]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
lalr1.cc: minor refactoring.
[bison.git] / ChangeLog
... / ...
CommitLineData
12010-05-04 Akim Demaille <demaille@gostai.com>
2
3 lalr1.cc: minor refactoring.
4 * data/lalr1.cc: Don't issue empty namespaces.
5
62010-05-04 Akim Demaille <demaille@gostai.com>
7
8 tests: fix %printer.
9 Currently, there is no check that %printer ... <foo> (nor
10 %destructor) is about an existing <foo> type. This C++ test had
11 it wrong (<::std::string> vs. <std::string>).
12
13 * tests/c++.at (AT_CHECK_VARIANTS): In list.yy, redefine the
14 pretty-printing of lists into something better for parser traces.
15 Update the expected output.
16 Fix correspondance between %type/%token and %printer.
17
182010-05-04 Akim Demaille <demaille@gostai.com>
19
20 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
21 * tests/calc.at (Span): Instead of begin/end, as in the built-in
22 location class, use first and last.
23 Define YYLLOC_DEFAULT to adjust to these changes.
24 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
25 location_type changes.
26
272010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
28
29 tests: fix maintainer-xml-check.
30 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
31 Update output to include comments now produced by --graph.
32 (xsl:template match="automaton"): As for --graph, name the
33 digraph after the grammar file.
34 * src/print-xml.c (escape_bufs): Enlarge array.
35 (print_xml): Add bug-report and url attributes to
36 bison-xml-report element.
37
382010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
39
40 In DOT output, convert from "/*" comments to "//" comments.
41 This handles the possibility that a "*/" might appear in
42 variable portions of those comments at some point in the future.
43 * src/graphviz.c (start_graph): Implement.
44
452010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
46
47 Document that undefined %prec identifier warnings will remain.
48 * NEWS (2.4.3): Here.
49 (2.4.2): Here.
50
512010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
52
53 Revert 2009-12-30 change for undefined %prec token complaints.
54 That is, keep them as warnings because that should be sufficient
55 to satisfy POSIX without creating backward compatibility issues.
56 Suggested by Richard Stallman at
57 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
58 * NEWS (2.5): Remove mention of complaint.
59 * src/reader.c (grammar_rule_check): Convert complaint back to
60 warning.
61 * tests/input.at (%prec's token must be defined): Update.
62
632010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
64
65 build: don't require src/bison during bootstrap.
66 Suggested by Eric Blake at
67 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
68 * bootstrap.conf (bootstrap_epilogue): New function to make sure
69 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
70
712010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
72
73 i18n: fix untranslatable string.
74 Reported by Goran Uddeborg at
75 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
76 * src/muscle-tab.c (muscle_percent_define_insert): Here.
77
782010-04-13 Akim Demaille <demaille@gostai.com>
79
80 tests: calc: minor refactoring.
81 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
82
832010-04-13 Akim Demaille <demaille@gostai.com>
84
85 tests: calc: simplify location management.
86 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
87 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
88 define the appropriate AT_LOC accessors.
89 * tests/calc.at: Use AT_LOC accessors.
90
912010-04-13 Akim Demaille <demaille@gostai.com>
92
93 test location_type.
94 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
95 Define AT_LOCATION_TYPE_IF.
96 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
97 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
98 used, provide a user location type and use it.
99 (Simple LALR1 C++ Calculator): Add a test case for location_type.
100
1012010-04-13 Akim Demaille <demaille@gostai.com>
102
103 tests: check fclose's return value.
104 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
105
1062010-04-13 Akim Demaille <demaille@gostai.com>
107
108 tests: don't depend on the actual location type.
109 * tests/calc.at: Use yy::parser::location_type rather than
110 yy::location, since the former is always right, and might point to
111 another type than the latter.
112
1132010-04-13 Akim Demaille <demaille@gostai.com>
114
115 formatting changes.
116 * tests/calc.at: Formatting changes.
117
1182010-04-13 Akim Demaille <demaille@gostai.com>
119
120 lalr1.cc: remove useless forward declaration.
121 * data/lalr1.cc: Include location.hh before stack.hh.
122 Remove the useless forward declarations of position and location.
123 Reported by Chris Morley.
124 * data/glr.cc: Likewise.
125
1262010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
127
128 * NEWS (2.4.3): Mention fix for Sun Studio C++.
129
1302010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
131
132 tests: fix for newer Sun Studio C++.
133 Reported by Dagobert Michelsen at
134 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
135 * THANKS (Dagobert Michelsen): Add.
136 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
137 Autoconf macro for handling the restrict keyword.
138 * gnulib: Update to latest, which no longer overrides that macro
139 from Autoconf.
140
1412010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
142
143 portability: fix pointer arithmetic to conform to C standard.
144 Reported by Tys Lefering at
145 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
146 This fix is already implemented in glr.c and does not apply to
147 lalr1.java.
148 * data/lalr1.cc (yy::parser::parse): Increase size of
149 yyerror_range and adjust subscripting so you don't have to
150 subtract one from the beginning of the array.
151 * data/yacc.c (b4_declare_parser_state_variables,
152 yyparse, yypush_parse): Likewise.
153
1542010-04-05 Akim Demaille <demaille@gostai.com>
155
156 remove useless include.
157 * src/graphviz.h: Don't include stdbool.h.
158
1592010-04-05 Akim Demaille <demaille@gostai.com>
160
161 graph: sign the output file.
162 * src/graphviz.c (start_graph): Issue comments about Bison.
163 Suggested by Tys Lefering.
164
1652010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
166
167 portability: fix test suite for GCC 4.5's new #error message.
168 Reported by Tys Lefering at
169 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
170 * NEWS (2.4.3): Mention.
171 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
172
1732010-03-30 Akim Demaille <demaille@gostai.com>
174
175 fix comments.
176 * src/graphviz.h: Add missing license notice.
177 Document.
178
1792010-03-25 Akim Demaille <demaille@gostai.com>
180
181 tests: fix 250: parse.error=verbose overflow.
182 * tests/regression.at (parse.error=verbose overflow): Avoid the
183 double inclusion of stdlib.h as it triggers hard errors.
184
1852010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
186
187 portability: fix for BSD make.
188 Reported by Johan van Selst at
189 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
190 * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in
191 this dependency list as in package.m4's target rule.
192
1932010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
194
195 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
196 Reported by Johan van Selst at
197 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
198 * NEWS (2.4.3): New.
199 * THANKS (Johan van Selst): Add.
200 * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
201 targets so that gnulib's new c++defs.h is matched.
202 * gnulib: Update to latest.
203
2042010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
205
206 maint: update for changes to gnulib's announce-gen.
207 * HACKING (Announce): RELEASE_TYPE=major must now be written
208 RELEASE_TYPE=stable.
209
2102010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
211
212 Version 2.4.2.
213 * NEWS (2.4.2): Set version and date. For the recent test suite
214 portability fixes, don't be so optimistic about their success
215 given the lack of feedback on the affected platforms.
216
2172010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
218
219 tests: fix maintainer-xml-check for recent changes.
220 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
221 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
222 output file whose name conflicts with a previous output file
223 is now never generated.
224
2252010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
226
227 portability: fix several issues with M4 subprocess.
228
229 M4's output pipe was not being drained upon fatal errors during
230 scan_skel. As a result, broken-pipe messages from M4 were seen
231 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
232 failure in the test suite. The problem was that, on platforms
233 where the default disposition for SIGPIPE is ignore instead of
234 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
235 then reported it. However, there's some sort of race condition,
236 because the new test group occasionally succeeded.
237 Reported by Albert Chin at
238 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
239
240 There were also problems with the test suite livelocking on
241 Tru64 5.1b. Reported by Didier Godefroy at
242 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
243 Switching to create_pipe_bidi suggested by Akim Demaille.
244
245 To attempt to solve both of these problems, switch to gnulib's
246 create_pipe_bidi and register M4 process as a slave. Along the
247 way, clean up file name conflict handling, which was affected by
248 the broken-pipe problem before the switch.
249 * NEWS (2.4.2): Document.
250 * THANKS (Didier Godefroy): Add.
251 * bootstrap.conf (gnulib_modules): Add pipe.
252 * gnulib: Update to latest to make sure we have all the latest
253 fixes.
254 * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and
255 subpipe.c.
256 * po/POTFILES.in (lib/subpipe.c): Remove.
257 * src/files.c (compute_output_file_names): Update invocations
258 of output_file_name_check.
259 (output_file_name_check): In the case that the grammar file
260 would be overwritten, use complain instead of fatal, but replace
261 the output file name with /dev/null. Use the /dev/null solution
262 for the case of two conflicting output files as well because it
263 seems safer in case Bison one day tries to open both files at
264 the same time.
265 * src/files.h (output_file_name_check): Update prototype.
266 * src/output.c (output_skeleton): Use create_pipe_bidi and
267 wait_subprocess. Assert that scan_skel completely drains the
268 pipe.
269 * src/scan-skel.l (at_directive_perform): Update
270 output_file_name_check invocation.
271 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
272 grammar file actually isn't overwritten.
273 (Conflicting output files: -o foo.y): Update expected output.
274 * tests/skeletons.at (Fatal errors but M4 continues producing
275 output): New test group.
276
2772010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
278
279 Update POTFILES.
280 * HACKING (Release Procedure): Add reminder about keeping
281 POTFILES files up-to-date.
282 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
283
2842010-02-01 Joel E. Denny <jdenny@clemson.edu>
285
286 Code cleanup.
287 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
288 which is already defined in atconfig.
289
2902010-01-22 Joel E. Denny <jdenny@clemson.edu>
291
292 tests: fix missing include caught by g++ 4.4.1.
293 Reported by Tys Lefering.
294 * HACKING (Release checks): Add note about trying a recent GCC.
295 * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include
296 cstdlib for abort.
297 (_AT_DATA_EXPECT2_Y): Likewise.
298
2992010-01-21 Joel E. Denny <jdenny@clemson.edu>
300
301 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
302
3032010-01-21 Joel E. Denny <jdenny@clemson.edu>
304
305 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
306 * HACKING (Release Procedure): Update notes on copyright years.
307 * Makefile.am (update-package-copyright-year): New target rule.
308 * build-aux/update-package-copyright-year: New file.
309 * cfg.mk (update-copyright): Add update-package-copyright-year
310 as a dependency.
311
3122010-01-19 Joel E. Denny <jdenny@clemson.edu>
313
314 * bootstrap: Import improvements from latest gnulib.
315
3162010-01-19 Joel E. Denny <jdenny@clemson.edu>
317
318 build: require Automake 1.11.1 to avoid a security flaw.
319 * HACKING (Release Procedure): Don't document Automake security
320 flaw here.
321 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
322 why here.
323
3242010-01-19 Joel E. Denny <jdenny@clemson.edu>
325
326 gnulib: update to latest.
327
3282010-01-19 Joel E. Denny <jdenny@clemson.edu>
329
330 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
331
3322010-01-15 Joel E. Denny <jdenny@clemson.edu>
333
334 Thank the developer of the initial push parser implementation.
335 This unfortunate oversight is several years old.
336 * THANKS (Odd Arild Olsen): Add.
337
3382010-01-04 Joel E. Denny <jdenny@clemson.edu>
339
340 Fix some comments concerning LR(0) versus LALR(1).
341
342 Stop equating LR(0) with nondeterminism and LALR(1) with
343 determinism. That is, if all states are consistent, then LR(0)
344 tables are deterministic. On the other hand, LALR(1) tables
345 might be nondeterministic before conflict resolution, and GLR
346 permits LALR(1) tables to remain nondeterministic.
347 * src/LR0.c, src/LR0.h: Here.
348 * src/lalr.c, src/lalr.h: Here.
349 * src/main.c (main): Here.
350 * src/state.c, src/state.h: Here.
351
352 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
353 parser tables.
354
3552010-01-04 Joel E. Denny <jdenny@clemson.edu>
356
357 maint: run "make update-copyright"
358
3592009-12-30 Joel E. Denny <jdenny@clemson.edu>
360
361 POSIX: complain if %prec's token was not defined.
362 * NEWS (2.5): Document.
363 * src/reader.c (grammar_rule_check): Convert warning to
364 complaint.
365 * tests/input.at (%prec's token must be defined): Update.
366
3672009-12-30 Joel E. Denny <jdenny@clemson.edu>
368
369 POSIX: warn if %prec's token was not defined.
370 Reported by Florian Krohm at
371 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
372 * NEWS (2.4.2): Document.
373 * src/reader.c (grammar_rule_check): Implement.
374 (grammar_current_rule_prec_set): Add comments explaining that we
375 here assume a %prec identifier is a token, but we still manage
376 to support POSIX.
377 * tests/input.at (%prec's token must be defined): New test
378 group.
379
3802009-12-31 Joel E. Denny <jdenny@clemson.edu>
381
382 * HACKING (Release Procedure): Recommend a secure automake.
383
3842009-12-29 Joel E. Denny <jdenny@clemson.edu>
385
386 portability: `<' and `>' are not always defined on addresses.
387 Specifically, don't sort objects by their memory addresses when
388 they're not allocated in the same array or other object. Though
389 I haven't found a test case where that fails on my platform, C
390 says the behavior is undefined.
391 * src/AnnotationList.c (AnnotationList__insertInto): Remove
392 FIXME. Use new id field of InadequacyList nodes rather than
393 their memory addresses when sorting.
394 (AnnotationList__compute_from_inadequacies): Add
395 inadequacy_list_node_count argument to pass to
396 InadequacyList__new_conflict.
397 * src/AnnotationList.h
398 (AnnotationList__compute_from_inadequacies): Update prototype
399 and documentation for new argument.
400 * src/InadequacyList.c (InadequacyList__new_conflict): Add
401 node_count argument and use it to assign a unique ID.
402 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
403 (InadequacyList): Add id field.
404 (InadequacyList__new_conflict): Update prototype and
405 documentation for new argument.
406 * src/ielr.c (ielr_compute_annotation_lists): Update
407 AnnotationList__compute_from_inadequacies invocation.
408
4092009-12-20 Joel E. Denny <jdenny@clemson.edu>
410
411 Fix handling of yychar manipulation in user semantic actions.
412 The problem was that yacc.c didn't always update the yychar
413 translation afterwards. However, other skeletons appear to be
414 fine. glr.c appears to already translate yychar before every
415 use. lalr1.cc does not define yychar and does not document its
416 replacement, yyla, for users. It does provide yyclearin, but
417 that does not manipulate yyla and thus requires no translation
418 update. In lalr1.java, yychar is out of scope during semantic
419 actions.
420 * NEWS (2.5): Document.
421 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
422 yytoken here.
423 (yyparse, yypush_parse): Instead, translate before every use of
424 yytoken, and add comments explaining this approach.
425 * tests/actions.at (Destroying lookahead assigned by semantic
426 action): New test group checking that translation happens before
427 lookahead destructor calls at parser return. Previously,
428 incorrect destructors were called.
429 * tests/conflicts.at (parse.error=verbose and consistent
430 errors): New test group checking that translation happens at
431 syntax error detection before the associated verbose error
432 message and the associated lookahead destructor calls. While
433 the destructor call is fixed by this patch, the verbose error
434 message is currently incorrect due to another bug (see
435 comments in test group), so this is an expected failure for now.
436
4372009-12-21 Joel E. Denny <jdenny@clemson.edu>
438
439 YYFAIL: warn about uses and remove from lalr1.java.
440 * NEWS (2.5): Document.
441 * data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
442 and make it private. Update all uses.
443 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
444
4452009-12-21 Joel E. Denny <jdenny@clemson.edu>
446
447 YYFAIL: deprecate.
448 * NEWS (2.4.2): Document deprecation and the phase-out plan.
449 * data/lalr1.java (parser::YYStack::YYFAIL): Add comment about
450 deprecation.
451 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
452 YYFAIL from GCC cpp's -Wunused-macros.
453 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
454 documentation.
455 (LocalWords): Remove YYFAIL.
456
4572009-12-20 Joel E. Denny <jdenny@clemson.edu>
458
459 tests: cleanup.
460 * tests/c++.at (Syntax error discarding no lookahead): Don't
461 ignore stderr. Instead, eliminate remaining warnings.
462
4632009-12-18 Joel E. Denny <jdenny@clemson.edu>
464
465 lalr1.cc: don't discard non-existent lookahead on syntax error.
466 * data/lalr1.cc (parser::parse): Check yyempty first.
467 * tests/c++.at (Syntax error discarding no lookahead): New test
468 group.
469
4702009-12-17 Joel E. Denny <jdenny@clemson.edu>
471
472 Code cleanup.
473 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
474 function, which is no longer used.
475
4762009-12-16 Joel E. Denny <jdenny@clemson.edu>
477
478 Add gcc's -Wundef to test suite and fix another warning from it.
479 * NEWS (2.4.2): Update description of -Wundef fix.
480 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
481 (WARN_CFLAGS_TEST): New substitution.
482 * data/glr.c: Avoid warning about __STRICT_ANSI__.
483 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
484 WARN_CFLAGS.
485 (NO_WERROR_CFLAGS): Likewise.
486 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
487
4882009-12-16 Joel E. Denny <jdenny@clemson.edu>
489
490 * data/yacc.c: Reformat m4 a little.
491
4922009-12-16 Joel E. Denny <jdenny@clemson.edu>
493
494 Document gcc -Wundef fix.
495 * NEWS (2.4.2): Here.
496 * THANKS (Jonathan Nieder): Add.
497
4982009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
499
500 Simplify y.tab.c when location tracking is disabled.
501 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
502 tracking is not enabled. Instead, unconditionally define
503 YY_LOCATION_PRINT as a no-op for backward compatibility.
504
5052009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
506
507 Avoid warnings from gcc -Wundef y.tab.c.
508 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
509 defined before using them.
510 * data/lalr1.cc: Likewise.
511 * data/yacc.c: Likewise.
512
5132009-12-15 Joel E. Denny <jdenny@clemson.edu>
514
515 autoconf: update to latest for fix of M4 detection.
516 Reported by Eric Blake.
517 * submodules/autoconf: Update.
518
5192009-12-15 Joel E. Denny <jdenny@clemson.edu>
520
521 portability: use -DGNULIB_POSIXCHECK.
522 Reported by Eric Blake. See discussions at
523 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
524 and
525 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
526 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
527 * bootstrap.conf (gnulib_modules): Add all the printf modules
528 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
529 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
530 (excluded_files): Remove m4/printf-posix.m4.
531 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
532 lib/libbison.a so gnulib libraries can be linked.
533
5342009-12-15 Joel E. Denny <jdenny@clemson.edu>
535
536 gnulib: update for fix of fprintf-posix, which we'll use soon.
537 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
538 targets so that gnulib's new arg-nonnull.h and link-warning.h
539 are matched.
540 * gnulib: Update.
541
5422009-12-14 Joel E. Denny <jdenny@clemson.edu>
543
544 Enable assertion output and --disable-assert for configure.
545 * bootstrap.conf (gnulib_modules): Add assert module.
546 * src/system.h (aver): Define as assert, and summarize the
547 discussion on this issue.
548
5492009-12-14 Joel E. Denny <jdenny@clemson.edu>
550
551 Expand GLR acronym in summary of Bison.
552 Based on discussion with Akim Demaille starting at
553 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
554 * doc/bison.texinfo (Introduction): Here.
555 * src/getargs.c (usage): Here.
556
5572009-10-03 Alex Rozenman <rozenman@gmail.com>
558
559 Document named references.
560 * doc/bison.texinfo (Actions): Add new example and xref to
561 Using Named References node.
562 (Using Named References): New node.
563
5642009-10-16 Joel E. Denny <jdenny@clemson.edu>
565
566 cleanup.
567 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
568 of char*.
569 (Sbitset__isEmpty): Use Sbitset instead of char*.
570 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
571 instead of char. This helps to avoid casting errors.
572 (Sbitset__or): Use Sbitset instead of char*.
573
5742009-10-16 Joel E. Denny <jdenny@clemson.edu>
575
576 portability: don't assume 8-bit bytes.
577 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
578 * src/Sbitset.h (Sbitset__nbytes): Here.
579 (Sbitset__byteAddress): Here.
580 (Sbitset__bit_mask): Here.
581 (Sbitset__last_byte_mask): Here.
582 (Sbitset__ones): Here.
583 (SBITSET__FOR_EACH): Here.
584
5852009-10-11 Joel E. Denny <jdenny@clemson.edu>
586
587 portability: use va_start and va_end in the same function.
588 * src/complain.c (error_message): Move va_end from here...
589 (ERROR_MESSAGE): ... to here.
590
5912009-10-08 Joel E. Denny <jdenny@clemson.edu>
592
593 * data/bison.m4: Update comments for rename to muscle-tab.h.
594
5952009-10-07 Joel E. Denny <jdenny@clemson.edu>
596
597 Minor code cleanup.
598 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
599 replace all uses with UNIQSTR_CONCAT.
600 * src/uniqstr.c (uniqstr_vsprintf): New function.
601 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
602 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
603 macros.
604
6052009-10-06 Joel E. Denny <jdenny@clemson.edu>
606
607 * TODO (Complaint submessage indentation): New.
608
6092009-10-04 Joel E. Denny <jdenny@clemson.edu>
610
611 Minor code cleanup.
612 * src/parse-gram.y: Clean up sorting of declarations.
613 Use types to simplify %printer declarations where possible.
614 Provide %printer for BRACKETED_ID and symbol.prec.
615 * src/symtab.c: Whitespace change.
616
6172009-10-04 Joel E. Denny <jdenny@clemson.edu>
618
619 tests: skip tests of file names that platform does not support.
620 Reported by Michael Raskin at
621 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
622 * THANKS (Michael Raskin): Add.
623 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
624 to fail at least for file names containing ":" or "\".
625
6262009-09-23 Joel E. Denny <jdenny@clemson.edu>
627
628 yysyntax_error: avoid duplicate lookahead collection.
629 Except when memory reallocation is required, this change
630 eliminates the need to invoke yysyntax_error twice and thus to
631 repeat the collection of lookaheads. It also prepares for
632 future extensions that will make those repetitions more
633 expensive and that will require additional memory management in
634 yysyntax_error. Finally, it fixes an obscure bug already
635 exercised in the test suite.
636 * data/yacc.c (yysyntax_error): Add arguments for message
637 buffer variables stored in the parser. Instead of size, return
638 status similar to yyparse status but indicating success of
639 message creation. Other than the actual reallocation of the
640 message buffer, import and clean up memory management code
641 from...
642 (yyparse, yypush_parse): ... here.
643 * tests/regression.at (parse.error=verbose overflow): No longer
644 an expected failure.
645
6462009-09-23 Joel E. Denny <jdenny@clemson.edu>
647
648 yysyntax_error: test memory management more.
649 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
650 * tests/regression.at (parse.error=verbose and
651 YYSTACK_USE_ALLOCA): New test group.
652 (parse.error=verbose overflow): New test group that reveals an
653 obscure bug. Expected fail for now.
654
6552009-10-04 Joel E. Denny <jdenny@clemson.edu>
656
657 benchmarks: use %debug consistently among grammars.
658 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
659 %debug by default. It can affect the timings even if yydebug=0.
660 (generate_grammar_calc): For consistency with other grammars,
661 use YYDEBUG environment variable to set yydebug.
662
6632009-10-03 Joel E. Denny <jdenny@clemson.edu>
664
665 Remove dead code.
666 * src/symtab.c (symbol_pack): Here because every symbol's number
667 is always defined by this time.
668
6692009-10-03 Alex Rozenman <rozenman@gmail.com>
670
671 Add additional space after periods in NEWS.
672 * NEWS (2.5): here.
673
6742009-09-29 Joel E. Denny <jdenny@clemson.edu>
675
676 Use the correct conversion specifier for size_t.
677 Reported by Jim Meyering.
678 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
679 because Sbitset__Index is size_t.
680 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
681
6822009-09-27 Joel E. Denny <jdenny@clemson.edu>
683
684 tests: don't abuse AT_BISON_CHECK.
685 * tests/regression.at (parse-gram.y: LALR = IELR): Move
686 additional shell commands outside of AT_BISON_CHECK.
687
6882009-09-26 Joel E. Denny <jdenny@clemson.edu>
689
690 tests: check that parse-gram.y's IELR and LALR are identical.
691 * tests/atlocal.in (abs_top_srcdir): New shell variable.
692 * tests/regression.at (parse-gram.y: LALR = IELR): New test
693 group.
694
6952009-09-19 Alex Rozenman <rozenman@gmail.com>
696
697 Keep sub-messages aligned. Fix strings for translation.
698 * src/location.h (location_print): Add return value.
699 * src/location.c (location_print): Return number of printed
700 characters.
701 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
702 new functions.
703 * src/complain.cpp (indent_ptr): New static variable.
704 (error_message, complain_at_indent, warn_at_indent): Implement
705 the alignment mechanism.
706 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
707 for translations. Use new alignment mechanism.
708 * tests/named-ref.at: Adjust test-cases.
709 * NEWS (2.5): Add an announcement about named references.
710
7112009-09-17 Akim Demaille <demaille@gostai.com>
712
713 doc: fixes.
714 * doc/bison.texinfo: here.
715 Reported by Alex Rozenman.
716
7172009-09-16 Akim Demaille <demaille@gostai.com>
718
719 doc: lalr1.cc and variants.
720 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
721 "variant" %define variables.
722 (C++ Semantic Values): Split into...
723 (C++ Unions, C++ Variants): these.
724 The latter is new.
725 (C++ Parser Interface): Fix type names.
726 Document parser::syntax_error.
727 Document the fact that locations are not mandatory.
728 (C++ Scanner Interface): Split into...
729 (Split Symbols, Complete Symbols): these.
730 The later is new.
731 (Calc++ Parsing Driver): Use variants.
732 Add more comments.
733 Adjust style.
734 (Calc++ Parser): Declare all the tokens, no
735 longer accept raw characters.
736 Remove %union.
737 Adjust types and printers.
738 Remove destructors.
739 (Calc++ Scanner): Use make_<SYMBOL> functions.
740 Use strerror in error message.
741
7422009-09-16 Akim Demaille <demaille@gostai.com>
743
744 doc: spell checking.
745 * doc/bison.texinfo: here.
746
7472009-09-16 Akim Demaille <demaille@gostai.com>
748
749 doc: comment changes.
750 * doc/bison.texinfo: Comment changes.
751
7522009-09-16 Akim Demaille <demaille@gostai.com>
753
754 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
755 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
756 constructor to take a token_type instead of the (internal) symbol
757 number.
758 Call yytranslate_.
759 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
760 don't call yytranslate_ here.
761
7622009-09-16 Akim Demaille <demaille@gostai.com>
763
764 TODO: statistics.
765 * TODO (Figures): New.
766
7672009-09-13 Joel E. Denny <jdenny@clemson.edu>
768
769 tests: clean up push.at test group titles.
770 * tests/push.at: Remove "Push Parsing: " from test group titles
771 because these are already under the banner "Push Parsing Tests".
772
7732009-09-12 Alex Rozenman <rozenman@gmail.com>
774
775 Provide an additional sub-message for clarity.
776 Add "symbol not found in production" error message when
777 an "invalid reference" is detected in named references
778 resolution.
779 * src/scan-code.l: Update "invalid reference" case.
780 * tests/named-ref.at: Adjust test-cases.
781
7822009-09-10 Joel E. Denny <jdenny@clemson.edu>
783
784 Clean up yacc.c a little.
785 * data/yacc.c: Clean up M4 for readability, and make output
786 whitespace more consistent. For the main parse function
787 comment, instead of saying "yyparse or yypush_parse", say either
788 "yyparse" or "yypush_parse" depending on which it actually is.
789
7902009-09-10 Joel E. Denny <jdenny@clemson.edu>
791
792 Fix --enable-gcc-warnings.
793 * src/parse-gram.y (%printer <param>): Handle param_none.
794
7952009-09-09 Akim Demaille <demaille@gostai.com>
796
797 lalr1.cc: syntax_error as exceptions.
798 It is common to use sort of factories in the user actions. These
799 factories may check some "syntactic" constraints that are not
800 enforced by the grammar itself. This is possible using YYERROR
801 within the action itself. Provide the user with a means to throw
802 a syntax_error exception.
803
804 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
805 Declare and define yy::parser::syntax_error.
806 * data/lalr1.cc: Include stdexcept.
807 (yy::parser::parse): Wrap the user action within a try/catch.
808 * data/glr.cc: Include stdexcept.
809
8102009-09-09 Akim Demaille <demaille@gostai.com>
811
812 lalr1.cc: add missing "inline".
813 * data/c++.m4 (b4_public_types_define): Add missing inline to
814 implementations provided in headers.
815
8162009-09-09 Akim Demaille <demaille@gostai.com>
817
818 %param: documentation.
819 * NEWS (2.6): Document %param, %lex-param, and %parse-param
820 changes.
821 * doc/bison.texinfo: Document that %lex-param and %parse-param
822 are n-ary.
823 Changes some examples to demonstrate it.
824 (Calc++ Parser): Use %param.
825
8262009-09-09 Akim Demaille <demaille@gostai.com>
827
828 Regen.
829
8302009-09-09 Akim Demaille <demaille@gostai.com>
831
832 style changes.
833 * src/parse-gram.y (add_param): Scope changes.
834
8352009-09-09 Akim Demaille <demaille@gostai.com>
836
837 %parse: support several arguments.
838 * src/parse-gram.y (current_param): New.
839 (param_type): Add param_none.
840 (params): New nonterminal.
841 Use it.
842
8432009-09-09 Akim Demaille <demaille@gostai.com>
844
845 Regen.
846
8472009-09-09 Akim Demaille <demaille@gostai.com>
848
849 %param.
850 Provide a means to factor lex-param and parse-param common
851 declarations.
852
853 * src/parse-gram.y (param_type): New.
854 Define a %printer for it.
855 (add_param): Use it.
856 (%parse-param, %lex-param): Merge into...
857 (%parse): this new token.
858 Adjust the grammar to use it.
859 * src/scan-gram.l (RETURN_VALUE): New.
860 (RETURN_PERCENT_FLAG): Use it.
861 (RETURN_PERCENT_PARAM): New.
862 Use it to support %parse-param, %lex-param and %param.
863
8642009-09-03 Joel E. Denny <jdenny@clemson.edu>
865
866 Use aver not assert.
867 * src/output.c: Don't include assert.h.
868 (output_skeleton): Use aver not assert.
869 * src/system.h (aver): In documentation of why, add links to
870 Paul Eggert's explanations in the mailing lists.
871
8722009-09-05 Alex Rozenman <rozenman@gmail.com>
873
874 Use "Unresolved reference" error message when no symbols were found
875 in a symbolic reference resolution. Remove .expr and -expr from
876 the shown reference when the reference is unresolved.
877 * src/scan-code.l: Change the error message, adjust location columns,
878 rename variable "exact_mode" to "explicit_bracketing".
879 * tests/named-ref.at: Adjust existing tests and add a new one.
880
8812009-09-04 Akim Demaille <demaille@gostai.com>
882
883 Adjust synclines in src/parse-gram.[ch].
884 * tests/bison.in: Do some magic (including working around issues
885 with ylwrap) when this wrapper is used to compile
886 src/parse-gram.y.
887
8882009-09-03 Joel E. Denny <jdenny@clemson.edu>
889
890 Complain about unused %define variables and %code qualifiers.
891 * NEWS (2.5): Document.
892 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
893 * doc/bison.texinfo (Decl Summary): Document complaint, and
894 improve %define documentation a little otherwise.
895 * tests/input.at (Reject unused %code qualifiers): Update.
896 (%define errors): Update.
897 (%define, --define, --force-define): Update.
898 (%define backward compatibility): Update.
899 (Unused %define api.pure): Update.
900 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
901
9022009-09-03 Joel E. Denny <jdenny@clemson.edu>
903
904 Don't suppress warnings about unused parse.error.
905 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
906 %define variable parse.error unless b4_error_verbose_flag is
907 actually expanded in a skeleton.
908
9092009-09-03 Akim Demaille <demaille@gostai.com>
910
911 * NEWS (2.4.2): Add "Internationalization" item.
912
9132009-09-03 Akim Demaille <demaille@gostai.com>
914
915 bootstrap: fix/improve find_tool.
916 * bootstrap (find_tool): Improve error messages.
917 Fix typo about find_tool_names.
918
9192009-08-29 Joel E. Denny <jdenny@clemson.edu>
920
921 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
922 See
923 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
924 * src/scan-code.h (code_props_rule_action_init): Rename
925 named_ref arg to name so it doesn't shadow named_ref type. This
926 makes it consistent with the function definition in scan-code.l
927 anyway.
928
9292009-08-28 Joel E. Denny <jdenny@clemson.edu>
930
931 %define: accept unquoted values.
932 * NEWS (2.5): Group all %define changes together, and document
933 this one. Remove quotes in IELR and canonical LR entry.
934 * doc/bison.texinfo: Remove quotes in most examples throughout.
935 (Decl Summary): Update %define documentation.
936 (Table of Symbols): Likewise.
937 * src/ielr.c (LrType): Update documentation.
938 * src/parse-gram.y (content.opt): Add production for ID.
939 * tests/actions.at: Remove quotes in most tests.
940 * tests/calc.at: Likewise.
941 * tests/existing.at: Likewise.
942 * tests/input.at: Likewise.
943 * tests/local.at: Likewise.
944 * tests/push.at: Likewise.
945 * tests/reduce.at: Likewise.
946 * tests/torture.at: Likewise.
947
9482009-08-28 Joel E. Denny <jdenny@clemson.edu>
949
950 %define lr.type: make values lowercase IDs.
951 That is, "LALR" => "lalr", "IELR" => "ielr", and
952 "canonical LR" => "canonical-lr".
953 * NEWS (2.5): Update documentation.
954 * doc/bison.texinfo (Decl Summary): Likewise.
955 * src/ielr.c (ielr): Use new values.
956 * src/ielr.h (ielr): Update documentation.
957 * src/reader.c (prepare_percent_define_front_end_variables): Use
958 and validate new values.
959 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
960 grammars.
961 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
962
9632009-08-27 Eric Blake <ebb9@byu.net>
964
965 scan-gram: avoid portability trap with ctype usage.
966 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
967 Avoid compiler warning.
968
9692009-08-27 Joel E. Denny <jdenny@clemson.edu>
970
971 tests: use perl for printing special sequences to files.
972 And skip tests if perl is not available. This is better than
973 playing tricks with shell portability. Suggested by Akim
974 Demaille.
975 * tests/input.at (Bad character literals): Use it here for
976 omitting final newlines.
977 (Bad escapes in literals): Use it here for special characters.
978
9792009-08-26 Joel E. Denny <jdenny@clemson.edu>
980
981 tests: show a use of %define lr.default-reductions "consistent"
982 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
983 prevents the omission of expected tokens for %error-verbose.
984
9852009-08-26 Akim Demaille <demaille@gostai.com>
986
987 tests: portability fix.
988 * tests/input.at (Bad escapes in literals): Don't expect "echo
989 '\0'" to output \ then 0.
990
9912009-08-26 Joel E. Denny <jdenny@clemson.edu>
992
993 Actually handle the yytable zero value correctly this time.
994 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
995 zero values in the YYTABLE comments.
996 * data/glr.c (yytable_value_is_error): Don't check for zero
997 value.
998 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
999 * data/yacc.c (yytable_value_is_error): Likewise.
1000 * data/lalr1.java (yy_table_value_is_error_): Likewise.
1001 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
1002 * src/tables.h: In header comments, explain why it's useless to
1003 check for a zero value in yytable.
1004
10052009-08-25 Joel E. Denny <jdenny@clemson.edu>
1006
1007 More fixes related to last two patches.
1008 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
1009 comments: zero indicates syntax error not default action.
1010 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
1011 defined.
1012 * data/glr.c (yyis_pact_ninf): Rename to...
1013 (yypact_value_is_default): ... this.
1014 (yyisDefaultedState): Update for rename.
1015 (yyis_table_ninf): Rename to...
1016 (yytable_value_is_error): ... this, and check for value zero
1017 besides just YYTABLE_NINF.
1018 (yygetLRActions): Check for default value from yypact. It
1019 appears that this check is always performed before this function
1020 is invoked, and so adding the check here is probably redundant.
1021 However, the code may evolve after this subtlety is forgotten.
1022 Also, update for rename to yytable_value_is_error. Because that
1023 macro now checks for zero, a different but equivalent branch of
1024 the if-then-else here is evaluated.
1025 (yyreportSyntaxError): Update for rename to
1026 yytable_value_is_error. The zero condition was mishandled
1027 before.
1028 (yyrecoverSyntaxError): Update for renames. No behavioral
1029 changes.
1030 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1031 New function.
1032 (yy_table_value_is_error_): New function.
1033 (parse): Use new functions where possible. No behavioral
1034 changes.
1035 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1036 The zero condition was mishandled before.
1037 * data/yacc.c (yyis_pact_ninf): Rename to...
1038 (yypact_value_is_default): ... this.
1039 (yyis_table_ninf): Rename to...
1040 (yytable_value_is_error): ... this, and check for value zero
1041 besides just YYTABLE_NINF.
1042 (yysyntax_error): Update for rename to yytable_value_is_error.
1043 The zero condition was mishandled before.
1044 (yyparse): Update for renames. No behavioral changes.
1045 * src/tables.h: Improve comments about yypact, yytable, etc.
1046 more. Most importantly, say yytable value of zero means syntax
1047 error not default action.
1048
10492009-08-25 Joel E. Denny <jdenny@clemson.edu>
1050
1051 Fix %error-verbose for conflicts resolved by %nonassoc.
1052 * NEWS (2.5): Document.
1053 * data/glr.c (yyreportSyntaxError): Fix this by checking
1054 yyis_table_ninf.
1055 * data/yacc.c (yysyntax_error): Likewise.
1056 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1057 yytable_ninf_.
1058 * data/lalr1.java (yysyntax_error): Likewise.
1059 * tests/conflicts.at (%nonassoc and eof): Update expected output
1060 and remove FIXME.
1061
10622009-08-25 Joel E. Denny <jdenny@clemson.edu>
1063
1064 Some code and documentation improvements.
1065 * data/c.m4 (b4_table_value_equals): New macro to capture
1066 some repeated code.
1067 * data/glr.c (yyis_pact_ninf): Use it here.
1068 (yyis_table_ninf): Likewise.
1069 (yyreportSyntaxError): Improve internal comments.
1070 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1071 Use it everywhere possible.
1072 (yyis_table_ninf): Likewise.
1073 (yysyntax_error): Improve internal comments.
1074 * data/lalr1.cc (yysyntax_error_): Likewise.
1075 * data/lalr1.java (yysyntax_error): Likewise.
1076 * src/tables.h: Improve comments about yypact, yytable, etc.
1077
10782009-08-21 Joel E. Denny <jdenny@clemson.edu>
1079
1080 Use locale when quoting.
1081 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1082 quote rather than implementing quoting here.
1083
10842009-08-20 Eric Blake <ebb9@byu.net>
1085
1086 Make previous patch more robust.
1087 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1088 argmatch.h.
1089 (output_skeleton): Use it.
1090 Suggested by Akim Demaille.
1091
1092 Import latest m4/m4.m4.
1093 * submodules/autoconf: Update to autoconf 2.64.
1094 * configure.ac (M4_GNU_OPTION): New define.
1095 * src/output.c (output_skeleton): Use it to resolve FIXME.
1096 * NEWS: Mention this.
1097
10982009-08-19 Joel E. Denny <jdenny@clemson.edu>
1099
1100 Fix complaints about escape sequences.
1101 Discussed starting at
1102 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1103 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1104 For a \0 and similar escape sequences meaning the null
1105 character, report an invalid escape sequence instead of an
1106 invalid null character because the latter does not actually
1107 appear in the user's input.
1108 In all escape sequence complaints, don't escape the initial
1109 backslash, and don't quote when the sequence appears at the end
1110 of the complaint line unless there's whitespace that quotearg
1111 won't escape.
1112 Consistently say "invalid" not "unrecognized".
1113 Consistently prefer "empty character literal" over "extra
1114 characters in character literal" warning for invalid escape
1115 sequences; that is, consistently discard those sequences.
1116 * tests/input.at (Bad escapes in literals): New.
1117
11182009-08-19 Akim Demaille <demaille@gostai.com>
1119
1120 doc: fixes.
1121 * doc/bison.texinfo: Fix minor Texinfo errors.
1122
11232009-08-19 Akim Demaille <demaille@gostai.com>
1124
1125 tests: distcc compliance.
1126 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
1127 error messages from the output.
1128
11292009-08-19 Akim Demaille <demaille@gostai.com>
1130
1131 variables: simplify the upgrade of namespace into api.namespace.
1132
1133 This patch simplifies "variables: rename namespace as
1134 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
1135 Suggested by Joel E. Denny in
1136 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
1137
1138 * src/muscle-tab.c (muscle_percent_variable_update): New.
1139 (muscle_percent_define_insert): Use it in replacement of the
1140 previous tr invocation.
1141 Remove variable_tr, no longer needed.
1142 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1143 Remove.
1144 * data/c++.m4: No longer handle namespace -> api.namespace.
1145 * tests/input.at (%define backward compatibility): Check that
1146 namespace is treated as api.namespace.
1147
11482009-08-19 Akim Demaille <demaille@gostai.com>
1149
1150 doc: %initial-action to initialize yylloc.
1151 Reported by Bill Allombert.
1152 * doc/bison.texinfo: Set fill-column to 76.
1153 (Location Type): Document the use of %initial-action to initialize
1154 yylloc.
1155
11562009-08-19 Akim Demaille <demaille@gostai.com>
1157
1158 lalr1.cc: use state_type.
1159 * data/lalr1.cc (yysyntax_error_): Use state_type.
1160 Move argument names into yy*.
1161
11622009-08-19 Akim Demaille <demaille@gostai.com>
1163
1164 lalr1.cc: get rid of yyparse's yystate.
1165 yystate and yystack_[0].state are equal, keep only the latter.
1166 The former was also used as a temporary variable to compute the
1167 post-reduction state. Move this computation into an auxiliary
1168 function.
1169
1170 * data/glr.c (yyLRgotoState): Fuse variable definition and first
1171 assignment.
1172 * data/lalr1.cc (yy_lr_goto_state_): New.
1173 (yyparse): Use it.
1174 Replace remaining uses of yystate by yystate_[0].state.
1175 Remove the former.
1176
11772009-08-19 Akim Demaille <demaille@gostai.com>
1178
1179 lalr1.cc: destroy $$ when YYERROR is called.
1180 * data/lalr1.cc (yyreduce): Compute the resulting state before
1181 running the user action so that yylhs is a valid symbol.
1182 (yyerrorlab): Since yylhs is complete (it knows its type), we can
1183 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
1184 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
1185
11862009-08-18 Joel E. Denny <jdenny@clemson.edu>
1187
1188 maint: update for gnulib's recent update-copyright changes
1189 * gnulib: Update.
1190 * .x-update-copyright (COPYING): Add as it's no longer implied
1191 when .x-update-copyright is present.
1192 * cfg.mk (update-copyright-local): Remove, now ignored.
1193 (update-copyright): Declare update-b4-copyright as a dependency.
1194
11952009-08-17 Akim Demaille <demaille@gostai.com>
1196
1197 build: require gettext 0.17.
1198
1199 Suggested by Bruno Haible.
1200 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1201 * configure.ac: require gettext 0.17 to ensure compatibility with
1202 gnulib.
1203
12042009-08-17 Akim Demaille <demaille@gostai.com>
1205
1206 build: lower gettext requirements.
1207
1208 Bison was uselessly requiring the formatstring macros from
1209 gettext, which resulted in mo files not being installed on systems
1210 that perfectly supported Bison mo files. Lower the requirement.
1211 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1212
1213 * configure.ac: Require need-ngettext instead of
1214 need-formatstring-macros.
1215 Reported by Martin Jabocs.
1216 Suggested by Bruno Haible.
1217 * INSTALL: Restructure.
1218 (Internationalization): New.
1219
12202009-08-14 Joel E. Denny <jdenny@clemson.edu>
1221
1222 maint: fix use of copyright year intervals.
1223 * gnulib: Update.
1224 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1225 as now recommended in gnulib/NEWS.
1226 * build-aux/update-b4-copyright: Fix.
1227 * cfg.mk (update-copyright-env): Configure update-copyright.
1228
12292009-08-13 Joel E. Denny <jdenny@clemson.edu>
1230
1231 Make it easier to write deterministic tests.
1232 Continues Akim's work from his 2009-06-10 commits.
1233 * src/reader.c (check_and_convert_grammar): Don't add any
1234 symbols after the first symbols_do invocation.
1235 * src/symtab.c (symbols_sorted): New static global.
1236 (user_token_number_redeclaration): Update comments.
1237 (symbol_from_uniqstr): If a new symbol is being created, assert
1238 that symbols_sorted hasn't been allocated yet.
1239 (symbols_free): Free symbols_sorted.
1240 (symbols_cmp, symbols_cmp_qsort): New functions.
1241 (symbols_do): Sort symbol_table into symbols_sorted on first
1242 invocation.
1243 * tests/input.at (Numbered tokens): Recombine tests now that the
1244 output should be deterministic across multiple numbers.
1245
12462009-08-12 Akim Demaille <demaille@gostai.com>
1247
1248 tests: GCC 4.5 compliance.
1249 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
1250 messages about #error.
1251
12522009-08-12 Akim Demaille <demaille@gostai.com>
1253
1254 build: fix the generation of the documentation.
1255 Some of our targets use "bison --help", but they can't depend on
1256 "bison" itself (to avoid additional requirements on the user), so
1257 they used to call "make src/bison" in the commands. Then
1258 concurrent builds may fail: one make might be aiming one of its
1259 jobs at compiling src/bison, and another job at generating the man
1260 page. If the latter is faster than the former, then we have two
1261 makes that concurrently try to compile src/bison.
1262
1263 This might also be a more convincing explanation for the failure
1264 described in the patch "build: fix paths".
1265
1266 * Makefile.am (SUFFIXES): Initialize.
1267 * build-aux/move-if-change: New, symlink to gnulib's.
1268 * build-aux/local.mk: Ship it.
1269 * doc/common.x: Remove, merged into...
1270 * doc/bison.x: here.
1271 * doc/local.mk (doc/bison.help): New.
1272 ($(CROSS_OPTIONS_TEXI)): Depend on it.
1273 Use src/bison.
1274 (.x.1): Replace with...
1275 (doc/bison.1): this explicit, simpler, target.
1276 (common_dep): Remove, inlined where appropriate.
1277 (SUFFIXES, PREPATH): Remove, unused.
1278
12792009-08-12 Akim Demaille <demaille@gostai.com>
1280
1281 gnulib: improve prefixing.
1282 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
1283 change the value of...
1284 (gl_LIBOBJS): this.
1285 Adjust more variables.
1286 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
1287 gl_LIBOBJS.
1288 (prefix): Also transform rules whose targets have slashes.
1289 Use $prefix liberally.
1290 Map @MKDIR_P@ to $(MKDIR_P).
1291 Prefix directories that are mkdir'd.
1292
12932009-08-12 Akim Demaille <demaille@gostai.com>
1294
1295 build: fix paths.
1296 When using $(top_builddir) inconsistently, Make (including GNU
1297 Make) is sometimes confused. As a result it may want to build
1298 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
1299 file, different names) concurrently, which, amusingly enough,
1300 might end with:
1301
1302 ranlib lib/libbison.a
1303 ranlib lib/libbison.a
1304 make[2]: *** [lib/libbison.a] Segmentation fault
1305
1306 on OS X.
1307
1308 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
1309 needed.
1310
13112009-08-12 Akim Demaille <demaille@gostai.com>
1312
1313 distcheck: fix.
1314
1315 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
1316
13172009-08-10 Joel E. Denny <jdenny@clemson.edu>
1318
1319 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
1320
13212009-08-10 Joel E. Denny <jdenny@clemson.edu>
1322
1323 Miscellaneous code readability improvements.
1324
1325 * src/reader.c (reader): Move %define front-end variable
1326 defaults and checking into...
1327 (prepare_percent_define_front_end_variables): ... this new
1328 function.
1329
1330 * src/scan-gram.l (INITIAL): For consistency with string
1331 literals, don't store open quote on character literal. It's
1332 discarded before returning anyway.
1333 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1334 Make length test more readable, and make the character stored
1335 for an empty literal more obvious while consistent with the
1336 previous behavior.
1337
1338 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1339 USER_NUMBER_HAS_STRING_ALIAS throughout.
1340 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1341 that is repeated in symtab.h. Improve argument names to make it
1342 clear which side of the symbol-string alias pair is which.
1343 (symbol_check_alias_consistency): Improve local variable names
1344 for the same purpose.
1345 * src/symtab.h (struct symbol): Make comments about aliases
1346 clearer.
1347 (symbol_make_alias): Improve comments and argument name.
1348 * src/output.c (token_definitions_output): Update for rename to
1349 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1350
13512009-08-08 Alex Rozenman <rozenman@gmail.com>
1352
1353 Convert "misleading reference" messages to warnings.
1354 * src/scan-code.l: New function 'show_sub_messages', more
1355 factoring.
1356 * tests/named-ref.at: Adjust tests.
1357
13582009-08-06 Joel E. Denny <jdenny@clemson.edu>
1359
1360 maint: run "make update-copyright"
1361
13622009-08-06 Joel E. Denny <jdenny@clemson.edu>
1363
1364 maint: make update-b4-copyright easier to use
1365 * build-aux/update-b4-copyright: In warnings, report line
1366 numbers rather than character positions.
1367 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1368 that update-copyright runs it.
1369 * gnulib: Update.
1370
13712009-08-05 Joel E. Denny <jdenny@clemson.edu>
1372
1373 maint: clean up update-b4-copyright code
1374 * build-aux/update-b4-copyright: Do not accept 2-digit
1375 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1376 Don't accept a `[' in a b4_copyright argument.
1377 Format code more consistently.
1378 Don't assume b4*copyright never occurs.
1379
13802009-08-04 Joel E. Denny <jdenny@clemson.edu>
1381
1382 maint: automate b4_copyright updates.
1383 * Makefile.am (update-b4-copyright): New target rule.
1384 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
1385 * build-aux/update-b4-copyright: New.
1386 * data/yacc.c: Remove stray characters around b4_copyright
1387 invocations.
1388
13892009-08-04 Joel E. Denny <jdenny@clemson.edu>
1390
1391 maint: automate annual package-wide copyright-year update.
1392 * .x-update-copyright: New.
1393 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1394 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1395 update-copyright. Remove gnumakefile, which is implied by
1396 maintainer-makefile.
1397 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1398 * gnulib: Update.
1399 * maint.mk: Remove, now copied from gnulib.
1400 * examples/extexi: Add missing "(C)" in copyright statement so
1401 update-copyright can recognize it.
1402 * src/LR0.h: Likewise.
1403 * src/print.h: Likewise.
1404 * src/print_graph.h: Likewise.
1405 * src/gram.c: Add missing comma in copyright statement.
1406 * src/gram.h: Likewise.
1407
14082009-08-04 Joel E. Denny <jdenny@clemson.edu>
1409
1410 Fix "make distcheck".
1411 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1412 of just calc.stamp.
1413
14142009-08-01 Joel E. Denny <jdenny@clemson.edu>
1415
1416 Pacify "gcc -Wunused" for the input function from Flex.
1417 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1418 and later.
1419 * src/scan-code.l: Add "%option noinput", which I cannot find in
1420 the Flex manual, but which Flex has supported since at least as
1421 far back as 2.5.4. However, if any of our developers still use
1422 Flex 2.5.4, they'll need to stop configuring with
1423 --enable-gcc-warnings because "%option noinput" didn't work
1424 correctly until Flex 2.5.6.
1425 * src/scan-gram.l: Likewise.
1426 * src/scan-skel.l: Likewise.
1427
14282009-07-31 Alex Rozenman <rozenman@gmail.com>
1429
1430 Fix --enable-gcc-warnings problems.
1431 * src/reader.c: Adjust variable names.
1432 * src/scan-code.l: Fix prototypes and adjust names.
1433 * src/named-ref.c: Remove redundant "if".
1434
14352009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1436
1437 Fix a --enable-gcc-warnings problem.
1438 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1439 variable.
1440
14412009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1442
1443 Warn about character literals not of length one.
1444 * NEWS (2.5): Document.
1445 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1446 the length.
1447 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1448 * tests/input.at (Bad character literals): New test group.
1449
14502009-07-24 Alex Rozenman <rozenman@gmail.com>
1451
1452 Fix some memory leaks.
1453 * src/named-ref.c: Add a pointer check (named_ref_free).
1454 * src/scan-code.l: New function (variant_table_free). Called in
1455 code_scanner_free.
1456 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1457
14582009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1459
1460 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1461
14622009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1463
1464 Some M4 cleanup in the testsuite.
1465 Suggested by Eric Blake at
1466 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1467 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1468 complicate the code by distinguishing between a missing value
1469 and an empty string value for an optional argument. This fix is
1470 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1471 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1472 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1473 arguments are not needed because of the following changes.
1474 Fix stale comments.
1475 Bison developers should use GNU M4 and should not use
1476 POSIXLY_CORRECT when building the test suite, so do not
1477 complicate the code by avoiding $10 and above.
1478 Do not quote an empty string value for an optional argument, and
1479 do not distinguish between a missing value and an empty string
1480 value.
1481
14822009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1483
1484 Revert unnecessary column realignment in --help output.
1485 Reported by Akim Demaille at
1486 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1487 * src/getargs.c (usage): Here.
1488
14892009-07-04 Alex Rozenman <rozenman@gmail.com>
1490
1491 Alphabetical order in src/local.mk.
1492 * src/local.mk: Adjust.
1493
14942009-07-04 Alex Rozenman <rozenman@gmail.com>
1495
1496 Style changes and factoring.
1497 * src/named-ref.h: Add comments.
1498 * src/parse-gram.y: Readability and style changes.
1499 * src/reader.c: Factoring: assign_named_ref function.
1500 * src/scan-code.l: Factoring and style changes. Rename
1501 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1502 Use "unsigned" type for variant index. Improve readablity.
1503 * src/scan-gram.l: Change error messages and add comments.
1504 * src/symlist.h: symbol_list_null: New function decl.
1505 * src/symlist.c: symbol_list_null: Implement here.
1506 * tests/named-refs.at: Adjust for new error messages.
1507
15082009-06-29 Eric Blake <ebb9@byu.net>
1509
1510 scan-code: avoid compiler warnings
1511 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1512
15132009-06-29 Akim Demaille <demaille@gostai.com>
1514
1515 build: avoid concurrent extraction of calc++.
1516 * examples/calc++/Makefile.am (calc.stamp): New.
1517 Depend on it to create the sources of calc++ so that concurrent
1518 builds don't launch several "extexi" in parallel.
1519 Not only this is inefficient, this also builds incorrect sources
1520 with several extractions mixed together.
1521
15222009-06-29 Akim Demaille <demaille@gostai.com>
1523
1524 parse.error: fix.
1525 * data/bison.m4: Move code related to specific variables after the
1526 definition of the variable-maintaining macros so that we don't
1527 "invoke" b4_percent_define_check_values before it is defined.
1528
15292009-06-29 Akim Demaille <demaille@gostai.com>
1530
1531 variables: parse.error
1532
1533 Implement, document, and test the replacement of %error-verbose
1534 by %define parse.error "verbose".
1535 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
1536 values of the parse.error variable.
1537 Make "simple" its default value.
1538 Check the valid values.
1539 * src/parse-gram.y: Use %define parse.error.
1540 (PERCENT_ERROR_VERBOSE): New token.
1541 Support it.
1542 * src/scan-gram.l: Support %error-verbose.
1543
1544 * doc/bison.texinfo (Decl Summary): Replace the documentation of
1545 %define error-verbose by that of %define parse.error.
1546 * NEWS: Document it.
1547
1548 * tests/actions.at, tests/calc.at: Use parse.error instead of
1549 %error-verbose.
1550
15512009-06-27 Alex Rozenman <rozenman@gmail.com>
1552
1553 Implement support for named symbol references.
1554 * src/parse-gram.y: Add new syntax (named_ref.opt).
1555 * src/reader.c: Store named refs in symbol lists.
1556 * src/reader.h: New argument for symbol_append and
1557 action_append functions.
1558 * src/scan-code.h: Add new field (named_ref) into
1559 code_props data structure. Keeps named ref of midrule
1560 actions.
1561 * src/scan-code.l: Support for named refs in semantic
1562 action code. New function 'parse_named_ref'.
1563 * src/scan-gram.l: Support bracketed id.
1564 * src/symlist.c: Store named refs in symbol lists.
1565 * src/symlist.h: New field in symbol list: named_ref.
1566 * src/named-ref.h: New file, a struct for named_ref.
1567 * src/named-ref.cp: New file, named_ref_new function.
1568 * src/local.mk: Add two new files.
1569 * tests/testsuite.at: Include new test group:
1570 * tests/named-refs.at: this new file.
1571
15722009-06-25 Akim Demaille <demaille@gostai.com>
1573
1574 hash: check insertion for memory exhaustion.
1575 * src/uniqstr.c (uniqstr_new): New.
1576
15772009-06-24 Akim Demaille <demaille@gostai.com>
1578
1579 variables: rename namespace as api.namespace.
1580 Discussed in
1581 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
1582
1583 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1584 New.
1585 (b4_percent_define_use): New.
1586 Use it where applicable.
1587 * data/c++.m4: Replace uses of the variable "namespace" by
1588 "api.namespace".
1589 Default the latter to the former.
1590 * doc/bison.texinfo (Decl Summary): Document "namespace" as
1591 obsolete.
1592 Document api.namespace.
1593 Use @samp to document %define uses, keep @code for identifiers.
1594 * NEWS: Likewise.
1595 * tests/c++.at, tests/input.at: Test api.namespace instead of
1596 namespace. (The tests passed with namespace.)
1597
15982009-06-11 Akim Demaille <demaille@gostai.com>
1599
1600 style changes.
1601 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1602 * src/print-xml.c: Style changes.
1603 * tests/conflicts.at: Comment changes.
1604
16052009-06-11 Akim Demaille <demaille@gostai.com>
1606
1607 xml: beware of user strings used to give a %prec to rules.
1608 * tests/conflicts.at (%prec with user strings): New.
1609 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1610 XML output.
1611
16122009-06-11 Akim Demaille <demaille@gostai.com>
1613
1614 hash: check insertion for memory exhaustion.
1615 * src/muscle-tab.c (muscle_insert, muscle_grow)
1616 * src/state.c (state_hash_insert): Check the return value of
1617 hash_insert.
1618
16192009-06-11 Akim Demaille <demaille@gostai.com>
1620
1621 tests: honor TESTSUITEFLAGS in every check target.
1622 * tests/local.mk (RUN_TESTSUITE): New.
1623 (check-local, installcheck-local, maintainer-check-g++)
1624 (maintainer-check-posix, maintainer-check-valgrind): Use it.
1625
16262009-06-10 Akim Demaille <demaille@gostai.com>
1627
1628 deterministic test suite.
1629 Some consistency checks on symbols are performed after all the
1630 symbols were read, by an iteration over the symbol table. This
1631 traversal is nondeterministic, which can be a problem for test
1632 cases.
1633 Avoid this.
1634 Addresses another form of nondeterminism reported by Joel E. Denny.
1635 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1636
1637 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1638 test in two.
1639 Use different file names for the three tests to make the
1640 maintenance easier.
1641
16422009-06-10 Akim Demaille <demaille@gostai.com>
1643
1644 gnulib: update.
1645 * gnulib: Update to latest.
1646 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1647 * m4/.gitignore: Regen.
1648 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1649 Call xalloc_die on hash_insert failures.
1650 Requested by the new __warn_unused_result__ attribute of
1651 hash_insert.
1652
16532009-06-10 Akim Demaille <demaille@gostai.com>
1654
1655 deterministic user-token-number redeclaration errors.
1656 Address nondeterminism reported by Joel E. Denny.
1657 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1658
1659 * src/uniqstr.h: Comment changes.
1660 * src/location.h (boundary_cmp, location_cmp): New.
1661 * src/symtab.c (user_token_number_redeclaration): New.
1662 (symbol_translation): Use it.
1663 * tests/input.at (Numbered tokens): Adjust the expected output.
1664
16652009-05-25 Akim Demaille <demaille@gostai.com>
1666
1667 build: avoid ignored errors.
1668 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
1669 errors, they pollute the output.
1670
16712009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1672
1673 Convert multiple variable definition warnings to complaints.
1674 * NEWS (2.5): Add a new entry for that change.
1675 * doc/bison.texinfo (Decl Summary): Update %define entry.
1676 (Bison Options): Update -D/--define/-F/--force-define entry.
1677 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
1678 * src/muscle-tab.h (muscle_percent_define_insert): Update
1679 comments.
1680 * tests/input.at (`%define errors'): Update.
1681 (`%define, --define, --force-define'): Update.
1682
16832009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1684
1685 -F/--force-define and relative %define/-D/--define priorities.
1686 * NEWS (2.5): Add documentation to -D/--define entry.
1687 * build-aux/cross-options.pl: Hard-code association of
1688 --force-define with %define.
1689 * doc/bison.texinfo (Decl Summary): In %define entry,
1690 cross-reference command-line options.
1691 (Bison Options): Add documentation to -D/--define entry.
1692 (Option Cross Key): Widen column for --force-define row.
1693 * src/getargs.c (usage): Document -F/--force-define. Realign
1694 options in output.
1695 (short_options, long_options, getargs): Parse -F/--force-define,
1696 and update muscle_percent_define_insert invocations.
1697 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
1698 (muscle_percent_define_insert): Add argument with that type.
1699 * src/muscle-tab.c (muscle_percent_define_insert): Implement
1700 -F/--force-define behavior and priorities.
1701 (muscle_percent_define_ensure): Update
1702 muscle_percent_define_insert invocation.
1703 * src/parse-gram.y (prologue_declaration): Update
1704 muscle_percent_define_insert invocations.
1705 * tests/input.at (`%define, --define'): Rename to...
1706 (`%define, --define, --force-define'): ... this and extend.
1707
17082009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1709
1710 Update some comments to make sense for -D.
1711 * data/bison.m4 (b4_check_user_names): In header comments, say
1712 "user occurrence" instead of "grammar occurrence".
1713 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
1714 (muscle_percent_code_grow): Likewise just for consistency.
1715
17162009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1717
1718 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1719
17202009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1721
1722 Handle a trailing `:' in a user-supplied C++ namespace better.
1723 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1724 among the closing braces here. This fix might make the
1725 generated code easier to debug, but otherwise it should be
1726 insignificant because a trailing `:' is a C++ error already.
1727
17282009-05-19 Akim Demaille <demaille@gostai.com>
1729
1730 remove useless variable.
1731 * src/getargs.c (skeleton_arg): Remove now useless variable.
1732 Should help the compiler see that this printf-like call is sane.
1733
17342009-05-15 Akim Demaille <demaille@gostai.com>
1735
1736 Rename token.prefix as api.tokens.prefix.
1737 Discussed here.
1738 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
1739
1740 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
1741 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
1742 (token.prefix): Rename as...
1743 (api.tokens.prefix): this.
1744
17452009-05-11 Akim Demaille <demaille@gostai.com>
1746
1747 doc: use C++ headers.
1748 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1749 headers.
1750
17512009-05-11 Akim Demaille <demaille@gostai.com>
1752
1753 doc: token.prefix
1754 * doc/bison.simple (Decl Summary): Document token.prefix.
1755 (Calc++ Parser): Various fixes.
1756 Formatting changes.
1757 Use token.prefix.
1758 Introduce a macro TOKEN to shorten the code and make it more
1759 readable.
1760 (Calc++ Scanner): Adjust.
1761 * NEWS (Variable token.prefix): New.
1762
17632009-05-04 Akim Demaille <demaille@gostai.com>
1764
1765 bison: catch bad symbol names.
1766 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1767 * tests/input.at: Adjust.
1768
17692009-05-04 Akim Demaille <demaille@gostai.com>
1770
1771 identifiers: dashes are letters.
1772 Dashes can now start identifiers (symbols and directives).
1773
1774 * src/scan-gram.l ({letter}): Add dash.
1775 ({id}): Remove it.
1776 * tests/input.at (Symbols): Adjust.
1777 Remove stray comment.
1778 * tests/regression.at (Invalid inputs): Adjust error message.
1779 * doc/bison.texinfo (Symbols): Update.
1780
17812009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1782
1783 Declare %code to be a permanent feature.
1784 * NEWS (2.4.2): Here.
1785 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
1786 experimental.
1787 (Decl Summary): Likewise.
1788
17892009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1790
1791 Convert underscores to dashes in some %define variable names.
1792 For now, just api.push-pull and lr.keep-unreachable-states.
1793 Maintain old names for backward compatibility.
1794 * NEWS (2.5): Document.
1795 * data/c.m4 (b4_identification): Update comment.
1796 * data/yacc.c: Update access.
1797 * doc/bison.texinfo: Update.
1798 * etc/bench.pl.in (bench_push_parser): Update use.
1799 * src/files.c (tr): Move to...
1800 * src/getargs.c, src/getargs.h (tr): ... here because I can't
1801 think of a better place to expose it. My logic is that, for all
1802 uses of tr so far, command-line arguments can be involved, and
1803 getargs.h is already included.
1804 * src/main.c (main): Update access.
1805 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
1806 variable names to new variable names before assigning value.
1807 * src/reader.c (reader): Update setting default.
1808 * tests/calc.at: Update uses.
1809 * tests/conflicts.at (Unreachable States After Conflict
1810 Resolution): Update use.
1811 * tests/input.at (%define enum variables): Update use.
1812 (%define backward compatibility): New test group.
1813 * tests/push.at: Update uses.
1814 * tests/reduce.at: Update uses.
1815 * tests/torture.at: Update uses.
1816
18172009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1818
1819 Set all front-end %define defaults in one place.
1820 * src/main.c (main): Move lr.keep_unreachable_states default...
1821 * src/reader.c (reader): ... to here.
1822
18232009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1824
1825 Rename lr.default_reductions to lr.default-reductions.
1826 * NEWS (2.5): Here.
1827 * doc/bison.texinfo: Here.
1828 * src/lalr.c (initialize_LA): Here.
1829 * src/print.c (print_reductions): Here.
1830 * src/reader.c (reader): Here.
1831 * src/tables.c (action_row): Here.
1832 * tests/input.at (%define enum variables): Here.
1833 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1834
18352009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1836
1837 Pacify ./configure --enable-gcc-warnings.
1838 * tests/input.at (Symbols): Prototype yyerror and yylex.
1839
18402009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1841
1842 Document how `%define "var" "value"' is not M4-friendly.
1843 * src/parse-gram.y (variable): In comments here.
1844
18452009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1846
1847 Clean up recent patches a little.
1848 Reported by Akim Demaille.
1849 * doc/bison.texinfo (Understanding): Fix typos.
1850 * src/print.c (print_reductions): Don't use negated variable.
1851
18522009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1853
1854 List accepted values for a %define enum variable with an invalid value.
1855 Suggested by Akim Demaille at
1856 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1857 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1858 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
1859 * tests/input.at (%define lr.default_reductions invalid values): Merge
1860 into...
1861 (%define enum variables): ... here, and update output.
1862
18632009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1864
1865 Rename "default rule" to "default reduction".
1866 This includes changing variable names in code, changing
1867 comments, and renaming %define lr.default_rules to %define
1868 lr.default_reductions.
1869 * NEWS (2.5): Update IELR documentation.
1870 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
1871 documentation.
1872 * data/glr.c, data/lalr1.java: Sync copyright dates.
1873 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1874 and lr.type documentation. Make some other wording
1875 improvements.
1876 (Glossary): Adjust cross-references and Default Reduction
1877 definition.
1878 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1879 Remove a confusing comment pointed out by Akim Demaille.
1880 (initialize_LA): Adjust code.
1881 * src/print-xml.c (print_reductions): Adjust code.
1882 * src/print.c (print_reductions): Adjust code.
1883 * src/reader.c (reader): Adjust code.
1884 * src/tables.c (action_row): Adjust code.
1885 (token_actions): Adjust code.
1886 * src/tables.h: Adjust YYDEFACT documentation.
1887 * tests/input.at (%define lr.default_rules invalid values):
1888 Rename test group to...
1889 (%define lr.default_reductions invalid values): ... this, and
1890 update grammar file and expected output.
1891 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1892 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1893
18942009-04-21 Akim Demaille <demaille@gostai.com>
1895
1896 tests: check the use of dashes and periods in symbols.
1897 * tests/input.at (Symbol): New test group.
1898
18992009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1900
1901 Document %define lr.type and lr.default_rules.
1902 * NEWS (2.5): Add an entry.
1903 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1904 besides just LALR(1) and GLR(1).
1905 * doc/bison.texinfo (Introduction): Likewise.
1906 (Language and Grammar): Bison is no longer limited to LALR(1)
1907 restrictions.
1908 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1909 when trying to distinguish from GLR. Talk about LR(1) grammars
1910 rather than LALR(1) grammars.
1911 (Decl Summary): In %define api.push_pull entry, say it applies
1912 to deterministic parsers in C rather than LALR(1) parsers in C.
1913 Add lr.default_rules entry.
1914 Add lr.type entry.
1915 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1916 restrictions.
1917 (Generalized LR Parsing): Same changes as for the previous GLR
1918 section.
1919 (Memory Management): Say deterministic rather than LALR(1).
1920 (Understanding): Correct some bison output.
1921 Index discussion of "accepting state".
1922 Say deterministic rather than LALR(1).
1923 (Bison Options): In --yacc entry, say deterministic rather than
1924 LALR(1).
1925 In --report, --graph, and --xml entries, just don't mention
1926 LALR(1).
1927 (C++ Parsers): Say deterministic rather than LALR(1).
1928 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1929 (Glossary): Add Accepting State, Consistent State, Default Rule,
1930 and IELR(1) definitions.
1931 In Generalized LR (GLR) definition, make same changes as in
1932 previous GLR sections.
1933 In LALR(1) definition, say Bison uses LALR(1) by default rather
1934 than implying Bison is limited to LALR(1).
1935 (LocalWords): Add IELR.
1936
19372009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1938
1939 Finish implementing %define lr.type.
1940 Its value can be "LALR", "IELR", or "canonical LR".
1941 * lib/timevar.def (TV_IELR_PHASE1): New var.
1942 (TV_IELR_PHASE2): New var.
1943 (TV_IELR_PHASE3): New var.
1944 (TV_IELR_PHASE4): New var.
1945 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1946 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1947 Sbitset.h, ielr.h, and ielr.c.
1948 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1949 trace_types): Add trace_ielr.
1950 * src/lalr.h, src/lalr.c (ngotos): Export it.
1951 (F): Rename to...
1952 (goto_follows): ... this, update all uses, and export it.
1953 (set_goto_map): Export it.
1954 (map_goto): Export it.
1955 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1956 handled in ielr.
1957 (initialize_LA): Export it. Move lookback allocation to...
1958 (lalr): ... here because, for canonical LR, initialize_LA must
1959 be invoked but lookback and much of the rest of LALR isn't
1960 needed.
1961 * main.c (main): Instead of lalr, invoke ielr, which invokes
1962 lalr.
1963 * src/reader.c (reader): Default lr.type to "LALR".
1964 Default lr.default_rules to "accepting" if lr.type is "canonical
1965 LR". Leave the default as "all" otherwise.
1966 Check for a valid lr.type value.
1967 * src/state.h, src/state.c (struct state_list): Add state_list
1968 member.
1969 (state_new): Initialize state_list member to NULL.
1970 (state_new_isocore): New function, exported.
1971 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1972 exercises all values of lr.type.
1973 (GNU AWK Grammar): Rename test group to...
1974 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1975 AT_TEST_EXISTING_GRAMMAR.
1976 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
1977 (GNU pic Grammar): Rename test group to...
1978 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1979 AT_TEST_EXISTING_GRAMMAR.
1980 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1981 all values of lr.type.
1982 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1983 (Lane Split): Likewise.
1984 (Complex Lane Split): Likewise.
1985 (Split During Added Lookahead Propagation): Likewise.
1986
19872009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1988
1989 Add new files for IELR and canonical LR implementation.
1990 * src/AnnotationList.c: New.
1991 * src/AnnotationList.h: New.
1992 * src/InadequacyList.c: New.
1993 * src/InadequacyList.h: New.
1994 * src/Sbitset.c: New.
1995 * src/Sbitset.h: New.
1996 * src/ielr.c: New.
1997 * src/ielr.h: New.
1998
19992009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2000
2001 Implement %define lr.default_rules.
2002 Its value describes the states that are permitted to contain
2003 default rules: "all", "consistent", or "accepting".
2004 * src/reader.c (reader): Default lr.default_rules to "all".
2005 Check for a valid lr.default_rules value.
2006 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
2007 is "accepting", then only mark the accepting state as
2008 consistent.
2009 (initialize_LA): Tell state_lookahead_tokens_count whether
2010 lr.default_rules is "accepting".
2011 * src/tables.c (action_row): If lr.default_rules is not "all",
2012 then disable default rules in inconsistent states.
2013 * src/print.c (print_reductions): Use this opportunity to
2014 perform some assertions about whether lr.default_rules was
2015 obeyed correctly.
2016 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
2017 helps with checking the parser tables for a grammar.
2018 * tests/input.at (%define lr.default_rules invalid values): New
2019 test group.
2020 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
2021 AT_TEST_TABLES_AND_PARSE.
2022 (`no %define lr.default_rules'): New test group generated by
2023 AT_TEST_LR_DEFAULT_RULES.
2024 (`%define lr.default_rules "all"'): Likewise.
2025 (`%define lr.default_rules "consistent"'): Likewise.
2026 (`%define lr.default_rules "accepting"'): Likewise.
2027
20282009-04-20 Akim Demaille <demaille@gostai.com>
2029
2030 Formatting change.
2031
20322009-04-20 Akim Demaille <demaille@gostai.com>
2033
2034 bison: factoring.
2035 * src/output.c (token_definitions_output): Use symbol_id_get
2036 instead of duplicating its logic.
2037 * TODO (YYERRCODE): Extend.
2038
20392009-04-20 Akim Demaille <demaille@gostai.com>
2040
2041 variables: prefer error-verbose to error_verbose.
2042 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
2043 instead of error_verbose.
2044 * src/scan-gram.l (%error-verbose): Map to the error-verbose
2045 variable.
2046 * doc/bison.texinfo: Promote %define error-verbose instead of
2047 %error-verbose.
2048 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
2049
20502009-04-15 Akim Demaille <demaille@gostai.com>
2051
2052 variables: accept dashes.
2053 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
2054 underscores.
2055 * src/scan-gram.l ({id}): Also accept dashes after the initial
2056 letter.
2057 ({directive}): Use {id}.
2058 * src/parse-gram.y: Comment and formatting changes.
2059 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
2060 symbols.
2061 * src/complain.h, src/complain.c (yacc_at): New.
2062 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
2063 symbol names.
2064 * src/output.c (token_definitions_output): Do not #define token
2065 names with dashes.
2066
20672009-04-20 Akim Demaille <demaille@gostai.com>
2068
2069 Consistently refer to Yacc, not YACC.
2070 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2071
20722009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
2073
2074 Pacify make maintainer-check-posix.
2075 * tests/input.at (%define, --define): Move bison command-line
2076 options before grammar file name.
2077
20782009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2079
2080 Document semicolon warnings.
2081 * NEWS (2.5): Here.
2082
20832009-04-14 Akim Demaille <demaille@gostai.com>
2084
2085 variables: use `parse.assert' instead of `assert'.
2086 * TODO (assert): Remove.
2087 * data/bison.m4 (b4_assert_if): Replace with...
2088 (b4_parse_assert_if): this.
2089 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
2090 * doc/bison.texinfo (Decl Summary): Document parse.assert.
2091
20922009-04-14 Akim Demaille <demaille@gostai.com>
2093
2094 variables: use `parse.trace' instead of `debug'.
2095 * src/getargs.c (getargs): Map -t to %define trace.parse.
2096 * src/scan-gram.l (%debug): Map to %define trace.parse.
2097 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
2098 names to `_' in macro names.
2099 (b4_debug_if): Replace with...
2100 (b4_parse_trace_if): this.
2101 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2102 * data/yacc.c: Adjust.
2103 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
2104 Use @code to label the variable list.
2105 Document the variable parse.trace.
2106 (Tracing): Promote the parse.trace variable.
2107 * TODO: %printer is not documented.
2108
21092009-04-14 Akim Demaille <demaille@gostai.com>
2110
2111 doc: minor fixes.
2112 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2113 (Table of Symbols): Remove duplicate entry for %debug.
2114
21152009-04-10 Eric Blake <ebb9@byu.net>
2116
2117 submodules: update to latest
2118 * submodules/autoconf: Use latest upstream Autoconf.
2119
21202009-04-06 Eric Blake <ebb9@byu.net>
2121
2122 Work around autoconf 2.63b bug in testsuite.
2123 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2124 autoconf bug related to # in test.
2125
21262009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2127
2128 * NEWS (2.5): New section. Describe new -D/--define feature.
2129
21302009-04-06 Akim Demaille <demaille@gostai.com>
2131
2132 Regen.
2133 * src/parse-gram.h, src/parse-gram.c: Regen.
2134
21352009-04-06 Akim Demaille <demaille@gostai.com>
2136
2137 rename muscle_tab.* as muscle-tab.* for consistency.
2138 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
2139 * src/muscle-tab.h, src/muscle-tab.c: these.
2140 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
2141 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
2142
21432009-04-06 Akim Demaille <demaille@gostai.com>
2144
2145 Makefile: introduce $(BISON).
2146 * src/local.mk (BISON): New.
2147 (YACC): Use it.
2148
21492009-04-06 Akim Demaille <demaille@gostai.com>
2150
2151 parser: handle %locations as %define locations.
2152 * src/getargs.h, src/getargs.c (locations_flag): Remove.
2153 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
2154 to set "locations" to true.
2155 * src/output.c (prepare): Don't output "locations".
2156 * src/scan-gram.l (%locations): Handle it as a %<flag>.
2157 * src/parse-gram.y: It's no longer a token.
2158 Don't handle it.
2159 * data/bison.m4 (b4_locations_if): Define it with
2160 b4_percent_define_if_define.
2161 * data/c.m4, data/glr.cc: Adjust.
2162
21632009-04-06 Akim Demaille <demaille@gostai.com>
2164
2165 Regen.
2166 * src/parse-gram.c: Regen.
2167
21682009-04-06 Akim Demaille <demaille@gostai.com>
2169
2170 muscle: factor the handling of obsolete of obsolete directives.
2171 Suggested by Joel E. Denny.
2172
2173 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
2174 New, extracted from...
2175 * src/parse-gram.y (prologue_declaration: pure-parser): here.
2176 Remove it.
2177 (prologue_declaration: "%<flag>"): Use
2178 muscle_percent_define_ensure.
2179 (%error-verbose, %pure-parser): No longer tokens.
2180 * src/scan-gram.l (pure-parser): Return as a %<flag>.
2181
21822009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2183
2184 Fix options documentation.
2185 * build-aux/cross-options.pl: As in --help output, write optional
2186 arguments as [=ARG] not =[ARG].
2187 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2188
21892009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2190
2191 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2192 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2193 requirements for a correct m4 are stricter.
2194 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
2195 * configure.ac: Update to use AC_PROG_GNU_M4.
2196 Reported by Eric Blake.
2197
21982009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2199
2200 Help with updating web manual.
2201 * HACKING: Incorporate instructions from gnulib/doc/README.
2202 * bootstrap.conf (gnulib_modules): Add gendocs.
2203
22042009-04-03 Akim Demaille <demaille@gostai.com>
2205
2206 Regen.
2207 * src/parse-gram.h, src/parse-gram.c: Regen.
2208
22092009-04-03 Akim Demaille <demaille@gostai.com>
2210
2211 Factor %FLAG at scan level.
2212 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
2213 definitions and associated rules, replaced by....
2214 (PERCENT_FLAG): this new token type, and rule.
2215 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
2216 Use it for %debug and %error-verbose.
2217
22182009-04-03 Akim Demaille <demaille@gostai.com>
2219
2220 Regen.
2221 * src/parse-gram.h, src/parse-gram.c: Regen.
2222
22232009-04-03 Akim Demaille <demaille@gostai.com>
2224
2225 Treat %debug as %define debug.
2226 * data/bison.m4 (b4_debug_if): New.
2227 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
2228 * data/lalr1.java: Use it instead of b4_debug_flag.
2229 * src/getargs.h, src/getargs.c (debug_flag): Remove.
2230 * src/output.c (prepare): Don't output it.
2231 * src/parse-gram.y: Treat %debug as %define debug.
2232
22332009-04-03 Akim Demaille <demaille@gostai.com>
2234
2235 Treat %error-verbose as %define error_verbose.
2236 This allows to pass -Derror_verbose on the command line. Better
2237 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
2238 ERROR_VERBOSE being defined as false or true.
2239 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
2240 on b4_percent_define_ifdef, for does not check the defined value,
2241 but only whether the symbol is defined, rely on
2242 b4_percent_define_flag_if, so that a value of "false" is processed
2243 as a false.
2244 If not defined, define the flag to "false".
2245 (b4_error_verbose_if): New.
2246 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
2247 b4_error_verbose_flag.
2248 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
2249 * src/output.c (prepare): Don't output it.
2250 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
2251
22522009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2253
2254 Fix strange %define locations for default values.
2255 Reported by Akim Demaille at
2256 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2257 and discussed again starting at
2258 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2259 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2260 because location information is bogus.
2261 Use angle brackets to delimit fake file name because square brackets
2262 look like underexpanded m4. Choose a better fake file name.
2263 Use negative line numbers.
2264 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2265 * src/location.c (location_print): If line for a boundary is negative,
2266 only print that boundary's file name.
2267 * src/location.h: Document that.
2268 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2269 defaults): Update output.
2270
22712009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2272
2273 Pacify ./configure --enable-gcc-warnings.
2274 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
2275 in lib won't compile with it.
2276 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
2277
22782009-03-31 Akim Demaille <demaille@gostai.com>
2279
2280 bootstrap: --help to stdout.
2281 * bootstrap (usage): Don't send --help to stderr.
2282 Use a here doc instead of a long string.
2283
22842009-03-31 Akim Demaille <demaille@gostai.com>
2285
2286 bootstrap: README-hacking no longer exists
2287 * bootstrap (checkout_only_file): Set to HACKING.
2288
22892009-03-26 Akim Demaille <demaille@gostai.com>
2290
2291 doc: merge HACKING and README-hacking.
2292 Two files is confusing.
2293 Reported by Alexandre Duret-Lutz.
2294
2295 * README-hacking: Merge into...
2296 * HACKING (Working from the repository): here.
2297
22982009-03-26 Akim Demaille <demaille@gostai.com>
2299
2300 doc: update README-hacking.
2301 * README-hacking: We now use git and git submodules.
2302 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2303
23042009-03-26 Akim Demaille <demaille@gostai.com>
2305
2306 lalr1.cc: avoid GCC 4.3 warnings.
2307 GCC 4.3 now warns about "a || b && c" and asks for explicit
2308 parentheses.
2309 Reported by Alexandre Duret-Lutz.
2310 * data/location.cc: Update copyright years.
2311 (Position::operator==): Use parens to make precedence explicit.
2312 Compare lines and columns first, as they are more likely to be
2313 different, and they are faster to compare.
2314
23152009-03-26 Akim Demaille <demaille@gostai.com>
2316
2317 gnulib: update.
2318 * gnulib: Update to latest.
2319 * src/local.mk (AM_CFLAGS): Move to...
2320 * Makefile.am: here.
2321 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
2322 AM_CFLAGS.
2323
23242009-03-02 Akim Demaille <demaille@gostai.com>
2325
2326 Comment changes.
2327
23282009-03-02 Akim Demaille <demaille@gostai.com>
2329
2330 Share b4_yytranslate_define.
2331 * data/lalr1.cc (b4_yytranslate_define): Move to...
2332 * data/c++.m4: here.
2333
23342009-03-02 Akim Demaille <demaille@gostai.com>
2335
2336 Use locations in the variant example.
2337 Yes, this obfuscates the point of this example, variants only.
2338 But glr.cc cannot work (yet?) without locations. This change
2339 makes it easier to use this example with glr.cc.
2340
2341 * examples/variant.yy (assert): %define it.
2342 (locations): Request them.
2343 (yylex): Bind the location to the stage.
2344
23452009-03-02 Akim Demaille <demaille@gostai.com>
2346
2347 Dub make_TOKEN as a public type interface.
2348 * data/c++.m4 (b4_symbol_constructor_declare)
2349 (b4_symbol_constructor_define): New empty stubs.
2350 (b4_public_types_declare, b4_public_types_define): Use them.
2351 * data/lalr1.cc (b4_symbol_constructor_declare)
2352 (b4_symbol_constructor_declare_)
2353 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
2354 Move to...
2355 * data/variant.hh: here.
2356 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
2357 needed.
2358 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
2359 b4_symbol_constructor_declare, as it is now done by
2360 b4_public_types_define and b4_public_types_declare.
2361
23622009-03-02 Akim Demaille <demaille@gostai.com>
2363
2364 Coding style changes.
2365 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2366 (b4_symbol_constructor_declarations)
2367 (b4_symbol_constructor_definition_)
2368 (b4_symbol_constructor_definitions)
2369 (b4_yytranslate_definition): Rename as...
2370 (b4_symbol_constructor_declare_)
2371 (b4_symbol_constructor_declare)
2372 (b4_symbol_constructor_define_)
2373 (b4_symbol_constructor_define)
2374 (b4_yytranslate_define): these.
2375 * data/variant.hh (b4_variant_definition): Rename as...
2376 (b4_variant_define): this.
2377
23782009-03-02 Akim Demaille <demaille@gostai.com>
2379
2380 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
2381 * data/bison.m4 (b4_percent_define_if_define): New.
2382 * data/c++.m4 (b4_variant_if): Move to...
2383 * data/bison.m4: Here, using b4_percent_define_if_define.
2384 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
2385 * data/bison.m4: Here, using b4_percent_define_if_define.
2386
23872009-03-02 Akim Demaille <demaille@gostai.com>
2388
2389 Dub symbol_type_base as a public type.
2390 * data/c++.m4 (b4_public_types_declare): Now define
2391 symbol_type_base and symbol_type.
2392 (b4_public_types_define): New.
2393 In both cases, the definitions are taken verbatim from lalr1.cc.
2394 * data/lalr1.cc: Adjust.
2395
23962009-03-02 Akim Demaille <demaille@gostai.com>
2397
2398 b4_public_types_declare.
2399 * data/c++.m4 (b4_public_types_declare): New.
2400 * data/glr.cc, data/lalr1.cc: Use it.
2401
24022009-03-02 Akim Demaille <demaille@gostai.com>
2403
2404 b4_semantic_type_declare.
2405 * data/c++.m4 (b4_semantic_type_declare): New.
2406 Factors and generalizes what was in glr.cc and lalr1.cc.
2407 * data/variant.hh (b4_semantic_type_declare): Redefine it for
2408 variants.
2409 * data/lalr1.cc, data/glr.cc: Use it.
2410
24112009-02-26 Akim Demaille <demaille@gostai.com>
2412
2413 Upgrade gnulib.
2414 * gnulib: Upgrade from master.
2415 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
2416 Regen.
2417
24182009-02-25 Akim Demaille <demaille@gostai.com>
2419
2420 Remove useless arguments.
2421 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
2422 relevant.
2423
24242009-02-25 Akim Demaille <demaille@gostai.com>
2425
2426 Comment changes.
2427 * data/lalr1.cc: here.
2428
24292009-02-25 Akim Demaille <demaille@gostai.com>
2430
2431 Fix glr.cc's debug level handling.
2432 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
2433 glr.c which is used.
2434 (debug_level, set_debug_level): Adjust.
2435
24362009-02-25 Akim Demaille <demaille@gostai.com>
2437
2438 Copyright years.
2439 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2440
24412009-02-25 Akim Demaille <demaille@gostai.com>
2442
2443 Style changes.
2444 * etc/bench.pl.in (generate_grammar_list): Consitently use
2445 location_type, not yy::location.
2446
24472009-02-25 Akim Demaille <demaille@gostai.com>
2448
2449 Comment change.
2450 * data/lalr1.cc: here.
2451
24522009-02-19 Akim Demaille <demaille@gostai.com>
2453
2454 Make yyparser::error public.
2455 * data/lalr1.cc: here.
2456 There is no good reason to keep it private (and it is convenient
2457 to use it from the scanner for instance). It is already public in
2458 glr.cc.
2459
24602009-02-19 Akim Demaille <demaille@gostai.com>
2461
2462 Comment changes.
2463 * data/glr.cc: here.
2464
24652009-02-19 Akim Demaille <demaille@gostai.com>
2466
2467 Remove trailing blanks.
2468 The epilogue has its own ending \n, no need to add another.
2469
2470 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
2471 epilogue.
2472 * data/glr.cc: dnl when extending the epilogue.
2473 Remove stray "private:".
2474
24752009-02-19 Akim Demaille <demaille@gostai.com>
2476
2477 Use b4_c_modern.
2478 * data/c.m4 (b4_c_function_decl): Here.
2479
24802009-02-19 Akim Demaille <demaille@gostai.com>
2481
2482 Comment changes.
2483 * data/lalr1.cc: here.
2484
24852009-02-19 Akim Demaille <demaille@gostai.com>
2486
2487 Extract variant.hh
2488 * data/variant.hh: New, extracted from...
2489 * data/lalr1.cc: here.
2490 Adjust.
2491 * data/local.mk: Adjust.
2492
24932009-02-19 Akim Demaille <demaille@gostai.com>
2494
2495 Extract stack.hh from lalr1.cc.
2496 * data/stack.hh: New.
2497 * data/lalr1.cc: Extract from here.
2498 * data/local.mk: Adjust.
2499
25002009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2501
2502 Add reminder about uploading public key to keys.gnupg.net.
2503 * HACKING (Release Procedure): Here.
2504
25052009-01-28 Akim Demaille <demaille@gostai.com>
2506
2507 * NEWS: Update information about 2.4.1 and 2.4.2.
2508
25092008-11-04 Akim Demaille <demaille@gostai.com>
2510
2511 Reformat NEWS.
2512 * NEWS: Use more outline-mode markup.
2513 Suggested by Jim Meyering.
2514
25152009-01-08 Akim Demaille <demaille@gostai.com>
2516
2517 Fix grep portability issues.
2518 Grep on Solaris does not support -q.
2519 Reported by Summum Bonum.
2520
2521 * NEWS: Add a stub for 2.4.2.
2522 * THANKS: Add Summum Bonum.
2523 * tests/atlocal.in (EGREP): New.
2524 (CC, CXX, XSLTPROC): Make it possible to override them via
2525 envvars.
2526 * tests/java.at: Use $EGREP instead of egrep.
2527 Use AT_CHECK's ignore instead of grep's -q.
2528
25292008-12-11 Akim Demaille <demaille@gostai.com>
2530
2531 Pass the token type to yysyntax_error.
2532 * data/yacc.c (yysyntax_error): Take the transated token instead
2533 of the raw number.
2534 Adjust callers.
2535 * TODO: Update.
2536
25372008-12-11 Akim Demaille <demaille@gostai.com>
2538
2539 Formatting changes.
2540 * data/glr.c: Formatting changes.
2541
25422008-12-11 Akim Demaille <demaille@gostai.com>
2543
2544 Propagate i18n changes into glr.c.
2545 * TODO: Update.
2546 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
2547 building the error message format dynamically.
2548 * data/lalr1.java: Formatting changes.
2549
25502008-12-11 Akim Demaille <demaille@gostai.com>
2551
2552 Use testsuite -C.
2553 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
2554 Solves problems when top_srcdir is an absolute path.
2555 Suggested by Eric Blake.
2556 * configure.ac: Require Autoconf 2.62.
2557
25582008-12-11 Akim Demaille <demaille@gostai.com>
2559
2560 Simplify the i18n of the error messages.
2561 * data/lalr1.cc: Comment changes.
2562 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
2563 lalr1.cc instead of building dynamically the format string.
2564
25652008-12-08 Akim Demaille <demaille@gostai.com>
2566
2567 Fix portability issue in the test suite.
2568 * tests/local.at (AT_MATCHES_CHECK): New.
2569 Based on Perl instead of Sed. Sed has too many portability
2570 pitfalls, not ever Sed is GNU Sed.
2571 * tests/actions.at (Fix user actions without a trailing semicolon):
2572 Use it.
2573
25742008-12-08 Akim Demaille <demaille@gostai.com>
2575
2576 Update data/README.
2577 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2578
25792008-12-08 Akim Demaille <demaille@gostai.com>
2580
2581 Install autoconf as a submodule to get m4sugar.
2582 * .gitmodules: Add submodules/autoconf.
2583 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2584 submodules/autoconf.
2585
25862008-12-08 Akim Demaille <demaille@gostai.com>
2587
2588 Test token.prefix in all the skeletons.
2589 * data/java.m4 (b4_token_enum): Use the token.prefix.
2590 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
2591 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
2592 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
2593 * tests/java.at: Comment changes.
2594 (AT_CHECK_JAVA_MINIMAL): Define the END token.
2595 (Java parser class and package names): Add token.prefix check.
2596
25972008-12-08 Akim Demaille <demaille@gostai.com>
2598
2599 Fix regeneration of atconfig.
2600 * tests/local.mk (tests/atconfig): The rule was incorrect, but
2601 remove it: now that there is no tests/Makefile.am, the top-level
2602 Makefile properly updates atconfig when needed.
2603
26042008-12-07 Di-an Jan <dianj@freeshell.org>
2605
2606 Implement the FIXME that ends an user action with a semicolon
2607 if it seems necessary.
2608 * src/scan-code.l (flex rules section): Flag cpp directive from
2609 any `#' to the first unescaped end-of-line. Semicolon is not
2610 needed after `;', `{', '}', or cpp directives and is needed after
2611 any other token (whitespaces and comments have no effect).
2612 * tests/actions.at (Fix user actions without a trailing semicolon):
2613 New test.
2614 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2615 to make user actions complete statements.
2616 Adjust column numbers in error messages.
2617 * tests/regression.at (Fix user actions without a trailing semicolon):
2618 Remove. Covered by new test.
2619
26202008-12-07 Akim Demaille <demaille@gostai.com>
2621
2622 Update gnulib.
2623 * gnulib: Update from master.
2624
26252008-12-05 Eric Blake <ebb9@byu.net>
2626
2627 Avoid compiler warning.
2628 * src/output.c (muscle_insert_item_number_table): Delete unused
2629 function.
2630
26312008-12-02 Eric Blake <ebb9@byu.net>
2632
2633 Build testsuite with newer autoconf.
2634 * tests/output.at (m4_expand): Don't override in newer autoconf,
2635 where the underlying implementation changed.
2636 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2637 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2638 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2639 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2640 since some of them contain unbalanced ')'.
2641
26422008-12-01 Akim Demaille <demaille@gostai.com>
2643
2644 Use b4_symbol for printers and destructors everywhere.
2645 * data/bison.m4 (b4_symbol_action_location): New.
2646 * data/c.m4 (b4_symbol_actions): Remove.
2647 Adjust all callers to use by b4_symbol_foreach and the corresponding
2648 b4_symbol_printer/destructor macro.
2649 * data/glr.cc: Adjust.
2650 * data/lalr1.java: Adjust the %destructor sanity check.
2651 * src/output.c (symbol_code_props_output): Remove, we no longer
2652 need the b4_symbol_printers/destructors tables.
2653
26542008-12-01 Akim Demaille <demaille@gostai.com>
2655
2656 Use b4_symbol_case_.
2657 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
2658 b4_symbol_case_.
2659
26602008-12-01 Akim Demaille <demaille@gostai.com>
2661
2662 Move b4_symbol based macro to bison.m4.
2663 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
2664 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
2665 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
2666 (b4_type_foreach): Move to...
2667 * data/bison.m4: Here.
2668 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
2669 b4_symbol_value_template instead of b4_symbol_value.
2670
26712008-12-01 Akim Demaille <demaille@gostai.com>
2672
2673 b4_symbol/type_foreach.
2674 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
2675 Use them.
2676
26772008-12-01 Akim Demaille <demaille@gostai.com>
2678
2679 Use the symbol properties to output the printer/destructor for lalr1.cc.
2680 Instead of defining complex list of tuples to define various
2681 properties of the symbols, we now prefer to define symbols as
2682 "structs" in m4: using the symbol key (its number), and the
2683 property name, b4_symbol gives it value. Use this to handle
2684 destructors and printers.
2685
2686 * src/output.c (CODE_PROP): New.
2687 (prepare_symbol_definitions): Use it to define the printer and
2688 destructor related attributes of the symbols.
2689 * data/lalr1.cc (b4_symbol_actions): Rename as...
2690 (b4_symbol_action): this.
2691 Use b4_symbol instead of 6 arguments.
2692 (b4_symbol_printer, b4_symbol_destructor): New.
2693 Use them instead of b4_symbol_actions.
2694
26952008-12-01 Akim Demaille <demaille@gostai.com>
2696
2697 Avoid capturing variables too easily.
2698 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
2699 v__ and p__ instead of v and p.
2700
27012008-12-01 Akim Demaille <demaille@gostai.com>
2702
2703 Remove spurious empty line before syncline.
2704 * data/bison.m4 (b4_syncline): Don't output an empty line before
2705 the output.
2706
27072008-11-26 Akim Demaille <demaille@gostai.com>
2708
2709 Convert lib/Makefile.am into lib/local.mk.
2710 The real problem is rather gnulib.mk, which itself is extracted
2711 from a Makefile.am that gnulib expects to the "recursive". The
2712 tool prefix-gnulib-mk converts such a gnulib.mk to be
2713 non-recursive. Also, some AC_SUBST variables need to be adjusted.
2714
2715 * etc/prefix-gnulib-mk: New.
2716 * bootstrap (slurp): Use it to convert further gnulib.mk.
2717 No longer try to avoid re-creation of lib/gnulib.mk as the changes
2718 are deeper.
2719 * lib/Makefile.am: Rename as...
2720 * lib/local.mk: this.
2721 Adjust to be prefixed.
2722 * Makefile.am, configure.ac: Adjust.
2723 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
2724
27252008-11-26 Akim Demaille <demaille@gostai.com>
2726
2727 s/_FLAGS/FLAGS/.
2728 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
2729 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
2730 Reported by Eric Blake.
2731
27322008-11-26 Akim Demaille <demaille@gostai.com>
2733
2734 Use b4_parser_tables_define in glr.cc.
2735 * data/glr.c: Use b4_parser_tables_define instead of defining the
2736 (deterministic integral) tables by hand.
2737
27382008-11-26 Akim Demaille <demaille@gostai.com>
2739
2740 Use b4_parser_tables_define in Java.
2741 * data/java.m4 (b4_typed_parser_table): Rename as...
2742 (b4_typed_parser_table_define): this, for consistency.
2743 Accept a comment as $4.
2744 Move $2 into yy*_.
2745 (b4_integral_parser_table): Rename as...
2746 (b4_integral_parser_table_define): this.
2747 * data/lalr1.java: Adjust all uses.
2748 Use b4_parser_tables_define instead of generation by hand.
2749
27502008-11-26 Akim Demaille <demaille@gostai.com>
2751
2752 Prepare the convergence bw C style and Java table generation.
2753 * data/bison.m4 (b4_tables_map, b4_tables_declare)
2754 (b4_tables_define): Rename as...
2755 (b4_integral_parser_tables_map, b4_parser_tables_declare)
2756 (b4_parser_tables_define): these.
2757 * data/c.m4 (b4_table_define): Rename as...
2758 (b4_integral_parser_table_define): this.
2759 * data/lalr1.cc: Adjust.
2760 (b4_table_define, b4_table_declare): Rename as...
2761 (b4_integral_parser_table_define)
2762 (b4_integral_parser_table_declare): these.
2763 (yyrline_): Move the comment where it is actually used.
2764 * data/yacc.c: Adjust.
2765 (yyrline): Use b4_integral_parser_table_define.
2766
27672008-11-26 Akim Demaille <demaille@gostai.com>
2768
2769 Regen.
2770 * src/parse-gram.h, src/parse-gram.c: Regen.
2771
27722008-11-26 Akim Demaille <demaille@gostai.com>
2773
2774 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
2775 * data/lalr1.cc (b4_tables_map): Move to...
2776 * data/bison.m4: here.
2777 Update the comment for yytable during the flight.
2778 (b4_tables_declare, b4_tables_define): New.
2779 * data/lalr1.cc: Use them.
2780 * data/c.m4 (b4_table_define): New.
2781 * data/yacc.c: Use b4_tables_define instead of output the tables
2782 by hand.
2783 * tests/regression.at (Web2c Actions): Adjust the expected output,
2784 the order of the tables changed.
2785
27862008-11-26 Akim Demaille <demaille@gostai.com>
2787
2788 Get rid of (yy)rhs and (yy)prhs.
2789 These tables are no longer needed in the parsers, and they don't seem to
2790 be useful. They are not documented either.
2791
2792 * src/output.c (prepare_rules): Get rid of rhs and prhs.
2793 Adjust the computation of (yy)r2.
2794
27952008-11-26 Akim Demaille <demaille@gostai.com>
2796
2797 Rule length is unsigned.
2798 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
2799
28002008-11-26 Akim Demaille <demaille@gostai.com>
2801
2802 Get rid of lalr1-split.cc.
2803 It was no longer maintainer.
2804
2805 * data/lalr1-split.cc: Remove.
2806 * etc/bench.pl.in (bench_fusion_parser): Remove.
2807 Adjust.
2808
28092008-11-26 Akim Demaille <demaille@gostai.com>
2810
2811 Use yy* consistently.
2812 * data/glr.c: Now that yyrhs no longer exists as a global
2813 variable, rename local "rhs" variables into "yyrhs" for
2814 consistency.
2815
28162008-11-25 Akim Demaille <demaille@gostai.com>
2817
2818 Get rid of yyrhs and yyprhs in glr.c.
2819 * data/glr.c (yyrhs, yyprhs): Remove.
2820 Instead, use the state stack and yystos.
2821
28222008-11-25 Akim Demaille <demaille@gostai.com>
2823
2824 Flag glr tests.
2825 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
2826 as an Autotest keyword.
2827
28282008-11-25 Akim Demaille <demaille@gostai.com>
2829
2830 Prefer TESTSUITE_FLAGS.
2831 TESTSUITEFLAGS is barely readable.
2832
2833 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
2834 for backward compatibility.
2835 Use the former instead of the latter.
2836
28372008-11-25 Akim Demaille <demaille@gostai.com>
2838
2839 Get rid of yyrhs and yyprhs in larl1.java.
2840 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
2841 (yy_reduce_print): Rather, use yystos_ and the state stack.
2842
28432008-11-25 Akim Demaille <demaille@gostai.com>
2844
2845 Formatting changes.
2846
28472008-11-25 Akim Demaille <demaille@gostai.com>
2848
2849 Get rid of yyrhs and yyprhs in yacc.c.
2850 They were used to get the symbol types, given a rule number, when
2851 displaying the top of the stack before a reduction. But the
2852 symbol type is available from the state stack. This has two be
2853 benefits: two tables less in the parser (making it smaller), and a
2854 more consistent use of the three stacks which will help to fuse
2855 them.
2856
2857 * data/yacc.c (yyprhs, yyrhs): Remove.
2858 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
2859 (yy_reduce_print): Take yyssp as argument.
2860 Use it, together with yystos, to get the symbol type.
2861 * tests/regression.at (Web2c Report): Remove these tables from the
2862 expected output.
2863
28642008-11-25 Akim Demaille <demaille@gostai.com>
2865
2866 b4_tables_map.
2867 The point is to factor the generation of the tables across skeletons.
2868 This is language dependant.
2869
2870 * data/c.m4 (b4_comment_): New.
2871 Should be usable to define how to generate tables independently of
2872 the language.
2873 (b4_c_comment): New.
2874 (b4_comment): Bounce to b4_c_comment.
2875 Now support $2 = [PREFIX] for indentation.
2876 * data/lalr1.cc (b4_table_declare): Don't output a comment if
2877 there is no comment.
2878 Indent it properly when there is one.
2879 Output the ending semicolon.
2880 (b4_table_define): Space changes.
2881 Output the ending semicolon.
2882 (b4_tables_map): New.
2883 Use it twice instead of declaring and defining the (integral)
2884 tables by hand.
2885
28862008-11-25 Akim Demaille <demaille@gostai.com>
2887
2888 b4_table_declare.
2889 * data/lalr1.cc (b4_table_declare): New.
2890 Use it to declare the tables defined with b4_table_define.
2891 (b4_table_define): Declare a third arg to match b4_table_declare
2892 signature.
2893 Move all the comments around invocations of b4_table_define into
2894 the invocations itselves.
2895 Move things around to have the order for declarations and
2896 definitions.
2897
28982008-11-25 Akim Demaille <demaille@gostai.com>
2899
2900 Formatting changes.
2901 * data/lalr1.java: here.
2902
29032008-11-25 Akim Demaille <demaille@gostai.com>
2904
2905 b4_args is more general than only C++.
2906 * data/lalr1.cc (b4_args, _b4_args): Move to...
2907 * data/bison.m4: here.
2908
29092008-11-21 Di-an Jan <dianj@freeshell.org>
2910
2911 Implement no-XXX arguments for --warnings, --report, --trace.
2912 * src/getargs.c (flags_argmatch): Handles no-XXX.
2913 Fix typo in doxygen comment.
2914
29152008-11-21 Akim Demaille <demaille@gostai.com>
2916
2917 Display the changes in cross-options.texi.
2918 * build-aux/cross-options.pl ($sep): New, to separate items.
2919 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
2920 changes.
2921
29222008-11-20 Di-an Jan <dianj@freeshell.org>
2923
2924 Improves options in the manual.
2925 * doc/bison.texinfo (-g, -x): Add space before argument.
2926 (Option Cross Key): Implement FIXME: listing directives also.
2927 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2928 (Short Option): Special case -d. Put arguments inside @option.
2929 (Bison Directive): Add column, automatically extracted from
2930 src/scan-gram.l (actual name passed as the first argument)
2931 with special case for %define.
2932 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
2933 to build-aux/cross-options.pl.
2934 * src/getargs.c (usage): Document limitations of cross-options.pl.
2935 * src/scan-gram.l: Likewise.
2936
29372008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2938
2939 Fix unexpanded macros in GLR defines file.
2940 Reported by Csaba Raduly at
2941 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2942 * THANKS (Csaba Raduly): Add.
2943 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2944 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2945 lexer in a separate module that includes the defines file.
2946 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
2947 source.
2948 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2949 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2950 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2951 (AT_DATA_SOURCE_PROLOGUE): New.
2952 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2953 (AT_DATA_SOURCE): New.
2954 (AT_FULL_COMPILE): Extend to support an additional source file.
2955
29562008-11-18 Akim Demaille <demaille@gostai.com>
2957
2958 More TODO.
2959 * TODO: More short term issues.
2960
29612008-11-18 Akim Demaille <demaille@gostai.com>
2962
2963 Regen.
2964 * src/parse-gram.h, src/parse-gram.c: Regen.
2965
29662008-11-18 Akim Demaille <demaille@gostai.com>
2967
2968 Use b4_subtract where possible.
2969 * data/lalr1.cc (b4_subtract): Move to...
2970 * data/bison.m4: here.
2971 * data/glr.c (b4_rhs_data): Use it.
2972 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
2973
29742008-11-18 Akim Demaille <demaille@gostai.com>
2975
2976 Remove incorrect mode specification.
2977 * data/glr.cc: Don't pretend it's C code.
2978
29792008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2980
2981 Simplify last patch slightly.
2982 * src/getargs.c (getargs): Here.
2983
29842008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2985
2986 Fix last warning from --enable-gcc-warnings.
2987 * src/getargs.c (getargs): Don't assign const address to non-const
2988 pointer.
2989
29902008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2991
2992 Don't let maintainer-*-check targets force a version update.
2993 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2994 handled.
2995
29962008-11-17 Di-an Jan <dianj@freeshell.org>
2997
2998 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2999 Align menus. Adjust word wrapping. Use node names for menu names.
3000 (Examples): Don't abbreviate node names.
3001 (LocalWords): Remove abbreviations.
3002 (Copying): Make description a sentence.
3003 (Java Action Features): Remove period to match the rest of menu.
3004
30052008-11-17 Di-an Jan <dianj@freeshell.org>
3006
3007 Handles several --enable-gcc-warnings.
3008 * src/getargs.c (command_line_location): Set parameters to void.
3009 * src/output.c (symbol_type_name_cmp): Make static.
3010 (symbols_by_type_name): Set parameters to void.
3011 (symbol_definitions_output): Remove unused parameter. Rename as...
3012 (prepare_symbol_definitions): this.
3013 (muscles_output): Move symbol_definitions_output to...
3014 (output): here as prepare_symbol_definitions.
3015 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
3016 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
3017
30182008-11-17 Di-an Jan <dianj@freeshell.org>
3019
3020 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
3021 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
3022
30232008-11-16 Akim Demaille <demaille@gostai.com>
3024
3025 Add missing $(EXEEXT).
3026 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
3027 "src/bison$(EXEEXT)".
3028 Reported by Di-an Jan.
3029
30302008-11-15 Akim Demaille <demaille@gostai.com>
3031
3032 * TODO: Update.
3033
30342008-11-15 Akim Demaille <demaille@gostai.com>
3035
3036 Formatting changes.
3037 * tests/input.at: here.
3038
30392008-11-15 Akim Demaille <demaille@gostai.com>
3040
3041 Remove duplicate header inclusion.
3042 * src/LR0.c: here.
3043
30442008-11-15 Akim Demaille <demaille@gostai.com>
3045
3046 * src/parse-gram.h, src/parse-gram.c: Regen.
3047
30482008-11-15 Akim Demaille <demaille@gostai.com>
3049
3050 Support parametric types.
3051
3052 There are two issues to handle: first scanning nested angle
3053 bracket pairs to support types such as std::pair< std::string,
3054 std::list<std::string> > >.
3055
3056 Another issue is to address idiosyncracies of C++: do not glue two
3057 closing angle brackets together (otherwise it's operator>>), and
3058 avoid sticking blindly a TYPE to the opening <, as it can result
3059 in '<:' which is a digraph for '['.
3060
3061 * src/scan-gram.l (brace_level): Rename as...
3062 (nesting): this.
3063 (SC_TAG): New.
3064 Implement support for complex tags.
3065 (tag): Accept
3066 , but not <.
3067 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
3068 (b4_symbol_variant): Leave space around types as parameters.
3069 * examples/variant.yy: Use nested template types and leading ::.
3070 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
3071 Rename as...
3072 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
3073 * tests/c++.at: Test parametric types.
3074
30752008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3076
3077 Test token.prefix.
3078 This is not sufficient, but we test at least that the make_SYMBOL
3079 interface is not affected by token.prefix. A more general test
3080 will be implemented when the support of token.prefix is generalized
3081 to more skeletons.
3082
3083 * tests/c++.at: One more variant test, using token.prefix.
3084
30852008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3086
3087 Test the make_TOKEN interface.
3088 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
3089 Factor the common code in yylex.
3090 Use it to test "%define lex_symbol".
3091
30922008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3093
3094 Formatting change.
3095
30962008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3097
3098 Simplify code for variants bench marks.
3099 * etc/bench.pl.in (&generate_grammar_list): Define and use
3100 location_type.
3101 Factor the common code in yylex.
3102
31032008-11-15 Akim Demaille <demaille@gostai.com>
3104
3105 Better error message.
3106 * bootstrap (find_tool): Fix the error message.
3107
31082008-11-15 Akim Demaille <demaille@gostai.com>
3109
3110 Update variant.yy to newest interface.
3111 * examples/variant.yy: Define lex_symbol.
3112 Adjust.
3113
31142008-11-15 Akim Demaille <demaille@gostai.com>
3115
3116 Don't use locations in variant.yy.
3117 * examples/variant.yy: Adjust to not using locations.
3118
31192008-11-15 Akim Demaille <demaille@gostai.com>
3120
3121 Comment changes.
3122 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
3123 comments for the license.
3124
31252008-11-15 Akim Demaille <demaille@gostai.com>
3126
3127 Remove tests/Makefile.am.
3128 * tests/Makefile.am: Rename as...
3129 * tests/local.mk: this.
3130 * Makefile.am, configure.ac: Adjust.
3131 * Makefile.am (DISTCLEANFILES): Define.
3132 (maintainer-check, maintainer-xml-check, maintainer-push-check):
3133 Remove, we no longer need to bounce to the real targets.
3134
31352008-11-15 Akim Demaille <demaille@gostai.com>
3136
3137 Comment changes.
3138
31392008-11-15 Akim Demaille <demaille@gostai.com>
3140
3141 djgpp/local.mk.
3142 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
3143 * djgpp/local.mk: this new file.
3144
31452008-11-15 Akim Demaille <demaille@gostai.com>
3146
3147 Remove doc/Makefile.am.
3148 * doc/Makefile.am: Rename as...
3149 * doc/local.mk: this.
3150 Adjust paths
3151 * Makefile.am, configure.ac: Adjust.
3152 * Makefile.am (MOSTLYCLEANFILES): New.
3153 * src/local.mk: Adjust.
3154
31552008-11-15 Akim Demaille <demaille@gostai.com>
3156
3157 Move sc_tight_scope into maint.mk.
3158 It does not work, and I don't know how it was supposed to work: it
3159 seems to be looking for sources in the build tree. I just moved
3160 it at a better place, fixing it is still required.
3161
3162 * src/local.mk (echo): Remove.
3163 (sc_tight_scope): Move to...
3164 * maint.mk: here.
3165
31662008-11-15 Akim Demaille <demaille@gostai.com>
3167
3168 Regen.
3169 * src/parse-gram.h, src/parse-gram.h: Regen.
3170
31712008-11-15 Akim Demaille <demaille@gostai.com>
3172
3173 Remove src/Makefile.am.
3174 * src/Makefile.am: Rename as...
3175 * src/local.mk: this.
3176 Prefix all the paths with src/.
3177 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
3178 (AM_CPPFLAGS): Find find in builddir/src.
3179 (YACC): Move the flags into...
3180 (AM_YFLAGS): here.
3181 * maint.mk (sc_tight_scope): Disable.
3182 It used to bounce to the version in src/Makefile.am which is now
3183 part of this very Makefile.
3184 * Makefile.am, configure.ac: Adjust.
3185 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
3186 include "..." to find files "here": we are no longer in src/, so
3187 qualify the includes with src/.
3188 * doc/Makefile.am (PREPATH): No longer include the top_builddir
3189 prefix.
3190 (.x.1): Adjust to be able to create src/foo from the top level
3191 Makefile, instead of going bounce to src/Makefile the creation of
3192 foo.
3193
31942008-11-15 Akim Demaille <demaille@gostai.com>
3195
3196 Remove useless variable.
3197 * doc/Makefile.am (srcsrcdir): Remove.
3198
31992008-11-15 Akim Demaille <demaille@gostai.com>
3200
3201 Remove data/Makefile.am.
3202 * data/Makefile.am: Rename as...
3203 * data/local.mk: this.
3204 Adjust paths.
3205 * Makefile.am, configure.ac: Adjust.
3206
32072008-11-15 Akim Demaille <demaille@gostai.com>
3208
3209 Remove etc/Makefile.am.
3210 * etc/Makefile.am: Rename as...
3211 * etc/local.mk: this.
3212 Adjust.
3213 * Makefile.am, configure.ac: Adjust.
3214
32152008-11-15 Akim Demaille <demaille@gostai.com>
3216
3217 Remove examples/local.mk.
3218 examples/calc++/Makefile.am might be interesting to keep as is, since
3219 it is an example in itself.
3220
3221 * examples/Makefile.am: Rename as...
3222 * examples/local.mk: this.
3223 Adjust.
3224 * Makefile.am, configure.ac: Adjust.
3225
32262008-11-15 Akim Demaille <demaille@gostai.com>
3227
3228 Remove build-aux/Makefile.am.
3229 Recursive Makefiles are really way too slow, let's get rid of some of
3230 them.
3231
3232 * build-aux/Makefile.am: Rename as...
3233 * build-aux/local.mk: this.
3234 Adjust paths.
3235 * Makefile.am, configure.ac: Adjust.
3236
32372008-11-15 Akim Demaille <demaille@gostai.com>
3238
3239 Provide convenience constructors for locations and positions.
3240 * data/location.cc (position::position): Accept file, line and
3241 column as arguments with default values.
3242 Always qualify initial line and column literals as unsigned.
3243 (location::location): Provide convenience constructors.
3244
32452008-11-15 Akim Demaille <demaille@gostai.com>
3246
3247 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
3248 token type.
3249 Using template buys us nothing, and makes it uselessly complex to
3250 construct a symbol. Besides, it could not be generalized to other
3251 languages, while make_FOO would work in C/Java etc.
3252
3253 * data/lalr1.cc (b4_symbol_): New.
3254 (b4_symbol): Use it.
3255 (b4_symbol_constructor_declaration_)
3256 (b4_symbol_constructor_definition_): Instead of generating
3257 specializations of an overloaded template function, just generate
3258 several functions whose names are forged from the token names
3259 without the token.prefix.
3260 (b4_symbol_constructor_declarations): Generate them for all the
3261 symbols, not just by class of symbol type, now that instead of
3262 specializing a function template by the token, we generate a
3263 function named after the token.
3264 (b4_symbol_constructor_specialization_)
3265 (b4_symbol_constructor_specializations): Remove.
3266 * etc/bench.pl.in: Adjust to this new API.
3267
32682008-11-13 Akim Demaille <demaille@gostai.com>
3269
3270 %define token.prefix.
3271 Provide a means to add a prefix to the name of the tokens as
3272 output in the generated files. Because of name clashes, it is
3273 good to have such a prefix such as TOK_ that protects from names
3274 such as EOF, FILE etc. But it clutters the grammar itself.
3275
3276 * data/bison.m4 (token.prefix): Empty by default.
3277 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
3278 * data/lalr1.cc (b4_symbol): Ditto.
3279
32802008-11-13 Akim Demaille <demaille@gostai.com>
3281
3282 Compute at M4 time some of the subtractions.
3283 * data/lalr1.cc (b4_subtract): New.
3284 (b4_rhs_data): Use it.
3285
32862008-11-13 Akim Demaille <demaille@gostai.com>
3287
3288 symbol::token.
3289 This allows the user to get the type of a token returned by yylex.
3290
3291 * data/lalr1.cc (symbol::token): New.
3292 (yytoknum_): Define when %define lex_symbol, independently of
3293 %debug.
3294 (yytoken_number_): Move into...
3295 (symbol::token): here, since that's the only use.
3296 The other one is YYPRINT which was not officially supported
3297 by lalr1.cc, and anyway it did not work since YYPRINT uses this
3298 array under a different name (yytoknum).
3299
33002008-11-13 Akim Demaille <demaille@gostai.com>
3301
3302 YYERRCODE.
3303 * TODO (YYERRCODE): Mention the case of $undef.
3304
33052008-11-13 Akim Demaille <demaille@gostai.com>
3306
3307 TODO: YYPRINT.
3308 * TODO (YYPRINT): New.
3309
33102008-11-13 Akim Demaille <demaille@gostai.com>
3311
3312 Comment changes.
3313 * data/lalr1.cc, data/yacc.c: Fix the description of the
3314 yytranslate and yytoknum tables.
3315
33162008-11-13 Akim Demaille <demaille@gostai.com>
3317
3318 Define make_symbol in the header.
3319 To reach good performances these functions should be inlined (yet
3320 this is to measure precisely). To this end they must be available
3321 to the caller.
3322
3323 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
3324 location_type with the class name.
3325 Since will now be output in the header, declare "inline".
3326 No longer use b4_symbol_constructor_specializations, but
3327 b4_symbol_constructor_definitions in the header.
3328 Don't call it in the *.cc file.
3329
33302008-11-13 Akim Demaille <demaille@gostai.com>
3331
3332 Define yytranslate in the header for lex_symbol.
3333 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
3334 into the header file when using %define lex_symbol.
3335 (yytranslate_): Declare inline.
3336
33372008-11-13 Akim Demaille <demaille@gostai.com>
3338
3339 Define the constructors of symbol_type in
3340 b4_symbol_constructor_definitions.
3341 The constructors are called by the make_symbol functions, which a
3342 forthcoming patch will move elsewhere. Hence the interest of
3343 putting them together.
3344
3345 The stack_symbol_type does not need to be moved, it is used only
3346 by the parser.
3347
3348 * data/lalr1.cc: Move symbol_type and symbol_base_type
3349 constructors into...
3350 (b4_symbol_constructor_definitions): here.
3351 Adjust.
3352
33532008-11-13 Akim Demaille <demaille@gostai.com>
3354
3355 Make it easier to move the definition of yytranslate_.
3356 Forthcoming changes will make it possible to use yytranslate_
3357 from outside the parser implementation file.
3358
3359 * data/lalr1.cc (b4_yytranslate_definition): New.
3360 Use it.
3361
33622008-11-13 Akim Demaille <demaille@gostai.com>
3363
3364 Remove useless class specification.
3365 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
3366 to refer to the class name to use a type defined by the class for
3367 arguments of member functions.
3368
33692008-11-13 Akim Demaille <demaille@gostai.com>
3370
3371 Finer input type for yytranslate.
3372 This patch is debatable: the tradition expects yylex to return an int
3373 which happens to correspond to token_number (which is an enum). This
3374 allows for instance to return characters (such as '*' etc.). But this
3375 goes against the stronger typing I am trying to have with the new
3376 lex interface which return a symbol_type. So in this case, feed
3377 yytranslate_ with a token_type.
3378
3379 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
3380 expect a token_type.
3381
33822008-11-13 Akim Demaille <demaille@gostai.com>
3383
3384 Honor lex-params in %define lex_symbol mode.
3385 * data/lalr1.cc: Use b4_lex_param.
3386
33872008-11-13 Akim Demaille <demaille@gostai.com>
3388
3389 Simplify names.
3390 * src/output.c (symbol_definitions_output): Rename symbol
3391 attributes type_name and has_type_name as type and has_type.
3392 * data/lalr1.cc: Adjust uses.
3393
33942008-11-13 Akim Demaille <demaille@gostai.com>
3395
3396 Use b4_type_names for the union type.
3397 The union used to compute the size of the variant used to iterate
3398 over the type of all the symbols, with a lot of redundancy. Now
3399 iterate over the lists of symbols having the same type-name.
3400
3401 * data/lalr1.cc (b4_char_sizeof_): New.
3402 (b4_char_sizeof): Use it.
3403 Adjust to be called with a list of numbers instead of a single
3404 number.
3405 Adjust its caller for new-line issues.
3406
34072008-11-13 Akim Demaille <demaille@gostai.com>
3408
3409 Define the "identifier" of a symbol.
3410 Symbols may have several string representations, for instance if
3411 they have an alias. What I call its "id" is a string that can be
3412 used as an identifier. May not exist.
3413
3414 Currently the symbols which have the "tag_is_id" flag set are
3415 those that don't have an alias. Look harder for the id.
3416
3417 * src/output.c (is_identifier): Move to...
3418 * src/symtab.c (is_identifier): here.
3419 * src/symtab.h, src/symtab.c (symbol_id_get): New.
3420 * src/output.c (symbol_definitions_output): Use it to define "id"
3421 and "has_id".
3422 Remove the definition of "tag_is_id".
3423 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
3424 "tag_is_id" were used to produce code.
3425 We still use "tag" for documentation.
3426
34272008-11-11 Akim Demaille <demaille@gostai.com>
3428
3429 Locations are no longer required by lalr1.cc.
3430 * data/lalr1.cc (_b4_args, b4_args): New.
3431 Adjust all uses of locations to make them optional.
3432 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
3433 (AT_CHECK_NAMESPACE): Check the use of locations.
3434 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
3435 without locations with lalr1.cc.
3436 Test these cases.
3437 * tests/output.at: Check lalr1.cc with and without location
3438 support.
3439 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
3440 Don't use locations.
3441
34422008-11-11 Akim Demaille <demaille@gostai.com>
3443
3444 AT_FULL_COMPILE.
3445 * tests/local.at (AT_FULL_COMPILE): New.
3446 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
3447
34482008-11-11 Akim Demaille <demaille@gostai.com>
3449
3450 Support parens in calc++.
3451 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
3452 * examples/calc++/test (run): Check the expected output.
3453 Adjust callers.
3454 Check parens too.
3455
34562008-11-11 Akim Demaille <demaille@gostai.com>
3457
3458 Simplify lalr1.cc since %defines is mandatory.
3459 * data/lalr1.cc: Remove useless calls to b4_defines_if.
3460
34612008-11-11 Akim Demaille <demaille@gostai.com>
3462
3463 TODO: yyfmt.
3464 * TODO (yysyntax_error): New item.
3465
34662008-11-11 Akim Demaille <demaille@gostai.com>
3467
3468 Prefer M4 to CPP.
3469 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
3470 YYERROR_VERBOSE.
3471
34722008-11-11 Akim Demaille <demaille@gostai.com>
3473
3474 Support i18n of the parse error messages.
3475 * TODO (lalr1.cc/I18n): Remove.
3476 * data/lalr1.cc (yysyntax_error_): Support the translation of the
3477 error messages, as done in yacc.c.
3478 Stay within the yy* pseudo namespace.
3479
34802008-11-11 Akim Demaille <demaille@gostai.com>
3481
3482 More TODO.
3483 * TODO (single stack, yysyntax_error): New.
3484
34852008-11-11 Akim Demaille <demaille@gostai.com>
3486
3487 Make it possible to return a symbol_type from yylex.
3488 * data/lalr1.cc (b4_lex_symbol_if): New.
3489 (parse): When lex_symbol is defined, expected yylex to return the
3490 complete lookahead.
3491 * etc/bench.pl.in (generate_grammar_list): Extend to support this
3492 yylex interface.
3493 (bench_variant_parser): Exercise it.
3494
34952008-11-11 Akim Demaille <demaille@gostai.com>
3496
3497 Remove useless bench case.
3498 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
3499 no longer used.
3500
35012008-11-11 Akim Demaille <demaille@gostai.com>
3502
3503 Improve display of directives.
3504 * etc/bench.pl.in (parse_term): Don't add useless eol.
3505
35062008-11-11 Akim Demaille <demaille@gostai.com>
3507
3508 Use string_cast in the bench.
3509 * etc/bench.pl.in (generate_grammar_list): Define and use
3510 string_cast.
3511
35122008-11-11 Akim Demaille <demaille@gostai.com>
3513
3514 Replace yychar with a Boolean.
3515 * data/lalr1.cc (parse::yychar): Replace by...
3516 (parse::yyempty): this.
3517
35182008-11-11 Akim Demaille <demaille@gostai.com>
3519
3520 Factor the tables.
3521 * TODO: New item.
3522
35232008-11-11 Akim Demaille <demaille@gostai.com>
3524
3525 Let yytranslate handle the eof case.
3526 * data/lalr1.cc (yytranslate_): Handle the EOF case.
3527 Adjust callers.
3528 No longer expect yychar to be equal to yyeof_, rather, test the
3529 lookahead's (translated) kind.
3530
35312008-11-11 Akim Demaille <demaille@gostai.com>
3532
3533 yychar cannot be empty in yyerrlab.
3534 * TODO (yychar == yyempty_): New.
3535 * data/lalr1.cc: Remove the handling of this case.
3536 This eases forthcoming changes related to yychar and yytranslate.
3537
35382008-11-11 Akim Demaille <demaille@gostai.com>
3539
3540 Bench: syntactic sugar for %define/#define.
3541 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
3542 (&bench_push_parser, bench_variant_parser): Use this feature.
3543 (&eat): New.
3544 Use it.
3545
35462008-11-11 Akim Demaille <demaille@gostai.com>
3547
3548 Less memory pressure on the "list" bench.
3549 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
3550 the values, to limit memory pressure.
3551
35522008-11-11 Akim Demaille <demaille@gostai.com>
3553
3554 Introduce make_symbol.
3555 make_symbol provides a means to construct a full symbol (kind,
3556 value, location) in a single shot. It is meant to be a Symbol
3557 constructor, parameterized by the symbol kind so that overloading
3558 would prevent incorrect kind/value pairs. Unfortunately
3559 parameterized constructors do not work well in C++ (unless the
3560 parameter also appears as an argument, which is not acceptable),
3561 hence the use of a function instead of a constructor.
3562
3563 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3564 (b4_symbol_constructor_declarations)
3565 (b4_symbol_constructor_specialization_)
3566 (b4_symbol_constructor_specializations)
3567 (b4_symbol_constructor_definition_)
3568 (b4_symbol_constructor_definitions): New.
3569 Use them where appropriate to generate declaration, declaration of
3570 the specializations, and implementations of the templated
3571 overloaded function "make_symbol".
3572 (variant::variant): Always define a default ctor.
3573 Also provide a copy ctor.
3574 (symbol_base_type, symbol_type): New ctor overloads for value-less
3575 symbols.
3576 (symbol_type): Now public, so that functions such as yylex can use
3577 it.
3578
35792008-11-11 Akim Demaille <demaille@gostai.com>
3580
3581 Inform m4 whether a tag is a valid id.
3582 * src/output.c (is_identifier): New.
3583 (symbol_definitions_output): Use it to define tag_is_id.
3584 But maybe this should be done at m4 level?
3585
35862008-11-11 Akim Demaille <demaille@gostai.com>
3587
3588 Test 214 was failing: it greps with a pattern containing [ ]*
3589 which obviously meant to catch spaces and tabs, but contained only
3590 spaces. Tabulations in sources are a nuisance, so to simplify the
3591 matter, get rid of all the tabulations in the Java sources. The
3592 other skeletons will be treated equally later.
3593
3594 * data/java.m4, data/lalr1.java: Untabify.
3595 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
3596 tabulations are no longer generated.
3597
35982008-11-11 Paolo Bonzini <bonzini@gnu.org>
3599
3600 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3601 * configure.ac: Adjust usage.
3602 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3603 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3604 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3605
36062008-11-10 Di-an Jan <dianj@freeshell.org>
3607
3608 Workaround Java's ``code too large'' problem for parser tables
3609 in most cases, by using one function per initialization.
3610 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
3611 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
3612 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
3613 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
3614 (yytname_): Use b4_typed_parser_table.
3615 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
3616 ``code too large'' error.
3617
36182008-11-10 Di-an Jan <dianj@freeshell.org>
3619
3620 * NEWS: Document them.
3621
3622 General Java skeleton improvements.
3623 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
3624 using gcj < 4.3 in the testsuite, according to comments in
3625 gnulib/m4/javacomp.m4.
3626 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
3627 location_type, position_type): Remove extraneous brackets from
3628 b4_percent_define_default.
3629 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
3630 m4_define and m4_define_default.
3631 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
3632 which marks the end of user code with appropriate syncline, like all
3633 the other skeletons.
3634 (b4_user_post_prologue): Add. Don't silently drop.
3635 (yylex): Remove.
3636 (parse): Inline yylex.
3637 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
3638 (%{...%}): Fix typo of %code imports.
3639 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
3640
3641 Support annotations on parser class with %define annotations.
3642 * data/lalr1.java (annotations): Add to parser class modifier.
3643 * doc/bison.texinfo (Java Parser Interface): Document
3644 %define annotations.
3645 (Java Declarations Summary): Document %define annotations.
3646 * tests/java.at (Java parser class modifiers): Test annotations.
3647
3648 Do not generate code for %error-verbose unless requested.
3649 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
3650 Make private. Make conditional on %error-verbose.
3651 (getErrorVerbose, setErrorVerbose): New.
3652 (yytnamerr_): Make conditional on %error-verbose.
3653 (yysyntax_error): Make some code conditional on %error-verbose.
3654 * doc/bison.texinfo (Java Bison Interface): Remove the parts
3655 about %error-verbose having no effect.
3656 (getErrorVerbose, setErrorVerbose): Document.
3657
3658 Move constants for token names to Lexer interface.
3659 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
3660 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
3661 (parse): Qualify EOF to Lexer.EOF.
3662 * doc/bison.texinfo (Java Parser Interface): Move documentation of
3663 EOF and token names to Java Lexer Interface.
3664 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
3665
3666 Make yyerror public.
3667 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
3668 (yyerror): Change to public. Add Javadoc comments. Use longer
3669 parameter names. Make the body rather than the declarator
3670 conditional on %locations.
3671 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
3672
3673 Allow user to add code to the constructor with %code init.
3674 * data/java.m4 (b4_init_throws): New, for %define init_throws.
3675 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
3676 Add %code init to the front of the constructor body.
3677 * doc/bison.texinfo (YYParser.YYParser): Document %code init
3678 and %define init_throws.
3679 (Java Declarations Summary): Document %code init and
3680 %define init_throws.
3681 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
3682 (Java constructor init and init_throws): Add tests.
3683
36842008-11-10 Akim Demaille <demaille@gostai.com>
3685
3686 Update TODO.
3687 * TODO (-D): is implemented.
3688 (associativity): Same precedence must have the same associativity.
3689 For instance, how can a * b / c be parsed if * is %left and / is
3690 %right?
3691 (YYERRORCODE, YYFAIL, YYBACKUP): New.
3692
36932008-11-10 Akim Demaille <demaille@gostai.com>
3694
3695 Formatting changes.
3696
36972008-11-10 Akim Demaille <demaille@gostai.com>
3698
3699 More information about the symbols.
3700 * src/output.c (type_names_output): Document all the symbols,
3701 including those that don't have a type-name.
3702 (symbol_definitions_output): Define "is_token" and
3703 "has_type_name".
3704 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
3705 type-name, now that they are defined too in b4_type_names.
3706
37072008-11-10 Akim Demaille <demaille@gostai.com>
3708
3709 Regen.
3710
37112008-11-10 Akim Demaille <demaille@gostai.com>
3712
3713 Make parser::yytranslate static.
3714 Small speedup (1%) on the list grammar. And makes yytranslate_
3715 available in non member functions.
3716
3717 * data/lalr1.cc (yytranslate_): Does not need to be a instance
3718 function.
3719
37202008-11-10 Akim Demaille <demaille@gostai.com>
3721
3722 Avoid trailing spaces.
3723 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
3724 * data/lalr1.cc: Don't indent before rule and symbol actions, as
3725 they can be empty, and anyway this incorrectly indents the first
3726 action.
3727
37282008-11-10 Akim Demaille <demaille@gostai.com>
3729
3730 Comment changes.
3731
37322008-11-10 Akim Demaille <demaille@gostai.com>
3733
3734 Use "enum" for integral constants.
3735 This is just nicer to read, I observed no speedup.
3736
3737 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
3738 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
3739 (yyuser_token_number_max_, yyundef_token_): Move into...
3740 (yytranslate_): here.
3741
37422008-11-10 Akim Demaille <demaille@gostai.com>
3743
3744 Shortcuts in bench directives.
3745 * etc/bench.pl.in (parse_dirs): New.
3746 Use it.
3747 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
3748 Create the benches in "benches/".
3749
37502008-11-10 Akim Demaille <demaille@gostai.com>
3751
3752 Formatting changes.
3753 * data/lalr1.cc: here.
3754
37552008-11-10 Akim Demaille <demaille@gostai.com>
3756
3757 Adjust verbose message to using emacs.
3758 * etc/bench.pl.in: Inform compilation-mode when we change the
3759 directory.
3760 (generate_grammar_list): Recognize %define "variant" in addition
3761 to %define variant.
3762
37632008-11-10 Akim Demaille <demaille@gostai.com>
3764
3765 Classify symbols by type-name.
3766 * src/uniqstr.h (UNIQSTR_CMP): New.
3767 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
3768 (type_names_output): New.
3769 (muscles_output): Use it.
3770 * data/lalr1.cc (b4_symbol_action_): Remove.
3771 (b4_symbol_case_, b4_type_action_): New.
3772 Adjust uses of b4_symbol_action_ to use b4_type_action_.
3773
37742008-11-10 Akim Demaille <demaille@gostai.com>
3775
3776 Change the handling of the symbols in the skeletons.
3777 Before we were using tables which lines were the symbols and which
3778 columns were things like number, tag, type-name etc. It is was
3779 difficult to extend: each time a column was added, all the numbers had
3780 to be updated (you asked for colon $2, not for "tag"). Also, it was
3781 hard to filter these tables when only a subset of the symbols (say the
3782 tokens, or the nterms, or the tokens that have and external number
3783 *and* a type-name) was of interest.
3784
3785 Now instead of monolithic tables, we define one macro per cell. For
3786 instance "b4_symbol(0, tag)" is a macro name which contents is
3787 self-decriptive. The macro "b4_symbol" provides easier access to
3788 these cells.
3789
3790 * src/output.c (type_names_output): Remove.
3791 (symbol_numbers_output, symbol_definitions_output): New.
3792 (muscles_output): Call them.
3793 (prepare_symbols): Define b4_symbols_number.
3794
37952008-11-10 Akim Demaille <demaille@gostai.com>
3796
3797 --trace=muscles
3798 * src/getargs.h, src/getargs.c (trace_muscle): New.
3799 (trace_types, trace_args): Support it.
3800 * src/output.c (output_skeleton): Use it.
3801
38022008-11-10 Akim Demaille <demaille@gostai.com>
3803
3804 muscles_output.
3805 * src/output.c (muscles_output): New, extracted from...
3806 (output_skeleton): here.
3807 Adjust.
3808
38092008-11-10 Akim Demaille <demaille@gostai.com>
3810
3811 Formatting changes.
3812
38132008-11-10 Akim Demaille <demaille@gostai.com>
3814
3815 Update the variant example.
3816 * examples/variant.yy: Formatting changes.
3817 One stage build.
3818
38192008-11-10 Akim Demaille <demaille@gostai.com>
3820
3821 Support constructor with an argument.
3822 This improves the "list" bench by 2%.
3823
3824 * data/lalr1.cc (variant::build): Add an overloaded version with
3825 an argument.
3826 * tests/c++.at (AT_CHECK_VARIANT): Check it.
3827
38282008-11-10 Akim Demaille <demaille@gostai.com>
3829
3830 Test variants.
3831 * tests/c++.at (AT_CHECK_VARIANTS): New.
3832 Use it with and without %define assert.
3833
38342008-11-10 Akim Demaille <demaille@gostai.com>
3835
3836 Add %precedence support.
3837 Unfortunately it is not possible to reuse the %prec directive. This
3838 is because to please POSIX, we do not require to end the rules with a
3839 semicolon. As a result,
3840
3841 foo: bar %prec baz
3842
3843 is ambiguous: either a rule which precedence is that of baz, or a rule,
3844 and then a declaration of the precedence of the token baz.
3845
3846 * doc/bison.texinfo: Document %precedence.
3847 (Precedence Only): New.
3848 * src/assoc.h, src/assoc.c (precedence_assoc): New.
3849 * src/conflicts.c (resolve_sr_conflict): Support it.
3850 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
3851 Parse it.
3852 * tests/calc.at: Use %precedence for NEG.
3853 * tests/conflicts.at (%precedence does not suffice)
3854 (%precedence suffices): New tests.
3855
38562008-11-09 Akim Demaille <demaille@gostai.com>
3857
3858 Make benches in a sub dirs.
3859 * etc/bench.pl.in ($dir): New.
3860 Use it.
3861 Check the use of constructors with an argument.
3862 (bench_variant_parser): Fix.
3863
38642008-11-09 Akim Demaille <demaille@gostai.com>
3865
3866 fix eof condition
3867
38682008-11-09 Akim Demaille <demaille@gostai.com>
3869
3870 Fix --help.
3871
38722008-11-09 Akim Demaille <demaille@gostai.com>
3873
3874 Require the generation of parse-gram.output.
3875 * src/Makefile.am (YACC): Pass --report=all.
3876
38772008-11-09 Akim Demaille <demaille@gostai.com>
3878
3879 Formatting changes.
3880
38812008-11-09 Akim Demaille <demaille@gostai.com>
3882
3883 Update TODO.
3884 * TODO: Remove obsolete items.
3885 Update others.
3886
38872008-11-09 Akim Demaille <demaille@gostai.com>
3888
3889 Enhance bench.pl.
3890 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
3891 (@token, $grammar, $bench): New.
3892 (generate_grammar_variant): Rename as...
3893 (generate_grammar_list): this.
3894 (generate_grammar): Adjust.
3895 (bench_grammar): Rename as...
3896 (bench): this.
3897 Use it in the various bench-marking routines.
3898 (-b, -g): New options.
3899
39002008-11-09 Akim Demaille <demaille@gostai.com>
3901
3902 Use a static hierarchy for symbols in the C++ parser.
3903 * data/lalr1.cc (symbol_base_type, symbol_type)
3904 (stack_symbol_type): Make it a static hierarchy.
3905 Adjust dependencies.
3906
39072008-11-09 Akim Demaille <demaille@gostai.com>
3908
3909 bench.pl -d, --directive.
3910 * etc/bench.pl.in (@directive): New.
3911 (&bench_grammar): Use it.
3912 (&bench_list_grammar): New, to provide access to the "variant"
3913 grammar.
3914 Use it.
3915 (getopts): Support -d, --directive.
3916
39172008-11-09 Akim Demaille <demaille@gostai.com>
3918
3919 Use inline for small operations.
3920 * data/lalr1.cc (symbol_base_type, symbol_type)
3921 (stack_symbol_type): Declare constructor and other operations as
3922 inline.
3923 (yy_destroy_): Inline.
3924
39252008-11-09 Akim Demaille <demaille@gostai.com>
3926
3927 Introduce a hierarchy for symbols.
3928 * data/lalr1.cc (symbol_base_type, symbol_type): New.
3929 (data_type): Rename as...
3930 (stack_symbol_type): this.
3931 Derive from symbol_base_type.
3932 (yy_symbol_value_print_): Merge into...
3933 (yy_symbol_print_): this.
3934 Rename as...
3935 (yy_print_): this.
3936 (yydestruct_): Rename as...
3937 (yy_destroy_): this.
3938 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
3939 (parser::parse): yyla is now of symbol_type.
3940 Use its type member instead of yytoken.
3941
39422008-11-09 Akim Demaille <demaille@gostai.com>
3943
3944 Rename data_type and stack_symbol_type.
3945 * data/lalr1.cc (data_type): Rename as...
3946 (stack_symbol_type): this.
3947
39482008-11-09 Akim Demaille <demaille@gostai.com>
3949
3950 Handle semantic value and location together.
3951 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
3952 yydata.value and yydata.location.
3953 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
3954 (YY_SYMBOL_PRINT): Now take semantic value and location as a
3955 single arg.
3956 Adjust all callers.
3957 (yydestruct_): New overload for a stack symbol.
3958
39592008-11-09 Akim Demaille <demaille@gostai.com>
3960
3961 Push a complete symbol, not connected parts.
3962 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
3963 state, value and location.
3964 Adjust callers.
3965
39662008-11-09 Akim Demaille <demaille@gostai.com>
3967
3968 Agregate yylval and yylloc.
3969 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
3970 (parser::yyla): this.
3971
39722008-11-09 Akim Demaille <demaille@gostai.com>
3973
3974 Rely on the state stack to display reduction traces.
3975 To display rhs symbols before a reduction, we used information
3976 about the rule reduced, which required the tables yyrhs and
3977 yyprhs. Now use rely only on the state stack to get the same
3978 information.
3979
3980 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
3981 Use them.
3982 (parser::yyrhs_, parser::yyprhs_): Remove.
3983 (parser::yy_reduce_print_): Use the state stack.
3984
39852008-11-09 Akim Demaille <demaille@gostai.com>
3986
3987 Fuse yyval and yyloc into yylhs.
3988 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
3989 yylhs.
3990 (parse): Replace yyval and yyloc with yylhs.value and
3991 yylhs.location.
3992 After a user action, compute yylhs.state earlier.
3993 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
3994 fresh error_token.
3995
39962008-11-09 Di-an Jan <dianj@freeshell.org>
3997
3998 Remove unused variable.
3999 * src/output.c (type_names_output): Remove unused variable sep.
4000
40012008-11-09 Paolo Bonzini <bonzini@gnu.org>
4002
4003 Change tests/output.at quoting.
4004 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
4005 expanding arguments.
4006
40072008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4008
4009 Don't add a semicolon to actions for %skeleton or %language.
4010 It breaks Java test cases as reported by Akim Demaille.
4011 * src/scan-code.l: Implement.
4012
40132008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4014
4015 Clean up %skeleton and %language priority implementation.
4016 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
4017 remove static qualifier because others will soon need to see it.
4018 (language_prio): Likewise.
4019 (getargs): Use command_line_prio rather than 0.
4020 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
4021 enum fields.
4022 (skeleton_prio): Extern it.
4023 (language_prio): Extern it.
4024 * src/parse-gram.y: Use grammar_prio rather than 1.
4025
40262008-11-07 Akim Demaille <demaille@gostai.com>
4027
4028 Moving push traces into yypush_.
4029 * data/lalr1.cc (yypush_): Now takes a optional trace message.
4030 Adjust all uses.
4031
40322008-11-07 Akim Demaille <demaille@gostai.com>
4033
4034 The single-stack C++ parser is now the standard one.
4035 * data/lalr1.cc: Rename as...
4036 * data/lalr1-split.cc: this.
4037 * data/lalr1-fusion.cc: Rename as...
4038 * data/lalr1.cc: this.
4039 * etc/bench.pl.in: Adjust.
4040
40412008-11-07 Akim Demaille <demaille@gostai.com>
4042
4043 Avoid empty-if warnings.
4044 Reported by Quentin Hocquet.
4045
4046 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
4047 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
4048
40492008-11-07 Akim Demaille <demaille@gostai.com>
4050
4051 Pass command line location to skeleton_arg and language_argmatch.
4052 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
4053 The location argument is now mandatory.
4054 Adjust all dependencies.
4055 (getargs): Use command_line_location.
4056
40572008-11-07 Akim Demaille <demaille@gostai.com>
4058
4059 -D, --define.
4060 * src/getargs.c (usage): Document -D.
4061 Fix help string for --locations.
4062 (command_line_location): New.
4063 (short_options, long_options, getargs): Support -D, --define.
4064 (getargs): Move -d support at the right place.
4065 * doc/bison.texinfo (Bison Options): Update.
4066 * tests/input.at (%define, --define): New.
4067
40682008-11-07 Akim Demaille <demaille@gostai.com>
4069
4070 Initialize the muscle table before parsing the command line.
4071 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
4072 (getargs): Define file_name.
4073 * src/main.c (main): Initialize muscle_tab before calling
4074 getargs.
4075 * src/muscle_tab.c (muscle_init): No longer define file_name, as
4076 its value is not available yet.
4077
40782008-11-07 Akim Demaille <demaille@gostai.com>
4079
4080 Locations without columns for command line arguments.
4081 * src/location.c (location_print): Don't display negative columns.
4082 * src/location.h: Document this.
4083
40842008-11-07 Akim Demaille <demaille@gostai.com>
4085
4086 Fix --help.
4087 * src/getargs.c (usage): Fix help string for -W.
4088
40892008-11-07 Akim Demaille <demaille@gostai.com>
4090
4091 Handle more general types of option arguments.
4092 * build-aux/cross-options.pl: The argument ends at the first
4093 space, not the first non-symbol character.
4094 Use @var for each word appearing the argument description.
4095
40962008-11-07 Akim Demaille <demaille@gostai.com>
4097
4098 Destroy the variants that remain on the stack in case of error.
4099 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
4100 destructor.
4101 Display the value only if yymsg is nonnull.
4102 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
4103
41042008-11-07 Akim Demaille <demaille@gostai.com>
4105
4106 Add "%define assert" to variants.
4107 This is used to help the user catch cases where some value gets
4108 ovewritten by a new one. This should not happen, as this will
4109 probably leak.
4110
4111 Unfortunately this uncovered a bug in the C++ parser itself: the
4112 lookahead value was not destroyed between two calls to yylex. For
4113 instance if the previous lookahead was a std::string, and then an int,
4114 then the value of the std::string was correctly taken (i.e., the
4115 lookahead was now an empty string), but std::string structure itself
4116 was not reclaimed.
4117
4118 This is now done in variant::build(other&) (which is used to take the
4119 value of the lookahead): other is not only stolen from its value, it
4120 is also destroyed. This incurs a new performance penalty of a few
4121 percent, and union becomes faster again.
4122
4123 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
4124 (b4_variant_if): New.
4125 (variant::built): New.
4126 Use it whereever the status of the variant changes.
4127 * etc/bench.pl.in: Check the penalty of %define assert.
4128
41292008-11-07 Akim Demaille <demaille@gostai.com>
4130
4131 Use "%define variant" in bench.pl.
4132 * etc/bench.pl.in: No longer use the pseudo directive %variants,
4133 just use %define variants.
4134
41352008-11-07 Akim Demaille <demaille@gostai.com>
4136
4137 Regen.
4138 * src/parse-gram.h, src/parse-gram.c: Regen.
4139
41402008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
4141
4142 Fix user actions without a trailing semicolon.
4143 Reported by Sergei Steshenko at
4144 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
4145 * THANKS (Sergei Steshenko): Add.
4146 * src/scan-code.l (SC_RULE_ACTION): Fix it.
4147 * tests/regression.at (Fix user actions without a trailing semicolon):
4148 New test case.
4149
41502008-11-04 Akim Demaille <demaille@gostai.com>
4151
4152 Use b4_copyright_years.
4153 * data/yacc.c (b4_copyright_years): New.
4154 Fix its value according to the comments in the file.
4155 Use it and undefine it.
4156
41572008-11-04 Akim Demaille <demaille@gostai.com>
4158
4159 Formatting changes.
4160 * data/lalr1-fusion.cc, src/parse-gram.y: here.
4161
41622008-11-04 Akim Demaille <demaille@gostai.com>
4163
4164 Formatting changes.
4165 * data/lalr1-fusion.cc: here.
4166
41672008-11-04 Akim Demaille <demaille@gostai.com>
4168
4169 Use strict on bench.pl.
4170 * etc/bench.pl.in (&run, &generate_grammar): New.
4171 Rename the grammar generating functions for consistency.
4172 Change the interface so that the list of benches to run is passed
4173 as (optionless) arguments.
4174 (&compile): Use &run.
4175
41762008-11-04 Akim Demaille <demaille@gostai.com>
4177
4178 Remove spurious initial empty lines.
4179 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
4180 * data/yacc.c: End the @output lines with an @.
4181
41822008-11-04 Akim Demaille <demaille@gostai.com>
4183
4184 Improve the display of sizes.
4185 * etc/bench.p.in: Higher precision.
4186 Sort by decreasing size.
4187
41882008-11-04 Akim Demaille <demaille@gostai.com>
4189
4190 Don't memcpy C++ structures.
4191 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
4192 arguments.
4193 (variant::build): New overload for
4194 copy-construction-that-destroys.
4195 (variant::swap): New.
4196 (parser::yypush_): Use it in variant mode.
4197
41982008-11-04 Akim Demaille <demaille@gostai.com>
4199
4200 Better defaults for bench.pl.
4201 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
4202 default values.
4203 Adjust &verbose uses.
4204 (-q, --quiet): New.
4205
42062008-11-04 Akim Demaille <demaille@gostai.com>
4207
4208 Make variant.yy more complex.
4209 std::list cannot be copied via memcpy, they are more demanding than
4210 std::string. Use one std::list to strengthen the test.
4211
4212 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
4213 Adjust.
4214 Create a list of strings, instead of a single large string.
4215
42162008-11-04 Akim Demaille <demaille@gostai.com>
4217
4218 bench.pl --bench.
4219 * etc/bench.pl.in (--bench, $bench): New.
4220
42212008-11-04 Akim Demaille <demaille@gostai.com>
4222
4223 Sort methods.
4224 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
4225 Define it after as().
4226
42272008-11-04 Akim Demaille <demaille@gostai.com>
4228
4229 Useless parens.
4230 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
4231
42322008-11-04 Akim Demaille <demaille@gostai.com>
4233
4234 Issue missing synclines after user actions.
4235 * data/c.m4 (b4_case): Issue synclines on the output file.
4236
42372008-11-04 Akim Demaille <demaille@gostai.com>
4238
4239 Remove trailing empty line.
4240 * data/lalr1-fusion.cc: Don't add an empty line after the user's
4241 epilogue.
4242
42432008-11-04 Akim Demaille <demaille@gostai.com>
4244
4245 Fix output of copyright years.
4246 * data/bison.m4 (b4_copyright): Fix the indentation of the
4247 copyright year paragraph.
4248 Use b4_copyright_years when no years are given.
4249 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
4250 (b4_copyright_years): New.
4251 Use it.
4252
42532008-11-04 Akim Demaille <demaille@gostai.com>
4254
4255 Avoid the spurious initial empty line.
4256 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
4257 the end of @output request to suppress the empty line that
4258 results.
4259
42602008-11-04 Akim Demaille <demaille@gostai.com>
4261
4262 Remove parser::rhs_number_type.
4263 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
4264 (yyrhs_): Use b4_table_define.
4265
42662008-11-04 Akim Demaille <demaille@gostai.com>
4267
4268 Fix iteration type.
4269 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
4270
42712008-11-04 Akim Demaille <demaille@gostai.com>
4272
4273 Factor the declaration of the integer tables.
4274 * data/lalr1-fusion.cc (b4_table_define): New.
4275 Use it.
4276
42772008-11-03 Akim Demaille <demaille@gostai.com>
4278
4279 Fix indentation of tables in lalr1.cc
4280 * data/lalr1-fusion.cc: Fix the indentation.
4281
42822008-11-03 Akim Demaille <demaille@gostai.com>
4283
4284 Destroy the lhs symbols after reduction.
4285 * data/lalr1-fusion.cc (parse): After the user action, when in
4286 variant mode, destroy the lhs symbols.
4287
42882008-11-03 Akim Demaille <demaille@gostai.com>
4289
4290 Simplify yysyntax_error_ use.
4291 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
4292 type, but make it unnamed in the declaration when it is not used.
4293
42942008-11-03 Akim Demaille <demaille@gostai.com>
4295
4296 Let yy::variant::build return an lvalue.
4297 * data/lalr1-fusion.cc (variant::build): Return a reference to the
4298 object.
4299
43002008-11-03 Akim Demaille <demaille@gostai.com>
4301
4302 Define yy::variant only when needed.
4303 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
4304 used.
4305
43062008-11-03 Akim Demaille <demaille@gostai.com>
4307
4308 Bench the three-stack lalr1.cc.
4309 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
4310 one-stack one.
4311
43122008-11-03 Akim Demaille <demaille@gostai.com>
4313
4314 Fail on parse error in calc++.
4315 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
4316 status.
4317 * examples/calc++/test ($me, $number, $exit, run): New.
4318 Use them to propagate errors to the exit status.
4319
43202008-11-03 Akim Demaille <demaille@gostai.com>
4321
4322 Don't specify the skeleton twice in the example.
4323 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
4324 file does what is needed.
4325
43262008-11-03 Akim Demaille <demaille@gostai.com>
4327
4328 bench: Improve output.
4329 * etc/bench.pl.in (bench_grammar): Tune the printf format.
4330
43312008-11-03 Akim Demaille <demaille@gostai.com>
4332
4333 bench: check impact of %debug on variants.
4334 * etc/bench.pl.in (variant_grammar): Fix the computation of
4335 $variant.
4336 Generate a grammar file that can work with or without %debug.
4337 Do use the @directive.
4338 (bench_variant_parser): Check impact of %debug.
4339 (@directives): Rename all the occurrences to...
4340 (@directive): this, for consistency.
4341
43422008-11-03 Akim Demaille <demaille@gostai.com>
4343
4344 bench: report the size too.
4345 * etc/bench.pl.in ($iterations): Defaults to -3.
4346 (&bench_grammar): Require hireswallclock.
4347 Compute and display the size of the result.
4348 More comments.
4349
43502008-11-03 Akim Demaille <demaille@gostai.com>
4351
4352 bench: More use of the verbosity level.
4353 * etc/bench.pl.in ($verbose, &verbose): New.
4354 Use them.
4355 More POD documentation.
4356
43572008-11-03 Akim Demaille <demaille@gostai.com>
4358
4359 bench.pl: a command line interface
4360 * etc/bench.pl.in: More doc.
4361 Some fixes in the documentation.
4362 ($cflags, $iterations, &help, &getopt): New.
4363 Use them.
4364 (&variant_grammar): Let the number of stages be 10 times what is
4365 specified.
4366
43672008-11-03 Akim Demaille <demaille@gostai.com>
4368
4369 Bench the use of Boost.Variants.
4370 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
4371 New.
4372 (&compile): Be ready to compile C++ parsers.
4373 (&bench_push_parser): Move debug information to the outermost
4374 level.
4375 * THANKS: Add Michiel De Wilde.
4376
43772008-11-03 Akim Demaille <demaille@gostai.com>
4378
4379 bench.pl: Pass directives as a list instead of as a string.
4380 * etc/bench.pl.in (&directives): New.
4381 (&triangular_grammar, &calc_grammar): Use it to format the Bison
4382 directives.
4383 (&triangular_grammar): Do use the directives (were ignored).
4384 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
4385 directives.
4386
43872008-11-03 Akim Demaille <demaille@gostai.com>
4388
4389 Improve genericity of bench.pl.
4390 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
4391 argument.
4392 (&bench_push_parser): New.
4393 Call it.
4394
43952008-11-03 Akim Demaille <demaille@gostai.com>
4396
4397 Add documentation to bench.pl.
4398 * etc/bench.pl.in: Comment changes.
4399
44002008-11-03 Akim Demaille <demaille@gostai.com>
4401
4402 Fuse the three stacks into a single one.
4403
4404 In order to make it easy to perform benchmarks to ensure that
4405 there are no performance loss, lalr1.cc is forked into
4406 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
4407 lalr1.cc.
4408
4409 Meanwhile, to make sure that lalr1-fusion.cc is correctly
4410 exercized by the test suite, the user must install a symbolic link
4411 from lalr1.cc to it.
4412
4413 Instead of having three stacks (state, value, location), use a
4414 stack of triples. This considerably simplifies the code (and it
4415 will be easier not to require locations as currently does the C++
4416 parser), and also gives a 10% speedup according to
4417 etc/bench (probably mainly since memory allocation is done once
4418 instead of three times).
4419
4420 Another motivation is to make it easier to destruct properly
4421 semantic values: now that they are bound to their state (hence
4422 symbol type) it will be easier to call the appropriate destructor.
4423
4424 These changes should probably benefit the C parser too.
4425
4426 * data/lalr1.cc: Copy as...
4427 * data/lalr1-fusion.cc: this new file.
4428 (b4_rhs_value, b4_rhs_location): New definitions overriding those
4429 from c++.m4.
4430 (state_stack_type, semantic_stack_type, location_stack_type)
4431 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
4432 (data_type, stack_type, yystack_): New.
4433 (YYLLOC_DEFAULT, yypush_): Adjust.
4434 (yyerror_range): Now based on data_type, not location_type.
4435
44362008-11-03 Akim Demaille <demaille@gostai.com>
4437
4438 Push the state, value, and location at the same time.
4439 This is needed to prepare a forthcoming patch that fuses the three
4440 stacks into one.
4441
4442 * data/lalr1.cc (parser::yypush_): New.
4443 (parser::yynewstate): Change the semantics: instead of arriving to
4444 this label when value and location have been pushed, but yystate
4445 is to be pushed on the state stack, now the three of them must
4446 have been pushed before. yystate still must be the new state.
4447 This allows to use yypush_ everywhere instead of individual
4448 handling of the stacks.
4449
44502008-11-03 Akim Demaille <demaille@gostai.com>
4451
4452 Prefer references to pointers.
4453 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
4454 definition to use references instead of pointers.
4455 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
4456 Take the value and location as references.
4457 Adjust callers.
4458
44592008-11-03 Akim Demaille <demaille@gostai.com>
4460
4461 stack::size instead of stack::height.
4462 * data/lalr1.cc (stack::height): Rename as...
4463 (stack::size): this.
4464 Fix the output type.
4465 Comment changes.
4466
44672008-11-03 Akim Demaille <demaille@gostai.com>
4468
4469 Use variants to support objects as semantic values.
4470 This patch was inspired by work by Michiel De Wilde. But he used
4471 Boost variants which (i) requires Boost on the user side, (ii) is
4472 slow, and (iii) has useless overhead (the parser knows the type of
4473 the semantic value there is no reason to duplicate this
4474 information as Boost.Variants do).
4475
4476 This implementation reserves a buffer large enough to store the
4477 largest objects. yy::variant implements this buffer. It was
4478 implemented with Quentin Hocquet.
4479
4480 * src/output.c (type_names_output): New.
4481 (output_skeleton): Invoke it.
4482 * data/c++.m4 (b4_variant_if): New.
4483 (b4_symbol_value): If needed, provide a definition for variants.
4484 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
4485 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
4486 (b4_char_sizeof, yy::variant): New.
4487 (parser::parse): If variants are requested, define
4488 parser::union_type, parser::variant, change the definition of
4489 semantic_type, construct $$ before running the user action instead
4490 of performing a default $$ = $1.
4491 * examples/variant.yy: New.
4492 Based on an example by Michiel De Wilde.
4493
44942008-11-03 Akim Demaille <demaille@gostai.com>
4495
4496 Parameterize the extraction of semantic values.
4497 To make future changes easier, no longer rely on ".TYPE" being the
4498 way to get a semantic value.
4499
4500 * data/c.m4 (b4_symbol_value): New.
4501 Use it.
4502 * data/c++.m4, data/yacc.c: Use it.
4503 * data/glr.c: Use b4_symbol_value.
4504 (b4_rhs_data): New.
4505 Use it.
4506
45072008-11-03 Akim Demaille <demaille@gostai.com>
4508
4509 Prepare easier M4 changes.
4510 * data/lalr1.cc: Use escaped [] instead of literals to prepare
4511 future changes.
4512
45132008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4514
4515 Initiate further development.
4516 * NEWS: Create an empty section for new entries.
4517 * gnulib: Update submodule to HEAD.
4518
45192008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4520
4521 * NEWS: Version 2.4.
4522
45232008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4524
4525 Prepare for next release.
4526 * NEWS: Briefly mention changes since 2.3b.
4527 * README: Say GNU m4 1.4.6, which we've been requiring in release
4528 announcements already, not 1.4.3, which breaks the build.
4529
45302008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4531
4532 Say %language is experimental.
4533 We're thinking of extending it's effect on output file naming. See the
4534 thread at
4535 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
4536 * NEWS: Say it's experimental.
4537 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
4538 recommend it over %skeleton for now.
4539 (Bison Options): Likewise.
4540 (C++ Bison Interface): Use %skeleton not %language.
4541 (Calc++ Parser): Use %skeleton not %language.
4542 * src/getargs.c (usage): Say it's experimental.
4543
45442008-11-01 Di-an Jan <dianj@freeshell.org>
4545 Paolo Bonzini <bonzini@gnu.org>
4546
4547 Support all Java parser class modifiers.
4548 * data/java.m4 (b4_percent_define_get3): New.
4549 (b4_final_if, b4_strictfp_if): New.
4550 * data/lalr1.java (final, strictfp, extends, implements): Support.
4551 * doc/bison.texinfo (final, strictfp, extends, implements): Add
4552 documentation.
4553 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
4554 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
4555 (AT_CHECK_JAVA_GREP): New.
4556 (Java parser class modifiers): New test.
4557 (Java parser class extends and implements): New test.
4558
4559 Model exception propagation better with throws and lex_throws.
4560 * data/java.m4 (b4_list2): New.
4561 (throws): Change default.
4562 * data/lalr1.java (yyaction): Add throws.
4563 (parse): Add lex_throws in addition to throws.
4564 * doc/bison.texinfo (throws, lex_throws): Add documentation.
4565 * tests/java.at (Java throws specifications): New test.
4566
4567 Improve documentation for Java parsers.
4568 * doc/bison.texinfo (Java Parsers): Add subsections.
4569 Don't quote first argument of %define.
4570 (Java Bison Interface): Document output files. Move documentation
4571 of parser class and merge into Java Parser Interface. Document
4572 features that error out. Document directives with no effect.
4573 Move note about Javadoc higher.
4574 (Java Semantic Values): Explicitly mention stype.
4575 Document that generic types cannot be used.
4576 (Java Location Values): Use @deftypeivar. Document constructors.
4577 Correct return value for toString.
4578 (Java Parser Interface): List undocumented constants/fields.
4579 Move documentation of fields added by %parse-param closer to list
4580 of members. Document that token names are added as fields.
4581 Document constructors accurately. Remove error method.
4582 (Java Scanner Interface): Move note on %pure-parser to Java Bison
4583 Interface. Describe %code lexer and yylex accutately.
4584 Remove documentation that does not match the code.
4585 (Java Action Features): New.
4586 (Java Differences): Add reference. Add item on semantic values.
4587 Add note about @{ ... @}. Clarify %% epilogue placement.
4588 (Java Declarations Summary): New.
4589
4590 Fix Java skeleton.
4591 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
4592 (b4_remove_comma): Quote test argument.
4593 (b4_identification): Remove "bison" field.
4594 * tests/java.at (Java parser class and package names): New test.
4595 (Java %parse-param and %lex-param): New test.
4596 (Java stype, position_class and location_class): New test.
4597
45982008-10-31 Di-an Jan <dianj@freeshell.org>
4599
4600 * data/lalr1.jave: Update copyright years.
4601 (YYParser): Correct name of "generated from" file in Javadoc:
4602 use b4_file_name instead of @ofile@.
4603 (Location constructor): Correct Javadoc parameter name.
4604 (yylloc): Add missing opening m4 quote after b4_location_if.
4605 This removes a stray [ in the Javadoc of Lexer.getStartPos.
4606 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
4607 (YYParser constructor): Correct Javadoc parameter name.
4608
46092008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
4610
4611 Always put auxiliary code files in the same dir as other output files.
4612 * src/files.c (compute_file_name_parts): When the user specifies
4613 --output but not --file-prefix, extract the directory prefix from the
4614 file prefix not from the grammar file name. This affects the location
4615 of files like location.hh generated by the C++ skeleton. The includes
4616 in the other output files require this fix.
4617 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
4618 for expected output files.
4619 (Output files): Add a test for the above.
4620
46212008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
4622
4623 * gnulib: Update submodule to HEAD.
4624
46252008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4626
4627 Update copyright year.
4628 * src/files.c: Here.
4629
46302008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
4631
4632 Don't overwrite the input file.
4633 * src/files.c (output_file_name_check): Fatal error if using input file
4634 for output.
4635 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
4636 argument.
4637 (Conflicting output files): Add test.
4638
46392008-10-28 Akim Demaille <demaille@gostai.com>
4640
4641 Space changes.
4642 * data/lalr1.cc: Formatting changes.
4643
46442008-10-28 Akim Demaille <demaille@gostai.com>
4645
4646 Don't define debugging functions when !YYDEBUG.
4647 * data/lalr1.cc (debug_stream, set_debug_stream)
4648 (debug_level_type, debug_level, set_debug_level): Don't
4649 declare them when YYDEBUG is not defined.
4650 The implementation are already YYDEBUG-aware.
4651
46522008-10-28 Akim Demaille <demaille@gostai.com>
4653
4654 Prefer "continue" for empty loop bodies.
4655 * etc/bench.pl.in: Use "continue" instead of {}.
4656
46572008-10-28 Akim Demaille <demaille@gostai.com>
4658
4659 Space and comments changes.
4660 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
4661 * data/c.m4, data/lalr1.cc: Space changes.
4662
46632008-10-28 Akim Demaille <demaille@gostai.com>
4664
4665 Make gnulib a submodule.
4666 * gnulib: New.
4667 * .gitmodules (gnulib): New.
4668
46692008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4670
4671 Fix yyerror_range for user-defined location type in C++. Reported by
4672 Georg Sauthoff at
4673 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
4674 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
4675 * THANKS (Georg Sauthoff): Add.
4676
46772008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4678
4679 Update several administrative files mainly to facilitate releasing.
4680 * HACKING (Administrivia): Make the git-merge-changelog notes more
4681 helpful.
4682 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
4683 (Release Procedure): Update for git and add numerous details that were
4684 previously missing.
4685 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
4686 * maint.mk (announcement): Don't list bison as a bootstrap tool so
4687 that announcements don't claim we bootstrapped with whatever bison
4688 happened to be in PATH. Add flex as a bootstrap tool.
4689 * Makefile.maint: Remove, previously replaced by maint.mk.
4690 * Makefile.cfg: Remove, and migrate settings to...
4691 * cfg.mk: ... here for the sake of `make announcement'.
4692 * bootstrap.conf (gnulib_modules): Add announce-gen.
4693 * README: Say GNU Bison instead of just Bison. Suggested by Karl
4694 Berry.
4695
46962008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
4697
4698 Small but important bugfixes for the Java skeleton.
4699 * data/lalr1.java (yyerror): Change Location to b4_location_type.
4700 (yy_symbol_print): Call toString on yyvaluep.
4701
47022008-08-29 Akim Demaille <demaille@gostai.com>
4703
4704 Clarify UPDATED use.
4705 * doc/bison.texinfo: It refers to the last edition of this file,
4706 not to the release date of Bison.
4707 Reported by Joel E. Denny.
4708
47092008-08-29 Akim Demaille <demaille@gostai.com>
4710
4711 * README: Update FAQ pointer.
4712 Reported by Joel E. Denny.
4713
47142008-08-27 Eric Blake <ebb9@byu.net>
4715
4716 Resync m4sugar from autoconf.
4717 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
4718 (m4_init): Adjust to latest m4.git changes.
4719 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
4720 effects.
4721 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
4722 (_m4_list_cmp): Reduce side effects.
4723
47242008-08-27 Akim Demaille <demaille@gostai.com>
4725
4726 Check yyerrok in calc.at.
4727 * tests/calc.at (calc.y): Use yyerrok on "( error )".
4728 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
4729 expected.
4730
47312008-08-27 Akim Demaille <demaille@gostai.com>
4732
4733 Support yyerrok in lalr1.cc.
4734 YYBACKUP is still to import back into lalr1.cc.
4735 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
4736
47372008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4738
4739 For maintainer-check*, don't recompile for a $(VERSION) update.
4740 * cfg.mk: New file.
4741 (_is-dist-target): Override the one in GNUmakefile.
4742 * Makefile.am (EXTRA_DIST): Add cfg.mk.
4743
47442008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4745
4746 Update for recent change to gnulib.
4747 * src/parse-gram.y: Don't include strverscmp.h. It comes from
4748 string.h now.
4749
47502008-08-15 Eric Blake <ebb9@byu.net>
4751
4752 Remaining m4sugar merge from autoconf.
4753 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
4754 * data/m4sugar/foreach.m4: New file, copied from autoconf.
4755 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
4756 * src/output.c (output_skeleton): Tell m4 how to find it.
4757
4758 Partial m4sugar merge from autoconf: m4_map.
4759 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
4760 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
4761 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
4762 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
4763 for empty list.
4764 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
4765 Likewise.
4766 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
4767 declares it.
4768
47692008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
4770
4771 Keep .version and PACKAGE_VERSION in sync.
4772 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
4773 dependency, and add comments justifying this in more detail. Discussed
4774 starting at
4775 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
4776
47772008-08-06 Eric Blake <ebb9@byu.net>
4778
4779 Partial m4sugar merge from autoconf: m4_shiftn.
4780 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
4781 (m4_shift2, m4_shift3): New macros.
4782 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
4783 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
4784 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
4785 * data/java.m4 (b4_remove_comma): Likewise.
4786
4787 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
4788 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
4789 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
4790 (m4_init): Consolidate wrapped text into single m4_wrap.
4791 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
4792 in wrapped text.
4793
47942008-08-05 Eric Blake <ebb9@byu.net>
4795
4796 Partial m4sugar merge from autoconf: builtins, version.m4.
4797 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
4798 (m4_prepend): Remove, as it is unused and inherently quadratic,
4799 whereas m4_append is linear in newer m4.
4800 (m4_mkstemp): New builtin.
4801 (m4_symbols): Make rename conditional.
4802 (m4_version_prereq): Ensure fatal error if used in bison, which
4803 intentionally lacks version.m4.
4804
4805 Fix comments in m4sugar.
4806 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
4807
48082008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4809
4810 Update for recent .gitignore fix in Gnulib.
4811 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
4812 anchored .gitignore entries.
4813
48142008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4815
4816 Set gnu or gnits strictness.
4817 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
4818 development and gnits strictness for releases. Based on Eric Blake's
4819 suggestion at
4820 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
4821
48222008-07-31 Paolo Bonzini <bonzini@gnu.org>
4823
4824 * NEWS: Clarify documentation of %language.
4825
48262008-07-31 Paolo Bonzini <bonzini@gnu.org>
4827
4828 Support usage of git-merge-changelog.
4829 * .gitattributes: New.
4830 * HACKING: Document usage of git-merge-changelog.
4831 * bootstrap: Install git-merge-changelog entries in .git/config
4832 if appropriate.
4833
48342008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4835
4836 Remove remaining dependence on CVS Id keyword.
4837 * ChangeLog: For the sake of people still using CVS, don't use dollars
4838 when mentioning Id.
4839 * data/xslt/bison.xsl: Remove Id from header comments, where it was
4840 unusual anyway.
4841 * data/xslt/xml2dot.xsl: Likewise.
4842 * data/xslt/xml2text.xsl: Likewise.
4843 * data/xslt/xml2xhtml.xsl: Likewise.
4844 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
4845 * doc/Makefile.am (neutralize): Remove, no longer needed.
4846 (.x.1): Don't use neutralize.
4847 (edit): Don't substitute for ID.
4848 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
4849
48502008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4851
4852 Fix dependence on computed configure variables.
4853 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
4854 $(top_srcdir)/configure.ac so that changes to computed variables, such
4855 as PACKAGE_VERSION, are seen.
4856 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
4857
48582008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
4859
4860 Update copyright dates for recent changes.
4861 * Makefile.am: Here.
4862 * src/Makefile.am: Here.
4863 * src/reduce.c: Here.
4864 * tests/reduce.at: Here.
4865
48662008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
4867
4868 Use git-version-gen for version names between releases.
4869 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
4870 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
4871 * .prev-version: New.
4872 * .version.in: Remove.
4873 * ChangeLog: Remove the Id previously used for capturing the CVS
4874 revision.
4875 * GNUmakefile: Remove, now copied from Gnulib.
4876 * Makefile.am: Add code suggested by comments in
4877 build-aux/git-version-gen.
4878 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
4879 .prev-version, and .version.
4880 * NEWS (2.3b+): Rename to...
4881 (?.?): ... this because we're dropping the "+" version naming scheme,
4882 but, in general, we still can't be sure of our next release name.
4883 * bootstrap: Add a quick hack to remove from .gitignore the
4884 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
4885 entry. This should really be fixed in gnulib instead.
4886 * bootstrap.conf (gnulib_modules): Add gnumakefile.
4887 * configure.ac (AC_INIT): Set version name by invoking
4888 build-aux/git-version-gen.
4889 (AC_CONFIG_FILES): Remove .version, now generated by
4890 build-aux/git-version-gen.
4891 * maint.mk: New, copied from coreutils.
4892 * doc/.cvsignore (bison.1): Add.
4893 * doc/.gitignore (/bison.1): Add.
4894 * doc/bison.1: Remove, generated.
4895 * src/.cvsignore (revision.c): Remove.
4896 * src/.gitignore (/revision.c): Remove.
4897 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
4898 (BUILT_SOURCES): Remove revision.c.
4899 (revision.c): Remove.
4900 * src/getargs.c (version): Don't print revision after the VERSION.
4901 * src/revision.h: Remove.
4902
49032008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4904
4905 Fix untranslatable composition of sentences. Reported by Goran
4906 Uddeborg at
4907 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
4908 * THANKS (Goran Uddeborg): Add.
4909 * src/reduce.c (reduce_print): Report the number of nonterminals and
4910 rules useless in the grammar in separate sentences.
4911 * tests/reduce.at (Useless Rules): Update output.
4912 (Reduced Automaton): Likewise.
4913 (Underivable Rules): Likewise.
4914 (Empty Language): Likewise.
4915
49162008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4917
4918 Fix some .gitignore and .cvsignore problems.
4919 * bootstrap (insert_sorted_if_absent): Replace all uses with...
4920 (insert_vc_ignore): ... this new function, which prepends `/' to all
4921 .gitignore entries before passing them to insert_sorted_if_absent.
4922 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
4923 .cvsignore files are maintained even though Bison developers run
4924 bootstrap while using Git.
4925 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
4926 unneeded by Bison.
4927 (gnulib): Add.
4928 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
4929 unneeded. Reported by Eric Blake.
4930 * lib/.gitignore (/*~): Add.
4931 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
4932 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
4933 Blake.
4934 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
4935
49362008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4937
4938 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
4939 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
4940 * bootstrap.conf (gnulib_modules): Add unsetenv.
4941 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
4942 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
4943 (/setenv.m4): Add.
4944 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
4945 the first argument because it may become position-dependent, and unset
4946 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
4947 Add comments explaining these issues in more detail.
4948
49492008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
4950
4951 Add .gitignore everywhere based on .cvsignore.
4952 * .gitignore: New.
4953 * build-aux/.gitignore: New.
4954 * data/.gitignore: New.
4955 * doc/.gitignore: New.
4956 * etc/.gitignore: New.
4957 * examples/.gitignore: New.
4958 * examples/calc++/.gitignore: New.
4959 * lib/.gitignore: New.
4960 * m4/.gitignore: New.
4961 * po/.gitignore: New.
4962 * runtime-po/.gitignore: New.
4963 * src/.gitignore: New.
4964 * tests/.gitignore: New.
4965
49662008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4967
4968 * NEWS (2.3b+): New section, empty for now.
4969 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
4970
49712008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4972
4973 * NEWS (2.3b): Update release date since there has been a delay in
4974 getting the announcements and tarballs out.
4975
49762008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4977
4978 * NEWS: Version 2.3b.
4979 * configure.ac (AC_INIT): Likewise.
4980 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
4981
49822008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4983
4984 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
4985 been doing it for years.
4986 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
4987 (Release Procedure): Add FIXME about make alpha being unmaintained.
4988
49892008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
4990
4991 * data/yacc.c: Reformat m4 a little for readability.
4992 * src/lalr.c (build_relations): Correct comment.
4993
49942008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4995
4996 DJGPP specific issue.
4997 * djgpp/config.sed: Fixes required to run configure scripts generated
4998 by autoconf 2.62.
4999
50002008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5001
5002 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
5003 coordinator@translationproject.org.
5004
50052008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5006
5007 * THANKS: Add Eric Blake.
5008
50092008-04-23 Eric Blake <ebb9@byu.net>
5010
5011 Revert prior patch, by working around autoconf regression.
5012 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
5013 ("Output file name: ("): Uncomment test.
5014 ("Output file name: )"): Likewise.
5015 Based on an idea from Noah Misch.
5016
50172008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5018
5019 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
5020 2.61. Reported by Juan Manuel Guerrero at
5021 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
5022 * tests/output.at ("Output file name: ("): Comment out test case for
5023 now.
5024 ("Output file name: )"): Likewise.
5025
50262008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5027
5028 * GNUmakefile: Update git-version-gen invocation so make dist
5029 succeeds.
5030
50312008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5032
5033 Update to the current gnulib CVS repository, and fix trigraph handling
5034 in Bison.
5035 * bootstrap: Update gnulib CVS repository URL.
5036 (symlink_to_dir): Encapsulate the code that guarantees the destination
5037 directory exists into...
5038 (check_dst_dir): ... this new function, and...
5039 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
5040 fail when copying files into lib/uniwidth/.
5041 * src/output.c (prepare_symbols): When writing yytname muscles, where
5042 symbol names will be encoded in C-string literals, tell quotearg to
5043 escape trigraphs. This used to be the default in gnulib.
5044 * tests/regression.at (Token definitions): Because of the change in
5045 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
5046 escapes trigraphs in symbol names. Thus, yytname no longer has
5047 trigraphs unnecessarily doubly escaped. Update test case output.
5048 Extend test case to be sure Bison's own error messages will no longer
5049 have trigraphs in symbol names unnecessarily escaped once.
5050
50512008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
5052
5053 Fix make dist infinite loop reported by Juan Manuel Guerrero at
5054 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
5055 * .cvsignore: Add .version.
5056 * .version.in: New.
5057 * bootstrap.conf (gnulib_modules): Add git-version-gen.
5058 * configure.ac (AC_CONFIG_FILES): Add .version.
5059 * build-aux/.cvsignore: Add git-version-gen.
5060
50612008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5062
5063 * NEWS (2.3a+): Mention that -g now takes an argument.
5064 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
5065 consistency. Update the -g and -x entries now that they take
5066 arguments. Use brackets to indicate optional arguments.
5067 * src/getargs.c (usage): Explain the relationship between arguments of
5068 long and short options more completely. Document --defines and -d
5069 separately since the former takes an argument but, for POSIX Yacc, the
5070 latter does not.
5071 (short_options): Let -W take an optional argument like --warnings.
5072 (getargs): Sort cases.
5073
50742008-02-28 Akim Demaille <demaille@gostai.com>
5075
5076 * doc/bison.texinfo: Fix a few typos.
5077
50782008-02-28 Akim Demaille <akim@epita.fr>
5079
5080 * doc/bison.texinfo (Bison Options): Document -W.
5081 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
5082
50832008-02-28 Akim Demaille <akim@epita.fr>
5084
5085 * src/getargs.c (short_options): Split and sort for readability.
5086 -g and -x take optional arguments, just like their long options.
5087 * build-aux/cross-options.pl: Use /x to make the regexp easier to
5088 understand.
5089 Fix the handling of $opt which resulted in all the argument to be
5090 considered as optional.
5091
50922008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
5093
5094 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
5095 say its interface is experimental.
5096 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5097 Java.
5098 (Bison Options): In the -L and --language entry, mention Java.
5099 (Java Bison Interface): Say the interface is experimental.
5100 * src/getargs.c (usage): Mention -L and --language.
5101
5102 * NEWS (2.3a+): Say the push parsing interface is experimental.
5103 * doc/bison.texinfo (Push Decl): Likewise.
5104 (Decl Summary): Likewise in the "%define api.push_pull" entry.
5105 (Push Parser Function): Likewise.
5106 (Pull Parser Function): Likewise.
5107 (Parser Create Function): Likewise.
5108 (Parser Delete Function): Likewise.
5109 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
5110 yypull_parse, and yypush_parse entries.
5111
5112 * NEWS (2.3a+): Mention XML support, and say the schema is
5113 experimental.
5114 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
5115 * src/getargs.c (usage): Say the XML schema is experimental.
5116
5117 * NEWS (2.3a+): Say option instead of flag.
5118
51192008-02-21 Wojciech Polak <polak@gnu.org>
5120
5121 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
5122 text.
5123
51242008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
5125
5126 Fix impure push parser compile error reported by Bob Rossi at
5127 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
5128 * data/yacc.c: Clean up whitespace in the output a little.
5129 (yypstate_allocated): Define for impure push parsers regardless of
5130 whether the pull interface is also requested.
5131 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
5132 check impure push parsers without the pull interface.
5133
5134 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
5135 yyerror takes arguments specified by %parse-param while yypstate_new
5136 does not.
5137 * doc/bison.texinfo (Parser Create Function): Document that
5138 yypstate_new returns 0 for multiple impure parser instances.
5139 * tests/push.at (Push Parsing: Multiple impure instances): Update
5140 expected stderr output.
5141
51422008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5143
5144 * runtime-po/POTFILES.in (push.c): Remove.
5145
51462008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5147
5148 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
5149 * data/push.c: Rename to...
5150 * data/yacc.c: ... this, overwriting it.
5151 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
5152 `%push-pull-parser' -> `%define api.push_pull "both"'.
5153 Remove old yacc.c tests, and update push.c tests to yacc.c.
5154
51552008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5156
5157 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
5158 `"%code top" blocks' instead of `%code "top" blocks'.
5159 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
5160 Clean up whitespace in the output a little.
5161
51622008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5163
5164 Fix documentation problems reported by Tim Josling at
5165 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
5166 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
5167 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
5168 integers. Explain the effect of literal string aliases on error
5169 messages. Copy token 0 documentation from the C++ skeleton
5170 documentation.
5171
51722008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5173
5174 Accept a token number in a %left, %right, or %nonassoc for POSIX
5175 conformance. Reported by Tim Josling at
5176 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
5177 * NEWS (2.3a+): Mention.
5178 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
5179 and code numbers are treated by precedence declarations.
5180 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
5181 of symbols.1.
5182 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
5183 of symbol.
5184 (symbol.prec): New, just like symbol but allows INT.
5185 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
5186 longer holds.
5187 * tests/regression.at (Token number in precedence declaration): New
5188 test case.
5189
51902008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5191
5192 DJGPP specific issues.
5193 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
5194 be changed. Copyright timestamp adjusted.
5195 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
5196 be changed. Copyright timestamp adjusted.
5197 * djgpp/config.site: Copyright timestamp adjusted.
5198 * djgpp/config_h.sed: Copyright timestamp adjusted.
5199 * djgpp/djunpack.bat: Copyright timestamp adjusted.
5200 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
5201 filename translation list.
5202 * djgpp/subpipe.c (init_subpipe): Check the environment variables
5203 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
5204 files shall be created. Before trying to use the temp dir where the
5205 environment variable points to check that the dir really exists. If
5206 not default to the cwd as temp dir. Copyright timestamp adjusted.
5207 * djgpp/subpipe.h: Copyright timestamp adjusted.
5208 * djgpp/testsuite.sed: Copyright timestamp adjusted.
5209
52102008-01-30 Paul Eggert <eggert@cs.ucla.edu>
5211
5212 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
5213
52142008-01-09 Paul Eggert <eggert@cs.ucla.edu>
5215
5216 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
5217 Problem reported by Claudio Saavedra in
5218 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
5219
52202008-01-05 Wojciech Polak <polak@gnu.org>
5221
5222 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
5223 document's title with the input grammar file name.
5224
52252007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
5226
5227 Automate regression testing of the XML/XSLT implementation. Discussed
5228 starting at
5229 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
5230 * configure.ac (XSLTPROC): New substitution.
5231 * Makefile.am (maintainer-xml-check): New phony target invoking...
5232 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
5233 invoking make maintainer-check with BISON_TEST_XML=1.
5234 * tests/atlocal.in (XSLTPROC): New.
5235 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
5236 not to report reachable memory when Bison is expected to have a
5237 non-zero exit status and (2) to compare XML/XSLT output with --graph
5238 and --report=all output for every working grammar when
5239 BISON_TEST_XML=1.
5240 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
5241 (AT_BISON_CHECK_XML): New.
5242 (AT_QUELL_VALGRIND): New.
5243 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
5244 (AT_CHECK): ... don't redefine this since this was the old way to
5245 quell Valgrind.
5246 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
5247 AT_BISON_CHECK invocations.
5248 * tests/c++.at: Likewise.
5249 * tests/calc.at: Likewise.
5250 * tests/conflicts.at: Likewise.
5251 * tests/cxx-type.at: Likewise.
5252 * tests/existing.at: Likewise.
5253 * tests/glr-regression.at: Likewise.
5254 * tests/headers.at: Likewise.
5255 * tests/input.at: Likewise.
5256 * tests/java.at: Likewise.
5257 * tests/output.at: Likewise.
5258 * tests/push.at: Likewise.
5259 * tests/reduce.at: Likewise.
5260 * tests/regression.at: Likewise.
5261 * tests/sets.at: Likewise.
5262 * tests/skeletons.at: Likewise.
5263 * tests/synclines.at: Likewise.
5264 * tests/torture.at: Likewise.
5265 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
5266 tends to hang xsltproc.
5267 (Big horizontal): Likewise.
5268
52692007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5270
5271 In XML output, remove redundant class attribute on symbol element.
5272 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
5273 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
5274 look up a symbol to determine whether it's a nonterminal or terminal.
5275 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
5276 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
5277
5278 Add prec/assoc information to XML output.
5279 * src/gram.c (grammar_rules_print_xml): For each rule that has a
5280 %prec, add a percent_prec attribute.
5281 * src/print-xml.c (print_grammar): For each terminal that has a
5282 precedence or associativity, add a prec or assoc attribute.
5283 (xml_indent): New.
5284 (xml_puts): Use xml_indent.
5285 (xml_printf): Use xml_indent.
5286 * src/print-xml.h (xml_indent): Prototype.
5287
5288 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
5289 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5290
52912007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5292
5293 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
5294 (bison:ruleByNumber): ... this for clarity.
5295 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
5296 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
5297 (xsl:template match="reduction"): Update.
5298 (xsl:template match="item"): Update.
5299 (xsl:template match="reduction"): Update.
5300
5301 In the XML output, don't print the list of rules where symbols appear.
5302 Compute it in XSLT instead. Discussed at
5303 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
5304 * data/xslt/bison.xsl (bison:ruleByLhs): New.
5305 (bison:ruleByRhs): New.
5306 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
5307 bison:ruleByRhs.
5308 (xsl:template match="terminal/rule"): Remove.
5309 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5310 bison:ruleByRhs.
5311 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5312 Remove.
5313 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
5314 bison:ruleByRhs and mode="number-link" for rule template.
5315 (xsl:template match="terminal/rule"): Remove.
5316 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5317 bison:ruleByRhs and mode="number-link" for rule template.
5318 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5319 Rewrite as...
5320 (xsl:template match="rule" mode="number-link"): ... this.
5321 * src/print-xml.c (print_grammar): Don't print the list of rules.
5322
53232007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5324
5325 Don't let --report affect XML output; always print all information.
5326 Discussed at
5327 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
5328 * src/conflicts.c (log_resolution): Implement.
5329 * src/print-xml.c (print_core): Implement.
5330 (print_state): Implement.
5331 (print_xml): Implement.
5332
5333 * NEWS (2.3a+): Fix quotes.
5334 * src/parse-gram.y (prologue_declaration): For consistency with -v,
5335 don't let %verbose clear the list specified by --report.
5336
53372007-11-26 Akim Demaille <akim@epita.fr>
5338
5339 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
5340
53412007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
5342
5343 In the XML output, list useless and unused symbols and rules with the
5344 useful ones and add a "usefulness" attribute. Discussed starting at
5345 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
5346 * src/gram.c (grammar_rules_partial_print_xml): Remove.
5347 (grammar_rules_print_xml): Print all rules instead of just those
5348 useful in the grammar, and add a "usefulness" attribute.
5349 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
5350 * src/print-xml.c (print_rules_useless_in_parser): Remove.
5351 (print_grammar): Print all nonterminals instead of just useful ones,
5352 and add a "usefulness" attribute to nonterminals and terminals.
5353 (print_xml): Don't print a separate "reductions" or
5354 "rules-useless-in-parser" element.
5355 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
5356 (reduce_xml): Remove.
5357 (reduce_token_unused_in_grammar): New.
5358 (reduce_nonterminal_useless_in_grammar): New.
5359 * src/reduce.h (reduce_xml): Remove prototype.
5360 (reduce_token_unused_in_grammar): Add prototype.
5361 (reduce_nonterminal_useless_in_grammar): Add prototype.
5362 * data/xslt/xml2text.xsl: Update for XML changes.
5363 * data/xslt/xml2xhtml.xsl: Update for XML changes.
5364 * tests/reduce.at (Useless Terminals): Update output.
5365 (Useless Rules): Update output.
5366 (Reduced Automaton): Update output.
5367
5368 Say "Terminals unused in grammar" instead of "Unused terminals".
5369 * NEWS (2.3a+): Update.
5370 * doc/bison.texinfo (Understanding): Update example output.
5371 * src/reduce.c (reduce_output): Implement.
5372 * data/xslt/xml2text.xsl: Implement.
5373 * data/xslt/xml2xhtml.xsl: Implement.
5374
53752007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
5376
5377 Accept --report-file=FILE to override the default `.output' filename.
5378 * NEWS (2.3a+): Mention.
5379 * doc/bison.texinfo (Bison Options): Add an entry.
5380 * src/files.c (compute_output_file_names): Don't override
5381 spec_verbose_file if already set.
5382 * src/getargs.c (usage): Document --report-file.
5383 (REPORT_FILE_OPTION): New anonymous enum member.
5384 (long_options): Add entry for it.
5385 (getargs): Add case for it setting spec_verbose_file.
5386
5387 * build-aux/cross-options.pl: Don't record a short option just because
5388 there's an arg.
5389 * doc/.cvsignore: Add yacc.1.
5390
53912007-11-14 Akim Demaille <akim@epita.fr>
5392
5393 * doc/yacc.1.in: New.
5394 * configure.ac, doc/Makefile.am: Adjust.
5395 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
5396 config.h symbol.
5397 Use AC_SUBST for assignments too.
5398 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
5399
54002007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5401
5402 * src/gram.c: Remove comments that duplicate comments in gram.h.
5403
5404 When reporting useless rules and nonterminals, say "useless in grammar"
5405 instead of "useless", and say "useless in parser" instead of "never
5406 reduced". Discussed starting at
5407 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
5408 * NEWS (2.3a+): Mention this change.
5409 * data/xslt/xml2text.xsl: Update output text and expected input XML
5410 element names to match changes below.
5411 * data/xslt/xml2xhtml.xsl: Likewise.
5412 (xsl:template match="bison-xml-report"): Add missing entry in Table of
5413 Contents: "Rules useless in parser due to conflicts".
5414 * doc/bison.texinfo (Decl Summary): Reword a little.
5415 (Understanding): Update example output for changes below.
5416 * src/gram.c: (rule_useful_p): Rename to...
5417 (rule_useful_in_grammar_p): ... this.
5418 (rule_useless_p): Rename to...
5419 (rule_useless_in_grammar_p): ... this.
5420 (rule_never_reduced_p): Rename to...
5421 (rule_useless_in_parser_p): ... this.
5422 (grammar_rules_print): Update for renames.
5423 (grammar_rules_print_xml): Update for renames.
5424 (grammar_rules_never_reduced_report): Rename to...
5425 (grammar_rules_useless_report): ... this since it is used for either
5426 kind of useless rule.
5427 * src/gram.h: Reword comments and update function names in prototypes.
5428 * src/main.c (main): Say "rule useless in parser due to conflicts".
5429 * src/print-xml.c (print_rules_never_reduced): Rename to...
5430 (print_rules_useless_in_parser): ... this, and rename output XML
5431 element "rules-never-reduced" to "rules-useless-in-parser".
5432 (print_xml): Update for rename.
5433 * src/print.c (print_results): Say "Rules useless in parser due to
5434 conflicts".
5435 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
5436 (nonterminals_reduce): Say "nonterminal useless in grammar".
5437 (reduce_output): Say "Nonterminals useless in grammar".
5438 Say "Rules useless in grammar".
5439 (reduce_xml): Rename output XML element "useless" to
5440 "useless-in-grammar".
5441 (reduce_print): Don't report the count of grammatically useless rules
5442 as "rules never reduced" just because %yacc is specified.
5443 In the correct report of this count, say nonterminal(s) and rule(s)
5444 "useless in grammar".
5445 * tests/conflicts.at (S/R in initial): Update expected output.
5446 (Defaulted Conflicted Reduction): Likewise.
5447 (Unreachable States After Conflict Resolution): Likewise.
5448 * tests/existing.at (GNU pic Grammar): Likewise.
5449 * tests/reduce.at (Useless Nonterminals): Likewise.
5450 (Useless Rules): Likewise.
5451 (Reduced Automaton): Likewise.
5452 (Underivable Rules): Likewise.
5453 (Empty Language): Likewise.
5454
54552007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5456
5457 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
5458 here document and before the EOF so that BSD's implementation of Bourne
5459 shell doesn't parse the delimiter as part of the here document.
5460 * doc/.cvsignore: Add cross-options.texi.
5461 * src/getargs.c (usage): Add a blank line after the warning categories.
5462
54632007-11-08 Paolo Bonzini <bonzini@gnu.org>
5464
5465 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
5466
54672007-11-05 Akim Demaille <akim@epita.fr>
5468
5469 Remove Id: from bison.1.
5470 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
5471 (perl -0777 -pi -e 's/\.PP\nId): New.
5472 (.x.1): Use it to ignore the version control revision.
5473
54742007-11-05 Akim Demaille <demaille@gostai.com>
5475
5476 * build-aux/Makefile.am: Ship cross-options.pl.
5477 * doc/Makefile.am: Always refer to cross-options.texi with
5478 $(srcdir).
5479 (MAINTAINERCLEANFILES): Add it.
5480
54812007-11-04 Akim Demaille <demaille@gostai.com>
5482
5483 Generate the long/short option cross-table.
5484 * build-aux/cross-options.pl: New.
5485 * doc/Makefile.am (cross-options.texi): New.
5486 * doc/bison.texinfo: Use it.
5487
54882007-11-04 Akim Demaille <demaille@gostai.com>
5489
5490 Generate bison.1 using help2man.
5491 * doc/common.x, doc/bison.x: New.
5492 * doc/Makefile.am (bison.1, .x.1): New.
5493 The code is taken from autoconf-2.61/man/Makefile.am.
5494 * configure.ac: Look for help2man.
5495
54962007-11-04 Akim Demaille <demaille@gostai.com>
5497
5498 Complete --help.
5499 * src/getargs.c (usage): Document -W, make it clear that -d,
5500 -g and -x have optional arguments.
5501
55022007-11-04 Akim Demaille <demaille@gostai.com>
5503
5504 Find sha1sum when named gsha1sum.
5505 * bootstrap (find_tool): New.
5506 ($SHA1SUM): New.
5507
55082007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5509
5510 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
5511 at
5512 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
5513 * NEWS (2.3a+): Mention.
5514 * data/bison.m4 (b4_pure_if): Don't define it here.
5515 * data/c.m4 (b4_identification): Depend on individual skeletons to
5516 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
5517 values of the %define variables api.pure or api.push_pull. Define
5518 YYPURE, YYPUSH, and YYPULL accordingly.
5519 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
5520 glr.cc has already defined b4_pure_flag.
5521 * data/push.c: Define b4_pure_if based on `%define api.pure'.
5522 Remove YYPUSH and YYPULL since they're back in b4_identification again.
5523 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
5524 * doc/bison.texinfo (Pure Decl): Update.
5525 (Push Decl): Update.
5526 (Decl Summary): Add api.pure to %define entry.
5527 In %pure-parser entry, say it's deprecated and reference %define.
5528 (Pure Calling): Update.
5529 (Error Reporting): Update.
5530 (C++ Scanner Interface): Update.
5531 (How Can I Reset the Parser): Update.
5532 (Table of Symbols): In %pure-parser entry, say it's deprecated and
5533 reference %define.
5534 * src/getargs.c (pure_parser): Remove global variable.
5535 * src/getargs.h (pure_parser): Remove extern.
5536 * src/output.c (prepare): Don't define pure_flag muscle.
5537 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
5538 wrapper around `%define api.pure'.
5539 * tests/calc.at (Simple LALR Calculator): Update.
5540 (Simple GLR Calculator): Update.
5541 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
5542 Update.
5543 (GLR: Resolve ambiguity, pure, locations): Update.
5544 (GLR: Merge conflicting parses, pure, no locations): Update.
5545 (GLR: Merge conflicting parses, pure, locations): Update.
5546 * tests/glr-regression.at (Uninitialized location when reporting
5547 ambiguity): Update
5548 * tests/input.at (Unused %define api.pure): New test case.
5549 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
5550 AT_PURE_IF and AT_PURE_AND_LOC_IF.
5551 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5552
55532007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5554
5555 %define push_pull -> %define api.push_pull. Discussed starting at
5556 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
5557 * data/push.c: Expect the new name.
5558 * data/yacc.c: Likewise.
5559 * doc/bison.texinfo (Push Decl): Update.
5560 (Decl Summary): Update %define entry.
5561 (Push Parser Function): Update.
5562 (Pull Parser Function): Update.
5563 (Parser Create Function): Update.
5564 (Parser Delete Function): Update.
5565 * tests/calc.at (Simple LALR Calculator): Update.
5566 * tests/input.at (%define enum variables): Update.
5567 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5568 (Push Parsing: Multiple impure instances): Update.
5569 (Push Parsing: Unsupported Skeletons): Update.
5570 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
5571 (Exploding the Stack Size with Malloc): Update.
5572
5573 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
5574 other entries some.
5575
55762007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
5577
5578 For the XML output's terminal element, rename @number to @token-number,
5579 and add @symbol-number. In the nonterminal element, rename @number to
5580 @symbol-number. Discussed starting at
5581 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
5582 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
5583 renames.
5584 (xsl:template match="nonterminal"): Likewise.
5585 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
5586 (xsl:template match="nonterminal"): Likewise.
5587 * src/print-xml.c (print_grammar): Implement.
5588
55892007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5590
5591 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
5592 2007-10-11 change, the child elements here are items not rules.
5593 (xsl:template match="item"): New.
5594 (xsl:template match="rule"): Update for new reduced itemset.
5595 (xsl:template match="point"): Remove.
5596 (xsl:template match="empty"): For consistency with --graph, don't
5597 output "/* empty */".
5598 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
5599 line-wrap, don't pass a negative value as first-line-length since this
5600 won't work with the following changes.
5601 (xsl:template name="line-wrap"): Simplify slightly.
5602 (xsl:template name="ws-search"): Eliminate recursion.
5603 * src/print_graph.c (print_core): Don't print a reduction's lookahead
5604 set next to an item whose dot is not at the end of the RHS even if it
5605 happens to be associated with the same rule.
5606
56072007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5608
5609 Add %define lr.keep_unreachable_states.
5610 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
5611 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
5612 * src/main.c (main): Implement it.
5613 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5614 Extend to test it, and fix a typo.
5615
56162007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5617
5618 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
5619 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
5620 the example .output text.
5621 * tests/regression.at (Extra lookahead sets in report): Improve wording
5622 of comments.
5623
56242007-10-17 Wojciech Polak <polak@gnu.org>
5625
5626 * src/print-xml.c (print_grammar): Renamed
5627 <terminal> and <nonterminal> attributes:
5628 "type" to "number" and "symbol" to "name".
5629 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
5630 Use new attribute names.
5631 (xsl:template match="nonterminal"): Likewise.
5632 * data/xslt/xml2xhtml.xsl: Likewise.
5633
56342007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
5635
5636 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
5637 (Option Cross Key): Likewise.
5638
5639 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
5640 next to an item whose dot is not at the end of the RHS even if it
5641 happens to be associated with the same rule.
5642 * src/print.c (print_core): Likewise.
5643 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
5644 (Resolved SR Conflicts): Update output.
5645 * tests/regression.at (Extra lookahead sets in report): New test case.
5646
56472007-10-11 Wojciech Polak <polak@gnu.org>
5648
5649 * src/print-xml.c (print_core): Remove item set
5650 redundancy.
5651 * data/xslt/bison.xsl (bison:ruleNumber): New key.
5652 Improve processing time. Suggested by Joel E. Denny.
5653 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
5654 Write xsl:param "required" attribute as comment.
5655 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
5656 (xsl:template match="rule"): Support new reduced itemset.
5657 (xsl:template match="point"): Remove.
5658 * data/xslt/xml2xhtml.xsl: Likewise.
5659
56602007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5661
5662 * src/getargs.c (version): Update copyright year.
5663
56642007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5665
5666 Make xml2dot.xsl and --graph produce the same output.
5667 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
5668 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
5669 escaped later.
5670 (xsl:template name="output-node"): Use the new escape template instead
5671 of the string-replace template directly.
5672 (xsl:template name="output-edge"): Likewise.
5673 (xsl:template name="escape"): New, escapes backslashes and newlines in
5674 addition to quotation marks.
5675 * src/graphviz.c (start_graph, output_node, output_edge): Add
5676 whitespace to output for legibility.
5677
5678 Make xml2text.xsl and --report produce the same output, and remove the
5679 XML "conflicts" element since a conflict summary is easily extracted
5680 from the automaton.
5681 * data/xslt/bison.xsl: New.
5682 (xsl:template match="state" mode="bison:count-conflicts): New.
5683 * data/xslt/xml2text.xsl: Import bison.xsl.
5684 (xsl:template match="bison-xml-report"): Instead of styling the
5685 "conflicts" element, style the "automaton" element with mode
5686 "conflicts". Unlike the former, the latter lists S/R and R/R
5687 conflicts for a state on the same line.
5688 (xsl:template match="conflicts"): Remove.
5689 (xsl:template match="conflict"): Remove.
5690 (xsl:template match="terminal"): Line-wrap the list of rules in which
5691 the terminal is used.
5692 (xsl:template match="nonterminal"): Likewise for nonterminals.
5693 (xsl:template match="automaton" mode="conflicts"): New.
5694 (xsl:template match="state" mode="conflicts"): New.
5695 (xsl:template name="line-wrap"): New.
5696 (xsl:template name="ws-search"): New.
5697 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
5698 (xsl:template match="bison-xml-report"): Instead of styling the
5699 "conflicts" element, style the "automaton" element with mode
5700 "conflicts."
5701 (xsl:template match="conflicts"): Remove.
5702 (xsl:template match="conflict"): Remove.
5703 (xsl:template match="automaton" mode="conflicts"): New.
5704 (xsl:template match="state" mode="conflicts): New.
5705 * src/conflicts.c (conflicts_output_xml): Remove.
5706 * src/conflicts.h (conflicts_output_xml): Remove prototype.
5707 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
5708 * src/print.c (print_grammar): Consistently wrap at the 66th column so
5709 the corresponding XSLT is easier. Also, never wrap between a word and
5710 the comma that follows it.
5711
57122007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5713
5714 Improve C++ namespace support. Discussed starting at
5715 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
5716 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
5717 b4_namespace_close): New macros that interpret the %define variable
5718 "namespace" so its value can contain "::" to indicate nested
5719 namespaces.
5720 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
5721 the above macros.
5722 * data/lalr1.cc (b4_namespace): Likewise.
5723 * data/location.cc (b4_namespace): Likewise.
5724 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
5725 inside a new table in the general %define entry. Document `%define
5726 namespace' there as well. Point the %name-prefix entry to it since it
5727 explains it more completely in the case of C++.
5728 (C++ Bison Interface): Mention `%define namespace' instead of
5729 %name-prefix.
5730 (Table of Symbols): Remove the `%define push_pull' entry. The %define
5731 entry suffices.
5732 * tests/c++.at (Relative namespace references): New test case.
5733 (Absolute namespace references): New test case.
5734 (Syntactically invalid namespace references): New test case.
5735 * tests/input.at (C++ namespace reference errors): New test case.
5736
57372007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5738
5739 Add syncline support and location accessor to internal %define
5740 interfaces.
5741 * data/bison.m4 (b4_percent_define_get_loc): New.
5742 (b4_percent_define_get_syncline): New.
5743 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
5744 (b4_percent_define_default): Record defining location as line 1 rather
5745 than 0 for the sake of synchronizing #line's, and define
5746 b4_percent_define_syncline(VARIABLE).
5747 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
5748 * src/muscle_tab.c (muscle_syncline_grow): New.
5749 (muscle_code_grow): Use muscle_syncline_grow.
5750 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
5751 define b4_percent_define_syncline(VARIABLE).
5752 (muscle_percent_define_get_loc): New.
5753 (muscle_percent_define_get_syncline): New.
5754 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
5755 remove some unused variables.
5756 (muscle_percent_define_default): Record defining location as line 1
5757 rather than 0 for the sake of synchronizing #line's, and define
5758 b4_percent_define_syncline(VARIABLE).
5759 (muscle_percent_define_check_values): Use
5760 muscle_percent_define_get_loc.
5761 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
5762 (muscle_percent_define_get_syncline): Prototype.
5763 * tests/skeletons.at (%define Boolean variables: invalid skeleton
5764 defaults): Update output for location change.
5765 (Complaining during macro argument expansion): Extend to test
5766 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
5767
57682007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
5769
5770 Fix some error-reporting macro bugs.
5771 * data/bison.m4 (b4_cat): New.
5772 (b4_error, b4_error_at): Use b4_cat to send error directives directly
5773 to stdout so they don't become arguments to other macros. Update
5774 comments and add examples.
5775 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
5776 add examples.
5777 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
5778 after printing the error directive so that M4 doesn't report subsequent
5779 problems that are induced by this problem.
5780 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
5781 instead of just in them. Recognize @\n in both places. Both expand to
5782 the empty string. Needed by b4_cat.
5783 * tests/skeletons.at (Complaining during macro argument expansion):
5784 New test case.
5785 (Fatal errors make M4 exit immediately): New test case.
5786
57872007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
5788
5789 Implement --print-datadir.
5790 * src/getargs.c (usage): Mention.
5791 (PRINT_DATADIR_OPTION): New anonymous enum member.
5792 (long_options): Add entry for it.
5793 (getargs): Add case for it calling compute_pkgdatadir.
5794 * src/output.c (output_skeleton): Encapsulate data directory
5795 computation from here...
5796 (prepare): ... and from here...
5797 (compute_pkgdatadir): ... into this new function.
5798 * src/output.h (compute_pkgdatadir): Prototype.
5799
58002007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
5801
5802 * src/print-xml.c (escape_bufs): New static global variable
5803 replacing...
5804 (xml_escape_n): ... the static local variable buf here.
5805 (print_xml): Free memory for escape_bufs.
5806 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
5807
58082007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
5809
5810 Replace `%push-parser' and `%push-pull-parser' with
5811 `%define push_pull "push"' and `%define push_pull "both"'.
5812 `%define push_pull "pull"' is the default.
5813 * doc/bison.texinfo (Push Decl, Push Parser Function,
5814 Pull Parser Function, Parser Create Function, Parser Delete Function):
5815 Update declarations.
5816 (Decl Summary, Table of Symbols): Replace %push-parser and
5817 %push-pull-parser entries with a %define push_pull entry.
5818 * data/bison.m4 (b4_percent_define_check_values): New macro.
5819 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
5820 definitions...
5821 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
5822 definitions...
5823 * data/push.c: ... to here and compute them from the value of the
5824 %define variable push_pull.
5825 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
5826 parsing requests here...
5827 * data/yacc.c: ... hack this to switch to push.c any time
5828 b4_use_push_pull_flag or the %define variable push_pull is set. This
5829 will go away when we mv push.c yacc.c.
5830 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
5831 push parsing is not supported since unused %define variables are
5832 reported anyway.
5833 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
5834 * src/muscle_tab.h (muscle_percent_define_check_values): Update
5835 comments for consistency with b4_percent_define_check_values.
5836 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
5837 muscles.
5838 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
5839 Remove.
5840 (prologue_declaration): Remove %push-parser and %push-pull-parser
5841 rules.
5842 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
5843 * tests/calc.at: Update declarations.
5844 * tests/input.at (%define enum variables): New test case.
5845 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
5846 declaration.
5847 (Push Parsing: Multiple impure instances): Update declaration.
5848 (Push Parsing: Unsupported Skeletons): New test case.
5849 * tests/torture.at (Exploding the Stack Size with Alloca): Update
5850 declaration.
5851 (Exploding the Stack Size with Malloc): Update declaration.
5852
58532007-09-24 Wojciech Polak <polak@gnu.org>
5854
5855 Add XSLT transformations.
5856
5857 * data/xslt/xml2dot.xsl: Transform XML into DOT.
5858 * data/xslt/xml2text.xsl: Transform XML into plain text.
5859 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
5860 * data/Makefile.am (xsltdir): New variable.
5861 (dist_xslt_DATA): Add xslt/*.xsl files.
5862
58632007-09-23 Paul Eggert <eggert@cs.ucla.edu>
5864
5865 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
5866 Problem reported by Wojciech Polak.
5867 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
5868 (xml_printf): Undo change I made on 21 September; that is,
5869 indent 2 spaces, not 1.
5870
58712007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
5872
5873 Pacify ./configure --enable-gcc-warnings.
5874 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
5875 `char const *' instead of `char *'.
5876 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
5877 local variable `sep'.
5878
58792007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5880
5881 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
5882 elsewhere.
5883 * src/print-xml.c: Prefer "const" after types; that's more consistent.
5884 (xml_printf): Indent just 1 space for level.
5885 (e_char, xlate_char): Remove.
5886 (xml_escape_string): Rewrite to avoid undefined behavior (used
5887 storage that was freed from the stack).
5888 (xml_escape_n): Don't bother checking for subscript error.
5889
58902007-09-21 Wojciech Polak <polak@gnu.org>
5891
5892 Add Bison XML Automaton Report.
5893
5894 Add support for an -x option to generate an XML report.
5895 It is not documented yet.
5896 * src/print-xml.c: New file.
5897 * src/print-xml.h: Likewise.
5898 * lib/timevar.def (TV_XML): New var.
5899 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
5900 * src/conflicts.c: Include print-xml.h.
5901 (solved_conflicts_xml_obstack): New var.
5902 (log_resolution, conflicts_solve, conflicts_free):
5903 Add support for XML report.
5904 (conflicts_output_val): New function.
5905 * src/conflicts.h (conflicts_output_val): New decl.
5906 * src/files.c (spec_xml_file): New var.
5907 (compute_output_file_names, output_file_names_free): Add XML support.
5908 * src/files.h (spec_xml_file): New decl.
5909 * src/getargs.c (xml_flag): New var.
5910 (usage, short_options, long_options, getargs): Add XML support.
5911 * src/getargs.h (xml_flag): New decl.
5912 * src/gram.c: Include print-xml.h.
5913 (rule_lhs_print_xml, rule_rhs_print_xml):
5914 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
5915 New functions.
5916 * src/gram.h: Declare external ones.
5917 * src/main.c: Include print-xml.h.
5918 (main): Add XML support.
5919 * src/reduce.c: Include print-xml.h.
5920 (reduce_xml): New function.
5921 * src/reduce.h: Declare it.
5922 * src/state.c: Include print-xml.h.
5923 (state_new): Add XML support.
5924 (state_rule_lookahead_tokens_print_xml): New function.
5925 * src/state.h: Declare it.
5926 (struct state): New member solved_conflicts_xml.
5927 * src/symtab.c (symbol_class_get_string): New function.
5928 * src/symtab.h: Declare it.
5929
59302007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5931
5932 * GNUmakefile: Switch to coreutils's version.
5933 * bootstrap: Likewise.
5934 * Makefile.cfg: Adjust to new GNUmakefile.
5935 * README-hacking: Likewise.
5936
5937 Import from gnulib:
5938
5939 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
5940 Bruno Haible <bruno@clisp.org>
5941
5942 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
5943 and is a script that invokes bison. Tighten the code. Add comments.
5944
59452007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
5946
5947 Spell "boolean" as "Boolean". Reported by Akim Demaille.
5948 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
5949 * doc/bison.texinfo (Decl Summary): Fix.
5950 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
5951 * tests/input.at (Boolean %define variables): Update output.
5952 * tests/skeletons.at (%define boolean variables: invalid skeleton
5953 defaults): Rename to...
5954 (%define Boolean variables: invalid skeleton defaults): ... this and
5955 update output.
5956
59572007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
5958
5959 In impure push mode, don't allow more than one yypstate to be allocated
5960 since multiple impure parsers would corrupt yynerrs.
5961 * data/push.c (yypstate_allocated): New static global variable
5962 initialized to 0.
5963 (yypull_parse): If yypstate_new returns 0, don't report it as memory
5964 exhaustion if yypstate_allocated is 1, but still return 2.
5965 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
5966 already 1. Otherwise, set it to 1.
5967 (yypstate_delete): Set it to 0.
5968 * tests/push.at (Push Parsing: Multiple impure instances): New test
5969 case.
5970
59712007-08-17 Bob Rossi <bob@brasko.net>
5972
5973 * doc/bison.texinfo (Push Decl): Document the push parser.
5974 (Table of Symbols): Ditto.
5975 (Pure Decl): Ditto.
5976 (Decl Summary): Ditto.
5977 (Multiple Parsers, Push Parser Function, Pull Parser Function,
5978 Parser Create Function, Parser Delete Function):
5979 Add new push parser symbols.
5980 (Table of Symbols): Document push-parser, push-pull-parser,
5981 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
5982
59832007-08-15 Paul Eggert <eggert@cs.ucla.edu>
5984
5985 Update to GPLv3.
5986 * doc/gpl-3.0.texi: New file.
5987 * doc/gpl.texi: Remove.
5988 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
5989 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
5990 * README-hacking, TODO, bootstrap, bootstrap.conf:
5991 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
5992 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
5993 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
5994 * data/lalr1.cc, data/lalr1.java, data/location.cc:
5995 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
5996 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
5997 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
5998 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
5999 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
6000 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
6001 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
6002 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
6003 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
6004 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
6005 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
6006 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
6007 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
6008 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
6009 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
6010 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
6011 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
6012 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
6013 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
6014 * src/complain.c, src/complain.h, src/conflicts.c:
6015 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
6016 * src/files.h, src/flex-scanner.h, src/getargs.c:
6017 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
6018 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
6019 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
6020 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
6021 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
6022 * src/print.c, src/print.h, src/print_graph.c:
6023 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
6024 * src/reduce.h, src/relation.c, src/relation.h:
6025 * src/revision.h, src/scan-code.h, src/scan-code.l:
6026 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
6027 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
6028 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
6029 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
6030 * tests/Makefile.am, tests/actions.at, tests/c++.at:
6031 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
6032 * tests/existing.at, tests/glr-regression.at:
6033 * tests/headers.at, tests/input.at, tests/java.at:
6034 * tests/local.at, tests/output.at, tests/push.at:
6035 * tests/reduce.at, tests/regression.at, tests/sets.at:
6036 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
6037 * tests/torture.at:
6038 Update to GPLv3.
6039
60402007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6041
6042 Get rid of broken %no-parser, -n, and --no-parser implementation and
6043 documentation.
6044 * TODO: Don't mention them.
6045 * doc/bison.1: Likewise.
6046 * doc/bison.texinfo (Decl Summary): Likewise.
6047 (Bison Options): Likewise.
6048 (Option Cross Key): Likewise.
6049 * src/getargs.c (no_parser_flag): Remove global variable.
6050 (usage): Don't print description of -n and --no-parser.
6051 (long_options): Remove --no-parser entry here.
6052 (getargs): Remove -n case in the switch here.
6053 * src/getargs.h (no_parser_flag): Remove extern.
6054 * tests/regression.at (Web2c Actions): Remove comment that mentions
6055 --no-parser.
6056
60572007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6058
6059 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
6060 name user variables starting with `yy'. Just pass NULL instead of a
6061 dummy local &yylval to yypush_parse.
6062 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
6063 starting with `yy'.
6064
60652007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
6066
6067 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
6068 true since it's then always used regardless of whether yyoverflow is
6069 defined. Reported by Christian Burger at
6070 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
6071 * THANKS: Add Christian Burger.
6072
6073 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6074 node names: say "Decl Summary" not "Bison Declaration Summary".
6075
60762007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
6077
6078 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
6079 determine whether this function has already complained about an invalid
6080 value for a %define boolean variable, don't check whether Bison has
6081 ever examined the value. As written, the check was a tautology.
6082 Instead, record and check for this complaint using a separate muscle.
6083
60842007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
6085
6086 Fix push parsing memory leak reported by Brandon Lucia at
6087 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
6088 * THANKS: Add Brandon Lucia.
6089 * data/push.c (yypstate_delete): Free the stack if it was reallocated
6090 but the parse never completed and thus freed it.
6091 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
6092 * tests/testsuite.at: Include push.at.
6093 * test/push.at: New.
6094 (Push Parsing: Memory Leak for Early Deletion): New test case.
6095
60962007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
6097
6098 Improve handling of multiple S/R conflicts in the same state and of S/R
6099 conflicts involving multiple reductions.
6100 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
6101 set for a state here or Bison will abort if it is reassigned on a
6102 later conflicted reduction in the same state.
6103 Similarly, don't finalize and assign the solved conflicts report here
6104 or it will be lost if it is reassigned on a later conflicted reduction
6105 in the same state.
6106 (set_conflicts): Instead, assign them both here after all S/R conflicts
6107 in the state have been fully examined.
6108 * src/print.c (shift_set): Rename to...
6109 (no_reduce_set): ... this.
6110 (print_reductions): Update for rename, and add %nonassoc error action
6111 tokens to no_reduce_set so that, when printing the first remaining
6112 reduction on an error action token, the reduction is enclosed in
6113 brackets.
6114 (print_results): Update for rename.
6115 * tests/conflicts.at (Solved conflicts report for multiple reductions
6116 in a state): New test case.
6117 (%nonassoc error actions for multiple reductions in a state): New test
6118 case.
6119
6120 * src/main.c (main): Don't depend on C99 features.
6121
61222007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
6123
6124 * build-aux/.cvsignore: Add compile.
6125 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
6126 uniwidth.
6127
61282007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
6129
6130 * bootstrap (slurp): Create target directories that don't exist.
6131 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
6132
61332007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6134
6135 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
6136 than item number.
6137 * closure.c (closure): Likewise.
6138 * state.h (reductions): Comment sorting of rules.
6139 (state): Comment sorting of items.
6140
61412007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
6142
6143 Fix C++ test cases after recent Gnulib changes. Discussed starting at
6144 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
6145 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
6146 definition in order to avoid Gnulib headers since we don't use config.h
6147 here.
6148 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
6149 rather than AT_DATA so that config.h is included.
6150
61512007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
6152
6153 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
6154 instead of fprintf. Guard these functions with #if YYDEBUG instead of
6155 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
6156 and so that YYFPRINTF is guaranteed to be defined here.
6157
61582007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6159
6160 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
6161 with...
6162 (muscle_percent_define_check_values): ... this more helpful function.
6163 Again, it's not used yet, but it will be.
6164 * src/muscle_tab.h: Likewise.
6165
6166 Improve some comments in parser table construction.
6167 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
6168 (generate_states): Don't mention ruleset, which is internal to closure.
6169 * src/closure.c (closure): Explain sorting of core and itemset, which
6170 is required for this function to behave correctly.
6171 * src/closure.h (closure): Mention sorting.
6172
61732007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
6174
6175 * src/lalr.c (state_lookahead_tokens_count): For code readability,
6176 move the check for disabled transitions to an aver since conflict
6177 resolution hasn't happened yet.
6178
6179 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
6180 labels a state as inconsistent just because it has error transitions.
6181 The original form of this check appeared in revision 1.1 of lalr.c,
6182 which was committed on 1991-12-21. Now (at least), changing the
6183 consistency label on such a state appears to have no useful effect in
6184 any of the places it is examined, which I enumerate below. The key
6185 point to understanding each item in this enumeration is that a state
6186 with an error transition is labelled consistent in the first place only
6187 if it has no rules, so the check cannot matter for states that have
6188 rules. (1) Labelling a state as inconsistent will cause set_conflicts
6189 to try to identify its conflicts, and a state must have *rules* to have
6190 conflicts. (2) Labelling a state as inconsistent will affect how
6191 action_row sets the default *rule* for the state. (3) Labelling a
6192 state as inconsistent will cause build_relations to add lookback edges
6193 to *rules* in that state.
6194 * src/state.h (struct state): Word the comment for member consistent
6195 more carefully.
6196
61972007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
6198
6199 Don't depend on C99 features.
6200 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
6201 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
6202 * src/reader.c (check_and_convert_grammar): Fix for-loop.
6203 * src/state.c (state_mark_reachable_states): Fix for-loop.
6204 (state_remove_unreachable_states): Fix for-loop.
6205
6206 Don't widen struct state with member reachable just to temporarily
6207 record reachability. Instead, use a local bitset.
6208 * src/state.h (struct state): Remove member.
6209 * src/state.c (state_new): Don't initialize it.
6210 (state_mark_reachable_states): Rename to...
6211 (state_record_reachable_states): ... this, and use bitset.
6212 (state_remove_unreachable_states): Use bitset.
6213
62142007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
6215
6216 * src/Makefile.am (yacc): Quote target action commands properly so
6217 that the yacc script isn't corrupt. Reported by Hans Aberg at
6218 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
6219
6220 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
6221 the case of pure parsers. Reported by Frans Englich at
6222 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
6223 * THANKS: Add Frans Englich.
6224
6225 * NEWS (2.3a+): In the %code entry, reference section `Bison
6226 Declaration Summary' from the manual now since the %code summary has
6227 moved there.
6228 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
6229 in the rules section must be terminated by semicolons.
6230
62312007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
6232
6233 Extend the front-end API for %define variables to more completely
6234 mirror the back-end. This will be useful in the future.
6235 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
6236 Update comments to mention the new front-end counterparts of these
6237 macros.
6238 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
6239 for muscle_string_decode and muscle_location_decode.
6240 (muscle_string_decode): New static function.
6241 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
6242 (muscle_percent_define_get, muscle_percent_define_ifdef): New
6243 functions.
6244 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
6245 muscle_percent_define_get to mimic the b4_percent_define_flag_if
6246 implementation more closely.
6247 (muscle_percent_define_invalid_value): New function.
6248 * src/muscle_tab.h (muscle_percent_define_get,
6249 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
6250 Prototype.
6251
62522007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
6253
6254 * NEWS (2.3a+): Mention yesterday's state-removal change.
6255 (2.3a): Remove the %language entry, which was added after 2.3a.
6256 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
6257 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
6258 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
6259 tests/existing.at: Update copyright date.
6260
62612007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6262
6263 If conflict resolution makes states unreachable, remove those states,
6264 report rules that are then unused, and don't report conflicts in those
6265 states.
6266 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
6267 New global function.
6268 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
6269 function.
6270 * src/main.c (main): After conflict resolution, remove the unreachable
6271 states and update all data structures that reference states by number.
6272 * src/state.c (state_new): Initialize each state's reachable member to
6273 false.
6274 (state_mark_reachable_states): New static function.
6275 (state_remove_unreachable_states): New global function.
6276 * src/state.h (struct state): Add member bool reachable.
6277 (state_remove_unreachable_states): Prototype.
6278 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6279 New test case.
6280 * tests/existing.at (GNU pic Grammar): Update test case output now that
6281 an unused rule is discovered.
6282
62832007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6284
6285 Minor code cleanup in parser table construction.
6286 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
6287 (new_itemsets, save_reductions): Update for rename to nitemset.
6288 * src/closure.c (nritemset): Rename to...
6289 (nitemset): ... this since the "r" appears to meaningless and isn't
6290 used in the comments.
6291 (closure): Update for rename.
6292 * src/closure.h (nritemset): Update extern to...
6293 (nitemset): ... this.
6294 * src/lalr.c (LA): Fix a typo in comments.
6295 * src/print.c (print_core): Update for rename to nitemset.
6296 * src/print_graph.c (print_graph): Likewise.
6297 * src/state.h: Fix some typos in header comments.
6298
62992007-04-04 Paul Eggert <eggert@cs.ucla.edu>
6300
6301 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
6302 still sticks to ASCII. Sorry!
6303
6304 * README-hacking: New file, taken mostly from coreutils, with changes
6305 for Bison. Contains much of the contents of:
6306 * README-cvs: Remove.
6307 * bootstrap: Sync from gnulib.
6308 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
6309 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
6310
63112007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
6312
6313 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
6314 Setzer.
6315 (Java Differences): Fix some typos.
6316 * THANKS: Add Sebastian Setzer.
6317
63182007-03-07 Paolo Bonzini <bonzini@gnu.org>
6319
6320 * data/java.m4 (b4_single_class_if): Remove.
6321 (b4_abstract_if): Look at "%define abstract".
6322 (b4_lexer_if): New.
6323 (b4_union_name): Rename...
6324 (b4_yystype): ... to this. Map to "%define stype".
6325 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
6326 b4_maybe_throws): Fix quoting.
6327 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
6328 * data/lalr1.java (Lexer interface): Always define.
6329 (Lexer interface within parser class): Remove.
6330 (YYLexer class): New, used when "%code lexer" is present.
6331 (constructor): When "%code lexer" is used, pass %lex-param
6332 to the lexer constructor.
6333 (yylex, yyparse): Remove %lex-param from method invocations
6334 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
6335
6336 * doc/bison.texinfo (Java Bison Interface): Mention "%define
6337 abstract". Rename "%define union_name" to "%define stype".
6338 Rename method names according to previous patch.
6339 (Java Scanner Interface): Describe "%code lexer" instead of
6340 "%pure-parser" and "%define single_class".
6341 (Java Differences): Mention "%code lexer".
6342
6343 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
6344 Include scanner here, using macros from tests/local.at.
6345 (AT_DATA_CALC_Y): Remove final argument.
6346 (_AT_CHECK_JAVA_CALC): Likewise.
6347 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
6348 of %locations and %error-verbose.
6349 (main): Test with and without %lex-param.
6350 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
6351 (AT_BISON_OPTION_POPDEFS): Pop it.
6352
63532007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6354
6355 DJGPP spefic issue. Inhibit the use of disallowed characters for
6356 file name genertion on Win98, WinXP, etc. These are |<>":?*\
6357 and concern testsuite case 46.
6358 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
6359 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
6360 * djgpp/config.bat: Inhibit the use of disallowed characters.
6361
63622007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6363
6364 Miscellaneous %define and %code cleanup.
6365 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
6366 values are interpreted.
6367 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
6368 documentation a little more.
6369 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
6370 muscle_percent_define_insert, muscle_percent_code_grow): New
6371 functions/macros.
6372 * src/muscle_tab.h (muscle_percent_define_insert,
6373 muscle_percent_code_grow): Prototype.
6374 * src/parse-gram.y (prologue_declaration): Use
6375 muscle_percent_define_insert and muscle_percent_code_grow when parsing
6376 %define and %code directives.
6377
6378 Make it easy to share %define boolean variables between the front-end
6379 and back-end. Though not used yet, this will be useful in the future.
6380 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
6381 Bison uses of names rather than just skeleton uses of names.
6382 (b4_percent_define_get, b4_percent_define_ifdef): Rename
6383 b4_percent_define_skeleton_variables(VARIABLE) to
6384 b4_percent_define_bison_variables(VARIABLE).
6385 (b4_percent_code_get, b4_percent_code_ifdef): Rename
6386 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
6387 b4_percent_code_bison_qualifiers(QUALIFIER).
6388 (b4_check_user_names_wrap): Update for renames.
6389 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
6390 muscle_percent_define_default): New functions mimicking
6391 b4_percent_define_flag_if and b4_percent_define_default.
6392
6393 For %define variables, report locations for invalid values and
6394 redefinitions.
6395 * data/bison.m4 (b4_percent_define_flag_if): Read
6396 b4_percent_define_loc(VARIABLE) to report the location of an invalid
6397 value for VARIABLE.
6398 (b4_percent_define_default): Save a special location in
6399 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
6400 must later be reported as invalid.
6401 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
6402 functions.
6403 (muscle_percent_define_insert): Record the location of VARIABLE in
6404 muscle percent_define_loc(VARIABLE), and use it to report the previous
6405 location for a redefinition.
6406 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
6407 (muscle_percent_define_default): Update like b4_percent_define_default.
6408 (muscle_grow_user_name_list): Rename to...
6409 (muscle_user_name_list_grow): ... this for consistency and use
6410 muscle_location_grow.
6411 * src/muscle_tab.h (muscle_location_grow): Prototype.
6412 * tests/input.at (%define errors): Update expected output.
6413 * tests/skeletons.at (%define boolean variables: invalid skeleton
6414 defaults): New test case.
6415
64162007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
6417
6418 * src/print.c (lookahead_set, state_default_rule): Remove.
6419 (print_reductions): Replace state_default_rule invocation with
6420 equivalent use of yydefact, which was computed in token_actions in
6421 tables.c.
6422 (print_results): Don't allocate lookahead_set.
6423
64242007-02-27 Paolo Bonzini <bonzini@gnu.org>
6425
6426 * data/lalr1.java: Prefix all private members with yy.
6427
64282007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
6429
6430 Use YYFPRINTF instead of fprintf where appropriate. Reported by
6431 Sebastien Fricker at
6432 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
6433 * THANKS: Add Sebastien Fricker.
6434 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
6435 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
6436 accept a variable number of arguments.
6437
64382007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
6439
6440 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
6441
64422007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6443
6444 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
6445 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
6446 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
6447
64482007-02-11 Paul Eggert <eggert@cs.ucla.edu>
6449
6450 Undo my 2007-02-07 change, switching back to the c-strcase module
6451 introduced in the 2007-02-03 change. Bruno Haible reported that
6452 the 2007-02-07 change would be dangerous in Turkish if we add a
6453 language whose name contains "i", since "i" is not lowercase "I"
6454 in Turkish.
6455 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
6456 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
6457 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
6458 * m4/.cvsignore: Remove strcase.m4.
6459 * src/getargs.c: Revert 2007-02-07 change, as follows.
6460 Include c-strcase.h.
6461 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
6462
64632007-02-11 Bruno Haible <bruno@clisp.org>
6464
6465 Enable the Java related testsuite tests when the only Java compiler
6466 found is a gcj < 4.3. Discussed at
6467 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
6468 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
6469
64702007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
6471
6472 * data/Makefile.am: Update copyright date.
6473 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
6474 yypstate_new returns NULL.
6475 (yypstate_new): Return NULL if malloc does.
6476 * src/reader.c (packgram): Move translation of rule actions from the
6477 beginning of packgram to...
6478 (check_and_convert_grammar): ... here right before packgram is invoked
6479 so it's easier to write more complete comments, and remove redundant
6480 code.
6481
64822007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
6483
6484 As in semantic actions, make @$ in %initial-action, %destructor, and
6485 %printer imply %locations.
6486 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
6487 scanning @$.
6488 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
6489 (@$ in %initial-action implies %locations,
6490 @$ in %destructor implies %locations,
6491 @$ in %printer implies %locations): ... these new test cases.
6492
64932007-02-07 Paul Eggert <eggert@cs.ucla.edu>
6494
6495 Undo most of the 2007-02-03 change, switching to the strcase module
6496 now that gnulib strcase has been fixed.
6497 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
6498 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
6499 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
6500 * m4/.cvsignore: Add strcase.m4.
6501 * src/getargs.c: Revert 2007-02-03 change, as follows.
6502 Don't include c-strcase.h.
6503 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
6504 strcasecmp has "unspecified behavior" outside the POSIX locale,
6505 but it works fine in practice if at least one argument is ASCII,
6506 as is the case in Bison.
6507
65082007-02-07 Paolo Bonzini <bonzini@gnu.org>
6509
6510 * tests/java.at: Skip tests if only one of javac/java is present.
6511 Reported by Joel E. Denny.
6512 * tests/atlocal.in: Adjust copyright years.
6513
65142007-02-05 Paolo Bonzini <bonzini@gnu.org>
6515
6516 * data/lalr1.java (Stack): Work around old verifiers that disallow
6517 access to the private fields of an inner class, from the outer class.
6518 We can make Stack's fields public because user code doesn't have access
6519 to the instance of Stack used by parse(). Reported by Paul Eggert.
6520
65212007-02-03 Paul Eggert <eggert@cs.ucla.edu>
6522
6523 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
6524 the right spot for these files?
6525 * bootstrap.conf (gnulib_modules): Add c-strcase.
6526 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
6527 c-strncasecmp.c.
6528 * src/getargs.c: Include c-strcase.h.
6529 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
6530 to avoid unspecified behavior.
6531
65322007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
6533
6534 * doc/bison.texinfo (Decl Summary): Correct typo.
6535
65362007-01-30 Paolo Bonzini <bonzini@gnu.org>
6537
6538 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
6539 Complain if the value does not match empty, "true" or "false".
6540 * data/c++.m4: Adjust default definitions of %define variables.
6541 * data/java.m4: Adjust default definitions of %define variables.
6542 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
6543 to above behavior.
6544 * tests/input.at (Boolean %define variables): Test new behavior.
6545
65462007-01-29 Paolo Bonzini <bonzini@gnu.org>
6547
6548 * NEWS: Mention java.
6549 * TODO: Remove things that are done.
6550 * bootstrap.conf: Add javacomp-script and javaexec-script.
6551 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
6552
6553 * data/Makefile.am: Add new files.
6554 * data/java-skel.m4: New.
6555 * data/java.m4: New.
6556 * data/lalr1.java: New.
6557
6558 * doc/bison.texinfo: Put "A Complete C++ Example" under
6559 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
6560 under Other Languages.
6561
6562 * src/getargs.c (valid_languages): Add Java.
6563 * src/getargs.h (struct bison_language): Update size of string fields.
6564
6565 * tests/Makefile.am: Add java.at.
6566 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
6567 * tests/java.at: New.
6568 * tests/testsuite.at: Include it.
6569
65702007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
6571
6572 Clean up.
6573 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
6574 at_directive_argv arguments so these no longer have to be global
6575 variables. Also, update the implementation for the following changes.
6576 (fail_for_at_directive_too_many_args,
6577 fail_for_at_directive_too_few_args): Add at_directive_name argument.
6578 (at_directive_name): Remove as at_directive_argv[0] will be used for
6579 this now.
6580 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
6581 for the directive name.
6582 (at_directive_argc, at_directive_argv): Make these local within
6583 skel_lex instead of global.
6584 (INITIAL): Update directive start action for above changes.
6585 (SC_AT_DIRECTIVE_ARG): Rename to...
6586 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
6587 (SC_AT_DIRECTIVE_SKIP_WS): Update.
6588 (scan_skel): Move yylex_destroy to...
6589 (skel_scanner_free): ... here.
6590 * tests/skeletons.at (installed skeleton file name): Rename to...
6591 (installed skeleton file names): ... this.
6592
65932007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
6594
6595 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6596 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
6597 Summary" not "Directives".
6598 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
6599 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
6600 since the former is now the more complete one.
6601 (Prologue Alternatives): Likewise and do the same for %defines.
6602 (Table of Symbols): Add summary of %code, add summary of %define, and
6603 move full %code documentation to...
6604 (Decl Summary): ... here for consistency with other entries in these
6605 sections.
6606 Move %define entry in order to keep this list alphabetized.
6607 Reword %define entry a little to put less emphasis on the skeleton
6608 concept, which most users shouldn't have to think about.
6609
66102007-01-26 Paul Eggert <eggert@cs.ucla.edu>
6611
6612 Adjust to recent gnulib changes.
6613 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
6614 Add string.h, string_.h, unistd_.h, wchar_.h.
6615 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
6616 * src/system.h: Don't include <stpcpy.h>; this is now done by
6617 <string.h>.
6618
66192007-01-23 Paolo Bonzini <bonzini@gnu.org>
6620
6621 Simplify implementation of unqualified %code, implement macros for
6622 uniform treatment of boolean %define flags. Document %define.
6623 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
6624 b4_percent_code_ifdef): New.
6625 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
6626 * data/c++.m4: Define default value for global_tokens_and_yystype.
6627 * data/glr.cc: Likewise.
6628 * data/location.cc: Use b4_percent_define_flag_if.
6629
6630 * doc/bison.texinfo (Decl Summary): Document %define.
6631
6632 * src/parse-gram.y (Unqualified %code): Change muscle name to
6633 b4_percent_code().
6634 (content.opt): Default to empty.
6635
66362007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6637
6638 Implement support for relative and absolute skeleton file names.
6639 Discussed starting at
6640 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
6641 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
6642 (Bison Options): Document in --skeleton entry.
6643 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
6644 full_skeleton can't necessarily hold all of pkgdatadir.
6645 If the specified skeleton file name contains a `/', don't prepend
6646 pkgdatadir.
6647 * src/parse-gram.y (prologue_declaration): If the specified skeleton
6648 file name contains a `/', prepend the grammar file directory.
6649 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
6650 * skeletons.at: New file.
6651 (relative skeleton file names): New test case.
6652 (installed skeleton file names): New test case.
6653 * tests/testsuite.at: Include skeletons.at.
6654
6655 * bootstrap: Update copyright to 2007.
6656
66572007-01-17 Paolo Bonzini <bonzini@gnu.org>
6658
6659 * bootstrap: Remove occurrences of .#bootmp from the files.
6660
66612007-01-17 Akim Demaille <akim@epita.fr>
6662
6663 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
6664 nonterminals.
6665 Use per-type %printer.
6666
66672007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6668
6669 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
6670 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6671 djgpp/config.site, src/files.c, src/files.h, src/main.c,
6672 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
6673 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
6674 tests/glr-regression.at, tests/input.at, tests/local.at,
6675 tests/output.at, tests/torture.at: Update copyright to 2007.
6676
66772007-01-16 Akim Demaille <akim@epita.fr>
6678
6679 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
6680 error code.
6681 (Calc++ Scanner): Exit with failure if we can't open the input
6682 file.
6683 Accept "-" standing for stdin.
6684 (Calc++ Top Level): Print the result only if the parsing was
6685 successful.
6686
66872007-01-16 Akim Demaille <akim@epita.fr>
6688
6689 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
6690
66912007-01-15 Paolo Bonzini <bonzini@gnu.org>
6692 and Joel E. Denny <jdenny@ces.clemson.edu>
6693
6694 Clean up %define and %code implementation in M4 some. Most
6695 importantly, rename all related macros to be in the b4_percent_define
6696 and b4_percent_code namespaces. Also, complete support for `.' in
6697 %define variable names and %code qualifiers.
6698 * data/bison.m4 (b4_check_user_names): Check for special
6699 "SKELETON-NAMESPACE(name)" macros instead of using two nested
6700 m4_foreach loops.
6701 (b4_get_percent_define, b4_get_percent_code): Rename to...
6702 (b4_percent_define_get, b4_percent_code_get): ... these.
6703 Extend documentation with examples.
6704 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
6705 b4_percent_define_skeleton_variables and
6706 b4_percent_code_skeleton_qualifiers.
6707 Expect any value for the %define variable `foo' to be stored in the
6708 macro named `b4_percent_define(foo)'; expect any %code blocks for the
6709 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
6710 expect any unqualified %code blocks to be stored in a macro named
6711 `b4_percent_code_unqualified'.
6712 Use m4_indir so that %define variable names and %code qualifiers can
6713 contain `.', which is allowed by the grammar parser.
6714 (b4_percent_define_default): New macro to set a default value for a
6715 %define variable.
6716 (m4_wrap): Update wrapped code, and fix some underquoting.
6717 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
6718 Expect grammar uses of %define variables and %code qualifiers to be
6719 defined in b4_percent_define_user_variables and
6720 b4_percent_code_user_qualifiers.
6721 * data/c++.m4: Use b4_percent_define_default rather than
6722 m4_define_default. Fix some underquoting. Skeleton usage of %define
6723 variable define_location_comparison now implies skeleton usage of
6724 %define variable filename_type.
6725 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6726 data/push.c, data/yacc.c: Update macro names.
6727 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
6728 muscle names.
6729
67302007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6731
6732 DJGPP specific issues.
6733
6734 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
6735 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
6736
67372007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6738
6739 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
6740 run parsers in all tests so that Valgrind is invoked during
6741 maintainer-check-valgrind.
6742 (Duplicate representation of merged trees): Free all semantic values.
6743 (Duplicated user destructor for lookahead): Likewise.
6744
67452007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6746
6747 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
6748 command-line prefix.
6749 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
6750 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
6751 miss Valgrind messages.
6752 (Exploding the Stack Size with Malloc): Likewise.
6753
67542007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6755
6756 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
6757 locals. Reported by Juan Manuel Guerrero at
6758 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
6759 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
6760 Fix some indentation also.
6761 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
6762 explaining this issue.
6763
67642007-01-09 Paolo Bonzini <bonzini@gnu.org>
6765 and Joel E. Denny <jdenny@ces.clemson.edu>
6766
6767 Simplify union and prologue handling, and escape union and lex/parse
6768 params with digraphs.
6769 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
6770 values to the empty string since these are no longer guaranteed
6771 initialized by the front-end.
6772 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
6773 braces around b4_user_stype since this is no longer done by the
6774 front-end.
6775 * src/files.c, src/files.h (pre_prologue_obstack,
6776 post_prologue_obstack): Remove.
6777 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
6778 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
6779 with digraphs. This fixes lex params and parse params.
6780 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
6781 * src/output.c (prepare): Remove muscle insertion of the prologues.
6782 (output): Remove freeing of pre_prologue_obstack and
6783 post_prologue_obstack.
6784 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
6785 than prologue_augment for prologue parsing so you don't need prologue
6786 obstacks.
6787 (grammar_declaration): For %union RHS, use `braceless' instead of
6788 "{...}" so that braces are already stripped and code is escaped with
6789 digraphs.
6790 * src/reader.c (prologue_augment): Remove.
6791 (reader): Remove initialization of pre_prologue_obstack and
6792 post_prologue_obstack.
6793 * src/reader.h (prologue_augment): Remove.
6794
6795 * data/c.m4: Remove stray parenthesis.
6796
67972007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6798
6799 Remove quotes from variables names in %define directives and from
6800 qualifiers in %code directives, and restrict the characters that are
6801 allowed in them to M4-friendly ones. For %define, continue to support
6802 the quoted form as a deprecated feature. Discussed starting at
6803 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
6804 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
6805 %code.
6806 * doc/bison.texinfo (Prologue Alternatives): Update.
6807 (Decl Summary): In %defines entry, update mention of `%code requires'
6808 and `%code provides'.
6809 (C++ Location Values): Update %define uses.
6810 (Calc++ Parser Interface): Likewise.
6811 (Calc++ Parser): Likewise, and update `%code requires' uses.
6812 (Table of Symbols): Update %code documentation.
6813 * src/parse-gram.y (prologue_declaration): For %define variables, use
6814 `variable' instead of `STRING'.
6815 (grammar_declaration): For %code qualifiers, use `ID' instead of
6816 `STRING'.
6817 (variable): New nonterminal that takes an `ID' or a `STRING'.
6818 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
6819 and %define uses.
6820 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
6821 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
6822 (%define errors): Update %define uses.
6823
68242007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6825
6826 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
6827 instead of muscle_insert for %define values so that M4-special
6828 characters are replaced with digraphs.
6829 * tests/input.at (%define errors): Extend to check weird values.
6830
68312007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6832
6833 Instead of having skeletons declare all valid %define variables and
6834 %code qualifiers, provide macros that retrieve the associated values
6835 and build these lists automatically. Thus Bison will now warn when a
6836 variable or qualifier is not used by the skeleton in the current
6837 invocation regardless of whether it might sometimes be used by that
6838 skeleton in other invocations. Also, move all %define value macros to
6839 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
6840 form, which is replaced by %code.
6841 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
6842 (b4_check_user_names): ... this, and change the series of valid name
6843 arguments to a single list argument for names used in the skeleton
6844 similar to the existing list argument for names used in the grammar.
6845 Warn instead of complaining.
6846 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
6847 values and %code code, to format %code code properly, and to build
6848 lists of all %define variables and %code qualifiers used in the
6849 skeleton: b4_skeleton_percent_define_variables and
6850 b4_skeleton_percent_code_qualifiers.
6851 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
6852 Remove, and...
6853 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
6854 the skeleton names lists can finish building first. In place of
6855 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
6856 expect the lists b4_user_percent_define_variables and
6857 b4_user_percent_code_qualifiers.
6858 * data/c++.m4: Where setting default values for b4_parser_class_name,
6859 b4_location_type, b4_filename_type, b4_namespace, and
6860 b4_define_location_comparison, update their names to the
6861 b4_percent_define_ namespace.
6862 * data/glr.c: Don't use b4_check_percent_define_variables and
6863 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6864 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
6865 (b4_parser_class_name, b4_namespace): Define these using
6866 b4_get_percent_define for parser_class_name and namespace.
6867 * data/location.cc: Use b4_get_percent_define.
6868 * data/push.c: Don't use b4_check_percent_define_variables and
6869 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6870 * data/yacc.c: Likewise, and don't call m4_exit in
6871 b4_use_push_for_pull_if or m4_wrap code will never execute.
6872 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
6873 Rename to...
6874 (muscle_grow_user_name_list): ... this for consistency with the
6875 terminology used in bison.m4.
6876 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
6877 %define variable names, and rename muscle used_percent_define_variables
6878 to user_percent_define_variables.
6879 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
6880 user_percent_code_qualifiers.
6881 (content): Remove.
6882 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
6883 {CODE} form is no longer accepted.
6884 * tests/input.at (Reject bad %code qualifiers): Rename to...
6885 (Reject unused %code qualifiers): ... this, and update test output.
6886 (%define error): Update test output.
6887
68882007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
6889
6890 Check for unrecognized %define variables similar to checking for
6891 unrecognized %code qualifiers. Check for redefined %define variables.
6892 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
6893 generalizes...
6894 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
6895 (b4_check_percent_define_variables): New, also wraps it.
6896 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
6897 variables using b4_check_percent_define_variables.
6898 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
6899 all those exercised in the test suite and all those listed in the
6900 `Default values' section of c++.m4. Are there others?
6901 * data/push.c, data/yacc.c: Declare no valid %define variables.
6902 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
6903 similar to muscle_find, but it works even when the muscle stores a
6904 const value.
6905 (muscle_grow_used_name_list): New function for constructing the used
6906 name list muscles that b4_check_for_unrecognized_names requires.
6907 * src/parse-gram.y (prologue_declaration): Warn if a variable is
6908 %define'd more than once. Define the b4_used_percent_define_variables
6909 muscle with muscle_grow_used_name_list.
6910 (grammar_declaration): Abbreviate %code code with
6911 muscle_grow_used_name_list.
6912 * tests/input.at (%define errors): New.
6913
69142007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6915
6916 Provide warn_at, complain_at, and fatal_at function callbacks to the
6917 skeletons, and use this for %code qualifier complaints.
6918 * data/bison.m4 (b4_error_at): New, invoked by...
6919 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
6920 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
6921 @fatal_at(...@) directives.
6922 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
6923 qualifiers in b4_used_percent_code_qualifiers and to use
6924 b4_complain_at.
6925 * src/location.c, src/location.h (boundary_set_from_string): New global
6926 function.
6927 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
6928 function.
6929 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
6930 to b4_used_percent_code_qualifiers.
6931 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
6932 function.
6933 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
6934 (lineno): Rename to...
6935 (out_lineno): ... this so I don't misunderstand it again.
6936 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
6937 here; these newlines are in the input but not the output file.
6938 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
6939 (at_directive_perform): ... this new static function, and add handling
6940 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
6941 directives.
6942 * tests/input.at (Reject bad %code qualifiers): Update test output with
6943 locations and extend.
6944
6945 * tests/output.at (Output file name: [, Output file name: ]): Remove
6946 bogus comment about these tests failing.
6947
69482007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6949
6950 Clean up b4_check_percent_code_qualifiers a little.
6951 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
6952 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
6953 documentation and add examples.
6954 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
6955 qualifiers here.
6956
69572007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6958
6959 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
6960 unreliable -- especially when they're hidden inside another macro.
6961 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
6962 data/c.m4: Remove m4_divert(-1).
6963 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6964 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
6965 m4_divert_push(0) and m4_divert_pop(0).
6966 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
6967 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
6968 pushed and popped by m4sugar, should be first on the stack.
6969
6970 Provide warn, complain, and fatal function callbacks to the skeletons.
6971 This provides more flexibility than m4_fatal, improves the error
6972 message format, and captures messages for translation. Discussed
6973 starting at
6974 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
6975 * data/bison.m4 (b4_error): New, invoked by...
6976 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
6977 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
6978 directives. Because these M4 macros might be called when the current
6979 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
6980 the previous removal of uses of m4_divert, which caused trouble.
6981 (b4_check_percent_code_qualifiers): Use b4_complain instead of
6982 m4_fatal to report unrecognized %code qualifiers.
6983 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
6984 push parser requests.
6985 * data/glr.c: Use b4_complain instead of m4_fatal to report
6986 non-deterministic push parser requests.
6987 Update @output usage to @output(...@) form.
6988 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
6989 report missing %defines. Update @output usage to @output(...@) form.
6990 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
6991 @output(...@) form.
6992 * src/main.c (main): Invoke skel_scanner_free.
6993 * src/scan-skel.h (skel_scanner_free): Prototype new function.
6994 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
6995 obstack_for_string from flex-scanner.h.
6996 (YY_DECL): Use to declare skel_lex static.
6997 (decode_at_digraphs): Remove; now handled in the new
6998 SC_AT_DIRECTIVE_ARG start condition.
6999 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
7000 functions.
7001 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
7002 at_directive_argv): New static globals.
7003 (INITIAL): Use fail_for_invalid_at.
7004 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
7005 recognize the start of a generalized `@directive(...@)' form and
7006 start...
7007 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
7008 directive args (using the new obstack_for_string), to decode the
7009 contained @ diagraphs, and to perform the directive. It recognizes
7010 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
7011 @output(...@).
7012 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
7013 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
7014 `@,'.
7015 (scan_skel): Initialize obstack_for_string on the first call.
7016 (skel_scanner_free): New function to free obstack_for_string.
7017 * tests/input.at (Reject bad %code qualifiers): Update test output.
7018
70192007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
7020
7021 Consolidate the 4 prologue alternative directives (%code, %requires,
7022 %provides, and %code-top) into a single %code directive with an
7023 optional qualifier field. Discussed at
7024 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
7025 * NEWS (2.3a+): Rewrite the existing entry for the prologue
7026 alternatives.
7027 * doc/bison.texinfo (Prologue Alternatives): Update.
7028 (Decl Summary): Update to %code "requires" and %code "provides".
7029 (Calc++ Parser): Update to %code "requires".
7030 (Table of Symbols): Remove entries for %requires, %provides, and
7031 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
7032 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
7033 are replaced by b4_percent_code_provides and b4_percent_code_requires,
7034 which are skeleton-specific.
7035 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
7036 declare what %code qualifiers it supports and to complain if any other
7037 qualifiers were used in the grammar.
7038 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
7039 and b4_user_code([b4_percent_code_provides]) in place of
7040 b4_user_requires and b4_user_provides.
7041 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
7042 Add b4_user_code([b4_percent_code_top]) and
7043 b4_user_code([b4_percent_code]).
7044 Invoke b4_check_percent_code_qualifiers.
7045 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7046 PERCENT_REQUIRES): Remove.
7047 (grammar_declaration): Remove RHS's for %code-top, %provides, and
7048 %requires. Rewrite the %code RHS as the unqualified form defining the
7049 muscle b4_percent_code. Add another RHS for the qualified %code form,
7050 which defines muscles of the form b4_percent_code_QUALIFIER and the
7051 b4_used_percent_code_qualifiers muscle.
7052 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7053 PERCENT_REQUIRES): Remove.
7054 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
7055 %code "requires" and %code "provides".
7056 * tests/input.at (Reject bad %code qualifiers): New.
7057
70582007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7059
7060 Use the new code_props interface for destructors and printers.
7061 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
7062 printer_location members, and change the type of the destructor and
7063 printer members to code_props.
7064 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
7065 symbol_printer_get, semantic_type_destructor_set,
7066 semantic_type_printer_set, default_tagged_destructor_set,
7067 default_tagless_destructor_set, default_tagged_printer_set,
7068 default_tagless_printer_set): Use code_props in arguments and return
7069 types in place of char const * and location.
7070 (symbol_destructor_location_get, symbol_printer_location_get): Remove
7071 since the locations are now contained in the return of
7072 symbol_destructor_get and symbol_printer_get.
7073 * src/output.c (symbol_destructors_output, symbol_printers_output):
7074 Replace with...
7075 (symbol_code_props_output): ... this to eliminate duplicate code.
7076 (output_skeleton): Update to use symbol_code_props_output.
7077 * src/reader.c (symbol_should_be_used): Update use of
7078 symbol_destructor_get.
7079 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7080 Update uses of the various _destructor_set and _printer_set functions.
7081 * src/symtab.c: (default_tagged_destructor_location,
7082 default_tagless_destructor_location, default_tagged_printer_location,
7083 default_tagless_printer_location): Remove since we...
7084 (default_tagged_destructor, default_tagless_destructor,
7085 default_tagged_printer, default_tagless_printer): ... change the type
7086 of these to code_props.
7087 (symbol_new, semantic_type_new, symbol_destructor_set,
7088 semantic_type_destructor_set, symbol_destructor_get,
7089 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
7090 symbol_check_alias_consistency, default_tagged_destructor_set,
7091 default_tagless_destructor_set, default_tagged_printer_set,
7092 default_tagless_printer_set): Update.
7093 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
7094 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
7095 code_props members.
7096 (symbol_print): Use SYMBOL_CODE_PRINT.
7097
70982007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7099
7100 Use the new code_props interface for rule actions.
7101 * src/symlist.h (symbol_list): Replace action, action_location, and
7102 used members with a code_props action_props member.
7103 * src/reader.c (symbol_should_be_used, grammar_rule_check,
7104 grammar_midrule_action, grammar_current_rule_merge_set,
7105 grammar_current_rule_symbol_append, packgram): Update.
7106 * src/scan-code.h (translate_rule_action): Remove, no longer used.
7107 * src/scan-code.l (handle_action_dollar): Update.
7108 (translate_rule_action): Remove, no longer used.
7109 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
7110
71112007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7112
7113 Use the new code_props interface in parse-gram.y.
7114 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
7115 Update all uses of translate_* functions to use the new code_props
7116 interface and to use gram_scanner_last_string_free and
7117 code_scanner_last_string_free where possible.
7118 (grammar_declaration): symbol_list_destructor_set and
7119 symbol_list_printer_set now perform the translation, so don't do it
7120 here. Use gram_scanner_last_string_free where possible.
7121 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
7122 translate_code): Remove, no longer used.
7123 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
7124 symbol_list_printer_set): Perform code translation here rather than
7125 depending on the caller to do so.
7126
7127 * src/symlist.h (struct symbol_list): Correct some documentation typos.
7128 * src/scan-gram.h (gram_last_string): Remove declaration.
7129 * src/scan-gram.l (last_string): Declare it static.
7130
71312007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7132
7133 Encapsulate code properties and related functionality for the various
7134 destructors, printers, and actions into a code_props structure and
7135 interface. This patch merely implements code_props in scan-code.h and
7136 scan-code.l. Future patches will rewrite other modules to use it.
7137 Discussed starting at
7138 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
7139 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
7140 consistently initialize const structs that have an empty location
7141 field.
7142 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
7143 to ensure consistency.
7144 * src/scan-code.h (code_props): New structure.
7145 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
7146 function, macro, and const global variable for initializing a
7147 code_props with no code.
7148 (code_props_plain_init, code_props_symbol_action_init,
7149 code_props_rule_action_init, code_props_translate_code): The rest of
7150 the new code_props functional interface. Among other things, the init
7151 functions set the code_props kind field so that
7152 code_props_translate_code will know whether to behave like
7153 translate_symbol_action, translate_rule_action, or translate_code.
7154 These old translate functions must remain until all other modules are
7155 updated to use the new code_props interface.
7156 (code_scanner_last_string_free): New function similar to
7157 gram_scanner_last_string_free.
7158 (code_scanner_free): Add documentation.
7159 * src/scan-code.l: Implement the new interface.
7160 (code_lex): Make it static, add a code_props* argument, and remove the
7161 rule argument.
7162 (last_string): New static global similar to the one in scan-gram.l.
7163 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
7164 instead of rule.
7165 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
7166 code_props since Bison may one day use this information for destructors
7167 and printers.
7168 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
7169 (handle_action_dollar): Use symbol_list_n_get and set used flag
7170 directly since symbol_list_n_used_set is removed.
7171 (translate_action): Add a code_props* argument and remove the rule,
7172 action, and location arguments. Pass the code_props* on to code_lex.
7173 (translate_rule_action, translate_symbol_action, translate_code):
7174 Rewrite as wrappers around the new code_props interface.
7175 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
7176 it would eventually need to break the encapsulation of code_props.
7177
71782007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7179
7180 * etc/.cvsignore: New.
7181
71822007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7183
7184 Add maintainer-push-check to run maintainer-check using push parsing in
7185 place of pull parsing where available.
7186 * Makefile.am (maintainer-push-check): New.
7187 * data/bison.m4 (b4_use_push_for_pull_if): New.
7188 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
7189 appropriately based on their existing values.
7190 (yypush_parse): Don't print push-parser-specific diagnostics if push
7191 parsing is being used in place of pull parsing.
7192 * data/yacc.c: If push parsing should replace pull parsing, redirect to
7193 push.c.
7194 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
7195 variable, and insert b4_use_push_for_pull_flag into muscles.
7196 * tests/Makefile.am (maintainer-push-check): New.
7197
71982006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7199
7200 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
7201 (whether successful or failed) so that yypush_parse can be invoked
7202 again to start a new parse using the same yypstate.
7203 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
7204 check multiple yypull_parse invocations on the same yypstate. For pull
7205 mode, extend to check multiple yyparse invocations.
7206 (Exploding the Stack Size with Alloca): Extend to try with
7207 %push-pull-parser.
7208 (Exploding the Stack Size with Malloc): Likewise.
7209
7210 * tests/calc.at (Simple LALR Calculator): Don't specify
7211 %skeleton "push.c" since %push-pull-parser implies that now.
7212 * tests/headers.at (export YYLTYPE): Don't check for the push
7213 declarations. Otherwise, this test case can't be used to see if push
7214 mode can truly emulate pull mode.
7215 * tests/input.at (Torturing the Scanner): Likewise.
7216 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
7217 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
7218 AT_YACC_IF, which now includes the case of push mode since %skeleton
7219 need not be used for push mode. This will be more intuitive once
7220 push.c is renamed to yacc.c.
7221
72222006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7223
7224 For push mode, convert yyparse from a macro to a function, invoke yylex
7225 instead of passing a yylexp argument to yypull_parse, and don't
7226 generate yypull_parse or yyparse unless %push-pull-parser is declared.
7227 Discussed starting at
7228 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
7229 * data/bison.m4 (b4_pull_if): New.
7230 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
7231 * data/push.c: Improve M4 quoting a little.
7232 (b4_generate_macro_args, b4_parenthesize): Remove.
7233 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
7234 any time a pull parser is requested.
7235 Don't #define this as a wrapper around yypull_parse. Instead, when
7236 both push and pull are requested, make it a function that does that
7237 same thing.
7238 (yypull_parse): If there's a b4_prefix, #define this to
7239 b4_prefix[pull_parse] when both push and pull are requested.
7240 Don't define this as a function unless both push and pull are
7241 requested.
7242 Remove the yylexp argument and hard-code yylex invocation instead.
7243 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
7244 %push-parser.
7245 * src/getargs.c (pull_parser): New global initialized to true.
7246 * getargs.h (pull_parser): extern it.
7247 * src/output.c (prepare): Insert pull_flag muscle.
7248 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
7249 (prologue_declaration): Set both push_parser and pull_parser = true for
7250 %push-pull-parser. Set push_parser = true and pull_parser = false for
7251 %push-parser.
7252 * src/scan-gram.l: Don't accept %push_parser as an alternative to
7253 %push-parser since there's no backward-compatibility concern here.
7254 Scan %push-pull-parser.
7255 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
7256 instead of %push-parser.
7257 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
7258 prototype it in the module that calls yyparse.
7259 * tests/input.at (Torturing the Scanner): Likewise.
7260 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
7261
72622006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
7263
7264 Update etc/bench.pl. Optimize push mode a little (the yyn change
7265 deserves most of the credit).
7266 * Makefile.am (SUBDIRS): Add etc subdirectory.
7267 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
7268 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
7269 yytoken, yyval, and yyloc declarations to...
7270 (yyparse or yypush_parse): ... here to improve performance. For
7271 yypush_parse invocations after the first, be sure to assign yyn its old
7272 value again.
7273 (yypstate_new): Don't bother initializing the yyresult field since the
7274 initial value isn't used.
7275 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
7276 remove the #define that, in push mode, set it to yyps->NAME.
7277 * etc/Makefile.am: New.
7278 * etc/bench.pl: Remove and build it instead from...
7279 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
7280 "tests/bison" from the build directory by default rather than just
7281 invoking "bison" from $PATH.
7282 (calc_grammar): Update push parser code: don't declare yylval globally,
7283 don't define yyparse_wrapper, and don't #define yyparse.
7284 (bench_grammar): Update to check all working combinations of yacc.c,
7285 push.c, impure, pure, pull, and push.
7286
72872006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7288
7289 For push mode, add pull wrappers around yypush_parse.
7290 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
7291 (yypull_parse): New function wrapping yypush_parse.
7292 (yyparse): New #define wrapping yypull_parse.
7293 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
7294 is declared.
7295 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
7296 prototype yylex in the module that calls yyparse, and don't prototype
7297 yyparse there. Otherwise, the yyparse expansion won't compile.
7298 * tests/input.at (Torturing the Scanner): Likewise.
7299
73002006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7301
7302 Enable push parsers to operate in impure mode. Thus, %push-parser no
7303 longer implies %pure-parser. The point of this change is to move
7304 towards being able to test the push parser code by running the entire
7305 test suite as if %push-parser had been declared.
7306 * data/push.c (yypush_parse): For impure mode, remove the
7307 yypushed_char, yypushed_val, and yypushed_loc arguments.
7308 Instead, declare these as local variables initialized to the global
7309 yychar, yylval, and yylloc.
7310 For the first yypush_parse invocation only, restore the initial values
7311 of these global variables when it's time to read a token since they
7312 have been overwritten.
7313 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
7314 %push-parser.
7315 * tests/calc.at (Simple LALR(1) Calculator): Always declare
7316 %pure-parser along with %push-parser since this test case was designed
7317 for pure push parsers.
7318 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
7319 (AT_YACC_OR_PUSH_IF): New.
7320 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
7321 add a note that it's still wrong for some cases (as it has been for a
7322 while).
7323 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
7324 %push-parser no longer implies %pure-parser.
7325
73262006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7327
7328 Remove some unnecessary differences between the pull parser code and
7329 the push parser code. This patch enables yynerrs in push mode.
7330 * data/push.c: Reformat M4 a little.
7331 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
7332 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
7333 because push mode is on. Instead, if pure mode is on, move yynerrs
7334 to...
7335 (b4_declare_parser_state_variables): ... here.
7336 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
7337 to yyps->NAME so it can be used in yypush_parse.
7338 (yypush_parse): Don't omit uses of yynerrs in push mode.
7339
73402006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7341
7342 Fix bug such that the first pushed token's value and location are
7343 sometimes overwritten (sometimes by %initial-action) before being used.
7344 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
7345 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
7346 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
7347 more closely mimic the pull parser logic.
7348 Don't copy the pushed token to yychar, yylval, and yylloc until it's
7349 time to read a token, which is after any initialization of yylval and
7350 yylloc.
7351 (gottoken): Rename label to...
7352 (yyread_pushed_token): ... for clarity and to avoid infringing on the
7353 user namespace.
7354
73552006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7356
7357 Rearrange initialization of the parser state variables so that the
7358 skeleton doesn't have to have a copy for pull mode and another for push
7359 mode. This patch also fixes at least a bug such that yylloc was not
7360 initialized (with b4_location_initial_line and
7361 b4_location_initial_column) upon calling yypush_parse. However, that
7362 initialization now overwrites the first token's location;
7363 %initial-action assigning @$ already did the same thing, and both bugs
7364 will be fixed in a later patch.
7365 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
7366 (b4_declare_parser_state_variables): Remove initialization of yytoken,
7367 yyss, yyvs, yyls, and yystacksize.
7368 (yypstate_new): Remove initialization of some yypstate fields: yystate,
7369 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
7370 yylsp.
7371 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
7372 yyps->NAME so it can be used in yypush_parse.
7373 (yyparse or yypush_parse): For yypush_parse, don't print the
7374 "Starting parse" diagnostic for invocations after the first.
7375 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
7376 yypush_parse, only do it for the first invocation.
7377 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
7378 initialization to occur in yypush_parse but only on the first
7379 invocation.
7380
73812006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7382
7383 * data/push.c: Add CPP guards around push parser declarations in both
7384 the header and the code file.
7385 In the code file, move the push parser declarations to the same place
7386 they appear in the header file.
7387 Clean up the M4 some, especially the inconsistent underquoting in
7388 some b4_c_function_def and b4_c_function_decl uses.
7389
73902006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7391
7392 Encapsulate the push parser state variables into an M4 macro so the
7393 push skeleton doesn't have to list them again for pull mode's yyparse.
7394 For push mode, remove yypush_parse's local equivalents of these
7395 variables to eliminate unnecessary copying between the two sets at
7396 run-time. This patch also fixes at least a bug related to multiple
7397 %initial-action invocations in push mode.
7398 * data/push.c (b4_declare_parser_variables): Rename to...
7399 (b4_declare_scanner_communication_variables): ... this for clarity and
7400 update both uses.
7401 (b4_declare_yyparse_variables): Remove and move its contents to the one
7402 spot where it was invoked.
7403 (b4_declare_parser_state_variables): New macro containing the parser
7404 state variables required by push mode.
7405 (struct yypstate): Replace all fields but yynew with
7406 b4_declare_parser_state_variables.
7407 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
7408 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
7409 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
7410 (yyparse or yypush_parse): For yyparse in pull mode, replace local
7411 parser state variable declarations with
7412 b4_declare_parser_state_variables.
7413 Don't initialize parser state variables when calling yypush_parse since
7414 yypstate_new already does that.
7415 Invoke the user's initial action only upon the first yypush_parse
7416 invocation.
7417 Remove all code that copies between the local parser state variables
7418 and the yypstate.
7419
74202006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7421
7422 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
7423 prevent a name collision in a future patch where these names will
7424 sometimes be #define'd.
7425 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
7426 since it no longer has the same name as the existing argument.
7427 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
7428
74292006-12-19 Paolo Bonzini <bonzini@gnu.org>
7430 and Joel E. Denny <jdenny@ces.clemson.edu>
7431
7432 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
7433 that the argument is case-insensitive, and there's no `=' here.
7434 For the %skeleton entry, mention that %language is better.
7435 (Bison Options): Likewise for --language and --skeleton. Move the
7436 --skeleton entry so that the `Tuning the parser' section is sorted
7437 alphabetically on long options.
7438 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
7439 %language directive in detail here; cross-reference the %language
7440 documentation instead.
7441 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
7442 `%require "2.3b"' so that the example is always up-to-date.
7443 (Table of Symbols): Add entries for %language and %skeleton.
7444 * examples/extexi (normalize): Instead of replacing every %require
7445 argument with the current Bison version, just substitute for
7446 `@value{VERSION}'. This guarantees that we're testing what actually
7447 appears in the documentation.
7448 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
7449 rather than `@VERSION@'.
7450
74512006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7452
7453 * NEWS: Reword the %language news a bit, and put it earlier.
7454
7455 * src/getargs.c (skeleton_arg): Last arg is now location const *.
7456 Rewrite to simplify the logic.
7457 (language_argmatch): Likewise.
7458 (program_name): We now own this var.
7459 * src/getargs.h (struct bison_language): Use char[] rather than
7460 const char *.
7461
7462 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
7463 Java is supported.
7464 * src/complain.c (program_name): Remove decl; no longer needed.
7465 * src/main.c (program_name): Remove; now belongs to getargs.
7466
74672006-12-18 Paolo Bonzini <bonzini@gnu.org>
7468
7469 * NEWS: Document %language.
7470
7471 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
7472
7473 * data/c-skel.m4, data/c++-skel.m4: New files.
7474 * data/glr.c: Complain on push parsers.
7475
7476 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
7477 over %skeleton.
7478 (Decl Summary): Document %language and %skeleton.
7479 (Command line): Document -L.
7480
7481 * examples/extexi: Rewrite %require directive.
7482 * examples/calc++/Makefile.am: Pass VERSION to extexi.
7483
7484 * src/files.c (compute_exts_from_gc): Look in language structure
7485 for .y extension.
7486 (compute_file_name_parts): Check whether .tab should be added.
7487 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
7488 (language, skeleton_arg, language_argmatch): New.
7489 (long_options): Add --language.
7490 (getargs): Use skeleton_arg, add -L/--language.
7491 * src/getargs.h: Include location.h.
7492 (struct bison_language, language, skeleton_arg, language_argmatch): New.
7493 * src/output.c (prepare): Pick default skeleton from struct language.
7494 Don't dispatch C skeletons here.
7495 * src/parse-gram.y (PERCENT_LANGUAGE): New.
7496 (prologue_declaration): Add "%language" rule, use skeleton_arg.
7497 * src/scan-gram.l ("%language"): New rule.
7498
7499 * tests/calc.at: Test %skeleton and %language.
7500 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
7501 (AT_GLR_IF): Look for %skeleton "glr.cc".
7502 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
7503 (AT_YACC_IF): Reject %language.
7504
75052006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7506
7507 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
7508 since it wasn't used; only the typedef name 'semantic_type' is needed.
7509 Also, omit trailing white space.
7510
7511 * bootstrap: Sync from coreutils.
7512 (gnulib_extra_files): Add build-aux/announce.gen.
7513 (slurp): Adjust .gitignore files like .cvsignore files.
7514 * build-aux/announce-gen: Remove from CVS, since bootstrap
7515 now creates this.
7516
75172006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
7518
7519 Make %push-parser imply %pure-parser. This fixes several bugs; see
7520 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
7521 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
7522 pure_parser = true.
7523 * data/push.c: Don't bother testing b4_push_if when deciding whether
7524 to expand b4_declare_parser_variables globally.
7525 (yypush_parse): Likewise in here.
7526
7527 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
7528 (yy_reduce_print): Reformat M4 for readability.
7529
75302006-12-15 Bob Rossi <bob@brasko.net>
7531 and Joel Denny <jdenny@ces.clemson.edu>
7532
7533 * data/push.c (yypstate): Add typedef, and update all uses of
7534 struct yypstate to just yypstate.
7535 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
7536
75372006-12-14 Bob Rossi <bob@brasko.net>
7538
7539 * data/push.c (yypush_parse): Declare prototype regardless of
7540 %locations option.
7541
75422006-12-14 Bob Rossi <bob@brasko.net>
7543
7544 * data/push.c (yyparse): Remove the prototype and the #define when in
7545 push-parser mode.
7546
75472006-12-13 Bob Rossi <bob@brasko.net>
7548
7549 * data/push.c (yypstate_init): Rename to...
7550 (yypstate_new): ... this and use b4_c_function_def.
7551 (yypstate_delete): New.
7552 (yypush_parse): Change parameters yynval and yynlloc to be const.
7553 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
7554 yypstate_delete functions.
7555
75562006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
7557
7558 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
7559 strange test case titles. Reported by Bob Rossi.
7560
75612006-12-13 Paul Eggert <eggert@cs.ucla.edu>
7562
7563 * TODO: Add pointer to Sylvain Schmitz's work on static detection
7564 of potential ambiguities in GLR grammers.
7565
75662006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
7567
7568 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
7569 `bison ', use m4_index instead of m4_substr since chopping up a string
7570 containing M4-special characters causes problems here.
7571
7572 Fix a couple of bugs related to special characters in user-specified
7573 file names, and make it easier for skeletons to compute output file
7574 names with the same file name prefix as Bison-computed output file
7575 names.
7576 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
7577 b4_parser_file_name and b4_spec_defines_file instead of
7578 @output_parser_name@ and @output_header_name@, which are now redundant.
7579 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
7580 b4_parser_file_name, b4_spec_defines_file, and the new
7581 @basename(FILENAME@) instead of @output_parser_name@ and
7582 @output_header_name@, which inappropriately escaped the file names as
7583 C string literals.
7584 * src/files.c (all_but_ext): Remove static qualifier.
7585 (compute_output_file_names): Move `free (all_but_ext)' to...
7586 (output_file_names_free): ... here since all_but_ext is needed later.
7587 * src/files.h (all_but_ext): Extern.
7588 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
7589 exactly what MUSCLE_INSERT_STRING used to do.
7590 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
7591 characters are escaped properly.
7592 * src/output.c (prepare): Define muscle file_name_all_but_ext as
7593 all_but_ext.
7594 For pkgdatadir muscle, maintain previous functionality by using
7595 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
7596 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
7597 digraphs would never be expanded. Hopefully no one has M4-special
7598 characters in his Bison installation path.
7599 * src/scan-skel.l: Don't parse @output_header_name@ and
7600 @output_parser_name@ anymore since they're now redundant.
7601 In @output, use decode_at_digraphs.
7602 Parse a new @basename command that invokes last_component.
7603 (decode_at_digraphs): New.
7604 (BASE_QPUTS): Remove unused.
7605 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
7606 (Output file name): New tests.
7607
76082006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
7609
7610 Warn about output files that are generated by the skeletons and that
7611 conflict with other output files.
7612 * data/glr.c: Don't generate the header file here when glr.cc does.
7613 * src/files.c (file_names, file_names_count): New static globals.
7614 (compute_output_file_names): Invoke output_file_name_check for files
7615 not generated by the skeletons and remove existing checks.
7616 (output_file_name_check): New function that warns about conflicting
7617 output file names.
7618 (output_file_names_free): Free file_names.
7619 * src/files.h (output_file_name_check): Declare.
7620 * src/scan-skel.l: Invoke output_file_name_check for files generated by
7621 the skeletons.
7622 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
7623 (Conflicting output files): New tests.
7624
76252006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7626
7627 * doc/bison.texinfo: Fix a couple of typos.
7628
76292006-12-08 Bob Rossi <bob@brasko.net>
7630
7631 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
7632 Rename to...
7633 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
7634 update all uses.
7635 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
7636 (yypush_parse): Rename yypvars argument to yyps and remove redundant
7637 local pv.
7638 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
7639 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
7640
76412006-12-07 Bob Rossi <bob@brasko.net>
7642 and Joel Denny <jdenny@ces.clemson.edu>
7643
7644 * data/push.c (yypvarsinit): Change return type from void* to struct
7645 yypvars*. No longer cast to void* on return.
7646 (struct yypvars): Remove yylen since it need not be remembered between
7647 yypushparse invocations.
7648 (yypushparse): Don't copy between yylen and pv->yylen.
7649
76502006-12-05 Bob Rossi <bob@brasko.net>
7651
7652 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
7653 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
7654 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
7655 (struct yypvars): Remove b4_declare_parser_variables.
7656 (yypvarsinit): Remove init code for removed variables.
7657 (global scope): Do not declare b4_declare_parser_variables if
7658 push or pure mode.
7659 (yypushparse): Add b4_declare_parser_variables.
7660 Init new local variables, and remove init code for removed
7661 yypvars variables.
7662 (yyparse): Delete.
7663 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
7664 and yyparse for other modes.
7665 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
7666 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
7667 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
7668 (AT_PURE_LEX_IF): True if pure or push parser.
7669
76702006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
7671
7672 Document Yacc prologue alternatives and default %destructor's and
7673 %printer's as experimental. Don't mention Java yet. Discussed at
7674 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
7675 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
7676 (2.3a): Annotate this entry to say the old forms of these features were
7677 also experimental.
7678 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
7679 Table of Symbols): Say they're experimental. Comment out any mention
7680 of Java (we'll want this back eventually).
7681
76822006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
7683
7684 Support a file name argument to %defines. Deprecate `=' in
7685 %file-prefix, %name-prefix, and %output. Discussed at
7686 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
7687 * NEWS (2.3a+): Mention.
7688 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
7689 form of %defines, and remove `=' from entries for %file-prefix,
7690 %name-prefix, and %output.
7691 * src/parse-gram.y (prologue_declaration): Implement.
7692 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
7693 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
7694 all but one occurrence of %name-prefix.
7695 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
7696 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
7697 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
7698 occurrence of each of %file-prefix and %output. Add check for %defines
7699 with argument.
7700 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
7701 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
7702 Remove the `=' from %output.
7703
77042006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
7705
7706 Don't escape $ in test case titles since Autoconf 2.61 now does that
7707 correctly.
7708 * tests/actions.at (Default %printer and %destructor are not for error
7709 or $undefined): Here.
7710 (Default %printer and %destructor are not for $accept): Here.
7711 * tests/input.at (Invalid $n and @n): Here.
7712
77132006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
7714
7715 Rename <!> to <>. Discussed starting at
7716 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
7717 * NEWS (2.3a+): Update.
7718 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
7719 Update.
7720 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
7721 * src/scan-gram.l (INITIAL): Implement.
7722 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
7723 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
7724 comment.
7725 * tests/actions.at (Default tagless %printer and %destructor,
7726 Default tagged and per-type %printer and %destructor,
7727 Default %printer and %destructor are not for error or $undefined,
7728 Default %printer and %destructor are not for $accept,
7729 Default %printer and %destructor for mid-rule values): Update.
7730 * tests/input.at (Default %printer and %destructor redeclared,
7731 Unused values with default %destructor): Update.
7732
77332006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
7734
7735 Don't let %prec take a nonterminal.
7736 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
7737 token.
7738 * tests/input.at (%prec takes a token): New test checking that %prec
7739 won't take a nonterminal.
7740
77412006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7742
7743 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
7744 it was double-quoted.
7745 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
7746 grammar is maintained with Bison's highest standards.
7747 * src/getargs.c: Fix some typos in Doxygen comments.
7748
77492006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7750
7751 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
7752 later. Reported by Paul Eggert in
7753 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
7754 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
7755 * src/scan-code.l (translate_action): Don't bother invoking
7756 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
7757 (code_scanner_free): Instead of invoking
7758 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
7759 which frees more.
7760 * src/scan-gram.l (gram_scanner_free): Likewise.
7761 * src/scan-skel.l (scan_skel): Likewise.
7762
77632006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
7764
7765 * src/files.c (tr): Change return type to void.
7766 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
7767 has been called previously for the same key.
7768 (muscle_find): Return storage instead of value so that
7769 --enable-gcc-warnings doesn't produce warnings that the return discards
7770 const. aver that the value and storage are the same since storage
7771 could potentially be NULL when value is not.
7772 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
7773 same as 0.
7774
77752006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7776
7777 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
7778 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
7779 us a slightly cleaner distribution, and also works.
7780 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
7781 gnulib changes.
7782
77832006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
7784 and Paul Eggert <eggert@cs.ucla.edu>
7785
7786 Don't let Bison leak memory except when it complains.
7787 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
7788 (spec_defines_file, dir_prefix): Now char *, not const char *,
7789 since they are freed.
7790 * src/files.c: Likewise.
7791 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
7792 Likewise.
7793 (tr): Now operates in-place. All uses changed.
7794 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
7795 values.
7796 (compute_file_name_parts, compute_output_file_names): Don't store
7797 read-only data in variables that will be freed.
7798 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
7799 src_extension, and header_extension.
7800 (output_file_names_free): New public function to free
7801 spec_verbose_file, spec_graph_file, spec_defines_file,
7802 parser_file_name, and dir_prefix.
7803 * src/getargs.c (getargs): Don't store read-only data in variables that
7804 will be freed.
7805 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
7806 (which previously existed but was unused), and quotearg_free.
7807 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
7808 * src/muscle_tab.c: Likewise.
7809 (muscle_entry): Make the value char const *,
7810 and add a new storage member that is char * and can be freed.
7811 (muscle_entry_free): New private function.
7812 (muscle_init): Use it instead of free.
7813 (muscle_insert, muscle_grow): Update and use new storage member.
7814 (muscle_code_grow): Free the string passed to muscle_grow
7815 since it's not needed anymore.
7816 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
7817 add a new `char *code' member.
7818 ("{...}"): Declare semantic type as code.
7819 * src/scan-code.h (translate_rule_action):
7820 (translate_symbol_action, translate_code, translate_action): Return
7821 `char const *' rather than `char *' since external code should not free
7822 these strings.
7823 * src/scan-code.l: Likewise.
7824 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
7825 which is "{...}" in the parser.
7826 * tests/Makefile.am (maintainer-check-valgrind): Set
7827 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
7828 Valgrind.
7829 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
7830 complain.
7831 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
7832 expecting a non-zero exit status sets --leak-check=summary and
7833 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
7834 this case, and we don't want to hear about it.
7835
78362006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7837
7838 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
7839 instead of from the template, to simplify configuration a bit.
7840 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
7841 and m4/wint_t.m4, as they are needed with the latest gnulib.
7842
78432006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7844
7845 Disable unset/unused mid-rule value warnings by default, and recognize
7846 --warnings=midrule-values to enable them. Discussed starting at
7847 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
7848 * NEWS (2.3a+): Mention.
7849 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
7850 warnings): Add entry for midrule-values subargument.
7851 * src/reader.c (symbol_should_be_used): Don't return true just because
7852 the value is a set/used mid-rule value unless
7853 --warnings=midrule-values was specified.
7854 * tests/input.at (Unused values, Unused values before symbol
7855 declarations): Run tests with and without --warnings=midrule-values.
7856
7857 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
7858 than LIST_FREE directly.
7859
78602006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7861
7862 Finish implementing --warnings=error, which should not be implied by
7863 --warnings=all (or by its synonyms -W and --warnings without
7864 subarguments).
7865 * src/complain.c (set_warning_issued): New function to report that
7866 warnings are being treated as errors and to record an error if so.
7867 Invoke...
7868 (warn_at, warn): ... here.
7869 * src/getargs.c (warnings_args, warnings_types): Reorder so that
7870 "error - warnings are errors" does not appear above "all - all of the
7871 above".
7872 (getargs): For -W and --warnings without subarguments, don't let
7873 FLAGS_ARGMATCH set warnings_error in warnings_flag.
7874 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
7875
78762006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7877
7878 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
7879 empty subargument list. For example: `bison --warnings= parser.y'.
7880
78812006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7882
7883 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
7884 the parser header file so that gcc doesn't warn.
7885
78862006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7887
7888 Split the default %destructor/%printer into two kinds: <*> and <!>.
7889 Discussed starting at
7890 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
7891 * NEWS (2.3a+): Mention.
7892 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
7893 previous change today related to mid-rules.
7894 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
7895 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
7896 (TYPE_TAG_ANY): Add as <*>.
7897 (TYPE_TAG_NONE): Add as <!>.
7898 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
7899 for <*> and <!>.
7900 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
7901 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
7902 * src/symlist.c (symbol_list_default_new): Split into tagged and
7903 tagless versions.
7904 (symbol_list_destructor_set, symbol_list_printer_set): Split
7905 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
7906 SYMLIST_DEFAULT_TAGLESS.
7907 * src/symlist.h: Update symbol_list_default*_new prototypes.
7908 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
7909 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
7910 * src/symtab.c (default_destructor, default_destructor_location,
7911 default_printer, default_printer_location): Split each into tagged and
7912 tagless versions.
7913 (symbol_destructor_get, symbol_destructor_location_get,
7914 symbol_printer_get, symbol_printer_location_get): Implement tagged
7915 default and tagless default cases.
7916 (default_destructor_set, default_printer_set): Split each into tagged
7917 and tagless versions.
7918 * src/symtab.h: Update prototypes.
7919 * tests/actions.at (Default %printer and %destructor): Rename to...
7920 (Default tagless %printer and %destructor): ... this, and extend.
7921 (Per-type %printer and %destructor): Rename to...
7922 (Default tagged and per-type %printer and %destructor): ... this, and
7923 extend.
7924 (Default %printer and %destructor for user-defined end token): Extend.
7925 (Default %printer and %destructor are not for error or $undefined):
7926 Update.
7927 (Default %printer and %destructor are not for $accept): Update.
7928 (Default %printer and %destructor for mid-rule values): Extend.
7929 * tests/input.at (Default %printer and %destructor redeclared): Extend.
7930 (Unused values with default %destructor): Extend.
7931
79322006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7933
7934 Don't apply the default %destructor/%printer to an unreferenced midrule
7935 value. Mentioned at
7936 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
7937 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
7938 like $@n instead of just @n so that the default %destructor/%printer
7939 logic doesn't see them as user-defined symbols.
7940 (symbol_is_dummy): Check for both forms of the name.
7941 * src/reader.c (packgram): Remove the `$' from each midrule symbol
7942 name for which the midrule value is referenced in any action.
7943 * tests/actions.at (Default %printer and %destructor for mid-rule
7944 values): New test.
7945 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
7946 for change to dummy symbol names.
7947
79482006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7949
7950 Warn about unset midrule $$ if the corresponding $n is used.
7951 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
7952 $n usage.
7953 (packgram): Before invoking grammar_rule_check on any rule, make sure
7954 all actions have already been scanned in order to set `used' flags.
7955 Otherwise, checking that a midrule's $$ is set will not always work
7956 properly because the midrule check must forward-reference the midrule's
7957 parent rule.
7958 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
7959 warning.
7960
79612006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7962
7963 More improvements to the documentation of the prologue alternatives:
7964 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
7965 Bison manual.
7966 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
7967 some text to clarify the relative importance of the new directives and
7968 to show how these directives may be viewed as code labels.
7969
79702006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
7971
7972 Similar to the recently removed %before-header, add %code-top as the
7973 alternative to the pre-prologue. Mentioned at
7974 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
7975 Also, let the prologue alternatives appear in the grammar section.
7976 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
7977 (prologue_declaration): Move the existing prologue alternatives to...
7978 (grammar_declaration): ... here and add %code-top.
7979 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
7980
7981 Clean up and extend documentation for the prologue alternatives.
7982 * NEWS (2.3a+): Describe prologue alternatives.
7983 * doc/bison.texinfo (Prologue): Move discussion of prologue
7984 alternatives to...
7985 (Prologue Alternatives): ... this new section, and extend it to discuss
7986 all 4 directives in detail.
7987 (Table of Symbols): Clean up discussion of prologue alternatives and
7988 add %code-top.
7989
79902006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7991
7992 DJGPP specific issues.
7993
7994 * djgpp/config.bat: config.hin has been moved to lib. Adjust
7995 config.bat accordingly.
7996 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
7997 * djgpp/config.site: Likewise.
7998
79992006-10-16 Paolo Bonzini <bonzini@gnu.org>
8000
8001 Replace %*-header with %provides, %requires, %code. See discussion at
8002 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
8003
8004 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
8005 (b4_user_start_header): Remove.
8006 * data/glr.c: Use new macros instead of b4_*start_header
8007 and b4_*end_header.
8008 * data/glr.cc: Likewise.
8009 * data/lalr1.cc: Likewise.
8010 * data/push.c: Likewise.
8011 * data/yacc.c: Likewise.
8012
8013 * doc/bison.texinfo: Remove %before-header, rename
8014 %{start,end,after}-header to %requires, %provides, %code.
8015
8016 * src/parse-gram.y: Likewise (also rename token names accordingly).
8017 * src/scan-gram.l: Likewise.
8018 * tests/actions.at: Likewise.
8019
80202006-10-14 Paul Eggert <eggert@cs.ucla.edu>
8021
8022 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
8023 Problem reported by Joel E. Denny.
8024
80252006-10-14 Jim Meyering <jim@meyering.net>
8026
8027 (Sync from coreutils.)
8028 Work also when the working directory (with e.g. coreutils sources)
8029 is version controlled with git, rather than CVS.
8030 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
8031 rather than CVS.
8032 In messages and comments, say e.g., "checked-out sources",
8033 rather than "CVS sources".
8034 (version_controlled_file): New function. Work for git as well as
8035 for CVS. Don't use grep's -q option.
8036 (slurp): Call it here, in place of CVS-specific code.
8037
80382006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
8039
8040 Fix testsuite for ./configure --enable-gcc-warnings:
8041 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
8042 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
8043 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
8044 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
8045 * test/regression.at (Diagnostic that expects two alternatives):
8046 Likewise.
8047
80482006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8049
8050 * bootstrap.conf (gnulib_modules): Add config-h.
8051 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
8052 worry about HAVE_CONFIG_H.
8053 * lib/abitset.c: Likewise.
8054 * lib/bitset.c: Likewise.
8055 * lib/bitset_stats.c: Likewise.
8056 * lib/bitsetv-print.c: Likewise.
8057 * lib/bitsetv.c: Likewise.
8058 * lib/ebitset.c: Likewise.
8059 * lib/get-errno.c: Likewise.
8060 * lib/lbitset.c: Likewise.
8061 * lib/subpipe.c: Likewise.
8062 * lib/timevar.c: Likewise.
8063 * lib/vbitset.c: Likewise.
8064 * lib/bitset.c: Include "bitset.h" first, to test interface.
8065 * lib/bitset_stats.c: Include "bitset_stats.h" first.
8066 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
8067 * lib/bitsetv.c: Include "bitsetv.h" first.
8068 * lib/get-errno.c: Include "get-errno.h" first.
8069 * m4/.cvsignore: Add config-h.m4.
8070 * tests/actions.at (Default %printer and %destructor for ...):
8071 Adjust expected line numbers in output to reflect removal of #if
8072 HAVE_CONFIG_H lines.
8073 * tests/glr-regression.at (Missed %merge type warnings when ...):
8074 Likewise.
8075 * tests/regression.at (Braced code in declaration in rules section):
8076 Likewise.
8077 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
8078 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
8079 Include <config.h> unconditionally.
8080
8081 * bootstrap: Sync from coreutils, as follows:
8082
8083 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8084
8085 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
8086 variable was sometimes used without being initialized. This
8087 messed up the installation of the INSTALL file in some cases.
8088
8089 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8090
8091 * bootstrap (usage, main program, symlink_to_gnulib): Add option
8092 --copy. Inspired by a suggestion from Bruno Haible.
8093
8094 2006-10-03 Jim Meyering <jim@meyering.net>
8095
8096 * bootstrap: Undo last change to this file, since now gnulib-tool
8097 sticks with the automake default in generating dependencies.
8098
80992006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8100
8101 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
8102 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
8103
8104 * doc/bison.1: Add copyright notice.
8105
8106 * data/glr.c: Don't include <stdarg.h>; not used.
8107
8108 * NEWS: The -g and --graph options now output graphs in Graphviz
8109 DOT format, not VCG format.
8110 * doc/bison.1: Likewise.
8111 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
8112 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
8113 of this change in
8114 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
8115 * TODO: Remove Graphviz entry.
8116 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
8117 remove vcg.c, vcg.h, vcg_defaults.h.
8118 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
8119 * src/graphviz.c, src/graphviz.h: New files.
8120 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
8121 * src/files.h: Make comment more generic.
8122 * src/main.c (main): Likewise.
8123 * src/print_graph.h: Likewise.
8124 * src/getargs.c (usage): Make usage description more generic.
8125 * src/print_graph.c: Include graphviz.h rather than vcg.h.
8126 (static_graph, fgraph): Remove. All uses changed to pass
8127 arguments instead of sharing a static var.
8128 (print_core, print_actions, print_state, print_graph):
8129 Output graphviz format rather than VCG format.
8130 * tests/.cvsignore: Remove *.vcg; add *.dot.
8131 * tests/output.at: Expect *.dot files, not *.vcg files.
8132
8133 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
8134 accommodates the 2006-10-08 change.
8135
81362006-10-11 Bob Rossi <bob@brasko.net>
8137
8138 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
8139 (b4_yyssa, b4_yyerror_range): New macros.
8140 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
8141 (yypvarsinit): Remove init of removed fields.
8142 (yypushparse): Remove use of removed fields; use new macros instead.
8143
81442006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8145
8146 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
8147 in a push parser. Reindent slightly to match yacc.c better.
8148
81492006-10-11 Bob Rossi <bob@brasko.net>
8150
8151 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
8152 yymsg_alloc fields.
8153 (yypvarsinit, yypushparse): Remove init of removed fields.
8154 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
8155
81562006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8157
8158 * THANKS: Add Paolo Bonzini and Bob Rossi.
8159
81602006-10-08 Paolo Bonzini <bonzini@gnu.org>
8161
8162 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
8163 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
8164 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
8165 b4_define_user_cde and uses): Remove.
8166 (b4_comment, b4_prefix, b4_sync_start): New.
8167 * data/bison.m4: New file, with most of the content removed from c.m4.
8168 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
8169 * src/output.c (output_skeleton): Pass bison.m4.
8170 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
8171 only if specified.
8172
81732006-10-05 Paul Eggert <eggert@cs.ucla.edu>
8174
8175 Fix test failure reported by Tom Lane in
8176 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
8177 and try to make such failures easier to catch in the future.
8178 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
8179 that's now the caller's responsibility.
8180 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
8181 Set yychar = YYEOF if it's negative.
8182 * tests/actions.at (yylex): Abort if asked to read past EOF.
8183 * tests/conflicts.at (yylex): Likewise.
8184 * tests/cxx-type.at (yylex): Likewise.
8185 * tests/glr-regression.at (yylex): Likewise.
8186 * tests/input.at (yylex): Likewise.
8187 * tests/regression.at (yylex): Likewise.
8188 * tests/torture.at (yylex): Likewise.
8189
81902006-10-01 Paul Eggert <eggert@cs.ucla.edu>
8191
8192 Fix problems with translating English-language diagnostics.
8193 * bootstrap: Fix bug introduced in recent bootstrap changes, with
8194 respect to bison-runtime pot generation. The YY_ stuff
8195 wasn't being captured.
8196 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
8197 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
8198 * runtime-po/POTFILES.in: Add data/push.c.
8199
82002006-09-29 Paul Eggert <eggert@cs.ucla.edu>
8201
8202 Merge bootstrap changes from coreutils.
8203
8204 2006-09-28 Jim Meyering <jim@meyering.net>
8205
8206 Automatically generated dependencies are important even
8207 when all of the sources in a directory come from gnulib.
8208 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
8209 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
8210
8211 2006-09-23 Jim Meyering <jim@meyering.net>
8212
8213 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
8214
8215 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8216
8217 * bootstrap: Add support for --force.
8218 (usage): New function. Describe usage less tersely.
8219 (CVS_only_file): New var.
8220
82212006-09-21 Paul Eggert <eggert@cs.ucla.edu>
8222
8223 * data/push.c (YYPUSH_MORE): Make it an enum instead.
8224 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
8225 Adjust white space and comments to match GNU style better.
8226
82272006-09-20 Bob Rossi <bob@brasko.net>
8228
8229 * data/push.c (yyresult_get): Remove function.
8230 (YYPUSH_MORE): Add #define.
8231 (yypushparse): Modify return value.
8232
82332006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8234
8235 * stamp-h.in: Remove; no longer needed.
8236 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
8237 Remove config.h, config.hin, intl (no longer created).
8238 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
8239 stamp-h1.
8240
8241 Sync bootstrap from coreutils, as follows:
8242
8243 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
8244
8245 * bootstrap (symlink_to_gnulib): New function.
8246 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
8247 to copies-of-gnulib.
8248 (cp_mark_as_generated, slurp, gnulib_files):
8249 Avoid making a copy if it's the same as the old version.
8250 (gnulib_files): Add support for this variable (used by Bison).
8251
82522006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8253
8254 * src/getargs.c (usage): Rework to use conventions similar to
8255 coreutils, to make translation a bit easier and the code a bit
8256 smaller. Problem reported by Tim Van Holder.
8257
82582006-09-15 Paul Eggert <eggert@cs.ucla.edu>
8259
8260 Use some of gnulib's new modules, taken from coreutils.
8261
8262 * bootstrap: Sync from coreutils, except add support for gnulib_files.
8263 * bootstrap.conf: New file.
8264 (gnulib_modules): Add configmake, inttypes, unistd.
8265 (XGETTEXT_OPTIONS): Add complain, complain_at,
8266 fatal, fatal_at, warn, warn_at, unexpected_end.
8267 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
8268 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
8269 (gl_EARLY): Add.
8270 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
8271 (gl_INIT): Add
8272 (GNULIB_AUTOCONF_SNIPPET): Remove.
8273 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
8274 the pickiest.
8275 * lib/.cvsignore: Add inttypes_.h.
8276 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
8277 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
8278 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
8279 no-longer-necessary initializations.
8280 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
8281 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
8282 use the unistd module.
8283 * src/system.h: Likewise.
8284 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
8285 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
8286 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
8287 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
8288 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
8289 * src/system.h: Include inttypes.h unconditionally, now that we
8290 use the inttypes module. Don't bother to include stdint.h, since
8291 inttypes.h now does that for us.
8292 (LOCALEDIR): Remove, now that we use the configmake module.
8293 * src/getargs.c: Include configmake.h.
8294 * src/main.c: Likewise.
8295 * src/output.c: Likewise.
8296 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
8297 not from $abs_top_builddir, since config.h moved.
8298
8299
8300 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
8301 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
8302
8303 * src/parse-gram.y (symbol_declaration): Don't put statements
8304 before declarations; it's not portable to C89.
8305 * src/scan-code.l (handle_action_at): Likewise.
8306
8307 * src/scan-code.l: Always initialize braces_level; the old code
8308 left it uninitialized and therefore had undefined behavior.
8309
8310 Don't attempt to redefine 'assert', since it runs afoul of
8311 systems where standard headers (mistakenly) include <assert.h>.
8312 Instead, define and use our own alternative, called 'aver'.
8313 * src/reader.c: Don't include assert.h, since we no longer
8314 use assert.
8315 * src/scan-code.l: Likewise.
8316 * src/system.h (assert): Remove, replacing with....
8317 (aver): New function, taking a bool arg. All uses changed.
8318 * src/tables.c (pack_vector): Ensure that aver arg is bool,
8319 not merely an integer.
8320
83212006-09-15 Bob Rossi <bob@brasko.net>
8322
8323 Add support for push parsing. Based on the original work of
8324 Odd Arild Olsen <oao@fibula.no>.
8325 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
8326 * data/c.m4 (YYPUSH): New.
8327 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
8328 * data/push.c: New file.
8329 * src/getargs.c (push_parser): New var.
8330 * src/getargs.h (push_parser): New declaration.
8331 * src/output.c (prepare): Add macro insertion of `push_flag'.
8332 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
8333 (prologue_declaration): Parse %push-parser.
8334 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
8335 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
8336 list of removed lines from the traces observed.
8337 (AT_CHECK_CALC_LALR): Added push parser tests.
8338
83392006-09-13 Paul Eggert <eggert@cs.ucla.edu>
8340
8341 * NEWS: Version 2.3a.
8342 * configure.ac (AC_INIT): Likewise.
8343
8344 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
8345 "#define YYSTYPE int" that caused "make maintainer-check" to fail
8346 due to header ordering dependencies. I don't know why the #define
8347 was there.
8348
8349 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
8350 runtime cost when YYDEBUG is not defined, and so that some tests
8351 that used to fail now work. Problem and initial suggestion by
8352 Paolo Bonzini.
8353 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
8354 * data/glr.cc (b4_parser_class_name):
8355 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
8356 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
8357 (yydebug_) [YYDEBUG]: New member.
8358 (yycdebug_): Now defined only if YYDEBUG.
8359 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
8360 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
8361 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
8362 if YYYDEBUG.
8363 (debug_stream, set_debug_stream, debug_level, set_debug_level):
8364 Define only if YYDEBUG.
8365 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
8366 set_debug_level.
8367 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
8368 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
8369 AT_CHECK_CALC_GLR_CC that are working now.
8370
83712006-09-12 Paul Eggert <eggert@cs.ucla.edu>
8372
8373 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
8374 We don't need them in glr.cc, and glr.c defines them.
8375 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
8376 assumes that defining it to anything is the same as defining
8377 it to 1. Problem reported by Paolo Bonzini.
8378
83792006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
8380
8381 * data/c.m4 (b4_null, b4_case): Define.
8382 * src/output.c (prepare_symbols): Use b4_null.
8383 (user_actions_output): Use b4_case.
8384
83852006-09-11 Paul Eggert <eggert@cs.ucla.edu>
8386
8387 * data/glr.c (b4_shared_declarations): Put start-header first,
8388 before any #includes that we generate, so that feature-test
8389 macros work. Problem reported by Michael Deutschmann in
8390 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
8391 * data/lalr1.cc: Likewise.
8392 * doc/bison.texinfo (Prologue): Document that feature-test macros
8393 should be defined before any Bison declarations.
8394 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
8395 that depend on location.hh after, not before, Bison decls, since
8396 we now include location.hh after the first user prologue.
8397
8398 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
8399 Sander Brandenburg in
8400 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
8401 Also, fix minor white space and comment issues.
8402 (Prologue): Mention that it's better to define feature-test macros
8403 before Bison declarations. Problem reported by Michael Deutschmann.
8404
8405 * README-cvs: Fix typo: "&" should be "&&". Problem reported
8406 by Jim Meyering.
8407 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
8408 This adjusts to recent gnulib changes.
8409
84102006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8411
8412 Finish implementation of per-type %destructor/%printer. Discussed
8413 starting at
8414 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
8415 and
8416 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
8417 * NEWS (2.3+): Add a description of this feature to the default
8418 %destructor/%printer description.
8419 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
8420 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
8421 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
8422 list node contains a semantic type.
8423 * src/symtab.c, src/symtab.h: Extend with a table that associates
8424 semantic types with their %destructor's and %printer's.
8425 (semantic_type_from_uniqstr, semantic_type_get,
8426 semantic_type_destructor_set, semantic_type_printer_set): New functions
8427 composing the public interface of that table.
8428 (symbol_destructor_get, symbol_destructor_location_get,
8429 symbol_printer_get, symbol_printer_location_get): If there's no
8430 per-symbol %destructor/%printer, look up the per-type before trying
8431 the default.
8432 * tests/actions.at (Per-type %printer and %destructor): New test case.
8433 * tests/input.at (Default %printer and %destructor redeclared):
8434 Extend to check that multiple occurrences of %symbol-default in a
8435 single %destructor/%printer declaration is an error.
8436 (Per-type %printer and %destructor redeclared, Unused values with
8437 per-type %destructor): New test cases.
8438
84392006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8440
8441 Require default %destructor/%printer to be declared using
8442 %symbol-default instead of an empty symbol list, and start working on
8443 new per-type %destructor/%printer. Discussed at
8444 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
8445 * NEWS (2.3+): Add %symbol-default to example.
8446 * bison.texinfo (Freeing Discarded Symbols): Likewise.
8447 (Table of Symbols): Add entry for %symbol-default.
8448 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
8449 (generic_symlist, generic_symlist_item): New nonterminals for creating
8450 a list in which each item is a symbol, semantic type, or
8451 %symbol-default.
8452 (grammar_declaration): Use generic_symlist in %destructor and %printer
8453 declarations instead of symbols.1 or an empty list.
8454 (symbol_declaration, precedence_declaration, symbols.1): Update actions
8455 for changes to symbol_list.
8456 * src/reader.c: Update for changes to symbol_list.
8457 * src/scan-code.l: Likewise.
8458 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
8459 * src/symlist.c, src/symlist.h: Extend such that a list node may
8460 represent a semantic type or a %symbol-default in addition to just an
8461 ordinary symbol. Add switched functions for setting %destructor's and
8462 %printer's.
8463 * tests/actions.at, tests/input.at: Add %symbol-default to all default
8464 %destructor/%printer declarations.
8465
84662006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
8467
8468 Whether the default %destructor/%printer applies to a particular symbol
8469 isn't a question of whether the user *declares* that symbol (in %token,
8470 for example). It's a question of whether the user by any means
8471 *defines* the symbol at all (by simply using a char token, for
8472 example). $end is defined by Bison whereas any other token with token
8473 number 0 is defined by the user. The error token is always defined by
8474 Bison regardless of whether the user declares it with %token, but we
8475 may one day let the user define error as a nonterminal instead.
8476 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
8477 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
8478 the meaning of "user-defined".
8479 * tests/actions.at (Default %printer and %destructor for user-declared
8480 end token): Rename to...
8481 (Default %printer and %destructor for user-defined end token): ...
8482 this.
8483
8484 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
8485 computation of whether to apply the default, don't maintain a list of
8486 every Bison-defined symbol. Instead, just check for a first character
8487 of '$', which a user symbol cannot have, and check for the error token.
8488
84892006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
8490
8491 Don't apply the default %destructor or %printer to the error token,
8492 $undefined, or $accept. This change fits the general rule that the
8493 default %destructor and %printer are only for user-declared symbols,
8494 and it solves several difficulties that are described in the new test
8495 cases listed below.
8496 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
8497 * tests/actions.at (Default %printer and %destructor are not for error
8498 or $undefined, Default %printer and %destructor are not for $accept):
8499 New test cases.
8500
85012006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
8502
8503 Allow %start after the first rule.
8504 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
8505 when parsing the first rule.
8506 (check_and_convert_grammar): Search for it here after all grammar
8507 declarations have been parsed. Skip midrules, which have dummy LHS
8508 nonterminals.
8509 * src/symtab.c (symbol_is_dummy): New function.
8510 * src/symtab.h (symbol_is_dummy): Declare it.
8511 * tests/input.at (%start after first rule): New test.
8512
85132006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8514
8515 Redo some of the previous commit: add back the ability to use
8516 non-aliased/undeclared string literals since it might be useful to
8517 those declaring %token-table.
8518 * src/reader.c (check_and_convert_grammar): Undo changes in previous
8519 commit: don't worry about complaints from symbols_pack.
8520 * src/symtab.c (symbol_new, symbol_class_set,
8521 symbol_check_alias_consistency): Undo changes in previous commit: count
8522 each string literal as a new symbol and token, assign it a symbol
8523 number, and don't complain about non-aliased string literals.
8524 (symbols_pack): Since symbol_make_alias still does not decrement symbol
8525 and token counts but does still set aliased tokens to the same number,
8526 symbol_pack_processor now leaves empty slots in the symbols array.
8527 Remove those slots.
8528 * tests/regression.at (Undeclared string literal): Remove test case
8529 added in previous commit since non-aliased string literals are allowed
8530 again.
8531 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
8532 remove unnecessary string literal declarations.
8533 * tests/sets.at (Firsts): Likewise.
8534
85352006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8536
8537 Don't allow an undeclared string literal, but allow a string literal to
8538 be used before its declaration.
8539 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
8540 symbols_pack complained.
8541 * src/symtab.c (symbol_new): Don't count a string literal as a new
8542 symbol.
8543 (symbol_class_set): Don't count a string literal as a new token, and
8544 don't assign it a symbol number since symbol_make_alias does that.
8545 (symbol_make_alias): It's not necessary to decrement the symbol and
8546 token counts anymore. Don't assume that an alias declaration occurs
8547 before any uses of the identifier or string, and thus don't assert that
8548 one of them has the highest symbol number so far.
8549 (symbol_check_alias_consistency): Complain if there's a string literal
8550 that wasn't declared as an alias.
8551 (symbols_pack): Bail if symbol_check_alias_consistency failed since
8552 symbol_pack asserts that every token has been assigned a symbol number
8553 although undeclared string literals have not.
8554 * tests/regression.at (String alias declared after use, Undeclared
8555 string literal): New test cases.
8556 (Characters Escapes, Web2c Actions): Declare string literals as
8557 aliases.
8558 * tests/sets.at (Firsts): Likewise.
8559
85602006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
8561
8562 In the grammar scanner, STRING_FINISH unclosed constructs and return
8563 them to the parser in order to improve error messages.
8564 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
8565 SC_BRACED_CODE, SC_PROLOGUE): Implement.
8566 * tests/input.at (Unclosed constructs): New test case.
8567 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
8568 seen.
8569
8570 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
8571 unused global.
8572
85732006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
8574
8575 Handle string aliases for character tokens correctly.
8576 * src/symtab.c (symbol_user_token_number_set): If the token has an
8577 alias, check and set its alias's user token number instead of its own,
8578 which is set to indicate the alias. Previously, every occurrence of
8579 the character token in the grammar overwrote that alias indicator with
8580 the character code.
8581 * tests/input.at (String aliases for character tokens): New test.
8582
85832006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
8584
8585 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
8586
85872006-08-11 Paul Eggert <eggert@cs.ucla.edu>
8588
8589 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
8590 to prevent failures when building on older platforms.
8591 Check for autopoint failure.
8592 Set XGETTEXT_OPTIONS to values that check for C format strings,
8593 so that translators are warned about them (this also helps
8594 prevent core dumps).
8595
8596 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
8597 function, since it simplifies our code a bit.
8598
8599 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
8600 rather than -W, so we don't get bogus warnings about sign comparisons.
8601 Add -Wpointer-arith, since that warning is useful (it reports code
8602 that does not conform to C89 and that some compilers reject).
8603 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
8604 since it's no longer needed.
8605
86062006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
8607
8608 Clean up scanners a bit.
8609 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
8610 definitions so gcc won't warn when obstack_for_string is unused.
8611 * src/scan-code.l: config.h and system.h are already #include'd by
8612 scan-code-c.c, so get rid of them here.
8613 * src/scan-gram.l: Likewise.
8614 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
8615 definitions rather than duplicating the rest of it.
8616 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
8617
86182006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
8619
8620 Suppress signed/unsigned comparison warnings for yycheck.
8621 * data/c.m4 (b4_safest_int_type): New macro.
8622 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
8623 a signed int type, cast it to b4_safest_int_type first.
8624 * data/yacc.c: Likewise.
8625 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
8626 also overwritten.
8627
86282006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
8629
8630 * doc/bison.texinfo: Fix some typos.
8631
86322006-08-02 Paul Eggert <eggert@cs.ucla.edu>
8633
8634 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
8635 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
8636
8637 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
8638 the latest gnulib does this a different way.
8639 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
8640 translation was patched, so stop omitting it.
8641
86422006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8643
8644 Enable declaration of default %printer/%destructor. Make the parser
8645 use these for all user-declared grammar symbols for which the user does
8646 not declare a specific %printer/%destructor. Thus, the parser uses it
8647 for token 0 if the user declares it but not if Bison generates it as
8648 $end. Discussed starting at
8649 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
8650 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
8651 and
8652 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
8653 * NEWS (2.3+): Mention.
8654 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
8655 declare a %destructor for a mid-rule's semantic value. It's just
8656 impossible to declare one specific to it.
8657 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
8658 code. Describe default %destructor form.
8659 * src/parse-gram.y (grammar_declaration): Parse default
8660 %printer/%destructor declarations.
8661 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
8662 and symbol_destructor_location_get rather than accessing the destructor
8663 and destructor_location members of struct symbol.
8664 (symbol_printers_output): Likewise but for %printer's.
8665 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
8666 again.
8667 * src/symtab.c (default_destructor, default_destructor_location,
8668 default_printer, default_printer_location): New static global
8669 variables to record the default %destructor and %printer.
8670 (symbol_destructor_get, symbol_destructor_location_get,
8671 symbol_printer_get, symbol_printer_location_get): New functions to
8672 compute the appropriate %destructor and %printer for a symbol.
8673 (default_destructor_set, default_printer_set): New functions to set the
8674 default %destructor and %printer.
8675 * src/symtab.h: Prototype all those new functions.
8676 * tests/actions.at (Default %printer and %destructor): New test to
8677 check that the right %printer and %destructor are called, that they're
8678 not called for $end, and that $$ and @$ work correctly.
8679 (Default %printer and %destructor for user-declared end token): New
8680 test to check that the default %printer and %destructor are called for
8681 a user-declared end token.
8682 * tests/input.at (Default %printer and %destructor redeclared, Unused
8683 values with default %destructor): New tests to check related grammar
8684 warnings and errors.
8685
86862006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8687
8688 Clean up handling of %destructor for the end token (token 0).
8689 Discussed starting at
8690 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
8691 and
8692 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
8693
8694 Make the skeletons consistent in how they pop the end token and invoke
8695 its %destructor.
8696 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
8697 state, which has token number 0, since this would invoke the
8698 %destructor for the end token.
8699 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
8700 until after shifting the end token, or else it won't be popped.
8701 * data/yacc.c (yyparse): Likewise.
8702
8703 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
8704 it's the end token. Upon termination, destroy an unshifted lookahead
8705 even when it's the end token.
8706 * data/lalr1.cc (yy::parser::parse): Likewise.
8707 * data/yacc.c (yyparse): Likewise.
8708
8709 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
8710 value warnings for the end token when the user gives the end token a
8711 %destructor.
8712
8713 * tests/actions.at (Printers and Destructors): Test all the above.
8714
87152006-07-24 Paul Eggert <eggert@cs.ucla.edu>
8716
8717 Update to latest gnulib and gettext versions.
8718 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
8719 Add fopen-safer.
8720 (gnulib_files): Add m4/warning.m4. Don't worry about files
8721 overwritten by autopoint.
8722 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
8723 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
8724 rejects them.
8725 Don't use autoreconf; instead, invoke autopoint etc. by hand,
8726 so that we can remove the intl files at a better time.
8727 (intl_files_to_remove): Remove aclocal.m4, since it gets
8728 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
8729 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
8730 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
8731 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
8732 Remove datarootdir hack; no longer needed.
8733 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
8734 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
8735 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
8736 strdup.h.
8737 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
8738 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
8739
87402006-07-20 Paul Eggert <eggert@cs.ucla.edu>
8741
8742 * bootstrap: Adjust to today's change to gnulib-tool by invoking
8743 it with --assume-autoconf='latest-stable'.
8744
87452006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
8746
8747 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
8748 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
8749 YYSTYPE' and `{'.
8750 * src/muscle_tab.h (muscle_grow): Replace the header comments with
8751 those from muscle_tab.c since the old ones are misleading.
8752
87532006-07-13 Akim Demaille <akim@epita.fr>
8754
8755 Support %define "KEY" {VALUE}.
8756 * src/scan-code.h, src/scan-code.l (translate_action)
8757 (translate_rule_action, translate_symbol_action, translate_code):
8758 Return char *, not const char *.
8759 * src/parse-gram.y (declaration): Rename as...
8760 (prologue_declaration): this.
8761 (string_content): Remove this nonterminal, use STRING.
8762 (braceless, content, content.opt): New nonterminal.
8763 Use them.
8764 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
8765 as value.
8766 * src/scan-gram.l (getargs.h): Don't include it.
8767
87682006-07-12 Paul Eggert <eggert@cs.ucla.edu>
8769
8770 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
8771 rather than a for-loop that declares a local bool variable. This
8772 should work around a compatibility problem with a Cray x1e C++
8773 compiler reported by Hung Nguyen in
8774 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
8775 The for-loop was introduced in the 2004-11-17 change but I don't
8776 know why it was needed.
8777
87782006-07-12 Akim Demaille <akim@epita.fr>
8779
8780 * data/c.m4: Comment changes.
8781
87822006-07-10 Akim Demaille <akim@lrde.epita.fr>
8783
8784 * src/complain.c (error_message, ERROR_MESSAGE): New.
8785 To factor...
8786 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
8787 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
8788
87892006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8790
8791 * NEWS: Instead of %union, you can define and use your own union type
8792 YYSTYPE if your grammar contains at least one <type> tag.
8793 Your YYSTYPE need not be a macro; it can be a typedef.
8794 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
8795 (Union Decl, Decl Summary): Document this.
8796 * data/glr.c (YYSTYPE): Implement this.
8797 * data/glr.cc (YYSTYPE): Likewise.
8798 * data/lalr1.cc (YYSTYPE): Likewise.
8799 * data/yacc.c (YYSTYPE): Likewise.
8800 * src/output.c (prepare): Output tag_seen_flag.
8801 * src/parse-gram.y (declaration, grammar_declaration):
8802 Use 'union_seen' rather than 'typed' to determine whether
8803 %union has been seen, since grammars can now be typed without
8804 %union.
8805 (symbol_declaration, type.opt, symbol_def):
8806 Keep track of whether a tag has been seen.
8807 * src/reader.c (union_seen, tag_seen): New vars.
8808 (typed): remove.
8809 * src/reader.h (union_seen, tag_seen, typed): Likewise.
8810 * src/scan-code.l (untyped_var_seen): New variable.
8811 (handle_action_dollar): Adjust to above changes.
8812 (handle_action_dollar, handle_action_at):
8813 Improve overflow checking for outlandish numbers.
8814 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
8815 avoid new diagnostics generated by above changes.
8816 * tests/regression.at (YYSTYPE typedef): Add test to check
8817 for type tags without %union.
8818
8819 * src/symlist.c (symbol_list_length): Return int, not unsigned
8820 int, since callers expect int. This may need to get revisited
8821 once we have proper integer overflow checking.
8822
8823 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
8824 object is now static.
8825
8826 * src/getargs.c (flags_argmatch): Return void, not int,
8827 to pacify ./configure --enable-gcc-warnings.
8828
8829 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
8830 since last_string is already defined to FLEX_PREFIX (last_string).
8831
88322006-07-09 Akim Demaille <akim@lrde.epita.fr>
8833
8834 Implement --warnings/-W.
8835 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
8836 replaced by...
8837 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
8838 Adjust callers.
8839 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
8840 (warnings_args, warnings_types): New.
8841 (getargs, short_options, long_options): Accept -W/--warnings.
8842 Sort the options by alphabetical order, upper case letter right
8843 before its lower case.
8844
88452006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
8846
8847 Change %merge result type clash warnings to errors. Discussed at
8848 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
8849 * src/reader.c (record_merge_function_type): Use complain_at.
8850 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8851 declared later): Update test case results.
8852
88532006-07-09 Akim Demaille <akim@lrde.epita.fr>
8854
8855 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
8856 to be in alphabetical order.
8857 (trace_args): Spelling fixes.
8858
88592006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8860
8861 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
8862 so they don't collide with user-defined macros.
8863 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
8864 this was never guaranteed, and now that we're using gnulib stdint,
8865 which defines int_fast16_t to long int, the problem is exposed.
8866
88672006-07-08 Paul Eggert <eggert@cs.ucla.edu>
8868
8869 * data/c.m4 (b4_basename): Simplify a bit, since we don't
8870 need the full POSIX semantics (and weren't implementing them
8871 anyway).
8872
8873 Adjust to Autoconf 2.60 and today's gnulib.
8874 * bootstrap (gnulib_modules): Add stdint.
8875 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
8876 no longer copies it.
8877 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
8878 since stdint needs the former and wcwidth (which is now required
8879 by mbswidth) needs the latter.
8880 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
8881 work around a compatibility glitch between gettext 0.14.6 and
8882 Autoconf 2.60.
8883 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
8884 Do not check for uintptr_t, since new stdint module does the right
8885 thing.
8886 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
8887 Add stdint.h, stdint_.h, wcwidth.h.
8888 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
8889 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
8890 stdint.m4, wchar_t.m4, wcwidth.m4.
8891 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
8892 usual order for ../lib/*.h files.
8893 (file_name_split): Use last_component, not base_name, to adjust
8894 to gnulib changes.
8895 * src/parse-gram.h: Include <strverscmp.h> in the usual order
8896 for ../lib/*.h files.
8897 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
8898 Define unconditionally, since we now assume the stdint module.
8899 * src/scan-skel.l: Include <dirname.h>.
8900 (BASE_QPUTS): Use last_component, not base_name.
8901 * src/system.h: Include <unlocked-io.h> in the usual order
8902 for ../lib/*.h files. Include <stdint.h> unconditionally,
8903 since we now use the stdint module.
8904 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
8905 HAVE_UINTPTR_T, since we now use the stdint module.
8906 (base_name): Remove decl, since files now include <dirname.h>
8907 to get the decl.
8908
89092006-07-08 Akim Demaille <akim@lrde.epita.fr>
8910
8911 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
8912 New, default to 1.
8913 * data/yacc.c, data/glr.c, data/location.cc: Use them.
8914 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
8915 default.
8916 * tests/calc.at: Adjust.
8917
89182006-07-08 Akim Demaille <akim@lrde.epita.fr>
8919
8920 * data/c.m4 (b4_basename): New.
8921 (b4_syncline): Also output the location of its invocation (from
8922 the skeleton).
8923 (b4_user_action, b4_define_user_action, b4_user_actions)
8924 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
8925 (b4_user_stype): New.
8926 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
8927
89282006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8929
8930 In the grammar file, the first column is 1 not 0 on the first line as
8931 on every other line.
8932 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
8933 * tests/input.at (Torturing the Scanner): Update output.
8934
8935 * src/scan-gram.l (scanner_cursor): Declare it static.
8936
89372006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8938
8939 In warnings, say "previous declaration" rather than "first
8940 declaration".
8941 * src/symtab.c (redeclaration): Do that here.
8942 * src/reader.c (record_merge_function_type): In the case of a result
8943 type clash, report the previous declaration rather than the very first
8944 one in the grammar file.
8945 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8946 declared later): Add a third declaration to check this behavior.
8947 * tests/input.at (Incompatible Aliases): Update output.
8948
89492006-06-27 Akim Demaille <akim@epita.fr>
8950
8951 * doc/Doxyfile.in: New.
8952 * doc/Makefile.am: Use it.
8953 * src/lalr.h, src/symtab.h: Initial doxygenation.
8954
89552006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8956
8957 Don't miss %merge result type warnings just because the LHS types are
8958 declared after the %merge. This continues the effort of the previous
8959 patch.
8960 * src/reader.c (get_merge_function): Don't set the merger type yet.
8961 (record_merge_function_type): New function for setting the merger type
8962 and checking for clashes.
8963 (grammar_current_rule_merge_set): Set the location of the %merge for
8964 the current rule.
8965 (packgram): Invoke record_merge_function_type for each rule now that
8966 all symbol type declarations have been parsed.
8967 * src/reader.h (merger_list.type_declaration_location): New member
8968 storing the location of the first %merge from which the type for this
8969 merging function was derived.
8970 * src/symlist.h (symbol_list.merger_declaration_location): New member
8971 storing the location of a rule's %merge, if any.
8972 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8973 declared later): New test to catch the error fixed by the above patch.
8974
89752006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8976
8977 Get action warnings (grammar_rule_check) right even when symbol
8978 declarations appear after the rules. Discussed at
8979 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
8980 and
8981 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
8982 Don't mistake the type of $$ in a midrule to be that of its parent
8983 rule's $$.
8984 * src/reader.c (grammar_current_rule_end): Don't invoke
8985 grammar_rule_check yet since not all symbol declarations may have been
8986 parsed yet.
8987 (grammar_midrule_action): Likewise.
8988 Don't record whether the midrule's $$ has been used yet since actions
8989 haven't been translated yet.
8990 Record the midrule's parent rule and its RHS index within the parent
8991 rule.
8992 (grammar_current_rule_action_append): Don't translate the action yet
8993 since not all symbol declarations may have been parsed yet and, thus,
8994 warnings about types for $$, $n, @$, and @n can't be reported yet.
8995 (packgram): Translate the action and invoke grammar_rule_check now that
8996 all symbol declarations have been parsed.
8997 * src/scan-code.l (handle_action_dollar): Now that this is invoked
8998 after parsing the entire grammar file, the symbol list here in the case
8999 of a midrule is actually the midrule's empty RHS, so reference its
9000 parent rule's RHS where necessary.
9001 On the other hand, now that you can already know it's a midrule, you
9002 aren't forced to think $$ has the same type as its parent rule's $$.
9003 (handle_action_at): In the case of a midrule, reference the parent rule
9004 where necessary.
9005 * src/symlist.c (symbol_list_new): Initialize new midrule-related
9006 members.
9007 (symbol_list_length): Now that this is invoked after all rules have
9008 been parsed, a NULL symbol (rather than a NULL symbol list node)
9009 terminates a rule. symbol_list_print already does this correctly.
9010 * src/symlist.h (symbol_list.midrule_parent_rule,
9011 symbol_list.midrule_parent_rhs_index): New members so that midrules can
9012 remember their relationships with their parents.
9013 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
9014 fixed by the above patch.
9015 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
9016 implementing...
9017 (Unused values): ... this old test case and...
9018 (Unused values before symbol declarations): ... this new test case.
9019 This one is the same as `Unused values' except that all symbol
9020 declarations appear after the rules in order to catch the rest of the
9021 errors fixed by the above patch.
9022
90232006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9024
9025 More cleanup.
9026 * src/reader.c (current_rule): Declare it static since it's no longer
9027 used outside this file.
9028 (grammar_current_rule_action_append): Remove redundant arguments from
9029 translate_rule_action invocation.
9030 * src/reader.h (current_rule): Remove this unused extern.
9031 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
9032 * src/scan-code.l (translate_rule_action): Likewise.
9033
90342006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
9035
9036 Clean up yesterday's patch.
9037 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
9038 to...
9039 * src/reader.c (grammar_current_rule_action_append): ... here for
9040 consistency with grammar_current_rule_symbol_append.
9041 * tests/regression.at (Braced code in declaration in rules section):
9042 Make yyerror and yylex static as usual.
9043
90442006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
9045
9046 Fix bug that mistakes braced code in a declaration in the rules section
9047 to be a rule action. Mentioned at
9048 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
9049 * src/scan-gram.l: Move midrule action detection from the start of the
9050 scanning of any braced code to...
9051 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
9052 action. For readability, use $2 and @2 rather than the equivalent
9053 global variables.
9054 * tests/regression.at (Braced code in declaration in rules section):
9055 New test to catch the error fixed by the above patch.
9056
9057 Work on code readability some.
9058 * src/scan-code.l (current_rule): Get rid of this misleading and
9059 redundant declaration: it's actually extern'ed in reader.h.
9060 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
9061 translate_action): Add a rule argument and use it instead of the global
9062 current_rule.
9063 (translate_rule_action): This already receives current_rule through an
9064 argument, so pass it on to translate_action instead of assigning
9065 current_rule to current_rule.
9066 (translate_symbol_action, translate_code): Pass rule = NULL to
9067 translate_action.
9068
90692006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
9070
9071 Rename %before-definitions to %start-header and %after-definitions to
9072 %end-header. Don't use these declarations to separate pre-prologue
9073 blocks from post-prologue blocks. Add new order-independent
9074 declarations %before-header and %after-header as alternatives to the
9075 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
9076 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
9077 * NEWS (2.3+): Update for these changes.
9078 * data/glr.c (b4_before_definitions): Update to...
9079 (b4_start_header): ... this.
9080 (b4_after_definitions): Update to...
9081 (b4_end_header): ... this.
9082 * data/glr.cc: Likewise.
9083 * data/lalr1.cc: Likewise.
9084 * data/yacc.c: Likewise.
9085 * doc/bison.texinfo (The prologue): Update names, and replace remaining
9086 prologue blocks with %*-header declarations.
9087 (Calc++ Parser): Likewise.
9088 (Decl Summary): Update names.
9089 (Table of Symbols): Update description.
9090 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
9091 (PERCENT_END_HEADER): ... this.
9092 (PERCENT_BEFORE_DEFINITIONS): Update to...
9093 (PERCENT_START_HEADER): ... this.
9094 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9095 (declaration): Update token names and m4 macro names.
9096 When parsing %end-header and %start-header, invoke translate_code
9097 before muscle_code_grow, and no longer set global booleans to remember
9098 whether these declarations have been seen.
9099 Parse new %after-header and %before-header.
9100 * src/reader.c (before_definitions, after_definitions): Remove.
9101 (prologue_augment): Accept a new bool argument to specify whether to
9102 augment the pre-prologue or post-prologue.
9103 * src/reader.h (before_definitions, after_definitions): Remove these
9104 extern's.
9105 (prologue_augment): Add new bool argument.
9106 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
9107 (PERCENT_END_HEADER): ... this.
9108 (PERCENT_BEFORE_DEFINITIONS): Update to...
9109 (PERCENT_START_HEADER): ... this.
9110 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9111 * tests/actions.at (Printers and Destructors): Update names.
9112
91132006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
9114
9115 Add comparison operators for C++ location classes. Discussed at
9116 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
9117 * data/c++.m4 (b4_define_location_comparison): New boolean %define
9118 declaration indicating whether filename_type has an operator==. If
9119 filename_type is `std::string', it defaults to `1', `0' otherwise.
9120 * data/location.cc: Iff b4_define_location_comparison is `1', add
9121 operator== and operator!= for class position and for class location.
9122
9123 Some minor fixes.
9124 * src/scan-action.l: Remove unused file.
9125 * src/symtab.c (symbol_printer_set): Use printer_location not
9126 destructor_location.
9127 * src/symtab.h (struct symbol): Replace incorrect source comment for
9128 printer members.
9129 * tests/input.at (Incompatible Aliases): Update output with correct
9130 printer location.
9131
91322006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
9133
9134 Don't put the pre-prologue in the header file. For the yacc.c code
9135 file and the glr.c header and code files, move the pre-prologue before
9136 the token definitions. Add new %before-definitions and
9137 %after-definitions to declare code that will go in both the header file
9138 and code file. Discussed at
9139 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
9140 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
9141 and
9142 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
9143 * NEWS (2.3+): Describe these changes.
9144 * data/glr.c (b4_pre_prologue): Move from within to before...
9145 (b4_shared_declarations): ... this.
9146 Add new b4_before_definitions before b4_token_enums.
9147 Add new b4_after_definitions at the end.
9148 * data/glr.cc (b4_pre_prologue): Replace with...
9149 (b4_before_definitions): ... this in the header file.
9150 (b4_after_definitions): New near the end of the header file.
9151 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
9152 code file right before including the header file.
9153 (b4_before_definitions): New in the previous position of
9154 b4_pre_prologue in the header file.
9155 (b4_after_definitions): New near the end of the header file.
9156 * data/yacc.c: Clean up some m4 quoting especially in the header file.
9157 (b4_token_enums_defines): In the code file, move to right before
9158 YYSTYPE for consistency with the header file.
9159 (b4_before_definitions): New right before b4_token_enums_defines in
9160 both the header and code file.
9161 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
9162 header and code file.
9163 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
9164 of prologues for %union dependencies.
9165 (Decl Summary): In %defines description, mention the effect of
9166 %before-definitions and %after-definitions on the header file.
9167 (Calc++ Parser): Forward declare driver in a %before-definitions rather
9168 than in the pre-prologue so that make check succeeds.
9169 (Table of Symbols): Add entries for %before-definitions and
9170 %after-definitions.
9171 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
9172 %before-definitions.
9173 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
9174 (declaration): Parse those declarations and append to
9175 b4_before_definitions and b4_after_definitions, respectively.
9176 * src/reader.c (before_definitions, after_definitions): New bools to
9177 track whether those declarations have been seen.
9178 (prologue_augment): Add to the post-prologue if %union,
9179 %before-definitions, or %after-definitions has been seen.
9180 * src/reader.h (before_definitions, after_definitions): New extern's.
9181 * src/scan-gram.l: Scan the new declarations.
9182 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
9183 prologue block in a %before-definitions or a %after-definitions based
9184 on whether the %union is declared.
9185 * tests/regression.at (Early token definitions with --yacc, Early token
9186 definitions without --yacc): Move tests for token definitions into the
9187 post-prologue since token names are no longer defined in the
9188 pre-prologue.
9189
91902006-06-20 Akim Demaille <akim@epita.fr>
9191
9192 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
9193 (symbol_get): Use it.
9194 * src/parse-gram.y: Use it.
9195
91962006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
9197
9198 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
9199 build succeeds when configured with --enable-gcc-warnings.
9200
92012006-06-19 Paul Eggert <eggert@cs.ucla.edu>
9202
9203 * src/parse-gram.y (char_name): New function.
9204 (CHAR, STRING, string_content): For %printer, properly escape.
9205 (ID): Prefer fputs to fprintf.
9206 (id): Reindent to be consistent with other rules.
9207 Properly quote char.
9208
9209 The Translation Project changed its way of publishing translations
9210 to maintainers. I haven't received any responses to my request
9211 for supporting the old way, or for documenting the new way. I
9212 have modified 'bootstrap' to use screen scraping
9213 (in this case, HTML scraping). This is unreliable and inelegant,
9214 but I don't see any better way. Yuck.
9215 * bootstrap (TP_URL, WGET_COMMAND): New vars.
9216 (get_translations): New function, which uses HTML scraping to
9217 deduce locations of latest translations.
9218 Use this function to grab both bison and bison-runtime .po files.
9219 Don't bother priming the pump for the runtime-po domain any more,
9220 as it's now translated better than bison is.
9221
92222006-06-19 Akim Demaille <akim@epita.fr>
9223
9224 * src/scan-gram.l: No longer "parse" things after `%union' until
9225 `{'. Rather, return a single "%union" token.
9226 No longer make symbols: return strings, and leave the conversion
9227 to symbols to the parser.
9228 (SC_PRE_CODE, token_type): Remove.
9229 * src/parse-gram.y (%union): New field `character'.
9230 Sort tokens.
9231 (CHAR): New token.
9232 (ID, ID_COLON): Now that the scanner no longer makes them
9233 identifiers, adjust all uses to invoke symbol_get.
9234 (id_colon): New, wraps the conversion from string to symbol.
9235 (%union): Accept a possible union_name.
9236 (symbol): Now can be a char.
9237 * data/c.m4 (b4_union_name): Leave a default value.
9238 * data/glr.c, data/yacc.c: Use it.
9239
92402006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
9241
9242 For associating token numbers with token names for "yacc.c", don't use
9243 #define statements unless `--yacc' is specified; always use enum
9244 yytokentype. Most important discussions start at:
9245 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
9246 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
9247 and
9248 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
9249 * NEWS (2.3+): Mention.
9250 * data/c.m4 (b4_yacc_if): New.
9251 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
9252 token #define's.
9253 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
9254 on token name definitions.
9255 * src/getargs.c (usage): Capitalize `Yacc' in English.
9256 * src/output.c (prepare): Define b4_yacc_flag.
9257 * tests/regression.at (Early token definitions): Test that tokens names
9258 are defined before the pre-prologue not just before the post-prologue.
9259 Remove this test case and copy to...
9260 (Early token definitions with --yacc): ... this to test #define's.
9261 (Early token definitions without --yacc): ... and this to test enums.
9262
92632006-06-11 Paul Eggert <eggert@cs.ucla.edu>
9264
9265 * NEWS: Reword the post-2.3 change to not be so optimistic about
9266 removing the old "look-ahead" spelling.
9267 Update previous look-ahead/lookahead change reports.
9268 * REFERENCES: look-ahead -> lookahead (since that's
9269 what he actually wrote).
9270 * doc/refcard.tex: look ahead -> lookahead,
9271 look-ahead -> lookahead
9272
92732006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
9274
9275 For consistency, use `lookahead' instead of `look-ahead' or
9276 `look_ahead'. Discussed starting at
9277 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
9278 and then at
9279 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
9280 * NEWS: For the next release, note the change to `--report'.
9281 * TODO, doc/bison.1: Update English.
9282 * doc/bison.texinfo: Update English.
9283 (Understanding Your Parser, Bison Options): Document as
9284 `--report=lookahead' rather than `--report=look-ahead'.
9285 * src/conflicts.c: Update English in comments.
9286 (lookahead_set): Rename from look_ahead_set.
9287 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
9288 (resolve_sr_conflict): Rename local look_ahead_tokens to
9289 lookahead_tokens, and update other uses.
9290 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
9291 count_rr_conflicts, conflicts_free): Update uses.
9292 * src/getargs.c (report_args): Move "lookahead" before alternate
9293 spellings.
9294 (report_types): Update uses.
9295 (usage): For `--report' usage description, state `lookahead' spelling
9296 rather than `look-ahead'.
9297 * src/getargs.h (report.report_lookahead_tokens): Rename from
9298 report_look_ahead_tokens.
9299 * src/lalr.c: Update English in comments.
9300 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
9301 (state_lookahead_tokens_count): Rename from
9302 state_look_ahead_tokens_count.
9303 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9304 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
9305 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9306 Update other uses.
9307 Update English in output.
9308 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
9309 * src/print.c: Update English in comments.
9310 (lookahead_set): Rename from look_ahead_set.
9311 (print_reduction): Rename argument lookahead_token from
9312 look_ahead_token.
9313 (print_core, state_default_rule, print_reductions, print_results):
9314 Update uses.
9315 * src/print_graph.c: Update English in comments.
9316 (print_core): Update uses.
9317 * src/state.c: Update English in comments.
9318 (reductions_new): Update uses.
9319 (state_rule_lookahead_tokens_print): Rename from
9320 state_rule_look_ahead_tokens_print, and update other uses.
9321 * src/state.h: Update English in comments.
9322 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
9323 (state_rule_lookahead_tokens_print): Rename from
9324 state_rule_look_ahead_tokens_print.
9325 * src/tables.c: Update English in comments.
9326 (conflict_row, action_row): Update uses.
9327 * tests/glr-regression.at
9328 (Incorrect lookahead during deterministic GLR,
9329 Incorrect lookahead during nondeterministic GLR): Rename
9330 print_look_ahead to print_lookahead.
9331 * tests/torture.at: Update English in comments.
9332 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
9333 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
9334 (Many lookahead tokens): Update uses.
9335 * data/glr.c: Update English in comments.
9336 * lalr1.cc: Likewise.
9337 * yacc.c: Likewise.
9338 * src/conflicts.h: Likewise.
9339 * src/lalr.h: Likewise.
9340 * src/main.c: Likewise.
9341 * src/output.c: Likewise.
9342 * src/parse-gram.c: Likewise.
9343 * src/tables.h: Likewise.
9344 * tests/calc.at: Likewise.
9345
93462006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
9347
9348 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
9349
93502006-06-07 Paul Eggert <eggert@cs.ucla.edu>
9351
9352 * TODO: Add request from Nelson H. F. Beebe to be able to install
9353 Bison without installing the yacc script.
9354
93552006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9356
9357 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
9358 and yytext if they're already #define'd.
9359 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
9360 * src/scan-code-c.c: ... here.
9361 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
9362 <config.h>.
9363
93642006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9365
9366 Get Bison to build again when configured with --enable-gcc-warnings.
9367 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
9368 missing #include's.
9369 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
9370 loc argument as it shadows a global.
9371 * src/scan-gram.l: Remove stray comma that prevents boundary_set
9372 invocation.
9373
9374 * src/.cvsignore: Add scan-code.c.
9375
93762006-06-07 Akim Demaille <akim@epita.fr>
9377
9378 * src/scan-gram.l: Move the "add a trailing ; to actions" code
9379 to...
9380 * src/scan-code.l: here.
9381 * tests/input.at (Torturing the Scanner): Fix another location
9382 error.
9383
93842006-06-07 Akim Demaille <akim@epita.fr>
9385
9386 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
9387
93882006-06-06 Akim Demaille <akim@epita.fr>
9389
9390 Extract the parsing of user actions from the grammar scanner.
9391 As a consequence, the relation between the grammar scanner and
9392 parser is much simpler. We can also split "composite tokens" back
9393 into simple tokens.
9394 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
9395 * src/scan-gram.l (add_column_width, adjust_location): Move to and
9396 rename as...
9397 * src/location.h, src/location.c (add_column_width)
9398 (location_compute): these.
9399 Fix the column count: the initial column is 0.
9400 (location_print): Be robust to ending column being 0.
9401 * src/location.h (boundary_set): New.
9402 * src/main.c: Adjust to scanner_free being renamed as
9403 gram_scanner_free.
9404 * src/output.c: Include scan-code.h.
9405 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
9406 Use boundary_set.
9407 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
9408 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
9409 which is now, again, a separate token.
9410 Adjust all dependencies.
9411 Whereever actions with $ and @ are used, use translate_code.
9412 (action): Remove this nonterminal which is now useless.
9413 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
9414 (grammar_current_rule_action_append): Use translate_code.
9415 (packgram): Bound check ruleno, itemno, and rule_length.
9416 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
9417 (last_string, last_braced_code_loc, max_left_semantic_context)
9418 (scanner_initialize, scanner_free, scanner_last_string_free)
9419 (gram_out, gram_lineno, YY_DECL_): Move to...
9420 * src/scan-gram.h: this new file.
9421 (YY_DECL): Rename as...
9422 (GRAM_DECL): this.
9423 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
9424 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9425 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9426 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9427 Move these declarations, and...
9428 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
9429 these to...
9430 * src/flex-scanner.h: this new file.
9431 * src/scan-gram.l (rule_length, rule_length_overflow)
9432 (increment_rule_length): Remove.
9433 (last_braced_code_loc): Rename as...
9434 (gram_last_braced_code_loc): this.
9435 Adjust to the changes of the parser.
9436 Move all the handling of $ and @ into...
9437 * src/scan-code.l: here.
9438 * src/scan-gram.l (handle_dollar, handle_at): Remove.
9439 (handle_action_dollar, handle_action_at): Move to...
9440 * src/scan-code.l: here.
9441 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
9442 scan-code.h, scan-code-c.c, scan-gram.h.
9443 (EXTRA_bison_SOURCES): Add scan-code.l.
9444 (BUILT_SOURCES): Add scan-code.c.
9445 (yacc): Be robust to white spaces.
9446
9447 * tests/conflicts.at, tests/input.at, tests/reduce.at,
9448 * tests/regression.at: Adjust the column numbers.
9449 * tests/regression.at: Adjust the error message.
9450
94512006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9452
9453 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9454 Use Akim's wording from
9455 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
9456
94572006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9458
9459 Between Bison releases, manually append `+' to the previous Bison
9460 release number, and use that as a signal to automatically print the
9461 ChangeLog's CVS Id keyword from --version. Discussed starting at
9462 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
9463 * ChangeLog: Add Id header.
9464 * configure.ac (AC_INIT): Append `+' to `2.3'.
9465 * src/.cvsignore: Add revision.c.
9466 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
9467 (BUILT_SOURCES): Add revision.c.
9468 (revision.c): New target rule. This file defines a new global variable
9469 named revision. It initializes it with either the Id from ChangeLog
9470 or, if VERSION doesn't contain `+', with the empty string.
9471 * src/getargs.c (version): Print the value of revision.
9472 * src/revision.h: Extern revision.
9473
94742006-06-05 Paul Eggert <eggert@cs.ucla.edu>
9475
9476 * NEWS: Version 2.3.
9477 * configure.ac (AC_INIT): Likewise.
9478
94792006-05-30 Paul Eggert <eggert@cs.ucla.edu>
9480
9481 * data/glr.c (YYRECOVERING): Define to be a function-like macro
9482 with no arguments, not as an object-like macro. This is for
9483 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
9484 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
9485 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
9486 Document this.
9487
94882006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
9489
9490 * src/getargs.c (usage): Back out yesterday's modification of the
9491 --help output so that we don't have to wait for translation before
9492 releasing 2.3.
9493
94942006-05-29 Paul Eggert <eggert@cs.ucla.edu>
9495
9496 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
9497 Problem reported by Akim Demaille.
9498
94992006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
9500
9501 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9502
95032006-05-26 Paul Eggert <eggert@cs.ucla.edu>
9504
9505 * data/yacc.c (yy_reduce_print): Omit trailing white space in
9506 generated source code. Problem reported by Frans Englich in
9507 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
9508
95092006-05-22 Paul Eggert <eggert@cs.ucla.edu>
9510
9511 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
9512 shell, not within 'make', so that 'make' by an ordinary builder
9513 (using GNU make) does not worry about configuring gzip. This also
9514 works around a bug reported independently by Keith Thompson and by
9515 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
9516 stderr rather than stdout, messing up the build logs.
9517
95182006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9519
9520 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
9521 to make sure that YYID will never be unused. This fixes a 'make
9522 maintainer-check' failure caused by the recent changes to the 'Trivial
9523 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
9524 not used.
9525 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
9526
95272006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9528
9529 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
9530 state before an empty RHS is always resolved here. Only the location
9531 of that state is guaranteed to be resolved, and that's enough. This
9532 fixes the remaining bug reported by Derek M. Jones in
9533 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9534 * tests/glr-regression.at (Uninitialized location when reporting
9535 ambiguity): Test the above case.
9536 Also, the embedded comments in this test case claim it checks the case
9537 of an empty RHS that has inherited the initial location. However, the
9538 corresponding LHS was already resolved, so yyresolveLocations didn't
9539 actually have reason to modify it. Fix this by forcing
9540 nondeterministic operation at the beginning of the parse.
9541
95422006-05-20 Paul Eggert <eggert@cs.ucla.edu>
9543
9544 * data/c.m4 (b4_yy_symbol_print_generate):
9545 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
9546 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
9547 of the bugs reported today by Derek M Jones in
9548 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9549 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
9550 defined to be a type name without parens or brackets.
9551 (Location Type): Similarly for YYLTYPE.
9552 * tests/regression.at (Trivial grammars): Put in a test for this
9553 bug that will be caught by 'make maintainer-check' (though not,
9554 alas, by 'make check' unless your compiler is picky).
9555
95562006-05-19 Paul Eggert <eggert@cs.ucla.edu>
9557
9558 * NEWS: Version 2.2.
9559 * configure.ac (AC_INIT): Likewise.
9560
95612006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
9562
9563 * data/glr.c (yyreportTree): Make room in yystates for the state
9564 preceding the RHS. This fixes the segmentation fault reported by Derek
9565 M. Jones in
9566 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
9567 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
9568 to the user. Reported for yyreportTree by Derek M. Jones later in the
9569 same thread.
9570 * THANKS: Add Derek M. Jones.
9571 Update my email address.
9572 Fix typo in Steve Murphy's name.
9573
95742006-05-14 Paul Eggert <eggert@cs.ucla.edu>
9575
9576 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
9577 checking against YYLAST that caused the parser to miss a potential
9578 alternative in its diagnostic.
9579 Problem reported by Maria Jose Moron Fernandez in
9580 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
9581 * data/lalr1.cc (yysyntax_error_): Likewise.
9582 * data/yacc.c (yysyntax_error): Likewise.
9583 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
9584 tokens, in case we run into an older C compiler.
9585 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
9586 Use them to check for the off-by-one error fixed above.
9587
9588 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
9589 YYSIZE_T, not size_t.
9590 * tests/regression.at (Trivial grammars): New test, to catch
9591 the error fixed by the above patch.
9592
95932006-05-14 Akim Demaille <akim@lrde.epita.fr>
9594
9595 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
9596 scheme.
9597 Reported by Steve Murphy.
9598
95992006-05-14 Akim Demaille <akim@lrde.epita.fr>
9600
9601 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
9602 * data/glr.cc: b4_location_flag is now b4_locations_flag.
9603
96042006-05-14 Akim Demaille <akim@lrde.epita.fr>
9605
9606 Implement --trace=m4.
9607 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
9608 * src/output.c (output_skeleton): When set, pass -dV to m4.
9609
9610 Factor the handling of flags in m4.
9611 * src/output.c (prepare): Rename the muscle names debug, defines,
9612 error_verbose to debug_flag, defines_flag, error_verbose_flag.
9613 * data/c.m4: Adjust.
9614 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
9615 Use b4_define_flag_if to define other b4_FLAG_if macros.
9616 (b4_location_if): As a consequence, rename as...
9617 (b4_locations_if): this, for consistency.
9618 Adjust all the skeletons.
9619
96202006-05-14 Akim Demaille <akim@lrde.epita.fr>
9621
9622 * etc/bench.pm: Shorten bench names.
9623
96242006-05-14 Akim Demaille <akim@lrde.epita.fr>
9625
9626 * src/output.h, src/output.c (error_verbose): Move to...
9627 * src/getargs.h, src/getargs.c: here.
9628 Sort the flags.
9629 Adjust dependencies.
9630
96312006-05-13 Paul Eggert <eggert@cs.ucla.edu>
9632
9633 * data/c.m4 (b4_copyright): Put the special exception for Bison
9634 skeletons here, so we don't have to put it in each skeleton. All
9635 uses changed. Suggested by Akim Demaille. Also, wrap the
9636 copyright notice, in case it is longer than 80 columns. Replace
9637 comma by newline after title.
9638
96392006-05-11 Paul Eggert <eggert@cs.ucla.edu>
9640
9641 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
9642 incompatibility, not a bug. Mention that it wasn't fixed as of
9643 flex 2.5.33.
9644
96452006-05-11 Akim Demaille <akim@lrde.epita.fr>
9646
9647 * examples/extexi: Enforce the precedence of concatenation over
9648 >>.
9649 Reported by Tommy Nordgren.
9650
96512006-05-11 Akim Demaille <akim@lrde.epita.fr>
9652
9653 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
9654 with the member "token".
9655 Reported by Martin Nylin.
9656
96572006-05-08 Paul Eggert <eggert@cs.ucla.edu>
9658
9659 * data/glr.c: Switch to Bison 2.2 special-exception language in
9660 the copyright notice. Use more-regular format for titles and
9661 copyright notices.
9662 * data/glr.cc: Likewise.
9663 * data/location.cc: Likewise.
9664 * data/yacc.cc: Likewise.
9665 * doc/bison.texinfo (Conditions): Document this.
9666 * NEWS: likewise. Upgrade version to 2.2.
9667
96682006-04-27 Akim Demaille <akim@lrde.epita.fr>
9669
9670 * data/glr.cc: Remove dead code.
9671
96722006-04-25 Paul Eggert <eggert@cs.ucla.edu>
9673
9674 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
9675 that variable and the line breaks the bootstrap. Problem reported
9676 by Juan M. Guerrero.
9677
96782006-04-24 Akim Demaille <akim@lrde.epita.fr>
9679
9680 * doc/bison.texinfo (Multiple start-symbols): New.
9681
96822006-04-24 Akim Demaille <akim@lrde.epita.fr>
9683
9684 * etc/README, etc/bench.pl: New.
9685
96862006-04-03 Akim Demaille <akim@lrde.epita.fr>
9687
9688 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
9689 rule.
9690 Reported by Mickael Labau.
9691 * tests/input.at (Torturing the Scanner): Test it.
9692
96932006-03-16 Paul Eggert <eggert@cs.ucla.edu>
9694
9695 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
9696 Problem reported by Bob Rossi.
9697
96982006-03-13 Paul Eggert <eggert@cs.ucla.edu>
9699
9700 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
9701 and didn't really work.
9702 For the index, use @ifnotinfo, not @iftex.
9703 Minor cleanups of spacing and terminology.
9704
97052006-03-12 Akim Demaille <akim@lrde.epita.fr>
9706
9707 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
9708 of AT_NAME_PREFIX when %name-prefix is not used.
9709
97102006-03-12 Akim Demaille <akim@lrde.epita.fr>
9711
9712 Apply --prefix to C++ skeletons too: they change the namespace.
9713 The test suite already exercize these cases.
9714 * data/c++.m4 (b4_namespace): New.
9715 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
9716 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
9717 * data/yacc.c, data/glr.c: Remove a useless `[]'.
9718 * doc/bison.texinfo: Document it.
9719 (Option Cross Key): Use @multitable in all formats. It looks
9720 nicer, even in TeX outputs.
9721 (Rules): Use the same code whatever the output type is.
9722 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
9723 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
9724 * tests/calc.at: Use it, instead of hard coding `yy'.
9725
97262006-03-10 Akim Demaille <akim@lrde.epita.fr>
9727
9728 * TODO: Remove dead items.
9729
97302006-03-10 Akim Demaille <akim@lrde.epita.fr>
9731
9732 * doc/FAQ: Remove, merged into...
9733 * doc/bison.texinfo (FAQ): this.
9734 * doc/Makefile.am (EXTRA_DIST): Adjust.
9735
97362006-03-10 Akim Demaille <akim@lrde.epita.fr>
9737
9738 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
9739 even if empty.
9740 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
9741 * doc/bison.texinfo (Calc++ Scanner): Use it.
9742
97432006-03-09 Paul Eggert <eggert@cs.ucla.edu>
9744
9745 Fix two nits reported by twlevo, plus one more that I discovered.
9746
9747 * src/assoc.h (assoc_to_string): Give a name to the arg, as
9748 this is the usual Bison style.
9749 * src/location.h (location_print): Likewise.
9750
9751 * src/reader.h (token_name): Likewise.
9752
97532006-03-08 Paul Eggert <eggert@cs.ucla.edu>
9754
9755 Fix some nits reported by twlevo.
9756 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
9757 and "POSIX". Use more-modern syntax for URLs. Mention C++
9758 and ask for Java. Don't hardwire OS version numbers. Add
9759 copyright notice.
9760 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
9761 * src/conflicts.c (solved_conflicts_obstack): Now static.
9762
97632006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
9764
9765 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
9766 page. Say "you can use it" not "you may use it" as on the web page;
9767 we're describing capabilities not granting permission.
9768
97692006-03-06 Paul Eggert <eggert@cs.ucla.edu>
9770
9771 * data/glr.c (yyresolveLocations): Rename local variables to avoid
9772 shadowing warnings. Use usual patter for iterating through RHS.
9773 * tests/glr-regression.at
9774 (Uninitialized location when reporting ambiguity):
9775 Modify yylex so that it uses its argument, rather than trying
9776 to rely on ARGSUSED (which doesn't work for gcc with warnings).
9777 const char -> char const.
9778
9779 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
9780 Don't use tabs inside commands; it messes up 'ps'.
9781 Problem reported by twlevo.
9782
97832006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
9784
9785 * tests/glr-regression.at (Uninitialized location when reporting
9786 ambiguity): New test case.
9787 * data/glr.c (yyresolveLocations): New function, which uses
9788 YYLLOC_DEFAULT.
9789 (yyresolveValue): Invoke yyresolveLocations before reporting an
9790 ambiguity.
9791 * doc/bison.texinfo (Default Action for Locations): Note
9792 YYLLOC_DEFAULT's usage for ambiguity locations.
9793 (GLR Semantic Actions): Cross-reference those notes.
9794
97952006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
9796
9797 * tests/glr-regression.at (Leaked semantic values when reporting
9798 ambiguity): Remove unnecessary union and type declarations.
9799 (Leaked lookahead after nondeterministic parse syntax error): New test
9800 case.
9801 * data/glr.c (yyparse): Check for zero stacks remaining before
9802 attempting to shift the lookahead so that you don't lose it.
9803
98042006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9805
9806 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
9807 * tests/glr-regression.at (Leaked semantic values when reporting
9808 ambiguity): New test case.
9809 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
9810 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
9811 now unnecessary yystackp parameter.
9812 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
9813 destructors can be called.
9814
9815 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
9816 in existing testcases.
9817
98182006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9819
9820 Don't leak semantic values for parent RHS when a user action cuts the
9821 parser, and clean up related code a bit.
9822 * tests/glr-regression.at (Leaked merged semantic value if user action
9823 cuts parse): Rename to...
9824 (Leaked semantic values if user action cuts parse): ... this. Add check
9825 for leaked parent RHS values.
9826 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
9827 between an unresolved state (non-empty chain of semantic options) and
9828 an incomplete one (signaled by an empty chain).
9829 (yyresolveStates): Document the interface. Move all manipulation of a
9830 successfully or unsuccessfully resolved yyGLRState to...
9831 (yyresolveValue): ... here so that yyresolveValue always leaves a
9832 yyGLRState with consistent data and thus is easier to understand.
9833 Remove the yyvalp and yylocp parameters since they are always just
9834 taken from the yys parameter. When reporting a discarded merged value
9835 in debugging output, note that it is incompletely merged. Document the
9836 interface.
9837 (yyresolveAction): If resolving any of the RHS states fails, destroy
9838 them all rather than leaking them. Thus, as long as user actions are
9839 written to clean up the RHS correctly, yyresolveAction always cleans up
9840 the RHS of a semantic option. Document the interface.
9841
98422006-02-27 Paul Eggert <eggert@cs.ucla.edu>
9843
9844 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
9845 led to a segmentation fault in GNU Pascal. Problem reported
9846 by Waldek Hebisch.
9847
98482006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
9849
9850 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
9851 mid-rule action inside a nonterminal symbol in order to declare a
9852 destructor for its semantic value.
9853
98542006-02-16 Paul Eggert <eggert@cs.ucla.edu>
9855
9856 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
9857 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
9858 __cplusplus && ! defined _STDLIB_H && !
9859 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
9860 defined free))]: Include <stdlib.h> rather than rolling our own
9861 declarations of malloc and free, to avoid problems with
9862 incompatible declarations (using 'throw') C++'s stdlib.h. This
9863 should fix Debian bug 340012
9864 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
9865 reported by Guillaume Melquiond.
9866
98672006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9868
9869 * NEWS: Clarify symbols versus types in unused-value warnings.
9870
9871 * configure.ac (AC_INIT): Bump version number.
9872
98732006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9874
9875 * NEWS: Version 2.1a.
9876 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
9877 since C99 requires this.
9878
98792006-02-11 Paul Eggert <eggert@cs.ucla.edu>
9880
9881 * m4/c-working.m4: New file.
9882 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
9883
98842006-02-10 Paul Eggert <eggert@cs.ucla.edu>
9885
9886 * Makefile.maint: Merge from coreutils.
9887
98882006-02-09 Paul Eggert <eggert@cs.ucla.edu>
9889
9890 More portability fixes for problems summarized by Nelson H. F. Beebe.
9891
9892 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
9893 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
9894 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
9895 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
9896 messes up because C++ code is compiled in 32-bit mode but linked
9897 in 64-bit mode.
9898
98992006-02-08 Paul Eggert <eggert@cs.ucla.edu>
9900
9901 More portability fixes for problems summarized by Nelson H. F. Beebe.
9902
9903 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
9904 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
9905
9906 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
9907 nodist_PROGRAMS, since we don't need to actually compile the
9908 example if we're just doing a plain 'make'. This avoids bothering
9909 the installer unnecessarily about problems due to weird C++
9910 compilers.
9911
99122006-02-06 Paul Eggert <eggert@cs.ucla.edu>
9913
9914 More portability fixes for problems summarized by Nelson H. F. Beebe.
9915
9916 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
9917 than #include "...", and compile with -I'.'. The old method was
9918 not portable, according to Posix and the C standard, and it does
9919 not work with Sun C 5.7, where previous #line directives affect
9920 the working directory used in later #include "..." directives.
9921
99222006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9923
9924 Various DJGGP specific issues in /djgpp
9925
99262006-02-02 Paul Eggert <eggert@cs.ucla.edu>
9927
9928 More portability fixes for problems summarized by Nelson H. F. Beebe.
9929
9930 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
9931 '#include <map>' works and that you can apply ++ to iterators.
9932
99332006-02-01 Paul Eggert <eggert@cs.ucla.edu>
9934
9935 Work around portability problems summarized by Nelson H. F. Beebe in
9936 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
9937
9938 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9939 that '#include <string>' works.
9940
9941 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
9942 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
9943 "warning: sorry: semantics of inline function static data `const
9944 unsigned char translate_table[262]' are wrong (you'll wind up with
9945 multiple copies)".
9946
9947 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
9948 or, xor to not_, and_, or_, and xor_, respectively. This works
9949 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
9950 random system header somewhere that includes the equivalent of
9951 <iso646.h>.
9952
9953 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
9954 -E" works; it apparently doesn't work with PathScale EKO Compiler
9955 Suite Version 2.0.
9956
99572006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
9958
9959 During deterministic GLR operation, user actions should be able to
9960 influence the parse by changing yychar. To make this easier to fix and
9961 to make glr.c easier to evolve in general, don't maintain yytoken in
9962 parallel with yychar; just compute yytoken when needed.
9963 * tests/glr-regression.at (Incorrect lookahead during deterministic
9964 GLR): Check that setting yychar in a user action has the intended
9965 effect.
9966 * data/glr.c (yyGLRStack): Remove yytokenp member.
9967 (yyclearin): Don't set *yytokenp.
9968 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
9969 yychar rather than *yytokenp to determine the current lookahead.
9970 Compute yytoken locally when needed.
9971 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
9972 point to.
9973
9974 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
9975 after `--report' documentation.
9976
99772006-01-30 Paul Eggert <eggert@cs.ucla.edu>
9978
9979 * src/parse-gram.y (grammar_declaration): Location of printer
9980 symbol is @1, not list->location. Bug reported by twlevo.
9981 * tests/input.at (Incompatible Aliases): Adjust to above change.
9982
99832006-01-29 Paul Eggert <eggert@cs.ucla.edu>
9984
9985 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
9986 all the test at once. This makes the output easier to read in the
9987 normal case.
9988
9989 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
9990 got from <http://bro-ids.org/download.html>. The bug is that
9991 when two actions appeared in succession, the second one was
9992 scanned before the first one was added to the grammar rule
9993 as a midrule action. Bison then output the incorrect warning
9994 "parse.y:905.17-906.36: warning: unused value: $3".
9995 * src/parse-gram.y (BRACED_CODE, action): These are no longer
9996 associated with a value.
9997 (rhs): Don't invoke grammar_current_rule_action_append.
9998 (action): Invoke it here instead.
9999 * src/reader.c (grammar_midrule_action): Now extern.
10000 (grammar_current_rule_action_append): Don't invoke
10001 grammar_midrule_action; that is now the scanner's job.
10002 * src/reader.h (last_string, last_braced_code_loc):
10003 (grammar_midrule_action): New decls.
10004 * src/scan-gram.l (last_string): Now extern, sigh.
10005 (last_braced_code_loc): New extern variable.
10006 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
10007 rule already has an action.
10008 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
10009 * tests/input.at (AT_CHECK_UNUSED_VALUES):
10010 Add some tests to check that the above changes fixed the bug.
10011
100122006-01-27 Paul Eggert <eggert@cs.ucla.edu>
10013
10014 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
10015 All used changed. Check whether the symbol has a destructor,
10016 not whether it is typed.
10017 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
10018 that the values are still reported as unused. All line numbers
10019 adjusted.
10020
100212006-01-23 Paul Eggert <eggert@cs.ucla.edu>
10022
10023 Work around a bug in bro 0.8, which underparenthesizes its
10024 definition of YYLLOC_DEFAULT.
10025 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
10026 their arguments.
10027 * data/lalr1.cc: Likewise.
10028 * data/yacc.cc: Likewise.
10029
100302006-01-22 Paul Eggert <eggert@cs.ucla.edu>
10031
10032 Work around a bug in Pike 7.0, and give the Pike folks a
10033 better way to override the usual int widths.
10034 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
10035 user can override the types.
10036 (short): #undef, to work around a bug in Pike 7.0.
10037 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
10038 (union yyalloc.yyss): Use yytype_int16 rather than short.
10039 All uses changed.
10040 (yysigned_char): Remove.
10041 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
10042 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
10043 * tests/regression.at (Web2c Actions): Adjust to above changes.
10044
10045 * src/reader.c (check_and_convert_grammar): New function.
10046 (reader): Close the input file even if something went wrong during
10047 parsing. Minor file descriptor leak reported by twlevo.
10048
10049 * src/assoc.c (assoc_to_string): Use a default: abort (); case
10050 to pacify gcc -Wswitch-default.
10051 * src/scan-gram.l (adjust_location): Use a default: break; case
10052 to pacify gcc -Wswitch-default.
10053 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
10054 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10055 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10056 Move these decls to scan-skel.l, since they don't need to be
10057 visible elsewhere.
10058 * src/scan-skel.l: Accept the above decls.
10059 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
10060 is used.
10061
100622006-01-21 Paul Eggert <eggert@cs.ucla.edu>
10063
10064 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
10065 since we don't want to insist on a version number at the start
10066 of the changelog every time.
10067 * Makefile.maint: Sync from coreutils a bit better.
10068 (sc_trailing_blank): Renamed from sc_trailing_space.
10069 All uses changed.
10070 (sc_no_if_have_config_h, sc_require_config_h):
10071 (sc_prohibit_assert_without_use): New rules.
10072 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
10073 (sc_dd_max_sym_length): Fix leading spaces in rule.
10074 (sc_system_h_headers): Prefix with @.
10075 (sc_useless_cpp_parens, m4-check): Output line numbers.
10076 (changelog-check): Allow version only in head.
10077 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
10078 satisfy new Makefile.maint rule.
10079 * data/glr.c: Likewise.
10080 * data/glr.cc: Likewise.
10081 * data/lalr1.cc: Likewise.
10082 * data/yacc.c: Likewise.
10083 * lib/ebitsetv.c: Likewise.
10084 * lib/lbitset.c: Likewise.
10085 * lib/subpipe.c: Likewise.
10086 * lib/timevar.c: Likewise.
10087 * src/system.h: Likewise.
10088 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
10089 * djgpp/Makefile.maint: Add copyright notice.
10090 * djgpp/README.in: Likewise.
10091 * djgpp/config.bat: Likewise.
10092 * djgpp/config.site: Likewise.
10093 * djgpp/config_h.sed: Likewise.
10094 * djgpp/djunpack.bat: Likewise.
10095 * djgpp/config.sed: Fix copyright notice to match standard format.
10096 * djgpp/subpipe.h: Likewise.
10097 * lib/bitsetv-print.c: Likewise.
10098 * lib/bitsetv.c: Likewise.
10099 * lib/subpipe.h: Likewise.
10100 * lib/timevar.c: Likewise.
10101 * lib/timevar.h: Likewise.
10102 * djgpp/subpipe.c: Use standard recipe for config.h.
10103 * lib/abitset.c: Likewise.
10104 * lib/bitset.c: Likewise.
10105 * lib/bitset_stats.c: Likewise.
10106 * lib/bitsetv-print.c: Likewise.
10107 * lib/bitsetv.c: Likewise.
10108 * lib/ebitsetv.c: Likewise.
10109 * lib/get-errno.c: Likewise.
10110 * lib/lbitset.c: Likewise.
10111 * lib/subpipe.c: Likewise.
10112 * lib/timevar.c: Likewise.
10113 * lib/vbitset.c: Likewise.
10114 * tests/local.at: Likewise.
10115 * src/scan-gram.l: Don't include verify.h, since system.h does
10116 that for us.
10117 * .x-sc_require_config_h: New file.
10118 * .x-sc_unmarked_diagnostics: New file.
10119
101202006-01-20 Paul Eggert <eggert@cs.ucla.edu>
10121
10122 Be a bit more systematic about using 'abort'.
10123 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
10124 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
10125 Put 'default: abort ();' before some other case, to satisfy older
10126 pedantic compilers.
10127 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10128 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
10129 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
10130 * src/conflicts.c (resolve_sr_conflict): Likewise.
10131 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
10132 (get_decision_str, get_orientation_str, get_node_alignment_str):
10133 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
10134 (get_linestyle_str, get_arrowstyle_str): Likewise.
10135 * src/conflicts.c (resolve_sr_conflict):
10136 Use a default case rather than one for the one remaining enum
10137 value, to catch invalid enum values as well.
10138 * src/lalr.c (set_goto_map, map_goto):
10139 Prefer "assert (FOO);" to "if (!FOO) abort ();".
10140 * src/nullable.c (nullable_compute, token_definitions_output):
10141 Likewise.
10142 * src/reader.c (packgram, reader): Likewise.
10143 * src/state.c (transitions_to, state_new, state_reduction_find):
10144 Likewise.
10145 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
10146 (symbol_pack): Likewise.
10147 * src/tables.c (conflict_row, pack_vector): Likewise.
10148 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
10149 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
10150 * src/system.h: Don't include <assert.h>.
10151 (assert): New macro.
10152
10153 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
10154 (Destructor Decl, Parser Function, Pure Calling):
10155 Describe rules for braces inside C code more carefully.
10156
101572006-01-19 Paul Eggert <eggert@cs.ucla.edu>
10158
10159 Fix some porting glitches found by Nelson H. F. Beebe.
10160 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
10161 compilers that don't understand that abort () does not return.
10162 * src/state.c (transitions_to): Likewise.
10163 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10164 that '#include <cstdlib>' works.
10165 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
10166 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
10167 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
10168 for the benefit of some pre-C99 compilers.
10169
10170 * bootstrap: Undo changes to gnulib files that autoreconf made.
10171
10172 Minor fixups to get 'make maintainer-check' to work.
10173 * configure.ac: Don't use -Wnested-externs, as it's incompatible
10174 with the new verify.h implementation.
10175 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
10176 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
10177 * data/yacc.c (YYUSE): Likewise.
10178 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
10179 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
10180 * src/parse-gram.y (declaration): Don't pass a string constant
10181 to a function that expects char *, since GCC might complain
10182 about the constant value.
10183 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
10184 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
10185 before #defining them.
10186 * tests/glr-regression.at
10187 (Incorrectly initialized location for empty right-hand side in GLR):
10188 In yyerror, use the msg arg.
10189 (Corrupted semantic options if user action cuts parse):
10190 (Incorrect lookahead during deterministic GLR):
10191 (Incorrect lookahead during nondeterministic GLR):
10192 Don't name a local var 'index'; it shadows string.h's 'index'.
10193
101942006-01-19 Akim Demaille <akim@epita.fr>
10195
10196 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
10197 location, not just parts of it.
10198
101992006-01-18 Paul Eggert <eggert@cs.ucla.edu>
10200
10201 * NEWS: Document the fact that multiple %unions are now allowed.
10202 * doc/bison.texinfo (Union Decl): Likewise.
10203 * TODO: This feature is now implemented, so remove it from
10204 the wishlist.
10205
10206 * Makefile.maint: Merge with coreutils Makefile.maint.
10207 (CVS_LIST): Use build-aux version if available.
10208 (VERSION_REGEXP): New macro.
10209 (syntax-check-rules): Add sc_no_if_have_config_h,
10210 sc_prohibit_assert_without_use, sc_require_config_h,
10211 sc_useless_cpp_parens.
10212 (sc_obsolete_symbols): Check for O_NDELAY.
10213 (sc_dd_max_sym_length): Track coreutils.
10214 (sc_unmarked_diagnostics): Look in all files, not just *.c.
10215 (sc_useless_cpp_parens): New rule.
10216 (news-date-check): Look for version or today's date.
10217 (changelog-check): Don't require version number near head.
10218 (copyright-check): Use current year instead of hardwiring 2005.
10219 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
10220 (announcement): Add --gpg-key-ID.
10221
10222 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
10223 with "file system".
10224
10225 Avoid undefined behavior that addressed just before the start of an
10226 array. Problem reported by twlevo.
10227 * src/reader.c (packgram): Prepend a new sentinel before ritem.
10228 * src/lalr.c (build_relations): Rely on new sentinel.
10229 * src/gram.c (gram_free): Adjust to new sentinel.
10230
102312006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
10232
10233 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
10234 yylookaheadNeeds. All uses updated.
10235 (yysplitStack): Rename local yynewLookaheadStatuses to
10236 yynewLookaheadNeeds.
10237 * data/glr-regression.at (Incorrect lookahead during nondeterministic
10238 GLR): In comments, change `lookahead status' to `lookahead need'.
10239
102402006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10241
10242 * data/glr.c (yysplitStack): A little stylistic rewrite.
10243
102442006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10245
10246 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
10247
102482006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
10249
10250 * doc/bison.texinfo: Fix some typos.
10251 (GLR Semantic Actions): New subsection discussing special
10252 considerations because GLR semantic actions might be deferred.
10253 (Actions): Mention look-ahead usage of yylval.
10254 (Actions and Locations): Mention look-ahead usage of yylloc.
10255 (Special Features for Use in Actions): Add YYEOF entry and mention it
10256 in the yychar entry.
10257 In the yychar entry, remove mention of the local yychar case (pure
10258 parser) since this is irrelevant information when writing semantic
10259 actions and since it's already discussed in `Table of Symbols' where
10260 yychar is otherwise described as an external variable.
10261 In the yychar entry, don't call it the `current' look-ahead since it
10262 isn't when semantic actions are deferred.
10263 In the yychar and yyclearin entries, add note about deferred semantic
10264 actions.
10265 Add yylloc and yylval entries discussing look-ahead usage.
10266 (Look-Ahead Tokens): When discussing yychar, don't call it the
10267 `current' look-ahead, and do mention yylval and yylloc.
10268 (Error Recovery): Cross-reference `Action Features' when mentioning
10269 yyclearin.
10270 (Table of Symbols): In the yychar entry, don't call it the `current'
10271 look-ahead.
10272 In the yylloc and yylval entries, mention look-ahead usage.
10273
102742006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
10275
10276 * tests/glr-regression.at: Update copyright year to 2006.
10277
102782006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10279
10280 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
10281 use during nondeterministic operation to track which stacks have
10282 actually needed the current lookahead.
10283 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
10284 Allocate, deallocate, resize, and otherwise shuffle space for
10285 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
10286 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
10287 appropriately during nondeterministic operation.
10288 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
10289 members to store the current lookahead to be used by the deferred
10290 user action.
10291 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
10292 from which the RHS is taken. Set the lookahead members of the new
10293 yySemanticOption according to the lookahead status for stack yyk.
10294 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
10295 yyaddDeferredAction.
10296 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
10297 members of yySemanticOption before invoking yyuserAction, and then set
10298 them back to their current values afterward.
10299 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
10300 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
10301 * tests/glr-regression.at: Remove `.' from the ends of recent test case
10302 titles for consistency.
10303 (Leaked merged semantic value if user action cuts parse): In order to
10304 suppress lint warnings, use arguments in merge function, and assign
10305 char value < 128 in main.
10306 (Incorrect lookahead during deterministic GLR): New test case.
10307 (Incorrect lookahead during nondeterministic GLR): New test case.
10308
103092006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10310
10311 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
10312 !yyvaluep as signal that no semantic value is available to print.
10313 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
10314 to print a semantic value.
10315
103162006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10317
10318 * tests/glr-regression.at: For consistency with my newer test cases,
10319 don't thank myself.
10320
103212006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
10322
10323 * data/glr.c (yyresolveValue): When merging semantic options, if at
10324 least one user action succeeds but a later one cuts the parse, then
10325 destroy the semantic value before returning rather than leaking it.
10326 (yyresolveStates): If a user action cuts the parse and thus
10327 yyresolveValue fails, ignore the (unset) semantic value rather than
10328 corrupting the yyGLRState, and empty the semantic options list since
10329 the user actions should have called all necessary destructors.
10330 Simplify code with YYCHK.
10331 * tests/glr-regression.at (Corrupted semantic options if user action
10332 cuts parse): New test case.
10333 (Undesirable destructors if user action cuts parse): New test case.
10334 Before applying any of this patch, this test case never actually failed
10335 for me... but only because the corrupted semantic options usually
10336 masked this bug.
10337 (Leaked merged semantic value if user action cuts parse): New test
10338 case.
10339
103402006-01-05 Akim Demaille <akim@epita.fr>
10341
10342 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
10343
103442006-01-04 Paul Eggert <eggert@cs.ucla.edu>
10345
10346 * data/c.m4 (b4_c_modern): New macro, with a new provision for
10347 _MSC_VER. Problem reported by Cenzato Marco.
10348 (b4_c_function_def): Use it.
10349 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
10350 b4_c_modern.
10351 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
10352 than rolling our own.
10353
103542006-01-04 Akim Demaille <akim@epita.fr>
10355
10356 Also warn about non-used mid-rule values.
10357 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
10358 member.
10359 (symbol_list_new): Adjust.
10360 * src/reader.c (symbol_typed_p): New.
10361 (grammar_rule_check): Use it.
10362 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
10363 Check its rule.
10364 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
10365 Use it.
10366 * tests/actions.at (Exotic Dollars): Adjust.
10367
103682006-01-04 Akim Demaille <akim@epita.fr>
10369
10370 * src/reader.c (grammar_midrule_action): If $$ is set in a
10371 mid-rule, move the `used' bit to its lhs.
10372 * tests/input.at (Unused values): New.
10373 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
10374
103752006-01-03 Paul Eggert <eggert@cs.ucla.edu>
10376
10377 * doc/bison.texinfo (Bison Options): Say more accurately what
10378 --yacc does.
10379 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
10380 about declarations in the grammar when in Yacc mode, as POSIX does
10381 not require a diagnostic when the grammar uses extensions.
10382
10383 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
10384
10385 Warn about dubious constructions like "%token T T".
10386 Reported by twlevo.
10387 * src/symtab.h (struct symbol.declared): New member.
10388 * src/symtab.c (symbol_new): Initialize it to false.
10389 (symbol_class_set): New arg DECLARING, specifying whether
10390 this is a declaration that we want to warn about, if there
10391 is more than one of them. All uses changed.
10392
10393 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
10394 Allow multiple %union directives, whose contents concatenate.
10395 * src/parse-gram.y (grammar_declaration): Likewise.
10396 Use muscle_code_grow, so that we don't need stype_line any more.
10397 All uses changed.
10398
10399 * src/muscle_tab.c (muscle_grow): Fix comment.
10400
10401 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
10402 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
10403 Update copyright year to 2006.
10404
104052006-01-03 Akim Demaille <akim@epita.fr>
10406
10407 Have glr.cc pass (some of) the calc.at tests.
10408 * data/glr.cc (b4_parse_param_orig): New.
10409 (b4_parse_param): Improve its definition, and bound it more
10410 clearly in the skeleton.
10411 (b4_epilogue): Append, instead of prepending, in order to keep
10412 #line consistency.
10413 Simplify the generation of auxiliary functions: locations and
10414 purity are mandated.
10415 (b4_global_tokens_and_yystype): Honor it.
10416 * data/location.cc (c++.m4): Don't include it.
10417 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
10418 and AT_SKEL_CC_IF.
10419 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
10420 AT_LALR1_CC_IF.
10421 Be sure to initialize the first position's filename.
10422 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
10423 mandated anyway.
10424 (AT_CHECK_CALC_GLR_CC): New.
10425 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
10426
104272006-01-02 Akim Demaille <akim@epita.fr>
10428
10429 * src/output.c (output_skeleton): Don't hard wire the inclusion of
10430 c.m4.
10431 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
10432 * data/glr.cc: Do not include stack.hh.
10433
104342006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
10435
10436 * data/glr.c: Reformat whitespace with tabs.
10437 (b4_lpure_formals): Remove this unused m4 macro.
10438 * tests/cxx-type.at: Reformat whitespace with tabs.
10439 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
10440 since it's a member. Rename type to isNterm for clarity.
10441
104422005-12-29 Akim <akim@sulaco.local>
10443
10444 Let glr.cc catch up with symbol_value_print.
10445 * data/glr.cc (b4_yysymprint_generate): Replace by...
10446 (b4_yy_symbol_print_generate): this.
10447 (yy_symbol_print, yy_symbol_value_print): Declare them.
10448
104492005-12-28 Paul Eggert <eggert@cs.ucla.edu>
10450
10451 * src/location.h (boundary): Note that a line or column equal
10452 to INT_MAX indicates an overflow.
10453 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
10454 (rule_length_overflow, increment_rule_length, add_column_width):
10455 New functions.
10456 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
10457 (<SC_BRACED_CODE>"}"):
10458 Use increment_rule_length rather than incrementing it by hand.
10459 (adjust_location, handle_syncline): Diagnose overflow.
10460 (handle_action_dollar, handle_action_at):
10461 Fix bug with monstrosities like $-2147483648.
10462 Remove now-unnecessary checks.
10463 (scan_integer): Verify assumptions and remove now-unnecessary checks.
10464 (convert_ucn_to_byte): Verify assumptions.
10465 (handle_syncline): New arg LOC. All callers changed.
10466 Don't store through a value derived from char const * pointer.
10467
10468 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
10469 GCC warnings.
10470
104712005-12-27 Paul Eggert <eggert@cs.ucla.edu>
10472
10473 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
10474 Remove unnecessary forward static decls.
10475
104762005-12-27 Akim Demaille <akim@epita.fr>
10477
10478 * src/reader.c (grammar_current_rule_check): Also check that $$
10479 is used.
10480 Take the rule to check as argument, hence rename as...
10481 (grammar_rule_check): this.
10482 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
10483 Rename as...
10484 (grammar_rule_begin, grammar_rule_end): these, for consistency.
10485 (grammar_midrule_action, grammar_symbol_append): Now static.
10486 * tests/torture.at (input): Don't rely on the default action
10487 being always performed.
10488 * tests/calc.at: "Set" $$ even when the action is "cut" with
10489 YYERROR or other.
10490 * tests/actions.at (Exotic Dollars): Instead of using unused
10491 values, check that the warning is issued.
10492
104932005-12-22 Paul Eggert <eggert@cs.ucla.edu>
10494
10495 * NEWS: Improve wording for unused-value warnings.
10496
104972005-12-22 Akim Demaille <akim@epita.fr>
10498
10499 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
10500 (b4_yysymprint_generate): Rename as...
10501 (b4_yy_symbol_print_generate): this.
10502 Generate yy_symbol_print instead of yysymprint.
10503 Generate also yy_symbol_value_print, and use it.
10504
105052005-12-22 Akim Demaille <akim@epita.fr>
10506
10507 * NEWS: Warn about unused values.
10508 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
10509 a `used' member.
10510 (symbol_list_n_get, symbol_list_n_used_set): New.
10511 (symbol_list_n_type_name_get): Use symbol_list_n_get.
10512 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
10513 * src/reader.c (grammar_current_rule_check): Check that values are
10514 used.
10515 * src/symtab.c (symbol_print): Accept 0.
10516 * tests/existing.at: Remove the type information.
10517 Empty the actions.
10518 Remove useless actions (beware of mid-rule actions: perl -000
10519 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
10520 * tests/actions.at (Exotic Dollars): Use unused values.
10521 * tests/calc.at: Likewise.
10522 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10523 Likewise.
10524
10525 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
10526 rule_useful_p.
10527
105282005-12-21 Paul Eggert <eggert@cs.ucla.edu>
10529
10530 Undo 2005-12-01 tentative license wording change. The wording is
10531 still being reviewed by the lawyers, and we don't want to wait for
10532 them before publishing a test release. For now, revert to the
10533 previous wording.
10534 * NEWS: Undo 2005-12-01 change.
10535 * data/glr.c: Revert to previous license wording.
10536 * data/glr.cc: Likewise.
10537 * data/lalr1.cc: Likewise.
10538 * data/location.cc: Likewise.
10539 * data/yacc.c: Likewise.
10540
10541 * NEWS: Reword %destructor vs YYABORT etc.
10542 * data/glr.c: Use American spacing, for consistency.
10543 * data/glr.cc: Likewise.
10544 * data/lalr1.cc: Likewise.
10545 * data/yacc.c: Likewise.
10546 * data/yacc.c: Reformat comments slightly.
10547 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
10548 for consistency. Fix some spelling errors and reword recently-included
10549 text slightly.
10550 * tests/cxx-type.at: Cast results of malloc, for C++.
10551
105522005-12-21 Joel E. Denny <address@hidden>
10553
10554 * tests/cxx-type.at: Construct a tree, count the parents of shared
10555 nodes, and free each node once and only once. Previously, the memory
10556 for semantic values was leaked instead.
10557
105582005-12-21 Joel E. Denny <address@hidden>
10559
10560 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
10561 (yylval, yylloc): If pure, #define to yystackp->yyval and
10562 yystackp->yyloc similar to yychar and yynerrs.
10563 (yyparse): If pure, remove local yylval and yylloc. Add local
10564 yystackp to accommodate pure definitions of yylval and yylloc.
10565 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
10566 yylvalp and yyllocp to &yylval and &yylloc.
10567 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
10568 namespace. Previously, nerrs and char were missing, but lval and lloc
10569 weren't necessary.
10570 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
10571 yylvalp and yyllocp parameters since, if pure, these are now always
10572 accessible through yystackp. If not pure, they are still accessible
10573 globally.
10574 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
10575 `if (YYID (N))' to pacify lint.
10576
105772005-12-21 Akim Demaille <akim@epita.fr>
10578
10579 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
10580 destroy the RHS symbols of a rule.
10581 * data/yacc.c (yylen): Initialize to 0.
10582 Keep its value to the number of items to possibly shift.
10583 In particular, a regular successful parse that ends on YYFINAL by
10584 a (internal) YYACCEPT must not have yylen != 0.
10585 (yyerrorlab, yyreturn): Pop the RHS.
10586 Reorder a bit to emphasize the `shifting' bits of code.
10587 (YYPOPSTACK): Now accept a number of items to pop.
10588 * data/lalr1.cc: Likewise.
10589 * data/glr.c: Formatting changes.
10590 Use goto instead of fall through.
10591 * doc/bison.texinfo (Destructor Decl): Complete.
10592
105932005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10594
10595 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10596 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
10597 * djgpp/config.bat: Replace every occurence of the file name
10598 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10599 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10600 * djgpp/config.sed: Replace every occurence of the file name
10601 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10602 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10603 * djgpp/djunpack.bat: DJGPP specific file.
10604 * djgpp/fnchange.lst: DJGPP specific file.
10605 * djgpp/README.in: Add new information about how to unpack the bison
10606 source on MSDOS and other systems which have 8.3 file name restrictions
10607 using djunpack.bat and fnchange.lst.
10608
106092005-12-12 Paul Eggert <eggert@cs.ucla.edu>
10610
10611 * bootstrap (build_cvs_prefix): Remove; unused.
10612 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
10613 when getting gnulib.
10614
106152005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
10616
10617 * data/glr.c: Reorder typedef declarations for structs to match order
10618 of struct declarations.
10619 Rename yystack everywhere to yystackp except in yyparse where it's not
10620 a pointer.
10621 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
10622 consistency.
10623 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
10624 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
10625 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
10626 lint.
10627
106282005-12-09 Paul Eggert <eggert@cs.ucla.edu>
10629
10630 * tests/sets.at (Accept): Fix typos in regular expression used to
10631 sed out the final state number.
10632
10633 Work around portability problem on Solaris 10: flex-generated
10634 files include <stdio.h> before <config.h>, which messes up
10635 because the latter defines __EXTENSIONS__. Address the problem
10636 by creating two new little files that include <config.h> first,
10637 then include the flex-generated files. Rewrite everyone else
10638 to include <config.h> first, as well.
10639 * lib/timevar.c: Always include "config.h".
10640 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
10641 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
10642 (EXTRA_bison_SOURCES): New macro.
10643 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
10644 * src/system.h: Don't include config.h.
10645 * src/LR0.c: Include <config.h> first.
10646 * src/assoc.c: Likewise.
10647 * src/closure.c: Likewise.
10648 * src/complain.c: Likewise.
10649 * src/conflicts.c: Likewise.
10650 * src/derives.c: Likewise.
10651 * src/files.c: Likewise.
10652 * src/getargs.c: Likewise.
10653 * src/gram.c: Likewise.
10654 * src/lalr.c: Likewise.
10655 * src/location.c: Likewise.
10656 * src/main.c: Likewise.
10657 * src/muscle_tab.c: Likewise.
10658 * src/nullable.c: Likewise.
10659 * src/output.c: Likewise.
10660 * src/parse-gram.y: Likewise.
10661 * src/print.c: Likewise.
10662 * src/print_graph.c: Likewise.
10663 * src/reader.c: Likewise.
10664 * src/reduce.c: Likewise.
10665 * src/relation.c: Likewise.
10666 * src/state.c: Likewise.
10667 * src/symlist.c: Likewise.
10668 * src/symtab.c: Likewise.
10669 * src/tables.c: Likewise.
10670 * src/uniqstr.c: Likewise.
10671 * src/vcg.c: Likewise.
10672
10673 * src/parse-gram.y: Fix minor problems uncovered by lint.
10674 (current_lhs, current_lhs_location): Now static.
10675 (current_assoc): Remove unused variable.
10676
10677 Cleanups so that Bison-generated parsers have less lint.
10678 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
10679 Prepend /*ARGSUSED*/, for lint's sake.
10680 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
10681 definition if 'lint' is defined.
10682 (YYID): New macro (or function, if lint).
10683 All uses of /*CONSTCOND*/0 replaced by YYID(0).
10684 * data/yacc.c: Likewise.
10685 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
10686 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
10687 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
10688 is C++ only.
10689 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
10690 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
10691 Use YYID(0) rather than 0, for lint.
10692 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
10693 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
10694
106952005-12-07 Paul Eggert <eggert@cs.ucla.edu>
10696
10697 * tests/glr-regression.at
10698 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10699 Close memory leak reported by twlevo.
10700
107012005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
10702
10703 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
10704 all stacks.
10705 (yyparse): Iterate another stack in order to call user destructors.
10706 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10707 New test case.
10708 (Duplicated user destructor for lookahead): This test now is expected
10709 to succeed.
10710
107112005-12-01 Paul Eggert <eggert@cs.ucla.edu>
10712
10713 * NEWS: Document the following change.
10714 * data/yacc.c: Say "parser skeleton" rather than "file", since
10715 it's no longer just a file.
10716 * data/glr.c: Grant a special exception for C GLR parsers, that
10717 reads like the already-existing exception for C LALR(1) parsers.
10718 * data/glr.cc: Likewise.
10719 * data/lalr1.cc: Likewise.
10720 * data/location.cc: Likewise.
10721 * data/yacc.c: Reword the "written by" statement to clarify that
10722 it was the parser skeleton, not the entire output file.
10723 * data/glr.c: Written by Paul Hilfinger.
10724 * data/glr.cc: Written by Akim Demaille.
10725 * data/lalr1.cc: Likewise.
10726
107272005-11-18 Paul Eggert <eggert@cs.ucla.edu>
10728
10729 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
10730 Fix typos in previous change that broke 'make check'.
10731 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
10732 supported in C.
10733 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
10734 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
10735 We can revert this once things settle down.
10736
10737 * src/conflicts.c (conflicts_print): Don't print file name twice
10738 when %expect fails because there were no conflicts.
10739 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
10740 change.
10741 * tests/conflicts.at (%expect not enough, %expect too much):
10742 (%expect with reduce conflicts): Adjust to new behavior.
10743
107442005-11-18 Akim Demaille <akim@epita.fr>
10745
10746 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
10747 errors.
10748 * NEWS: Document this.
10749 * doc/bison.texinfo (Expect Decl): Likewise.
10750
107512005-11-16 Akim Demaille <akim@epita.fr>
10752
10753 Generalize the display of semantic values and locations in traces.
10754 * data/glr.c (yy_reduce_print): Fix indices (again).
10755 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
10756 literal integers.
10757 * data/lalr1.cc (yyreduce_print): Rename as...
10758 (yy_reduce_print): this.
10759 Display values and locations.
10760 * data/yacc.c (yy_reduce_print): Likewise.
10761 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
10762 (yysymprint): Move higher to be visible from yy_reduce_print).
10763 (yyparse): Adjust.
10764 * tests/calc.at: Adjust the expected length of the traces.
10765
107662005-11-14 Akim Demaille <akim@epita.fr>
10767
10768 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
10769 from 1 to N, while values and location start at 0.
10770 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
10771
107722005-11-14 Akim Demaille <akim@epita.fr>
10773
10774 * data/glr.c (yy_reduce_print): Fix the $ number.
10775
107762005-11-14 Akim Demaille <akim@epita.fr>
10777
10778 "Use" parse parameters.
10779 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
10780 * data/glr.c, data/glr.cc: Use them.
10781 * data/glr.c (YYUSE): Have a C++ definition that supports
10782 non-pointer types.
10783
107842005-11-14 Akim Demaille <akim@epita.fr>
10785
10786 * data/glr.c (yyexpandGLRStack): Declare only if defined.
10787
107882005-11-14 Akim Demaille <akim@epita.fr>
10789
10790 * data/glr.cc: New.
10791 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
10792
107932005-11-12 Akim Demaille <akim@epita.fr>
10794
10795 Let position and location be PODs.
10796 * data/location.cc (position::initialize, location::initialize): New.
10797 (position::position, location::location): Define only if
10798 b4_location_constructors is defined.
10799 * data/lalr1.cc (b4_location_constructors): Define it for backward
10800 compatibility.
10801 * doc/bison.texinfo (Initial Action Decl): Use initialize.
10802
108032005-11-12 Akim Demaille <akim@epita.fr>
10804
10805 * data/lalr1.cc: Move the body of the ctor and dtor into the
10806 parser file (instead of the header).
10807 Wrap the implementations in a "namespace yy".
10808
108092005-11-12 Akim Demaille <akim@epita.fr>
10810
10811 Have glr.c include its header file when created.
10812 * data/glr.c (b4_shared_declarations): New.
10813 Output them verbatim in the parser if !%defines, otherwise
10814 output then in the header file, and include it instead.
10815
108162005-11-11 Akim Demaille <akim@epita.fr>
10817
10818 * data/glr.c: Comment changes.
10819
108202005-11-11 Akim Demaille <akim@epita.fr>
10821
10822 When yydebug, report semantic and location values for reductions.
10823 * data/glr.c (yy_reduce_print): Report the semantic values and the
10824 locations.
10825 (YY_REDUCE_PRINT): Adjust.
10826 (yyglrReduce): Use them.
10827 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
10828 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
10829 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
10830 traces.
10831
108322005-11-10 Akim Demaille <akim@epita.fr>
10833
10834 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
10835 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
10836 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
10837
108382005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
10839
10840 * m4/cxx.m4, examples/Makefile.am: Don't build
10841 examples/calc++ if no C++ compiler is available. (trivial change)
10842
108432005-11-09 Akim Demaille <akim@epita.fr>
10844
10845 * src/scan-skel.l: Use a couple of asserts.
10846
108472005-11-03 Akim Demaille <akim@epita.fr>
10848
10849 In some (weird) cases, the final state number is incorrect.
10850 Reported by Alexandre Duret-Lutz.
10851 * src/LR0.c (state_list_append): Remove the computation of
10852 final_state.
10853 (save_reductions): Do it here.
10854 (get_state): Alpha conversion.
10855 (generate_states): Use a for loop.
10856 * src/gram.h (item_number_is_rule_number)
10857 (item_number_is_symbol_number): New.
10858 * src/state.c: Use assert.
10859 * src/system.h: Include assert.h.
10860 * tests/sets.at (Accept): New.
10861
108622005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10863
10864 * data/glr.c (yyfill): Adjust comment.
10865 (yyresolveAction): Initialize default location properly
10866 for empty right-hand sides.
10867 (yydoAction): Ditto.
10868 Add comment explaining apparently dead code.
10869 * tests/glr-regression.at
10870 (Incorrectly initialized location for empty right-hand side in GLR):
10871 New test.
10872
108732005-10-30 Paul Eggert <eggert@cs.ucla.edu>
10874
10875 * bootstrap (cleanup_gnulib): New function. Use it to clean up
10876 gnulib when interrupted. This fixes some race conditions and
10877 works around some portability problems (one noted by Paul
10878 Hilfinger).
10879
108802005-10-22 Akim <akim@epita.fr>
10881
10882 * Makefile.cfg: Adjust to config -> build-aux.
10883 Reported by twledo.
10884
108852005-10-21 Akim Demaille <akim@epita.fr>
10886
10887 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
10888 the %parse-params.
10889 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
10890 * data/yacc.c (b4_Pure_if): Rename as...
10891 (b4_yacc_pure_if): this.
10892 (YY_SYMBOL_PRINT, yyparse): Adjust.
10893 * doc/bison.texinfo: Formatting changes.
10894
108952005-10-21 Akim Demaille <akim@epita.fr>
10896
10897 Finish the transition config -> build-aux.
10898 * configure.ac, Makefile.am: Use build-aux.
10899 * config/prev-version, config/announce-gen, config/Makefile.am:
10900 Move to...
10901 * build-aux/prev-version, build-aux/announce-gen,
10902 * build-aux/Makefile.am: here.
10903
109042005-10-14 Akim Demaille <akim@epita.fr>
10905
10906 * examples/calc++/test: Use set -x only when VERBOSE.
10907
109082005-10-13 Paul Eggert <eggert@cs.ucla.edu>
10909
10910 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
10911 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
10912
109132005-10-13 Akim Demaille <akim@epita.fr>
10914
10915 * src/scan-skel.l: Output the base name parts of the parser and
10916 header file names.
10917 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
10918 additional checks.
10919 Use this to exercise C++ outputs in subdirs.
10920 Reported by Oleg Smolsky.
10921
109222005-10-12 Paul Eggert <eggert@cs.ucla.edu>
10923
10924 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
10925 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
10926 Problem reported by John P. Hartmann.
10927 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
10928 already defined it.
10929
109302005-10-12 Akim Demaille <akim@epita.fr>
10931
10932 * src/parse-gram.y (version_check): Exit 63 to please missing
10933 (stands for "version mismatch).
10934 * tests/input.at, doc/bison.texinfo: Adjust.
10935
109362005-10-10 Paul Eggert <eggert@cs.ucla.edu>
10937
10938 Work around portability problems with Visual Age C compiler
10939 (xlc and xlC_r) reported by John P. Hartmann.
10940 * data/location.cc (initial_column, initial_line): Remove.
10941 All uses replaced by 0 and 1.
10942 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
10943 that xlc complains about.
10944 * src/scan-skel.l (skel_wrap): Likewise.
10945 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
10946 as __STDC__.
10947 * data/yacc.c (YYMODERN_C): New macro, which also looks at
10948 __STDC_VERSION__. Use it everywhere instead of looking at
10949 __STDC__ and __cplusplus.
10950
109512005-10-10 Akim Demaille <akim@epita.fr>
10952
10953 * examples/calc++/test: Be quiet unless VERBOSE.
10954
109552005-10-05 Paul Eggert <eggert@cs.ucla.edu>
10956
10957 * data/c.m4 (yydestruct, yysymprint):
10958 Use YYUSE instead of casting to void.
10959 * data/glr.c (YYUSE): New macro.
10960 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10961 Use it instead of rolling our own.
10962 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10963 (YYCHK1):
10964 Use /*CONSTCOND*/ to suppress lint warnings.
10965 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10966 (YY_STACK_PRINT): Use 'false' not '0'.
10967 (YYUSE): New macro.
10968 (yysymprint_, yydestruct_): Use it instead of rolling our own.
10969 * data/yacc.c (YYUSE): New macro.
10970 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
10971 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
10972 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
10973
10974
10975 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
10976 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
10977
109782005-10-04 Paul Eggert <eggert@cs.ucla.edu>
10979
10980 Undo the parts of the unlocked-I/O change that substituted
10981 putc or puts for printf. This might hurt performance a bit,
10982 but some people prefer the printf style.
10983 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
10984 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
10985 All uses replaced by YYFPRINTF and YYDPRINTF.
10986 * data/yacc.c: Likewise.
10987 * lib/bitset.c (bitset_print): Likewise.
10988 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
10989 putc and puts.
10990 * lib/lbitset.c (debug_lbitset): Likewise.
10991 * src/closure.c (print_firsts, print_fderives): Likewise.
10992 * src/gram.c (grammar_dump): Likewise.
10993 * src/lalr.c (look_ahead_tokens_print): Likewise.
10994 * src/output.c (escaped_output): Likewise.
10995 (user_actions_output): Break apart two printfs.
10996 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
10997 * src/reduce.c (reduce_print): Likewise.
10998 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10999 * src/system.h: Include unlocked-io.h rathe than stdio.h.
11000
11001 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11002 Use assignments rather than casts-to-void to suppress
11003 unused-variable warnings. This pacifies 'lint'.
11004 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
11005 unused-variable warnings.
11006
110072005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11008
11009 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11010
110112005-10-02 Paul Eggert <eggert@cs.ucla.edu>
11012
11013 Use unlocked I/O for a minor performance improvement on hosts like
11014 GNU/Linux and Solaris that support unlocked I/O. The basic idea
11015 is to use the gnlib unlocked-io module, and to prefer putc and
11016 puts to printf when either will work (since the latter doesn't
11017 come in an unlocked flavor).
11018 * bootstrap (gnulib_modules): Add unlocked-io.
11019 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
11020 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
11021 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
11022 and similarly for puts and putc and printf.
11023 * data/yacc.c: Likewise.
11024 * lib/bitset.c (bitset_print): Likewise.
11025 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
11026 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
11027 to printf.
11028 * lib/lbitset.c (debug_lbitset): Likewise.
11029 * src/closure.c (print_firsts, print_fderives): Likewise.
11030 * src/gram.c (grammar_dump): Likewise.
11031 * src/lalr.c (look_ahead_tokens_print): Likewise.
11032 * src/output.c (escaped_output): Likewise.
11033 (user_actions_output): Coalesce two printfs.
11034 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
11035 * src/reduce.c (reduce_print): Likewise.
11036 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
11037 * src/system.h: Include unlocked-io.h rather than stdio.h.
11038
11039 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
11040 this confuses xgettext.
11041
110422005-10-02 Akim Demaille <akim@epita.fr>
11043
11044 * bootstrap (gnulib_modules): Add strverscmp.
11045 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
11046 * m4/.cvsignore: Add strverscmp.m4.
11047 * src/parse-gram.y (%require): New token, new rule.
11048 (version_check): New.
11049 * src/scan-gram.l (%require): Adjust.
11050 * tests/input.at (AT_REQUIRE): New.
11051 Use it.
11052 * doc/bison.texinfo (Require Decl): New.
11053 (Calc++ Parser): Use %require.
11054
110552005-10-02 Akim Demaille <akim@epita.fr>
11056
11057 * data/location.cc: New.
11058
110592005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
11060 Akim Demaille <akim@epita.fr>
11061
11062 Make sure -odir/foo.cc creates dir/location.hh etc.
11063 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
11064 (spec_file_prefix, spec_verbose_file, spec_graph_file)
11065 (spec_defines_file): Now const.
11066 (dir_prefix): New.
11067 (short_base_name): Remove.
11068 * src/files.c: Adjust.
11069 (dirname.h): Include.
11070 (base_name): Don't prototype it.
11071 (finput): Remove, duplicates gram_in.
11072 (full_base_name, short_base_name): Replace by...
11073 (all_but_ext, all_but_tab_ext): these.
11074 (compute_base_names): Rename as...
11075 (compute_file_name_parts): this.
11076 Update to compute the new variables, including dir_prefix.
11077 Adjust dependencies.
11078 * src/output.c (prepare): Output them.
11079 * src/reader.c: Adjust to use gram_in, not finput.
11080 * src/scan-skel.l (@dir_prefix@): New.
11081
110822005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11083
11084 * lib/subpipe.c: New function end_of_output_subpipe() added
11085 to allow support for non-posix systems. This is a no-op function
11086 for posix systems.
11087
11088 * lib/subpipe.h: New function end_of_output_subpipe() added
11089 to allow support for non-posix systems. This is a no-op function
11090 for posix systems.
11091
11092 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
11093 handle the lack of pipe/fork functionality on non-posix systems.
11094
11095 * djgpp/Makefile.maint: DJGPP specific file.
11096
11097 * djgpp/README.in: DJGPP specific file.
11098
11099 * djgpp/config.bat: DJGPP specific configuration file.
11100
11101 * djgpp/config.sed: DJGPP specific configuration file.
11102
11103 * djgpp/config.site: DJGPP specific configuration file.
11104
11105 * djgpp/config_h.sed: DJGPP specific configuration file.
11106
11107 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
11108
11109 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
11110
111112005-10-02 Akim Demaille <akim@epita.fr>
11112
11113 * data/location.cc: New, extract from...
11114 * data/lalr1.cc: here.
11115 (location.hh): Include it after the user prologue, in case the
11116 filename type is defined by the user.
11117 Forward declation location and position before the pre-prologue.
11118 (yyresult_): Rename as...
11119 (yyresult): this, it's a local variable, not an attribute.
11120 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
11121
111222005-10-01 Akim Demaille <akim@epita.fr>
11123
11124 * examples/extexi: Restore the #line generation.
11125
111262005-09-30 Akim Demaille <akim@epita.fr>,
11127 Alexandre Duret-Lutz <adl@gnu.org>
11128
11129 Move the token type and YYSTYPE in the parser class.
11130 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
11131 (parser::token): New, from the moved free definition of tokens.
11132 (parser::semantic_value): Now a full definition instead of an
11133 indirection to YYSTYPE.
11134 (b4_post_prologue): No longer included in the header file, but
11135 in the implementation file.
11136 * doc/bison.texi (C+ Language Interface): Update.
11137 * src/parse-gram.y: Support unary %define.
11138 * tests/actions.at: Define global_tokens_and_yystype for backward
11139 compatibility until we update the tests.
11140 * tests/calc.at: Idem.
11141 (first_line, first_column, last_line, last_column): Define for lalr1.cc
11142 to simplify the code.
11143
111442005-09-29 Paul Eggert <eggert@cs.ucla.edu>
11145
11146 Port to SunOS 4.1.4, which lacks strtoul and strerror.
11147 Ah, the good old days! Problem reported by Peter Klein.
11148 * bootstrap (gnulib_modules): Add strerror, strtoul.
11149 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
11150 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
11151
111522005-09-29 Akim Demaille <akim@epita.fr>
11153
11154 * data/c.m4 (b4_error_verbose_if): New.
11155 * data/lalr1.cc: Use it.
11156 (YYERROR_VERBOSE_IF): Remove.
11157 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
11158 parser members, replaced by...
11159 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
11160 local variables.
11161 (yysyntax_error_): Takes the state number as argument.
11162 (yyreduce_print_): Use the argument yyrule, not the former
11163 attribute yyn_.
11164
111652005-09-26 Paul Eggert <eggert@cs.ucla.edu>
11166
11167 * bootstrap (gnulib_modules): Add verify.
11168 * lib/.cvsignore: Add verify.h.
11169 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
11170 * src/system.h (verify): Remove.
11171 Include verify.h instead.
11172 * src/tables.c (tables_generate): Use new API for 'verify'.
11173
111742005-09-21 Paul Eggert <eggert@cs.ucla.edu>
11175
11176 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
11177 local variables whose names begin with 'yy'.
11178 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11179 Trivial changes from Joel E. Denny.
11180
11181 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
11182 it itself.
11183 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
11184 don't use alloca any more.
11185
11186 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
11187 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
11188 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
11189 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
11190 to match yacc.c, to test more hosts.
11191
111922005-09-20 Paul Eggert <eggert@cs.ucla.edu>
11193
11194 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
11195 doesn't affect behavior.
11196 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
11197 Solaris, AIX, MSC.
11198 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
11199 This works a bit better with glibc, if user code has already included
11200 stdlib.h.
11201 * doc/bison.texinfo (Bison Parser): Document that users can't
11202 arbitrarily use malloc and free for other purposes. Document
11203 that <alloca.h> and <malloc.h> might be included.
11204 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
11205 user must declare alloca.
11206
11207 * HACKING (release): Forwarn the Translation Project about
11208 stable releses.
11209
112102005-09-20 Akim Demaille <akim@epita.fr>
11211
11212 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
11213
112142005-09-19 Paul Eggert <eggert@cs.ucla.edu>
11215
11216 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
11217 (YYSTACK_ALLOC_MAXIMUM): Use it.
11218 (yysyntax_error): New function.
11219 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
11220 multiple syntax errors are reported, and alloca is being used.
11221 Instead, reallocate buffers twice as big each time, so that
11222 we waste at most half the allocated memory. Start with a small
11223 (128-byte) buffer that will suffice in most cases anyway.
11224 Use yysyntax_error to do most of the work.
11225
11226 * doc/bison.texinfo (Error Reporting, Table of Symbols):
11227 yynerrs is the number of errors reported, not the number of
11228 errors encountered.
11229
11230 * tests/glr-regression.at (Duplicated user destructor for lookahead):
11231 Mark it as expected to fail.
11232 Cast result of malloc; problem reported by twlevo@xs4all.nl.
11233 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
11234 Don't start user-code symbols with "yy", to avoid name space problems.
11235
112362005-09-19 Akim Demaille <akim@epita.fr>
11237
11238 Remove the traits, failed experiment.
11239 It never proved useful, and anyway because of the current
11240 definition, it was not possible to have several specialization of
11241 this traits, making it useless.
11242 * data/lalr1.cc (yy:traits): Remove.
11243 Inline its definitions in the parser class.
11244
112452005-09-19 Akim Demaille <akim@epita.fr>
11246
11247 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
11248 least Mac OSX with a /usr/local install of gettext.
11249
112502005-09-19 Akim Demaille <akim@epita.fr>
11251
11252 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
11253 and yytoken for similarity with the other skeletons.
11254
112552005-09-19 Akim Demaille <akim@epita.fr>
11256
11257 * NEWS, configure.ac: update version number to 2.1a.
11258
112592005-09-16 Paul Eggert <eggert@cs.ucla.edu>
11260
11261 * NEWS: Version 2.1.
11262
11263 * NEWS: Remove notice of yytname change, since it was never in an
11264 official release.
11265 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
11266 diagnostic.
11267 * src/output.c (prepare): Likewise.
11268 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
11269 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
11270 is not defined. This is an awful hack, but it's enough for now.
11271 All callers changed.
11272 * tests/glr-regression-at (make_value): Args are const pointers now,
11273 to avoid GCC warning.
11274 (Duplicated user destructor for lookahead): New test. Currently
11275 skipped. It fails on my host but I'm not sure it'll always fail.
11276
112772005-09-16 Akim Demaille <akim@epita.fr>
11278
11279 * src/symtab.h (struct symbol): Declare the printer and destructor
11280 as const, to avoid accidental calls to free.
11281 (symbol_destructor_set, symbol_printer_set): Adjust.
11282 * src/symtab.c: Adjust.
11283
112842005-09-16 Akim Demaille <akim@epita.fr>
11285
11286 * data/c.m4 (b4_token_enums): New.
11287 (b4_token_defines): Rename as...
11288 (b4_token_enums_defines): this.
11289 (b4_token_defines): New, output only the #defines.
11290 * data/yacc.c, data/glr.c: Adjust.
11291 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
11292 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
11293 as default values.
11294
112952005-09-16 Akim Demaille <akim@epita.fr>
11296
11297 * data/lalr1.cc (yylex_): Remove, inline its code.
11298 (yyreport_syntax_error_): Remove, replaced by...
11299 (yysyntax_error_): this which returns a string and leaves to the
11300 caller the call to the users' error function.
11301 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
11302 Move from members of the parser object...
11303 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
11304 to local variables of the parse function.
11305
113062005-09-16 Akim Demaille <akim@epita.fr>
11307
11308 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
11309 since it's in Bison's name space.
11310
113112005-09-15 Paul Eggert <eggert@cs.ucla.edu>
11312
11313 * data/glr.c (yyresolveValue): Add default case to pacify
11314 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
11315
11316 * NEWS: Document when yyparse started to return 2.
11317 * doc/bison.texinfo (Parser Function): Document when yyparse
11318 returns 2.
11319
11320 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
11321 (b4_filename_type): Renamed back from b4_file_name_type. All uses
11322 changed.
11323 (class position): file_name -> filename (reverting). All uses changed.
11324
113252005-09-14 Paul Eggert <eggert@cs.ucla.edu>
11326
11327 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
11328 do anything if $@ exists. This reverts part of the 2005-07-07
11329 patch.
11330
113312005-09-11 Paul Eggert <eggert@cs.ucla.edu>
11332
11333 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
11334 contains obsolete information and isn't worth distributing as a
11335 separate file anyway.
11336 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
11337 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
11338 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
11339 (yyparse): Abort if user code uses longjmp to throw an unexpected
11340 value.
11341
113422005-09-09 Paul Eggert <eggert@cs.ucla.edu>
11343
11344 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
11345 Suggested by twlevo@xs4all.nl.
11346
11347 * data/glr.c (YYCHK1): Do not assume YYE is in range.
11348 This avoids a diagnostic from gcc -Wswitch-enum.
11349 Problem reported by twlevo@xs4all.nl.
11350
11351 * doc/bison.texinfo: Don't use "filename", as per GNU coding
11352 standards. Use "file name" or "file" or "name", depending on
11353 the context.
11354 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
11355 not to hack/foo.tab.c.
11356 (Calc++ Top Level): 2nd arg of main is not const.
11357 * data/glr.c: b4_filename -> b4_file_name.
11358 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
11359 All uses changed.
11360 (class position): filename -> file_name. All uses changed.
11361 * data/yacc.c: b4_filename -> b4_file_name.
11362 * lib/bitset.h: filename -> file_name in local vars.
11363 * lib/bitset_stats.c: Likewise.
11364 * src/files.c: Likewise.
11365 * src/scan-skel.l ("@output ".*\n): Likewise.
11366 * src/files.c (file_name_split): Renamed from filename_split.
11367 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
11368
113692005-09-08 Paul Eggert <eggert@cs.ucla.edu>
11370
11371 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
11372 to accommodate latest gnulib.
11373
11374 * tests/glr-regression.at (Duplicate representation of merged trees):
11375 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
11376
11377 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
11378 needed.
11379
113802005-08-26 Paul Eggert <eggert@cs.ucla.edu>
11381
11382 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
11383 All uses changed. Invoke user destructor after an error during a
11384 split parse (trivial change from Joel E. Denny).
11385
11386 * tests/glr-regression.at
11387 (User destructor after an error during a split parse): New test case.
11388 Problem reported by Joel E. Denny in:
11389 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
11390
113912005-08-25 Paul Eggert <eggert@cs.ucla.edu>
11392
11393 * README-cvs: Give URLs for recommended tools.
11394 Mention Gzip version problem, and bootstrapping issues.
11395 Remove troubleshooting section, as it's somewhat obsolete.
11396
11397 * bootstrap (no_cache): New var, to accommodate different wget
11398 variants. Use it instead of '-C off'. Problem reported by
11399 twlevo@xs4all.nl.
11400
11401 * data/glr.c (yydestroyStackItem): New function.
11402 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
11403 debugging information. Problem reported by Joel E. Denny.
11404
114052005-08-25 Akim Demaille <akim@epita.fr>
11406
11407 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
11408
114092005-08-24 Paul Eggert <eggert@cs.ucla.edu>
11410
11411 * data/glr.c (yyrecoverSyntaxError, yyreturn):
11412 Don't invoke destructor on unresolved entries.
11413 * tests/glr-regression.at
11414 (User destructor for unresolved GLR semantic value): New test case.
11415 Problem reported by Joel E. Denny in:
11416 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
11417
114182005-08-21 Paul Eggert <eggert@cs.ucla.edu>
11419
11420 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
11421 Add strnlen.c.
11422 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
11423 lib-prefix.m4, po.m4.
11424
11425 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
11426 in yydestruct diagnostic, since it might not be an error.
11427 Problem reported by Joel Denny near end of
11428 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11429 * data/lalr1.cc (yyerturn): Likewise.
11430 * data/yacc.c (yyreturn): Likewise.
11431 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
11432
11433 * src/files.c: Remove obsolete FIXME comment.
11434
11435 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
11436 with the other templates, and to fix bogus run-on messages such
11437 as the one reported at the end of
11438 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11439 All callers changed to avoid the newline.
11440 (yyprocessOneStack): Output two lines rather than one, to accommodate
11441 the above change. This changes the debug output format slightly.
11442
11443 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
11444 reported by Joel E. Denny in
11445 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
11446 (trivial change).
11447 * tests/glr-regression.at (Duplicate representation of merged trees):
11448 New test, from Joel E. Denny in:
11449 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
11450 * THANKS: Add Joel E. Denny.
11451
11452 * configure.ac (AC_INIT): Bump to 2.0c.
11453
114542005-07-24 Paul Eggert <eggert@cs.ucla.edu>
11455
11456 * NEWS: Version 2.0b.
11457
11458 * Makefile.am (SUBDIRS): Put examples before tests, so that
11459 "make check" doesn't finish with "All 1 tests passed".
11460
11461 * tests/regression.at (Token definitions): Don't rely on
11462 AT_PARSER_CHECK for data that contains backslashes. It currently
11463 uses 'echo', and 'echo' isn't portable if its argument contains
11464 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
11465 that the byte '\0xff' is not printable in the C locale; it is,
11466 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
11467 not printable, so use '\0x81' to test.
11468
11469 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
11470 version of GCC, since the macro is used with non-GCC compilers.
11471
11472 Fix core dump reported by Pablo De Napoli in
11473 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
11474 * tests/regression.at (Invalid inputs with {}): New test.
11475 * src/parse-gram.y (token_name): Translate type before using
11476 it as an index.
11477
11478 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
11479 the user's name space. All uses changed to __attribute__
11480 ((__unused__)).
11481 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
11482 Add __attribute__ ((__noreturn__)).
11483
11484 * etc/clcommit: Remove. We weren't using it, and it failed
11485 "make maintainer-distcheck".
11486 * Makefile.maint: Merge from coreutils.
11487 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
11488 (syntax-check-rules): Change list of rules as described below.
11489 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
11490 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
11491 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
11492 (sc_trailing_space): New rules.
11493 (sc_xalloc_h_in_src): Remove.
11494 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
11495 (sc_space_tab, sc_error_exit_success, sc_changelog):
11496 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
11497 (makefile-check, po-check, author_mark_check):
11498 (makefile_path_separator_check, copyright-check):
11499 Use grep -n, to make it easier to find violations.
11500 Use CVS_LIST and CVS_LIST_EXCEPT.
11501 (header_regexp, h_re): Remove.
11502 (dd_c): New macro.
11503 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
11504 (my-distcheck): Use more-modern GCC flags.
11505 (signatures, %.asc): Remove.
11506 (rel-files, announcement): Remove signatures.
11507 Restore old updating code, even though we don't use it, so
11508 that we're the same as coreutils.
11509 (alpha, beta, major): Depend on news-date-check.
11510 Make the upload commands.
11511
11512 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
11513 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
11514 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
11515 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
11516 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
11517 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
11518 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
11519 * tests/sets.at: Likewise.
11520
11521 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
11522 we comment out the Autoconf version number.
11523 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
11524 it's error-prone and "make maintainer-distcheck" rejects it.
11525
11526 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
11527 Indent calls to "error" to pacify "make maintainer-distcheck",
11528 when the calls are not intended to be translated.
11529 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
11530
11531 * src/Makefile.am (DEFS): Use +=, to pacify
11532 "make maintainer-distcheck".
11533 (bison_SOURCES): Add scan-skel.h.
11534 (sc_tight_scope): New rule, from coreutils.
11535
11536 * src/files.c (src_extension, header_extension):
11537 Now static, not extern.
11538 * src/getargs.c (short_options): Likewise.
11539 * src/muscle_tab.c (muscle_table): Likewise.
11540 * src/parse-gram.y (current_class, current_type, current_prec):
11541 Likewise.
11542 * src/reader.c (grammar_end, previous_rule_end): Likewise.
11543 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
11544 * src/main.c (main): Cast bindtextdomain and textdomain calls to
11545 void, to avoid warning when NLS is disabled.
11546 * src/output.c: Include scan-skel.h.
11547 (scan_skel): Remove decl, since scan-skel.h does this.
11548 (output_skeleton):
11549 Indent calls to "error" to pacify "make maintainer-distcheck".
11550 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
11551 * src/reader.h (gram_end, gram_lineno): New decls to pacify
11552 "make maintainer-distcheck".
11553 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
11554 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
11555 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
11556 (skel_lex_destroy, scan_skel): Move these decls to...
11557 * src/scan-skel.h: New file.
11558 * src/uniqstr.c (uniqstr_assert):
11559 Indent calls to "error" to pacify "make maintainer-distcheck".
11560
11561 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
11562 not @VAR@.
11563
11564 * tests/torture.at: Revamp to avoid misuse of atoi that
11565 "make maintainer-distcheck" complained about.
11566
11567 * examples/extexi (message): Don't print a message more than once,
11568 and omit line-number decoration that makes Emacs compile think
11569 that informative messages are worth worrying about.
11570
115712005-07-22 Paul Eggert <eggert@cs.ucla.edu>
11572
11573 * configure.ac: Update version number.
11574
11575 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
11576 accidentally.
11577 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
11578 autogenerated by the maintainer.
11579 * examples/calc++/.cvsignore: Add *.yy.
11580
11581 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
11582 * lib/bitset_stats.c (bitset_stats_init): Likewise.
11583 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11584
11585 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
11586
11587 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
11588 from maintainer-distcheck about casting the argument of 'free'.
11589
11590 * NEWS: Mention recent yytname changes.
11591 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
11592
11593 * bootstrap: For translations that have not yet been upgraded to
11594 the new runtime-po domain, prime the pump by extracting the
11595 relevant strings from the obsolete translations. This code can be
11596 removed once the bison-runtime domain has been translated by each
11597 team.
11598
11599 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
11600 now that token names are already quoted.
11601
11602 Fix problem reported by Anthony Heading.
11603 * data/glr.c (YYTOKEN_TABLE): New macro.
11604 (yytname): Define if YYTOKEN_TABLE.
11605 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
11606 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
11607 (YYERROR_VERBOSE): Define the same way the other skeletons do.
11608 * src/output.c (prepare_symbols): Output token_table_flag.
11609
116102005-07-21 Paul Eggert <eggert@cs.ucla.edu>
11611
11612 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
11613 again if the first call fails.
11614
11615 * data/glr.c (yytnamerr): New function.
11616 (yyreportSyntaxError): Use it to dequote most string literals.
11617 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
11618 with other skeletons. All uses changed.
11619 (yytnameerr_): New function.
11620 (yyreport_syntax_error): Use it to dequote most string literals.
11621 * data/yacc.c (yytnamerr): New function.
11622 (yyerrlab): Use it to decode most string literals.
11623 * doc/bison.texinfo (Decl Summary, Calling Convention):
11624 Clarify quoting convention of yytname.
11625 * src/output.c (prepare_symbols): Quote all names. This undoes
11626 the 2005-04-17 change, which is now accomplished (mostly) via
11627 changes in the parsers as described above.
11628 * tests/regression.at (Token definitions, Web2c Actions):
11629 Undo most 2005-04-17 change here, too.
11630
116312005-07-20 Paul Eggert <eggert@cs.ucla.edu>
11632
11633 Fix more problems reported by twlevo@xs4all.nl.
11634 * tests/cxx-type.at: Don't pipe output of ./types through sed to
11635 remove trailing spaces. This loses the exit status of ./types,
11636 and isn't needed since ./types shouldn't be emitting trailing
11637 spaces.
11638 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
11639 as the stack isn't valid in that case.
11640
11641 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
11642 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
11643 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
11644 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
11645 is used.
11646 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
11647 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
11648 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
11649 Likewise.
11650
11651 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
11652 overly-picky compilers that reject 'char *foo = "bar";'.
11653
11654 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
11655 to FILE * parameter, not to stderr. This fixes a typo introduced
11656 in the 2005-07-12 change.
11657
11658 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
11659 warnings from GCC 4.
11660
11661 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
11662 (yyglrShiftDefer, yysplitStack):
11663 Remove unused parameters b4_pure_formals. All uses changed.
11664 (yyglrShift): Remove unused parameters b4_user_formals.
11665 All uses changed.
11666 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
11667
116682005-07-18 Paul Eggert <eggert@cs.ucla.edu>
11669
11670 Destructor cleanups and regularization among the three skeletons.
11671 * NEWS: Document the behavior changes.
11672 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
11673 stack before failing, as the cleanup code will do it for us now.
11674 * data/lalr1.cc (yyerrlab): Likewise.
11675 * data/glr.c (yyparse): Pop everything off the stack before
11676 freeing it, so that destructors get called properly.
11677 * data/lalr1.cc (yyreturn): Likewise.
11678 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
11679 This is more consistent.
11680 * doc/bison.texinfo (Destructor Decl): Mention more reasons
11681 why destructors might be called. 1.875 -> 2.1.
11682 (Destructor Decl, Decl Summary, Table of Symbols):
11683 Some English-language cleanups for %destructor.
11684 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11685 Add output line for destructor of start symbol.
11686 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
11687 because of that same extra output line.
11688
11689 * NEWS: Document minor wording changes in diagnostics of
11690 Bison-generated parsers.
11691 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
11692 Remove unused formals. All uses changed.
11693 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
11694 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
11695 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
11696 Rename yyoverflowab to yyexhaustedlab.
11697 When memory exhaustion occurs during syntax-error reporting,
11698 report it separately rather than in a single diagnostic; this
11699 eases translation.
11700 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
11701 (Memory Exhausted): Renamed from Parser Stack Overflow.
11702 Revamp wording slightly to prefer "memory exhaustion".
11703 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
11704
11705 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
11706
11707 Add i18n support to the GLR skeleton. Partially fix the C++
11708 skeleton; a C++ expert needs to finish this. Remove debugging
11709 msgids; there's little point to having them translated, since they
11710 can be understood only by someone who can read the
11711 (English-language) source code.
11712
11713 Generate runtime-po/bison-runtime.pot automatically, so that we
11714 don't have to worry about garbage getting in that file. We'll
11715 make sure after the next official release that old msgids don't
11716 get lost. See
11717 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
11718
11719 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
11720 Now auto-generated.
11721 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
11722 Fix typos in explanations of the runtime file.
11723 * bootstrap: Change gettext keyword from YYI18N to YY_.
11724 Use standard Makefile.in.in in runtime-po, since we'll arrange
11725 for backward-compatible bison-runtime.po files in a different way.
11726 * data/glr.c (YY_): New macro, from yacc.c.
11727 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
11728 Translate messages intended for users.
11729 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
11730 the wording in the other skeletons. We don't know that the memory
11731 is virtual.
11732 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
11733 Use same method that yacc.c uses.
11734 Don't translate debugging messages.
11735 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
11736 it doesn't work (yet), and requires C++ expertise to fix.
11737 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
11738 Move defn to a more logical place, to be consistent with other
11739 skeletons.
11740 Don't translate debugging messages.
11741 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
11742 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
11743 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
11744 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
11745
11746 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
11747 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
11748 void, not int.
11749 * tests/glr-regression.at (Badly Collapsed GLR States):
11750 Likewise.
11751 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11752 yylex should return 0 at EOF rather than aborting.
11753
11754 Improve tests for stack overflow in GLR parser.
11755 Problem reported by twlevo@xs4all.nl.
11756 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
11757 All uses removed.
11758 (yyStackOverflow): Just longjmp, but with value 2 so that caller
11759 can handle the problem.
11760 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
11761 (yyparse): New local variable yyresult to record the result.
11762 Use result of setjmp to set it, rather than storing itinto
11763 struct.
11764 (yyDone): Remove label.
11765 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
11766 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
11767 if YYABORT is used).
11768 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
11769 yyparse status; put status > 1 into diagnostic.
11770 Check that status==2 works.
11771 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
11772 Use exit status 3 for failure to open (which shouldn't happen).
11773
117742005-07-17 Paul Eggert <eggert@cs.ucla.edu>
11775
11776 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
11777 1 on syntax error; just let yyparse do its thing.
11778 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
11779 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
11780 (Exploding the Stack Size with Alloca):
11781 (Exploding the Stack Size with Malloc):
11782 Expect exit status 2, not 1, since the parser is supposed to blow
11783 its stack. Problem reported by twlevo@xs4all.nl.
11784
11785 * data/glr.c (yyparse): Don't assume that the initial calls
11786 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
11787 Print a stack-overflow message and fail instead.
11788 Initialize the line-number information before creating the stack,
11789 so that the stack-overflow message can report line zero safely.
11790
117912005-07-14 Paul Eggert <eggert@cs.ucla.edu>
11792
11793 Fix problems reported by twlevo@xs4all.nl.
11794 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
11795 (yyuserMerge): Provide a default case if b4_mergers is empty.
11796 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
11797 * tests/glr-regression.at
11798 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11799 Add casts to pacify C++ compilers.
11800 * tests/glr-regression.at (Improper merging of GLR delayed action
11801 sets): Declare yylex before using it.
11802 * tests/Makefile.am (maintainer-check-g++): Fix a stray
11803 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
11804 test for valgrind; valgrind is independent of g++.
11805 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
11806 for compatibility with POSIX 1003.1-2001 (if running coreutils).
11807 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
11808 Use a destructor, so that we can expand the stack. Change
11809 YYSTYPE to char * so that we can free it. Cast result of malloc.
11810
118112005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11812
11813 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
11814 a valgrind failure. Problem reported by twlevo@xs4all.nl.
11815
118162005-07-13 Paul Eggert <eggert@cs.ucla.edu>
11817
11818 * PACKAGING: New file, suggested by Bruno Haible and taken from
11819 similar wording in gettext's PACKAGING file.
11820 * NEWS: Mention PACKAGING.
11821 * Makefile.am (EXTRA_DIST): Add PACKAGING.
11822
118232005-07-12 Paul Eggert <eggert@cs.ucla.edu>
11824
11825 * NEWS: Document recent i18n improvements.
11826 * bootstrap: Get runtime translations into runtime-po.
11827 Create runtime-po files automatically, if possible.
11828 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
11829 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
11830 does not infringe on the user's name space.
11831 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
11832 * doc/bison.texinfo (Internationalization): Revamp the English
11833 and Texinfo syntax a bit, to try to make it clearer.
11834 (Bison Options, Option Cross Key): Mention --print-localedir.
11835 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
11836 YYENABLE_NLS. Quote a bit more.
11837 * runtime-po/.cvsignore: New file.
11838 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
11839 * runtime-po/Rules-quot: Remove; now created by bootstrap.
11840 * runtime-po/quot.sed: Likewise.
11841 * runtime-po/boldquot.sed: Likewise.
11842 * runtime-po/en@quot.header: Likewise.
11843 * runtime-po/en@boldquot.header: Likewise.
11844 * runtime-po/insert-header.sin: Likewise.
11845 * runtime-po/remove-potcdate.sin: Likewise.
11846 * runtime-po/Makevars: Likewise.
11847 * runtime-po/LINGUAS: Likewise.
11848 * runtime-po/de.po: Likewise; we will rely on the translation project
11849 to maintain this, so "bootstrap" should get it.
11850 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
11851 its value.
11852 * src/main.c (main): Bind the bison-runtime domain, too.
11853
118542005-07-12 Bruno Haible <bruno@clisp.org>
11855
11856 * data/yacc.c: Include <libintl.h> when NLS is enabled.
11857 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
11858 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
11859 * runtime-po: New directory.
11860 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
11861 $(DOMAIN).pot-update rule, so that old messages are never dropped.
11862 * runtime-po/Rules-quot: New file, copied from po/.
11863 * runtime-po/quot.sed: Likewise.
11864 * runtime-po/boldquot.sed: Likewise.
11865 * runtime-po/en@quot.header: Likewise.
11866 * runtime-po/en@boldquot.header: Likewise.
11867 * runtime-po/insert-header.sin: Likewise.
11868 * runtime-po/remove-potcdate.sin: Likewise.
11869 * runtime-po/Makevars: New file.
11870 * runtime-po/POTFILES.in: New file.
11871 * runtime-po/LINGUAS: New file.
11872 * runtime-po/bison-runtime.pot: New file.
11873 * runtime-po/de.po: New file.
11874 * m4/bison.m4: New file.
11875 * Makefile.am (SUBDIRS): Add runtime-po.
11876 (aclocaldir, aclocal_DATA): New variables.
11877 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
11878 Define aclocaldir.
11879 * src/getargs.c (usage): Document --print-localedir option.
11880 (PRINT_LOCALEDIR_OPTION): New enum item.
11881 (long_options): Add --print-localedir option.
11882 (getargs): Handle --print-localedir option.
11883 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
11884 (Internationalization): New section.
11885
118862005-07-12 Akim Demaille <akim@epita.fr>
11887
11888 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
11889 for consistency with the rest of the code.
11890 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
11891 Add separators.
11892
118932005-07-12 Akim Demaille <akim@epita.fr>
11894
11895 * src/parse-gram.y: Use %printer instead of YYPRINT.
11896
118972005-07-12 Akim Demaille <akim@epita.fr>
11898
11899 * src/symtab.h, src/symtab.c (symbol_print): New.
11900 * src/symlist.h, src/symlist.c (symbol_list_print): New.
11901 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
11902
119032005-07-12 Akim Demaille <akim@epita.fr>
11904
11905 * data/glr.c (b4_syncline): Fix (swap) the definitions of
11906 b4_at_dollar and b4_dollar_dollar.
11907
119082005-07-11 Paul Eggert <eggert@cs.ucla.edu>
11909
11910 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
11911 and Pennello's paper.
11912
119132005-07-09 Paul Eggert <eggert@cs.ucla.edu>
11914
11915 * data/yacc.c (yyparse): Undo previous patch. Instead,
11916 set yylsp[0] and yyvsp[0] only if the initial action
11917 sets yylloc and yylval, respectively.
11918
11919 * data/yacc.c (yyparse): In the initial action, set
11920 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
11921 This avoids the use of undefined variables if the initial
11922 action does not set yylloc and/or yylval.
11923
119242005-07-07 Paul Eggert <eggert@cs.ucla.edu>
11925
11926 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
11927 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
11928 Remove from CVS. These files are automatically generated.
11929 * examples/extexi: Clarify that this file is now part of Bison,
11930 not GNU M4, and that it works with any POSIX-compatible Awk.
11931 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
11932 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
11933 so that we also get calc++-parser.yy. Geneate it.
11934 Use $(AWK), not gawk, since any conforming Awk will do.
11935 Put comment before action, since older 'make' can't handle comment
11936 in action.
11937 $(BUILT_SOURCES): List all built sources, not just some of them.
11938 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
11939 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
11940 $($(calc_sources_generated)): Remove unnecessary test for existence
11941 of target. (This had a shell syntax error anyway; a stray "x".)
11942 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
11943 calc++-parser.yy.
11944 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
11945
11946 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
11947 implied by the other modules.
11948
119492005-07-06 Akim Demaille <akim@epita.fr>
11950
11951 Bind examples/calc++ to the package.
11952 * examples/calc++/Makefile: Remove, replaced by...
11953 * examples/calc++/Makefile.am: ... this new file.
11954 * examples/calc++/test: Remove input.
11955 * examples/calc++/compile: Remove.
11956 * examples/Makefile.am: New.
11957 * configure.ac, Makefile.am: Adjust.
11958 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
11959
119602005-07-05 Paul Eggert <eggert@cs.ucla.edu>
11961
11962 * data/glr.c (yyFail): Drastically simplify; since the format argument
11963 never had any % directives, we can simply pass it to yyerror.
11964 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
11965 be modified later, as that is the usual style in glr.c.
11966 Problems reported by Paul Hilfinger.
11967
11968 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
11969 and size overflow errors.
11970 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
11971 in case the user prolog sets feature-test macros like _GNU_SOURCE.
11972 (YYSIZEMAX): New macro.
11973 (yystpcpy): New function, taken from yacc.c.
11974 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
11975 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
11976 so that we don't have to maintain their signatures.
11977 (yyFail): Check for buffer overflow, by using vsnprintf rather
11978 than vsprintf. Allocate a bigger buffer if possible.
11979 Report an error if buffer allocation fails.
11980 (yyStackOverflow): New function.
11981 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
11982 the initialization was successful. It might fail if storage was
11983 exhausted.
11984 (yyexpandGLRStack): Add more checks for storage allocation failure.
11985 Use yyStackOverflow to report failures.
11986 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
11987 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
11988 Don't assume stack number fits in int.
11989 (yysplitStack): Check for storage allocation failure.
11990 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
11991 can print diagnostics on storage allocation failure. All callers
11992 changed.
11993 (yyresolveValue): Use yybool for boolean.
11994 (yyreportSyntaxError): Check for size-calculation overflow.
11995 This code is taken from yacc.c.
11996 (yyparse): Check for storage allocation errors when allocating
11997 the initial stack.
11998
119992005-07-05 Akim Demaille <akim@epita.fr>
12000
12001 Extract calc++ from the documentation.
12002 * doc/bison.texinfo (Calc++): Add the extraction marks.
12003 * examples/extexi: New, from the aborted GNU Programming 2E.
12004 Separate the different paragraph of a file with empty lines.
12005 * examples/Makefile: Use it to extract the whole calc++ example.
12006
120072005-06-24 Akim Demaille <akim@epita.fr>
12008
12009 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
12010 class typedefs.
12011
120122005-06-22 Akim Demaille <akim@epita.fr>
12013
12014 * doc/bison.texinfo (C++ Language Interface): First stab.
12015 (C++ Parsers): Remove.
12016
120172005-06-22 Akim Demaille <akim@epita.fr>
12018
12019 * data/lalr1.cc (yylex_): Honor %lex-param.
12020
120212005-06-22 Akim Demaille <akim@epita.fr>
12022
12023 Start a set of simple examples.
12024 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
12025 * examples/calc++/calc++-driver.hh,
12026 * examples/calc++/calc++-parser.yy,
12027 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
12028 * examples/calc++/compile, examples/calc++/test: New.
12029
120302005-06-09 Paul Eggert <eggert@cs.ucla.edu>
12031
12032 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
12033 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
12034 which stems from the 2005-05-27 patch.
12035
120362005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12037
12038 * data/glr.c: Modify treatment of unused parameters to permit use
12039 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
12040
120412005-05-30 Paul Eggert <eggert@cs.ucla.edu>
12042
12043 Fix infringement on user name space reported by Janos Zoltan Szabo.
12044 * data/yacc.c (yyparse): strlen -> yystrlen.
12045
120462005-05-30 Akim Demaille <akim@epita.fr>
12047
12048 * data/lalr1.cc (_): New.
12049 Translate the various messages.
12050
120512005-05-27 Paul Eggert <eggert@cs.ucla.edu>
12052
12053 Fix infringement on user name space reported by Bruno Haible.
12054 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
12055 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
12056 the user's name space.
12057 (alloca): Include <stdlib.h> to get it, if it's not built in.
12058 (YYMALLOC, YYFREE): Define only if needed.
12059 (malloc, free): Declare, but only if needed, as this infringes on
12060 the user name space.
12061
120622005-05-25 Paul Eggert <eggert@cs.ucla.edu>
12063
12064 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
12065 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
12066 with %d format.
12067 * lib/ebitset.c (min, max): Undef before defining.
12068 * lib/vbitset.c (min, max): Likewise.
12069 * lib/subpipe.c (create_subpipe): Save local variables in case
12070 vfork clobbers them.
12071
120722005-05-24 Bruno Haible <bruno@clisp.org>
12073
12074 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
12075 error message syntax used by gcc-4.0.
12076
120772005-05-23 Paul Eggert <eggert@cs.ucla.edu>
12078
12079 * README: Mention m4 1.4.3. Remove obsolete advice about
12080 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
12081
12082 * bootstrap: Remove workaround for problem I encountered with
12083 gettext 0.14.1; it seems to be fixed now.
12084
120852005-05-22 Paul Eggert <eggert@cs.ucla.edu>
12086
12087 * NEWS: Version 2.0a.
12088
12089 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
12090 the previous change.
12091
12092 Various maintainer cleanups.
12093 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
12094 conftest*, for benefit of CVS commands run at the same time as
12095 "configure". Add build-aux, since "bootstrap" now creates it and
12096 its subfiles.
12097 * Makefile.cfg (move_if_change): Remove.
12098 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
12099 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
12100 (po_repo, do-po-update, po-update, wget_files, get-targets):
12101 (config.guess-url_prefix, config.sub-url_prefix):
12102 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
12103 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
12104 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
12105 Remove.
12106 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
12107 this is now the recommended name.
12108 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
12109 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
12110 ylwrap. These files now go into build-aux.
12111 * config/move-if-change: Remove.
12112 * config/prev-version.txt: Bump from 1.75 to 2.0.
12113
12114 * bootstrap: Add stdio-safer, unistd-safer modules.
12115 Remove m4/glibc2.m4 (introduced by latest gnulib, but
12116 we don't need it).
12117 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
12118 fopen-safer.c, stdio-safer.h, unistd-safer.h.
12119 * lib/subpipe.c: Include "unistd-safer.h".
12120 (create_subpipe): Make sure all the newly-created
12121 file descriptors are > 2, so that diagnostics don't
12122 get sent down them (which might cause Bison to hang, in theory).
12123 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
12124 * src/files.c (xfopen): Use fopen_safer, not fopen.
12125
12126 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
12127 yesterday's yacc.c fix.
12128
121292005-05-21 Paul Eggert <eggert@cs.ucla.edu>
12130
12131 * data/glr.c, data/lalr1.cc: Update copyright date.
12132
12133 Fix a destructor bug reported by Wolfgang Spraul in
12134 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
12135 * data/yacc.c (yyabortlab): Don't call destructor, and
12136 don't set yychar to EMPTY.
12137 (yyoverflowlab): Don't call destructor.
12138 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
12139 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
12140 since we no longer output the message "discarding lookahead token
12141 end of input ()".
12142
121432005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12144
12145 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
12146 fix a small glitch in debugging output.
12147 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
12148 after YY_SYMBOL_PRINT where needed.
12149
12150 (struct yyGLRState): Add some comments.
12151 (struct yySemanticOption): Add some comments.
12152 (union yyGLRStackItem): Add comment.
12153
12154 (yymergeOptionSets): Correct this to properly perform the union,
12155 avoiding infinite reported by Michael Rosien.
12156 Update comment.
12157
12158 * tests/glr-regression.at: Add test for GLR merging error reported
12159 by M. Rosien.
12160
121612005-05-13 Paul Eggert <eggert@cs.ucla.edu>
12162
12163 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
12164 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
12165 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
12166 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
12167 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
12168 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
12169 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
12170 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
12171 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
12172 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
12173 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
12174 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
12175 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
12176 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
12177 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
12178 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
12179 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
12180 src/derives.h, src/files.c, src/files.h, src/getargs.c,
12181 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
12182 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
12183 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
12184 src/output.h, src/parse-gram.c, src/parse-gram.h,
12185 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
12186 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
12187 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
12188 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
12189 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
12190 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
12191 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
12192 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
12193 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
12194 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
12195 tests/reduce.at, tests/regression.at, tests/sets.at,
12196 tests/synclines.at, tests/testsuite.at, tests/torture.at:
12197 Update FSF postal mail address.
12198
121992005-05-11 Paul Eggert <eggert@cs.ucla.edu>
12200
12201 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
12202 Problem reported by Ralf Menzel.
12203
122042005-05-01 Paul Eggert <eggert@cs.ucla.edu>
12205
12206 * tests/actions.at: Test that stack overflow invokes destructors.
12207 From Marcus Holland-Moritz.
12208 * data/yacc.c (yyerrlab): Move the code that destroys the stack
12209 from here....
12210 (yyreturn): to here. That way, destructors are called properly
12211 even if the stack overflows, or the user calls YYACCEPT or
12212 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
12213 (yyoverflowlab): Destroy the lookahead.
12214
122152005-04-24 Paul Eggert <eggert@cs.ucla.edu>
12216
12217 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
12218
122192005-04-17 Paul Eggert <eggert@cs.ucla.edu>
12220
12221 * NEWS: Bison-generated C parsers no longer quote literal strings
12222 associated with tokens.
12223 * src/output.c (prepare_symbols): Don't escape strings,
12224 since users don't want to see C escapes.
12225 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
12226 in diagnostics.
12227 * tests/input.at (Torturing the Scanner): Likewise.
12228 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
12229
122302005-04-16 Paul Eggert <eggert@cs.ucla.edu>
12231
12232 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
12233 the data size is known to be too small and we can't increase it.
12234 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
12235
122362005-04-15 Paul Eggert <eggert@cs.ucla.edu>
12237
12238 * src/parse-gram.y: Include quotearg.h.
12239 (string_as_id): Quote $1 before using it as a key, since the
12240 lexer no longer quotes it for us.
12241 (string_content): Don't strip quotes, since lexer no longer
12242 quotes it for us.
12243 * src/scan-gram.l: Include quotearg.h.
12244 ("\""): Omit quote.
12245 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
12246 a key, since the rest of the lexer doesn't quote it.
12247 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
12248 * tests/regression.at (Token definitions): Check for backslashes
12249 in token strings.
12250
12251 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
12252 (YYSIZE_T): Define to unsigned long int when using an older compiler.
12253 (yyparse): Revamp code to generate long syntax error message, to
12254 make it easier to translate, and to avoid problems with arithmetic
12255 overflow. Change "virtual memory" to "memory" in diagnostic, since
12256 we don't know whether the memory is virtual.
12257
122582005-04-13 Paul Eggert <eggert@cs.ucla.edu>
12259
12260 * NEWS: Bison-generated C parsers now use the _ macro to
12261 translate strings.
12262 * data/yacc.c (_) [!defined _]: New macro.
12263 All English strings wrapped inside this macro.
12264 * doc/bison.texinfo (Bison Parser): Document _.
12265 * po/POTFILES.in: Include src/parse-gram.c, since it now
12266 includes translateable strings that parse-gram.y doesn't.
12267
122682005-04-12 Paul Eggert <eggert@cs.ucla.edu>
12269
12270 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
12271 reverting the 2004-10-11 change to this function.
12272 (symbol_check_alias_consistency): Don't call symbol_type_set
12273 if the type name is already correct.
12274 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
12275
122762005-03-25 Paul Eggert <eggert@cs.ucla.edu>
12277
12278 * tests/regression.at (Token definitions): Don't use a token named
12279 c, as that generates a "#define c ..." that runs afoul of buggy
12280 stdlib.h that uses the identifier c as a member of struct
12281 drand48_data. Problem reported by Horst Wente.
12282
122832005-03-21 Paul Eggert <eggert@cs.ucla.edu>
12284
12285 * bootstrap: Change translation URL from
12286 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
12287 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
12288 redirection glitches. Problem reported by twlevo@xs4all.nl.
12289
122902005-03-20 Paul Eggert <eggert@cs.ucla.edu>
12291
12292 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
12293 after operands; POSIX says this isn't portable for the c99 command.
12294
122952005-03-18 Paul Eggert <eggert@cs.ucla.edu>
12296
12297 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
12298 immediately if a data overrun has occurred; this may help us track
12299 down what may be a spurious failure on MacOS.
12300
123012005-03-17 Paul Eggert <eggert@cs.ucla.edu>
12302
12303 Respond to problems reported by twlevo@xs4all.nl.
12304
12305 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
12306
12307 * src/vcg.h: Comment fix.
12308 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
12309 (G_CMAX): Change to -1 instead of INT_MAX.
12310
12311 * data/yacc.c (yyparse): Omit spaces before #line.
12312
123132005-03-15 Paul Eggert <eggert@cs.ucla.edu>
12314
12315 * src/tables.c (state_number_to_vector_number): Put it inside an
12316 "#if 0", since it's not currently used. Problem reported by
12317 Roland McGrath.
12318
123192005-03-06 Paul Eggert <eggert@cs.ucla.edu>
12320
12321 * src/output.c (escaped_output): Renamed from
12322 escaped_file_name_output, since we now use it for symbol tags as
12323 well. All uses changed.
12324 (symbol_destructors_output, symbol_printers_output):
12325 Escape symbol tags too.
12326 Problem reported by Matyas Forstner in
12327 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
12328
12329 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
12330 not needed.
12331 * src/output.c (user_actions_output, token_definitions_output,
12332 symbol_destructors_output, symbol_printers_output): Likewise.
12333 * src/reader.c (prologue_augment): Likewise.
12334 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
12335
12336 * src/vcg.c (output_edge): Don't quote linestyle arg.
12337 Problem reported by twlevo@xs4all.nl.
12338
123392005-02-28 Paul Eggert <eggert@cs.ucla.edu>
12340
12341 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
12342 example, reported by Derek M Jones. Also, make the example even
12343 more outrageous, to better illustrate how bad the problem is.
12344
123452005-02-24 Paul Eggert <eggert@cs.ucla.edu>
12346
12347 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
12348 putsym. Typo reported by Sebastian Piping.
12349
123502005-02-23 Paul Eggert <eggert@cs.ucla.edu>
12351
12352 * doc/bison.texinfo (Language and Grammar): some -> same
12353 (Epilogue): int he -> in the
12354 Typos reported by Sebastian Piping via Justin Pence.
12355
123562005-02-07 Paul Eggert <eggert@cs.ucla.edu>
12357
12358 * tests/glr-regression.at (Improper handling of embedded actions
12359 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
12360 embedded actions and $-N in GLR parsers", work around an Autoconf bug
12361 with dollar signs in test names.
12362 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
12363 for a similar reason.
12364
123652005-01-28 Paul Eggert <eggert@cs.ucla.edu>
12366
12367 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
12368 wants to redefine G_VIEW.
12369
123702005-01-27 Paul Eggert <eggert@cs.ucla.edu>
12371
12372 * src/vcg.c (get_view_str): Remove case for normal_view.
12373 Problem reported by twlevo@xs4all.nl.
12374
123752005-01-24 Paul Eggert <eggert@cs.ucla.edu>
12376
12377 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
12378 Problem reported by twlevo@xs4all.nl.
12379
12380 * doc/bison.texinfo: Change @dircategory from "GNU programming
12381 tools" to "Software development". Requested by Richard Stallman
12382 via Karl Berry.
12383
123842005-01-23 Paul Eggert <eggert@cs.ucla.edu>
12385
12386 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
12387 Problem reported by twlevo@xs4all.nl.
12388
123892005-01-21 Paul Eggert <eggert@cs.ucla.edu>
12390
12391 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
12392 keyword; it's not needed with modern compilers, and it doesn't
12393 affect correctness with older compilers. Suggested by
12394 twlevo@xs4all.nl.
12395
123962005-01-17 Paul Eggert <eggert@cs.ucla.edu>
12397
12398 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
12399 gcc -Wswitch-default.
12400 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12401 * data/yacc.c (yyparse): Likewise.
12402
124032005-01-12 Paul Eggert <eggert@cs.ucla.edu>
12404
12405 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
12406 already. Let config.h define any nonstandard values.
12407
124082005-01-10 Paul Eggert <eggert@cs.ucla.edu>
12409
12410 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
12411 for the benefit of slower hosts. Problem reported by
12412 Nelson H. F. Beebe.
12413
124142005-01-07 Paul Eggert <eggert@cs.ucla.edu>
12415
12416 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
12417 being defined and not used.
12418 * data/lalr1.cc (yyparse): Likewise.
12419 Use "if (false)" rather than "if (0)".
12420
124212005-01-05 Paul Eggert <eggert@cs.ucla.edu>
12422
12423 * TODO: Mention that we should allow NUL bytes in tokens.
12424
124252005-01-02 Paul Eggert <eggert@cs.ucla.edu>
12426
12427 * src/scan-skel.l (<<EOF>>): Don't close standard output.
12428 Problem reported by Hans Aberg.
12429
124302005-01-01 Paul Eggert <eggert@cs.ucla.edu>
12431
12432 * src/getargs.c (version): Happy new year; update overall
12433 program copyright date from 2004 to 2005.
12434
12435 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
12436 Problem reported by Hans Aberg.
12437 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
12438 (Output file names.): Add a test for the case when standard output
12439 is closed.
12440
124412004-12-26 Paul Eggert <eggert@cs.ucla.edu>
12442
12443 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
12444 to fix an oversight in the Bison 2.0 manual.
12445
124462004-12-25 Paul Eggert <eggert@cs.ucla.edu>
12447
12448 * NEWS: Version 2.0. Reformat the existing news items since
12449 1.875, so that related items are grouped together.
12450 * configure.ac (AC_INIT): Bump version to 2.0.
12451 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
12452
12453 * tests/torture.at (Exploding the Stack Size with Alloca): Set
12454 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
12455 otherwise, we're not testing alloca. Unfortunately there's no
12456 simple way to consult HAVE_ALLOCA here.
12457
12458 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
12459 for yymsg, too.
12460
12461 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
12462 hand. This avoids a warning about comparing int to size_t when
12463 GCC warnings are enabled.
12464
124652004-12-22 Paul Eggert <eggert@cs.ucla.edu>
12466
12467 * NEWS: Bison-generated parsers no longer default to using the
12468 alloca function (when available) to extend the parser stack, due
12469 to widespread problems in unchecked stack-overflow detection.
12470 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
12471 responsibility to set it to a positive value. This lets the user
12472 specify a value that is not a preprocessor constant.
12473 * data/yacc.c (YYMAXDEPTH): Likewise.
12474 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
12475 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
12476 to be a compile-time constant. However, explain the constraints on it.
12477 Also, explain the constraints on YYINITDEPTH.
12478 (Table of Symbols): Explain that alloca is no longer the default.
12479 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
12480 to 1.
12481
12482 * doc/bison.texinfo (Location Default Action): Mention that n must
12483 be zero when k is zero. Suggested by Frank Heckenbach.
12484
124852004-12-22 Akim Demaille <akim@epita.fr>
12486
12487 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
12488 (parser::state_type, parser::semantic_type, parser::location_type):
12489 Private, not public.
12490 (parser::parse): Return ints, not bool.
12491 Returning a bool introduces a problem: 0 corresponds to false, and
12492 it seems weird to return false on success. Returning true changes
12493 the conventions for yyparse.
12494 Alternatively we could return void and send an exception.
12495 There is no clear consensus (yet?).
12496 (state_stack, semantic_stack, location_stack): Rename as...
12497 (state_stack_type, semantic_stack_type, location_stack_type): these.
12498 Private, not public.
12499 * tests/c++.at: New.
12500 * tests/testsuite.at, tests/Makefile.am: Adjust.
12501
125022004-12-21 Akim Demaille <akim@epita.fr>
12503
12504 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
12505
125062004-12-21 Akim Demaille <akim@epita.fr>
12507
12508 Don't impose std::string for filenames.
12509
12510 * data/lalr1.cc (b4_filename_type): New.
12511 (position::filename): Use it.
12512 (parser.hh): Move the inclusion of stack.hh and location.hh below
12513 the user code, so that needed headers for the filename type can be
12514 included first.
12515 Forward declare them before the user code.
12516 * tests/Makefile.am (check-local, installcheck-local): Pass
12517 TESTSUITEFLAGS to the TESTSUITE.
12518
125192004-12-20 Akim Demaille <akim@epita.fr>
12520
12521 Use more STL like names: my_class instead of MyClass.
12522
12523 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
12524 (SemanticStack, SemanticType, StateStack, StateType)
12525 (TokenNumberType, Stack, Slice, Traits, Parser::location)
12526 (Parser::value): Rename as...
12527 (location_stack, location_type, rhs_number_type, semantic_stack)
12528 (semantic_type, state_stack, state_type, token_number_type, stack)
12529 (slice, traits, parser::yylloc, parser::yylval): these.
12530
12531 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
12532
125332004-12-19 Paul Eggert <eggert@cs.ucla.edu>
12534
12535 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
12536 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12537
125382004-12-17 Paul Eggert <eggert@cs.ucla.edu>
12539
12540 Remove uses of 'short int' and 'unsigned short int'. This raises
12541 some arbitrary limits. It uses more memory but nowadays that's
12542 not much of an issue.
12543
12544 This change does not affect the generated parsers; that's a different
12545 task, as some users will want to conserve memory there.
12546
12547 Ideally we should use size_t to represent all object counts, and
12548 something like ptrdiff_t to represent signed differences of object
12549 counts; but that will require more code-cleanup than I have the
12550 time to do right now.
12551
12552 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
12553 Use size_t, not int or short int, to count objects.
12554 * src/closure.c (nritemset, closure): Likewise.
12555 * src/closure.h (nritemset, closure): Likewise.
12556 * src/nullable.c (nullable_compute): Likewise.
12557 * src/print.c (print_core): Likewise.
12558 * src/print_graph.c (print_core): Likewise.
12559 * src/state.c (state_compare, state_hash): Likewise.
12560 * src/state.h (struct state): Likewise.
12561 * src/tables.c (default_goto, goto_actions): Likewise.
12562
12563 * src/gram.h (rule_number, rule): Use int, not short int.
12564 * src/output.c (prepare_rules): Likewise.
12565 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
12566 errs, reductions): Likewise.
12567 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
12568 Likewise.
12569 * src/tables.c (vector_number, tally, action_number,
12570 ACTION_NUMBER_MINIMUM): Likewise.
12571 * src/output.c (muscle_insert_short_int_table): Remove.
12572
125732004-12-17 Akim Demaille <akim@epita.fr>
12574
12575 * data/lalr1.cc: Extensive Doxygenation.
12576 (error_): Rename as...
12577 (error): this, since it is visible to the user.
12578 Adjust callers.
12579 (Parser::message): Now an automatic variable from...
12580 (Parser::yyreport_syntax_error_): here.
12581 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
12582 Parser::error.
12583 * tests/input.at: Escape $.
12584
125852004-12-16 Paul Eggert <eggert@cs.ucla.edu>
12586
12587 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
12588 Parenthesize rhs to avoid obscure problems with mistakes like
12589 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
12590 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12591 b4_rhs_location): Likewise.
12592 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12593 b4_rhs_location): Likewise.
12594
125952004-12-16 Akim Demaille <akim@epita.fr>
12596
12597 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
12598 yacc.c: be sure to stay within yycheck_.
12599 * tests/actions.at: Re-enable C++ tests.
12600
126012004-12-16 Akim Demaille <akim@epita.fr>
12602
12603 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
12604 real.
12605
126062004-12-16 Akim Demaille <akim@epita.fr>
12607
12608 Use #define to handle the %name-prefix.
12609
12610 * data/glr.c, data/yacc.c: Comment changes.
12611 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
12612 so that one can refer to yylex in the parser file, and have it
12613 renamed, as is the case with other skeletons.
12614
126152004-12-16 Akim Demaille <akim@epita.fr>
12616
12617 Move lalr1.cc internals into yy*.
12618
12619 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
12620 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
12621 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
12622 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
12623 (empty_, final_, terror_, errcode_, ntokens_)
12624 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
12625 (looka_, ilooka_, error_range_, nerrs_):
12626 Rename as...
12627 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
12628 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
12629 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
12630 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
12631 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
12632 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
12633 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
12634 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
12635 these.
12636
126372004-12-15 Paul Eggert <eggert@cs.ucla.edu>
12638
12639 Fix some problems reported by twlevo at xs4all.
12640 * src/symtab.c (symbol_new): Report an error if the input grammar
12641 contains too many symbols. This is better than calling abort() later.
12642 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
12643 (struct node, struct graph):
12644 Rename member expand to stretch. All uses changed.
12645 (struct graph): Remove member layoutalgorithm. All uses removed.
12646 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
12647 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
12648 All uses changed.
12649 (N_STRETCH): Rename from N_EXPAND. All uses changed.
12650
126512004-12-15 Akim Demaille <akim@epita.fr>
12652
12653 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
12654 Add more Doxygen comments.
12655 (symprint_, stack_print_, reduce_print_, destruct_, pop)
12656 (report_syntax_error_, translate_): Rename as...
12657 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
12658 (yypop_, yyreport_syntax_error_, yytranslate_): this.
12659
126602004-12-15 Akim Demaille <akim@epita.fr>
12661
12662 * data/lalr1.cc (lex_): Rename as...
12663 (yylex_): this.
12664 Move the trace here.
12665 Take the %name-prefix into account.
12666 Reported by Alexandre Duret-Lutz.
12667
126682004-12-15 Akim Demaille <akim@epita.fr>
12669
12670 Simplify the C++ parser constructor.
12671
12672 * data/lalr1.cc (debug_): Rename as...
12673 (yydebug_): so that the parser's internals are always in the yy*
12674 pseudo namespace.
12675 Adjust uses.
12676 (b4_parse_param_decl): Remove the leading comma as it is now only
12677 called as unique argument list.
12678 (Parser::Parser): Remove the constructor accepting a location and
12679 an initial debugging level.
12680 Remove from the other ctor the argument for the debugging level.
12681 (debug_level_type, debug_level, set_debug_level): New.
12682
12683 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
12684 constructor calls.
12685
126862004-12-15 Akim Demaille <akim@epita.fr>
12687
12688 Remove b4_root related material: failure experiment
12689 (which goal was to allow to derive from a class).
12690
12691 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
12692 definitions and uses.
12693
126942004-12-14 Paul Eggert <eggert@cs.ucla.edu>
12695
12696 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
12697 not 2, since it's not portable to subtract 1 from the start of an
12698 array. The new item 0 is never set or used. All uses changed.
12699
12700 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
12701 the default definition of YYLLOC_DEFAULT. Problem reported
12702 by Frank Heckenbach.
12703
127042004-12-12 Paul Eggert <eggert@cs.ucla.edu>
12705
12706 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
12707 the normal case and one for the error case. Just use the
12708 first one uniformly. Problem reported by Frank Heckenbach.
12709 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
12710 use exactly the same macro in both places.
12711 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
12712 so that the normal-case YYRHSLOC works for the error case too.
12713 All uses changed.
12714 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
12715 (YYLLOC_DEFAULT): Use the same macro as glr.c.
12716 * doc/bison.texinfo (Location Default Action): Don't claim that
12717 we have an array of locations. Use the same macro for both glr
12718 and lalr parsers. Mention YYRHSLOC. Mention what happens when
12719 the index is 0.
12720
127212004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12722
12723 * HACKING: Update email addresses to send announcements to.
12724
12725 * configure.ac (AC_INIT): Bump version to 1.875f.
12726
127272004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12728
12729 * NEWS: Version 1.875e.
12730 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
12731
12732 * src/scan-skel.l: Include "complain.h", for "fatal".
12733
12734 * src/relation.h (relation_print, relation_digraph):
12735 Relation sizes are of type relation_node, not size_t (this is
12736 merely a doc fix, since the two types are equivalent).
12737 (relation_transpose): Relation sizes are of type relation_node,
12738 not int.
12739 * src/relation.c: Likewise.
12740 (top, infinity): Now of type relation_node, not int.
12741 (traverse, relation_transpose): Use relation_node, not int.
12742
12743 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
12744 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
12745 (yyparse): Remove unused local introduced in 2004-10-25 patch.
12746
12747 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
12748 specifying whether the test should be skipped. Use it tp
12749 specify that the [%defines %skeleton "lalr1.cc"] tests currently
12750 fail on some hosts, and should be skipped.
12751
127522004-12-08 Paul Eggert <eggert@cs.ucla.edu>
12753
12754 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
12755 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
12756 unless otherwise specified below.
12757
12758 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
12759 to allocate kernel_base, kernel_items, kernel_size, since
12760 they needn't be initialized to 0.
12761 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
12762 * src/closure.c (new_closure): Likewise, for itemset.
12763 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
12764 * src/lalr.c (set_goto_map): Likewise, for temp_map.
12765 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
12766 (build_relations): Likewise for edge, states1, includes.
12767 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
12768 * src/reader.c (packgram): Likewise, for ritem, rules.
12769 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
12770 * src/relation.c (relation_digraph): Likewise for VERTICES.
12771 (relation_transpose): Likewise for new_R, end_R.
12772 * src/symtab.c (symbols_token_translations_init): Likewise for
12773 token_translations.
12774 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
12775 (token_actions): Likewise for yydefact, actrow, conflrow,
12776 conflict_list.
12777 (save_column): Likewise for froms[symno], tos[symno].
12778 (goto_actions): Likewise for state_count.
12779 (pack_table): Likewise for base, pos, check.
12780 (tables_generate): Likewise for width.
12781
12782 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
12783 for initial core. Just have a separate core, so we needn't worry
12784 about whether kernel_size and kernel_base are initialized.
12785
12786 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
12787 kernel_size, kernel_items): Remove unnecessary initialization.
12788 * src/conflicts.c (conflicts): Likewise.
12789 * src/derives.c (derives): Likewise.
12790 * src/muscle_tablc (muscle_insert): Likewise.
12791 * src/relation.c (relation_digraph): Likewise.
12792 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
12793 conflrow, conflict_table, conflict_list, table, check):
12794 Likewise.
12795
12796 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
12797 This is because all callers pass unsigned int.
12798 * src/closure.h (new_closure): Likewise.
12799
12800 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
12801 (build_relations): Initialize includes[i] in all cases.
12802 * src/reader.c (packgram): Always initialize rules[ruleno].prec
12803 and rules[ruleno].precsym. Initialize members in order.
12804 * src/relation.c (relation_transpose): Always initialize new_R[i]
12805 and end_R[i].
12806 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
12807
12808 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
12809 conflict_list[0] was always 0, but now it isn't initialized.
12810
12811 * src/table.c (table_grow): When conflict_table grew, the grown
12812 area wasn't cleared. Fix this.
12813
12814 * lib/.cvsignore: Add strdup.c, strdup.h.
12815 * m4/.cvsignore: Add strdup.m4.
12816
128172004-12-07 Paul Eggert <eggert@cs.ucla.edu>
12818
12819 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
12820 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
12821 GOTO_NUMBER_MAXIMUM, since we occasionally compute
12822 ngotos + 1 without checking for overflow.
12823 (build_relations): Use END_NODE, not -1, to denote end of edges.
12824 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
12825 build_relations): Use goto_number, not int, for goto numbers.
12826 * src/tables.c (save_column, default_goto): Likewise.
12827
128282004-11-23 Akim Demaille <akim@epita.fr>
12829
12830 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
12831 of #defining from yystype.
12832 Don't typedef yystype, C++ does not need it.
12833 This lets it possible to forward declare it as union.
12834
128352004-11-23 Paul Eggert <eggert@cs.ucla.edu>
12836
12837 * bootstrap (gnulib_modules): Add extensions.
12838 Problem reported by Jim Meyering.
12839
128402004-11-22 Paul Eggert <eggert@cs.ucla.edu>
12841
12842 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
12843 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
12844 src/system.h, src/tables.c: XFREE -> free, to accommodate
12845 recent change to gnulib xalloc.h.
12846 Problem reported by Jim Meyering.
12847
128482004-11-17 Akim Demaille <akim@epita.fr>
12849
12850 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
12851
128522004-11-17 Akim Demaille <akim@epita.fr>,
12853 Alexandre Duret-Lutz <adl@gnu.org>
12854
12855 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
12856 changes.
12857 (YYCDEBUG): Adjust.
12858 Use it instead of cdebug_.
12859 (Parser::debug_stream, Parser::set_debug_stream): New.
12860 (Parser::symprint_): Define cdebug_ for temporary backward
12861 compatibility.
12862 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
12863 debug_stream ().
12864
128652004-11-17 Akim Demaille <akim@epita.fr>
12866
12867 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
12868 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
12869 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
12870 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12871
128722004-10-27 Paul Eggert <eggert@cs.ucla.edu>
12873
12874 * data/glr.c (yyloc_default): Remove; not used.
12875 Problem reported by Frank Heckenbach.
12876
128772004-10-25 Akim Demaille <akim@epita.fr>
12878
12879 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
12880 Introduce another definition to address simple location arrays.
12881 (yyGLRStack): New member: yyerror_range.
12882 (yyrecoverSyntaxError, yyparse): Update it.
12883 (yyrecoverSyntaxError): Use it when shifting the error token to
12884 have an accurate range, equivalent to the one computed by both
12885 yacc.c and lalr1.cc.
12886 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
12887 that column numbers start at column 0, as per GNU Coding
12888 Standards, the others tests, and the doc.
12889 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
12890 Adjust to the above change (first column is 0).
12891 And adjust the location of the "<error>", now covering the whole
12892 line.
12893
128942004-10-22 Akim Demaille <akim@epita.fr>
12895 and Paul Eggert <eggert@cs.ucla.edu>
12896
12897 Remove some arbitrary limits on goto numbers and relations.
12898 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
12899 initial values, since they're never used.
12900 (set_goto_map): ngotos is now unsigned, so test for overflow
12901 by seeing whether it wraps around to zero.
12902 * src/lalr.h (goto_number): Now size_t, not short int.
12903 (GOTO_NUMBER_MAXIMUM): Remove.
12904 * src/relation.c (relation_print, traverse, relation_transpose):
12905 Check for END_NODE rather than looking at sign.
12906 * src/relation.h (END_NODE): New macro.
12907 (relation_node): Now size_t, not short int.
12908
129092004-10-22 Paul Eggert <eggert@cs.ucla.edu>
12910
12911 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
12912 keyword, not an identifier. Problem reported by Baron Schwartz in
12913 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
12914
129152004-10-11 Akim Demaille <akim@epita.fr>
12916
12917 * src/symtab.c (symbol_check_alias_consistency): Also check
12918 type names, destructors, and printers.
12919 Reported by Alexandre Duret-Lutz.
12920 Recode the handling of associativity and precedence in terms
12921 of symbol_precedence_set.
12922 Accept no redeclaration at all, not even equal to the previous
12923 value.
12924 (redeclaration): New.
12925 Use it to factor redeclaration complaints.
12926 (symbol_make_alias): Don't set the type of the alias, let
12927 symbol_check_alias_consistency do it as for other features.
12928 * src/symtab.h (symbol): Add new member prec_location, and
12929 type_location.
12930 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
12931 * tests/input.at (Incompatible Aliases): New.
12932
129332004-10-09 Paul Eggert <eggert@cs.ucla.edu>
12934
12935 .cvsignore fixes to accommodate gnulib changes,
12936 and the practice of naming build directories "_build".
12937 * .cvsignore: Add "_*". Sort.
12938 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
12939 * m4/.cvsignore: Add "*_gl.m4".
12940
129412004-10-06 Akim Demaille <akim@epita.fr>
12942
12943 * src/parse-gram.y (add_param): Fix the truncation of trailing
12944 spaces.
12945
129462004-10-05 Akim Demaille <akim@epita.fr>
12947
12948 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
12949 whether the reducion was empty or not. This leaves room to
12950 improve the use of YYLLOC_DEFAULT in such a case.
12951 lalr1.cc is still experimental, so changing this is acceptable.
12952 And finally, there are probably not many users who changed the
12953 handling of locations in GLR, so changing is admissible too.
12954
12955 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
12956 empty reduction, set @$ to an empty location ending the previously
12957 stacked symbol.
12958 Adjust uses to make sure the code is triggered on empty
12959 reductions.
12960 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
12961 expected output: empty reductions have empty locations.
12962
129632004-09-29 Akim Demaille <akim@epita.fr>
12964
12965 * data/lalr1.cc: Move towards a more standard C++ coding style
12966 for templates: Class < T > -> Class<T>.
12967
129682004-09-29 Akim Demaille <akim@epita.fr>
12969
12970 * data/lalr1.cc: Reinstall the former ctor, for sake of
12971 compatibility, but warn it will be removed.
12972 Move towards a more standard C++ coding style (i.e., type *var ->
12973 type* var).
12974
129752004-09-27 Paul Eggert <eggert@cs.ucla.edu>
12976
12977 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
12978 since it's less likely to work if NULs are involved in the future.
12979
129802004-09-27 Akim Demaille <akim@epita.fr>
12981
12982 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
12983
129842004-09-27 Akim Demaille <akim@epita.fr>
12985
12986 * data/lalr1.cc (b4_parse_param_decl_1): New.
12987 (b4_parse_param_decl): Use it to have different names between attribute
12988 and argument names.
12989 (b4_cc_constructor_call): Likewise.
12990
129912004-09-24 Akim Demaille <akim@epita.fr>
12992
12993 * src/parse-gram.y (add_param): Strip the leading and trailing
12994 blanks from a formal argument declaration.
12995 (YY_LOCATION_PRINT): New.
12996
129972004-09-24 Akim Demaille <akim@epita.fr>
12998
12999 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
13000 after the location.
13001
130022004-09-24 Akim Demaille <akim@epita.fr>
13003
13004 * doc/bison.texinfo (Table of Symbols): Sort.
13005
130062004-09-21 Akim Demaille <akim@epita.fr>
13007
13008 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
13009 the useless parentheses.
13010 Suggested by Paul Eggert.
13011
130122004-09-20 Akim Demaille <akim@epita.fr>
13013
13014 Let the initial-action act on the look-ahead, and use it for the
13015 "initial push" (corresponding to an hypothetical beginning-of-file).
13016 And let lalr1.cc honor %initial-action.
13017
13018 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
13019 example.
13020 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
13021 (Parser::Parser): Remove the ctor that used to initialize it.
13022 (Parser::parse): Like in the other skeletons, issue the "starting
13023 parse" message before any action.
13024 Honor %initial-action.
13025 Initialize the stacks with the lookahead.
13026 * data/yacc.c: Let $$ and @$ in %initial-action designate the
13027 look-ahead.
13028 Push them in the stacks.
13029 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
13030
130312004-09-20 Akim Demaille <akim@epita.fr>
13032
13033 * doc/bison.texinfo (Initial Action Decl): New.
13034
130352004-09-20 Akim Demaille <akim@epita.fr>
13036
13037 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
13038 clearer criterion to define it.
13039 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
13040 When reducing on an empty RHS, use the latest stacked location as
13041 location.
13042 yylloc is not always available.
13043 * data/glr.c: Likewise.
13044 Also, honor initial-actions.
13045
130462004-09-20 Akim Demaille <akim@epita.fr>
13047
13048 * data/yacc.c (YY_LOCATION_PRINT): New.
13049 Define when we know YYLTYPE's structure, i.e., when the default
13050 YYLLOC_DEFAULT is used.
13051 * data/c.m4 (b4_yysymprint_generate): Use it.
13052 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
13053 value of the result.
13054 (error_start_): Replace with...
13055 (error_range_): this location array.
13056 This allows to replace code relying on the implementation of
13057 locations by portable code.
13058 * data/yacc.c (yylerrsp): Replace with...
13059 (yyerror_range): this.
13060 Every time a token is popped, update yyerror_range[0], to have an
13061 accurate location for the error token.
13062 * data/glr.c (YY_LOCATION_PRINT): New.
13063 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
13064 deference a pointer.
13065 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
13066 report the location in %printers.
13067
13068 * src/scan-skel.l: Instead of abort, report error messages to ease
13069 understanding skeleton scanning failures.
13070
130712004-09-16 Akim Demaille <akim@epita.fr>
13072
13073 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
13074 (iterator, const_iterator): these, to be more in the C++ spirit.
13075 Also, return reverse iterators so that when displaying the stack
13076 we display its bottom first.
13077 (Parser::stack_print_, Parser::reduce_print_): Match the messages
13078 from yacc.c.
13079 We should probably use vector here though.
13080
130812004-09-16 Akim Demaille <akim@epita.fr>
13082
13083 Have more complete shift traces.
13084
13085 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
13086 to report Shifts instead of ad hoc YYDPRINTF invocations,
13087 including for the error token.
13088 * data/lalr1.cc (symprint_): Output the location.
13089 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
13090 output the location within the %printer.
13091 Activate GLR tests, at least to make sure they compile properly.
13092 They still don't pass though.
13093 * tests/calc.at: Adjust expect verbose output, since now "Entering
13094 state..." is on a different line than the "Shifting" message.
13095
130962004-09-08 Akim Demaille <akim@epita.fr>
13097
13098 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
13099 Bison directive from the Bison file to the invocation of this
13100 macro, so that these directives are passed to
13101 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
13102 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
13103 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
13104 the extra Bison directives instead of the whole series.
13105 Change the grammar so that there are recoverable errors, and
13106 unrecoverable errors. Now we can have the parser give up before
13107 consuming the whole input. As a result we now can observe that
13108 the lookahead is freed when needed.
13109 Change the parser source to parse argv[1] instead of a hard coded
13110 string.
13111 Simplify yylex, and give a value and location to EOF.
13112 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
13113 passed directives already coded in the file.
13114 Add some tests to check the location of "error".
13115 For some tests, the C++ parser is correct, and not yacc.c.
13116 For other tests, they provide different, but unsatisfying, values,
13117 so keep the C++ value so that at least one parser is "correct"
13118 according to the test suite.
13119 (Actions after errors): Remove, this is subsumed by the
13120 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
13121
131222004-09-06 Akim Demaille <akim@epita.fr>
13123
13124 * data/lalr1.cc: Adjust the indentation of the labels.
13125 (Parser::pop): New.
13126 Use it.
13127
131282004-09-06 Akim Demaille <akim@epita.fr>
13129
13130 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
13131 argument, an informative message.
13132 Call YY_SYMBOL_PRINT.
13133 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
13134 * data/lalr1.cc (destruct_): Likewise.
13135 In addition, no longer depend on b4_yysymprint_generate and
13136 b4_yydestruct_generate to generate these functions, do it "by
13137 hand".
13138
131392004-09-03 Akim Demaille <akim@epita.fr>
13140
13141 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
13142 invoked, yydestruct the lookahead.
13143 * tests/calc.at (Calculator $1): Update the expected lengths of
13144 traces: there is an added line for the discarded lookahead.
13145 * doc/bison.texinfo (Destructor Decl): Some rewording.
13146 Define "discarded" symbols.
13147
131482004-09-02 Akim Demaille <akim@epita.fr>
13149
13150 * data/lalr1.cc (translate_, destruct_): No reason to be static.
13151
131522004-09-02 Akim Demaille <akim@epita.fr>
13153
13154 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
13155 (YYDSYMPRINTF): Rename as...
13156 (YY_SYMBOL_PRINT): this.
13157 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
13158 two.
13159 Use it instead of direct symprint_ calls.
13160 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
13161 one.
13162
131632004-09-02 Akim Demaille <akim@epita.fr>
13164
13165 * data/lalr1.cc (b4_yysymprint_generate): New.
13166 (symprint_): New member function, defined when YYDEBUG.
13167 Use it consistently instead of token/nterm debugging output by
13168 hand.
13169 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
13170 %printer calls to use cdebug_ when using lalr1.cc.
13171
131722004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
13173
13174 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
13175 with #ifdef YYDEBUG.
13176
131772004-08-26 Akim Demaille <akim@epita.fr>
13178
13179 * doc/bison.texinfo (Implementing Loops): Rename as...
13180 (Implementing Gotos/Loops): this.
13181
131822004-08-13 Paul Eggert <eggert@cs.ucla.edu>
13183
13184 Adjust to latest gnulib.
13185 * bootstrap (gnulib_modules): Add xalloc-die.
13186 Set LC_ALL=C so that file names sort consistently.
13187 Prefer the gnulib copies of gettext.m4, glibc21.m4,
13188 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
13189 uintmax_t.m4, ulonglong.m4.
13190 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
13191 po.m4 since we are now using _gl.m4 instead.
13192
131932004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
13194
13195 * src/scan-action.l: Remove. Scanning of semantic actions is
13196 handled in scan-gram.l.
13197
131982004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
13199
13200 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
13201
13202 * src/location.h (struct): The file member is a uniqstr.
13203 (equal_boundaries): Use UNIQSTR_EQ for comparison.
13204
132052004-07-22 Paul Eggert <eggert@cs.ucla.edu>
13206
13207 Fix bug with non-%union parsers that have printers or destructors,
13208 which led to a Bison core dump. Reported by Peter Fales in
13209 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
13210
13211 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
13212 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
13213 not to our own type.
13214 * src/output.c (symbol_destructors_output, symbol_printers_output):
13215 Don't assume %union.
13216 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
13217 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
13218 UNION-FLAG. All callers changed.
13219 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
13220 Use type char, not unsigned int, when declaring an array of char;
13221 this lets us remove a cast.
13222 (Printers and Destructors): Add non-%union test cases.
13223
132242004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13225
13226 * doc/bison.texinfo: Minor editorial changes, mostly to the new
13227 GLR writeups. E.g., avoid frenchspacing and the future tense,
13228 change "lookahead" to "look-ahead", and change "wrt" to "with
13229 respect to".
13230
132312004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13232
13233 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
13234 New sections, split off from the GLR Parsers section. Put the new
13235 Simple GLR Parser near the start of the GLR section, for clarity.
13236 Rewrite connective text.
13237
132382004-06-21 Frank Heckenbach <frank@g-n-u.de>
13239
13240 * doc/bison.texinfo (Simple GLR Parsers): New section.
13241
132422004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13243
13244 * NEWS, TODO, doc/bison.texinfo:
13245 Use "look-ahead" instead of "lookahead", to be consistent.
13246 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
13247 while we're fixing "look-ahead".
13248 * src/conflicts.c (shift_set): Renamed from shiftset.
13249 (look_ahead_set): Renamed from lookaheadset.
13250 * src/print.c: Likewise.
13251 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
13252 name for "lookahead".
13253 (report_types, usage): Likewise.
13254 * src/getargs.h (report_look_ahead_tokens): Renamed from
13255 report_lookaheads.
13256 * src/lalr.c (compute_look_ahead_tokens): Renamed from
13257 compute_lookaheads.
13258 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
13259 (look_ahead_tokens_print): Renamed from lookaheads_print.
13260 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
13261 state_rule_lookaheads_print.
13262 * src/state.h: Likewise.
13263 (reductions.look_ahead_tokens): Renamed from lookaheads.
13264 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
13265 AT_DATA_LOOKAHEADS_GRAMMAR.
13266
132672004-06-03 Paul Eggert <eggert@cs.ucla.edu>
13268
13269 * README: Update location of patched M4 distribution.
13270
132712004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
13272
13273 Don't assume the C++ compiler takes the same arguments as the C compiler
13274 (trivial change).
13275 * configure.ac (O0CXXFLAGS): New var.
13276 * tests/atlocal.in (CXXFLAGS): Use it.
13277
132782004-05-29 Paul Eggert <eggert@cs.ucla.edu>
13279
13280 Fix some "make check" problems with C++ reported by
13281 Albert Chin-A-Young for Tru64 C++ in this thread:
13282 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
13283
13284 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
13285 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13286 Output to a .cc file for C++, not to a .c file.
13287 * tests/calc.at (AT_CHECK_CALC): Likewise.
13288 * tests/regression.at (AT_CHECK_DANCER): Likewise.
13289 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
13290
132912004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
13292
13293 * tests/calc.at, tests/actions.at: Workaround for SGI
13294 C++ compiler. (trivial change)
13295
132962004-05-27 Paul Eggert <eggert@cs.ucla.edu>
13297
13298 Spent a few hours checking out which prerequisite versions the
13299 current sources actually require. I went all the way back to
13300 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
13301 a seemingly endless set of combinations of versions more recent
13302 than that. The bottom line is that the current sources require
13303 fairly recent versions of the build tools, and it'll be some work
13304 to change this.
13305 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
13306 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
13307 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
13308 Add comments explaining why those particular versions are
13309 currently needed.
13310
13311 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
13312 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
13313 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
13314
13315 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
13316 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
13317
133182004-05-26 Paul Eggert <eggert@cs.ucla.edu>
13319
13320 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
13321 0.11.5. Suggested by Bruno Haible.
13322 * bootstrap: Remove gettext version checking.
13323
13324 * doc/bison.texinfo (Decl Summary): Also mention that %union
13325 can depend on prerequisite types. Problem reported by Tim
13326 Van Holder.
13327
133282004-05-25 Paul Eggert <eggert@cs.ucla.edu>
13329
13330 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
13331 * README-alpha: Don't tell people not to package this.
13332
13333 * bootstrap: Don't assume $(...) works; use `...` instead.
13334 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
13335 gettext better.
13336
13337 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
13338 put into the -d output file, and mention what to do if YYSTYPE is
13339 defined as a macro.
13340
133412004-05-24 Paul Eggert <eggert@cs.ucla.edu>
13342
13343 Undo change made earlier today: it caused autopoint to not bring
13344 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
13345 autopoint's.
13346
13347 * bootstrap: Check that gettext version matches what's in
13348 configure.ac. Warn users to ignore robots.txt ERROR 404.
13349 * bootstrap: Undo today's earlier change (logged below).
13350 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
13351
13352 The gettext version checking is causing more trouble than it's
13353 curing; remove it. Problem reported by Paul Hilfinger.
13354
13355 * bootstrap: Issue a warning that one can expect a message
13356 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
13357 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
13358
133592004-05-23 Paul Eggert <eggert@cs.ucla.edu>
13360
13361 Ensure that the C++ compiler used for testing actually works on a
13362 simple test program; if not, skip the C++-related tests. Problem
13363 reported by Vin Shelton in:
13364 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
13365
13366 * m4/cxx.m4: New file.
13367 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
13368 * tests/atlocal.in (BISON_CXX_WORKS): Add.
13369 * tests/local.at (AT_COMPILE_CXX): Use it.
13370
133712004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13372
13373 * data/glr.c (yylloc): Output this macro even if locations are not
13374 being generated, as the GLR parser needs it even in that case.
13375 Problem reported by Troy A. Johnson
13376 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
13377
13378 * configure.ac (AC_INIT): Update to 1.875e.
13379
133802004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13381
13382 * NEWS: Version 1.875d.
13383 * configure.ac (AC_INIT): Likewise.
13384 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
13385
13386 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
13387 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
13388 lalr1.cc runs afoul of the first, and the last two are no longer
13389 supported by GCC 3.4.0.
13390 * README: Mention GNU m4 1.4 or later; mention m4 patches.
13391 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
13392
133932004-05-06 Paul Eggert <eggert@cs.ucla.edu>
13394
13395 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
13396 unsigned int, for compatibility with latest gnulib hash module.
13397 * src/state.c (state_hash, state_hasher): Likewise.
13398 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
13399 * src/uniqstr.c (hash_uniqstr): Likewise.
13400
134012004-05-03 Paul Eggert <eggert@cs.ucla.edu>
13402
13403 * NEWS: Unescaped newlines are no longer allowed in char & strings.
13404
13405 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
13406 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
13407 character and string literals.
13408 (unexpected_end): New function.
13409 (unexpected_eof): Use it.
13410 (unexpected_newline): New function.
13411 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
13412 actions.
13413
13414 * NEWS: Document %expect-rr.
13415
13416 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
13417 Fix typo by replacing $1 with $option.
13418 Remove more 'intl'-related files.
13419 Don't DEFUN AM_INTL_SUBDIR twice.
13420
13421 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
13422 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
13423 strtoul.c.
13424 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
13425 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
13426 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
13427 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
13428 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
13429 * src/.cvsignore: Add *.output.
13430
13431 * src/parse-gram.y: Put copyright notice inside %{ %} so it
13432 gets copied to the output file.
13433
134342004-04-28 Paul Eggert <eggert@twinsun.com>
13435
13436 Get files from the gnulib and po repositories, instead of relying
13437 on them being in our CVS. Upgrade to latest versions of gnulib
13438 and Automake.
13439
13440 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
13441 * bootstrap: Bootstrap from gnulib and po repositories.
13442 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
13443 * README-cvs: Document these changes. Remove version numbers from
13444 mentions of build tools, since they change so often. Mention Flex.
13445
13446 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
13447 (gl_USE_SYSTEM_EXTENSIONS): Add.
13448 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
13449 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
13450 does this for us.
13451 (AC_ISC_POSIX): Remove; we no longer support this
13452 ancient OS, as it gets in the way of latest Autoconf & gnulib.
13453 (AC_HEADER_STDC): Remove: we now assume C89 or better.
13454 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
13455 Do not check for C89 headers, except for locale.h which is used
13456 by the Yacc library and must port to K&R hosts.
13457 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
13458 Do not check for C89 functions, except for setlocale which is
13459 used by the Yacc library.
13460 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
13461 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
13462 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
13463 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
13464 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
13465 AM_GNU_GETTEXT): Remove; now done by:
13466 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
13467 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
13468 for us.
13469
13470 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
13471 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
13472 Define to empty, as gnulib.mk will do the rest for us.
13473 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
13474 for us.
13475 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
13476 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
13477
13478 * src/files.c: Include gnulib's xstrndup.h.
13479
13480 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
13481 (REALLOC): Use xnrealloc, for likewise.
13482 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
13483 (strnlen, memrchr): Remove decls; functions no longer used.
13484 Include <stpcpy.h>.
13485
13486 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
13487 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13488 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
13489 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
13490 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
13491 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
13492 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
13493 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
13494 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
13495 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
13496 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
13497 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13498 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
13499 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
13500 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
13501 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
13502 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
13503 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
13504 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
13505 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
13506 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
13507 Remove, as these files are now generated automatically
13508 by bootstrap or automake.
13509
13510 * po/ChangeLog: Remove: all but one entry was a duplicate
13511 of this file, and I moved that 2000-11-02 entry here.
13512
13513 * config/.cvsignore: Add Makefile, depcomp, install-sh.
13514 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
13515 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
13516 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
13517 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
13518 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
13519 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
13520 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
13521 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
13522 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
13523 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
13524 xstrndup.h.
13525 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
13526 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
13527 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
13528 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
13529 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
13530 * src/.cvsignore: Remove *_.c.
13531
13532
13533 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
13534 support it. (The latest stable gzip doesn't.)
13535
135362004-04-27 Paul Eggert <eggert@twinsun.com>
13537
13538 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
13539 case, as stos_ is now used by destructors due to the 2004-02-09
13540 change.
13541
13542 Remove more K&R C support.
13543 * lib/libiberty.y (PARAMS): Remove. All uses removed.
13544 * lib/subpipe.c (errno): Remove decl.
13545 Include <stdlib.h> unconditionally.
13546 (EXIT_FAILURE): Remove macro.
13547 * src/complain.c (vfprintf, strerror): Remove.
13548 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
13549 unconditionally.
13550 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
13551 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
13552 (strchr, strspn, memchr): Remove decls.
13553 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
13554 unconditionally. Do not declare perror.
13555 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
13556 unconditionally.
13557
13558 * src/complain.c (_): Remove useless defn, as system.h defines this.
13559
13560 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
13561 with latest obstack.h.
13562 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
13563 to procedure types, as obstack.h now does that for us.
13564 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
13565
13566 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
13567 so that this include file can stand alone.
13568 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
13569 does this now. Include subpipe.h first after config.h, to
13570 test whether it can stand alone.
13571
13572 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
13573 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
13574 unused declaration.
13575
13576 * tests/synclines.at (%union synch line): Put a dummy member in
13577 the union, because empty unions aren't allowed in C. Caught
13578 by GCC 3.4.0.
13579
135802004-04-13 Jim Meyering <jim@meyering.net>
13581
13582 * src/conflicts.c (conflicts_print): Correct format string typo:
13583 use `%%' to produce literal `%'. (trivial change)
13584
135852004-03-30 Paul Eggert <eggert@twinsun.com>
13586
13587 * src/getargs.c (version): Update copyright year to 2004.
13588
13589 * data/c.m4 (b4_int_type): Use 'short int' rather than
13590 'short', and similarly for 'long', 'unsigned', etc.
13591 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13592 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
13593 yy_yypstack, yydumpstack): Likewise.
13594 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
13595 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
13596 Likewise.
13597 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
13598 yy_stack_print, yyparse): Likewise.
13599 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
13600 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
13601 * lib/bitset.c (bitset_print): Likewise.
13602 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
13603 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13604 * lib/bitsetv.c (bitsetv_dump): Likewise.
13605 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
13606 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
13607 Likewise.
13608 * src/LR0.c (allocate_itemsets): Likewise.
13609 * src/gram.h (rule_number, rule): Likewise.
13610 * src/lalr.h (goto_number): Likewise.
13611 * src/nullable.c (nullable_compute): Likewise.
13612 * src/output.c (prepare_rules): Likewise.
13613 * src/relation.c (relation_print, relation_digraph): Likewise.
13614 * src/relation.h (relation_node): Likewise.
13615 * src/state.h (state_number, transitions, errs, reductions,
13616 struct state): Likewise.
13617 * src/symtab.h (symbol_number, struct symbol): Likewise.
13618 * src/tables.c (vector_number, tally, action_number,
13619 default_goto, goto_actions): Likewise.
13620 * tests/existing.at (GNU Cim Grammar): Likewise.
13621 * tests/regression.at (Web2c Actions): Likewise.
13622
13623 * src/output.c (muscle_insert_short_int_table): Renamed from
13624 muscle_insert_short_table. All uses changed.
13625
136262004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
13627
13628 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
13629 (declaration): Replace expected_conflicts with expected_sr_conflicts.
13630 Add %expect-rr rule.
13631
13632 * src/scan-gram.l: Recognize %expect-rr.
13633
13634 * src/conflicts.h (expected_sr_conflicts): Rename from
13635 expected_conflicts.
13636 (expected_rr_conflicts): Declare.
13637
13638 * src/conflicts.c (expected_sr_conflicts): Rename from
13639 expected_conflicts.
13640 (expected_rr_conflicts): Define.
13641 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
13642 for GLR parsers.
13643 Use expected_sr_conflicts in place of expected_conflicts.
13644 Warn if expected_rr_conflicts used in non-GLR parser.
13645
13646 * doc/bison.texinfo: Add documentation for %expect-rr.
13647
136482004-03-08 Paul Eggert <eggert@gnu.org>
13649
13650 Add support for hex token numbers. Suggested by Odd Arild Olsen in
13651 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
13652
13653 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
13654 in lalr1.cc.
13655 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
13656 * src/scan-gram.l (scan_integer): New function.
13657 ({int}): Use it.
13658 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
13659 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
13660 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
13661 Say "long int", not "long", for uniformity with GNU style.
13662
136632004-02-25 Paul Eggert <eggert@twinsun.com>
13664
13665 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
13666 compilers. This fixes a problem with Intel's C++ compiler being
13667 chatty, reported by Guido Trentalancia in
13668 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
13669
136702004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
13671
13672 Support %destructor and merge error locations in lalr1.cc.
13673
13674 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
13675 (Parser::stos_): Define unconditionally.
13676 (Parser::destruct_): New method. Generate its body with
13677 b4_yydestruct_generate.
13678 (Parser::error_start_): New attribute.
13679 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
13680 token which are discarded.
13681 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
13682 error_start_ when erroneous token are discarded.
13683 (Parser::parse) <yyerrlab1>: Compute the location of the error
13684 token so that it covers all the discarded tokens.
13685 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
13686 it can be called with `%skeleton "lalr1.cc"', and do that.
13687
136882004-02-02 Paul Eggert <eggert@twinsun.com>
13689
13690 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
13691 $(top_srcdir)/lib and ../lib. This fixes a bug reported
13692 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
13693 There's no need to mention top_builddir since Automake does that
13694 for us.
13695 (INCLUDES): Remove, as Automake says it's obsolescent.
13696 Contents migrated into AM_CPPFLAGS as described above.
13697 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
13698
136992004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13700
13701 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
13702 (yyreportSyntaxError): Handle case where lookahead token is
13703 YYEMPTY.
13704
137052004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13706
13707 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
13708 resulting parsers are compilable with C++.
13709
137102003-12-23 Paul Eggert <eggert@twinsun.com>
13711
13712 * config/depcomp, config/install-sh: Sync with Automake 1.8.
13713 * src/output.c (output_skeleton): Rename local var.
13714 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
13715 Bison tokens, as this runs afoul of the 2003-10-07 change that
13716 disallowed NUL bytes in character constants or string literals.
13717
13718 * tests/local.at: Require Autoconf 2.59's Autotest.
13719 * tests/testsuite.at: Don't include local.at, since we now assume
13720 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
13721 including it.
13722 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
13723 multiple inclusion warnings.
13724
137252003-12-02 Akim Demaille <akim@epita.fr>
13726
13727 * doc/bison.texinfo (How Can I Reset the Parser): More about start
13728 conditions.
13729 From Bruno Haible.
13730
137312003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
13732
13733 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
13734
137352003-10-07 Paul Eggert <eggert@twinsun.com>
13736
13737 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
13738 if testsuite doesn't exist.
13739
13740 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
13741 literals, unfortunately.
13742 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
13743 Complain about NUL bytes in character constants or string literals.
13744
137452003-10-05 Paul Eggert <eggert@twinsun.com>
13746
13747 * NEWS: Don't document %no-default-prec, as it's still
13748 too experimental.
13749 * doc/bison.texinfo: Document %no-default-prec only if
13750 the defaultprec flag is set. Normally it's not.
13751
137522003-10-04 Paul Eggert <eggert@twinsun.com>
13753
13754 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
13755 non-modifiable lvalue, instead of a modifiable one.
13756 * doc/bison.texinfo (Actions): Document that $$ can
13757 be assigned to. Do not claim that $$ and $N are
13758 array element references: user code should not rely on this.
13759
137602003-10-01 Paul Eggert <eggert@twinsun.com>
13761
13762 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
13763 (grammar_declaration): Use it.
13764 * src/scan-gram.l: New token %no-default-prec.
13765 * tests/conflicts.at: Revamp tests to use %no-default-prec.
13766 * NEWS, doc/bison.texinfo: Document the above.
13767
137682003-10-01 Akim Demaille <akim@epita.fr>
13769
13770 VCG no longer supports long_straight_phase.
13771
13772 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
13773 * src/print_graph.c (print_graph): Adjust.
13774
137752003-09-30 Frank Heckenbach <frank@g-n-u.de>
13776 and Paul Eggert <eggert@twinsun.com>
13777
13778 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
13779 Table of Symbols): Document %default-prec.
13780 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
13781 (grammar_declaration): Set default_prec on %default-prec.
13782 * src/scan-gram.l (%default-prec): New token.
13783 * src/reader.h (default_prec): New flag.
13784 * src/reader.c: Likewise.
13785 (packgram): Handle it.
13786 * tests/conflicts.at (%default-prec without %prec,
13787 %default-prec with %prec, %default-prec 1): New tests.
13788
137892003-09-30 Paul Eggert <eggert@twinsun.com>
13790
13791 * tests/testsuite.at: Include local.at, not input.at, fixing
13792 a typo in the 2003-08-25 patch.
13793
137942003-08-27 Akim Demaille <akim@epita.fr>
13795
13796 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
13797 GCC warnings.
13798
137992003-08-26 Akim Demaille <akim@epita.fr>
13800
13801 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
13802 "<\#" to avoid magic from Gnus when posting parts of this script.
13803
138042003-08-26 Akim Demaille <akim@epita.fr>
13805
13806 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
13807 (Parser::parse): here.
13808 Adjust: nerrs and errstatus is now replaced by...
13809 (Parser::nerrs_, Parser::errstatus_): New.
13810
138112003-08-25 Akim Demaille <akim@epita.fr>
13812
13813 * config/announce-gen, Makefile.cfg: New.
13814 * Makefile.am: Adjust.
13815 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
13816 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
13817
138182003-08-25 Akim Demaille <akim@epita.fr>
13819
13820 When reducing initial empty rules, Bison parser read an initial
13821 location that is not defined. This results in garbage, and that
13822 affects Bison's own parser. Therefore we need (i) to extend Bison
13823 to support a means to initialize this location, and (ii) to use
13824 this CVS Bison to fix CVS Bison's parser.
13825
13826 * src/reader.h, reader.c (epilogue_augment): Remove, replace
13827 with...
13828 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
13829 * src/parse-gram.y: Adjust.
13830 (%initial-action): New.
13831 (%error-verbose): Since we require CVS Bison, there is no reason
13832 not to use it.
13833 * src/scan-gram.l: Adjust.
13834 * src/Makefile.am (YACC): New, to make sure we use our own parser.
13835 * data/yacc.c (yyparse): Use b4_initial_action.
13836
138372003-08-25 Akim Demaille <akim@epita.fr>
13838
13839 * doc/bison.texinfo: Don't promote stdout for error messages.
13840
138412003-08-25 Akim Demaille <akim@epita.fr>
13842
13843 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
13844 From Alexandre Duret-Lutz.
13845
138462003-08-25 Akim Demaille <akim@epita.fr>
13847
13848 Version 1.875c.
13849
138502003-08-25 Akim Demaille <akim@epita.fr>
13851
13852 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
13853 Use them.
13854
138552003-08-25 Akim Demaille <akim@epita.fr>
13856
13857 * data/lalr1.cc (Parser::reduce_print_): New.
13858 Use it.
13859
138602003-08-25 Akim Demaille <akim@epita.fr>
13861
13862 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
13863 error recovery loops. This patch is based on
13864 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
13865 Also, augment the similarity between lalr1.cc and yacc.c.
13866 Note: the locations of error recovery rules are not correct yet.
13867
13868 * data/lalr1.cc: Comment changes to augment the similarity between
13869 lalr1.cc and yacc.c.
13870 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
13871 (yyerrlab1): Remove, but where it used to be (now the bottom part of
13872 yyerrlab), when hitting EOF, pop the whole stack here instead of
13873 merely falling thru the default error handling mechanism.
13874 (yyerrorlab): New label, with the old contents of YYERROR,
13875 plus the following change: pop the stack of rhs corresponding
13876 to the production that invoked YYERROR. That is how Yacc
13877 behaves (required by POSIX).
13878 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
13879 fail.
13880
138812003-08-25 Akim Demaille <akim@epita.fr>
13882
13883 Tune local.at so that people can "autom4te -l autotest calc.at -o
13884 calc" for instance, to extract a sub test suite.
13885
13886 * tests/testsuite.at: Move the initialization, Autotest version
13887 requirement, and AT_TESTED invocation into...
13888 * tests/local.at: here.
13889 * tests/testsuite.at: Include it for compatibility with Autoconf
13890 2.57.
13891 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
13892 be ignore.
13893
138942003-08-04 Paul Eggert <eggert@twinsun.com>
13895
13896 Rework code slightly to avoid gcc -Wtraditional warnings.
13897 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
13898 The returned value is now stored in *YY0. All callers changed.
13899 * src/output.c (merge_output): Adjust to the above change.
13900
139012003-07-26 Paul Eggert <eggert@twinsun.com>
13902
13903 * data/glr.c (YYASSERT): New macro.
13904 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
13905 yyresolveStates, yyprocessOneStack):
13906 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
13907 Derived from a suggestion by Frank Heckenbach.
13908
139092003-07-25 Paul Eggert <eggert@twinsun.com>
13910
13911 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
13912 for portability to K&R C (after ansi2knr, presumably). See
13913 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
13914 by Frank Heckenbach, though I have omitted the structure-initialization
13915 part of his glr-knr.diff patch since I recall that the Portable
13916 C Compiler didn't require that change.
13917
13918 Let the user specify how to allocate and free memory.
13919 Derived from a suggestion by Frank Heckenbach in
13920 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
13921 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
13922 All uses of free, malloc, realloc changed to use these macros,
13923 and unnecessary casts removed.
13924 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
13925
139262003-07-06 Matthias Mann <MatthiasMann@gmx.de>
13927
13928 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
13929 use s.empty() rather than s == "" to test for empty string; see
13930 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
13931 (trivial change)
13932
139332003-06-25 Akim Demaille <akim@epita.fr>
13934
13935 * config/depcomp, config/install-sh: Update from masters.
13936
139372003-06-20 Paul Eggert <eggert@twinsun.com>
13938
13939 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
13940 and return properly parenthesized result.
13941 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
13942 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13943 Remove unnecessary parentheses from uses.
13944 * doc/bison.texinfo (Location Default Action): Describe the
13945 conventions for parentheses.
13946
139472003-06-19 Paul Eggert <eggert@twinsun.com>
13948
13949 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
13950 yyreportTree): Do not assume that size_t is the same width as int,
13951 when printing sizes. Print sizes using an unsigned format.
13952 Problem reported by Frank Heckenbach in
13953 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
13954
13955 Port to Forte Developer 7 C compiler.
13956 * data/glr.c (struct YYLTYPE): If locations are not being used,
13957 declare a single dummy member, as empty structs do not conform
13958 to the C standard.
13959 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
13960 the Forte Developer 7 C compiler complains that end-of-loop
13961 code is not reached.
13962
139632003-06-17 Paul Eggert <eggert@twinsun.com>
13964
13965 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
13966 avoid warnings from picky compilers about redefinition of PARAMS.
13967
139682003-06-17 Paul Eggert <eggert@twinsun.com>
13969
13970 Version 1.875b.
13971
13972 * NEWS: Document 1.875b.
13973
13974 * lib/bbitset.h: Do not include config.h; that's the includer's job.
13975 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
13976 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
13977 Don't use 'index' in comments, as it's a builtin fn on some hosts.
13978 * lib/bitset_stats.c: Include gettext.h unconditionally, as
13979 per recent gettext manual's suggestion.
13980 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
13981 Use prototypes, not old-style definitions.
13982 * lib/lbitset.c (lbitset_unused_clear): Likewise.
13983 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
13984 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
13985 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
13986 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
13987 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
13988 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
13989 vbitset_or_and_cmp, vbitset_copy): Likewise.
13990
13991 * lib/libiberty.h: Do not include config.h; that's the includer's job.
13992 Do not include <stdlib.h>.
13993 (PARAMS): Define unconditionally for C89.
13994 (ATTRIBUTE_NORETURN): Remove.
13995 (ATTRIBUTE_UNUSED): Define unconditionally.
13996
13997 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
13998 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
13999 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
14000 * lib/vbitset.c, lib/vbitset.h: New files.
14001 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14002 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
14003 from libbitset.
14004
14005 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
14006 `How Can I Reset @code{yyparse}', since texinfo does not allow
14007 arbitrary @ in node names.
14008
14009 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
14010 shouldn't be needed according to the gettext 0.12.1 documentation
14011 but which seem to be needed anyway: codeset.m4 glibc21.m4
14012 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
14013 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
14014 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
14015
14016 * lib/.cvsignore: Add stdbool.h.
14017 * m4/.cvsignore: Add nls.m4, po.m4.
14018
14019 Upgrade to CVS gnulib.
14020 * stdbool_.h: File renamed from stdbool.h.in.
14021 * configure.ac (AM_STDBOOL_H): Invoke this instead of
14022 AC_HEADER_STDBOOL.
14023 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
14024 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
14025 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
14026 (MOSTLYCLEANFILES): New var.
14027 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
14028 (stdbool.h): New rule.
14029 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
14030 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
14031 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
14032 m4/quote.m4: Upgrade to today's gnulib.
14033
14034 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
14035 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
14036 the tests right now.
14037 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
14038 yyerror are declared before use; C99 requires this.
14039
140402003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14041
14042 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
14043 first.
14044 (yyrecoverSyntaxError): Correct the logic for setting and testing
14045 yyerrState.
14046 Correct comment on handling EOF.
14047 Allow states with only a default reduction, rather than failing
14048 (I can't quite reconstruct why these were not allowed before).
14049
14050 Fixes to avoid problem that $-N rules in GLR parsers can cause
14051 buffer overruns, corrupting state.
14052
14053 * src/output.c (prepare_rules): Output max_left_semantic_context
14054 definition.
14055 * src/reader.h (max_left_semantic_context): New variable declaration.
14056 * src/scan-gram.l (max_left_semantic_context): Define.
14057 (handle_action_dollar): Update max_left_semantic_context.
14058 * data/glr.c (YYMAXLEFT): New definition.
14059 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
14060 (yyresolveAction): Ditto.
14061
14062 Fixes to problems with location handling in GLR parsers reported by
14063 Frank Heckenbach (2003/06/05).
14064
14065 * data/glr.c (YYLTYPE): Make trivial if locations not used.
14066 (YYRHSLOC): Add parentheses, and define only if locations used.
14067 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
14068 locations not used.
14069 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
14070 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
14071
14072 * tests/cxx-type.at: Exercise location information; update tests
14073 to differentiate output with and without locations.
14074 Remove forward declarations of yylex and yyerror---caused errors
14075 because default YYLTYPE not yet defined.
14076 Change semantic actions to compute strings, rather than printing
14077 them directly (to test proper passing of semantics values). Change
14078 output to prefix notation and update test data and expected results.
14079 (yylex): Track locations.
14080 (stmtMerge): Return value rather than printing, and include arguments
14081 in value.
14082
140832003-06-03 Paul Eggert <eggert@twinsun.com>
14084
14085 Avoid warnings generated by GCC 2.95.4 when Bison is
14086 configured with --enable-gcc-warnings.
14087 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
14088 yy::]b4_parser_class_name[::translate_,
14089 yy::Stack::operator[] (unsigned),
14090 yy::Stack::operator[] (unsigned) const,
14091 yy::Slice::operator[] (unsigned),
14092 yy::Slice::operator[] (unsigned) const):
14093 Rename local vars to avoid warnings.
14094 * tests/glr-regression.at (Improper handling of embedded actions
14095 and $-N in GLR parsers): Remove unused local variable from yylex.
14096 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
14097 (void) as arg when not pure, since we now assume C89 when building
14098 Bison. Pacify GCC by using parameter.
14099
141002003-06-02 Paul Eggert <eggert@twinsun.com>
14101
14102 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
14103 yy::Location::lines, yy::Location::columns): Rename arguments
14104 to avoid shadowing; this removes a warning generated by GCC 3.3.
14105
141062003-06-01 Paul Eggert <eggert@twinsun.com>
14107
14108 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
14109 to g++, as GCC 3.3 complains if you do it.
14110 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
14111 everything that WARNING_CFLAGS has, except omit warnings
14112 not suitable for C++.
14113 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
14114 * tests/atlocal.in (CXXFLAGS): New var.
14115 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
14116
14117 Fix a GLR parser bug I reported in February; see
14118 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
14119 The problem was that GLR parsers did not conform to the C standard,
14120 because actions like { $1 = $2 + $3; } expanded to expressions
14121 that invoked YYFILL in separate subexpressions, and YYFILL assigned
14122 to a local variable. The C standard says that expressions
14123 like (var = f ()) + (var = f ()) have undefined behavior.
14124 Another problem was that GCC sometimes issues warnings that
14125 yyfill and its parameters are unused.
14126
14127 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
14128 as possibly unused.
14129 (yyfill): New function.
14130 (YYFILL): Use it.
14131 (yyuserAction): Change type of yynormal to bool, so that it matches
14132 the new yyfill signature. Mark it as possibly unused.
14133
14134
14135 Follow up on a bug I reported in February, where a Bison-generated
14136 parser can loop. Provide a test case and a fix for yacc.c. I
14137 don't have a fix for lalr1.cc or for glr.c, unfortunately.
14138 The original bug report is in:
14139 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
14140
14141 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
14142 macro's size was becoming unwieldy.
14143 (yyerrlab): Do not discard an empty lookahead symbol, as this
14144 might destroy garbage.
14145 (yyerrorlab): New label, with the old contents of YYERROR,
14146 plus the following change: pop the stack of rhs corresponding
14147 to the production that invoked YYERROR. That is how Yacc
14148 behaves, and POSIX requires this behavior.
14149 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
14150 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
14151 Define 'alarm' to do nothing if unistd.h is not available.
14152 Add a new rule "exp: '-' error;" to test the above change to
14153 data/yacc.c. Use 'alarm' to abort any test taking longer than
14154 10 seconds, as it's probably looping.
14155 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
14156 Also, the new yacc.c generates two fewer diagnostics for an
14157 existing test.
14158
141592003-05-24 Paul Eggert <eggert@twinsun.com>
14160
14161 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
14162 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
14163 This fixes a problem reported by John Bowman when the Compaq/HP
14164 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
14165 -ansi -Wall -gall).
14166 * data/yacc.c (union yyalloc): Likewise.
14167 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
14168
14169 Switch from 'int' to 'bool' where that makes sense.
14170
14171 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
14172 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
14173 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
14174 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
14175 Return or accept bool, not int. All callers changed.
14176 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
14177 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
14178 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
14179 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
14180 bitset_or_and_cmp_): Likewise.
14181 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
14182 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
14183 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
14184 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
14185 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
14186 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
14187 bitset_stats_or_and_cmp): Likewise.
14188 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
14189 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
14190 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
14191 ebitset_xor_cmp): Likewise.
14192 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
14193 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
14194 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
14195 lbitset_xor_cmp): Likewise.
14196 * lib/bbitset.h: Include <stdbool.h>.
14197 (struct bitset_vtable): The following members now return bool, not
14198 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
14199 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
14200 or_and_cmp).
14201 * src/conflicts.c (count_rr_conflicts): Likewise.
14202 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
14203 All uses changed.
14204 * lib/ebitset.c (ebitset_obstack_init): Likewise.
14205 * lib/lbitset.c (lbitset_obstack_init): Likewise.
14206 * src/getargs.c (debug_flag, defines_flag, locations_flag,
14207 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14208 graph_flag): Likewise.
14209 * src/getargs.h (debug_flag, defines_flag, locations_flag,
14210 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14211 graph_flag): Likewise.
14212 * src/output.c (error_verbose): Likewise.
14213 * src/output.h (error_verbose): Likewise.
14214 * src/reader.c (start_flag, typed): Likewise.
14215 * src/reader.h (typed): Likewise.
14216 * src/getargs.c (LOCATIONS_OPTION): New constant.
14217 (long_options, getargs): Use it.
14218 * src/lalr.c (build_relations): Use bool, not int.
14219 * src/nullable.c (nullable_compute): Likewise.
14220 * src/print.c (print_reductions): Likewise.
14221 * src/tables.c (action_row, pack_vector): Likewise.
14222 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
14223 * src/output.c (prepare): Use it.
14224 * src/output.c (token_definitions_output,
14225 symbol_destructors_output, symbol_destructors_output): Use string,
14226 not boolean integer, to keep track of whether to output separator.
14227 * src/print_graph.c (print_core): Likewise.
14228 * src/state.c (state_rule_lookaheads_print): Likewise.
14229
14230 * config/install-sh: Sync from automake 1.7.5.
14231
142322003-05-14 Paul Eggert <eggert@twinsun.com>
14233
14234 * src/parse-gram.y (rules_or_grammar_declaration): Require a
14235 semicolon after a grammar declaration, in the interest of possible
14236 future changes to the Bison input language.
14237 Do not allow a stray semicolon at the start of the grammar.
14238 (rhses.1): Allow one or more semicolons after any rule, including
14239 just before "|" as required by POSIX.
14240 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
14241 grammar.
14242
142432003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
14244
14245 %parse-param support for lalr1.cc.
14246
14247 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
14248 b4_cc_constructor_calls, b4_cc_constructor_call,
14249 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
14250 definitions.
14251 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
14252 parse-param arguments.
14253 (yy::b4_parser_class_name): Declare instance variables to
14254 hold parse-param arguments.
14255 * tests/calc.at: s/value/semantic_value/ because value clashes
14256 with a member of yy::b4_parser_class_name. Adjust C++ code
14257 to handle %parse-param. Enable %parse-param test in C++.
14258
142592003-05-12 Paul Eggert <eggert@twinsun.com>
14260
14261 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
14262 English a bit. Fix fclose typo. Change "const char" to "char
14263 const", and use ANSI C rather than K&R for "main". Suggest
14264 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
14265 and suggest yy_switch_to_buffer.
14266
142672003-05-05 Paul Eggert <eggert@twinsun.com>
14268
14269 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
14270 C89. This avoids a diagnostic on compilers that define __STDC__
14271 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
14272 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
14273
142742003-05-03 Paul Eggert <eggert@twinsun.com>
14275
14276 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
14277 Do not overrun array bounds.
14278 This should fix a bug reported today by Olatunji Oluwabukunmi in
14279 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
14280
142812003-04-29 Akim Demaille <akim@epita.fr>
14282
14283 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
14284 * src/getargs.c, src/getargs.h: here, as bool, not int.
14285 (nondeterministic_parser): New.
14286 * src/parse-gram.y, src/scan-gram.l: Support
14287 %nondeterministic-parser.
14288 * src/output.c (prepare): Use nondeterministic_parser instead
14289 of glr_parser where appropriate.
14290 * src/tables.c (conflict_row, action_row, save_row)
14291 (token_actions, token_actions, pack_vector): Ditto.
14292
142932003-04-29 Akim Demaille <akim@epita.fr>
14294
14295 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
14296
142972003-04-29 Akim Demaille <akim@epita.fr>
14298
14299 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
14300 with %pure-parser and %locations to exercise the patch from Yakov
14301 Markovitch below.
14302
143032003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
14304
14305 * data/yacc.c: (b4_lex_param): Corrected for the case where
14306 %lex-param is provided and %pure-parser isn't.
14307
143082003-04-27 Paul Eggert <eggert@twinsun.com>
14309
14310 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
14311 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
14312 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
14313 if it is not defined.
14314 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
14315
143162003-04-26 Paul Eggert <eggert@twinsun.com>
14317
14318 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
14319 Declare to be of type suitable for the ninf value itself, not of
14320 type suitable for the corresponding table, since the latter might
14321 be unsigned but the ninf value might be negative. This fixes a
14322 bug reported by Alexandre Duret-Lutz in
14323 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
14324
14325 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
14326 invokes it. We shouldn't invoke it twice because it will attempt
14327 to put error.o in the archive twice. This fixes a glitch reported
14328 by Martin Mokrejs in
14329 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
14330
143312003-04-21 Paul Eggert <eggert@twinsun.com>
14332
14333 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
14334 to gnulib.
14335
143362003-04-21 Yakov Markovitch <Markovitch@iso.ru>
14337
14338 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
14339 Fix obvious typo that results in uncompilable GLR parsers
14340 when both %pure-parser and %locations are used. (trivial change)
14341
143422003-04-17 Paul Eggert <eggert@twinsun.com>
14343
14344 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
14345 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
14346 Do not insert the expected token via unput, as this runs afoul
14347 of a POSIX-compatibility bug in flex 2.5.31.
14348 All uses changed to BEGIN the parent state,
14349 since we no longer insert the expected token via unput.
14350 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
14351 that is no longer emitted after the above change.
14352
14353 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
14354 the first one. This change is from Paul Hilfinger, and it fixes
14355 regression reported by Werner Lemberg in
14356 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
14357
14358 (resolve_sr_conflict): Don't invoke state_errs_set
14359 unless one or more tokens have been explicitly made errors.
14360 Otherwise, the above change causes Bison to abort.
14361
14362 * tests/existing.at (GNU pic Grammar): New test case, taken from
14363 Lemberg's email.
14364
143652003-03-31 Akim Demaille <akim@epita.fr>
14366
14367 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
14368
143692003-03-31 Akim Demaille <akim@epita.fr>
14370
14371 * src/output.c (prepare_symbols): Avoid trailing spaces in the
14372 output.
14373
143742003-03-31 Akim Demaille <akim@epita.fr>
14375
14376 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
14377 From Paul Hilfinger.
14378
143792003-03-29 Akim Demaille <akim@epita.fr>
14380
14381 * m4/error.m4: Do not put under dynamic conditions some code which
14382 expansion is under static control.
14383
143842003-03-29 Akim Demaille <akim@epita.fr>
14385
14386 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
14387
143882003-03-29 Akim Demaille <akim@epita.fr>
14389
14390 * doc/bison.texinfo (Strings are Destroyed): New.
14391
143922003-03-13 Paul Eggert <eggert@twinsun.com>
14393
14394 * .cvsignore: Add configure.lineno.
14395 * src/.cvsignore: Add yacc.
14396 * tests/.cvsignore: Add testsuite.log.
14397 * doc/fdl.texi: Sync with latest FSF version.
14398
143992003-03-12 Paul Eggert <eggert@twinsun.com>
14400
14401 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
14402 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
14403 cursor, instead of leaving it undefined. This fixes a bug
14404 reported by Tim Van Holder in
14405 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
14406 * tests/input.at (Torturing the Scanner): Test the scanner on
14407 an empty input file, which was Tim Van Holder's test case.
14408
14409 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
14410 <sys/resource.h> can be included, include sys/time.h and
14411 sys/times.h first, if available. This works around the SunOS
14412 4.1.4 porting bug reported by Bruce Becker in
14413 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
14414
14415 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
14416 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
14417 AC_HEADER_SYS_WAIT.
14418
14419 Merge changes from gnulib. This was prompted because the CVS
14420 snapshot didn't build on Solaris 7 due to strnlen problems.
14421
14422 These changes need to be merged back into gnulib:
14423 * lib/hash.c: Include <stdbool.h> unconditionally.
14424 * m4/onceonly.m4 (m4_quote): New macro.
14425 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
14426 Quote AC_FOREACH variable-expansions properly.
14427 The 2003-01-03 obstack.h change also needs merging.
14428 {end of changes requiring merging}
14429
14430 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14431 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
14432 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
14433 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
14434 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
14435 New files, imported from gnulib.
14436 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
14437 above.
14438
14439 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
14440 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
14441 gnulib sources.
14442
14443 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
14444 Add.
14445 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
14446 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
14447 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
14448 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
14449 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
14450 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
14451 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
14452 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
14453 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
14454 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
14455 (jm_PREREQ_ARGMATCH): Remove.
14456 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
14457 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
14458
14459 * src/system.h: Include <stdbool.h> unconditionally.
14460
14461 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
14462 assuming at least C89 in the bitset code for some time now.
14463
144642003-03-03 Akim Demaille <akim@epita.fr>
14465
14466 * ro.po: New.
14467
144682003-03-02 Akim Demaille <akim@epita.fr>
14469
14470 * doc/bison.texinfo (Table of Symbols): Reactivate the
14471 documentation for %lex-param, and %parse-param.
14472
144732003-03-02 Akim Demaille <akim@epita.fr>
14474
14475 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
14476 generate verbose error messages.
14477 Use the number of tokens as an upper bound in yytname, as it
14478 cannot be a non terminal.
14479
144802003-03-02 Akim Demaille <akim@epita.fr>
14481
14482 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
14483 message.
14484
144852003-03-02 Akim Demaille <akim@epita.fr>
14486
14487 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
14488 Use them to exercise yycheck overrun.
14489 Based on Andrew Suffield's grammar.
14490
144912003-03-02 Akim Demaille <akim@epita.fr>
14492
14493 Create tests/local.at for Bison generic testing macros.
14494
14495 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
14496 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
14497 This new file.
14498 * tests/calc.at (AT_CHECK_CALC): Adjust.
14499 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
14500 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
14501 * tests/local.at: here.
14502 (AT_COMPILE_CXX): Tags the tests using it as c++.
14503 Ignore the test if CXX is not functional.
14504
145052003-03-01 Paul Eggert <eggert@twinsun.com>
14506
14507 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
14508 not loc->end, since loc->end might contain garbage and this leads
14509 to undefined behavior on some platforms.
14510 (id_loc, token_start): Use (IF_LINTed) initial values that do not
14511 depend on *loc, so that the reader doesn't give the the false
14512 impression that *loc is initialized.
14513 (<INITIAL>"%%"): Do not bother setting code_start, since its value
14514 does not survive the return.
14515
145162003-03-01 Akim Demaille <akim@epita.fr>
14517
14518 * src/scan-gram.l (code_start): Always initialize it when entering
14519 into yylex, as SC_EPILOGUE is activated *before* the corresponding
14520 yylex invocation. An alternative would be making it static, but
14521 then it starts with the second %%'s beginning, instead of its end.
14522
145232003-02-28 Paul Eggert <eggert@twinsun.com>
14524
14525 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
14526 around a UnixWare 7.1.1 porting bug reported by John Hughes in
14527 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
14528
145292003-02-26 Paul Eggert <eggert@twinsun.com>
14530
14531 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
14532 Remove Sequent/Pyramid discussion (nobody uses them any more).
14533 Merge VMS and MS-DOS discussion; these ports may well be dead
14534 but let's keep mentioning them for now. Put <> around email
14535 addresses. Add copyright notice.
14536
145372003-02-24 Paul Eggert <eggert@twinsun.com>
14538
14539 * data/glr.c (yy_reduce_print): yylineno -> yylno,
14540 to avoid collision with flex use of yylineno.
14541 Problem reported by Bruce Lilly in
14542 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
14543 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
14544 * data/yacc.c (yy_reduce_print): Likewise.
14545
14546 * config/depcomp: Sync with Automake 1.7.3.
14547
145482003-02-21 Akim Demaille <akim@epita.fr>
14549
14550 * data/lalr1.cc: Use temporary variables instead of casts to
14551 change integer types.
14552 Suggested by Paul Eggert.
14553
145542003-02-21 Akim Demaille <akim@epita.fr>
14555
14556 * doc/bison.texinfo: Use "location" consistently to refer to @n,
14557 to avoid confusions with lalr1.cc's notion of Position.
14558 Suggested by Paul Eggert.
14559
145602003-02-20 Akim Demaille <akim@epita.fr>
14561
14562 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
14563 before initial_columns.
14564 (location.hh): Use consistent variable names when defining the
14565 operator<<.
14566 Use "last" so that we subtract from Positions, not from unsigned.
14567
145682003-02-20 Akim Demaille <akim@epita.fr>
14569
14570 * data/lalr1.cc (position.hh): New subfile, including the extended
14571 and Doxygen'ed documentation of class Position.
14572 (location.hh): Use it.
14573 Document a` la Doxygen.
14574 With the help of Benoit Perrot.
14575
145762003-02-20 Akim Demaille <akim@epita.fr>
14577
14578 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
14579 AT_YACC_IF.
14580 Redefine AT_YYERROR_SEES_LOC_IF using it.
14581 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
14582 not defined.
14583 Don't use the location in yy::Parser::error_ and
14584 yy::Parser::print_ when not %locations.
14585 Activate more lalr1.cc tests.
14586
145872003-02-19 Akim Demaille <akim@epita.fr>
14588
14589 * data/lalr1.cc: When displaying a line number, be sure to make it
14590 an int.
14591
145922003-02-19 Akim Demaille <akim@epita.fr>
14593
14594 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
14595 Remove, useless.
14596 (YYABORT, YYACCEPT, YYERROR): New.
14597 * tests/calc.at: Renable the lalr1.cc test.
14598
145992003-02-19 Akim Demaille <akim@epita.fr>
14600
14601 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
14602 error recovery, mixing with/without pops and discarding of the
14603 lookahead.
14604 Exercise YYERROR.
14605 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
14606
146072003-02-17 Paul Eggert <eggert@twinsun.com>
14608
14609 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
14610 * tests/testsuite.at (AT_COMPILE): Use them.
14611 This fixes the testsuite problem reported by Robert Lentz in
14612 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
14613
146142003-02-12 Paul Eggert <eggert@twinsun.com>
14615
14616 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
14617 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
14618 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
14619 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
14620 Check for malloc failure, for consistency with yacc.c.
14621 (yytname_size): Remove, for consistency with yacc.c.
14622
14623 The bug still remains in data/lalr1.cc, as I didn't have time
14624 to fix it there.
14625
146262003-02-06 Akim Demaille <akim@epita.fr>
14627
14628 * configure.ac (GXX): Rename as...
14629 (CXX): this, to keep the original Autoconf semantics.
14630 Require 2.57.
14631 * data/lalr1.cc: Fix b4_copyright invocations.
14632 If YYDEBUG is not defined, don't depend upon name_ being defined.
14633 (location.hh): Include string and iostream.
14634 (Position::filename): New member.
14635 (Position::Position ()): New.
14636 (operator<< (Position)): New.
14637 (operator- (Position, int)): New.
14638 (Location::first, Location::last): Rename as...
14639 (Location::begin, Location::end): these, to mock the conventional
14640 iterator names.
14641 (operator<< (Location)): New.
14642 * tests/atlocal.in (CXX): New.
14643 * tests/testsuite.at (AT_COMPILE_CXX): New.
14644 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
14645 locations in a more synthetic way.
14646 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
14647 lalr1.cc is used.
14648 Adjust the C locations to match those from Emacs: first column is
14649 column 0.
14650 Change all the expected results.
14651 Conform to the GCS: simplify the locations when applicable.
14652 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
14653 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
14654 these CPP macros with the m4 macros new defined by...
14655 (AT_CHECK_PUSHDEFS): this, i.e.:
14656 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
14657 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
14658 New macros.
14659 (AT_CHECK_POPDEFS): Undefine them.
14660 (AT_CHECK_CALC_LALR1_CC): New.
14661 Use it for the first lalr1.cc test.
14662
146632003-02-04 Akim Demaille <akim@epita.fr>
14664
14665 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
14666 Location as is defined.
14667
146682003-02-04 Akim Demaille <akim@epita.fr>
14669
14670 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
14671 name_ being defined.
14672
146732003-02-03 Paul Eggert <eggert@twinsun.com>
14674
14675 * src/gram.h (start_symbol): Remove unused decl.
14676
14677 Use more-consistent naming conventions for local vars.
14678
14679 * src/derives.c (derives_compute): Change type of local var from
14680 int to rule_number.
14681 * src/gram.c (grammar_rules_partial_print): Likewise.
14682 * src/print.c (print_core): Likewise.
14683 * src/reduce.c (reduce_grammar_tables): Likewise.
14684
14685 * src/gram.c (grammar_dump): Change name of item_number *
14686 local var from r to rp.
14687 * src/nullable.c (nullable_compute): Likewise.
14688
14689 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
14690
14691 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
14692 for symbol or symbol_number var.
14693 * src/reader.c (grammar_start_symbol_set): Likewise.
14694 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
14695 Likewise.
14696 * src/state.c (transitions_to): Likewise.
14697 * src/state.h: Likewise.
14698 * src/tables.c (symbol_number_to_vector_number): Likewise.
14699
14700 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
14701 char * var.
14702
14703 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
14704 var.
14705
14706 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
14707 var.
14708
14709 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
14710 Use str, not s, for char * var. Use ch, not c, for character var.
14711 Use size for size var.
14712
14713 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
14714 char * var.
14715 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
14716 uniqstr var.
14717 * src/uniqstr.h: Likewise.
14718
14719 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14720 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14721 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
14722 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
14723 param to have same name as that of enum, so that we don't use
14724 "s" to stand for a non-state.
14725
147262003-02-02 Akim Demaille <akim@epita.fr>
14727
14728 * src/scan-skel.l: Scan more than one inert character per yylex
14729 invocation.
14730
147312003-02-01 Paul Eggert <eggert@twinsun.com>
14732
14733 Version 1.875a.
14734
14735 * po/LINGUAS: Add ms.
14736
147372003-01-30 Akim Demaille <akim@epita.fr>
14738
14739 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
14740
147412003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14742
14743 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
14744 of $1.
14745
14746 Changes in response to error report by S. Eken: GLR mode does not
14747 handle negative $ indices or $ indices in embedded rules correctly.
14748 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
14749
14750 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
14751 (b4_rhs_location): Ditto.
14752 (yyfill): New function to copy from stack tree into array
14753 incrementally.
14754 (yyuserAction): Modify to allow incremental move of semantic values
14755 to rhs array when in GLR mode.
14756 Define YYFILL to use in user-defined actions to fill semantic array
14757 as needed.
14758 Remove dummy use of yystack, as there is now a guaranteed use.
14759 (yydoAction): Modify to allow incremental move of semantic values
14760 to rhs array when in GLR mode.
14761 (yyresolveAction): Ditto.
14762 (yyglrShiftDefer): Update comment.
14763 (yyresolveStates): Use X == NULL for pointers, not !X.
14764 (yyglrReduce): Ditto.
14765 (yydoAction): Ditto
14766
14767 * tests/glr-regr1.at: Rename to ...
14768 * tests/glr-regression.at: Add new regression test for the problems
14769 described above (adapted from S. Eken).
14770 Update copyright notice.
14771 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
14772 * tests/Makefile.am: Ditto.
14773
147742003-01-28 Paul Eggert <eggert@twinsun.com>
14775
14776 * data/lalr1.cc: Do not use @output_header_name@ unless
14777 b4_defines_flag is set. This fixes two bugs reported by
14778 Tim Van Holder in
14779 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
14780 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
14781
147822003-01-21 Paul Eggert <eggert@twinsun.com>
14783
14784 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
14785 we don't need to worry about yyerrlab1 being reported as an
14786 "unused label" by non-GCC C compilers. The downside is that if
14787 locations are used then a couple of statements are duplicated each
14788 time YYERROR is invoked, but the upside is that the warnings
14789 should vanish.
14790 (yyerrlab1): Move code to YERROR.
14791 (yyerrlab2): Remove. Change uses back to yyerrlab1.
14792 This reverts some of the 2002-12-27 change.
14793
147942003-01-17 Paul Eggert <eggert@twinsun.com>
14795
14796 * src/output.c (symbol_printers_output): Fix typo that led
14797 to core dump. Problem reported by Antonio Rus in
14798 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
14799
148002003-01-13 Akim Demaille <akim@epita.fr>,
14801 Quoc Peyrot <chojin@lrde.epita.fr>,
14802 Robert Anisko <anisko_r@lrde.epita.fr>
14803
14804 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
14805 when the stacks contain one element, as the loop would otherwise
14806 free the last state, and then use the top state (the one we just
14807 popped). This means that the initial elements will not be freed
14808 explicitly, as is the case in yacc.c; it is not a problem, as
14809 these elements have fake values.
14810
148112003-01-11 Paul Eggert <eggert@twinsun.com>
14812
14813 * NEWS: %expect-violations are now just warnings, reverting
14814 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
14815 bootstrapping problem reported by Matthias Klose; see
14816 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
14817 * src/conflicts.c (conflicts_print): Likewise.
14818 * tests/conflicts.at (%expect not enough, %expect too much,
14819 %expect with reduce conflicts): Likewise.
14820 * doc/bison.texinfo (Expect Decl): Document this. Also mention
14821 that the warning is enabled if the number of conflicts changes
14822 (not necessarily increases).
14823
14824 * src/getargs.c (version): Update copyright year.
14825
148262003-01-09 Akim Demaille <akim@epita.fr>
14827
14828 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
14829
148302003-01-08 Paul Eggert <eggert@twinsun.com>
14831
14832 * Makefile.maint (WGETFLAGS):
14833 New macro, containing "-C off" to disable proxy caches.
14834 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
14835 (rel-check): Use $(WGET) instead of wget.
14836
148372003-01-06 Paul Eggert <eggert@twinsun.com>
14838
14839 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
14840 the GLR paper of Scott, Johnstone and Hussain.
14841
148422003-01-04 Paul Eggert <eggert@twinsun.com>
14843
14844 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
14845 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
14846 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
14847 (EXTRA_LIBRARIES): New var, for liby.a.
14848 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
14849 (EXTRA_SCRIPTS): New var, for yacc.
14850
14851 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
14852 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
14853 Problem reported by Nelson H. F. Beebe.
14854
148552003-01-03 Paul Eggert <eggert@twinsun.com>
14856
14857 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
14858 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
14859 when compiling Bison 1.875's `bitset bset = obstack_alloc
14860 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
14861
14862 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
14863 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
14864 grow to a huge size with typical invocation.
14865
14866 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
14867 Use the pattern recommended by Autoconf 2.57, except also protect
14868 against double-definition.
14869 * src/system.h: Likewise.
14870 Portability issues reported by Nelson H. F. Beebe.
14871
14872 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
14873 All uses changed. Provide a definition in both C and C++.
14874 (yytrue, yyfalse): Define even if defined (__cplusplus).
14875
14876 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
14877 Reported by Nelson H. F. Beebe.
14878
14879 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
14880
148812003-01-02 Paul Eggert <eggert@twinsun.com>
14882
14883 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
14884 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
14885 Bug reported by Nelson H. F. Beebe.
14886
148872003-01-01 Paul Eggert <eggert@twinsun.com>
14888
14889 * Version 1.875.
14890
148912002-12-30 Paul Eggert <eggert@twinsun.com>
14892
14893 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
14894 Moved here from...
14895 (<INITIAL>","): Here. This causes stray "," to be treated
14896 more uniformly.
14897
14898 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
14899 last brace in braced code when not in Yacc mode, for compatibility
14900 with Bison 1.35. This resurrects the 2001-12-15 patch to
14901 src/reader.c.
14902
14903 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
14904 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
14905
149062002-12-28 Paul Eggert <eggert@twinsun.com>
14907
14908 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
14909 that of SYM's type. This fixes Debian bug 168069, reported by
14910 Thomas Olsson.
14911
149122002-12-28 Paul Eggert <eggert@twinsun.com>
14913
14914 Version 1.75f.
14915
14916 Switch back to the Yacc style of conflict reports, undoing some
14917 of the 2002-07-30 change.
14918 * doc/bison.texinfo (Understanding): Use Yacc style for
14919 conflict reports. Also, use new way of locating rules.
14920 * src/conflicts.c (conflict_report):
14921 Renamed from conflict_report_yacc, removing the old
14922 'conflict_report'. Translate the entire conflict report at once,
14923 so that we don't assume that "," has the same interpretation in
14924 all languages.
14925 (conflicts_output): Use Yacc-style conflict report for each state,
14926 instead of our more-complicated style.
14927 (conflicts_print): Use Yacc-style conflict report, except print
14928 the input file name when not emulating Yacc.
14929 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
14930 Conflicted Reduction, %expect not enough, %expect too much,
14931 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
14932 * tests/existing.at (GNU Cim Grammar): Likewise.
14933 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
14934
14935 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
14936 fatal): Don't invoke fflush; it's not needed and it might even be
14937 harmful for stdout, as stdout might not be open.
14938 * src/reduce.c (reduce_print): Likewise.
14939
149402002-12-27 Paul Eggert <eggert@twinsun.com>
14941
14942 Fix a bug where error locations were not being recorded correctly.
14943 This problem was originally reported by Paul Hilfinger in
14944 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
14945
14946 * data/yacc.c (yyparse): New local var yylerrsp, to record the
14947 top of the location stack's error locations.
14948 (yyerrlab): Set it. When discarding a token, push its location
14949 onto yylerrsp so that we don't lose track of the error's end.
14950 (yyerrlab1): Now is only the target of YYERROR, so that we can
14951 properly record the location of the action that failed. For GCC
14952 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
14953 GCC warning about yyerrlab1 being unused if YYERROR is unused.
14954 (yyerrlab2): New label, which yyerrlab now falls through to.
14955 Compute the error's location by applying YYLLOC_DEFAULT to
14956 the locations of all the symbols that went into the error.
14957 * doc/bison.texinfo (Location Default Action): Mention that
14958 YYLLOC_DEFAULT is also invoked for syntax errors.
14959 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14960 Error locations include the locations of all the tokens that were
14961 discarded, not just the last token.
14962
149632002-12-26 Paul Eggert <eggert@twinsun.com>
14964
14965 * src/files.c: Include quote.h.
14966 (compute_output_file_names): Warn if we detect conflicting
14967 outputs to the same file. This should catch the misunderstanding
14968 exemplified by Debian Bug 165349, reported by Bruce Stephens..
14969
14970 * src/conflicts.c (conflicts_print): If the user specifies
14971 "%expect N", report an error if there are any reduce/reduce
14972 conflicts. This is what the manual says should happen.
14973 This fixes Debian bug 130890, reported by Anthony DeRobertis.
14974 * tests/conflicts.at (%expect with reduce conflicts): New test.
14975
14976 Don't use m4_include on relative file names, as it doesn't work as
14977 desired if there happens to be a file with that name under ".".
14978
14979 * m4sugar/version.m4: Remove; it was included but it wasn't used.
14980 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
14981 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
14982 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
14983 * src/output.c (output_skeleton): Use full path names when
14984 specifying a file to include; don't rely on include path, as
14985 it's unreliable when the working file contains a file with
14986 that name.
14987
149882002-12-25 Paul Eggert <eggert@twinsun.com>
14989
14990 Remove obsolete references to bison.simple and bison.hairy.
14991 Problem mentioned by Aubin Mahe in
14992 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
14993 * data/glr.c: Comment fix.
14994 * doc/bison.1: Remove references. Also, mention "yacc".
14995
14996 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
14997 with -g option.
14998
14999 * src/parse-gram.y (declaration): Use enum "report_states" rather
15000 than its numeric value 1.
15001
15002 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
15003 opening a new one. This fixes Debian bug 165349, reported by
15004 Bruce Stephens.
15005
150062002-12-24 Paul Eggert <eggert@twinsun.com>
15007
15008 Version 1.75e.
15009
15010 * Makefile.maint (cvs-update): Don't assume that the shell
15011 supports $(...), as Solaris sh doesn't.
15012
15013 * src/parse-gram.y (lloc_default): Remove test for empty
15014 nonterminals at the end, since it didn't change the result.
15015
150162002-12-24 Paul Eggert <eggert@twinsun.com>
15017
15018 If the user does not define YYSTYPE as a macro, Bison now declares it
15019 using typedef instead of defining it as a macro. POSIX requires this.
15020 For consistency, YYLTYPE is also declared instead of defined.
15021
15022 %union directives can now have a tag before the `{', e.g., the
15023 directive `%union foo {...}' now generates the C code
15024 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
15025 The default union tag is `YYSTYPE', for compatibility with Solaris 9
15026 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
15027 instead of `yyltype'.
15028
15029 `yystype' and `yyltype' are now obsolescent macros instead of being
15030 typedefs or tags; they are no longer documented and will be
15031 withdrawn in a future release.
15032
15033 * data/glr.c (b4_location_type): Remove.
15034 (YYSTYPE): Renamed from yystype.
15035 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
15036 (struct YYLTYPE): Renamed from struct yyltype.
15037 (YYLTYPE): Renamed from yyltype.
15038 (yyltype, yystype): New (and obsolescent) macros,
15039 for backward compatibility.
15040 * data/yacc.c: Likewise.
15041
15042 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
15043 does not specify a union tag. This is for compatibility with
15044 Solaris 9 yacc.
15045
15046 * src/parse-gram.y (add_param): 2nd arg is now char * not char
15047 const *, since it is now modified by stripping surrounding { }.
15048 (current_braced_code): Remove.
15049 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
15050 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
15051 trailing " {...}". Now of type <chars>.
15052 (grammar_declaration): Adjust to bundled tokens.
15053 (code_content): Remove; stripping is now done by add_param.
15054 (print_token_value): Print contents of bundled tokens.
15055 (token_name): New function.
15056
15057 * src/reader.h (braced_code, current_braced_code): Remove.
15058 (token_name): New decl.
15059
15060 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
15061 token_type, not braced_code code_kind. All uses changed.
15062 (SC_PRE_CODE): New state, for scanning after a keyword that
15063 has (or usually has) an immediately-following braced code.
15064 (token_type): New local var, to keep track of which token type
15065 to return when scanning braced code.
15066 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
15067 <INITIAL>"%parse-param", <INITIAL>"%printer",
15068 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
15069 instead of returning a token type immediately.
15070 (<INITIAL>"{"): Set token type.
15071 (<SC_BRACED_CODE>"}"): Use it.
15072 (handle_action_dollar, handle_action_at): Now returns bool
15073 indicating success. Fail if ! current_rule; this prevents a core dump.
15074 (handle_symbol_code_dollar, handle_symbol_code_at):
15075 Remove; merge body into caller.
15076 (handle_dollar, handle_at): Complain in invalid contexts.
15077
15078 * NEWS, doc/bison.texinfo: Document the above.
15079 * NEWS: Fix years and program names in copyright notice.
15080
150812002-12-17 Paul Eggert <eggert@twinsun.com>
15082
15083 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
15084 Reporting, Table of Symbols): Omit mentions of %lex-param and
15085 %parse-param from the documentation for now.
15086
150872002-12-15 Paul Eggert <eggert@twinsun.com>
15088
15089 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
15090 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
15091 lookahead symbol, and which sets yychar in parser actions) and it
15092 disagreed with the Bison documentation. Bug
15093 reported by Andrew Walrond.
15094
15095 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
15096 as the caller now does that.
15097 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
15098 (YYEMPTY): Parenthesize right hand side, since others use it.
15099 (yyparse): Don't assume that our generated code is the only code
15100 that sets yychar.
15101
151022002-12-13 Paul Eggert <eggert@twinsun.com>
15103
15104 Version 1.75d.
15105
15106 POSIX requires a "yacc" command.
15107 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
15108 (MOSTLYCLEANFILES): Add yacc.
15109 (yacc): New rule.
15110 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
15111 as an alias for bison y.
15112
15113 * po/LINGUAS: Add da.
15114
15115 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
15116 problem with latest <getopt.h>.
15117 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
15118
15119 * doc/fdl.texi: Upgrade to 1.2.
15120 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
15121 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
15122 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
15123 gnulib.
15124 * config/install-sh: Sync with autotools.
15125
15126 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
15127 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
15128 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
15129 locations are requested.
15130 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
15131 locations are requested.
15132
151332002-12-12 Paul Eggert <eggert@twinsun.com>
15134
15135 Remove unportable casts and storage allocation tricks.
15136 While we're at it, remove almost all casts, since they
15137 usually aren't needed and are a sign of trouble.
15138
15139 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
15140
15141 * src/derives.c (derives_compute): Do not subtract NTOKENS from
15142 the pointer DSET returned by malloc; this isn't portable.
15143 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
15144 Similarly for DERIVES.
15145 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
15146 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
15147 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
15148
15149 * src/derives.c (derives_compute): Do not bother invoking
15150 int_of_rule_number, since rule numbers are integers.
15151
15152 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
15153 rather than XMALLOC (char, N).
15154
15155 * src/files.c (filename_split): Rewrite to avoid cast.
15156
15157 * src/gram.h (symbol_number_as_item_number,
15158 item_number_as_symbol_number, rule_number_as_item_number,
15159 item_number_as_rule_number):
15160 Now inline functions rather than macros, to avoid casts.
15161 * src/state.h (state_number_as_int): Likewise.
15162 * src/tables.c (state_number_to_vector_number,
15163 symbol_number_to_vector_number): Likewise.
15164
15165 * src/gram.h (int_of_rule_number): Remove; no longer used.
15166
15167 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
15168 since the resulting storage is always stored into.
15169
15170 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
15171 where it's needed.
15172
15173 * src/muscle_tab.c (muscle_m4_output):
15174 Now inline. Return bool, not int.
15175 * src/state.c (state_compare): Likewise.
15176 * src/symtab.c (symbol_check_defined,
15177 symbol_check_alias_consistency, symbol_pack, symbol_translation,
15178 hash_compare_symbol, hash_symbol):
15179 Likewise.
15180 * src/uniqstr.c (uniqstr_print): Likewise.
15181 * src/muscle_tab.c (muscle_m4_output_processor):
15182 New function, to avoid casts.
15183 * src/state.c (state_comparator, stage_hasher): Likewise.
15184 * src/symtab.c (symbol_check_defined_processor,
15185 symbol_check_alias_consistency_processor, symbol_pack_processor,
15186 symbol_translation_processor, hash_symbol_comparator,
15187 hash_symbol_hasher): Likewise.
15188 * src/uniqstr.c (uniqstr_print_processor): Likewise.
15189 * src/muscle_tab.c (muscles_m4_output):
15190 Use new functions instead of casting old functions unportably.
15191 * src/state.c (state_hash_new): Likewise.
15192 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
15193 symbols_token_translations_init):
15194 Likewise.
15195 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
15196
15197 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
15198 var instead of casting to long, to avoid casts.
15199 (prepare_states): Use MALLOC rather than alloca, so that we don't
15200 have to worry about alloca.
15201 * src/state.c (state_hash_lookup): Likewise.
15202
15203 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
15204 local var instead of casting to unsigned char, to avoid casts.
15205
15206 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
15207 STATE_ALLOC): Remove.
15208 (transitions_new, errs_new, reductions_new, state_new): Use malloc
15209 rather than calloc, and use offsetof to avoid allocating slightly
15210 too much storage.
15211 (state_new): Initialize all members.
15212
15213 * src/state.c (state_hash): Use unsigned accumulator, not signed.
15214
15215 * src/symtab.c (symbol_free): Remove; unused.
15216 (symbol_get): Remove cast in lhs of assignment.
15217 (symbols_do): Now static. Accept generic arguments, not
15218 hashing-related ones.
15219
15220 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
15221 (symbol_processor): Remove.
15222 (symbols_do): Remove decl; now static.
15223
15224 * src/system.h (alloca): Remove; decl no longer needed.
15225 (<stddef.h>): Include, for offsetof.
15226 (<inttypes.>, <stdint.h>): Include if available.
15227 (uintptr_t): New type, if system lacks it.
15228 (CALLOC, MALLOC, REALLOC): New macros.
15229 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
15230 new macros.
15231
15232 * src/tables.c (table_size): Now int, to pacify GCC.
15233 (table_grow, table_ninf_remap): Use signed table size.
15234 (save_row): Don't bother initializing locals when not needed.
15235 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
15236 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
15237
15238 * src/vcg.h: Correct misspellings.
15239
15240 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
15241
15242
15243 * src/getargs.c (getargs): Don't assume EOF == -1.
15244
152452002-12-09 Paul Eggert <eggert@twinsun.com>
15246
15247 Change identifier spellings to avoid collisions with names
15248 that are reserved by POSIX.
15249
15250 Don't use names ending in _t, since POSIX reserves them.
15251 For consistency, remove _e and _s endings -- they're weren't
15252 needed to remove ambiguity. All uses changed.
15253 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
15254 turn was just renamed from struniq_t.
15255 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
15256 which in turn was just renamed from struniq_processor_t.
15257 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
15258 in turn was renamed from hash_compare_struniq_t.
15259 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
15260 (state_list): Renamed from state_list_t.
15261 * src/assoc.h (assoc): Renamed from assoc_t.
15262 * src/conflicts.c (enum conflict_resolution): Renamed from
15263 enum conflict_resolution_e.
15264 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
15265 (rule_list): Renamed from rule_list_t.
15266 * src/getargs.h (enum trace): Renamed from enum trace_e.
15267 (enum report): Renamed from enum report_e.
15268 * src/gram.h (item_number): Renamed from item_number_t.
15269 (rule_number): Renamed from rule_number_t.
15270 (struct rule_s): Remove the "rule_s" part; not used.
15271 (rule): Renamed from rule_t.
15272 (rule_filter): Renamed from rule_filter_t.
15273 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
15274 (goto_list): Renamed from goto_list_t.
15275 * src/lalr.h (goto_number): Renamed from goto_number_t.
15276 * src/location.h (location): Renamed from location_t.
15277 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
15278 and moved here from:
15279 * src/muscle_tab.h (muscle_entry_t): here.
15280 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
15281 (rule_list): Renamed from rule_list_t.
15282 * src/print_graph.c (static_graph): Renamed from graph.
15283 * src/reader.h (braced_code): Renamed from braced_code_t.
15284 Remove brace_code_e tag.
15285 * src/relation.h (relation_node): Renamed from relation_node_t.
15286 (relation_nodes): Renamed from relation_nodes_t.
15287 (relation): Renamed from relation_t.
15288 * src/state.h (state_number): Renamed from state_number_t.
15289 (struct state): Renamed from struct state_s.
15290 (state): Renamed from state_t.
15291 (transitions): Renamed from transitions_t. Unused (and
15292 misspelled) transtion_s tag removed.
15293 (errs): Renamed from errs_t. Unused errs_s tag removed.
15294 (reductions): Renamed from reductions_t. Unused tag
15295 reductions_s removed.
15296 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
15297 (struct symbol_list): Renamed from struct symbol_list_s.
15298 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
15299 (struct symbol): Renamed from struct symbol_s.
15300 (symbol): Renamed from symbol_t.
15301 * src/tables.c (vector_number): Renamed from vector_number_t.
15302 (action_number): Renamed from action_t.
15303 * src/tables.h (base_number): Renamed from base_t.
15304 * src/vcg.h (enum color): Renamed from enum color_e.
15305 (enum textmode): Renamed from enum textmode_e.
15306 (enum shape): Renamed from enum shape_e.
15307 (struct colorentry): Renamed from struct colorentry_s.
15308 (struct classname): Renamed from struct classname_s.
15309 (struct infoname): Renamed from struct infoname_s.
15310 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
15311 (enum decision): Renamed from enum decision_e.
15312 (enum orientation): Renamed from enum orientation_e.
15313 (enum alignment): Renamed from enum alignment_e.
15314 (enum arrow_mode): Renamed from enum arrow_mode_e.
15315 (enum crossing_type): Renamed from enum crossing_type_e.
15316 (enum view): Renamed from enum view_e.
15317 (struct node): Renamed from struct node_s.
15318 (node): Renamed from node_t.
15319 (enum linestyle): Renamed from enum linestyle_e.
15320 (enum arrowstyle): Renamed from enum arrowstyle_e.
15321 (struct edge): Renamed from struct edge.
15322 (edge): Renamed from edge_t.
15323 (struct graph): Renamed from struct graph_s.
15324 (graph): Renamed from graph_t.
15325 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
15326 Rename value_t -> value.
15327 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
15328 value_t_as_yystype -> value_as_yystype.
15329
15330 Don't include <errno.h> in the mainstream code, since it
15331 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
15332 * lib/get-errno.c, lib/get-errno.h: New files.
15333 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
15334 get-errno.c.
15335 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
15336 * src/output.c (output_skeleton): Likewise.
15337 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
15338 instead of errno.
15339 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
15340 Likewise.
15341 (handle_action_dollar, handle_action_at): Likewise.
15342 * src/system.h: Do not include <errno.h>.
15343 (TAB_EXT): Renamed from EXT_TAB.
15344 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
15345
15346 Avoid str[a-z]*, since <string.h> reserves that name space.
15347 Change all instances of "struniq" in names to "uniqstr", and
15348 likewise for "STRUNIQ" and "UNIQSTR".
15349 * src/uniqstr.c: Renamed from src/struniq.c.
15350 * src/uniqstr.h: Renamed from src/struniq.h.
15351 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
15352 * src/files.c (strsuffix): Remove; unused.
15353 (concat2): Renamed from stringappend. Now static.
15354 * src/files.h (strsuffix, stringappend): Remove; unused.
15355 * src/parse-gram.y (<chars>): Renamed from <string>.
15356 (<uniqstr>): Renamed from <struniq>.
15357 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
15358 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
15359 (struct graph_s.expand): Renamed from struct graph_s.stretch.
15360 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
15361 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
15362 (N_EXPAND): Renamed from N_STRETCH.
15363
15364 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
15365 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
15366 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
15367 Remove; unused.
15368 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
15369 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
15370 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
15371 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
15372 (BASE_MAXIMUM): Renamed from BASE_MAX.
15373 (BASE_MINIMUM): Renamed from BASE_MIN.
15374 (ACTION_MAX): Remove; unused.
15375 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
15376 Unnecessary casts removed from above defines.
15377
15378
15379 Fix misspelling in names.
15380 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
15381 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
15382 G_NODE_ALIGNEMENT.
15383
15384
15385 * lib/timevar.c (timevar_report): Renamed from time_report,
15386 for consistency with other names.
15387 * lib/timevar.h (timevar_report): New decl.
15388 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
15389
15390
15391 Sort include-file uses.
15392
15393 Reorder all include files under src to be in the order "system.h".
15394 then the ../lib include files in angle brackets (alphabetized),
15395 then the . include files in double-quotes (alphabetized). Fix
15396 dependency breakages encountered in this process, as follows:
15397 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
15398 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
15399 * src/state.h: Include "symtab.h".
15400
154012002-12-08 Paul Eggert <eggert@twinsun.com>
15402
15403 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
15404 since this causes problems when __file__ contains character
15405 sequences like "@" that are treated specially by src/scan-skel.l.
15406 Instead, just use the file's basename. This fixes the bug
15407 reported by Martin Mokrejs in
15408 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
15409
154102002-12-06 Paul Eggert <eggert@twinsun.com>
15411
15412 Add support for rules that do not have trailing semicolons, as
15413 POSIX requires. Improve the quality of locations in Bison
15414 diagnostics.
15415
15416 * src/location.c: Include <quotearg.h>.
15417 (empty_location): Now const.
15418 (location_print): New function. Follow the recommendation of the
15419 GNU Coding Standards for locations that span file boundaries.
15420 * src/location.h: Do not include <quotearg.h>; no longer needed.
15421 (boundary): New type.
15422 (location_t): Use it. This allows locations to span file boundaries.
15423 All member uses changed: file -> start.file or end.file (as needed),
15424 first_line -> start.line, first_column -> start.column,
15425 last_line -> end.line, last_column -> end.column.
15426 (equal_boundaries): New function.
15427 (LOCATION_RESET, LOCATION_STEP): Remove.
15428 (LOCATION_PRINT): Remove. All callers changed to use location_print.
15429 (empty_location): Now const.
15430 (location_print): New decl.
15431 * src/parse-gram.y (lloc_default): New function, which handles
15432 empty locations more accurately.
15433 (YYLLOC_DEFAULT): Use it.
15434 (%token COLON): Remove.
15435 (%token ID_COLON): New token.
15436 (rules): Use it.
15437 (declarations, rules): Remove trailing semicolon.
15438 (declaration, rules_or_grammar_declaration):
15439 Allow empty (";") declaration.
15440 (symbol_def): Remove empty actions; no longer needed.
15441 (rules_or_grammar_declaration): Remove trailing semicolon.
15442 (semi_colon.opt): Remove.
15443 * src/reader.h: Include location.h.
15444 (scanner_cursor): New decl.
15445 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
15446 rolling our own.
15447 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
15448 of *loc.
15449 (STEP): Remove. No longer needed, now that adjust_location does
15450 the work. All uses removed.
15451 (scanner_cursor): New var.
15452 (adjust_location): Renamed from extend_location. It now sets
15453 *loc and adjusts the scanner cursor. All uses changed.
15454 Don't bother testing for CR.
15455 (handle_syncline): Remove location arg; now updates scanner cursor.
15456 All callers changed.
15457 (unexpected_end_of_file): Now accepts start boundary of token or
15458 comment, not location. All callers changed. Update scanner cursor,
15459 not the location.
15460 (SC_AFTER_IDENTIFIER): New state.
15461 (context_state): Renamed from c_context. All uses changed.
15462 (id_loc, code_start, token_start): New local vars.
15463 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
15464 processing of Yacc white space and equivalents here.
15465 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
15466 instead of returning ID immediately, since we need to search for
15467 a subsequent colon.
15468 (<INITIAL>"'", "\""): Save token_start.
15469 (<INITIAL>"%{", "{", "%%"): Save code_start.
15470 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
15471 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
15472 BEGIN context_state at end, not INITIAL.
15473 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
15474 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
15475 Return correct token start.
15476 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
15477 the start of a character, string or multiline comment is found.
15478 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
15479 Reduction): Adjust reported locations to match the more-precise
15480 results now expected.
15481 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
15482 * tests/reduce.at (Useless Rules, Reduced Automaton,
15483 Underivable Rules): Likewise.
15484 * tests/regression.at (Invalid inputs): No longer `expecting ";"
15485 or "|"' now that so many other tokens are allowed by the new grammar.
15486
15487 * src/complain.h (current_file): Remove duplicate decl;
15488 current_file is now owned by files.h.
15489 * src/complain.c, src/scan-gram.l: Include files.h.
15490
154912002-12-06 Paul Eggert <eggert@twinsun.com>
15492
15493 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
15494 promotes to int; it might be unsigned int.
15495 * data/yacc.c (yy_reduce_print): Likewise.
15496
15497 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
15498 be #defined in the prologue, not in the Bison declarations.
15499 This fixes Debian Bug 102878, reported by Shaul Karl.
15500
155012002-12-02 Paul Eggert <eggert@twinsun.com>
15502
15503 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
15504 * lib/strtoul.c: New file, from gnulib.
15505 This fixes a porting bug reported by Peter Klein in
15506 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
15507
155082002-11-30 Paul Eggert <eggert@twinsun.com>
15509
15510 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
15511 and put only a forward declaration in the prologue. This is for
15512 consistency with the other scanner helper functions.
15513
15514 Type clashes now generate warnings, not errors, since it
15515 appears that POSIX may allow some grammars with type clashes.
15516 * src/reader.c (grammar_current_rule_check): Warn about
15517 type clashes instead of complaining.
15518 * tests/input.at (Type Clashes): Expect warnings, not complaints.
15519
15520 Add Yacc library, since POSIX requires it.
15521 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
15522 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
15523 * lib/main.c, lib/yyerror.c: New files.
15524
15525 gram_error can be static; it need not be extern.
15526 * src/reader.h (gram_error): Remove decl.
15527 * src/parse-gram.y (gram_error): Now static. Add static decl.
15528 (print_token_value): Omit parameter names from forward decl,
15529 for consistency.
15530
155312002-11-29 Paul Eggert <eggert@twinsun.com>
15532
15533 * doc/bison.texinfo: Emphasize that yylex and yyerror must
15534 be declared before being used. E.g., one should typically
15535 declare them in the prologue. Use GNU coding style in examples.
15536 Put "const" consistently after the type it modifies. Mention
15537 that C99 supports "inline". Mention that yyerror traditionally
15538 returns "int".
15539
15540 %parse-param and %lex-param now take just one argument, the
15541 declaration; the argument name is deduced from the declaration.
15542
15543 * doc/bison.texinfo (Parser Function, Pure Calling, Error
15544 Reporting, Table of Symbols): Document this.
15545 * src/parse-gram.y (add_param): New function.
15546 (COMMA): Remove.
15547 (declaration): Implement new rule for %parse-param and %lex-param.
15548 * src/scan-gram.l: "," now elicits a warning, rather than being
15549 a token; this is more compatible with byacc.
15550 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
15551
155522002-11-27 Paul Eggert <eggert@twinsun.com>
15553
15554 Rename identifiers to avoid real and potential collisions.
15555
15556 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
15557 to avoid collision with lex macro described by Bruce Lilly in
15558 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
15559 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
15560 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
15561 * src/parse-gram.y (print_token_value): Renamed from yyprint.
15562 All uses changed.
15563 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
15564 The name "yycontrol" violates the name space rules, and this stuff
15565 wasn't being used anyway.
15566 (input): Remove action; this stuff wasn't being used.
15567 (gram_error): Rename local variable yylloc -> loc.
15568 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
15569 (YY_DECL): Don't use "yy" at start of local variables.
15570 All uses changed, e.g., yylloc -> loc.
15571 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
15572 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
15573 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
15574 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
15575
15576 * src/parse-gram.y (gram_error): loc is now const *.
15577 * src/reader.h (gram_error): Likewise.
15578
155792002-11-24 Paul Eggert <eggert@twinsun.com>
15580
15581 Version 1.75c.
15582
15583 * tests/actions.at (Actions after errors): Use an output format
15584 more similar to that of the Printers and Destructors test.
15585 Test the position of the ';' token too.
15586 (Printers and Destructors): Likewise.
15587 (Printers and Destructors: %glr-parser): Remove for now, to avoid
15588 unnecessarily alarming people when the test fails.
15589
15590 * data/yacc.c (yyerrlab1): Move this label down, so that the
15591 parser does not discard the lookahead token if the user code
15592 invokes YYERROR. This change is required for POSIX conformance.
15593
15594 * lib/error.c: Sync with gnulib.
15595
155962002-11-22 Paul Eggert <eggert@twinsun.com>
15597
15598 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
15599 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
15600 * lib/xmalloc.c: Likewise.
15601
156022002-11-20 Paul Eggert <eggert@twinsun.com>
15603
15604 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
15605
156062002-11-20 Paul Eggert <eggert@twinsun.com>
15607
15608 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
15609 should use `if (! x) abort ();' rather than `assert (x);', and
15610 anyway it's one less thing to worry about configuring.
15611
15612 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
15613 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
15614 and replace all instances of assert with abort.
15615 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
15616 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
15617
15618 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
15619 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
15620 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
15621 hash_find_entry, hash_rehash, hash_insert): Likewise.
15622 * src/conflicts.c (resolve_sr_conflict): Likewise.
15623 * src/lalr.c (set_goto_map, map_goto): Likewise.
15624 * src/nullable.c (nullable_compute): Likewise.
15625 * src/output.c (prepare_rules, token_definitions_output): Likewise.
15626 * src/reader.c (packgram, reader): Likewise.
15627 * src/state.c (state_new, state_free, state_transitions_set,
15628 state_reduction_find): Likewise.
15629 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
15630 symbol_pack): Likewise.
15631 * src/tables.c (conflict_row, pack_vector): Likewise.
15632 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15633 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15634 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
15635 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
15636
15637 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
15638 (ARGMATCH_CONSTRAINT): New macro.
15639 (ARGMATCH_ASSERT): Use it.
15640
15641 * src/system.h (verify): New macro.
15642 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
15643 rather than assert.
15644 * src/tables.c (tables_generate): Likewise.
15645
15646 * src/struniq.c (struniq_assert): Now returns void, and aborts
15647 if the assertion is false.
15648 (struniq_assert_p): Remove.
15649 * src/struniq.h: Likewise.
15650
156512002-11-18 Paul Eggert <eggert@twinsun.com>
15652
15653 * data/glr.c (yygetLRActions): Replace `yyindex' with
15654 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
15655 This fixes the regression with Sun ONE Studio 7 cc that I reported in
15656 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
15657
156582002-11-18 Akim Demaille <akim@epita.fr>
15659
15660 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
15661 space.
15662 From Tim Van Holder.
15663
156642002-11-17 Paul Eggert <eggert@twinsun.com>
15665
15666 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
15667 to "SyntaxError" for consistency with my 2002-11-15 change.
15668
15669 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
15670 not define to {}, since this breaks the common use of `YYDPRINTF
15671 ((...));' if a single statement is desired (e.g. before `else').
15672 Work around GCC warnings by surrounding corresponding calls with
15673 {} if needed.
15674 (yyhasResolvedValue): Remove unused function.
15675 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
15676 loop body.
15677 (yyreportSyntaxError): Renamed from yyreportParseError.
15678 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
15679 All uses changed.
15680 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
15681 extern when possible. Remove unused initializations.
15682
156832002-11-16 Akim Demaille <akim@epita.fr>
15684
15685 Augment the similarity between GLR and LALR traces.
15686
15687 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
15688 (YY_REDUCE_PRINT): New.
15689 (yyparse): Use them.
15690 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
15691 YYDPRINT here.
15692 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
15693 state reached after the reduction/recovery, since...
15694 (yyparse, yyprocessOneStack): Report the state we are entering in.
15695
156962002-11-16 Akim Demaille <akim@epita.fr>
15697
15698 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
15699 Add support for --trace=skeleton.
15700 * src/scan-skel.l: %option debug.
15701 Scan strings of non-@ or \n instead of character by character.
15702 (scan_skel): Handle trace_skeleton.
15703 (QPUTS): New.
15704 (@output_parser_name@, @output_header_name@): ``Restore'' their
15705 support (used to be M4 macros).
15706 * data/yacc.c: Quote larger chunks, a la glr.c.
15707 * data/lalr1.cc: Likewise.
15708 The header guards are no longer available, so use some other
15709 string than `YYLSP_NEEDED'.
15710
157112002-11-16 Akim Demaille <akim@epita.fr>
15712
15713 Make the ``Printers and Destructors'' test more verbose, taking
15714 `yacc.c''s behavior as (possibly wrong) reference.
15715
15716 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
15717 instead of fprint on stdout.
15718 Set and report the last_line of the symbols.
15719 Consistently display values and locations.
15720
157212002-11-16 Paul Eggert <eggert@twinsun.com>
15722
15723 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
15724
157252002-11-15 Paul Eggert <eggert@twinsun.com>
15726
15727 * tests/actions.at (Actions after errors): New test case.
15728
15729 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
15730 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
15731 tests/action.at, tests/calc.at, tests/conflicts.at,
15732 tests/cxx-type.at, tests/regression.at:
15733 "parse error" -> "syntax error" for POSIX compatibility.
15734 "parsing stack overflow..." -> "parser stack overflow" so
15735 that code matches Bison documentation.
15736
157372002-11-15 Akim Demaille <akim@epita.fr>
15738
15739 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
15740 take two BRACED_CODE, not two string_content.
15741 Free the scanner's obstack when we are done.
15742 (code_content): New.
15743 * tests/calc.at: Adjust.
15744 * doc/bison.texinfo: Adjust.
15745 Also, make sure to include the `,' for these declarations.
15746
157472002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
15748
15749 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
15750 definition; avoids potential autoreconf problems.
15751
157522002-11-15 Akim Demaille <akim@epita.fr>
15753
15754 Always check the value returned by yyparse.
15755
15756 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
15757 returned by yyparse.
15758 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
15759 Adjust calls.
15760 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
15761 returned by yyparse.
15762
157632002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15764
15765 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
15766 on input.at test.
15767
157682002-11-14 Paul Eggert <eggert@twinsun.com>
15769
15770 * src/output.c (output_skeleton): Call xfopen instead of
15771 duplicating xfopen's body.
15772
15773 Fix bugs reported by Nelson H. F. Beebe in
15774 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
15775
15776 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
15777 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
15778 Group compiler. Instead, use "$CC -E bar.c". Include the .h
15779 file twice in the grammar, as an extra check.
15780
15781 * tests/input.at (Torturing the Scanner): Surround the
15782 backslash-newline tests with "#if 0", to make it less likely that
15783 we'll run into compiler bugs. Bring back solitary \ inside
15784 comment, but add a closing comment to work around HP C bug. Don't
15785 test backslash-newline in C character constant.
15786
157872002-11-14 Akim Demaille <akim@epita.fr>
15788
15789 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
15790 status of the compiler.
15791 Calling `exit 1' is no longer needed.
15792 Reported by Nelson H. F. Beebe.
15793
157942002-11-14 Akim Demaille <akim@epita.fr>
15795
15796 * tests/atlocal.in (CPPFLAGS): We have config.h.
15797 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
15798 New.
15799 * tests/actions.at, tests/calc.at, tests/conflicts.at,
15800 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
15801 * tests/regression.at, tests/torture.at: Use them for all the
15802 grammars that are to be compiled.
15803 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
15804 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
15805 * doc/bison.texinfo (GLR Parsers): Document `inline'.
15806
158072002-11-14 Akim Demaille <akim@epita.fr>
15808
15809 * doc/bison.texinfo: Various formatting changes (alignments in
15810 samples, additional @group/@end group, GCS in samples.
15811 Use @deffn instead of simple @table to define the directives,
15812 macros, variables etc.
15813
158142002-11-13 Paul Eggert <eggert@twinsun.com>
15815
15816 Fix some bugs reported by Albert Chin-A-Young in
15817 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
15818
15819 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
15820 -o c"; the HP C compiler chatters during compilation.
15821 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
15822 * tests/headers.at (export YYLTYPE): Likewise.
15823
15824 * tests/input.at (Torturing the Scanner): Remove lines containing
15825 solitary backslashes, as they tickle a bug in the HP C compiler.
15826
15827 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
15828 comments, since they're not portable. Use GNU coding style.
15829
158302002-11-13 Akim Demaille <akim@epita.fr>
15831
15832 * data/yacc.c: Leave bigger chunks of quoted text.
15833 (YYDSYMPRINTF): New.
15834 Use it to report symbol activities.
15835 * data/glr.c (YYDSYMPRINTF): New.
15836 Use it.
15837
158382002-11-12 Paul Eggert <eggert@twinsun.com>
15839
15840 Version 1.75b.
15841
15842 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
15843 (yyglrReduce): Return yyok, not 0.
15844 This should avoid the enumerated-type warnings reported
15845 by Nelson H. F. Beebe in
15846 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
15847
15848 * lib/bbitset.h (BITSET_INLINE): Remove.
15849 * lib/bitset.h [! BITSET_INLINE]: Remove.
15850 (bitset_set, bitset_reset, bitset_test): Rename local vars
15851 to avoid shadowing warnings by GCC.
15852
15853 * data/glr.c (inline): Remove #define. It's the user's
15854 responsibility to #define it away, just like 'const'.
15855 This fixes one of the bugs reported by Nelson H. F. Beebe in
15856 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
15857
15858 * Makefile.maint (po-check): Scan .l and .y files instead of the
15859 .c and the .h files that they generate. This fixes the bug
15860 reported by Tim Van Holder in:
15861 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
15862 Look for N_ as well as for _. Try to avoid matching #define for
15863 N_ and _.
15864 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
15865 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
15866 * src/scan-gram.l: Revamp regular expressions so that " and '
15867 do not confuse xgettext.
15868
15869 * src/struniq.h (struniq_new): Do not declare the return type
15870 to be 'const'; this violates the C standard.
15871 * src/struniq.c (struniq_new): Likewise.
15872
158732002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
15874
15875 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
15876 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
15877 linker.
15878
158792002-11-12 Akim Demaille <akim@epita.fr>
15880
15881 * Makefile.maint: Sync with Autoconf:
15882 (local_updates): New.
15883
158842002-11-12 Akim Demaille <akim@epita.fr>
15885
15886 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
15887
158882002-11-12 Akim Demaille <akim@epita.fr>
15889
15890 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
15891 locations.
15892
158932002-11-12 Akim Demaille <akim@epita.fr>
15894
15895 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
15896 not yyvalue.
15897
158982002-11-12 Akim Demaille <akim@epita.fr>
15899
15900 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
15901 Use it to test the GLR parser.
15902
159032002-11-12 Akim Demaille <akim@epita.fr>
15904
15905 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
15906 defines it.
15907 * data/glr.c (yystos): New.
15908 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
15909 (YYDSYMPRINT): New.
15910 (yyval): Don't define it, it is handled via M4.
15911 (yyrecoverParseError): Free verbosely the discarded symbols.
15912 * data/yacc.c (yysymprint): Remove, rather...
15913 (b4_yysymprint_generate): invoke.
15914 * data/c.m4 (b4_yysymprint_generate): New.
15915 Accept pointers as arguments, as opposed to the version from
15916 yacc.c.
15917 (b4_yydestruct_generate): Likewise.
15918 * tests/cations.at (Printers and Destructors): Use Bison directives
15919 instead of CPP macros.
15920 Don't rely on internal details.
15921
159222002-11-12 Akim Demaille <akim@epita.fr>
15923
15924 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
15925 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
15926 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
15927 it against YYEMPTY and so forth), work on yytoken (i.e., set
15928 it to YYEMPTY etc.).
15929 (yydestruct): Replace with a b4_yydestruct_generate invocation.
15930 (b4_symbol_actions): Remove.
15931 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
15932 for 0, end-of-input.
15933
159342002-11-12 Akim Demaille <akim@epita.fr>
15935
15936 * doc/bison.texinfo (Destructor Decl): New.
15937
159382002-11-12 Akim Demaille <akim@epita.fr>
15939
15940 * src/tables.c (tables_generate): Use free for pointers that
15941 cannot be NULL, not XFREE.
15942 (pack_vector): Use assert, not fatal, for bound violations.
15943 * src/state.c (state_new): Likewise.
15944 * src/reader.c (reader): Likewise.
15945 * src/lalr.c (set_goto_map): Likewise.
15946 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
15947 the file name.
15948
159492002-11-12 Akim Demaille <akim@epita.fr>
15950
15951 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
15952 Restore.
15953 * src/scan-gram.l (last_string): Is global to the file, not to
15954 yylex.
15955 * src/parse-gram.y (input): Don't append the epilogue here,
15956 (epilogue.opt): do it here, and free the scanner's obstack.
15957 * src/reader.c (epilogue_set): Rename as...
15958 (epilogue_augment): this.
15959 * data/c.m4 (b4_epilogue): Defaults to empty.
15960
159612002-11-12 Akim Demaille <akim@epita.fr>
15962
15963 * src/getargs.c (long_options): Remove duplicates.
15964 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
15965 Remove.
15966 * doc/bison.rnh: Remove.
15967 * doc/bison.texinfo (VMS Invocation): Remove.
15968
159692002-11-12 Akim Demaille <akim@epita.fr>
15970
15971 * src/struniq.h, src/struniq.c (struniq_t): Is const.
15972 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
15973
15974 Use struniq for symbols.
15975
15976 * src/symtab.h (symbol_t): The tag member is a struniq.
15977 (symbol_type_set): Adjust.
15978 * src/symtab.c (symbol_new): Takes a struniq.
15979 (symbol_free): Don't free the tag member.
15980 (hash_compare_symbol_t, hash_symbol_t): Rename as...
15981 (hash_compare_symbol, hash_symbol): these.
15982 Use the fact that tags as struniqs.
15983 (symbol_get): Use struniq_new.
15984 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
15985 Returns a strniq.
15986 * src/reader.h (merger_list, grammar_currentmerge_set): The name
15987 and type members are struniqs.
15988 * src/reader.c (get_merge_function)
15989 (grammar_current_rule_merge_set): Adjust.
15990 (TYPE, current_type): Are struniq.
15991
15992 Use struniq for file names.
15993
15994 * src/files.h, src/files.c (infile): Split into...
15995 (grammar_file, current_file): these.
15996 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
15997 * src/reduce.c (reduce_print): Likewise.
15998 * src/getargs.c (getargs): Likewise.
15999 * src/complain.h, src/complain.c: Likewise.
16000 * src/main.c (main): Call struniqs_new early enough to use it for
16001 file names.
16002 Don't free the input file name.
16003
160042002-11-12 Akim Demaille <akim@epita.fr>
16005
16006 * src/symtab.c (symbol_free): Remove dead deactivated code:
16007 type_name are properly removed.
16008 Don't use XFREE to free items that cannot be NULL.
16009 * src/struniq.h, src/struniq.c: New.
16010 * src/main.c (main): Initialize/free struniqs.
16011 * src/parse-gram.y (%union): Add astruniq member.
16012 (yyprint): Adjust.
16013 * src/scan-gram.l (<{tag}>): Return a struniq.
16014 Free the obstack bit that used to store it.
16015 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
16016
160172002-11-11 Paul Eggert <eggert@twinsun.com>
16018
16019 Revamp to fix many (but not all) of the C- and M4-related quoting
16020 problems. Among other things, this fixes the Bison bug reported
16021 by Jan Hubicka when processing the Bash grammar; see:
16022 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
16023
16024 Use new @ escapes consistently. Represent brackets with @{ and @}
16025 rather than @<:@ and @:>@, since this works a bit better with dumb
16026 editors like vi. Represent @ with @@, since @ is now consistently
16027 an escape. Use @oline@ and @ofile@ rather than __oline__ and
16028 __ofile__, to avoid unexpected expansions. Similarly, use @output
16029 rather than #output.
16030
16031 * data/c.m4 (b4_copyright): Omit file name from comment, since
16032 the file name could contain "*/".
16033 (b4_synclines_flag): Don't quote the 2nd argument; it should already
16034 be quoted. All uses changed.
16035
16036 * data/glr.c: Use new @ escapes consistently.
16037 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
16038 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
16039 Remove, since they couldn't handle arbitrary characters in file
16040 names.
16041 * data/lalr1.cc: Likewise.
16042 * data/yacc.c: Likewise.
16043
16044 * src/files.c (output_infix): Remove; all uses removed.
16045 * src/files.h: Likewise.
16046
16047 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
16048 mishandled funny characters in file names, and anyway it isn't
16049 needed any more.
16050 * data/yacc.c: Likewise.
16051 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
16052
16053 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
16054 * data/yacc.c: Likewise.
16055
16056 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
16057 strings now.
16058 (muscle_init): Quote filename as a C string.
16059 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
16060 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
16061 * src/output.c (escaped_file_name_output): New function.
16062 (prepare_symbols): Quote tokens for M4.
16063 (prepare): Don't insert output_infix, output_prefix,
16064 output_parser_name, output_header_name; this is now down by scan-skel.
16065 Insert skeleton as a C string.
16066
16067 * src/output.c (user_actions_output, symbol_destructors_output,
16068 symbol_printers_output): Quote filenames for C and M4.
16069 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16070
16071 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
16072 escapes other than \\ and \'; this simplifies the code.
16073 (<SC_STRING>): Likewise, for \\ and \".
16074 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
16075 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
16076 Use new escapes @{ and @} for [ and ].
16077
16078 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
16079 them with auto vars.
16080 Switch to new escape scheme, where @ is the escape character uniformly.
16081 Abort if a stray escape character is found. Avoid unbounded input
16082 buffer when parsing non-escaped text.
16083
16084 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
16085 __oline__, #output, $@, and @{ do not have unintended meanings.
16086
160872002-11-09 Paul Eggert <eggert@twinsun.com>
16088
16089 Fix the test failure due to GCC warnings described in
16090 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
16091 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
16092 evaluate to 0 if it's impossible for NINF to be in the respective
16093 table.
16094 (yygetLRActions, yyrecoverParseError): Use them.
16095
16096 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
16097 counted in the token inserted at end of file. Now takes
16098 location_t *, not location_t, so that the location can be
16099 adjusted. All uses changed.
16100
16101 * tests/regression.at (Invalid inputs): Adjust wording in
16102 diagnostic to match the new behavior.
16103
16104 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
16105 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
16106 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
16107 abort ();'. This reduces the runtime of the "Many lookaheads"
16108 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
16109 GCC 3.2.
16110
161112002-11-07 Paul Eggert <eggert@twinsun.com>
16112
16113 * src/parse-gram.y (CHARACTER): Remove unused token.
16114 All uses removed.
16115
16116 * src/scan-gram.l: Remove stack option. We no longer use the
16117 stack, since the stack was never deeper than 1; instead, use the
16118 new auto var c_context to record the stacked value.
16119
16120 Remove nounput option. At an unexpected end of file, we now unput
16121 the minimal input necessary to end cleanly; this simplifies the
16122 code.
16123
16124 Avoid unbounded token sizes where this is easy.
16125
16126 (unexpected_end_of_file): New function.
16127 Use it to systematize the error message on unexpected EOF.
16128 (last-string): Now auto, not static.
16129 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
16130 (scanner_last_string_free): Remove; not used.
16131 (percent_percent_count): Move decl to just before use.
16132 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
16133 not the (never otherwised-used) CHARACTER.
16134
161352002-11-07 Akim Demaille <akim@epita.fr>
16136
16137 Let yyerror always receive the msg as last argument, so that
16138 yyerror can be variadic.
16139
16140 * data/yacc.c (b4_yyerror_args): New.
16141 Use it when calling yyerror.
16142 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
16143 Use it when calling yyerror.
16144 * doc/bison.texinfo (Error Reporting): Adjust.
16145 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
16146 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
16147
161482002-11-06 Akim Demaille <akim@epita.fr>
16149
16150 #line should have quoted strings.
16151 Ideally, this should be done by m4_quotearg.
16152
16153 * src/scan-skel.l: Include quotearg.h.
16154 Quote __ofile__.
16155 * src/output.c (symbol_printers_output)
16156 (symbol_destructors_output): Quote the file name.
16157
161582002-11-06 Akim Demaille <akim@epita.fr>
16159
16160 * tests/regression.at (Invalid inputs): Adjust to the recent
16161 messages.
16162
161632002-11-06 Akim Demaille <akim@epita.fr>
16164
16165 Restore --no-lines.
16166 Reported by Jim Kent.
16167
16168 * data/c.m4 (b4_syncline): New.
16169 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
16170 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
16171 * src/output.c (user_actions_output): Likewise.
16172 (prepare): Define 'b4_synclines_flag'.
16173 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
16174
161752002-11-06 Akim Demaille <akim@epita.fr>
16176
16177 * src/main.c (main): Free `infile'.
16178 * src/scan-gram.l (handle_syncline): New.
16179 Recognize `#line'.
16180 * src/output.c (user_actions_output, symbol_destructors_output)
16181 (symbol_printers_output): Use the location's file name, not
16182 infile.
16183 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16184
161852002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16186
16187 * src/tables.c (matching_state): Don't allow states to match if
16188 either has GLR conflict entries.
16189
161902002-11-05 Paul Eggert <eggert@twinsun.com>
16191
16192 * src/scan-gram.l: Use more accurate diagnostics, e.g.
16193 "integer out of range" rather than "invalid value".
16194 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
16195 accordingly.
16196
16197 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
16198 Also, remove one static variable in the scanner.
16199
16200 * src/scan-gram.l (braces_level): Now auto, not static.
16201 Initialize to zero if the compiler is being picky.
16202 (INITIAL): Clear braces_level instead of incrementing it.
16203 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
16204 as POSIX 1003.1-2001 requires.
16205 * src/system.h (IF_LINT): New macro, taken from coreutils.
16206 * configure.ac: Define "lint" if --enable-gcc-warnings.
16207
162082002-11-05 Akim Demaille <akim@epita.fr>
16209
16210 * src/scan-gram.l: When it starts with `%', complain about the
16211 whole directive, not just that `invalid character: %'.
16212
162132002-11-04 Akim Demaille <akim@epita.fr>
16214
16215 * Makefile.maint: Update from Autoconf.
16216 (update, cvs-update, po-update, do-po-update): New.
16217
162182002-11-04 Akim Demaille <akim@epita.fr>
16219
16220 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
16221 and yyerror.
16222 Have yyerror `use' its arguments.
16223 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
16224 returns true when location & yacc & pure & parse-param.
16225 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
16226
162272002-11-04 Akim Demaille <akim@epita.fr>
16228
16229 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
16230 clashes.
16231 * src/scan-gram.l: Use [\'] instead of ['] to pacify
16232 font-lock-mode.
16233 Use complain_at.
16234 Use quote, not quote_n since LOCATION_PRINT no longer uses the
16235 slot 0.
16236
162372002-11-03 Paul Eggert <eggert@twinsun.com>
16238
16239 * src/reader.c (get_merge_function, grammar_current_rule_check):
16240 Use consistent diagnostics for reporting type name clashes.
16241 Quote the types with <>, for consistency with Yacc.
16242 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
16243
162442002-11-03 Akim Demaille <akim@epita.fr>
16245
16246 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
16247 New.
16248 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
16249 (b4_parse_param): Remove.
16250 Use b4_identification.
16251 Propagate b4_pure_args where needed to pass them to yyerror.
16252 * data/glr.m4 (b4_parse_param): Remove.
16253 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
16254 (b4_lpure_formals): New.
16255 Use b4_identification.
16256 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
16257 b4_user_formals and b4_user_args.
16258 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
16259 (yyreportAmbiguity): When using a pure parser, also need
16260 the location, and the parse-params.
16261 Adjust callers.
16262 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
16263 When using a pure parser, also need the parse-params.
16264 Adjust callers.
16265 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
16266 (%pure-parser + %parse-param) LALR and GLR parsers.
16267 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
16268 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
16269 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
16270 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
16271 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
16272 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
16273 * doc/bison.texinfo: Untabify the whole file.
16274 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
16275 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
16276 (Error Reporting): Adjust to these new directives.
16277 Document %error-verbose, deprecate YYERROR_VERBOSE.
16278
162792002-11-03 Akim Demaille <akim@epita.fr>
16280
16281 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
16282 AT_CHECK_CALC_GLR invocations to use % directives, instead of
16283 command line options.
16284 * tests/cxx-type.at: Formatting changes.
16285
162862002-11-03 Paul Eggert <eggert@twinsun.com>
16287
16288 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
16289 to count columns correctly, and to check for invalid inputs.
16290
16291 Use mbsnwidth to count columns correctly. Account for tabs, too.
16292 Include mbswidth.h.
16293 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
16294 (extend_location): New function.
16295 (YY_LINES): Remove.
16296
16297 Handle CRLF in C code rather than in Lex code.
16298 (YY_INPUT): New macro.
16299 (no_cr_read): New function.
16300
16301 Scan UCNs, even though we don't fully handle them yet.
16302 (convert_ucn_to_byte): New function.
16303
16304 Handle backslash-newline correctly in C code.
16305 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
16306 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
16307 all uses changed.
16308 (tag, splice): New EREs. Do not allow NUL or newline in tags.
16309 Use {splice} wherever C allows backslash-newline.
16310 YY_STEP after space, newline, vertical-tab.
16311 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
16312
16313 (letter, id): Don't assume ASCII; e.g., spell out a-z.
16314
16315 ({int}, handle_action_dollar, handle_action_at): Check for integer
16316 overflow.
16317
16318 (YY_STEP): Omit trailing semicolon, so that it's more like C.
16319
16320 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
16321 as well as \000. Check for UCHAR_MAX, not 255.
16322 Allow \x with an arbitrary positive number of digits, as in C.
16323 Check for overflow here.
16324 Allow \? and UCNs, for compatibility with C.
16325
16326 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
16327 with quote slot used by complain_at.
16328
16329 * tests/input.at: Add tests for backslash-newline, m4 quotes
16330 in symbols, long literals, and funny escapes in strings.
16331
16332 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
16333 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
16334 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
16335 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
16336 * m4/mbswidth.m4: New file, from GNU coreutils.
16337
16338 * doc/bison.texinfo (Grammar Outline): Document // comments.
16339 (Symbols): Document that trigraphs have no special meaning in Bison,
16340 nor is backslash-newline allowed.
16341 (Actions): Document that trigraphs have no special meaning.
16342
16343 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
16344 no longer used.
16345
163462002-11-02 Paul Eggert <eggert@twinsun.com>
16347
16348 * src/reader.c: Don't include quote.h; not needed.
16349 (get_merge_function): Reword warning to be consistent with
16350 type clash diagnostic in grammar_current_rule_check.
16351
16352 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
16353 bug in trigraph handling.
16354
16355 * src/output.c (prepare_symbols): When printing token names,
16356 escape "[" as "@<:@" and likewise for "]".
16357
16358 * src/system.h (errno): Remove declaration, as we are now
16359 assuming C89 or better, and C89 guarantees errno.
16360
163612002-10-30 Paul Eggert <eggert@twinsun.com>
16362
16363 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
16364 Check for close failures.
16365 * src/files.h (xfclose): Return void, not int, since it always
16366 returned zero.
16367 * src/files.c (xfclose): Likewise. Report I/O error if ferror
16368 indicates one.
16369 * src/output.c (output_skeleton): Use xfclose rather than fclose
16370 and ferror. xfclose now checks ferror.
16371
16372 * data/glr.c (YYLEFTMOST_STATE): Remove.
16373 (yyreportTree): Use a stack-based leftmost state. This avoids
16374 our continuing battles with bogus warnings about initializers.
16375
163762002-10-30 Akim Demaille <akim@epita.fr>
16377
16378 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
16379 #if.
16380
163812002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16382
16383 * tests/glr-regr1.at: New test for reported regressions.
16384 * tests/testsuite.at: Add glr-regr1.at test.
16385 * tests/Makefile.am: Add glr-regr1.at test.
16386
163872002-10-24 Paul Eggert <eggert@twinsun.com>
16388
16389 Version 1.75a.
16390
16391 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
16392 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
16393 we use malloc. Don't assume 'A' through 'Z' are contiguous.
16394 Don't assume strdup exists; POSIX says its an XSI extension.
16395 Check for buffer overflow on input.
16396
163972002-10-24 Akim Demaille <akim@epita.fr>
16398
16399 * src/output.c (output_skeleton): Don't disable M4sugar comments
16400 too soon: it results in comments being expanded.
16401 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
16402 first output.
16403
164042002-10-24 Akim Demaille <akim@epita.fr>
16405
16406 * data/yacc.c (m4_int_type): New.
16407 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
16408 char' as only yacc.c wants K&R portability.
16409 * data/glr.c (yysigned_char): Remove.
16410 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
16411 Reported by Quoc Peyrot.
16412
164132002-10-23 Paul Eggert <eggert@twinsun.com>
16414
16415 * src/main.c (main): With --trace=time, report times even if a
16416 non-fatal error occurs. Formerly, the times were reported in some
16417 such cases but not in others.
16418 * src/reader.c (reader): Just return if a complaint has been issued,
16419 instead of exiting, so that 'main' can report times.
16420
164212002-10-22 Akim Demaille <akim@epita.fr>
16422
16423 * src/system.h: Include sys/types.
16424 Reported by Bert Deknuydt.
16425
164262002-10-23 Paul Eggert <eggert@twinsun.com>
16427
16428 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
16429 Suggested by Art Haas.
16430
164312002-10-22 Paul Eggert <eggert@twinsun.com>
16432
16433 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
16434 decl; not needed any more.
16435 * src/main.c (main): Use return to exit, undoing yesterday's change.
16436 The last OS that we could find where this wouldn't work is
16437 SunOS 3.5, and that's too old to worry about now.
16438
16439 * data/glr.c (struct yyltype): Define members even when not
16440 doing locations. This is more consistent with yacc.c, and it
16441 works around the following bug reports:
16442 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
16443 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
16444
16445 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
16446 @acronym consistently. Standardize on "Yacc" instead of "YACC",
16447 "Algol" instead of "ALGOL". Give a bit more history about BNF.
16448
164492002-10-22 Akim Demaille <akim@epita.fr>
16450
16451 * data/README: New.
16452
164532002-10-21 Paul Eggert <eggert@twinsun.com>
16454
16455 Be consistent about 'bool'; the old code used an enum in one
16456 module and an int in another, and this violates the C standard.
16457 * m4/stdbool.m4: New file, from coreutils 4.5.3.
16458 * configure.ac (AC_HEADER_STDBOOL): Add.
16459 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
16460 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
16461 * src/symtab.c (hash_compare_symbol_t): Likewise.
16462 * src/system.h (bool, false, true): Use a definition consistent
16463 with ../lib/hash.c. All uses changed.
16464
16465 * src/complain.c (warning_issued): Renamed from warn_message_count,
16466 so that we needn't worry about integer overflow (!).
16467 Now of type bool. All uses changed.
16468 (complaint_issued): Renamed from complain_message_count; likewise.
16469
16470 * src/main.c (main): Use exit to exit with failure.
16471
16472 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
16473 rather than 1 and 0.
16474 * src/main.c (main): Likewise.
16475 * src/getargs.c (getargs): Likewise.
16476 * src/reader.c (reader): Likewise.
16477
16478 * src/getarg.c (getargs): Remove duplicate code for
16479 "Try `bison --help'".
16480
16481 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
16482 What was that "2" for?
16483
16484 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
16485 * src/getargs.c (usage): Likewise.
16486
16487 * src/getargs.c (getargs): When there are too few operands, report
16488 the last one. When there are too many, report the first extra
16489 one. This is how diffutils does it.
16490
164912002-10-20 Paul Eggert <eggert@twinsun.com>
16492
16493 Remove K&R vestiges.
16494 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
16495 * src/complain.c (VA_START): Remove. Assume prototypes.
16496 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
16497 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
16498 fatal): Assume prototypes.
16499 * src/complain.h: Assume prototypes.
16500 * src/system.h (PARAMS): Remove.
16501 Include <limits.h> unconditionally, since it's guaranteeed even
16502 for a freestanding C89 compiler.
16503 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
16504 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
16505
165062002-10-20 Akim Demaille <akim@epita.fr>
16507
16508 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
16509 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
16510 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
16511 (yyresolveStates, yyresolveAction, yyresolveStack)
16512 (yyprocessOneStack): Use them.
16513 (yy_reduce_print): New.
16514 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
16515
165162002-10-20 Akim Demaille <akim@epita.fr>
16517
16518 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
16519 arguments and output `void'.
16520 (b4_c_function): Rename as...
16521 (b4_c_function_def): this.
16522 (b4_c_function_decl, b4_c_ansi_function_def)
16523 (b4_c_ansi_function_decl): New.
16524 Change the interpretation of the arguments: before `int, foo', now
16525 `int foo, foo'.
16526 * data/yacc.c (yyparse): Prototype and define thanks to these.
16527 Adjust b4_c_function_def uses.
16528 * data/glr.c (yyparse): Likewise, but ANSI only.
16529
165302002-10-20 Akim Demaille <akim@epita.fr>
16531
16532 * src/output.c (prepare): Move the definition of `tokens_number',
16533 `nterms_number', `undef_token_number', `user_token_number_max'
16534 to...
16535 (prepare_tokens): Here.
16536 (prepare_tokens): Rename as...
16537 (prepare_symbols): this.
16538 (prepare): Move the definition of `rules_number' to...
16539 (prepare_rules): here.
16540 (prepare): Move the definition of `last', `final_state_number',
16541 `states_number' to...
16542 (prepare_states): here.
16543 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
16544
165452002-10-20 Akim Demaille <akim@epita.fr>
16546
16547 * src/tables.h, src/tables.c, src/output.c: Comment changes.
16548
165492002-10-20 Akim Demaille <akim@epita.fr>
16550
16551 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
16552 * data/c.m4: here.
16553
165542002-10-20 Akim Demaille <akim@epita.fr>
16555
16556 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
16557 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
16558 `pair'.
16559 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
16560 `name' to...
16561 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
16562 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
16563 These.
16564
165652002-10-19 Paul Eggert <eggert@twinsun.com>
16566
16567 Do not create a temporary file, as that involves security and
16568 cleanup headaches. Instead, use a pair of pipes.
16569 Derived from a suggestion by Florian Krohm.
16570 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
16571 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
16572 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
16573 (BISON_PREREQ_SUBPIPE): Add.
16574 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
16575 Add subpipe.h, subpipe.c.
16576 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
16577 * po/POTFILES.in: Add lib/subpipe.c.
16578 * src/output.c: Include "subpipe.h".
16579 (m4_invoke): Remove decl.
16580 (scan_skel): New decl.
16581 (output_skeleton): Use pipe rather than temporary file for m4 input.
16582 Check that m4sugar.m4 is readable, to avoid deadlock.
16583 Check for pipe I/O error.
16584 * src/scan-skel.l (readpipe): Remove decl.
16585 (scan_skel): New function, to be used in place of m4_invoke.
16586 Read from stream rather than file.
16587
16588 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
16589 float, as this generates a warning on Solaris 8 + GCC 3.2 with
16590 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
16591 this generates a more-accurate value anyway.
16592
16593 * lib/timevar.c (timervar_accumulate): Rename locals to
16594 avoid confusion with similarly-named more-global.
16595 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
16596
16597 * src/output.c (prepare): Use xstrdup to convert char const *
16598 to char *, to avoid GCC warning.
16599
166002002-10-19 Akim Demaille <akim@epita.fr>
16601
16602 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
16603 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
16604 Use them to have `calc.y' ready for %pure-parser.
16605 * data/yacc.c (YYLEX): Pass a yylex return type to
16606 b4_c_function_call.
16607
166082002-10-19 Akim Demaille <akim@epita.fr>
16609
16610 Prototype support of %lex-param and %parse-param.
16611
16612 * src/parse-gram.y: Add the definition of the %lex-param and
16613 %parse-param tokens, plus their rules.
16614 Drop the `_' version of %glr-parser.
16615 Add the "," token.
16616 * src/scan-gram.l (INITIAL): Scan them.
16617 * src/muscle_tab.c: Comment changes.
16618 (muscle_insert, muscle_find): Rename `pair' as `probe'.
16619 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
16620 (muscle_entry_s): The `value' member is no longer const.
16621 Adjust all dependencies.
16622 * src/muscle_tab.c (muscle_init): Adjust: use
16623 MUSCLE_INSERT_STRING.
16624 Initialize the obstack earlier.
16625 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
16626 (muscle_pair_list_grow): New.
16627 * data/c.m4 (b4_c_function_call, b4_c_args): New.
16628 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
16629 * tests/calc.at: Use %locations, not --locations.
16630 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
16631
166322002-10-19 Akim Demaille <akim@epita.fr>
16633
16634 * src/getargs.c (usage): Take status as argument and exit
16635 accordingly.
16636 Report the traditional `Try ... --help' message when status != 0.
16637 (usage, version): Don't take a FILE * as arg, it is pointless.
16638 (getargs): When there is an incorrect number of arguments, make it
16639 an error, and report it GNUlically thanks to `usage ()'.
16640
166412002-10-18 Paul Eggert <eggert@twinsun.com>
16642
16643 * data/glr.c (yyreportParseError): Don't assume that sprintf
16644 yields the length of the printed string, as this is not true
16645 on SunOS 4.1.4. Reported by Peter Klein.
16646
16647 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
16648 * tests/conflicts.at (%nonassoc and eof): Likewise.
16649 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
16650
166512002-10-17 Akim Demaille <akim@epita.fr>
16652
16653 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
16654 * src/getargs.c (trace_types, trace_args): Adjust.
16655 * src/reader.c (grammar_current_rule_prec_set)
16656 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
16657 Standardize error messages.
16658 And s/@prec/%prec/!
16659 (reader): Use trace_flag to enable scanner/parser debugging,
16660 instead of an adhoc scheme.
16661 * src/scan-gram.l: Remove trailing debugging code.
16662
166632002-10-16 Paul Eggert <eggert@twinsun.com>
16664
16665 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
16666 MUSCLE_TAB_H.
16667
16668 * NEWS: Officially drop support for building Bison with K&R C,
16669 since it didn't work anyway and it's not worth worrying about.
16670 * Makefile.maint (wget_files): Remove ansi2knr.c.
16671 (ansi2knr.c-url_prefix): Remove.
16672 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
16673 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16674 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16675
166762002-10-15 Paul Eggert <eggert@twinsun.com>
16677
16678 Stop using the "enum_" trick for K&R-style function definitions;
16679 it confused me, and I was the author! Instead, assume that people
16680 who want to use K&R C compilers (when using these modules in GCC,
16681 perhaps?) will run ansi2knr.
16682
16683 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
16684 All uses of "enum_" changed to "enum ".
16685 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16686 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16687
16688 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
16689 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
16690 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
16691 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
16692 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
16693 abitset_not, abitset_ones, abitset_or, abitset_or_and,
16694 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
16695 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
16696 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
16697 Use function prototypes; this removes the need for declaring
16698 static functions simply to provide their prototypes.
16699 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
16700 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
16701 bitset_count_, bitset_create, bitset_dump, bitset_first,
16702 bitset_free, bitset_init, bitset_last, bitset_next,
16703 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
16704 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
16705 bitset_print, bitset_release_memory, bitset_toggle_,
16706 bitset_type_choose, bitset_type_get, bitset_type_name_get,
16707 debug_bitset): Likewise.
16708 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
16709 * lib/bitset_stats.c (bitset_log_histogram_print,
16710 bitset_percent_histogram_print, bitset_stats_and,
16711 bitset_stats_and_cmp, bitset_stats_and_or,
16712 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
16713 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
16714 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
16715 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
16716 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
16717 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
16718 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
16719 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
16720 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
16721 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
16722 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
16723 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
16724 bitset_stats_zero): Likewise.
16725 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16726 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16727 bitsetv_dump, debug_bitsetv): Likewise.
16728 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
16729 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
16730 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
16731 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
16732 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
16733 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
16734 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
16735 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
16736 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
16737 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
16738 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
16739 Likewise.
16740 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
16741 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
16742 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
16743 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
16744 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
16745 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
16746 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
16747 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
16748 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
16749 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
16750 lbitset_xor_cmp, lbitset_zero): Likewise.
16751
167522002-10-14 Akim Demaille <akim@epita.fr>
16753
16754 Version 1.75.
16755
167562002-10-14 Akim Demaille <akim@epita.fr>
16757
16758 * tests/Makefile.am (maintainer-check-posix): New.
16759
167602002-10-14 Akim Demaille <akim@epita.fr>
16761
16762 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
16763 member.
16764
167652002-10-14 Akim Demaille <akim@epita.fr>
16766
16767 * src/tables.c (table_ninf_remap): base -> tab.
16768 Reported by Matt Rosing.
16769
167702002-10-14 Paul Eggert <eggert@twinsun.com>
16771
16772 * tests/action.at, tests/calc.at, tests/conflicts.at,
16773 tests/cxx-type.at, tests/headers.at, tests/input.at,
16774 tests/regression.at, tests/synclines.at, tests/torture.at:
16775 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
16776 so that the tests still work even if POSIXLY_CORRECT is set.
16777 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
16778
16779 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
16780 for portability to K&R hosts. Fix typo: signed char is guaranteed
16781 only to 127, not to 128.
16782 * data/glr.c (yysigned_char): New type.
16783 * data/yacc.c (yysigned_char): Likewise.
16784 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
16785
167862002-10-13 Paul Eggert <eggert@twinsun.com>
16787
16788 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
16789 true due to limited range of data type" warning from GCC.
16790
16791 * data/c.m4 (b4_token_defines): Protect against double-inclusion
16792 by wrapping enum yytokentype's definition inside #ifndef
16793 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
16794
167952002-10-13 Akim Demaille <akim@epita.fr>
16796
16797 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
16798 Un yy- yyrhs to avoid the name clash with the global YYRHS.
16799
168002002-10-13 Akim Demaille <akim@epita.fr>
16801
16802 * Makefile.maint: Update from Autoconf 2.54.
16803 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
16804
168052002-10-13 Akim Demaille <akim@epita.fr>
16806
16807 * src/print.c (print_state): Separate the list of solved conflicts
16808 from the other items.
16809 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
16810
168112002-10-13 Akim Demaille <akim@epita.fr>
16812
16813 Let nondeterministic skeletons be usable with deterministic
16814 tables.
16815
16816 With the patch, GAWK compiled by GCC without -O2 passes its test
16817 suite using a GLR parser driven by LALR tables. It fails with -O2
16818 because `struct stat' gives two different answers on my machine:
16819 88 (definition of an auto var) and later 96 (memset on this var).
16820 Hence the stack is badly corrumpted. The headers inclusion is to
16821 blame: if I move the awk.h inclusion before GLR's system header
16822 inclusion, the two struct stat have the same size.
16823
16824 * src/tables.c (pack_table): Always create conflict_table.
16825 (token_actions): Always create conflict_list.
16826 * data/glr.c (YYFLAG): Remove, unused.
16827
168282002-10-13 Akim Demaille <akim@epita.fr>
16829
16830 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
16831 (O0FLAGS): New.
16832 (VALGRIND, GXX): New.
16833 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
16834 * tests/bison.in: Run $PREBISON a pre-command.
16835 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
16836 (maintainer-check-g++): New.
16837 * Makefile.am (maintainer-check): New.
16838
168392002-10-13 Akim Demaille <akim@epita.fr>
16840
16841 * data/glr.c: Formatting changes.
16842 Tweak some trace messages to match yacc.c's.
16843
168442002-10-13 Akim Demaille <akim@epita.fr>
16845
16846 GLR parsers sometimes raise parse errors instead of performing the
16847 default reduction.
16848 Reported by Charles-Henry de Boysson.
16849
16850 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
16851 check the length of the traces when %glr.
16852 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
16853 GLR's traces.
16854 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
16855 Test GLR parsers.
16856 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
16857 (yyltype): Remove the yy prefix from the member names.
16858 (yytable): Complete its comment.
16859 (yygetLRActions): Map error action number from YYTABLE from
16860 YYTABLE_NINF to 0.
16861 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
16862 (which was a bug: it should have been YYTABEL_NINF, and yet it was
16863 not satisfying as we could compare an YYACTION computed from
16864 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
16865 only value for error actions.
16866 (yyreportParseError): In verbose parse error messages, don't issue
16867 `error' in the list of expected tokens.
16868 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
16869 next action to perform to match glr.c's decoding.
16870 (yytable): Complete its comment.
16871
168722002-10-13 Paul Eggert <eggert@twinsun.com>
16873
16874 Fix problem reported by Henrik Grubbstroem in
16875 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
16876 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
16877 because the Bison parser reads the second action before reducing
16878 the first one.
16879 * src/scan-gram.l (rule_length): New static var.
16880 Use it to keep track of the rule length in the scanner, since
16881 we can't expect the parser to be in lock-step sync with the scanner.
16882 (handle_action_dollar, handle_action_at): Use this var.
16883 * tests/actions.at (Exotic Dollars): Test for the problem.
16884
168852002-10-12 Paul Eggert <eggert@twinsun.com>
16886
16887 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
16888 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
16889 Include <sys/time.h> when checking for clock_t and struct tms.
16890 Use same include order as source.
16891 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
16892 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
16893
16894 * lib/timevar.c: Update copyright date and clarify comments.
16895 (get_time) [IN_GCC]: Keep the GCC version for reference.
16896
16897 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
16898 GCC version as of today, then merge Bison's changes.
16899 Change "GCC" to "Bison" in copyright notice. timevar.def's
16900 author is Akim, so change that too.
16901
16902 * src/reader.c (grammar_current_rule_check):
16903 Don't worry about the default action if $$ is untyped.
16904 Prevents bogus warnings reported by Jim Gifford in
16905 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
16906
16907 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
16908 * data/glr.c, data/lalr1.cc, data/yacc.c:
16909 Output token definitions before the first part of user declarations.
16910 Fixes compatibility problem reported by Jim Gifford for kbd in
16911 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
16912
169132002-10-11 Paul Eggert <eggert@twinsun.com>
16914
16915 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
16916 (yyparse): here. This undoes some of the 2002-07-25 change.
16917 Compatibility problem reported by Ralf S. Engelschall with
16918 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
16919
169202002-10-11 Akim Demaille <akim@epita.fr>
16921
16922 * tests/regression.at Characters Escapes): New.
16923 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
16924 characters.
16925 Reported by Jan Nieuwenhuizen.
16926
169272002-10-11 Akim Demaille <akim@epita.fr>
16928
16929 * po/id.po: New.
16930
169312002-10-10 Paul Eggert <eggert@twinsun.com>
16932
16933 Portability fixes for bitsets; this also avoids several GCC
16934 warnings.
16935
16936 * lib/abitset.c: Include <stddef.h>, for offsetof.
16937 * lib/lbitset.c: Likewise.
16938
16939 * lib/abitset.c (abitset_bytes): Return a size that is aligned
16940 properly for vectors of objects. Do not assume that adding a
16941 header size to a multiple of a word size yields a value that is
16942 properly aligned for the whole union.
16943 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16944
16945 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16946 unique names for structures.
16947 * lib/ebitset.c (ebitset_bytes): Likewise.
16948 * lib/lbitset.c (lbitset_bytes): Likewise.
16949
16950 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
16951 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
16952 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
16953 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
16954 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
16955 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
16956 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
16957 to improve the type-checking that GCC can do.
16958 * lib/bitset.c (bitset_op4_cmp): Likewise.
16959 * lib/bitset_stats.c (bitset_stats_count,
16960 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
16961 bitset_stats_copy, bitset_stats_disjoint_p,
16962 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
16963 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
16964 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
16965 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
16966 bitset_stats_and_or_cmp, bitset_stats_andn_or,
16967 bitset_stats_andn_or_cmp, bitset_stats_or_and,
16968 bitset_stats_or_and_cmp): Likewise.
16969 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
16970 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
16971 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
16972 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
16973
16974 * lib/abitset.h: Include bitset.h, not bbitset.h.
16975 * lib/ebitset.h: Likewise.
16976 * lib/lbitset.h: Likewise.
16977
16978 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
16979 All instances of parameters of type enum bitset_opts are now of
16980 type enum_bitset_opts, to conform to the C Standard, and similarly
16981 for enum_bitset_type.
16982 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16983 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16984
16985 Do not use "struct bitset_struct" to mean different things in
16986 different modules. Not only is this confusing, it violates
16987 the C Standard, which requires that structure types in different
16988 modules must be compatible if one is to be passed to the other.
16989 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
16990 All instances of "struct bitset_struct *" replaced with "bitset".
16991 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
16992 (union bitset_union, struct abitset_struct, struct ebitset_struct,
16993 struct lbitset_struct, struct bitset_stats_struct): New types.
16994 All uses of struct bitset_struct changed to union bitset_union,
16995 etc.
16996 * lib/abitset.c (struct abitset_struct, abitset,
16997 struct bitset_struct): Remove.
16998 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
16999 struct bitset_struct): Remove.
17000 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
17001 bitset_struct): Remove.
17002 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
17003 Likewise.
17004
17005 Do not call a function of type T using a call that assumes the
17006 function is of a different type U. Standard C requires that a
17007 function must be called with a type that is compatible with its
17008 definition.
17009 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17010 New decls.
17011 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17012 New functions.
17013 * lib/ebitset.c (PFV): Remove.
17014 * lib/lbitset.c (PFV): Likewise.
17015 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
17016 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
17017 decls.
17018 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
17019 (ebitset_vtable): Use them.
17020 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
17021 lbitset_xor): New functions.
17022 (lbitset_vtable): Use them.
17023
17024 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
17025 Declare.
17026
17027 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
17028 GCC warning.
17029 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
17030 Use offsetof, for simplicity.
17031
170322002-10-06 Paul Eggert <eggert@twinsun.com>
17033
17034 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
17035 the same width as int. This reapplies a hunk of the 2002-08-12 patch
17036 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
17037 which was inadvertently undone by the 2002-09-30 patch.
17038 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
17039 the same width as int.
17040
170412002-10-04 Paul Eggert <eggert@twinsun.com>
17042
17043 Version 1.50.
17044
17045 * configure.ac (AC_INIT), NEWS: Increment version number.
17046
17047 * doc/bison.texinfo: Minor spelling, grammar, and white space
17048 fixes.
17049 (Symbols): Mention that any negative value returned from yylex
17050 signifies end-of-input. Warn about negative chars. Mention
17051 the portable Standard C character set.
17052
17053 The GNU coding standard says CFLAGS and YFLAGS are reserved
17054 for the installer to set.
17055 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
17056 * src/Makefile.am (AM_CFLAGS): Likewise.
17057 (AM_YFLAGS): Renamed from YFLAGS.
17058
17059 Fix some MAX and MIN problems.
17060 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
17061 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
17062 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
17063 * src/reader.c (reader): Use it.
17064
17065 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
17066 POSIX 1003.1-2001 has removed fgrep.
17067
170682002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
17069
17070 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
17071 interpreted as signed.
17072 * lib/ebitset.c (ebitset_list): Fix bug.
17073
170742002-10-01 Paul Eggert <eggert@twinsun.com>
17075
17076 More fixes for 64-bit hosts and large bitsets.
17077
17078 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
17079 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
17080 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
17081 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
17082 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
17083 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
17084 bitset_count_): Likewise.
17085 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
17086 bitset_first, bitset_last): Likewise.
17087 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
17088 bitset_stats_list_reverse, bitset_stats_size,
17089 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
17090 Likewise.
17091 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17092 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17093 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17094 bitsetv_reflexive_transitive_closure): Likewise.
17095 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
17096 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
17097 Likewise.
17098 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
17099 Likewise.
17100
17101 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
17102 Use size_t, not unsigned int, to count bytes.
17103 * lib/abitset.h (abitset_bytes): Likewise.
17104 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
17105 Likewise.
17106 * lib/bitset.h (bitset_bytes): Likewise.
17107 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
17108 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
17109 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17110 * lib/ebitset.c (ebitset_bytes): Likewise.
17111 * lib/ebitset.h (ebitset_bytes): Likewise.
17112 * lib/lbitset.c (lbitset_bytes): Likewise.
17113 * lib/lbitset.h (lbitset_bytes): Likewise.
17114
17115 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
17116 abitset_subset_p, abitset_disjoint_p, abitset_and,
17117 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
17118 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
17119 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
17120 abitset_or_and, abitset_or_and_cmp):
17121 Use bitset_windex instead of unsigned int.
17122 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17123 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
17124 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
17125 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
17126 Likewise.
17127 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
17128
17129 * lib/bitset.c (bitset_print):
17130 Use proper printf formats for widths of integer types.
17131 * lib/bitset_stats.c (bitset_percent_histogram_print,
17132 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
17133 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17134 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17135 * lib/lbitset.c (lbitset_bytes): Likewise.
17136
17137 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
17138 BITSET_SIZE_MAX): New macros.
17139 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
17140 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
17141 to BITSET_WINDEX_MAX.
17142
17143 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
17144 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
17145 since we now return the bitset_bindex type (not int).
17146
17147 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
17148 when computing sizes.
17149 * lib/ebitset.c (ebitset_elts_grow): Likewise.
17150
17151 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
17152 and avoid cast to unsigned.
17153
171542002-09-30 Akim Demaille <akim@epita.fr>
17155
17156 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
17157 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
17158 Updates from Michael Hayes.
17159
171602002-09-30 Art Haas <ahaas@neosoft.com>
17161
17162 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
17163 invocations.
17164 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
17165 defined.
17166
171672002-09-27 Akim Demaille <akim@epita.fr>
17168
17169 Version 1.49c.
17170
171712002-09-27 Akim Demaille <akim@epita.fr>
17172
17173 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
17174 (Because of AC_LIBSOURCE).
17175
171762002-09-27 Akim Demaille <akim@epita.fr>
17177
17178 Playing with Autoscan.
17179
17180 * configure.ac: Remove the old LIBOBJ tweaks.
17181 (AC_REPLACE_FUNCS): Add strrchr and strtol.
17182 * lib/strrchr.c: New.
17183 * lib/strtol.c: New, from the Coreutils 4.5.1.
17184
171852002-09-27 Akim Demaille <akim@epita.fr>
17186
17187 Playing with Autoscan.
17188
17189 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
17190 * lib/Makefile.am (libbison_a_SOURCES): No longer include
17191 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
17192 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
17193 Coreutils 4.5.1.
17194
171952002-09-24 Akim Demaille <akim@epita.fr>
17196
17197 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
17198 (Frequently Asked Questions, Parser Stack Overflow): New.
17199
172002002-09-13 Akim Demaille <akim@epita.fr>
17201
17202 Playing with autoscan.
17203
17204 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
17205 * src/files.c (skeleton_find): Remove, unused.
17206 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
17207 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
17208
172092002-09-13 Akim Demaille <akim@epita.fr>
17210
17211 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
17212 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
17213
172142002-09-13 Akim Demaille <akim@epita.fr>
17215
17216 * configure.ac: Require 2.54.
17217 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
17218 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
17219 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
17220 Remove, provided by Autoconf macros.
17221
172222002-09-12 Akim Demaille <akim@epita.fr>
17223
17224 * m4/prereq.m4: Update, from Coreutils 4.5.1.
17225
172262002-09-12 Akim Demaille <akim@epita.fr>
17227
17228 * m4/prereq.m4: Update, from Fileutils 4.1.5.
17229 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
17230 Reported by Martin Mokrejs.
17231
172322002-09-10 Akim Demaille <akim@epita.fr>
17233
17234 * src/parse-gram.y: Associate a human readable string to each
17235 token type.
17236 * tests/regression.at (Invalid inputs): Adjust.
17237
172382002-09-10 Gary V. Vaughan <gary@gnu.org>
17239
17240 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
17241 with an Autoconf-2.5x style configure.ac.
17242
172432002-09-06 Paul Eggert <eggert@twinsun.com>
17244
17245 * doc/bison.texinfo (Conditions): Make explicit that the GPL
17246 exception applies only to yacc.c. This is a modification of a
17247 patch originally suggested by Akim Demaille.
17248
172492002-09-06 Akim Demaille <akim@epita.fr>
17250
17251 * data/c.m4 (b4_copyright): Move the GPL exception comment from
17252 here to...
17253 * data/yacc.c: here.
17254
17255 * data/lalr1.cc (struct yyltype): Don't define it, since we use
17256 LocationType.
17257 (b4_ltype): Default to yy::Location from location.hh.
17258
172592002-09-04 Jim Meyering <jim@meyering.net>
17260
17261 * data/yacc.c: Guard the declaration of yytoknum also with
17262 `#ifdef YYPRINT', so it is declared only when used.
17263
172642002-09-04 Akim Demaille <akim@epita.fr>
17265
17266 * configure.in: Rename as...
17267 * configure.ac: this.
17268 Bump to 1.49c.
17269
172702002-09-04 Akim Demaille <akim@epita.fr>
17271
17272 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
17273 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
17274 translate maintainer only messages.
17275
172762002-08-12 Paul Eggert <eggert@twinsun.com>
17277
17278 Version 1.49b.
17279
17280 * Makefile.am (SUBDIRS): Remove intl.
17281 (DISTCLEANFILES): Remove.
17282 * NEWS: Mention that GNU M4 is now required. Clarify what is
17283 meant by "larger grammars". Mention the pt_BR translation.
17284 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
17285 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
17286 Bump version from 0.11.2 to 0.11.5.
17287 (BISON_PREREQ_STAGE): Remove.
17288 (AM_GNU_GETTEXT): Use external gettext.
17289 (AC_OUTPUT): Remove intl/Makefile.
17290
17291 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
17292
17293 * data/glr.c: Include string.h, for strlen.
17294 (yyreportParseError): Use size_t for yysize.
17295 (yy_yypstack): No longer nested inside yypstates, as nested
17296 functions are not portable. Do not assume size_t is the
17297 same width as int.
17298 (yypstates): Do not assume that ptrdiff_t is the same width
17299 as int, and similarly for yyposn and YYINDEX.
17300
17301 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
17302
17303 * lib/Makefile.am (INCLUDES): Do not include from the intl
17304 directory, which has been removed.
17305 * src/Makefile.am (INCLUDES): Likewise.
17306
17307 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
17308 (bitsets_sources, additional_bitsets_sources, timevars_sources):
17309 New vars.
17310
17311 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
17312 * tests/Makefile.am (EXTRA_DIST): Likewise.
17313
17314 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
17315 Do not assume that bitset_windex is the same width as unsigned.
17316
17317 * lib/abitset.c (abitset_unused_clear): Do not assume that
17318 bitset_word is the same width as int.
17319 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
17320 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
17321 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
17322 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
17323 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
17324
17325 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
17326 portability to one's complement hosts!).
17327 * lib/ebitset.c (ebitset_op1): Likewise.
17328 * lib/lbitset.c (lbitset_op1): Likewise.
17329
17330 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
17331 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
17332 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
17333 Sync with fileutils.
17334 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
17335 lib/gettext.h: Sync with diffutils.
17336
17337 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
17338 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
17339
17340 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
17341 PROTOTYPES to check for prototypes, and "defined __STDC__" to
17342 check for void *.
17343
17344 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
17345 size_t; the old version tried to do this but casted improperly.
17346 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
17347 (bitset_test): Now returns int, not unsigned long.
17348
17349 * lib/bitset_stats.c: Include "gettext.h".
17350 (_): New macro.
17351 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
17352 name locals "index", as it generates unnecessary warnings on some
17353 hosts that have an "index" function.
17354
17355 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
17356 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
17357 they need translation.
17358 * src/LR0.c (state_list_append, new_itemsets, get_state,
17359 append_states, generate_states): Likewise.
17360 * src/assoc.c (assoc_to_string): Likewise.
17361 * src/closure.c (print_closure, set_firsts, closure): Likewise.
17362 * src/gram.c (grammar_dump): Likewise.
17363 * src/injections.c (injections_compute): Likewise.
17364 * src/lalr.c (lookaheads_print): Likewise.
17365 * src/relation.c (relation_transpose): Likewise.
17366 * src/scan-gram.l: Likewise.
17367 * src/tables.c (table_grow, pack_vector): Likewise.
17368
17369 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
17370 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
17371 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
17372 * m4/mbstate_t.m4: Sync with fileutils.
17373 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
17374
17375 * po/LINGUAS: Add pt_BR.
17376 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
17377 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
17378 lib/timevar.c.
17379 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
17380 manual recommends.
17381 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
17382
17383 * src/complain.c (strerror_r): Remove decl; not needed.
17384 (strerror): Use same pattern as ../lib/error.c.
17385
17386 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
17387
17388 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
17389
17390 * src/main.c (main): Cast result of bindtextdomain and textdomain
17391 to void, to avoid a GCC warning when --disable-nls is in effect.
17392
17393 * src/scan-gram.l: Use strings rather than escapes when possible,
17394 to minimize the number of warnings from xgettext.
17395 (handle_action_dollar, handle_action_at): Don't use isdigit,
17396 as it mishandles negative chars and it may not work as expected
17397 outside the C locale.
17398
17399 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
17400 this is a GCC extension and is not portable to other compilers.
17401
17402 * src/system.h (alloca): Use same pattern as ../lib/error.c.
17403 Do not include <ctype.h>; no longer needed.
17404 Do not include <malloc.h>; no longer needed (and generates
17405 warnings on OpenBSD 3.0).
17406
17407 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
17408 it's not portable.
17409
17410 * tests/regression.at: Do not use 'cc -c input.c -o input';
17411 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
17412
17413 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
17414 exit status as failure, not just exit status 1. Sun C exits
17415 with status 2 sometimes.
17416
17417 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
17418 Use it for the two large tests.
17419
174202002-08-02 Akim Demaille <akim@epita.fr>
17421
17422 * src/conflicts.c (conflicts_output): Don't output rules never
17423 reduced here, since anyway that computation doesn't work.
17424 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
17425 (rule_useless_p, rule_never_reduced_p): New.
17426 (grammar_rules_partial_print): Use a filter instead of a range.
17427 Display the title only if needed.
17428 (grammar_rules_print): Adjust.
17429 (grammar_rules_never_reduced_report): New.
17430 * src/tables.c (action_row): Move the computation of rules never
17431 reduced to...
17432 (token_actions): here.
17433 * src/main.c (main): Make the parser before making the report, so
17434 that rules never reduced are computed.
17435 Call grammar_rules_never_reduced_report.
17436 * src/print.c (print_results): Report rules never reduced.
17437 * tests/conflicts.at, tests/reduce.at: Adjust.
17438
174392002-08-01 Akim Demaille <akim@epita.fr>
17440
17441 Instead of attaching lookaheads and duplicating the rules being
17442 reduced by a state, attach the lookaheads to the reductions.
17443
17444 * src/state.h (state_t): Remove the `lookaheads',
17445 `lookaheads_rule' member.
17446 (reductions_t): Add a `lookaheads' member.
17447 Use a regular array for the `rules'.
17448 * src/state.c (reductions_new): Initialize the lookaheads member
17449 to 0.
17450 (state_rule_lookaheads_print): Adjust.
17451 * src/state.h, src/state.c (state_reductions_find): New.
17452 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
17453 (count_rr_conflicts): Adjust.
17454 * src/lalr.c (LArule): Remove.
17455 (add_lookback_edge): Adjust.
17456 (state_lookaheads_count): New.
17457 (states_lookaheads_initialize): Merge into...
17458 (initialize_LA): this.
17459 (lalr_free): Adjust.
17460 * src/main.c (main): Don't free nullable and derives too early: it
17461 is used by --verbose.
17462 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
17463
174642002-08-01 Akim Demaille <akim@epita.fr>
17465
17466 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
17467 `rule_number_t**'.
17468 (set_derives, free_derives): Rename as...
17469 (derives_compute, derives_free): this.
17470 Adjust all dependencies.
17471 * src/nullable.c (set_nullable, free_nullable): Rename as...
17472 (nullable_compute, nullable_free): these.
17473 (rule_list_t): Store rule_t *, not rule_number_t.
17474 * src/state.c (state_rule_lookaheads_print): Directly compare rule
17475 pointers, instead of their numbers.
17476 * src/main.c (main): Call nullable_free, and derives_free earlier,
17477 as they were lo longer used.
17478
174792002-08-01 Akim Demaille <akim@epita.fr>
17480
17481 * lib/timevar.c (get_time): Include children time.
17482 * src/lalr.h (LA, LArule): Don't export them: used with the
17483 state_t.
17484 * src/lalr.c (LA, LArule): Static.
17485 * src/lalr.h, src/lalr.c (lalr_free): New.
17486 * src/main.c (main): Call it.
17487 * src/tables.c (pack_vector): Check whether loc is >= to the
17488 table_size, not >.
17489 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
17490 (tables_generate): do it, since that's also it which allocates
17491 them.
17492 Don't free LA and LArule, main does.
17493
174942002-07-31 Akim Demaille <akim@epita.fr>
17495
17496 Separate parser tables computation and output.
17497
17498 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
17499 (conflict_list, conflict_list_cnt, table, check, table_ninf)
17500 (yydefgoto, yydefact, high): Move to...
17501 * src/tables.h, src/tables.c: here.
17502 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17503 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17504 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
17505 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
17506 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
17507 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
17508 (action_row, save_row, token_actions, save_column, default_goto)
17509 (goto_actions, sort_actions, matching_state, pack_vector)
17510 (table_ninf_remap, pack_table, prepare_actions): Move to...
17511 * src/tables.c: here.
17512 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
17513 * src/output.c (token_actions, output_base, output_conflicts)
17514 (output_check): Merge into...
17515 (prepare_actions): this.
17516 (actions_output): Rename as...
17517 (user_actions_output): this.
17518 * src/main.c (main): Call tables_generate and tables_free.
17519
175202002-07-31 Akim Demaille <akim@epita.fr>
17521
17522 Steal GCC's --time-report support.
17523
17524 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
17525 stolen/adjusted from GCC.
17526 * m4/stage.m4: Remove time related checks.
17527 * m4/timevar.m4: New.
17528 * configure.in: Adjust.
17529 * src/system.h: Adjust to using timevar.h.
17530 * src/getargs.h, src/getargs.c: Support trace_time for
17531 --trace=time.
17532 * src/main.c (stage): Remove.
17533 (main): Replace `stage' invocations with timevar calls.
17534 * src/output.c: Insert pertinent timevar calls.
17535
175362002-07-31 Akim Demaille <akim@epita.fr>
17537
17538 Let --trace have arguments.
17539
17540 * src/getargs.h (enum trace_e): New.
17541 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
17542 (long_options, short_options): --trace/-T takes an optional
17543 argument.
17544 Change all the uses of trace_flag to reflect the new flags.
17545 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
17546
17547 Strengthen `stage' portability.
17548
17549 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
17550 * configure.in: Use it.
17551 Don't check for malloc.h and sys/times.h.
17552 * src/system.h: Include them when appropriate.
17553 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
17554 times and struct tms are available.
17555
175562002-07-30 Akim Demaille <akim@epita.fr>
17557
17558 In verbose parse error message, don't report `error' as an
17559 expected token.
17560 * tests/actions.at (Printers and Destructors): Adjust.
17561 * tests/calc.at (Calculator $1): Adjust.
17562 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
17563 error message, do not report the parser accepts the error token in
17564 that state.
17565
175662002-07-30 Akim Demaille <akim@epita.fr>
17567
17568 Normalize conflict related messages.
17569
17570 * src/complain.h, src/complain.c (warn, complain): New.
17571 * src/conflicts.c (conflicts_print): Use them.
17572 (conflict_report_yacc): New, extracted from...
17573 (conflicts_print): here.
17574 * tests/conflicts.at, tests/existing.at: Adjust.
17575
175762002-07-30 Akim Demaille <akim@epita.fr>
17577
17578 Report rules which are never reduced by the parser: those hidden
17579 by conflicts.
17580
17581 * src/LR0.c (save_reductions): Don't make the final state too
17582 different: save its reduction (accept) instead of having a state
17583 without any action (no shift or goto, no reduce).
17584 Note: the final state is now a ``regular'' state, i.e., the
17585 parsers now contain `reduce 0' as default reduction.
17586 Nevertheless, since they decide to `accept' when yystate =
17587 final_state, they still will not reduce rule 0.
17588 * src/print.c (print_actions, print_reduction): Adjust.
17589 * src/output.c (action_row): Track reduced rules.
17590 (token_actions): Report rules never reduced.
17591 * tests/conflicts.at, tests/regression.at: Adjust.
17592
175932002-07-30 Akim Demaille <akim@epita.fr>
17594
17595 `stage' was accidently included in a previous patch.
17596 Initiate its autoconfiscation.
17597
17598 * configure.in: Look for malloc.h and sys/times.h.
17599 * src/main.c (stage): Adjust.
17600 Report only when trace_flag.
17601
176022002-07-29 Akim Demaille <akim@epita.fr>
17603
17604 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
17605 state_number_t.
17606 (errs_t): symbol_t*, not symbol_number_t.
17607 (reductions_t): rule_t*, not rule_number_t.
17608 (FOR_EACH_SHIFT): New.
17609 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
17610 * src/print.c, src/print_graph.c: Adjust.
17611
176122002-07-29 Akim Demaille <akim@epita.fr>
17613
17614 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
17615
17616 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
17617 (endtoken, accept): these.
17618 * src/reader.c (reader): Set endtoken's default tag to "$end".
17619 Set undeftoken's tag to "$undefined" instead of "$undefined.".
17620 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
17621 Adjust.
17622
176232002-07-29 Akim Demaille <akim@epita.fr>
17624
17625 * src/reduce.c (reduce_grammar): When the language is empty,
17626 complain about the start symbol, not the axiom.
17627 Use its location.
17628 * tests/reduce.at (Empty Language): New.
17629
176302002-07-26 Akim Demaille <akim@epita.fr>
17631
17632 * src/reader.h, src/reader.c (gram_error): ... can't get
17633 yycontrol without making too strong assumptions on the parser
17634 itself.
17635 * src/output.c (prepare_tokens): Use the real 0th value of
17636 token_translations instead of `0'.
17637 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
17638 visible here.
17639 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
17640 for the time being: %locations ought to provide it to yyerror.
17641
176422002-07-25 Akim Demaille <akim@epita.fr>
17643
17644 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
17645 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
17646 * tests/regression.at (Web2c Actions): Adjust.
17647
176482002-07-25 Akim Demaille <akim@epita.fr>
17649
17650 Stop storing rules from 1 to nrules + 1.
17651
17652 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
17653 * src/nullable.c, src/output.c, src/print.c, src/reader.c
17654 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
17655 Iterate from 0 to nrules.
17656 Use rule_number_as_item_number and item_number_as_rule_number.
17657 Adjust to `derive' now containing possibly 0.
17658 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
17659 Handle the `- 1' part in rule numbers from/to item numbers.
17660 * src/conflicts.c (log_resolution): Fix the message which reversed
17661 shift and reduce.
17662 * src/output.c (action_row): Initialize default_rule to -1.
17663 (token_actions): Adjust.
17664 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
17665 expected output.
17666 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
17667
176682002-07-25 Akim Demaille <akim@epita.fr>
17669
17670 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
17671 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
17672 (b4_c_knr_arg_decl): New.
17673 * data/yacc.c: Use it to define yysymprint, yydestruct, and
17674 yyreport_parse_error.
17675
176762002-07-25 Akim Demaille <akim@epita.fr>
17677
17678 * data/yacc.c (yyreport_parse_error): New, extracted from...
17679 (yyparse): here.
17680 (yydestruct, yysymprint): Move above yyparse.
17681 Be K&R compliant.
17682
176832002-07-25 Akim Demaille <akim@epita.fr>
17684
17685 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
17686 replace...
17687 (b4_sint_type, b4_uint_type): these.
17688 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
17689 * tests/regression.at (Web2c Actions): Adjust.
17690
176912002-07-25 Akim Demaille <akim@epita.fr>
17692
17693 * src/gram.h (TIEM_NUMBER_MAX): New.
17694 (item_number_of_rule_number, rule_number_of_item_number): Rename
17695 as...
17696 (rule_number_as_item_number, item_number_as_rule_number): these.
17697 Adjust dependencies.
17698 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17699 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17700 (symbol_number_to_vector_number): New.
17701 (order): Of vector_number_t* type.
17702 (base_t, BASE_MAX, BASE_MIN): New.
17703 (froms, tos, width, pos, check): Of base_t type.
17704 (action_number_t, ACTION_MIN, ACTION_MAX): New.
17705 (actrow): Of action_number_t type.
17706 (conflrow): Of unsigned int type.
17707 (table_ninf, base_ninf): New.
17708 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
17709 (muscle_insert_int_table, muscle_insert_base_table)
17710 (muscle_insert_rule_number_table): New.
17711 (prepare_tokens): Output `toknum' as int_table.
17712 (action_row): Returns a rule_number_t.
17713 Use ACTION_MIN, not SHRT_MIN.
17714 (token_actions): yydefact is rule_number_t*.
17715 (table_ninf_remap): New.
17716 (pack_table): Use it for `base' and `table'.
17717 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
17718 replaced with...
17719 (YYPACT_NINF, YYTABLE_NINF): these.
17720 (yypact, yytable): Compute their types instead of hard-coded
17721 `short'.
17722 * tests/regression.at (Web2c Actions): Adjust.
17723
177242002-07-19 Akim Demaille <akim@epita.fr>
17725
17726 * src/scan-gram.l (id): Can start with an underscore.
17727
177282002-07-16 Akim Demaille <akim@epita.fr>
17729
17730 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
17731 Adjust all former `associativity' dependencies.
17732 * src/symtab.c (symbol_new): Default associativity is `undef', not
17733 `right'.
17734 (symbol_check_alias_consistence): Adjust.
17735
177362002-07-09 Akim Demaille <akim@epita.fr>
17737
17738 * doc/bison.texinfo: Properly set the ``header'' part.
17739 Use @dircategory ``GNU programming tools'' as per Texinfo's
17740 documentation.
17741 Use @copying.
17742
177432002-07-09 Akim Demaille <akim@epita.fr>
17744
17745 * lib/quotearg.h: Protect against multiple inclusions.
17746 * src/location.h (location_t): Add a `file' member.
17747 (LOCATION_RESET, LOCATION_PRINT): Adjust.
17748 * src/complain.c (warn_at, complain_at, fatal_at): Drop
17749 `error_one_per_line' support.
17750
177512002-07-09 Akim Demaille <akim@epita.fr>
17752
17753 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
17754 * src/reader.c (lineno): Remove.
17755 Adjust all dependencies.
17756 (get_merge_function): Take a location and use complain_at.
17757 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
17758 * tests/regression.at (Invalid inputs, Mixing %token styles):
17759 Adjust.
17760
177612002-07-09 Akim Demaille <akim@epita.fr>
17762
17763 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
17764 recovery rule, and forbid extensions when --yacc.
17765 (gram_error): Use complain_at.
17766 * src/reader.c (reader): Exit if there were parse errors.
17767
177682002-07-09 Akim Demaille <akim@epita.fr>
17769
17770 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
17771 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
17772 Reported by R Blake <blakers@mac.com>.
17773
177742002-07-09 Akim Demaille <akim@epita.fr>
17775
17776 * data/yacc.c: Output the copyright notive in the header.
17777
177782002-07-03 Akim Demaille <akim@epita.fr>
17779
17780 * src/output.c (froms, tos): Are state_number_t.
17781 (save_column): sp, sp1, and sp2 are state_number_t.
17782 (prepare): Rename `final' as `final_state_number', `nnts' as
17783 `nterms_number', `nrules' as `rules_number', `nstates' as
17784 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
17785 unused.
17786 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
17787 * data/lalr1.cc (nsym_): Remove, unused.
17788
177892002-07-03 Akim Demaille <akim@epita.fr>
17790
17791 * src/lalr.h, src/lalr.c (goto_number_t): New.
17792 * src/lalr.c (goto_list_t): New.
17793 Propagate them.
17794 * src/nullable.c (rule_list_t): New.
17795 Propagate.
17796 * src/types.h: Remove.
17797
177982002-07-03 Akim Demaille <akim@epita.fr>
17799
17800 * src/closure.c (print_fderives): Use rule_rhs_print.
17801 * src/derives.c (print_derives): Use rule_rhs_print.
17802 (rule_list_t): New, replaces `shorts'.
17803 (set_derives): Add comments.
17804 * tests/sets.at (Nullable, Firsts): Adjust.
17805
178062002-07-03 Akim Demaille <akim@epita.fr>
17807
17808 * src/output.c (prepare_actions): Free `tally' and `width'.
17809 (prepare_actions): Allocate and free `order'.
17810 * src/symtab.c (symbols_free): Free `symbols'.
17811 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
17812 * src/output.c (m4_invoke): Move to...
17813 * src/scan-skel.l: here.
17814 (<<EOF>>): Close yyout, and free its name.
17815
178162002-07-03 Akim Demaille <akim@epita.fr>
17817
17818 Fix some memory leaks, and fix a bug: state 0 was examined twice.
17819
17820 * src/LR0.c (new_state): Merge into...
17821 (state_list_append): this.
17822 (new_states): Merge into...
17823 (generate_states): here.
17824 (set_states): Don't ensure a proper `errs' state member here, do it...
17825 * src/conflicts.c (conflicts_solve): here.
17826 * src/state.h, src/state.c: Comment changes.
17827 (state_t): Rename member `shifts' as `transitions'.
17828 Adjust all dependencies.
17829 (errs_new): For consistency, also take the values as argument.
17830 (errs_dup): Remove.
17831 (state_errs_set): New.
17832 (state_reductions_set, state_transitions_set): Assert that no
17833 previous value was assigned.
17834 (state_free): New.
17835 (states_free): Use it.
17836 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
17837 temporary storage: use `errs' and `nerrs' as elsewhere.
17838 (set_conflicts): Allocate and free this `errs'.
17839
178402002-07-02 Akim Demaille <akim@epita.fr>
17841
17842 * lib/libiberty.h: New.
17843 * lib: Update the bitset implementation from upstream.
17844 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
17845 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
17846 * src/main.c: Adjust bitset stats calls.
17847
178482002-07-01 Paul Eggert <eggert@twinsun.com>
17849
17850 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
17851 char, so that negative chars don't collide with $.
17852
178532002-06-30 Akim Demaille <akim@epita.fr>
17854
17855 Have the GLR tests be `warning' checked, and fix the warnings.
17856
17857 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
17858 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
17859 (yyremoveDeletes): `yyi' and `yyj' are size_t.
17860 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
17861 (yyaddDeferredAction): static.
17862 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
17863 (yyreportParseError): yyprefix is const.
17864 yytokenp is used only when verbose.
17865 (yy__GNUC__): Replace with __GNUC__.
17866 (yypdumpstack): yyi is size_t.
17867 (yypreference): Un-yy local variables and arguments, to avoid
17868 clashes with `yyr1'. Anyway, we are not in the user name space.
17869 (yytname_size): be an int, as is compared with ints.
17870 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
17871 Use them.
17872 * tests/cxx-gram.at: Use quotation to protect $1.
17873 Use AT_COMPILE to enable warnings hunts.
17874 Prototype yylex and yyerror.
17875 `Use' argc.
17876 Include `string.h', not `strings.h'.
17877 Produce and prototype stmtMerge only when used.
17878 yylex takes a location.
17879
178802002-06-30 Akim Demaille <akim@epita.fr>
17881
17882 We spend a lot of time in quotearg, in particular when --verbose.
17883
17884 * src/symtab.c (symbol_get): Store a quoted version of the key.
17885 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
17886 Adjust all callers.
17887
178882002-06-30 Akim Demaille <akim@epita.fr>
17889
17890 * src/state.h (reductions_t): Rename member `nreds' as num.
17891 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
17892 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
17893
178942002-06-30 Akim Demaille <akim@epita.fr>
17895
17896 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
17897 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
17898 (shifts_to): Rename as...
17899 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
17900 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
17901 (TRANSITION_IS_DISABLED, transitions_to): these.
17902
179032002-06-30 Akim Demaille <akim@epita.fr>
17904
17905 * src/print.c (print_shifts, print_gotos): Merge into...
17906 (print_transitions): this.
17907 (print_transitions, print_errs, print_reductions): Align the
17908 lookaheads columns.
17909 (print_core, print_transitions, print_errs, print_state,
17910 print_grammar): Output empty lines separator before, not after.
17911 (state_default_rule_compute): Rename as...
17912 (state_default_rule): this.
17913 * tests/conflicts.at (Defaulted Conflicted Reduction),
17914 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
17915 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
17916
179172002-06-30 Akim Demaille <akim@epita.fr>
17918
17919 Display items as we display rules.
17920
17921 * src/gram.h, src/gram.c (rule_lhs_print): New.
17922 * src/gram.c (grammar_rules_partial_print): Use it.
17923 * src/print.c (print_core): Likewise.
17924 * tests/conflicts.at (Defaulted Conflicted Reduction),
17925 (Unresolved SR Conflicts): Adjust.
17926 (Unresolved SR Conflicts): Adjust and rename as...
17927 (Resolved SR Conflicts): this, as was meant.
17928 * tests/regression.at (Web2c Report): Adjust.
17929
179302002-06-30 Akim Demaille <akim@epita.fr>
17931
17932 * src/print.c (state_default_rule_compute): New, extracted from...
17933 (print_reductions): here.
17934 Pessimize, but clarify the code.
17935 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
17936
179372002-06-30 Akim Demaille <akim@epita.fr>
17938
17939 * src/output.c (action_row): Let default_rule be always a rule
17940 number.
17941
179422002-06-30 Akim Demaille <akim@epita.fr>
17943
17944 * src/closure.c (print_firsts, print_fderives, closure):
17945 Use BITSET_EXECUTE.
17946 * src/lalr.c (lookaheads_print): Likewise.
17947 * src/state.c (state_rule_lookaheads_print): Likewise.
17948 * src/print_graph.c (print_core): Likewise.
17949 * src/print.c (print_reductions): Likewise.
17950 * src/output.c (action_row): Likewise.
17951 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
17952
179532002-06-30 Akim Demaille <akim@epita.fr>
17954
17955 * src/print_graph.c: Use report_flag.
17956
179572002-06-30 Akim Demaille <akim@epita.fr>
17958
17959 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
17960 to...
17961 * src/relation.h, src/relation.c (traverse, relation_digraph)
17962 (relation_print, relation_transpose): New.
17963
179642002-06-30 Akim Demaille <akim@epita.fr>
17965
17966 * src/state.h, src/state.c (shifts_to): New.
17967 * src/lalr.c (build_relations): Use it.
17968
179692002-06-30 Akim Demaille <akim@epita.fr>
17970
17971 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
17972 (item_number_of_rule_number, rule_number_of_item_number): New.
17973 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
17974 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17975 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
17976 Propagate their use.
17977 Much remains to be done, in particular wrt `shorts' from types.h.
17978
179792002-06-30 Akim Demaille <akim@epita.fr>
17980
17981 * src/symtab.c (symbol_new): Initialize the `printer' member.
17982
179832002-06-30 Akim Demaille <akim@epita.fr>
17984
17985 * src/LR0.c (save_reductions): Remove, replaced by...
17986 * src/state.h, src/state.c (state_reductions_set): New.
17987 (reductions, errs): Rename as...
17988 (reductions_t, errs_t): these.
17989 Adjust all dependencies.
17990
179912002-06-30 Akim Demaille <akim@epita.fr>
17992
17993 * src/LR0.c (state_list_t, state_list_append): New.
17994 (first_state, last_state): Now symbol_list_t.
17995 (this_state): Remove.
17996 (new_itemsets, append_states, save_reductions): Take a state_t as
17997 argument.
17998 (set_states, generate_states): Adjust.
17999 (save_shifts): Remove, replaced by...
18000 * src/state.h, src/state.c (state_shifts_set): New.
18001 (shifts): Rename as...
18002 (shifts_t): this.
18003 Adjust all dependencies.
18004 * src/state.h (state_t): Remove the `next' member.
18005
180062002-06-30 Akim Demaille <akim@epita.fr>
18007
18008 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
18009 escaped in slot 0.
18010
180112002-06-30 Akim Demaille <akim@epita.fr>
18012
18013 Use hash.h for the state hash table.
18014
18015 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
18016 (allocate_storage): Use state_hash_new.
18017 (free_storage): Use state_hash_free.
18018 (new_state, get_state): Adjust.
18019 * src/lalr.h, src/lalr.c (states): Move to...
18020 * src/states.h (state_t): Remove the `link' member, no longer
18021 used.
18022 * src/states.h, src/states.c: here.
18023 (state_hash_new, state_hash_free, state_hash_lookup)
18024 (state_hash_insert, states_free): New.
18025 * src/states.c (state_table, state_compare, state_hash): New.
18026 * src/output.c (output_actions): Do not free states now, since we
18027 still need to know the final_state number in `prepare', called
18028 afterwards. Do it...
18029 * src/main.c (main): here: call states_free after `output'.
18030
180312002-06-30 Akim Demaille <akim@epita.fr>
18032
18033 * src/state.h, src/state.c (state_new): New, extracted from...
18034 * src/LR0.c (new_state): here.
18035 * src/state.h (STATE_ALLOC): Move to...
18036 * src/state.c: here.
18037 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
18038 * src/state.h, src/state.c: here.
18039
180402002-06-30 Akim Demaille <akim@epita.fr>
18041
18042 * src/reader.c (gensym): Rename as...
18043 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
18044 (getsym): Rename as...
18045 (symbol_get): this.
18046
180472002-06-30 Akim Demaille <akim@epita.fr>
18048
18049 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
18050 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
18051 * src/output.c, src/print.c, src/print_graph.c: Propagate.
18052 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
18053
180542002-06-30 Akim Demaille <akim@epita.fr>
18055
18056 Make the test suite pass with warnings checked.
18057
18058 * tests/actions.at (Printers and Destructors): Improve.
18059 Avoid unsigned vs. signed issues.
18060 * tests/calc.at: Don't exercise the scanner here, do it...
18061 * tests/input.at (Torturing the Scanner): here.
18062
180632002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18064
18065 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
18066 reorganize first lines parallel to yacc.c.
18067
180682002-06-28 Akim Demaille <akim@epita.fr>
18069
18070 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
18071 (b4_token_enum, b4_token_defines): New, factored from...
18072 * data/lalr1.cc, data/yacc.c, glr.c: here.
18073
180742002-06-28 Akim Demaille <akim@epita.fr>
18075
18076 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
18077 unused variables.
18078 * src/output.c (merger_output): static.
18079
180802002-06-28 Akim Demaille <akim@epita.fr>
18081
18082 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
18083 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
18084 pacify GCC.
18085 * src/output.c (save_row): Initialize all the variables to pacify GCC.
18086
180872002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18088
18089 Accumulated changelog for new GLR parsing features.
18090
18091 * src/conflicts.c (count_total_conflicts): Change name to
18092 conflicts_total_count.
18093 * src/conflicts.h: Ditto.
18094 * src/output.c (token_actions): Use the new name.
18095 (output_conflicts): Change conflp => conflict_list_heads, and
18096 confl => conflict_list for better readability.
18097 * data/glr.c: Use the new names.
18098 * NEWS: Add self to GLR announcement.
18099
18100 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
18101
18102 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
18103 Akim Demaille.
18104
18105 * data/bison.glr: Change name to glr.c
18106 * data/glr.c: Renamed from bison.glr.
18107 * data/Makefile.am: Add glr.c
18108
18109 * src/getargs.c:
18110
18111 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
18112 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
18113
18114 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18115
18116 * data/bison.glr: Be sure to restore the
18117 current #line when returning to the skeleton contents after having
18118 exposed the input file's #line.
18119
18120 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18121
18122 * data/bison.glr: Bring up to date with changes to bison.simple.
18123
18124 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18125
18126 * data/bison.glr: Correct definitions that use b4_prefix.
18127 Various reformatting.
18128 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
18129 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
18130 yytokenp argument; now part of stack.
18131 (yychar): Define to behave as documented.
18132 (yyclearin): Ditto.
18133
18134 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18135
18136 * src/reader.h: Add declaration for free_merger_functions.
18137
18138 * src/reader.c (merge_functions): New variable.
18139 (get_merge_function): New function.
18140 (free_merger_functions): New function.
18141 (readgram): Check for %prec that is not followed by a symbol.
18142 Handle %dprec and %merge declarations.
18143 (packgram): Initialize dprec and merger fields in rules array.
18144
18145 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
18146 conflict_list_cnt, conflict_list_free): New variables.
18147 (table_grow): Also grow conflict_table.
18148 (prepare_rules): Output dprec and merger tables.
18149 (conflict_row): New function.
18150 (action_row): Output conflict lists for GLR parser. Don't use
18151 default reduction in conflicted states for GLR parser so that there
18152 are spaces for the conflict lists.
18153 (save_row): Also save conflict information.
18154 (token_actions): Allocate conflict list.
18155 (merger_output): New function.
18156 (pack_vector): Pack conflict table, too.
18157 (output_conflicts): New function to output yyconflp and yyconfl.
18158 (output_check): Allocate conflict_tos.
18159 (output_actions): Output conflict tables, also.
18160 (output_skeleton): Output b4_mergers definition.
18161 (prepare): Output b4_max_rhs_length definition.
18162 Use 'bison.glr' as default skeleton for GLR parsers.
18163
18164 * src/gram.c (glr_parser): New flag.
18165 (grammar_free): Call free_merger_functions.
18166
18167 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
18168 all pairs of conflicting reductions, rather than just all tokens
18169 causing conflicts. Needed to size conflict tables.
18170 (conflicts_output): Modify call to count_rr_conflicts for new
18171 interface.
18172 (conflicts_print): Ditto.
18173 (count_total_conflicts): New function.
18174
18175 * src/reader.h (merger_list): New type.
18176 (merge_functions): New variable.
18177
18178 * src/lex.h (tok_dprec, tok_merge): New token types.
18179
18180 * src/gram.h (rule_s): Add dprec and merger fields.
18181 (glr_parser): New flag.
18182
18183 * src/conflicts.h (count_total_conflicts): New function.
18184
18185 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
18186
18187 * doc/bison.texinfo (Generalized LR Parsing): New section.
18188 (GLR Parsers): New section.
18189 (Language and Grammar): Mention GLR parsing.
18190 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
18191 Correct typo ("tge" -> "the").
18192
18193 * data/bison.glr: New skeleton for GLR parsing.
18194
18195 * tests/cxx-gram.at: New tests for GLR parsing.
18196
18197 * tests/testsuite.at: Include cxx-gram.at.
18198
18199 * tests/Makefile.am: Add cxx-gram.at.
18200
18201 * src/parse-gram.y:
18202
18203 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
18204
18205 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
18206
182072002-06-27 Akim Demaille <akim@epita.fr>
18208
18209 * src/options.h, src/options.c: Remove.
18210 * src/getargs.c (short_options, long_options): New.
18211
182122002-06-27 Akim Demaille <akim@epita.fr>
18213
18214 * data/bison.simple, data/bison.c++: Rename as...
18215 * data/yacc.c, data/lalr1.cc: these.
18216 * doc/bison.texinfo (Environment Variables): Remove.
18217
182182002-06-25 Raja R Harinath <harinath@cs.umn.edu>
18219
18220 * src/getargs.c (report_argmatch): Initialize strtok().
18221
182222002-06-20 Akim Demaille <akim@epita.fr>
18223
18224 * data/bison.simple (b4_symbol_actions): New, replaces...
18225 (b4_symbol_destructor, b4_symbol_printer): these.
18226 (yysymprint): Be sure to call YYPRINT only for tokens, and using
18227 user token numbers.
18228
182292002-06-20 Akim Demaille <akim@epita.fr>
18230
18231 * data/bison.simple (yydestructor): Rename as...
18232 (yydestruct): this.
18233
182342002-06-20 Akim Demaille <akim@epita.fr>
18235
18236 * src/symtab.h, src/symtab.c (symbol_type_set)
18237 (symbol_destructor_set, symbol_precedence_set): The location is
18238 the last argument.
18239 Adjust all callers.
18240
182412002-06-20 Akim Demaille <akim@epita.fr>
18242
18243 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
18244 internals.
18245 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
18246 Takes a location.
18247 * src/symtab.h, src/symtab.c (symbol_class_set)
18248 (symbol_user_token_number_set): Likewise.
18249 Adjust all callers.
18250 Promote complain_at.
18251 * tests/input.at (Type Clashes): Adjust.
18252
182532002-06-20 Akim Demaille <akim@epita.fr>
18254
18255 * data/bison.simple (YYLEX): Fix the declaration when
18256 %pure-parser.
18257
182582002-06-20 Akim Demaille <akim@epita.fr>
18259
18260 * data/bison.simple (yysymprint): Don't print the token number,
18261 just its name.
18262 * tests/actions.at (Destructors): Rename as...
18263 (Printers and Destructors): this.
18264 Also exercise %printer.
18265
182662002-06-20 Akim Demaille <akim@epita.fr>
18267
18268 * data/bison.simple (YYDSYMPRINT): New.
18269 Use it to remove many of the #if YYDEBUG/if (yydebug).
18270
182712002-06-20 Akim Demaille <akim@epita.fr>
18272
18273 * src/symtab.h, src/symtab.c (symbol_t): printer and
18274 printer_location are new members.
18275 (symbol_printer_set): New.
18276 * src/parse-gram.y (PERCENT_PRINTER): New token.
18277 Handle its associated rule.
18278 * src/scan-gram.l: Adjust.
18279 (handle_destructor_at, handle_destructor_dollar): Rename as...
18280 (handle_symbol_code_at, handle_symbol_code_dollar): these.
18281 * src/output.c (symbol_printers_output): New.
18282 (output_skeleton): Call it.
18283 * data/bison.simple (yysymprint): New. Cannot be named yyprint
18284 since there are already many grammar files with a user `yyprint'.
18285 Replace the calls to YYPRINT to calls to yysymprint.
18286 * tests/calc.at: Adjust.
18287 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
18288 taking advantage of parser very internal details (stack size!).
18289
182902002-06-20 Akim Demaille <akim@epita.fr>
18291
18292 * src/scan-gram.l: Complete the scanner with the missing patterns
18293 to pacify Flex.
18294 Use `quote' and `symbol_tag_get' where appropriate.
18295
182962002-06-19 Akim Demaille <akim@epita.fr>
18297
18298 * tests/actions.at (Destructors): Augment to test locations.
18299 * data/bison.simple (yydestructor): Pass it the current location
18300 if locations are enabled.
18301 Prototype only when __STDC__ or C++.
18302 Change the argument names to move into the yy name space: there is
18303 user code here.
18304
183052002-06-19 Akim Demaille <akim@epita.fr>
18306
18307 * data/bison.simple (b4_pure_if): New.
18308 Use it instead of #ifdef YYPURE.
18309
183102002-06-19 Akim Demaille <akim@epita.fr>
18311
18312 * data/bison.simple (b4_location_if): New.
18313 Use it instead of #ifdef YYLSP_NEEDED.
18314
183152002-06-19 Akim Demaille <akim@epita.fr>
18316
18317 Prepare @$ in %destructor, but currently don't bind it in the
18318 skeleton, as %location use is not cleaned up yet.
18319
18320 * src/scan-gram.l (handle_dollar, handle_destructor_at)
18321 (handle_action_at): New.
18322 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
18323 a braced_code_t and a location as additional arguments.
18324 (handle_destructor_dollar): Instead of requiring `b4_eval', just
18325 unquote one when outputting `b4_dollar_dollar'.
18326 Adjust callers.
18327 * data/bison.simple (b4_eval): Remove.
18328 (b4_symbol_destructor): Adjust.
18329 * tests/input.at (Invalid @n): Adjust.
18330
183312002-06-19 Zack Weinberg <zack@codesourcery.com>
18332
18333 * doc/bison.texinfo: Document ability to have multiple
18334 prologue sections.
18335
183362002-06-18 Akim Demaille <akim@epita.fr>
18337
18338 * src/files.c (compute_base_names): When computing the output file
18339 names from the input file name, strip the directory part.
18340
183412002-06-18 Akim Demaille <akim@epita.fr>
18342
18343 * data/bison.simple.new: Comment changes.
18344 Reported by Andreas Schwab.
18345
183462002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
18347
18348 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
18349 there are no `label `yyoverflowlab' defined but not used' warnings
18350 when yyoverflow is defined.
18351
183522002-06-18 Akim Demaille <akim@epita.fr>
18353
18354 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
18355 new member.
18356 (symbol_destructor_set): Adjust.
18357 * src/output.c (symbol_destructors_output): Output the destructor
18358 locations.
18359 Output the symbol name.
18360 * data/bison.simple (b4_symbol_destructor): Adjust.
18361
183622002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
18363 and Akim Demaille <akim@epita.fr>
18364
18365 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
18366 what's left on the stack when the error recovery hits EOF.
18367 * tests/actions.at (Destructors): Complete to exercise this case.
18368
183692002-06-17 Akim Demaille <akim@epita.fr>
18370
18371 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
18372 arguments is really empty, not only equal to `[]'.
18373 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
18374 member.
18375 (symbol_destructor_set): New.
18376 * src/output.c (symbol_destructors_output): New.
18377 * src/reader.h (brace_code_t, current_braced_code): New.
18378 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
18379 (handle_dollar): Rename as...
18380 (handle_action_dollar): this.
18381 (handle_destructor_dollar): New.
18382 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
18383 (grammar_declaration): Use it.
18384 * data/bison.simple (yystos): Is always defined.
18385 (yydestructor): New.
18386 * tests/actions.at (Destructors): New.
18387 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
18388
183892002-06-17 Akim Demaille <akim@epita.fr>
18390
18391 * src/symlist.h, src/symlist.c (symbol_list_length): New.
18392 * src/scan-gram.l (handle_dollar, handle_at): Compute the
18393 rule_length only when needed.
18394 * src/output.c (actions_output, token_definitions_output): Output
18395 the full M4 block.
18396 * src/symtab.c: Don't access directly to the symbol tag, use
18397 symbol_tag_get.
18398 * src/parse-gram.y: Use symbol_list_free.
18399
184002002-06-17 Akim Demaille <akim@epita.fr>
18401
18402 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
18403 (symbol_list_prepend, get_type_name): Move to...
18404 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
18405 (symbol_list_prepend, symbol_list_n_type_name_get): here.
18406 Adjust all callers.
18407 (symbol_list_free): New.
18408 * src/scan-gram.l (handle_dollar): Takes a location.
18409 * tests/input.at (Invalid $n): Adjust.
18410
184112002-06-17 Akim Demaille <akim@epita.fr>
18412
18413 * src/reader.h, src/reader.c (symbol_list_new): Export it.
18414 (symbol_list_prepend): New.
18415 * src/parse-gram.y (%union): `list' is a new member.
18416 (symbols.1): New, replaces...
18417 (terms_to_prec.1, nterms_to_type.1): these.
18418 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
18419 Take a location as additional argument.
18420 Adjust all callers.
18421
184222002-06-15 Akim Demaille <akim@epita.fr>
18423
18424 * src/parse-gram.y: Move %token in the declaration section so that
18425 we don't depend upon CVS Bison.
18426
184272002-06-15 Akim Demaille <akim@epita.fr>
18428
18429 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
18430 * src/print.c (print_core): Use it.
18431
184322002-06-15 Akim Demaille <akim@epita.fr>
18433
18434 * src/conflicts.c (log_resolution): Accept the rule involved in
18435 the sr conflicts instead of the lookahead number that points to
18436 that rule.
18437 (flush_reduce): Accept the current lookahead vector as argument,
18438 instead of the index in LA.
18439 (resolve_sr_conflict): Accept the current number of lookahead
18440 bitset to consider for the STATE, instead of the index in LA.
18441 (set_conflicts): Adjust.
18442 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
18443
184442002-06-15 Akim Demaille <akim@epita.fr>
18445
18446 * src/state.h (state_t): Replace the `lookaheadsp' member, a
18447 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
18448 Adjust all dependencies.
18449 * src/lalr.c (initialize_lookaheads): Split into...
18450 (states_lookaheads_count, states_lookaheads_initialize): these.
18451 (lalr): Adjust.
18452
184532002-06-15 Akim Demaille <akim@epita.fr>
18454
18455 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
18456 out of...
18457 (grammar_rules_print): here.
18458 * src/reduce.c (reduce_output): Use it.
18459 * tests/reduce.at (Useless Rules, Reduced Automaton)
18460 (Underivable Rules): Adjust.
18461
184622002-06-15 Akim Demaille <akim@epita.fr>
18463
18464 Copy BYacc's nice way to report the grammar.
18465
18466 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
18467 New.
18468 Don't print the rules' location, it is confusing and useless.
18469 (rule_print): Use grammar_rhs_print.
18470 * src/print.c (print_grammar): Use grammar_rules_print.
18471
184722002-06-15 Akim Demaille <akim@epita.fr>
18473
18474 Complete and rationalize `useless thing' warnings.
18475
18476 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
18477 (symbol_tag_print): New.
18478 Use them everywhere in place of accessing directly the tag member.
18479 * src/gram.h, src/gram.c (rule_print): New.
18480 Use it where a rule used to be printed `by hand'.
18481 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
18482 (reduce_grammar_tables): Report the useless rules.
18483 (reduce_print): Useless things are a warning, not an error.
18484 Report it as such.
18485 * tests/reduce.at (Useless Nonterminals, Useless Rules):
18486 (Reduced Automaton, Underivable Rules): Adjust.
18487 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
18488 * tests/conflicts.at (Unresolved SR Conflicts)
18489 (Solved SR Conflicts): Adjust.
18490
184912002-06-15 Akim Demaille <akim@epita.fr>
18492
18493 Let symbols have a location.
18494
18495 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
18496 (getsym): Adjust.
18497 Adjust all callers.
18498 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
18499 Use location_t, not int.
18500 * src/symtab.c (symbol_check_defined): Take advantage of the
18501 location.
18502 * tests/regression.at (Invalid inputs): Adjust.
18503
185042002-06-15 Akim Demaille <akim@epita.fr>
18505
18506 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
18507 (input): Don't try to initialize yylloc here, do it in the
18508 scanner.
18509 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
18510 * src/gram.h (rule_t): Change line and action_line into location
18511 and action_location, of location_t type.
18512 Adjust all dependencies.
18513 * src/location.h, src/location.c (empty_location): New.
18514 * src/reader.h, src/reader.c (grammar_start_symbol_set)
18515 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
18516 (grammar_current_rule_symbol_append)
18517 (grammar_current_rule_action_append): Expect a location as argument.
18518 * src/reader.c (grammar_midrule_action): Adjust to attach an
18519 action's location as dummy symbol location.
18520 * src/symtab.h, src/symtab.c (startsymbol_location): New.
18521 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
18522 the line numbers.
18523
185242002-06-14 Akim Demaille <akim@epita.fr>
18525
18526 Grammar declarations may be found in the grammar section.
18527
18528 * src/parse-gram.y (rules_or_grammar_declaration): New.
18529 (declarations): Each declaration may end with a semicolon, not
18530 just...
18531 (grammar_declaration): `"%union"'.
18532 (grammar): Branch to rules_or_grammar_declaration.
18533
185342002-06-14 Akim Demaille <akim@epita.fr>
18535
18536 * src/main.c (main): Invoke scanner_free.
18537
185382002-06-14 Akim Demaille <akim@epita.fr>
18539
18540 * src/output.c (m4_invoke): Extracted from...
18541 (output_skeleton): here.
18542 Free tempfile.
18543
185442002-06-14 Akim Demaille <akim@epita.fr>
18545
18546 * src/parse-gram.y (directives, directive, gram)
18547 (grammar_directives, precedence_directives, precedence_directive):
18548 Rename as...
18549 (declarations, declaration, grammar, grammar_declaration)
18550 (precedence_declaration, precedence_declarator): these.
18551 (symbol_declaration): New.
18552
185532002-06-14 Akim Demaille <akim@epita.fr>
18554
18555 * src/files.c (action_obstack): Remove, unused.
18556 (output_obstack): Remove it, and all its dependencies, as it is no
18557 longer needed.
18558 * src/reader.c (epilogue_set): Build the epilogue in the
18559 muscle_obstack.
18560 * src/output.h, src/output.c (muscle_obstack): Move to...
18561 * src/muscle_tab.h, src/muscle_tab.h: here.
18562 (muscle_init): Initialize muscle_obstack.
18563 (muscle_free): New.
18564 * src/main.c (main): Call it.
18565
185662002-06-14 Akim Demaille <akim@epita.fr>
18567
18568 * src/location.h: New, extracted from...
18569 * src/reader.h: here.
18570 * src/Makefile.am (noinst_HEADERS): Merge into
18571 (bison_SOURCES): this.
18572 Add location.h.
18573 * src/parse-gram.y: Use location_t instead of Bison's.
18574 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
18575 Use location_t instead of ints.
18576
185772002-06-14 Akim Demaille <akim@epita.fr>
18578
18579 * data/bison.simple, data/bison.c++: Be sure to restore the
18580 current #line when returning to the skeleton contents after having
18581 exposed the input file's #line.
18582
185832002-06-12 Akim Demaille <akim@epita.fr>
18584
18585 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
18586 eager.
18587 * tests/actions.at (Exotic Dollars): New.
18588
185892002-06-12 Akim Demaille <akim@epita.fr>
18590
18591 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
18592 ['"/] too eagerly.
18593 * tests/input.at (Torturing the Scanner): New.
18594
185952002-06-11 Akim Demaille <akim@epita.fr>
18596
18597 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
18598 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
18599 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
18600 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
18601 * src/reader.c (reader): Use it.
18602
186032002-06-11 Akim Demaille <akim@epita.fr>
18604
18605 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
18606 Adjust all callers.
18607 (scanner_last_string_free): New.
18608
186092002-06-11 Akim Demaille <akim@epita.fr>
18610
18611 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
18612 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
18613 (last_string, YY_OBS_FREE): New.
18614 Use them when returning an ID.
18615
186162002-06-11 Akim Demaille <akim@epita.fr>
18617
18618 Have Bison grammars parsed by a Bison grammar.
18619
18620 * src/reader.c, src/reader.h (prologue_augment): New.
18621 * src/reader.c (copy_definition): Remove.
18622
18623 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
18624 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
18625 (grammar_current_rule_prec_set, grammar_current_rule_check)
18626 (grammar_current_rule_symbol_append)
18627 (grammar_current_rule_action_append): Export.
18628 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
18629 (symbol_list_action_append): Remove.
18630 Hook the routines from reader.
18631 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
18632 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18633
18634 * src/reader.c (read_declarations): Remove, unused.
18635
18636 * src/parse-gram.y: Handle the epilogue.
18637 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
18638 (grammar_start_symbol_set): this.
18639 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
18640 * src/reader.c (readgram): Remove, unused.
18641 (reader): Adjust to insert eoftoken and axiom where appropriate.
18642
18643 * src/reader.c (copy_dollar): Replace with...
18644 * src/scan-gram.h (handle_dollar): this.
18645 * src/parse-gram.y: Remove `%thong'.
18646
18647 * src/reader.c (copy_at): Replace with...
18648 * src/scan-gram.h (handle_at): this.
18649
18650 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
18651 New.
18652
18653 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
18654 time being.
18655
18656 * src/reader.h, src/reader.c (grammar_rule_end): New.
18657
18658 * src/parse.y (current_type, current_class): New.
18659 Implement `%nterm', `%token' support.
18660 Merge `%term' into `%token'.
18661 (string_as_id): New.
18662 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
18663 type name.
18664
18665 * src/parse-gram.y: Be sure to handle properly the beginning of
18666 rules.
18667
18668 * src/parse-gram.y: Handle %type.
18669 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
18670
18671 * src/parse-gram.y: More directives support.
18672 * src/options.c: No longer handle source directives.
18673
18674 * src/parse-gram.y: Fix %output.
18675
18676 * src/parse-gram.y: Handle %union.
18677 Use the prologue locations.
18678 * src/reader.c (parse_union_decl): Remove.
18679
18680 * src/reader.h, src/reader.c (epilogue_set): New.
18681 * src/parse-gram.y: Use it.
18682
18683 * data/bison.simple, data/bison.c++: b4_stype is now either not
18684 defined, then default to int, or to the contents of %union,
18685 without `union' itself.
18686 Adjust.
18687 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
18688
18689 * src/output.c (actions_output): Don't output braces, as they are
18690 already handled by the scanner.
18691
18692 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
18693 characters to themselves.
18694
18695 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
18696 that the epilogue has a proper #line.
18697
18698 * src/parse-gram.y: Handle precedence/associativity.
18699
18700 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
18701 a terminal.
18702 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
18703 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
18704 at all to define terminals that cannot be emitted.
18705
18706 * src/scan-gram.l: Escape M4 characters.
18707
18708 * src/scan-gram.l: Working properly with escapes in user
18709 strings/characters.
18710
18711 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
18712 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
18713 grammar.
18714 Use more modest sizes, as for the time being the parser does not
18715 release memory, and therefore the process swallows a huge amount
18716 of memory.
18717
18718 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
18719 stricter %token grammar.
18720
18721 * src/symtab.h (associativity): Add `undef_assoc'.
18722 (symbol_precedence_set): Do nothing when passed an undef_assoc.
18723 * src/symtab.c (symbol_check_alias_consistence): Adjust.
18724
18725 * tests/regression.at (Invalid %directive): Remove, as it is now
18726 meaningless.
18727 (Invalid inputs): Adjust to the new error messages.
18728 (Token definitions): The new grammar doesn't allow too many
18729 eccentricities.
18730
18731 * src/lex.h, src/lex.c: Remove.
18732 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
18733 (copy_character, copy_string2, copy_string, copy_identifier)
18734 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
18735 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
18736 (parse_action): Remove.
18737 * po/POTFILES.in: Adjust.
18738
187392002-06-11 Akim Demaille <akim@epita.fr>
18740
18741 * src/reader.c (parse_action): Don't store directly into the
18742 rule's action member: return the action as a string.
18743 Don't require `rule_length' as an argument: compute it.
18744 (grammar_current_rule_symbol_append)
18745 (grammar_current_rule_action_append): New, eved out from
18746 (readgram): here.
18747 Remove `action_flag', `rulelength', unused now.
18748
187492002-06-11 Akim Demaille <akim@epita.fr>
18750
18751 * src/reader.c (grammar_current_rule_prec_set).
18752 (grammar_current_rule_check): New, eved out from...
18753 (readgram): here.
18754 Remove `xaction', `first_rhs': useless.
18755 * tests/input.at (Type clashes): New.
18756 * tests/existing.at (GNU Cim Grammar): Adjust.
18757
187582002-06-11 Akim Demaille <akim@epita.fr>
18759
18760 * src/reader.c (grammar_midrule_action): New, Eved out from
18761 (readgram): here.
18762
187632002-06-11 Akim Demaille <akim@epita.fr>
18764
18765 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
18766 New.
18767 (readgram): Use them as replacement of inlined code, crule and
18768 crule1.
18769
187702002-06-11 Akim Demaille <akim@epita.fr>
18771
18772 * src/reader.c (grammar_end, grammar_symbol_append): New.
18773 (readgram): Use them.
18774 Make the use of `p' as local as possible.
18775
187762002-06-10 Akim Demaille <akim@epita.fr>
18777
18778 GCJ's parser requires the tokens to be defined before the prologue.
18779
18780 * data/bison.simple: Output the token definition before the user's
18781 prologue.
18782 * tests/regression.at (Braces parsing, Duplicate string)
18783 (Mixing %token styles): Check the output from bison.
18784 (Early token definitions): New.
18785
187862002-06-10 Akim Demaille <akim@epita.fr>
18787
18788 * src/symtab.c (symbol_user_token_number_set): Don't complain when
18789 assigning twice the same user number to a token, so that we can
18790 use it in...
18791 * src/lex.c (lex): here.
18792 Also use `symbol_class_set' instead of hand written code.
18793 * src/reader.c (parse_assoc_decl): Likewise.
18794
187952002-06-10 Akim Demaille <akim@epita.fr>
18796
18797 * src/symtab.c, src/symtab.c (symbol_class_set)
18798 (symbol_user_token_number_set): New.
18799 * src/reader.c (parse_token_decl): Use them.
18800 Use a switch instead of ifs.
18801 Use a single argument.
18802
188032002-06-10 Akim Demaille <akim@epita.fr>
18804
18805 Remove `%thong' support as it is undocumented, unused, duplicates
18806 `%token's job, and creates useless e-mail traffic with people who
18807 want to know what it is, why it is undocumented, unused, and
18808 duplicates `%token's job.
18809
18810 * src/reader.c (parse_thong_decl): Remove.
18811 * src/options.c (option_table): Remove "thong".
18812 * src/lex.h (tok_thong): Remove.
18813
188142002-06-10 Akim Demaille <akim@epita.fr>
18815
18816 * src/symtab.c, src/symtab.c (symbol_type_set)
18817 (symbol_precedence_set): New.
18818 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
18819 (value_components_used): Remove, unused.
18820
188212002-06-09 Akim Demaille <akim@epita.fr>
18822
18823 Move symbols handling code out of the reader.
18824
18825 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
18826 (axiom): Move to...
18827 * src/symtab.h, src/symtab.c: here.
18828
18829 * src/gram.c (start_symbol): Remove: use startsymbol->number.
18830 * src/reader.c (startval): Rename as...
18831 * src/symtab.h, src/symtab.c (startsymbol): this.
18832 * src/reader.c: Adjust.
18833
18834 * src/reader.c (symbol_check_defined, symbol_make_alias)
18835 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18836 (token_translations_init)
18837 Move to...
18838 * src/symtab.c: here.
18839 * src/reader.c (packsymbols): Move to...
18840 * src/symtab.h, src/symtab.c (symbols_pack): here.
18841 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
18842 argument.
18843
188442002-06-03 Akim Demaille <akim@epita.fr>
18845
18846 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
18847 then statements.
18848
188492002-06-03 Akim Demaille <akim@epita.fr>
18850
18851 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
18852 structs with non literals.
18853 * src/scan-skel.l: never-interactive.
18854 * src/conflicts.c (enum conflict_resolution_e): No trailing
18855 comma.
18856 * src/getargs.c (usage): Split long literal strings.
18857 Reported by Hans Aberg.
18858
188592002-05-28 Akim Demaille <akim@epita.fr>
18860
18861 * data/bison.c++: Use C++ ostreams.
18862 (cdebug_): New member.
18863
188642002-05-28 Akim Demaille <akim@epita.fr>
18865
18866 * src/output.c (output_skeleton): Be sure to allocate enough room
18867 for `/' _and_ for `\0' in full_skeleton.
18868
188692002-05-28 Akim Demaille <akim@epita.fr>
18870
18871 * data/bison.c++: Catch up with bison.simple:
18872 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18873 and Paul Eggert <eggert@twinsun.com>: `error' handing.
18874 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
18875 and popping traces.
18876
188772002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18878
18879 * src/output.c (output_skeleton): Put an explicit path in front of
18880 the skeleton file name, rather than relying on the -I directory,
18881 to partially alleviate effects of having a skeleton file lying around
18882 in the current directory.
18883
188842002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18885
18886 * src/conflicts.c (log_resolution): Correct typo:
18887 obstack_printf should be obstack_fgrow1.
18888
188892002-05-26 Akim Demaille <akim@epita.fr>
18890
18891 * src/state.h (state_t): `solved_conflicts' is a new member.
18892 * src/LR0.c (new_state): Set it to 0.
18893 * src/conflicts.h, src/conflicts.c (print_conflicts)
18894 (free_conflicts, solve_conflicts): Rename as...
18895 (conflicts_print, conflicts_free, conflicts_solve): these.
18896 Adjust callers.
18897 * src/conflicts.c (enum conflict_resolution_e)
18898 (solved_conflicts_obstack): New, used by...
18899 (log_resolution): this.
18900 Adjust to attach the conflict resolution to each state.
18901 Complete the description with the precedence/associativity
18902 information.
18903 (resolve_sr_conflict): Adjust.
18904 * src/print.c (print_state): Output its solved_conflicts.
18905 * tests/conflicts.at (Unresolved SR Conflicts)
18906 (Solved SR Conflicts): Exercise --report=all.
18907
189082002-05-26 Akim Demaille <akim@epita.fr>
18909
18910 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18911 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18912 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
18913 (token_number_t, item_number_as_token_number)
18914 (token_number_as_item_number, muscle_insert_token_number_table):
18915 Rename as...
18916 (symbol_number_t, item_number_as_symbol_number)
18917 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
18918 these, since it is more appropriate.
18919
189202002-05-26 Akim Demaille <akim@epita.fr>
18921
18922 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
18923 `Error:' lines.
18924 * data/bison.simple (yystos) [YYDEBUG]: New.
18925 (yyparse) [YYDEBUG]: Display the symbols which are popped during
18926 error recovery.
18927 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
18928
189292002-05-25 Akim Demaille <akim@epita.fr>
18930
18931 * doc/bison.texinfo (Debugging): Split into...
18932 (Tracing): this new section, its former contents, and...
18933 (Understanding): this new section.
18934 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
18935 by...
18936 (report_flag): this.
18937 Adjust all dependencies.
18938 (report_args, report_types, report_argmatch): New.
18939 (usage, getargs): Report/support -r, --report.
18940 * src/options.h
18941 (struct option_table_struct): Rename as..,
18942 (struct option_table_s): this.
18943 Rename the `set_flag' member to `flag' to match with getopt_long's
18944 struct.
18945 * src/options.c (option_table): Split verbose into an entry for
18946 %verbose, and another for --verbose.
18947 Support --report/-r, so remove -r from the obsolete --raw.
18948 * src/print.c: Attach full item sets and lookaheads reports to
18949 report_flag instead of trace_flag.
18950 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
18951
189522002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18953 and Paul Eggert <eggert@twinsun.com>
18954
18955 * data/bison.simple (yyparse): Correct error handling to conform to
18956 POSIX and yacc. Specifically, after syntax error is discovered,
18957 do not reduce further before shifting the error token.
18958 Clean up the code a bit by removing the labels yyerrdefault,
18959 yyerrhandle, yyerrpop.
18960 * NEWS: Document the above.
18961
189622002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18963
18964 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
18965 type; it isn't always big enough, since it doesn't necessarily
18966 include non-terminals.
18967 (yytranslate): Expand definition of yy_token_number_type, so that
18968 the latter can be removed.
18969 (yy_token_number_type): Remove, only one use.
18970 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
18971 don't use TokenNumberType as element type.
18972
18973 * tests/regression.at: Modify expected output to agree with change
18974 to yyr1 and yytranslate.
18975
189762002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
18977
18978 * src/reader.c (parse_action): Use copy_character instead of
18979 obstack_1grow.
18980
189812002-05-13 Akim Demaille <akim@epita.fr>
18982
18983 * tests/regression.at (Token definitions): Prototype yylex and
18984 yyerror.
18985
189862002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18987
18988 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
18989 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
18990 32-bit arithmetic.
18991 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
18992
189932002-05-07 Akim Demaille <akim@epita.fr>
18994
18995 * tests/synclines.at: Be sure to prototype yylex and yyerror to
18996 avoid GCC warnings.
18997
189982002-05-07 Akim Demaille <akim@epita.fr>
18999
19000 Kill GCC warnings.
19001
19002 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
19003 over the RHS of each rule.
19004 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
19005 * src/state.h (state_t): Member `nitems' is unsigned short.
19006 * src/LR0.c (get_state): Adjust.
19007 * src/reader.c (packgram): Likewise.
19008 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
19009 `Type'.
19010 (muscle_insert_int_table): Remove, unused.
19011 (prepare_rules): Remove `max'.
19012
190132002-05-06 Akim Demaille <akim@epita.fr>
19014
19015 * src/closure.c (print_firsts): Display of the symbol tags.
19016 (bitmatrix_print): Move to...
19017 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
19018 here.
19019 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
19020
190212002-05-06 Akim Demaille <akim@epita.fr>
19022
19023 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
19024 hash_do_for_each.
19025
190262002-05-06 Akim Demaille <akim@epita.fr>
19027
19028 * src/LR0.c (new_state, get_state): Instead of using the global
19029 `kernel_size' and `kernel_base', have two new arguments:
19030 `core_size' and `core'.
19031 Adjust callers.
19032
190332002-05-06 Akim Demaille <akim@epita.fr>
19034
19035 * src/reader.c (packgram): No longer end `ritem' with a 0
19036 sentinel: it is not used.
19037
190382002-05-05 Akim Demaille <akim@epita.fr>
19039
19040 New experimental feature: display the lookaheads in the report and
19041 graph.
19042
19043 * src/print (print_core): When --trace-flag, display the rules
19044 lookaheads.
19045 * src/print_graph.c (print_core): Likewise.
19046 Swap the arguments.
19047 Adjust caller.
19048
190492002-05-05 Akim Demaille <akim@epita.fr>
19050
19051 * tests/torture.at (Many lookaheads): New test.
19052
190532002-05-05 Akim Demaille <akim@epita.fr>
19054
19055 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
19056 (GENERATE_MUSCLE_INSERT_TABLE): this.
19057 (output_int_table, output_unsigned_int_table, output_short_table)
19058 (output_token_number_table, output_item_number_table): Replace with...
19059 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
19060 (muscle_insert_short_table, muscle_insert_token_number_table)
19061 (muscle_insert_item_number_table): these.
19062 Adjust all callers.
19063 (prepare_tokens): Don't free `translations', since...
19064 * src/reader.h, src/reader.c (grammar_free): do it.
19065 Move to...
19066 * src/gram.h, src/gram.c (grammar_free): here.
19067 * data/bison.simple, data/bison.c++: b4_token_number_max is now
19068 b4_translate_max.
19069
190702002-05-05 Akim Demaille <akim@epita.fr>
19071
19072 * src/output.c (output_unsigned_int_table): New.
19073 (prepare_rules): `i' is unsigned.
19074 `prhs', `rline', `r2' are unsigned int.
19075 Rename muscle `rhs_number_max' as `rhs_max'.
19076 Output muscles `prhs_max', `rline_max', and `r2_max'.
19077 Free rline and r1.
19078 * data/bison.simple, data/bison.c++: Adjust to use these muscles
19079 to compute types instead of constant types.
19080 * tests/regression.at (Web2c Actions): Adjust.
19081
190822002-05-04 Akim Demaille <akim@epita.fr>
19083
19084 * src/symtab.h (SALIAS, SUNDEF): Rename as...
19085 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
19086 Adjust dependencies.
19087 * src/output.c (token_definitions_output): Be sure not to output a
19088 `#define 'a'' when fed with `%token 'a' "a"'.
19089 * tests/regression.at (Token definitions): New.
19090
190912002-05-03 Paul Eggert <eggert@twinsun.com>
19092
19093 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
19094 for K&R C.
19095
190962002-05-03 gettextize <bug-gnu-gettext@gnu.org>
19097
19098 * Makefile.am (SUBDIRS): Remove intl.
19099 (EXTRA_DIST): Add config/config.rpath.
19100
191012002-05-03 Akim Demaille <akim@epita.fr>
19102
19103 * data/bison.simple (m4_if): Don't output empty enums.
19104 And actually, output valid enum definitions :(.
19105
191062002-05-03 Akim Demaille <akim@epita.fr>
19107
19108 * configure.bat: Remove, completely obsolete.
19109 * Makefile.am (EXTRA_DIST): Adjust.
19110 Don't distribute config.rpath...
19111 * config/Makefile.am (EXTRA_DIST): Do it.
19112
191132002-05-03 Akim Demaille <akim@epita.fr>
19114
19115 * configure.in (GETTEXT_VERSION): New.
19116 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
19117
191182002-05-03 Akim Demaille <akim@epita.fr>
19119
19120 * data/bison.simple (b4_token_enum): New.
19121 (b4_token_defines): Use it to output tokens both as #define and
19122 enums.
19123 Suggested by Paul Eggert.
19124 * src/output.c (token_definitions_output): Don't output spurious
19125 white spaces.
19126
191272002-05-03 Akim Demaille <akim@epita.fr>
19128
19129 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19130
191312002-05-02 Robert Anisko <robert@lrde.epita.fr>
19132
19133 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
19134 Update the stack class, give a try to deque as the default container.
19135
191362002-05-02 Akim Demaille <akim@epita.fr>
19137
19138 * data/bison.simple (yyparse): Do not implement @$ = @1.
19139 (YYLLOC_DEFAULT): Adjust to do it.
19140 * doc/bison.texinfo (Location Default Action): Fix.
19141
191422002-05-02 Akim Demaille <akim@epita.fr>
19143
19144 * src/reader.c (parse_braces): Merge into...
19145 (parse_action): this.
19146
191472002-05-02 Akim Demaille <akim@epita.fr>
19148
19149 * configure.in (ALL_LINGUAS): Remove.
19150 * po/LINGUAS, hr.po: New.
19151
191522002-05-02 Akim Demaille <akim@epita.fr>
19153
19154 Remove the so called hairy (semantic) parsers.
19155
19156 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
19157 * src/gram.h, src/gram.c (semantic_parser): Remove.
19158 (rule_t): Remove the guard and guard_line members.
19159 * src/lex.h (token_t): remove tok_guard.
19160 * src/options.c (option_table): Remove %guard and %semantic_parser
19161 support.
19162 * src/output.c, src/output.h (guards_output): Remove.
19163 (prepare): Adjust.
19164 (token_definitions_output): Don't output the `T'
19165 tokens (???).
19166 (output_skeleton): Don't output the guards.
19167 * src/files.c, src/files.c (attrsfile): Remove.
19168 * src/reader.c (symbol_list): Remove the guard and guard_line
19169 members.
19170 Adjust dependencies.
19171 (parse_guard): Remove.
19172 * data/bison.hairy: Remove.
19173 * doc/bison.texinfo (Environment Variables): Remove occurrences of
19174 BISON_HAIRY.
19175
191762002-05-02 Akim Demaille <akim@epita.fr>
19177
19178 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
19179 (parse_guard): Rename the formal argument `stack_offset' as
19180 `rule_length', which is more readable.
19181 Adjust callers.
19182 (copy_at, copy_dollar): Instead of outputting the hard coded
19183 values of $$, $n and so forth, output invocation to b4_lhs_value,
19184 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
19185 Note: this patch partially drops `semantic-parser' support: it
19186 always does `rule_length - n', where semantic parsers ought to
19187 always use `-n'.
19188 * data/bison.simple, data/bison.c++ (b4_lhs_value)
19189 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
19190
191912002-05-02 Akim Demaille <akim@epita.fr>
19192
19193 * configure.in (AC_INIT): Bump to 1.49b.
19194 (AM_INIT_AUTOMAKE): Short invocation.
19195
191962002-05-02 Akim Demaille <akim@epita.fr>
19197
19198 Version 1.49a.
19199
192002002-05-01 Akim Demaille <akim@epita.fr>
19201
19202 * src/skeleton.h: Remove.
19203
192042002-05-01 Akim Demaille <akim@epita.fr>
19205
19206 * src/skeleton.h: Fix the #endif.
19207 Reported by Magnus Fromreide.
19208
192092002-04-26 Paul Eggert <eggert@twinsun.com>
19210
19211 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
19212 Define if we define YYSTYPE and YYLTYPE, respectively.
19213 (YYCOPY): Fix [] quoting problem in the non-GCC case.
19214
192152002-04-25 Robert Anisko <robert@lrde.epita.fr>
19216
19217 * src/scan-skel.l: Postprocess quadrigraphs.
19218
19219 * src/reader.c (copy_character): New function, used to output
19220 single characters while replacing `[' and `]' with quadrigraphs, to
19221 avoid troubles with M4 quotes.
19222 (copy_comment): Output characters with copy_character.
19223 (read_additionnal_code): Likewise.
19224 (copy_string2): Likewise.
19225 (copy_definition): Likewise.
19226
19227 * tests/calc.at: Exercise M4 quoting.
19228
192292002-04-25 Akim Demaille <akim@epita.fr>
19230
19231 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
19232 between `!' and the command.
19233 Reported by Paul Eggert.
19234
192352002-04-24 Robert Anisko <robert@lrde.epita.fr>
19236
19237 * tests/calc.at: Exercise prologue splitting.
19238
19239 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
19240 `b4_post_prologue' instead of `b4_prologue'.
19241
19242 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
19243 muscles.
19244 (output): Free pre_prologue_obstack and post_prologue_obstack.
19245 * src/files.h, src/files.c (attrs_obstack): Remove.
19246 (pre_prologue_obstack, post_prologue_obstack): New.
19247 * src/reader.c (copy_definition): Add a parameter to specify the
19248 obstack to fill, instead of using attrs_obstack unconditionally.
19249 (read_declarations): Pass pre_prologue_obstack to copy_definition if
19250 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
19251
192522002-04-23 Paul Eggert <eggert@twinsun.com>
19253
19254 * data/bison.simple: Remove unnecessary commentary and white
19255 space differences from 1_29-branch.
19256 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
19257
19258 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
19259 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
19260 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
19261 constructors or destructors.
19262
19263 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
19264
192652002-04-23 Akim Demaille <akim@epita.fr>
19266
19267 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
19268 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
19269 location with columns.
19270 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
19271 All reported by Paul Eggert.
19272
192732002-04-22 Akim Demaille <akim@epita.fr>
19274
19275 * src/reduce.c (dump_grammar): Move to...
19276 * src/gram.h, src/gram.c (grammar_dump): here.
19277 Be sure to separate long item numbers.
19278 Don't read the members of a rule's prec if its nil.
19279
192802002-04-22 Akim Demaille <akim@epita.fr>
19281
19282 * src/output.c (table_size, table_grow): New.
19283 (MAXTABLE): Remove, replace uses with table_size.
19284 (pack_vector): Instead of dying when the table is too big, grow it.
19285
192862002-04-22 Akim Demaille <akim@epita.fr>
19287
19288 * data/bison.simple (yyr1): Its type is that of a token number.
19289 * data/bison.c++ (r1_): Likewise.
19290 * tests/regression.at (Web2c Actions): Adjust.
19291
192922002-04-22 Akim Demaille <akim@epita.fr>
19293
19294 * src/reader.c (token_translations_init): 256 is now the default
19295 value for the error token, i.e., it will be assigned another
19296 number if the user assigned 256 to one of her tokens.
19297 (reader): Don't force 256 to error.
19298 * doc/bison.texinfo (Symbols): Adjust.
19299 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
19300 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
19301 etc. instead of 10, 20, 30 (which was used to `jump' over error
19302 (256) and undefined (2)).
19303
193042002-04-22 Akim Demaille <akim@epita.fr>
19305
19306 Propagate more token_number_t.
19307
19308 * src/gram.h (token_number_as_item_number)
19309 (item_number_as_token_number): New.
19310 * src/output.c (GENERATE_OUTPUT_TABLE): New.
19311 Use it to create output_item_number_table and
19312 output_token_number_table.
19313 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19314 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
19315 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
19316 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
19317
193182002-04-22 Akim Demaille <akim@epita.fr>
19319
19320 * src/output.h, src/output.c (get_lines_number): Remove.
19321
193222002-04-19 Akim Demaille <akim@epita.fr>
19323
19324 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
19325 as Lex/Flex'.
19326 (Debugging): More details about enabling the debugging features.
19327 (Table of Symbols): Describe $$, $n, @$, and @n.
19328 Suggested by Tim Josling.
19329
193302002-04-19 Akim Demaille <akim@epita.fr>
19331
19332 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
19333
193342002-04-10 Akim Demaille <akim@epita.fr>
19335
19336 * src/system.h: Rely on HAVE_LIMITS_H.
19337 Suggested by Paul Eggert.
19338
193392002-04-09 Akim Demaille <akim@epita.fr>
19340
19341 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
19342 full stderr, and strip it according to the bison options, instead
19343 of composing the error message from different bits.
19344 This makes it easier to check for several error messages.
19345 Adjust all the invocations.
19346 Add an invocation exercising the error token.
19347 Add an invocation demonstrating a stupid error message.
19348 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
19349 Adjust the tests.
19350 Error message are for stderr, not stdout.
19351
193522002-04-09 Akim Demaille <akim@epita.fr>
19353
19354 * src/gram.h, src/gram.c (error_token_number): Remove, use
19355 errtoken->number.
19356 * src/reader.c (reader): Don't specify the user token number (2)
19357 for $undefined, as it uselessly prevents using it.
19358 * src/gram.h (token_number_t): Move to...
19359 * src/symtab.h: here.
19360 (state_t.number): Is a token_number_t.
19361 * src/print.c, src/reader.c: Use undeftoken->number instead of
19362 hard coded 2.
19363 (Even though this 2 is not the same as above: the number of the
19364 undeftoken remains being 2, it is its user token number which
19365 might not be 2).
19366 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
19367 `user_token_number_max'.
19368 Output `undef_token_number'.
19369 * data/bison.simple, data/bison.c++: Use them.
19370 Be sure to map invalid yylex return values to
19371 `undef_token_number'. This saves us from gratuitous SEGV.
19372
19373 * tests/conflicts.at (Solved SR Conflicts)
19374 (Unresolved SR Conflicts): Adjust.
19375 * tests/regression.at (Web2c Actions): Adjust.
19376
193772002-04-08 Akim Demaille <akim@epita.fr>
19378
19379 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
19380 Adding #line.
19381 Remove the duplicate `typedefs'.
19382 (RhsNumberType): Fix the declaration and various other typos.
19383 Use __ofile__.
19384 * data/bison.simple: Use __ofile__.
19385 * src/scan-skel.l: Handle __ofile__.
19386
193872002-04-08 Akim Demaille <akim@epita.fr>
19388
19389 * src/gram.h (item_number_t): New, the type of item numbers in
19390 RITEM. Note that it must be able to code symbol numbers as
19391 positive number, and the negation of rule numbers as negative
19392 numbers.
19393 Adjust all dependencies (pretty many).
19394 * src/reduce.c (rule): Remove this `short *' pointer: use
19395 item_number_t.
19396 * src/system.h (MINSHORT, MAXSHORT): Remove.
19397 Include `limits.h'.
19398 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
19399 (shortcpy): Remove.
19400 (MAXTABLE): Move to...
19401 * src/output.c (MAXTABLE): here.
19402 (prepare_rules): Use output_int_table to output rhs.
19403 * data/bison.simple, data/bison.c++: Adjust.
19404 * tests/torture.at (Big triangle): Move the limit from 254 to
19405 500.
19406 * tests/regression.at (Web2c Actions): Ajust.
19407
19408 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
19409 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
19410 passes, but produces negative #line number, once fixed, GCC is
19411 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
19412 C), it passes.
19413 * src/state.h (state_h): Code input lines on ints, not shorts.
19414
194152002-04-08 Akim Demaille <akim@epita.fr>
19416
19417 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
19418 and then the grammar.
19419
194202002-04-08 Akim Demaille <akim@epita.fr>
19421
19422 * src/system.h: No longer using strndup.
19423
194242002-04-07 Akim Demaille <akim@epita.fr>
19425
19426 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
19427 * src/output.c (output_table_data): Return the longest number.
19428 (prepare_tokens): Output `token_number_max').
19429 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
19430 New.
19431 Use them to define yy_token_number_type/TokenNumberType.
19432 Use this type for yytranslate.
19433 * tests/torture.at (Big triangle): Push the limit from 124 to
19434 253.
19435 * tests/regression.at (Web2c Actions): Adjust.
19436
194372002-04-07 Akim Demaille <akim@epita.fr>
19438
19439 * tests/torture.at (Big triangle): New.
19440 (GNU AWK Grammar, GNU Cim Grammar): Move to...
19441 * tests/existing.at: here.
19442
194432002-04-07 Akim Demaille <akim@epita.fr>
19444
19445 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
19446 nritems.
19447 Adjust dependencies.
19448
194492002-04-07 Akim Demaille <akim@epita.fr>
19450
19451 * src/reader.c: Normalize increments to prefix form.
19452
194532002-04-07 Akim Demaille <akim@epita.fr>
19454
19455 * src/reader.c, symtab.c: Remove debugging code.
19456
194572002-04-07 Akim Demaille <akim@epita.fr>
19458
19459 Rename all the `bucket's as `symbol_t'.
19460
19461 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
19462 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
19463 * src/symtab.c, src/symtab.h (bucket): Rename as...
19464 (symbol_t): this.
19465 (symbol_list_new, bucket_check_defined, bucket_make_alias)
19466 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
19467 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19468 (buckets_new, buckets_free, buckets_do): Rename as...
19469 (symbol_list_new, symbol_check_defined, symbol_make_alias)
19470 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19471 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
19472 (symbols_new, symbols_free, symbols_do): these.
19473
194742002-04-07 Akim Demaille <akim@epita.fr>
19475
19476 Use lib/hash for the symbol table.
19477
19478 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
19479 EOF.
19480 * src/lex.c (lex): Set the `number' member of new terminals.
19481 * src/reader.c (bucket_check_defined, bucket_make_alias)
19482 (bucket_check_alias_consistence, bucket_translation): New.
19483 (reader, grammar_free, readgram, token_translations_init)
19484 (packsymbols): Adjust.
19485 (reader): Number the predefined tokens.
19486 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
19487 for predefined tokens.
19488 * src/symtab.h (bucket): Remove all the hash table related
19489 members.
19490 * src/symtab.c (symtab): Replace by...
19491 (bucket_table): this.
19492 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19493 (buckets_new, buckets_do): New.
19494
194952002-04-07 Akim Demaille <akim@epita.fr>
19496
19497 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
19498 (start_symbol, max_user_token_number, semantic_parser)
19499 (error_token_number): Initialize.
19500 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
19501 Initialize.
19502 (reader): Don't.
19503 (errtoken, eoftoken, undeftoken, axiom): Extern.
19504
195052002-04-07 Akim Demaille <akim@epita.fr>
19506
19507 * src/gram.h (rule_s): prec and precsym are now pointers
19508 to the bucket giving the priority/associativity.
19509 Member `associativity' removed: useless.
19510 * src/reduce.c, src/conflicts.c: Adjust.
19511
195122002-04-07 Akim Demaille <akim@epita.fr>
19513
19514 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
19515 Properly escape the symbols' TAG when outputting them.
19516
195172002-04-07 Akim Demaille <akim@epita.fr>
19518
19519 * src/lalr.h (LA): Is a bitsetv, not bitset*.
19520
195212002-04-07 Akim Demaille <akim@epita.fr>
19522
19523 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
19524 (LArule): this, which is an array to rule_t*.
19525 * src/print.c, src/conflicts.c: Adjust.
19526
195272002-04-07 Akim Demaille <akim@epita.fr>
19528
19529 * src/gram.h (rule_t): Rename `number' as `user_number'.
19530 `number' is a new member.
19531 Adjust dependencies.
19532 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
19533
195342002-04-07 Akim Demaille <akim@epita.fr>
19535
19536 As a result of the previous patch, it is no longer needed
19537 to reorder ritem itself.
19538
19539 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
19540
195412002-04-07 Akim Demaille <akim@epita.fr>
19542
19543 Be sure never to walk through RITEMS, but use only data related to
19544 the rules themselves. RITEMS should be banished.
19545
19546 * src/output.c (output_token_translations): Rename as...
19547 (prepare_tokens): this.
19548 In addition to `translate', prepare the muscles `tname' and
19549 `toknum', which were handled by...
19550 (output_rule_data): this.
19551 Remove, and move the remainder of its outputs into...
19552 (prepare_rules): this new routines, which also merges content from
19553 (output_gram): this.
19554 (prepare_rules): Be sure never to walk through RITEMS.
19555 (output_stos): Rename as...
19556 (prepare_stos): this.
19557 (output): Always invoke prepare_states, after all, just don't use it
19558 in the output if you don't need it.
19559
195602002-04-07 Akim Demaille <akim@epita.fr>
19561
19562 * src/LR0.c (new_state): Display `nstates' as the name of the
19563 newly created state.
19564 Adjust to initialize first_state and last_state if needed.
19565 Be sure to distinguish the initial from the final state.
19566 (new_states): Create the itemset of the initial state, and use
19567 new_state.
19568 * src/closure.c (closure): Now that the initial state has its
19569 items properly set, there is no need for a special case when
19570 creating `ruleset'.
19571
19572 As a result, now the rule 0, reducing to $axiom, is visible in the
19573 outputs. Adjust the test suite.
19574
19575 * tests/conflicts.at (Solved SR Conflicts)
19576 (Unresolved SR Conflicts): Adjust.
19577 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
19578 * tests/conflicts.at (S/R in initial): New.
19579
195802002-04-07 Akim Demaille <akim@epita.fr>
19581
19582 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
19583 the RHS of the rules.
19584 * src/output.c (output_gram): Likewise.
19585
195862002-04-07 Akim Demaille <akim@epita.fr>
19587
19588 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
19589 bucket.
19590 Adjust all dependencies.
19591 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
19592 `number' of the buckets too.
19593 * src/gram.h: Include `symtab.h'.
19594 (associativity): Move to...
19595 * src/symtab.h: here.
19596 No longer include `gram.h'.
19597
195982002-04-07 Akim Demaille <akim@epita.fr>
19599
19600 * src/gram.h, src/gram.c (rules_rhs_length): New.
19601 (ritem_longest_rhs): Use it.
19602 * src/gram.h (rule_t): `number' is a new member.
19603 * src/reader.c (packgram): Set it.
19604 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
19605 the end of `rules', and count them out of `nrules'.
19606 (reduce_output, dump_grammar): Adjust.
19607 * src/print.c (print_grammar): It is no longer needed to check for
19608 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
19609 * tests/reduce.at (Reduced Automaton): New test.
19610
196112002-04-07 Akim Demaille <akim@epita.fr>
19612
19613 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
19614 lacking `+ 1' to nrules, Bison reported as useless a token if it
19615 was used solely to set the precedence of the last rule...
19616
196172002-04-07 Akim Demaille <akim@epita.fr>
19618
19619 * data/bison.c++, data/bison.simple: Don't output the current file
19620 name in #line, to avoid useless diffs between two identical
19621 outputs under different names.
19622
196232002-04-07 Akim Demaille <akim@epita.fr>
19624
19625 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
19626 Normalize loops to using `< nrules + 1', not `<= nrules'.
19627
196282002-04-07 Akim Demaille <akim@epita.fr>
19629
19630 * TODO: Update.
19631
196322002-04-07 Akim Demaille <akim@epita.fr>
19633
19634 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
19635 bucket.value as bucket.number.
19636
196372002-04-07 Akim Demaille <akim@epita.fr>
19638
19639 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
19640 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19641 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
19642 RHS, instead of being an index in RITEMS.
19643
196442002-04-04 Paul Eggert <eggert@twinsun.com>
19645
19646 * doc/bison.texinfo: Update copyright date.
19647 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
19648 (Symbols): Warn about running Bison in one character set,
19649 but compiling and/or running in an incompatible one.
19650 Warn about character code 256, too.
19651
196522002-04-03 Paul Eggert <eggert@twinsun.com>
19653
19654 * src/bison.data (YYSTACK_ALLOC): Depend on whether
19655 YYERROR_VERBOSE is nonzero, not whether it is defined.
19656
19657 Merge changes from bison-1_29-branch.
19658
196592002-03-20 Paul Eggert <eggert@twinsun.com>
19660
19661 Merge fixes from Debian bison_1.34-1.diff.
19662
19663 * configure.in (AC_PREREQ): 2.53.
19664
196652002-03-20 Akim Demaille <akim@epita.fr>
19666
19667 * src/conflicts.c (log_resolution): Argument `resolution' is const.
19668
196692002-03-19 Paul Eggert <eggert@twinsun.com>
19670
19671 * src/bison.simple (YYCOPY): New macro.
19672 (YYSTACK_RELOCATE): Use it.
19673 Remove Type arg; no longer needed. All callers changed.
19674 (yymemcpy): Remove; no longer needed.
19675
19676 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
19677 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
19678
196792002-03-19 Akim Demaille <akim@epita.fr>
19680
19681 Test and fix the #line outputs.
19682
19683 * tests/atlocal.at (GCC): New.
19684 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
19685 (Prologue synch line, %union synch line, Postprologue synch line)
19686 (Action synch line, Epilogue synch line): New tests.
19687 * src/reader.c (parse_union_decl): Define the muscle stype_line.
19688 * data/bison.simple, data/bison.c++: Use it.
19689
196902002-03-19 Akim Demaille <akim@epita.fr>
19691
19692 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
19693 (Solved SR Conflicts, %expect not enough, %expect right)
19694 (%expect too much): Move to...
19695 * tests/conflicts.at: this new file.
19696
196972002-03-19 Akim Demaille <akim@epita.fr>
19698
19699 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19700 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
19701 that we can move to enums for instance.
19702 * src/output.c (token_definitions_output): Output a list of
19703 `token-name, token-number' instead of the #define.
19704 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
19705
197062002-03-14 Akim Demaille <akim@epita.fr>
19707
19708 Use Gettext 0.11.1.
19709
197102002-03-09 Robert Anisko <robert@lrde.epita.fr>
19711
19712 * data/bison.c++: Make the user able to add members to the generated
19713 parser by subclassing.
19714
197152002-03-05 Robert Anisko <robert@lrde.epita.fr>
19716
19717 * src/reader.c (read_additionnal_code): `c' should be an integer, not
19718 a character.
19719 Reported by Nicolas Tisserand and Nicolas Burrus.
19720
197212002-03-04 Robert Anisko <robert@lrde.epita.fr>
19722
19723 * src/reader.c: Warn about lacking semi-colons, do not complain.
19724
197252002-03-04 Robert Anisko <robert@lrde.epita.fr>
19726
19727 * data/bison.c++: Remove a debug line.
19728
197292002-03-04 Robert Anisko <robert@lrde.epita.fr>
19730
19731 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
19732 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
19733 provide a default implementation.
19734
197352002-03-04 Akim Demaille <akim@epita.fr>
19736
19737 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
19738 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
19739 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
19740 * tests/semantic.at (Parsing Guards): Similarly.
19741 * src/reader.at (readgram): Complain if the last rule is not ended
19742 with a semi-colon.
19743
197442002-03-04 Akim Demaille <akim@epita.fr>
19745
19746 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
19747 * src/closure.c: here.
19748 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
19749 RTC.
19750 * src/warshall.h, src/warshall.c: Remove.
19751 * tests/sets.at (Broken Closure): Adjust.
19752
197532002-03-04 Akim Demaille <akim@epita.fr>
19754
19755 * src/output.c (output_skeleton): tempdir is const.
19756 bytes_read is unused.
19757
197582002-03-04 Akim Demaille <akim@epita.fr>
19759
19760 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19761 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
19762 Update.
19763 From Michael Hayes.
19764
197652002-03-04 Akim Demaille <akim@epita.fr>
19766
19767 * src/closure.c (closure): `r' is unused.
19768
197692002-03-04 Akim Demaille <akim@epita.fr>
19770
19771 * tests/sets.at (Broken Closure): Add the ending `;'.
19772 * src/reader.at (readgram): Complain if a rule is not ended with a
19773 semi-colon.
19774
197752002-03-04 Akim Demaille <akim@epita.fr>
19776
19777 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
19778 (count_sr_conflicts): Use bitset_count.
19779 * src/reduce.c (inaccessable_symbols): Ditto.
19780 (bits_size): Remove.
19781 * src/warshall.h, src/warshall.c: Convert to bitsetv.
19782
197832002-03-04 Akim Demaille <akim@epita.fr>
19784
19785 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
19786 * src/reduce.c: Remove the `bitset_zero's following the
19787 `bitset_create's, as now it is performed by the latter.
19788
197892002-03-04 Akim Demaille <akim@epita.fr>
19790
19791 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
19792 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
19793 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
19794 latest sources from Michael.
19795
197962002-03-04 Akim Demaille <akim@epita.fr>
19797
19798 * src/output.c (output): Don't free the grammar.
19799 * src/reader.c (grammar_free): New.
19800 * src/main.c (main): Call it and don't free symtab here.
19801
198022002-03-04 Akim Demaille <akim@epita.fr>
19803
19804 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
19805 before returning.
19806 Reported by Benoit Perrot.
19807
198082002-03-04 Akim Demaille <akim@epita.fr>
19809
19810 Use bitset operations when possible, not loops over bits.
19811
19812 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
19813 bitset_or.
19814 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
19815 * src/reduce.c (useless_nonterminals): Formatting changes.
19816 * src/warshall.c (TC): Use bitset_or.
19817
198182002-03-04 Akim Demaille <akim@epita.fr>
19819
19820 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
19821 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
19822 Ditto.
19823
198242002-03-04 Akim Demaille <akim@epita.fr>
19825
19826 * src/lalr.c (F): Now a bitset*.
19827 Adjust all dependencies.
19828
198292002-03-04 Akim Demaille <akim@epita.fr>
19830
19831 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
19832 Adjust all dependencies.
19833
198342002-03-04 Akim Demaille <akim@epita.fr>
19835
19836 * src/L0.c, src/LR0.h (nstates): Be size_t.
19837 Adjust comparisons (signed vs unsigned).
19838 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
19839 bitset*.
19840 Adjust all dependencies.
19841
198422002-03-04 Akim Demaille <akim@epita.fr>
19843
19844 * src/closure.c (firsts): Now, also a bitset.
19845 Adjust all dependencies.
19846 (varsetsize): Remove, now unused.
19847 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
19848
198492002-03-04 Akim Demaille <akim@epita.fr>
19850
19851 * src/print.c: Convert to use bitset.h, not hand coded iterations
19852 over ints.
19853
198542002-03-04 Akim Demaille <akim@epita.fr>
19855
19856 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
19857
198582002-03-04 Akim Demaille <akim@epita.fr>
19859
19860 * src/closure.c (ruleset): Be a bitset.
19861 (rulesetsize): Remove.
19862
198632002-03-04 Akim Demaille <akim@epita.fr>
19864
19865 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19866 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
19867 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
19868 * src/closure.c (fderives): Be an array of bitsets.
19869
198702002-02-28 Robert Anisko <robert@lrde.epita.fr>
19871
19872 * data/bison.c++: Merge the two generated headers. Insert a copyright
19873 notice in each output file.
19874
198752002-02-28 Akim Demaille <akim@epita.fr>
19876
19877 * data/bison.c++: Copy the prologue of bison.simple to fetch
19878 useful M4 definitions, such as b4_header_guard.
19879
198802002-02-25 Akim Demaille <akim@epita.fr>
19881
19882 * src/getargs.c (version): Give the name of the authors, and use a
19883 translator friendly scheme for the bgr
19884 copyright notice.
19885
198862002-02-25 Akim Demaille <akim@epita.fr>
19887
19888 * src/output.c (header_output): Remove, now handled completely via
19889 M4.
19890
198912002-02-25 Akim Demaille <akim@epita.fr>
19892
19893 * m4/m4.m4: New, from CVS Autoconf.
19894 * configure.in: Invoke it.
19895 * src/output.c (output_skeleton): Use its result instead of the
19896 hard coded name.
19897
198982002-02-25 Akim Demaille <akim@epita.fr>
19899
19900 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
19901 Fileutils 4.1.5.
19902 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
19903 * src/output.c (output_skeleton): Use mkstemp to create a real
19904 temporary file.
19905 Move the filling of `skeleton' and its muscle to...
19906 (prepare): here.
19907 (output): Move the definition of the prologue muscle to...
19908 (prepare): here.
19909 * src/system.h (DEFAULT_TMPDIR): New.
19910
199112002-02-14 Paul Eggert <eggert@twinsun.com>
19912
19913 Remove the support for C++ namespace cleanliness; it was
19914 causing more problems than it was curing, since it didn't work
19915 properly on some nonstandard C++ compilers. This can wait
19916 for a proper C++ parser.
19917
19918 * NEWS: Document this.
19919 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
19920 of C++, as it's treated like C now.
19921 * src/bison.simple (YYSTD): Remove.
19922 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
19923 Treat C++ just like Standard C instead of trying to support
19924 namespace cleanliness.
19925
199262002-02-14 Akim Demaille <akim@epita.fr>
19927
19928 * tests/regression.at (else): Adjust to Andreas' change.
19929
199302002-02-14 Akim Demaille <akim@epita.fr>
19931
19932 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
19933
199342002-02-13 Andreas Schwab <schwab@suse.de>
19935
19936 * src/output.c (output_rule_data): Don't output NULL, it might
19937 not be defined yet.
19938
199392002-02-11 Robert Anisko <robert@lrde.epita.fr>
19940
19941 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
19942 (Copyright notice): Update.
19943
199442002-02-11 Akim Demaille <akim@epita.fr>
19945
19946 * tests/regression.at (%nonassoc and eof): Don't include
19947 nonportable headers.
19948
199492002-02-08 Robert Anisko <robert@lrde.epita.fr>
19950
19951 * data/bison.c++: Correct error recovery. Make the user able to
19952 initialize the starting location.
19953
199542002-02-07 Akim Demaille <akim@epita.fr>
19955
19956 * tests/input.at: New.
19957
199582002-02-07 Robert Anisko <robert@lrde.epita.fr>
19959
19960 * data/bison.c++: Replace some direct m4 expansions by constants. Be
19961 more consistent when naming methods and variables. Put preprocessor
19962 directives around tables only needed for debugging.
19963
199642002-02-07 Robert Anisko <robert@lrde.epita.fr>
19965
19966 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
19967 C++ parsers.
19968 (yy::b4_name::parse): Use print_.
19969
199702002-02-07 Robert Anisko <robert@lrde.epita.fr>
19971
19972 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
19973
199742002-02-07 Robert Anisko <robert@lrde.epita.fr>
19975
19976 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
19977 C++ parsers.
19978 (yy::b4_name::parse): Build verbose error messages, and use error_.
19979
199802002-02-06 Robert Anisko <robert@lrde.epita.fr>
19981
19982 * data/bison.c++: Fix m4 quoting in comments.
19983
199842002-02-06 Robert Anisko <robert@lrde.epita.fr>
19985
19986 * data/bison.c++: Adjust the parser code. Fix some muscles that were
19987 not expanded by m4.
19988
199892002-02-05 Akim Demaille <akim@epita.fr>
19990
19991 * data/bison.c++: Adjust to the M4 back end.
19992 More is certainly needed.
19993
199942002-02-05 Akim Demaille <akim@epita.fr>
19995
19996 Give a try to M4 as a back end.
19997
19998 * lib/readpipe.c: New, from wdiff.
19999 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
20000 BISON_HAIRY.
20001 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
20002 specific values. Now it is m4 that performs the lookup.
20003 * src/parse-skel.y: Remove.
20004 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
20005 * src/output.c (actions_output, guards_output)
20006 (token_definitions_output): No longer keeps track of the output
20007 line number, hence remove the second argument.
20008 (guards_output): Check against the guard member of a rule, not the
20009 action member.
20010 Adjust callers.
20011 (output_skeleton): Don't look for the skeleton location, let m4 do
20012 that.
20013 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
20014 file will be used.
20015 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
20016 (prepare): Given that for the time being changesyntax is not
20017 usable in M4, rename the muscles using `-' to `_'.
20018 Define `defines_flag', `output_parser_name' and `output_header_name'.
20019 * src/output.h (actions_output, guards_output)
20020 (token_definitions_output): Adjust prototypes.
20021 * src/scan-skel.l: Instead of scanning the skeletons, it now
20022 processes the output of m4: `__oline__' and `#output'.
20023 * data/bison.simple: Adjust to be used by M4(sugar).
20024 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
20025 to date.
20026 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
20027 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
20028 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
20029 shamelessly stolen from CVS Autoconf.
20030
200312002-02-05 Akim Demaille <akim@epita.fr>
20032
20033 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
20034 * configure.in: Check for the declarations of free and malloc.
20035 * src/muscle_tab.c: Adjust.
20036
200372002-02-05 Akim Demaille <akim@epita.fr>
20038
20039 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
20040 which have no values.
20041
200422002-02-05 Akim Demaille <akim@epita.fr>
20043
20044 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
20045 * data/: here.
20046
200472002-01-29 Paul Eggert <eggert@twinsun.com>
20048
20049 * src/bison.simple (YYSIZE_T): Do not define merely because
20050 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
20051 On some platforms, <alloca.h> does not declare YYSTD (size_t).
20052
200532002-01-27 Akim Demaille <akim@epita.fr>
20054
20055 Fix `%nonassoc and eof'.
20056
20057 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
20058 which were not properly copied! Replace
20059 memcpy (res->errs, src->errs, src->nerrs);
20060 with
20061 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
20062 !!!
20063 * tests/regression.at (%nonassoc and eof): Adjust to newest
20064 Autotest: `.' is not in the PATH.
20065
200662002-01-27 Akim Demaille <akim@epita.fr>
20067
20068 * tests/sets.at (AT_EXTRACT_SETS): New.
20069 (Nullable): Use it.
20070 (Firsts): New.
20071
200722002-01-26 Akim Demaille <akim@epita.fr>
20073
20074 * tests/actions.at, tests/calc.at, tests/headers.at,
20075 * tests/torture.at: Adjust to the newest Autotest which no longer
20076 forces `.' in the PATH.
20077
200782002-01-25 Akim Demaille <akim@epita.fr>
20079
20080 * tests/regression.at (%nonassoc and eof): New.
20081 Suggested by Robert Anisko.
20082
200832002-01-24 Akim Demaille <akim@epita.fr>
20084
20085 Bison dumps core when trying to complain about broken input files.
20086 Reported by Cris van Pelt.
20087
20088 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
20089 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
20090 into...
20091 (Invalid inputs): Strengthen: exercise parse_percent_token.
20092
200932002-01-24 Robert Anisko <robert.anisko@epita.fr>
20094
20095 * src/Makefile.am: Add bison.c++.
20096 * src/bison.c++: New skeleton.
20097
200982002-01-21 Paolo Bonzini <bonzini@gnu.org>
20099
20100 * po/it.po: New.
20101
201022002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
20103
20104 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
20105
201062002-01-20 Marc Autret <marc@gnu.org>
20107
20108 * src/files.c (compute_output_file_names): Fix
20109
201102002-01-20 Marc Autret <marc@gnu.org>
20111
20112 * tests/output.at: New test.
20113 * src/files.c (compute_base_names): Don't map extensions when
20114 the YACC flag is set, use defaults.
20115 Reported by Evgeny Stambulchik.
20116
201172002-01-20 Marc Autret <marc@gnu.org>
20118
20119 * src/system.h: Need to define __attribute__ away for non-GCC
20120 compilers as well (i.e., the vendor C compiler).
20121 Suggested by Albert Chin-A-Young.
20122
201232002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
20124
20125 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
20126 canonical definition.
20127 * src/system.h: Use the canonical definition for PARAMS (avoids
20128 a conflict with the macro from lib/hash.h).
20129
201302002-01-11 Akim Demaille <akim@epita.fr>
20131
20132 * configure.in: Use AC_FUNC_STRNLEN.
20133 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
20134
201352002-01-09 Akim Demaille <akim@epita.fr>
20136
20137 * src/files.c, src/files.h (output_infix): New.
20138 (tab_extension): Remove.
20139 (compute_base_names): Compute the former, drop the latter.
20140 * src/output.c (prepare): Insert the muscles `output-infix', and
20141 `output-suffix'.
20142 * src/parse-skel.y (string, string.1): New.
20143 (section.header): Use it.
20144 (section.yacc): Remove.
20145 (prefix): Remove too.
20146 * src/scan-skel.l: Adjust.
20147 * src/bison.simple, src/bison.hairy: Adjust.
20148
201492002-01-09 Akim Demaille <akim@epita.fr>
20150
20151 * configure.in (WERROR_CFLAGS): Compute it.
20152 * src/Makefile.am (CFLAGS): Pass it.
20153 * tests/atlocal.in (CFLAGS): Idem.
20154 * src/files.c: Fix a few warnings.
20155 (get_extension_index): Remove, unused.
20156
201572002-01-08 Akim Demaille <akim@epita.fr>
20158
20159 * src/getargs.c (AS_FILE_NAME): New.
20160 (getargs): Use it to convert DOSish file names.
20161 * src/files.c (base_name): Rename as full_base_name to avoid
20162 clashes with `base_name ()'.
20163 (filename_split): New.
20164 (compute_base_names): N-th rewrite, using filename_split.
20165
201662002-01-08 Akim Demaille <akim@epita.fr>
20167
20168 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
20169 New, stolen from the Fileutils 4.1.
20170 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20171 * configure.in: Check for the presence of memrchr, and of its
20172 prototype.
20173
201742002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
20175
20176 * lib/hash.h (__P): Added definition for this macro.
20177 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
20178 BUILT_SOURCES, to ensure they are generated first.
20179 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
20180 %error-verbose to allow bootstrapping with bison 1.30x.
20181
201822002-01-06 Akim Demaille <akim@epita.fr>
20183
20184 * src/reader.c (parse_braces): Don't fetch the next char, the
20185 convention is to fetch on entry.
20186 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
20187 'switch' without a following semicolon.
20188 * tests/regression.at (braces parsing): New.
20189
201902002-01-06 Akim Demaille <akim@epita.fr>
20191
20192 Bison is dead wrong in its RR conflict reports.
20193
20194 * tests/torture.at (GNU Cim Grammar): New.
20195 * src/conflicts.c (count_rr_conflicts): Fix.
20196
201972002-01-06 Akim Demaille <akim@epita.fr>
20198
20199 Creating package.m4 from configure.ac causes too many problems.
20200
20201 * tests/Makefile.am (package.m4): Create it by hand,
20202 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
20203
202042002-01-06 Akim Demaille <akim@epita.fr>
20205
20206 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
20207 skeleton.h.
20208
202092002-01-04 Paul Eggert <eggert@twinsun.com>
20210
20211 * doc/bison.texinfo (Debugging):
20212 Remove YYSTDERR; it's no longer defined or used.
20213 Also, s/cstdio.h/cstdio/.
20214
202152002-01-03 Akim Demaille <akim@epita.fr>
20216
20217 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
20218
202192002-01-03 Akim Demaille <akim@epita.fr>
20220
20221 * src/parse-skel.y (process_skeleton): Don't bind the parser's
20222 tracing code to --trace, wait for a better --trace option, with
20223 args.
20224
202252002-01-03 Akim Demaille <akim@epita.fr>
20226
20227 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
20228 The ISO C++ standard is extremely clear about it: stderr is
20229 considered a macro, not a regular symbol (see table 94 `Header
20230 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
20231 Therefore std:: does not apply to it. It still does with fprintf.
20232 Also, s/cstdio.h/cstdio/.
20233
202342002-01-03 Akim Demaille <akim@epita.fr>
20235
20236 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
20237 for non system headers.
20238
202392002-01-02 Akim Demaille <akim@epita.fr>
20240
20241 Equip the skeleton chain with location tracking, runtime trace,
20242 pure parser and scanner.
20243
20244 * src/parse-skel.y: Request a pure parser, locations, and prefix
20245 renaming.
20246 (%union): Having several members with the same type does not help
20247 type mismatches, simplify.
20248 (YYPRINT, yyprint): New.
20249 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
20250 (skel_error): this.
20251 Handle locations.
20252 * src/scan-skel.l: Adjust to these changes.
20253 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
20254 (LOCATION_PRINT, skel_control_t): New.
20255
202562001-12-30 Akim Demaille <akim@epita.fr>
20257
20258 * src/parse-skel.y: Get rid of the shift/reduce conflict:
20259 replace `gb' with BLANKS.
20260 * src/scan-skel.l: Adjust.
20261
202622001-12-30 Akim Demaille <akim@epita.fr>
20263
20264 * src/system.h: We don't need nor want bcopy.
20265 Throw away MS-DOS crap: we don't need getpid.
20266 * configure.in: We don't need strndup. It was even causing
20267 problems: because Flex includes the headers *before* us,
20268 _GNU_SOURCE is not defined by config.h, and therefore strndup was
20269 not visible.
20270 * lib/xstrndup.c: New.
20271 * src/scan-skel.l: Use it.
20272 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
20273 * src/parse-skel.y: Use %directives instead of #defines.
20274
202752001-12-30 Akim Demaille <akim@epita.fr>
20276
20277 * src/skeleton.h: New.
20278 * src/output.c (output_parser, output_master_parser): Remove, dead
20279 code.
20280 * src/output.h (get_lines_number, actions_output, guards_output)
20281 (token_definitions_output): Prototype them.
20282 * src/parse-skel.y: Add the license notice.
20283 Include output.h and skeleton.h.
20284 (process_skeleton): Returns void, and takes a single parameter.
20285 * src/scan-skel.l: Add the license notice.
20286 Include skeleton.h.
20287 Don't use %option yylineno: it seems that then Flex imagines
20288 REJECT has been used, and therefore it won't reallocate its
20289 buffers (which makes no other sense to me than a bug). It results
20290 in warnings for `unused: yy_flex_realloc'.
20291
202922001-12-30 Robert Anisko <robert.anisko@epita.fr>
20293
20294 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20295 (MUSCLE_INSERT_PREFIX): ...to there.
20296 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20297 (MUSCLE_INSERT_PREFIX): Move from here...
20298
20299 * src/bison.hairy: Add a section directive. Put braces around muscle
20300 names. This parser skeleton is still broken, but Bison should not
20301 choke on a bad muscle 'syntax'.
20302 * src/bison.simple: Add a section directive. Put braces around muscle
20303 names.
20304
20305 * src/files.h (strsuffix, stringappend): Add declarations.
20306 (tab_extension): Add declaration.
20307 (short_base_name): Add declaration.
20308
20309 * src/files.c (strsuffix, stringappend): No longer static. These
20310 functions are used in the skeleton parser.
20311 (tab_extension): New.
20312 (compute_base_names): Use the computations done in this function
20313 to guess if the generated parsers should have '.tab' in their
20314 names.
20315 (short_base_name): No longer static.
20316
20317 * src/output.c (output_skeleton): New.
20318 (output): Disable call to output_master_parser, and give a try to
20319 a new skeleton handling system.
20320 (guards_output, actions_output): No longer static.
20321 (token_definitions_output, get_lines_number): No longer static.
20322
20323 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
20324
20325 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
20326 parse-skel.y.
20327
20328 * src/parse-skel.y: New file.
20329 * src/scan-skel.l: New file.
20330
203312001-12-29 Akim Demaille <akim@epita.fr>
20332
20333 %name-prefix is broken.
20334
20335 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
20336 Adjust all dependencies.
20337 * tests/headers.at (export YYLTYPE): Strengthen this test: use
20338 %name-prefix.
20339
20340 Renaming yylval but not yylloc is not consistent. Now we do.
20341
20342 * src/bison.simple: Prefix yylloc if used.
20343 * doc/bison.texinfo (Decl Summary): Document that.
20344
203452001-12-29 Akim Demaille <akim@epita.fr>
20346
20347 * doc/bison.texinfo: Promote `%long-directive' over
20348 `%long_directive'.
20349 Remove all references to fixed-output-files, yacc is enough.
20350
203512001-12-29 Akim Demaille <akim@epita.fr>
20352
20353 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
20354 user prologue. These are defaults.
20355 * tests/actions.at (Mid-rule actions): Make sure the user can
20356 define YYDEBUG and YYERROR_VERBOSE.
20357
203582001-12-29 Akim Demaille <akim@epita.fr>
20359
20360 * src/output.c (header_output): Don't forget to export YYLTYPE and
20361 yylloc.
20362 * tests/headers.at (export YYLTYPE): New, make sure it does.
20363 * tests/regression.at (%union and --defines, Invalid CPP headers):
20364 Move to...
20365 * tests/headers.at: here.
20366
203672001-12-29 Akim Demaille <akim@epita.fr>
20368
20369 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
20370
203712001-12-29 Akim Demaille <akim@epita.fr>
20372
20373 * tests/actions.at (Mid-rule actions): Output on a single line
20374 instead of several.
20375
203762001-12-29 Akim Demaille <akim@epita.fr>
20377
20378 * doc/bison.texinfo: Formatting changes.
20379
203802001-12-29 Akim Demaille <akim@epita.fr>
20381
20382 Don't store the token defs in a muscle, just be ready to output it
20383 on command. Now possible via `symbols'. Fixes a memory leak.
20384
20385 * src/output.c (token_definitions_output): New.
20386 (output_parser, header_output): Use it.
20387 * src/reader.c (symbols_save): Remove.
20388
203892001-12-29 Akim Demaille <akim@epita.fr>
20390
20391 * src/bison.simple: Do not provide a default for YYSTYPE and
20392 YYLTYPE before the user's prologue. Otherwise it's hardly... a
20393 default.
20394
203952001-12-29 Akim Demaille <akim@epita.fr>
20396
20397 Mid-rule actions are simply... ignored!
20398
20399 * src/reader.c (readgram): Be sure to attach mid-rule actions to
20400 the empty-rule associated to the dummy symbol, not to the host
20401 rule.
20402 * tests/actions.at (Mid-rule actions): New.
20403
204042001-12-29 Akim Demaille <akim@epita.fr>
20405
20406 Memory leak.
20407
20408 * src/reader.c (reader): Free grammar.
20409
204102001-12-29 Akim Demaille <akim@epita.fr>
20411
20412 Memory leak.
20413
20414 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
20415 since it allocates it for each state, although only one is needed.
20416 (allocate_storage): Do it here.
20417
204182001-12-29 Akim Demaille <akim@epita.fr>
20419
20420 * src/options.h, src/options.c (create_long_option_table): Rename
20421 as...
20422 (long_option_table_new): this, with a clearer prototype.
20423 (percent_table): Remove, unused,
20424 * src/getargs.c (getargs): Adjust.
20425
204262001-12-29 Akim Demaille <akim@epita.fr>
20427
20428 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
20429 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
20430 as states.
20431
204322001-12-29 Akim Demaille <akim@epita.fr>
20433
20434 * src/lalr.c (build_relations): Rename `states' as `states1'.
20435 Sorry, I don't understand exactly what it is, no better name...
20436
204372001-12-29 Akim Demaille <akim@epita.fr>
20438
20439 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
20440 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
20441 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
20442 as rules.
20443
204442001-12-29 Akim Demaille <akim@epita.fr>
20445
20446 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
20447 ago.
20448
204492001-12-29 Akim Demaille <akim@epita.fr>
20450
20451 * src/reader.c, src/reader.h (user_toknums): Remove.
20452 Adjust all users to use symbols[i]->user_token_number.
20453
204542001-12-29 Akim Demaille <akim@epita.fr>
20455
20456 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
20457 Adjust all users to use symbols[i]->prec or ->assoc.
20458
204592001-12-29 Akim Demaille <akim@epita.fr>
20460
20461 * src/reader.c, src/reader.h (tags): Remove.
20462 Adjust all users to use symbols[i]->tag.
20463
204642001-12-29 Akim Demaille <akim@epita.fr>
20465
20466 * src/gram.h, src/gram.c (symbols): New, similar to state_table
20467 and rule_table.
20468 * src/reader.c (packsymbols): Fill this table.
20469 Drop sprec.
20470 * src/conflicts.c (resolve_sr_conflict): Adjust.
20471 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
20472 single table.
20473 Use symbols[i]->tag instead of tags[i].
20474
204752001-12-29 Akim Demaille <akim@epita.fr>
20476
20477 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
20478 In addition, put a comment in there, to replace...
20479 * tests/regression.at (%union and C comments): Remove.
20480
204812001-12-29 Akim Demaille <akim@epita.fr>
20482
20483 * tests/regression.at (Web2c Actions): Blindly move the actual
20484 output as expected output. The contents *seem* right to me, but I
20485 can't pretend reading perfectly parser tables... Nonetheless, all
20486 the other tests pass correctly, the table look OK, even though the
20487 presence of `$axiom' is to be noted: AFAICS it is useless (but
20488 harmless).
20489
204902001-12-29 Akim Demaille <akim@epita.fr>
20491
20492 * src/reader.c (readgram): Don't add the rule 0 if there were no
20493 rules read. In other words, add it _after_ having performed
20494 grammar sanity checks.
20495 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
20496
204972001-12-29 Akim Demaille <akim@epita.fr>
20498
20499 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
20500 visible, and some states have now a different number.
20501
205022001-12-29 Akim Demaille <akim@epita.fr>
20503
20504 * src/reader.c (readgram): Bind the initial rule's lineno to that
20505 of the first rule.
20506 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20507 (Solved SR Conflicts): Adjust rule 0's line number.
20508
205092001-12-29 Akim Demaille <akim@epita.fr>
20510
20511 Fix the `GAWK Grammar' failure.
20512
20513 * src/LR0.c (final_state): Initialize to -1 so that we do compute
20514 the reductions of the first state which was mistakenly confused
20515 with the final state because precisely final_state was initialized
20516 to 0.
20517 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
20518 now noticed by Bison.
20519 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
20520 have a reduction on $default.
20521
205222001-12-29 Akim Demaille <akim@epita.fr>
20523
20524 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
20525 rule line numbers.
20526 * src/closure.c (print_closure): Likewise.
20527 * src/derives.c (print_derives): Likewise.
20528 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
20529 now.
20530
205312001-12-29 Akim Demaille <akim@epita.fr>
20532
20533 * src/lalr.c (lookaheads_print): New.
20534 (lalr): Call it when --trace-flag.
20535 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
20536 are dumped.
20537
205382001-12-29 Akim Demaille <akim@epita.fr>
20539
20540 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
20541 when walking through ritem, even via rule->rhs.
20542 * src/reduce.c (dump_grammar, useful_production, reduce_output)
20543 (useful_production, useless_nonterminals): Likewise.
20544 (reduce_grammar_tables): Likewise, plus update nritems.
20545 * src/nullable.c (set_nullable): Likewise.
20546 * src/lalr.c (build_relations): Likewise.
20547 * tests/sets.at (Nullable): Adjust.
20548 Fortunately, now, the $axiom is no longer nullable.
20549
205502001-12-29 Akim Demaille <akim@epita.fr>
20551
20552 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
20553 the 0-sentinel.
20554 * src/gram.c (ritem_longest_rhs): Likewise.
20555 * src/reduce.c (nonterminals_reduce): Likewise.
20556 * src/print_graph.c (print_graph): Likewise.
20557 * src/output.c (output_rule_data): Likewise.
20558 * src/nullable.c (set_nullable): Likewise.
20559
205602001-12-29 Akim Demaille <akim@epita.fr>
20561
20562 * src/output.c: Comment changes.
20563
205642001-12-27 Paul Eggert <eggert@twinsun.com>
20565
20566 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
20567 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
20568 Sparc, as they were causing more porting problems than the
20569 (minor) performance improvement was worth.
20570
20571 Also, catch up with 1.31's YYSTD.
20572
205732001-12-27 Akim Demaille <akim@epita.fr>
20574
20575 * src/output.c (output_gram): Rely on nritems, not the
20576 0-sentinel. See below.
20577 Use -1 as separator, not 0.
20578 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
20579 Rely on -1 as separator in yyrhs, instead of 0.
20580 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
20581 twice `Now at end of input', therefore there are two lines less to
20582 expect.
20583
205842001-12-27 Akim Demaille <akim@epita.fr>
20585
20586 * tests/regression.at (Unresolved SR Conflicts):
20587 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
20588 below.
20589
205902001-12-27 Akim Demaille <akim@epita.fr>
20591
20592 * src/LR0.c (new_state): Recognize the final state by the fact it
20593 is reached by eoftoken.
20594 (insert_start_shifting_state, insert_eof_shifting_state)
20595 (insert_accepting_state, augment_automaton): Remove, since now
20596 these states are automatically computed from the initial state.
20597 (generate_states): Adjust.
20598 * src/print.c: When reporting a rule number to the user, substract
20599 1, so that the axiom rule is rule 0, and the first user rule is 1.
20600 * src/reduce.c: Likewise.
20601 * src/print_graph.c (print_core): For the time being, just as for
20602 the report, depend upon --trace-flags to dump the full set of
20603 items.
20604 * src/reader.c (readgram): Once the grammar read, insert the rule
20605 0: `$axiom: START-SYMBOL $'.
20606 * tests/set.at: Adjust: rule 0 is now displayed, and since the
20607 number of the states has changed (the final state is no longer
20608 necessarily the last), catch up.
20609
206102001-12-27 Akim Demaille <akim@epita.fr>
20611
20612 Try to make the use of the eoftoken valid. Given that its value
20613 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
20614 is used instead of > 0 where appropriate, (ii), depend upon nritems
20615 instead of the 0-sentinel.
20616
20617 * src/gram.h, src/gram.c (nritems): New.
20618 Expected to be duplication of nitems, but for the time being...
20619 * src/reader.c (packgram): Assert nritems and nitems are equal.
20620 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
20621 * src/closure.c (print_closure, print_fderives): Likewise.
20622 * src/gram.c (ritem_print): Likewise.
20623 * src/print.c (print_core, print_grammar): Likewise.
20624 * src/print_graph.c: Likewise.
20625
206262001-12-27 Akim Demaille <akim@epita.fr>
20627
20628 * src/main.c (main): If there are complains after grammar
20629 reductions, then output the report anyway if requested, then die.
20630 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
20631 * src/reader.c (eoftoken): New.
20632 (parse_token_decl): If the token being defined has value `0', it
20633 is the eoftoken.
20634 (packsymbols): No longer hack `tags' to insert `$' by hand.
20635 Be sure to preserve the value of the eoftoken.
20636 (reader): Make sure eoftoken is defined.
20637 Initialize nsyms to 0: now eoftoken is created just like the others.
20638 * src/print.c (print_grammar): Don't special case the eof token.
20639 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
20640 lie anyway, albeit pleasant.
20641 * tests/calc.at: Exercise error messages with eoftoken.
20642 Change the grammar so that empty input is invalid.
20643 Adjust expectations.
20644 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
20645
206462001-12-27 Akim Demaille <akim@epita.fr>
20647
20648 * configure.in: Check the protos of strchr ans strspn.
20649 Replace strchr if needed.
20650 * src/system.h: Provide the protos of strchr, strspn and memchr if
20651 missing.
20652 * lib/strchr.c: New.
20653 * src/reader.c (symbols_save): Use strchr.
20654
206552001-12-27 Akim Demaille <akim@epita.fr>
20656
20657 * src/print.c, src/print_graph.c (escape): New.
20658 Use it to quote the TAGS outputs.
20659 * src/print_graph.c (print_state): Now errors are in red, and
20660 reductions in green.
20661 Prefer high to wide: output the state number on a line of its own.
20662
206632001-12-27 Akim Demaille <akim@epita.fr>
20664
20665 * src/state.h, src/state.c (reductions_new): New.
20666 * src/LR0.c (set_state_table): Let all the states have a
20667 `reductions', even if reduced to 0.
20668 (save_reductions): Adjust.
20669 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
20670 * src/print.c (print_reductions, print_actions): Adjust.
20671 * src/output.c (action_row): Adjust.
20672
206732001-12-27 Akim Demaille <akim@epita.fr>
20674
20675 * src/state.h, src/state.c (errs_new, errs_dup): New.
20676 * src/LR0.c (set_state_table): Let all the states have an errs,
20677 even if reduced to 0.
20678 * src/print.c (print_errs, print_reductions): Adjust.
20679 * src/output.c (output_actions, action_row): Adjust.
20680 * src/conflicts.c (resolve_sr_conflict): Adjust.
20681
206822001-12-27 Akim Demaille <akim@epita.fr>
20683
20684 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
20685
206862001-12-27 Akim Demaille <akim@epita.fr>
20687
20688 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
20689 * src/print.c: here.
20690 (lookaheadset, shiftset): New, used as additional storage by
20691 print_reductions.
20692 (print_results): Adjust.
20693 (print_shifts, print_gotos, print_errs): New, extracted from...
20694 (print_actions): here.
20695 * src/print_graph.c (print_actions): Remove dead code.
20696
206972001-12-27 Akim Demaille <akim@epita.fr>
20698
20699 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
20700 `$n' and `@n'.
20701
207022001-12-27 Akim Demaille <akim@epita.fr>
20703
20704 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
20705 (build_relations): Adjust.
20706
207072001-12-27 Akim Demaille <akim@epita.fr>
20708
20709 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
20710 duplication.
20711
207122001-12-27 Akim Demaille <akim@epita.fr>
20713
20714 * src/reader.c (packgram): Catch nitems overflows.
20715
207162001-12-27 Akim Demaille <akim@epita.fr>
20717
20718 * src/files.c, src/files.h (guard_obstack): Remove.
20719 * src/output.c (output): Adjust.
20720 * src/reader.c (parse_braces): New, factoring...
20721 (copy_action, copy_guard): these two which are renamed as...
20722 (parse_action, parse_guard): these.
20723 As a voluntary consequence, using braces around guards is now
20724 mandatory.
20725
207262001-12-27 Akim Demaille <akim@epita.fr>
20727
20728 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
20729 * src/reader.c (symbol_list): `guard' and `guard_line' are new
20730 members.
20731 (symbol_list_new): Adjust.
20732 (copy_action): action_line is the first line, not the last.
20733 (copy_guard): Just as for actions, store the `action' only, not
20734 the switch/case/break flesh.
20735 Don't parse the user action that might follow the guard, let...
20736 (readgram): do it, i.e., now, there can be an action after a
20737 guard.
20738 In other words the guard is just explicitly optional.
20739 (packgram): Adjust.
20740 * src/output.c (guards_output): New.
20741 (output_parser): Call it when needed.
20742 (output): Also free the guard and attrs obstacks.
20743 * src/files.c, src/files.h (obstack_save): Remove.
20744 (output_files): Remove.
20745 As a result, if one needs the former `.act' file, using an
20746 appropriate skeleton which requires actions and guards is now
20747 required.
20748 * src/main.c (main): Adjust.
20749 * tests/semantic.at: New.
20750 * tests/regression.at: Use `input.y' as input file name.
20751 Avoid 8+3 problems by requiring input.c when the test needs the
20752 parser.
20753
207542001-12-27 Akim Demaille <akim@epita.fr>
20755
20756 * src/reader.c (symbol_list_new): Be sure to initialize all the
20757 fields.
20758
207592001-12-27 Akim Demaille <akim@epita.fr>
20760
20761 All the hacks using a final pseudo state are now useless.
20762
20763 * src/LR0.c (set_state_table): state_table holds exactly nstates.
20764 * src/lalr.c (nLA): New.
20765 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
20766 instead of lookaheadsp from the pseudo state (nstate + 1).
20767
207682001-12-27 Akim Demaille <akim@epita.fr>
20769
20770 * src/output.c (action_row, token_actions): Use a state_t instead
20771 of a integer, and nlookaheads instead of the following state's
20772 lookaheadsp.
20773
207742001-12-27 Akim Demaille <akim@epita.fr>
20775
20776 * src/conflicts.c (log_resolution, flush_shift)
20777 (resolve_sr_conflict, set_conflicts, solve_conflicts)
20778 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
20779 (conflicts_print, print_reductions): Use a state_t instead of an
20780 integer when referring to a state.
20781 As much as possible, depend upon nlookaheads, instead of the
20782 `lookaheadsp' member of the following state (since lookaheads of
20783 successive states are successive, the difference between state n + 1
20784 and n served as the number of lookaheads for state n).
20785 * src/lalr.c (add_lookback_edge): Likewise.
20786 * src/print.c (print_core, print_actions, print_state)
20787 (print_results): Likewise.
20788 * src/print_graph.c (print_core, print_actions, print_state)
20789 (print_graph): Likewise.
20790 * src/conflicts.h: Adjust.
20791
207922001-12-27 Akim Demaille <akim@epita.fr>
20793
20794 * src/bison.hairy: Formatting/comment changes.
20795 ANSIfy.
20796 Remove `register' indications.
20797 Add plenty of `static'.
20798
207992001-12-27 Akim Demaille <akim@epita.fr>
20800
20801 * src/output.c (prepare): Drop the muscle `ntbase' which
20802 duplicates ntokens.
20803 * src/bison.simple: Formatting/comment changes.
20804 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
20805 is an undocumented synonym.
20806
208072001-12-22 Akim Demaille <akim@epita.fr>
20808
20809 * src/output.c (output_table_data): Change the prototype to use
20810 `int' for array ranges: some invocations do pass an int, not a
20811 short.
20812 Reported by Wayne Green.
20813
208142001-12-22 Akim Demaille <akim@epita.fr>
20815
20816 Some actions of web2c.y are improperly triggered.
20817 Reported by Mike Castle.
20818
20819 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
20820 * tests/regression.at (Web2c): Rename as...
20821 (Web2c Report): this.
20822 (Web2c Actions): New.
20823
208242001-12-22 Akim Demaille <akim@epita.fr>
20825
20826 Reductions in web2c.y are improperly reported.
20827 Reported by Mike Castle.
20828
20829 * src/conflicts.c (print_reductions): Fix.
20830 * tests/regression.at (Web2c): New.
20831
208322001-12-18 Akim Demaille <akim@epita.fr>
20833
20834 Some host fail on `assert (!"foo")', which expands to
20835 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
20836 Reported by Nelson Beebee.
20837
20838 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
20839 `#define it_succeeded 0' and `assert (it_succeeded)'.
20840
208412001-12-17 Marc Autret <autret_m@epita.fr>
20842
20843 * src/bison.simple: Don't hard code the skeleton line and filename.
20844 * src/output.c (output_parser): Rename 'line' as 'output_line'.
20845 New line counter 'skeleton_line' (skeleton-line muscle).
20846
208472001-12-17 Paul Eggert <eggert@twinsun.com>
20848
20849 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
20850 YYDEBUG must be defined to a nonzero value.
20851
20852 * src/bison.simple (yytname): Do not assume that the user defines
20853 YYDEBUG to a properly parenthesized expression.
20854
208552001-12-17 Akim Demaille <akim@epita.fr>
20856
20857 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
20858 nlookaheads is a new member.
20859 Adjust all users.
20860 * src/lalr.h (nlookaheads): Remove this orphan declaration.
20861 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
20862 state.
20863
208642001-12-17 Akim Demaille <akim@epita.fr>
20865
20866 * src/files.h, src/files.c (open_files, close_files): Remove.
20867 * src/main.c (main): Don't open/close files, nor invoke lex_free,
20868 let...
20869 * src/reader.c (reader): Do it.
20870
208712001-12-17 Akim Demaille <akim@epita.fr>
20872
20873 * src/conflicts.c (print_reductions): Formatting changes.
20874
208752001-12-17 Akim Demaille <akim@epita.fr>
20876
20877 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
20878 (flush_reduce): New.
20879 (resolve_sr_conflict): Adjust.
20880
208812001-12-17 Akim Demaille <akim@epita.fr>
20882
20883 * src/output.c (output_obstack): Be static and rename as...
20884 (format_obstack): this, to avoid any confusion with files.c's
20885 output_obstack.
20886 * src/reader.h (muscle_obstack): Move to...
20887 * src/output.h: here, since it's defined in output.c.
20888
208892001-12-17 Akim Demaille <akim@epita.fr>
20890
20891 * src/output.c (action_row, save_column, default_goto)
20892 (sort_actions, matching_state, pack_vector): Better variable
20893 locality.
20894
208952001-12-17 Akim Demaille <akim@epita.fr>
20896
20897 * src/output.c: Various formatting changes.
20898
208992001-12-17 Akim Demaille <akim@epita.fr>
20900
20901 * src/files.c (output_files): Free the output_obstack.
20902 * src/main.c (main): Call print and print_graph conditionally.
20903 * src/print.c (print): Work unconditionally.
20904 * src/print_graph.c (print_graph): Work unconditionally.
20905 * src/conflicts.c (log_resolution): Output only if verbose_flag.
20906
209072001-12-16 Marc Autret <autret_m@epita.fr>
20908
20909 * src/output.c (actions_output): Fix. When we use %no-lines,
20910 there is one less line per action.
20911
209122001-12-16 Marc Autret <autret_m@epita.fr>
20913
20914 * src/bison.simple: Remove a useless #line directive.
20915 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
20916 * src/output.c (get_lines_number): New.
20917 (output_parser): Adjust, now takes care about the lines of a
20918 output muscles.
20919 Fix line numbering.
20920 (actions_output): Computes the number of lines taken by actions.
20921 (output_master_parser): Insert new skeleton which is the name of
20922 the output parser file name.
20923
209242001-12-15 Marc Autret <autret_m@epita.fr>
20925
20926 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
20927
209282001-12-15 Marc Autret <autret_m@epita.fr>
20929
20930 * src/output.c (output_gram): Keep track of the hairy one.
20931
209322001-12-15 Akim Demaille <akim@epita.fr>
20933
20934 Make `make distcheck' work.
20935
20936 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
20937 system.h which uses libgettext.h.
20938
209392001-12-15 Akim Demaille <akim@epita.fr>
20940
20941 * src/nullable.c (set_nullable): Useless rules must be skipped,
20942 otherwise, since we range over their symbols, we might look at a
20943 nonterminal which no longer ``exists'', i.e., it is not counted in
20944 `nvars', hence we overflow our arrays.
20945
209462001-12-15 Akim Demaille <akim@epita.fr>
20947
20948 The header can also be produced directly, without any obstack!
20949 Yahoo!
20950
20951 * src/files.c, src/files.h (defines_obstack): Remove.
20952 (compute_header_macro): Global.
20953 (defines_obstack_save): Remove.
20954 * src/reader.c (parse_union_decl): No longer output to
20955 defines_obstack: its content can be found in the `stype' muscle
20956 anyway.
20957 (output_token_translations): Merge into...
20958 (symbols_output): this.
20959 Rename as...
20960 (symbols_save): this.
20961 (reader): Adjust.
20962 * src/output.c (header_output): New.
20963 (output): Call it.
20964
209652001-12-15 Akim Demaille <akim@epita.fr>
20966
20967 * src/reader.c (parse_union_decl): Instead of handling two obstack
20968 simultaneously, use one to define the `stype' muscle, and use the
20969 value of the latter to fill defines_obstack.
20970 (copy_comment): Remove.
20971 (copy_comment2): Work for a single obstack.
20972 Rename as...
20973 (copy_comment): this.
20974
209752001-12-15 Akim Demaille <akim@epita.fr>
20976
20977 * src/lex.c, src/lex.h (xgetc): No longer static.
20978 * src/reader.c (parse_union_decl): Revamp.
20979
209802001-12-15 Akim Demaille <akim@epita.fr>
20981
20982 Still making progress in separating Bison into (i) input, (ii)
20983 process, (iii) output: now we can directly output the parser file
20984 without using table_obstack at all.
20985
20986 * src/files.c, src/files.h (table_obstack): Bye bye.
20987 (parser_file_name): New.
20988 * src/files.c (compute_output_file_names): Compute it.
20989 * src/output.c (actions_output, output_parser)
20990 (output_master_parser): To a file instead of an obstack.
20991
209922001-12-15 Akim Demaille <akim@epita.fr>
20993
20994 Attach actions to rules, instead of pre-outputting them to
20995 actions_obstack.
20996
20997 * src/gram.h (rule_t): action and action_line are new members.
20998 * src/reader.c (symbol_list): Likewise.
20999 (copy_action): Save the actions within the rule.
21000 (packgram): Save them in rule_table.
21001 * src/output.c (actions_output): New.
21002 (output_parser): Use it on `%%actions'.
21003 (output_rule_data): Don't free rule_table.
21004 (output): Do it.
21005 (prepare): Don't save the `action' muscle.
21006 * src/bison.simple: s/%%action/%%actions/.
21007
210082001-12-15 Akim Demaille <akim@epita.fr>
21009
21010 * src/reader.c (copy_action): When --yacc, don't append a `;'
21011 to the user action: let it fail if lacking.
21012 Suggested by Arnold Robbins and Tom Tromey.
21013
210142001-12-14 Akim Demaille <akim@epita.fr>
21015
21016 * src/lex.c (literalchar): Simply return the char you decoded, non
21017 longer mess around with obstacks and int pointers.
21018 Adjust all callers.
21019
210202001-12-14 Akim Demaille <akim@epita.fr>
21021
21022 * src/lex.c (literalchar): Don't escape the special characters,
21023 just decode them, and keep them as char (before, eol was output as
21024 the 2 char string `\n' etc.).
21025 * src/output.c (output_rule_data): Use quotearg to output the
21026 token strings.
21027
210282001-12-13 Paul Eggert <eggert@twinsun.com>
21029
21030 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
21031 Do not infringe on the global user namespace when using C++.
21032 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
21033 All uses of `fprintf' and `stderr' changed.
21034
21035 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
21036
210372001-12-13 Akim Demaille <akim@epita.fr>
21038
21039 The computation of nullable is broken: it doesn't handle empty
21040 RHS's properly.
21041
21042 * tests/torture.at (GNU AWK Grammar): New.
21043 * tests/sets.at (Nullable): New.
21044 * src/nullable.c (set_nullable): Instead of blindly looping over
21045 `ritems', loop over the rules, and then over their rhs's.
21046
21047 Work around Autotest bugs.
21048
21049 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
21050 frame, because Autotest understand lines starting with a `+' as
21051 traces from the shell. Then, they are not processed properly.
21052 Admittedly an Autotest bug, but we don't have time to wait for
21053 Autotest to catch up.
21054 * tests/regression.at (Broken Closure): Adjust to the new table
21055 frames.
21056 Move to...
21057 * tests/sets.at: here.
21058
210592001-12-13 Akim Demaille <akim@epita.fr>
21060
21061 * src/closure.c (closure): Use nrules instead of playing tricks
21062 with BITS_PER_WORD.
21063
210642001-12-13 Akim Demaille <akim@epita.fr>
21065
21066 * src/print.c (print_actions): Output the handling of `$' as the
21067 traces do: shifting the token EOF. Before EOF was treated as a
21068 nonterminal.
21069 * tests/regression.at: Adjust some tests.
21070 * src/print_graph.c (print_core): Complete the set of items via
21071 closure. The next-to-final and final states are still unsatisfying,
21072 but that's to be addressed elsewhere.
21073 No longer output the rule numbers, but do output the state number.
21074 A single loop for the shifts + gotos is enough, but picked a
21075 distinct color for each.
21076 (print_graph): Initialize and finalize closure.
21077
210782001-12-13 Akim Demaille <akim@epita.fr>
21079
21080 * src/reader.c (readgram): Remove dead code, an strip useless
21081 braces.
21082 (get_type): Remove, unused.
21083
210842001-12-12 Akim Demaille <akim@epita.fr>
21085
21086 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
21087 on that of lib/error.c.
21088
210892001-12-12 Akim Demaille <akim@epita.fr>
21090
21091 Some hosts don't like `/' in includes.
21092
21093 * src/system.h: Include libgettext.h without qualifying the path.
21094 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
21095 $(top_srcdir).
21096
210972001-12-11 Marc Autret <autret_m@epita.fr>
21098
21099 * src/output.c (output_parser): Remove useless muscle.
21100
211012001-12-11 Marc Autret <autret_m@epita.fr>
21102
21103 * src/bison.simple: Remove #line just before %%epilogue. It
21104 is now handled in ...
21105 * src/reader.c (read_additionnal_code): Add the output of a
21106 #line for the epilogue.
21107
211082001-12-10 Marc Autret <autret_m@epita.fr>
21109
21110 * src/reader.c (copy_definition): Re-use CPP-outed code which
21111 replace precedent remove.
21112 * src/bison.simple: Remove #line before %%prologue because
21113 %%input-line is wrong at this time.
21114
211152001-12-10 Marc Autret <autret_m@epita.fr>
21116
21117 * src/reader.c (symbols_output): Clean up.
21118 * src/output.c (output_gram, output): Clean up.
21119
211202001-12-10 Akim Demaille <akim@epita.fr>
21121
21122 * src/lalr.c (initialize_lookaheads): New. Extracted from...
21123 * src/LR0.c (set_state_table): here.
21124 * src/lalr.c (lalr): Call it.
21125
211262001-12-10 Akim Demaille <akim@epita.fr>
21127
21128 * src/state.h (shifts): Remove the `number' member: shifts are
21129 attached to state, hence no longer need to be labelled with a
21130 state number.
21131
211322001-12-10 Akim Demaille <akim@epita.fr>
21133
21134 Now that states have a complete set of members, the linked list of
21135 shifts is useless: just fill directly the state's shifts member.
21136
21137 * src/state.h (shifts): Remove the `next' member.
21138 * src/LR0.c (first_state, last_state): Remove.
21139 Adjust the callers.
21140 (augment_automaton): Don't look for the shifts that must be added
21141 a shift on EOF: it is those of the state we looked for! But now,
21142 since shifts are attached, it is no longer needed to looking
21143 merely by its id: its number.
21144
211452001-12-10 Akim Demaille <akim@epita.fr>
21146
21147 * src/LR0.c (augment_automaton): Better variable locality.
21148 Remove an impossible branch: if there is a state corresponding to
21149 the start symbol being shifted, then there is shift for the start
21150 symbol from the initial state.
21151
211522001-12-10 Akim Demaille <akim@epita.fr>
21153
21154 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
21155 only when appropriate: when insert_start_shifting_state' is not
21156 invoked.
21157 * tests/regression.at (Rule Line Numbers): Adjust.
21158
211592001-12-10 Akim Demaille <akim@epita.fr>
21160
21161 * src/LR0.c (augment_automaton): Now that all states have shifts,
21162 merge the two cases addition shifts to the initial state.
21163
211642001-12-10 Akim Demaille <akim@epita.fr>
21165
21166 * src/lalr.c (set_state_table): Move to...
21167 * src/LR0.c: here.
21168 * src/lalr.c (lalr): Don't call it...
21169 * src/LR0.c (generate_states): do it.
21170 * src/LR0.h (first_state): Remove, only the table is used.
21171
211722001-12-10 Akim Demaille <akim@epita.fr>
21173
21174 * src/LR0.h (first_shift, first_reduction): Remove.
21175 * src/lalr.c: Don't use first_shift: find shifts through the
21176 states.
21177
211782001-12-10 Akim Demaille <akim@epita.fr>
21179
21180 * src/LR0.c: Attach shifts to states as soon as they are
21181 computed.
21182 * src/lalr.c (set_state_table): Instead of assigning shifts to
21183 state, just assert that the mapping was properly done.
21184
211852001-12-10 Akim Demaille <akim@epita.fr>
21186
21187 * src/LR0.c (insert_start_shift): Rename as...
21188 (insert_start_shifting_state): this.
21189 (insert_eof_shifting_state, insert_accepting_state): New.
21190 (augment_automaton): Adjust.
21191 Better locality of the variables.
21192 When looking if the start_symbol is shifted from the initial
21193 state, using `while (... symbol != start_symbol ...)' sounds
21194 better than `while (... symbol < start_symbol ...)': If fail
21195 to see how the order between symbols could be relevant!
21196
211972001-12-10 Akim Demaille <akim@epita.fr>
21198
21199 * src/getargs.h: Don't declare `spec_name_prefix' and
21200 `spec_file_prefix', declared by src/files.h.
21201 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
21202 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
21203 * src/output.c (prepare): Adjust.
21204 * src/reader.c (symbols_output): Likewise.
21205 * src/vmsgetargs.c: Vaguely adjust, but who cares?
21206
212072001-12-10 Akim Demaille <akim@epita.fr>
21208
21209 * src/muscle_tab.c (muscle_init): NULL is a better default than
21210 `"0"'.
21211
212122001-12-10 Akim Demaille <akim@epita.fr>
21213
21214 * src/reader.c (reader): Calling symbols_output once is enough.
21215
212162001-12-10 Akim Demaille <akim@epita.fr>
21217
21218 Now that states have a complete set of members, the linked list of
21219 reductions is useless: just fill directly the state's reductions
21220 member.
21221
21222 * src/state.h (struct reductions): Remove member `number' and
21223 `next'.
21224 * src/LR0.c (first_reduction, last_reduction): Remove.
21225 (save_reductions): Don't link the new reductions, store them in
21226 this_state.
21227 * src/lalr.c (set_state_table): No need to attach reductions to
21228 states, it's already done.
21229 * src/output.c (output_actions): No longer free the shifts, then
21230 the reductions, then the states: free all the states and their
21231 members.
21232
212332001-12-10 Akim Demaille <akim@epita.fr>
21234
21235 * src/options.c (OPTN, DRTV, BOTH): New.
21236 (option_table): Use them.
21237
21238 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
21239 the job of system.h.
21240 * src/options.c: Don't include stdio.h and xalloc.h for the same
21241 reasons.
21242
212432001-12-10 Akim Demaille <akim@epita.fr>
21244
21245 * src/output.c (output, prepare): Make sure the values of the
21246 muscles `action' and `prologue' are 0-terminated.
21247
212482001-12-10 Akim Demaille <akim@epita.fr>
21249
21250 Clean up GCC warnings.
21251
21252 * src/reader.c (copy_action): `buf' is not used.
21253 (parse_skel_decl): Be static.
21254 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
21255 * src/options.h (create_long_option_table): Have a real prototype.
21256 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
21257 (hash_delete_at): Return const void *.
21258 Adjust casts to preserve the const.
21259
212602001-12-10 Akim Demaille <akim@epita.fr>
21261
21262 * configure.in: Require 2.52g.
21263 M4 is not needed, but AUTOM4TE is.
21264 * m4/m4.m4: Remove.
21265 * tests/Makefile.am: Adjust.
21266
212672001-12-10 Akim Demaille <akim@epita.fr>
21268
21269 One structure for states is enough, even though theoretically
21270 there are LR(0) states and LALR(1) states.
21271
21272 * src/lalr.h (state_t): Remove.
21273 (state_table): Be state_t **, not state_t *.
21274 * src/state.h (core, CORE_ALLOC): Rename as...
21275 (state_t, STATE_ALLOC): this.
21276 Add the LALR(1) members: shifts, reductions, errs.
21277 * src/LR0.c (state_table): Rename as...
21278 (state_hash): this, to avoid name clashes with the global
21279 `state_table'.
21280 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
21281 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
21282
212832001-12-10 Akim Demaille <akim@epita.fr>
21284
21285 Bison dumps core on bash.y.
21286 Reported by Pascal Bart.
21287
21288 * src/warshall.c (bitmatrix_print): New.
21289 (TC): Use it.
21290 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
21291 j must be the outer loop.
21292 * tests/regression.at (Broken Closure): New.
21293
212942001-12-05 Akim Demaille <akim@epita.fr>
21295
21296 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
21297 its argument.
21298 Reported by Peter Hamorsky.
21299
213002001-12-05 Akim Demaille <akim@epita.fr>
21301
21302 * src/conflicts.c (err_table): Remove.
21303 (resolve_sr_conflict): Adjust.
21304 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
21305 Rename as...
21306 (state_t.reductions, state_t.shifts): this.
21307
213082001-12-05 Akim Demaille <akim@epita.fr>
21309
21310 * src/reduce.c (reduce_grammar_tables): No longer disable the
21311 removal of useless rules via CPP but via `if (0)', so that the
21312 compiler still check the code is valid.
21313 For instance, it should have noticed `rline' no longer exists: use
21314 the `line' member of rule_t.
21315 * src/gram.c (dummy, rline): Remove, unused.
21316
213172001-12-05 Akim Demaille <akim@epita.fr>
21318
21319 * src/output.c (pack_vector): Use assert, not berror.
21320 * src/main.c (berror): Remove, unused.
21321
213222001-12-05 Akim Demaille <akim@epita.fr>
21323
21324 New experimental feature: if --verbose --trace output all the
21325 items of a state, not only its kernel.
21326
21327 * src/print.c (print_core): If `trace_flag', then invoke closure
21328 before outputting the items of the state (print_core is no longer
21329 a correct name them).
21330 (print_results): Invoke new_closure/free_closure if needed.
21331
213322001-12-05 Akim Demaille <akim@epita.fr>
21333
21334 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
21335 * src/closure.c, src/closure.h (itemsetsize): Rename as...
21336 (nitemset): for consistency with the rest of the project.
21337
213382001-12-05 Akim Demaille <akim@epita.fr>
21339
21340 * src/closure.c (print_closure): Improve.
21341 (closure): Use it for printing input and output.
21342
213432001-12-05 Akim Demaille <akim@epita.fr>
21344
21345 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
21346 indexed by nonterminals.
21347
213482001-12-05 Akim Demaille <akim@epita.fr>
21349
21350 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
21351 what it was!).
21352 * src/warshall.h: Remove accidental duplication of the content.
21353
213542001-12-05 Akim Demaille <akim@epita.fr>
21355
21356 * src/closure.c (set_fderives): De-obfuscate.
21357
213582001-12-05 Akim Demaille <akim@epita.fr>
21359
21360 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
21361
213622001-12-05 Akim Demaille <akim@epita.fr>
21363
21364 * src/closure.c (set_firsts): De-obfuscate.
21365
213662001-12-05 Akim Demaille <akim@epita.fr>
21367
21368 * src/output.c (action_row): De-obfuscate
21369 using the good o' techniques: arrays not pointers, variable
21370 locality, BITISSET, RESETBIT etc.
21371
213722001-12-05 Akim Demaille <akim@epita.fr>
21373
21374 Pessimize the code to simplify it: from now on, all the states
21375 have a valid SHIFTS, which NSHIFTS is possibly 0.
21376
21377 * src/LR0.c (shifts_new): Be global and move to..
21378 * src/state.c, src/state.h: here.
21379 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
21380 * src/print_graph: Adjust.
21381
213822001-12-05 Akim Demaille <akim@epita.fr>
21383
21384 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
21385 * src/conflicts.c: Use it.
21386 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
21387 incorrectly ``simplified''.
21388
213892001-12-05 Akim Demaille <akim@epita.fr>
21390
21391 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
21392 using the good o' techniques: arrays not pointers, variable
21393 locality, BITISSET, RESETBIT etc.
21394
213952001-12-05 Akim Demaille <akim@epita.fr>
21396
21397 * src/state.h (SHIFT_SYMBOL): New.
21398 * src/conflicts.c: Use it to deobfuscate.
21399
214002001-12-05 Akim Demaille <akim@epita.fr>
21401
21402 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
21403 (print_reductions): De-obfuscate using the good o' techniques:
21404 arrays not pointers, variable locality, BITISSET.
21405
214062001-12-05 Akim Demaille <akim@epita.fr>
21407
21408 * src/conflicts.c (print_reductions): Arrays, not pointers.
21409 Use BITISSET.
21410
214112001-12-05 Akim Demaille <akim@epita.fr>
21412
21413 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21414
214152001-12-05 Akim Demaille <akim@epita.fr>
21416
21417 * src/conflicts.c (print_reductions): Improve variable locality.
21418
214192001-12-05 Akim Demaille <akim@epita.fr>
21420
21421 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21422
214232001-12-05 Akim Demaille <akim@epita.fr>
21424
21425 * src/conflicts.c (print_reductions): Improve variable locality.
21426
214272001-12-05 Akim Demaille <akim@epita.fr>
21428
21429 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
21430 * src/lalr.c: Use them.
21431
214322001-12-05 Akim Demaille <akim@epita.fr>
21433
21434 * src/LR0.c (augment_automaton): Formatting changes.
21435 Better variable locality.
21436
214372001-12-05 Akim Demaille <akim@epita.fr>
21438
21439 * src/lalr.c (matrix_print): New.
21440 (transpose): Use it.
21441 Use arrays instead of pointers.
21442
214432001-12-05 Akim Demaille <akim@epita.fr>
21444
21445 * src/lalr.c (maxrhs): Move to...
21446 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
21447 * src/lalr.c (build_relations): Adjust.
21448
214492001-12-05 Akim Demaille <akim@epita.fr>
21450
21451 * src/lalr.c (transpose): Free the memory allocated to the
21452 argument, as it is replaced by the results by the unique caller.
21453 (build_relations): Merely invoke transpose: it handles the memory
21454 deallocation.
21455 Improve variable locality.
21456 Avoid variables used as mere abbreviations.
21457 (compute_lookaheads): Use arrays instead of pointers.
21458
214592001-12-05 Akim Demaille <akim@epita.fr>
21460
21461 * src/lalr.c (initialize_F): Improve variable locality.
21462 Avoid variables used as mere abbreviations.
21463
214642001-12-05 Akim Demaille <akim@epita.fr>
21465
21466 * src/derives.c (print_derives): Display the ruleno.
21467 * src/lalr.c (initialize_F, transpose): Better variable locality
21468 to improve readability.
21469 Avoid variables used as mere abbreviations.
21470
214712001-12-05 Akim Demaille <akim@epita.fr>
21472
21473 * src/lalr.c (traverse): Use arrays instead of pointers.
21474
214752001-12-05 Akim Demaille <akim@epita.fr>
21476
21477 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
21478 the handling of squeue.
21479 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21480
214812001-12-05 Akim Demaille <akim@epita.fr>
21482
21483 Because useless nonterminals are now kept alive (instead of being
21484 `destroyed'), we now sometimes examine them, and store information
21485 related to them. Hence we need to know their number, and adjust
21486 memory allocations.
21487
21488 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
21489 static.
21490 * src/LR0.c (allocate_itemsets): The memory allocated to
21491 `symbol_count' was used for two different purpose: once to count
21492 the number of occurrences of each symbol, and later reassigned to
21493 `shift_symbol', containing the symbol that can be shifted from a
21494 given state.
21495 Deobfuscate, i.e., allocate, use and free `symbol_count' here
21496 only, and...
21497 (new_itemsets): Allocate `shift_symbol' here.
21498 (allocate_itemsets): symbol_count includes useless nonterminals.
21499 Make room for them.
21500 (free_storage): Use `free', not `XFREE', for pointers that cannot
21501 be null.
21502
215032001-12-05 Akim Demaille <akim@epita.fr>
21504
21505 * src/nullable.c (set_nullable): Deobfuscate the handling of
21506 ritem.
21507 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21508
215092001-12-05 Akim Demaille <akim@epita.fr>
21510
21511 * src/gram.c, src/gram.h (ritem_print): New.
21512 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
21513 (This useless function was defined only to work around VMS linkers
21514 that can't handle compilation units with variables only).
21515 * src/reduce.c (dump_grammar): Use it to trace the construction of
21516 ritem.
21517
215182001-12-04 Paul Eggert <eggert@twinsun.com>
21519
21520 * src/bison.simple (union yyalloc): Change member names
21521 to be the same as the stack names.
21522 (yyparse): yyptr is now union yyalloc *, not char *.
21523 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
21524 and may generate better code on some machines.
21525 (yystpcpy): Use prototype if __STDC__ is defined, not just
21526 if __cplusplus is defined.
21527
215282001-11-30 Akim Demaille <akim@epita.fr>
21529
21530 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
21531 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
21532 Gettext doesn't compile cleanly, and dies with -Werror.
21533 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
21534 Include WARNING_CFLAGS here.
21535 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
21536 before being defined.
21537
215382001-11-27 Paul Eggert <eggert@twinsun.com>
21539
21540 * lib/quotearg.h (quotearg_n, quotearg_n_style):
21541 First arg is int, not unsigned.
21542 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
21543 (SIZE_MAX, UINT_MAX): New macros.
21544 (quotearg_n_options): Abort if N is negative.
21545 Avoid overflow check on hosts where size_t is 64 bits and int
21546 is 32 bits, as overflow is impossible there.
21547 Fix off-by-one typo that caused unnecessary reallocation.
21548
215492001-11-29 Paul Eggert <eggert@twinsun.com>
21550
21551 Name space cleanup in generated parser.
21552
21553 * doc/bison.texinfo (Bison Parser): Discuss system headers
21554 and their effect on the user name space.
21555
21556 * src/bison.simple:
21557 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
21558 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
21559 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
21560
21561 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
21562 on user names when possible.
21563
21564 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
21565 Simplify test for whather <alloca.h> exists.
21566
21567 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
21568
21569 (<stdio.h>): Include if YYDEBUG.
21570
21571 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
21572 ! defined (yyoverflow) && ! defined (yymemcpy).
21573
21574 (yymemcpy, yyparse): Rename local variables as needed so that
21575 they all begin with 'yy'.
21576
21577 (yystrlen, yystpcpy): New functions.
21578
21579 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
21580 All uses changed.
21581
21582 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
21583 instead of relying on string.h functions. Use YYSTACK_ALLOC
21584 and YYSTACK_FREE instead of malloc and free.
21585
215862001-11-30 Akim Demaille <akim@epita.fr>
21587
21588 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
21589 before their first uses.
21590 (YYBISON, YYPURE): Move to the top of the output.
21591
215922001-11-30 Akim Demaille <akim@epita.fr>
21593
21594 * tests/reduce.at (Useless Nonterminals): Fix.
21595
215962001-11-30 Akim Demaille <akim@epita.fr>
21597
21598 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
21599 if body instead of `;' to pacify GCC's warnings.
21600
216012001-11-30 Akim Demaille <akim@epita.fr>
21602
21603 Instead of mapping the LHS of unused rules to -1, keep the LHS
21604 valid, but flag the rules as invalid.
21605
21606 * src/gram.h (rule_t): `useful' is a new member.
21607 * src/print.c (print_grammar): Adjust.
21608 * src/derives.c (set_derives): Likewise.
21609 * src/reader.c (packgram, reduce_output): Likewise.
21610 * src/reduce.c (reduce_grammar_tables): Likewise.
21611 * tests/reduce.at (Underivable Rules, Useless Rules): New.
21612
216132001-11-30 Akim Demaille <akim@epita.fr>
21614
21615 * src/reduce.c (reduce_output): Formatting changes.
21616 * src/print.c (print_results, print_grammar): Likewise.
21617 * tests/regression.at (Rule Line Numbers)
21618 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
21619
216202001-11-30 Akim Demaille <akim@epita.fr>
21621
21622 * src/reduce.c (nonterminals_reduce): Instead of throwing away
21623 useless nonterminals, move them at the end of the symbol arrays.
21624 (reduce_output): Adjust.
21625 * tests/reduce.at (Useless Nonterminals): Adjust.
21626
216272001-11-30 Akim Demaille <akim@epita.fr>
21628
21629 * src/reduce.c: Various comment/formatting changes.
21630 (nonterminals_reduce): New, extracted from...
21631 (reduce_grammar_tables): here.
21632 (reduce_grammar): Call nonterminals_reduce.
21633
216342001-11-29 Paul Eggert <eggert@twinsun.com>
21635
21636 * src/bison.simple (YYSTACK_REALLOC): Remove.
21637 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
21638 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
21639 New macros.
21640 (union yyalloc): New type.
21641 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
21642 an arbitrary restriction on hosts where size_t is wider than int.
21643
21644 (yyparse): Don't dump core if alloca or malloc fails; instead, report
21645 a parser stack overflow. Allocate just one block of memory for all
21646 three stacks, instead of allocating three blocks; this typically is
21647 faster and reduces fragmentation.
21648
21649 Do not limit the number of items in the stack to a value that fits
21650 in 'int', as this is an arbitrary limit on hosts with 64-bit
21651 size_t and 32-bit int.
21652
216532001-11-29 Marc Autret <autret_m@epita.fr>
21654
21655 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
21656 of defining YYERROR_VERBOSE.
21657 [AT_DATA]: $4 is now out of C declarations in the prologue.
21658
216592001-11-28 Marc Autret <autret_m@epita.fr>
21660
21661 * src/reader.c (parse_dquoted_param): New.
21662 (parse_skel_decl): Use it.
21663 * src/lex.h: Add its prototype.
21664 * src/lex.c (literalchar): Become not static.
21665
216662001-11-28 Marc Autret <autret_m@epita.fr>
21667
21668 * src/output.h: And put its extern declaration here.
21669 * src/output.c (error_verbose): Define here.
21670 (prepare): Echo name modification.
21671 * src/getargs.h: Clean its extern declaration.
21672 * src/getargs.c (error_verbose_flag): Remove.
21673 (getargs): Remove case 'e'.
21674 * src/options.c (option_table): 'error-verbose' is now seen as simple
21675 percent option.
21676 Include output.h.
21677
21678 * src/reader.c (read_declarations): Remove case tok_include.
21679 (parse_include_decl): Remove.
21680 * src/lex.h (token_t): Remove tok_include.
21681 * src/options.c (option_table): 'include' is now a simple command line
21682 option.
21683
216842001-11-28 Marc Autret <autret_m@epita.fr>
21685
21686 * src/bison.simple: Adjust muscle names.
21687 * src/muscle_tab.c (muscle_init): Also rename the muscles.
21688 * src/output.c (prepare): s/_/-/ for the muscles names.
21689 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
21690
216912001-11-28 Marc Autret <autret_m@epita.fr>
21692
21693 * src/bison.simple: Fix debug.
21694 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
21695
216962001-11-28 Akim Demaille <akim@epita.fr>
21697
21698 * src/LR0.c (shifts_new): New.
21699 (save_shifts, insert_start_shift, augment_automaton): Use it.
21700
217012001-11-28 Akim Demaille <akim@epita.fr>
21702
21703 * src/closure.c (closure): `b' and `ruleno' denote the same value:
21704 keep ruleno only.
21705
217062001-11-28 Akim Demaille <akim@epita.fr>
21707
21708 * src/closure.c (closure): Instead of looping over word in array
21709 then bits in words, loop over bits in array.
21710
217112001-11-28 Akim Demaille <akim@epita.fr>
21712
21713 * src/closure.c (closure): No longer optimize the special case
21714 where all the bits of `ruleset[r]' are set to 0, to make the code
21715 clearer.
21716
217172001-11-28 Akim Demaille <akim@epita.fr>
21718
21719 * src/closure.c (closure): `r' and `c' are new variables, used to
21720 de-obfuscate accesses to RULESET and CORE.
21721
217222001-11-28 Akim Demaille <akim@epita.fr>
21723
21724 * src/reduce.c (reduce_print): Use ngettext.
21725 (dump_grammar): Improve the trace accuracy.
21726
217272001-11-28 Akim Demaille <akim@epita.fr>
21728
21729 * src/reduce.c (dump_grammar): Don't translate trace messages.
21730
217312001-11-28 Akim Demaille <akim@epita.fr>
21732
21733 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
21734 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
21735 as all tags are free'ed afterwards.
21736 From Enrico Scholz.
21737
217382001-11-27 Paul Eggert <eggert@twinsun.com>
21739
21740 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
21741 use alloca when we didn't want to, and vice versa.
21742
217432001-11-27 Marc Autret <autret_m@epita.fr>
21744
21745 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
21746 initialization.
21747 * src/output.c (prepare): Remove its update.
21748
217492001-11-27 Marc Autret <autret_m@epita.fr>
21750
21751 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
21752 Use %error-verbose.
21753
217542001-11-27 Marc Autret <autret_m@epita.fr>
21755
21756 * src/bison.simple: Remove YYERROR_VERBOSE using.
21757 Use %%error_verbose.
21758 (yyparse): Likewise.
21759 * src/output.c (prepare): Give its final value.
21760 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
21761 * src/getargs.h: Add its extern declaration.
21762 * src/getargs.c (error_verbose_flag): New int.
21763 (getargs): Update to catch new case.
21764 * src/options.c (option_table): 'error-verbose' is a new option.
21765 (shortopts): Update.
21766
217672001-11-27 Akim Demaille <akim@epita.fr>
21768
21769 * src/system.h: Use intl/libgettext.h.
21770 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
21771
217722001-11-27 Akim Demaille <akim@epita.fr>
21773
21774 * tests/torture.at (Exploding the Stack Size with Malloc):
21775 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
21776
217772001-11-27 Akim Demaille <akim@epita.fr>
21778
21779 * src/files.c: Include error.h.
21780 Reported by Hans Aberg.
21781
217822001-11-26 Marc Autret <autret_m@epita.fr>
21783
21784 * src/reader.c (parse_include_decl): New, not yet implemented.
21785 (read_declarations): Add case tok_include.
21786 * src/getargs.h (include): Add its extern definition.
21787 * src/getargs.c (include): New const char *.
21788 (getargs): Add case '-I'.
21789 * src/options.c (option_table): Add include as command line and
21790 percent option.
21791 * src/lex.h (token_t): Add tok_include.
21792
217932001-11-26 Akim Demaille <akim@epita.fr>
21794
21795 * src/reader.c (readgram): Make sure rules for mid-rule actions
21796 have a lineno equal to that of their host rule.
21797 Reported by Hans Aberg.
21798 * tests/regression.at (Rule Line Numbers): New.
21799
218002001-11-26 Akim Demaille <akim@epita.fr>
21801
21802 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
21803 size_ts.
21804
218052001-11-26 Akim Demaille <akim@epita.fr>
21806
21807 * src/complain.c, src/complain.h (error): Remove, provided by
21808 lib/error.[ch].
21809
218102001-11-26 Akim Demaille <akim@epita.fr>
21811
21812 * src/reader.c (read_declarations): Don't abort on tok_illegal,
21813 issue an error message.
21814 * tests/regression.at (Invalid %directive): New.
21815 Reported by Hans Aberg.
21816
218172001-11-26 Akim Demaille <akim@epita.fr>
21818
21819 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
21820 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
21821
218222001-11-26 Akim Demaille <akim@epita.fr>
21823
21824 * src/conflicts.c (conflicts_print): Don't complain at all when
21825 there are no reduce/reduce conflicts, and as many shift/reduce
21826 conflicts as expected.
21827 * tests/regression.at (%expect right): Adjust.
21828
218292001-11-23 Akim Demaille <akim@epita.fr>
21830
21831 * lib/alloca.c: Update, from fileutils.
21832
218332001-11-23 Akim Demaille <akim@epita.fr>
21834
21835 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
21836
218372001-11-23 Akim Demaille <akim@epita.fr>
21838
21839 * src/system.h: Include alloca.h.
21840 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
21841
218422001-11-23 Akim Demaille <akim@epita.fr>
21843
21844 * src/print_graph.c (print_actions): Remove `rule', unused.
21845 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
21846 pacify GCC's signed < unsigned warnings.
21847 * src/closure.c (itemsetsize): Likewise.
21848 * src/reader.c (symbol_list_new): Static.
21849
218502001-11-23 Akim Demaille <akim@epita.fr>
21851
21852 Attaching lineno to buckets is stupid, since only one copy of each
21853 symbol is kept, only the line of the first occurrence is kept too.
21854
21855 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
21856 * src/reader.c (rline_allocated): Remove, unused.
21857 (symbol_list): Have a `line' member.
21858 (symbol_list_new): New.
21859 (readgram): Use it.
21860 * src/print.c (print_grammar): Output the rule line numbers.
21861 * tests/regression.at (Solved SR Conflicts)
21862 (Unresolved SR Conflicts): Adjust.
21863 Reported by Hans Aberg.
21864
218652001-11-22 Marc Autret <autret_m@epita.fr>
21866
21867 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
21868
218692001-11-22 Marc Autret <autret_m@epita.fr>
21870
21871 * src/muscle_tab.c (muscle_init): Remove initialization of
21872 skeleton muscle.
21873 * src/output.c (output_master_parser): Do it here.
21874
218752001-11-20 Akim Demaille <akim@epita.fr>
21876
21877 * po/sv.po: New.
21878 * configure.in (ALL_LINGUAS): Adjust.
21879 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
21880 longer contains strings to translate.
21881
218822001-11-19 Akim Demaille <akim@epita.fr>
21883
21884 * src/conflicts.c (conflicts_print): Add a missing \n.
21885
218862001-11-19 Akim Demaille <akim@epita.fr>
21887
21888 * src/nullable.c (nullable_print): New.
21889 (set_nullable): Call it when tracing.
21890 Better locality of variables.
21891
218922001-11-19 Akim Demaille <akim@epita.fr>
21893
21894 * src/print.c (print_actions): Better locality of variables.
21895
218962001-11-19 Akim Demaille <akim@epita.fr>
21897
21898 * src/derives.c (print_derives): Fix and enrich.
21899 * src/closure.c (print_fderives): Likewise.
21900
219012001-11-19 Akim Demaille <akim@epita.fr>
21902
21903 * src/closure.c (itemsetend): Remove, replaced with...
21904 (itemsetsize): new.
21905
219062001-11-19 Akim Demaille <akim@epita.fr>
21907
21908 * src/LR0.c (kernel_end): Remove, replaced with...
21909 (kernel_size): new.
21910
219112001-11-19 Akim Demaille <akim@epita.fr>
21912
21913 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
21914 to clarify.
21915
219162001-11-19 Akim Demaille <akim@epita.fr>
21917
21918 * src/closure.c (closure): Use arrays instead of pointers to clarify.
21919
219202001-11-19 Akim Demaille <akim@epita.fr>
21921
21922 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
21923 trace messages.
21924 * src/LR0.c: Likewise.
21925 (allocate_itemsets): Use arrays instead of pointers to clarify.
21926
219272001-11-19 Akim Demaille <akim@epita.fr>
21928
21929 * src/getargs.c (statistics_flag): Replace with...
21930 (trace_flag): New.
21931 (longopts): Accept --trace instead of --statistics.
21932 * src/getargs.h, src/options.c: Adjust.
21933 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
21934 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
21935
219362001-11-19 Akim Demaille <akim@epita.fr>
21937
21938 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
21939 pointers to clarify the code.
21940 (save_reductions, save_shifts): Factor common parts of alternatives.
21941
219422001-11-19 Akim Demaille <akim@epita.fr>
21943
21944 * src/LR0.c (new_state, get_state): Complete TRACE code.
21945 * src/closure.c: Include `reader.h' to get `tags', needed by the
21946 trace code.
21947 Rename the conditional DEBUG as TRACE.
21948 Output consistently TRACEs to stderr, not stdout.
21949 * src/derives.c: Likewise.
21950 * src/reduce.c: (inaccessable_symbols): Using if is better style
21951 than goto.
21952 Use `#if TRACE' instead of `#if 0' for tracing code.
21953
219542001-11-19 Akim Demaille <akim@epita.fr>
21955
21956 * src/system.h (LIST_FREE, shortcpy): New.
21957 * src/LR0.c: Use them.
21958 * src/output.c (free_itemsets, free_reductions, free_shifts):
21959 Remove, replaced by LIST_FREE.
21960
219612001-11-19 Akim Demaille <akim@epita.fr>
21962
21963 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
21964 (REDUCTIONS_ALLOC): New.
21965 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
21966 allocation.
21967
219682001-11-19 Akim Demaille <akim@epita.fr>
21969
21970 * src/LR0.c (new_state): Complete trace code.
21971 * src/nullable.c (set_nullable): Don't translate traces.
21972
219732001-11-19 Akim Demaille <akim@epita.fr>
21974
21975 * src/print_graph.c (print_core): Better locality of variables.
21976 * src/print.c (print_core): Likewise.
21977
219782001-11-19 Akim Demaille <akim@epita.fr>
21979
21980 * src/vcg.c: You do the output, so you are responsible of the
21981 handling of VCG syntax, in particular: use quotearg.
21982 * src/print_graph.c: Don't.
21983 (print_actions): Don't output the actions as part of the nodes,
21984 since that's the job of the edges.
21985 (print_state): Don't output by hand: fill the node description,
21986 and ask for its output.
21987
219882001-11-19 Akim Demaille <akim@epita.fr>
21989
21990 * src/bison.simple (yyparse): When verbosely reporting an error,
21991 no longer put additional quotes around token names.
21992 * tests/calc.at: Adjust.
21993
219942001-11-19 Akim Demaille <akim@epita.fr>
21995
21996 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
21997 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
21998 * src/output.c: Adjust.
21999
220002001-11-19 Akim Demaille <akim@epita.fr>
22001
22002 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
22003 (rule_t): this.
22004 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
22005
220062001-11-19 Akim Demaille <akim@epita.fr>
22007
22008 * src/gram.h (rule_t): New.
22009 (rule_table): New.
22010 (rrhs, rlhs): Remove, part of state_t.
22011 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
22012 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
22013 * src/reader.c, src/reduce.c: Adjust.
22014
220152001-11-19 Akim Demaille <akim@epita.fr>
22016
22017 * src/reader.c (symbols_output): New, extracted from...
22018 (packsymbols): Here.
22019 (reader): Call it.
22020
220212001-11-19 Akim Demaille <akim@epita.fr>
22022
22023 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
22024 (maxrhs): this new function.
22025
220262001-11-19 Akim Demaille <akim@epita.fr>
22027
22028 * src/lalr.c (F): New macro to access the variable F.
22029 Adjust.
22030
220312001-11-19 Akim Demaille <akim@epita.fr>
22032
22033 * src/lalr.h (LA): New macro to access the variable LA.
22034 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22035 * src/lalr.c: Adjust.
22036
220372001-11-19 Akim Demaille <akim@epita.fr>
22038
22039 * src/lalr.c (initialize_LA): Only initialize LA. Let...
22040 (set_state_table): handle the `lookaheads' members.
22041
220422001-11-19 Akim Demaille <akim@epita.fr>
22043
22044 * src/lalr.h (lookaheads): Removed array, whose contents is now
22045 a member of...
22046 (state_t): this structure.
22047 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22048 Adjust.
22049
220502001-11-19 Akim Demaille <akim@epita.fr>
22051
22052 * src/lalr.h (consistent): Removed array, whose contents is now
22053 a member of...
22054 (state_t): this structure.
22055 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22056 Adjust.
22057
220582001-11-19 Akim Demaille <akim@epita.fr>
22059
22060 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
22061 contents are now members of...
22062 (state_t): this structure.
22063 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22064 Adjust.
22065
220662001-11-19 Akim Demaille <akim@epita.fr>
22067
22068 * src/lalr.h (state_t): New.
22069 (state_table): Be a state_t * instead of a core **.
22070 (accessing_symbol): Remove, part of state_t.
22071 * src/lalr.c: Adjust.
22072 (set_accessing_symbol): Merge into...
22073 (set_state_table): this.
22074 * src/print_graph.c, src/conflicts.c: Adjust.
22075
220762001-11-14 Akim Demaille <akim@epita.fr>
22077
22078 * tests/calc.at, tests/output.at, tests/regression.at,
22079 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
22080 now the tests are run in private dirs, therefore AC_CLEANUP and
22081 family can be simplified to 0-ary.
22082 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
22083 use abs. path to find config.h.
22084 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
22085 stderr, there can be way too much random noise.
22086 Instead pass -Werror to GCC and rely on the exit status.
22087 Reported by Wolfram Wagner.
22088
220892001-11-14 Akim Demaille <akim@epita.fr>
22090
22091 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
22092 defined only if yyoverflow is defined, to avoid `warning: unused
22093 variable `yyvs1''.
22094 Reported by The Test Suite.
22095
220962001-11-14 Akim Demaille <akim@epita.fr>
22097
22098 * src/print.c: Include reduce.h.
22099 Reported by Hans Aberg.
22100
221012001-11-14 Akim Demaille <akim@epita.fr>
22102
22103 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
22104 Revert a previous patch: these are really const.
22105 * src/conflicts.c (conflict_report): Additional useless pair of
22106 braces to pacify GCC's warnings for `if () if () {} else {}'.
22107 * src/lex.c (parse_percent_token): Replace equal_offset with
22108 arg_offset.
22109 arg is const.
22110 Be sure to strdup `arg' when used, since there is no reason for
22111 token_buffer not to change.
22112
221132001-11-14 Akim Demaille <akim@epita.fr>
22114
22115 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
22116 definition.
22117 * src/main.c (main): Use them.
22118 Suggested by Hans Aberg.
22119
221202001-11-12 Akim Demaille <akim@epita.fr>
22121
22122 * src/system.h (ngettext): Now that we use ngettext, be sure to
22123 provide a default definition when NLS are not used.
22124
221252001-11-12 Akim Demaille <akim@epita.fr>
22126
22127 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
22128 Use @kbd to denote user input.
22129 (Language and Grammar): ANSIfy the example.
22130 Adjust its layout for info/notinfo.
22131 (Location Tracking Calc): Output error messages to stderr.
22132 Output locations in a more GNUtically correct way.
22133 Fix a couple of Englishos.
22134 Adjust @group/@end group pairs.
22135
221362001-11-12 Akim Demaille <akim@epita.fr>
22137
22138 %expect was not functioning at all.
22139
22140 * src/conflicts.c (expected_conflicts): Set to -1.
22141 (conflict_report): Use ngettext.
22142 (conflicts_print): Check %expect and make its violation an error.
22143 * doc/bison.texinfo (Expect Decl): Adjust.
22144 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
22145 * tests/regression.at (%expect not enough, %expect right)
22146 (%expect too much): New.
22147
221482001-11-12 Akim Demaille <akim@epita.fr>
22149
22150 * tests/regression.at (Conflicts): Rename as...
22151 (Unresolved SR Conflicts): this.
22152 (Solved SR Conflicts): New.
22153
221542001-11-12 Akim Demaille <akim@epita.fr>
22155
22156 * src/reduce.c (print_results): Rename as...
22157 (reduce_output): This.
22158 Output to OUT, passed as argument, instead of output_obstack.
22159 (dump_grammar): Likewise.
22160 (reduce_free): New.
22161 Also free V1.
22162 (reduce_grammar): No longer call reduce_output, since...
22163 * src/print.c (print_results): do it.
22164 * src/main.c (main): Call reduce_free;
22165
221662001-11-12 Akim Demaille <akim@epita.fr>
22167
22168 * src/conflicts.c (print_reductions): Accept OUT as argument.
22169 Output to it, not to output_obstack.
22170 * src/print.c (print_actions): Adjust.
22171
221722001-11-12 Akim Demaille <akim@epita.fr>
22173
22174 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
22175 the result instead of using...
22176 (src_total, rrc_total, src_count, rrc_count): Remove.
22177 (any_conflicts): Remove.
22178 (print_conflicts): Split into...
22179 (conflicts_print, conflicts_output): New.
22180 * src/conflicts.h: Adjust.
22181 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
22182 * src/print.c (print_grammar): Issue `\n' between two rules.
22183 * tests/regression.at (Conflicts): New.
22184 Reported by Tom Lane.
22185
221862001-11-12 Akim Demaille <akim@epita.fr>
22187
22188 * tests/regression.at (Invalid input): Remove, duplicate with
22189 ``Invalid input: 1''.
22190
221912001-11-12 Akim Demaille <akim@epita.fr>
22192
22193 * tests/torture.at (AT_DATA_STACK_TORTURE)
22194 (Exploding the Stack Size with Alloca)
22195 (Exploding the Stack Size with Malloc): New.
22196
221972001-11-12 Akim Demaille <akim@epita.fr>
22198
22199 * src/bison.simple (YYSTACK_REALLOC): New.
22200 (yyparse) [!yyoverflow]: Use it and free the old stack.
22201 Reported by Per Allansson.
22202
222032001-11-12 Pascal Bart <pascal.bart@epita.fr>
22204
22205 * src/bison.simple: Define type yystype instead of YYSTYPE, and
22206 define CPP macro, which substitute YYSTYPE by yystype.
22207 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
22208 with yyltype/YYLTYPE. This allows inclusion of the generated
22209 header within the parser if the compiler, such as GGC, accepts
22210 multiple equivalent #defines.
22211 From Akim.
22212
222132001-11-05 Akim Demaille <akim@epita.fr>
22214
22215 * src/reader.c (symbols_output): New, extracted from...
22216 (packsymbols): here.
22217 (reader): Adjust.
22218
222192001-11-05 Akim Demaille <akim@epita.fr>
22220
22221 * src/lex.c (parse_percent_token): s/quotearg/quote/.
22222
222232001-11-05 Akim Demaille <akim@epita.fr>
22224
22225 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
22226 pattern.
22227
222282001-11-05 Akim Demaille <akim@epita.fr>
22229
22230 * src/options.h (struct option_table_struct): set_flags is void*.
22231 * src/options.c (longopts): Support `--output' and `%output'.
22232 (usage): Adjust.
22233 * src/lex.h (tok_setopt): Remove, replaced with...
22234 (tok_intopt, tok_stropt): these new guys.
22235 * src/lex.c (getopt.h): Not needed.
22236 (token_buffer, unlexed_token_buffer): Not const.
22237 (percent_table): Promote `-' over `_' in directive names.
22238 Active `%name-prefix', `file-prefix', and `output'.
22239 (parse_percent_token): Accept possible arguments to directives.
22240 Promote `-' over `_' in directive names.
22241
222422001-11-04 Akim Demaille <akim@epita.fr>
22243
22244 * doc/bison.texinfo (Decl Summary): Split the list into
22245 `directives for grammars' and `directives for bison'.
22246 Sort'em.
22247 Add description of `%name-prefix', `file-prefix', and `output'.
22248 Promote `-' over `_' in directive names.
22249 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
22250 Simplify the description of `--name-prefix'.
22251 Promote `-' over `_' in directive names.
22252 Promote `--output' over `--output-file'.
22253 Fix the description of `--defines'.
22254 * tests/output.at: Exercise %file-prefix and %output.
22255
222562001-11-02 Akim Demaille <akim@epita.fr>
22257
22258 * doc/refcard.tex: Update.
22259
222602001-11-02 Akim Demaille <akim@epita.fr>
22261
22262 * src/symtab.h (SUNDEF): New.
22263 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
22264 stand for `uninitialized', instead of 0.
22265 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
22266 * src/lex.c (lex): Adjust.
22267
22268 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
22269 Number it 0.
22270 Let yylex return it instead of a plain 0.
22271 Reported by Dick Streefland.
22272
222732001-11-02 Akim Demaille <akim@epita.fr>
22274
22275 * tests/regression.at (Mixing %token styles): New test.
22276
222772001-11-02 Akim Demaille <akim@epita.fr>
22278
22279 * src/reader.c (parse_thong_decl): Formatting changes.
22280 (token_translations_init): New, extracted from...
22281 (packsymbols): Here.
22282 Adjust.
22283
222842001-11-01 Akim Demaille <akim@epita.fr>
22285
22286 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
22287 Check that `9foo.y' produces correct cpp guards.
22288 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
22289 guards.
22290 Reported by Wwp.
22291
222922001-11-01 Akim Demaille <akim@epita.fr>
22293
22294 * tests/regression.at (Invalid input: 2): New.
22295 * src/lex.c (unlexed_token_buffer): New.
22296 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
22297 too.
22298 Reported by Wwp.
22299
223002001-11-01 Akim Demaille <akim@epita.fr>
22301
22302 * tests/calc.at: Catch up with 1.30.
22303 * configure.in: Bump to 1.49a.
22304 Adjust to newer Autotest.
22305
223062001-10-19 Pascal Bart <pascal.bart@epita.fr>
22307
22308 * src/conflicts.c: Move global variables rrc_total and src_total ...
22309 (print_conflicts): here.
22310 * src/output.c (output): Free global variable user_toknums.
22311 * src/lex.c (token_obstack): Become static.
22312
223132001-10-18 Akim Demaille <akim@epita.fr>
22314
22315 * tests/atlocal.in (GCC): Add.
22316 * tests/calc.at: s/m4_match/m4_bmatch/.
22317 s/m4_patsubst/m4_bpatsubst/.
22318 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
22319 * configure.in: AC_SUBST(GCC).
22320
223212001-10-14 Marc Autret <autret_m@epita.fr>
22322
22323 * src/options.c (create_long_option_table): Fix.
22324
223252001-10-10 Akim Demaille <akim@epita.fr>
22326
22327 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
22328
223292001-10-04 Akim Demaille <akim@epita.fr>
22330
22331 * src/reader.c (parse_union_decl): Push the caracters in
22332 union_obstack, not attrs_obstack.
22333
223342001-10-04 Akim Demaille <akim@epita.fr>
22335
22336 Merge in the branch 1.29.
22337
22338 * src/reader.c (packsymbols): Use a temporary obstack for
22339 `%%tokendef', since output_stack is already used elsewhere.
22340
22341 2001-10-02 Akim Demaille <akim@epita.fr>
22342
22343 Bump 1.29d.
22344
22345 2001-10-02 Akim Demaille <akim@epita.fr>
22346
22347 Version 1.29c.
22348
22349 2001-10-02 Akim Demaille <akim@epita.fr>
22350
22351 * tests/regression.at (Invalid CPP headers): New.
22352 From Alexander Belopolsky.
22353 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
22354
22355 2001-10-02 Akim Demaille <akim@epita.fr>
22356
22357 * tests/regression.at (Invalid input): New.
22358 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
22359 Reported by Shura.
22360
22361 2001-10-02 Akim Demaille <akim@epita.fr>
22362
22363 * tests/calc.at: Now that --debug works, the tests must be adjusted.
22364
22365 2001-10-02 Akim Demaille <akim@epita.fr>
22366
22367 * src/output.c (output_parser): Assert `skeleton'.
22368 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
22369 systems.
22370 From Shura.
22371
22372 2001-10-01 Marc Autret <autret_m@epita.fr>
22373
22374 * src/lex.h: Echo modifications.
22375 * src/lex.c (unlex): Parameter is now token_t.
22376 From Hans Aberg.
22377
22378 2001-10-01 Marc Autret <autret_m@epita.fr>
22379
22380 * src/main.c: Include lex.h.
22381 From Hans Aberg.
22382
22383 2001-09-29 Akim Demaille <akim@epita.fr>
22384
22385 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
22386
22387 2001-09-28 Akim Demaille <akim@epita.fr>
22388
22389 * tests/testsuite.at: Update to newer Autotest.
22390 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
22391
22392 2001-09-27 Akim Demaille <akim@epita.fr>
22393
22394 Position independent wrapper.
22395
22396 * tests/bison: Remove.
22397 * tests/bison.in: New.
22398 * configure.in: Adjust.
22399
22400 2001-09-27 Paul Eggert <eggert@twinsun.com>
22401
22402 Port quotearg fixes from tar 1.13.24.
22403
22404 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
22405 tm to be declared.
22406 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
22407 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
22408
22409 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
22410 * m4/mbrtowc.m4: New file.
22411 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
22412 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
22413
22414 2001-09-27 Akim Demaille <akim@epita.fr>
22415
22416 Bump to 1.29c.
22417
22418 2001-09-27 Akim Demaille <akim@epita.fr>
22419
22420 Version 1.29b.
22421
22422 2001-09-25 Akim Demaille <akim@epita.fr>
22423
22424 * src/system.h: Include `xalloc.h'.
22425 Remove it from the C files.
22426 * src/files.c (output_files): Free the obstacks.
22427 * src/lex.c (init_lex): Rename as...
22428 (lex_init): this.
22429 (lex_free): New.
22430 * src/main.c (main): Use it.
22431
22432 2001-09-24 Marc Autret <autret_m@epita.fr>
22433
22434 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
22435 to output informations in fout (FILE*).
22436 (open_graph, close_graph): Likewise.
22437 (output_graph, output_edge, output_node): Likewise.
22438 * src/vcg.h: Update function prototypes.
22439 * src/print_graph.c (print_graph): Open output graph file.
22440 (print_actions): Adjust.
22441 * src/files.h: Remove extern declaration.
22442 * src/files.c: Remove graph_obstack declaration.
22443 (open_files): Remove graph_obstack initialization.
22444 (output_files): Remove graph_obstack saving.
22445
22446 2001-09-24 Marc Autret <autret_m@epita.fr>
22447
22448 * src/files.c (compute_output_file_names): Fix.
22449
22450 2001-09-24 Marc Autret <autret_m@epita.fr>,
22451 Akim Demaille <akim@epita.fr>
22452
22453 * src/reader.c (reader): Remove call to free_symtab ().
22454 * src/main.c (main): Call it here.
22455 Include symtab.h.
22456 * src/conflicts.c (initialize_conflicts): Rename as...
22457 (solve_conflicts): this.
22458 * src/print.c (print_core, print_actions, print_state)
22459 (print_grammar): Dump to a file instead a `output_obstack'.
22460 (print_results): Dump `output_obstack', and then proceed with the
22461 FILE *.
22462 * src/files.c (compute_output_file_names, close_files): New.
22463 (output_files): Adjust.
22464 * src/main.c (main): Adjust.
22465
22466 2001-09-23 Marc Autret <autret_m@epita.fr>
22467
22468 * src/files.c (compute_header_macro): Computes header macro name
22469 from spec_defines_file when given.
22470
22471 2001-09-23 Marc Autret <autret_m@epita.fr>
22472
22473 * src/files.c (output_files): Add default extensions.
22474
22475 2001-09-22 Akim Demaille <akim@epita.fr>
22476
22477 * src/conflicts.c (finalize_conflicts): Rename as...
22478 (free_conflicts): this.
22479
22480 2001-09-22 Akim Demaille <akim@epita.fr>
22481
22482 * src/gram.c (gram_free): Rename back as...
22483 (dummy): this.
22484 (output_token_translations): Free `token_translations'.
22485 * src/symtab.c (free_symtab): Free the tag field.
22486
22487 2001-09-22 Akim Demaille <akim@epita.fr>
22488
22489 Remove `translations' as it is always set to true.
22490
22491 * src/gram.h: Adjust.
22492 * src/reader.c (packsymbols, parse_token_decl): Adjust
22493 * src/print.c (print_grammar): Adjust.
22494 * src/output.c (output_token_translations): Adjust.
22495 * src/lex.c (lex): Adjust.
22496 * src/gram.c: Be sure the set pointers to NULL.
22497 (dummy): Rename as...
22498 (gram_free): this.
22499
22500 2001-09-22 Akim Demaille <akim@epita.fr>
22501
22502 * configure.in: Invoke AM_LIB_DMALLOC.
22503 * src/system.h: Use dmalloc.
22504 * src/LR0.c: Be sure to have pointers initialized to NULL.
22505 (allocate_itemsets): Allocate kernel_items only if needed.
22506
22507 2001-09-22 Akim Demaille <akim@epita.fr>
22508
22509 * configure.in: Bump to 1.29b.
22510 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
22511 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
22512 need xmalloc.c in calc.y.
22513 From Pascal Bart.
22514
22515 2001-09-21 Akim Demaille <akim@epita.fr>
22516
22517 Version 1.29a.
22518 * Makefile.maint, config/config.guess, config/config.sub,
22519 * config/missing: Update from masters.
22520 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
22521 upon package.m4.
22522 * configure.in (ALL_LINGUAS): Add `tr'.
22523
22524 2001-09-21 Akim Demaille <akim@epita.fr>
22525
22526 * tests/Makefile.am (package.m4): Move to...
22527 ($(srcdir)/$(TESTSUITE)): here.
22528
22529 2001-09-20 Akim Demaille <akim@epita.fr>
22530
22531 * src/complain.c: No longer try to be standalone: use system.h.
22532 Don't assume __STDC__ is defined to 1. Just test if it is defined.
22533 * src/complain.h: Likewise.
22534 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
22535 Remove the unused variable `n'.
22536 From Albert Chin-A-Young.
22537
22538 2001-09-18 Marc Autret <autret_m@epita.fr>
22539
22540 * doc/bison.1: Update.
22541 * doc/bison.texinfo (Bison Options): Update --defines and --graph
22542 descriptions.
22543 (Option Cross Key): Update.
22544 Add --graph.
22545
22546 2001-09-18 Marc Autret <autret_m@epita.fr>
22547
22548 * tests/regression.at: New test (comment in %union).
22549
22550 2001-09-18 Marc Autret <autret_m@epita.fr>
22551
22552 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
22553 do that.
22554 Reported by Keith Browne.
22555
22556 2001-09-18 Marc Autret <autret_m@epita.fr>
22557
22558 * tests/output.at: Add tests for --defines and --graph.
22559
22560 2001-09-18 Marc Autret <autret_m@epita.fr>
22561
22562 * tests/output.at: Removes tests of %{header,src}_extension features.
22563
22564 2001-09-18 Akim Demaille <akim@epita.fr>
22565
22566 * tests/Makefile.am (package.m4): New.
22567 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
22568 (_AT_CHECK_CALC_ERROR): Likewise.
22569 Factor the `, ' part of verbose error messages.
22570
22571 2001-09-18 Marc Autret <autret_m@epita.fr>
22572
22573 * src/getargs.c (longopts): Declare --defines and --graph as options
22574 with optional arguments.
22575 * src/files.h: Add extern declarations.
22576 * src/files.c (spec_graph_file, spec_defines_file): New.
22577 (output_files): Update.
22578 Remove CPP-outed code.
22579
22580 2001-09-18 Marc Autret <autret_m@epita.fr>
22581
22582 Turn off %{source,header}_extension feature.
22583
22584 * src/files.c (compute_exts_from_gf): Update.
22585 (compute_exts_from_src): Update.
22586 (output_files): CPP-out useless code.
22587 * src/files.h: Remove {header,source}_extension extern declarations.
22588 * src/reader.c (parse_dquoted_param): CPP-out.
22589 (parse_header_extension_decl): Remove.
22590 (parse_source_extension_decl): Remove.
22591 (read_declarations): Remove cases tok_{hdrext,srcext}.
22592 * src/lex.c (percent_table): Remove {header,source}_extension entries.
22593 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
22594
22595 2001-09-10 Akim Demaille <akim@epita.fr>
22596
22597 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
22598 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
22599 (AT_CHECK_OUTPUT): this.
22600 Merely check ls' exit status, its output is useless.
22601
22602 2001-09-10 Akim Demaille <akim@epita.fr>
22603
22604 * tests/calc.at: Use m4_match.
22605 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
22606
22607 2001-09-10 Marc Autret <autret_m@epita.fr>,
22608 Akim Demaille <akim@epita.fr>
22609
22610 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
22611 enum color_e.
22612 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
22613 to `normal'.
22614 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
22615 * src/lex.h: Adjust prototype.
22616 (token_t): Add `tok_undef'.
22617 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
22618 (parse_percent_token): Now returns token_t.
22619 Add default statement in switch.
22620 (lex): Separate `c' as an input variable, from the token_t result
22621 part.
22622 (unlexed): Is a token_t.
22623
22624 2001-09-10 Akim Demaille <akim@epita.fr>
22625
22626 * configure.in: Bump to 1.29a.
22627
22628 2001-09-07 Akim Demaille <akim@epita.fr>
22629
22630 Version 1.29.
22631
22632 2001-08-30 Akim Demaille <akim@epita.fr>
22633
22634 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
22635 * m4/atconfig.m4: Remove.
22636 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
22637 * tests/bison: New.
22638 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
22639 m4_if, m4_patsubst, and m4_regexp.
22640 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
22641 `input' file instead of echo.
22642
22643 2001-08-29 Akim Demaille <akim@epita.fr>
22644
22645 Bump to 1.28e.
22646
22647 2001-08-29 Akim Demaille <akim@epita.fr>
22648
22649 Version 1.28d.
22650
22651 2001-08-29 Paul Eggert <eggert@twinsun.com>
22652
22653 * src/bison.simple (yyparse): Don't take the address of an
22654 item before the start of an array, as that doesn't conform to
22655 the C Standard.
22656
22657 2001-08-29 Robert Anisko <anisko_r@epita.fr>
22658
22659 * doc/bison.texinfo (Location Tracking Calc): New node.
22660
22661 2001-08-29 Paul Eggert <eggert@twinsun.com>
22662
22663 * src/output.c (output): Do not define const, as this now
22664 causes more problems than it cures.
22665
22666 2001-08-29 Akim Demaille <akim@epita.fr>
22667
22668 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
22669 the nodes.
22670 Be sure to tag the `detailmenu'.
22671
22672 2001-08-29 Akim Demaille <akim@epita.fr>
22673
22674 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
22675 download in a tmp dir.
22676
22677 2001-08-28 Marc Autret <autret_m@epita.fr>
22678
22679 * config/depcomp: New file.
22680
22681 2001-08-28 Marc Autret <autret_m@epita.fr>
22682
22683 * doc/bison.1 (mandoc): Adjust.
22684 From Juan Manuel Guerrero.
22685
22686 2001-08-28 Marc Autret <autret_m@epita.fr>
22687
22688 * src/print_graph.c (print_state): Fix.
22689
22690 2001-08-27 Marc Autret <autret_m@epita.fr>
22691
22692 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
22693 char * members.
22694 Echo modifications to the functions prototypes.
22695 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
22696
22697 2001-08-27 Marc Autret <autret_m@epita.fr>
22698
22699 * src/vcg.c: Include `xalloc.h'.
22700 (add_colorentry): New.
22701 (add_classname): New.
22702 (add_infoname): New.
22703 * src/vcg.h: Add new prototypes.
22704
22705 2001-08-27 Akim Demaille <akim@epita.fr>
22706
22707 * Makefile.maint: Sync. again with CVS Autoconf.
22708
22709 2001-08-27 Akim Demaille <akim@epita.fr>
22710
22711 * Makefile.maint: Formatting changes.
22712 (po-update, cvs-update, update): New targets.
22713 (AMTAR): Remove.
22714
22715 2001-08-27 Akim Demaille <akim@epita.fr>
22716
22717 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22718 * Makefile.maint: Sync. with CVS Autoconf.
22719
22720 2001-08-27 Marc Autret <autret_m@epita.fr>
22721
22722 * src/vcg.h (struct infoname_s): New.
22723 (struct colorentry_s): New.
22724 (graph_s): New fields {vertical,horizontal}_order in structure.
22725 Add `infoname' field.
22726 Add `colorentry' field;
22727 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
22728 (G_HORIZONTAL_ORDER): New.
22729 (G_INFONAME): New.
22730 (G_COLORENTRY): New.
22731 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
22732 Add output of `infoname'.
22733 Add output of `colorentry'.
22734
22735 2001-08-27 Marc Autret <autret_m@epita.fr>
22736
22737 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
22738 This one shadowed a global parameter.
22739
22740 2001-08-24 Marc Autret <autret_m@epita.fr>
22741
22742 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
22743 instead of `unsigned'.
22744 (print_state): Do not call obstack_object_size () in obstack_grow ()
22745 to avoid macro variables shadowing.
22746
22747 2001-08-23 Marc Autret <autret_m@epita.fr>
22748
22749 * src/lex.c (percent_table): Typo: s/naem/name/.
22750 Add graph option.
22751 Normalize new options declarations.
22752
22753 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
22754
22755 * tests/suite.at: Exercise %header_extension and %source_extension.
22756
22757 2001-08-16 Marc Autret <autret_m@epita.fr>
22758
22759 * src/reader.c (parse_dquoted_param): New.
22760 (parse_header_extension_decl): Use it.
22761 (parse_source_extension_decl): Likewise.
22762
22763 2001-08-16 Marc Autret <autret_m@epita.fr>
22764
22765 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
22766 (get_xxxx_str): Use assert () instead of complain ().
22767 Remove return invokations in default cases.
22768 (get_decision_str): Modify default behaviour. Remove second argument.
22769 Echo modifications on calls.
22770 (output_graph): Fix.
22771
22772 2001-08-16 Marc Autret <autret_m@epita.fr>
22773
22774 * src/getargs.c (usage): Update with ``-g, --graph''.
22775
22776 2001-08-16 Marc Autret <autret_m@epita.fr>
22777
22778 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
22779 (Option Cross Key): Likewise.
22780 * doc/bison.1: Update.
22781
227822001-09-25 Pascal Bart <pascal.bart@epita.fr>
22783
22784 * src/output.c (output_master_parser): Don't finish action_obstack.
22785 (output_parser): Don't care about the muscle action, here.
22786 (prepare): Copy the action_obstack in the action muscle.
22787 (output): Free action_obstack.
22788
227892001-09-23 Pascal Bart <pascal.bart@epita.fr>
22790
22791 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
22792 will contain `%union' declaration.
22793 (parse_union_decl): Delete #line directive output.
22794 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
22795 informations about %union.
22796 (parse_union_decl): Copy the union_obstack in the muscle stype.
22797 * src/bison.simple: Add new #line directive.
22798 Add typdef %%stype YYSTYPE.
22799
228002001-09-23 Pascal Bart <pascal.bart@epita.fr>
22801
22802 * src/bison.simple: Add new `#line' directive.
22803
228042001-09-22 Pascal Bart <pascal.bart@epita.fr>
22805
22806 * src/bison.simple: New `#line' directive.
22807 * src/output.c (output_parser): Support new dynamic muscle input_line.
22808
228092001-09-22 Marc Autret <autret_m@epita.fr>
22810
22811 * src/output.c (output_master_parser): New.
22812 (output_parser): Be more re-entrant.
22813
228142001-09-21 Marc Autret <autret_m@epita.fr>
22815
22816 * src/reader.c (copy_definition, parse_union_decl): Update and use
22817 `linef' muscle.
22818 (copy_action): Likewise.
22819 Use obstack_1grow ().
22820 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
22821
228222001-09-21 Marc Autret <autret_m@epita.fr>
22823
22824 * src/options.c (option_table): Adjust.
22825 * src/lex.c (parse_percent_token): Fix.
22826
228272001-09-20 Pascal Bart <pascal.bart@epita.fr>
22828
22829 * src/options.c (symtab.h): Include it, need by lex.h.
22830
228312001-09-20 Pascal Bart <pascal.bart@epita.fr>
22832
22833 * src/lex.c (parse_percent_token): Change type of variable `tx', which
22834 is now an option_table_struct*.
22835 (option_strcmp): New function option_strcmp.
22836 (parse_percent_token): Call option_strcmp.
22837 * src/getargs.c (xalloc.h, options.h): Include it.
22838 (getargs): Call create_long_option_table.
22839 (getargs): Free longopts at the end of the function.
22840 (shortopts): Move in options.c.
22841 * src/options.c (create_long_option_table): New function. Convert
22842 information from option_table to option structure.
22843 * src/reader.c (options.h): Include it.
22844
22845 * src/Makefile.am: Adjust.
22846 * src/options.c (option_table): Create from longopts and percent_table.
22847 * src/getargs.c (longopts): Delete.
22848 * src/lex.c (struct percent_table_struct): Delete.
22849 (percent_table): Delete.
22850 (options.h): Include it.
22851 * src/options.c: Create.
22852 * src/options.h: Create.
22853 Declare enum opt_access_e.
22854 Define struct option_table_struct.
22855
228562001-09-20 Marc Autret <autret_m@epita.fr>
22857
22858 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
22859 sections of Bison.
22860
228612001-09-19 Pascal Bart <pascal.bart@epita.fr>
22862
22863 * src/bison.simple: s/%%filename/%%skeleton.
22864 * src/muscle_tab.c (getargs.h): Include it.
22865 (muscle_init): Insert new muscle skeleton.
22866
228672001-09-18 Pascal Bart <pascal.bart@epita.fr>
22868
22869 * src/output.c (output_parser): Delete unused variable actions_dumped.
22870
228712001-09-07 Pascal Bart <pascal.bart@epita.fr>
22872
22873 * src/output.c (output): Delete call to reader_output_yylsp.
22874 * src/reader.c (reader): Likewise.
22875 * src/reader.h: Delete declaration of reader_output_yylsp.
22876
228772001-09-02 Marc Autret <autret_m@epita.fr>
22878
22879 * src/reader.c: Include muscle_tab.h.
22880 (parse_union_decl): Update.
22881 (parse_macro_decl): Rename parse_muscle_decl.
22882 Update to use renamed functions and variable.
22883 (read_declarations, copy_action, read_additionnal_code, : Updated
22884 with correct variables and functions names.
22885 (packsymbols, reader): Likewise.
22886
22887 * src/reader.h (muscle_obstack): Extern declaration update.
22888
22889 * src/output.c: Include muscle_tab.h
22890 In all functions using macro_insert, change by using muscle_insert ().
22891 (macro_obstack): Rename muscle_obstack.
22892 Echo modifications in the whole file.
22893 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
22894 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
22895 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
22896
22897 * src/muscle_tab.h: Update double inclusion macros.
22898 (macro_entry_s): Rename muscle_entry_s.
22899 Update prototypes.
22900
22901 * src/muscle_tab.c: Include muscle_tab.h.
22902 Rename macro_tabble to muscle_table.
22903 (mhash1, mhash2, mcmp): Use muscle_entry.
22904 (macro_init): Rename muscle_init. Update.
22905 (macro_insert): Rename muscle_insert. Update.
22906 (macro_find): Rename muscle_find. Update.
22907
22908 * src/main.c: Include muscle_tab.h.
22909 (main): Call muscle_init ().
22910 * src/Makefile.am (bison_SOURCES): Echo modifications.
22911
229122001-09-02 Marc Autret <autret_m@epita.fr>
22913
22914 Now the files macro_tab.[ch] are named muscle_tab.[ch].
22915
22916 * src/muscle_tab.c, src/muscle_tab.h: Add files.
22917
229182001-09-02 Marc Autret <autret_m@epita.fr>
22919
22920 * src/macrotab.c, src/macrotab.h: Remove.
22921
229222001-09-01 Pascal Bart <pascal.bart@epita.fr>
22923
22924 * src/reader.c (copy_guard): Use muscle to specify the `#line'
22925 filename.
22926
229272001-09-01 Marc Autret <autret_m@epita.fr>
22928
22929 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
22930 to an explicit value to activate the feature. We do it here.
22931
229322001-08-31 Pascal Bart <pascal.bart@epita.fr>
22933
22934 * src/output.c (prepare): Delete the `filename' muscule insertion.
22935 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
22936 (parse_union_decl): Likewise.
22937 * src/macrotab.c (macro_init): Initialize filename by infile.
22938
229392001-08-31 Marc Autret <autret_m@epita.fr>
22940
22941 * src/bison.simple (YYLSP_NEEDED): New definition.
22942 * src/output.c (prepare): Add macro insertion of `locations_flag'
22943
229442001-08-31 Pascal Bart <pascal.bart@epita.fr>
22945
22946 * src/output.c (prepare): Delete insertion of previous muscles,
22947 and insert the `prefix' muscles.
22948 * src/macrotab.c (macro_init): Likewise.
22949 (macro_init): Initialization prefix directive by `yy'.
22950 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
22951 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
22952 yylval, yydebug, yyerror, yynerrs and yyparse.
22953 New directive `#define' to substitute yydebug, ... with option
22954 name_prefix.
22955
229562001-08-31 Pascal Bart <pascal.bart@epita.fr>
22957
22958 * src/main.c (main): Standardize.
22959 * src/output.c (output_table_data, output_parser): Likewise.
22960 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
22961
229622001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
22963
22964 * src/reader.c (read_additionnal_code): Rename %%user_code to
22965 %%epilogue.
22966 * src/output.c (output): Rename %%declarations to %%prologue.
22967 * src/bison.simple: Echo modifications.
22968
229692001-08-31 Marc Autret <autret_m@epita.fr>
22970
22971 * src/reader.c (readgram): CleanUp.
22972 (output_token_defines): Likewise.
22973 (packsymbols): Likewise.
22974 (reader): Likewise.
22975 * src/output.c (output): CPP-out useless code.
22976
229772001-08-31 Pascal Bart <pascal.bart@epita.fr>
22978
22979 * src/reader.c (reader): Delete obsolete call to function
22980 output_trailers and output_headers.
22981 * src/output.h: Remove obsolete functions prototypes of output_headers
22982 and output_trailers.
22983
229842001-08-30 Pascal Bart <pascal.bart@epita.fr>
22985
22986 * src/main.c: Include macrotab.h.
22987 * src/macrotab.h (macro_entry_s): Constify fields.
22988 Adjust functions prototypes.
22989 * src/macrotab.c (macro_insert): Constify key and value.
22990 (macro_find): Constify key.
22991 (macro_insert): Include 'xalloc.h'
22992 (macro_insert): Use XMALLOC.
22993 (macro_find): Constify return value.
22994 * src/output.c (output_table_data): Rename table to table_data.
22995 (output_parser): Constify macro_key, macro_value.
22996
229972001-08-30 Marc Autret <autret_m@epita.fr>
22998
22999 * src/reader.c (parse_skel_decl): New.
23000 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
23001 * src/lex.h (token_t): New token `tok_skel'.
23002 * src/lex.c (percent_table): Add skeleton option entry.
23003 Standardize.
23004
230052001-08-29 Marc Autret <autret_m@epita.fr>
23006
23007 * src/bison.simple: Add %%user_code directive at the end.
23008 * src/reader.c (read_additionnal_code): New.
23009 (reader): Use it.
23010 * src/output.c (output_program): Remove.
23011 (output): Update.
23012
230132001-08-28 Marc Autret <autret_m@epita.fr>
23014
23015 * src/output.c (output_actions): Clean up.
23016 (output_gram): CPP-out useless code.
23017 * src/reader.c (reader): Clean up, CPP-out useless code.
23018
230192001-08-28 Pascal Bart <pascal.bart@epita.fr>
23020
23021 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
23022 directive.
23023 * src/bison.simple: Add `%%definitions'.
23024
230252001-08-28 Marc Autret <autret_m@epita.fr>
23026
23027 * config/depcomp: New file.
23028
230292001-08-27 Paul Eggert <eggert@twinsun.com>
23030
23031 * src/bison.simple (yyparse): Don't take the address of an
23032 item before the start of an array, as that doesn't conform to
23033 the C Standard.
23034
230352001-08-27 Robert Anisko <robert.anisko@epita.fr>
23036
23037 * src/output.c (output): Remove the initialization of the macro
23038 obstack. It was done too late here.
23039
23040 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
23041 completely wrong.
23042 (reader): Initialize the macro obstack here, since we need it to grow
23043 '%define' directives.
23044
23045 * src/reader.h: Declare the macro obstack as extern.
23046
230472001-08-27 Robert Anisko <robert.anisko@epita.fr>
23048
23049 * src/output.c (output_parser): Fix. Store single '%' characters in
23050 the output obstack instead of throwing them away.
23051
230522001-08-27 Akim Demaille <akim@epita.fr>
23053
23054 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23055
230562001-08-25 Robert Anisko <robert.anisko@epita.fr>
23057
23058 * lib/Makefile.am: Adjust.
23059
230602001-08-25 Robert Anisko <robert.anisko@epita.fr>
23061
23062 * src/bison.simple: Update and add '%%' directives.
23063
230642001-08-25 Robert Anisko <robert.anisko@epita.fr>
23065
23066 * src/reader.c (reader): Remove calls to 'output_headers' and
23067 'output_trailers'. Remove some C output.
23068 (readgram): Disable a piece of code that was writing a default
23069 definition for 'YYSTYPE'.
23070 (reader_output_yylsp): Remove.
23071 (packsymbols): Output token defintions to a macro.
23072 (copy_definition): Disable C output.
23073
23074 * src/reader.c (parse_macro_decl): New function used to parse macro
23075 declarations.
23076 (copy_string2): Put the body of copy_string into this new function.
23077 Add a parameter to let the caller choose whether he wants to copy the
23078 string delimiters or not.
23079 (copy_string): Be a simple call to copy_string2 with the last argument
23080 bound to true.
23081 (read_declarations): Add case for macro definition.
23082 (copy_identifier): New.
23083 (parse_macro_decl): Read macro identifiers using copy_identifier
23084 rather than lex.
23085
230862001-08-25 Robert Anisko <robert.anisko@epita.fr>
23087
23088 * src/output.c (prepare): Add prefixed names.
23089 (output_parser): Output semantic actions.
23090 (output_parser): Fix bug on '%%line' directives.
23091
23092 * src/output.c (output_headers): Remove. The C code printed by this
23093 function should now be in the skeletons.
23094 (output_trailers): Remove.
23095 (output): Disable call to 'reader_output_yylsp'.
23096 (output_rule_data): Do not output tables to the table obstack.
23097
23098 * src/output.c: Remove some C dedicated output.
23099 Improve the use of macro and output obstacks.
23100 (output_defines): Remove.
23101
23102 * src/output.c (output_token_translations): Associate 'translate'
23103 table with a macro. No output to the table obstack.
23104 (output_gram): Same for 'rhs' and 'prhs'.
23105 (output_stos): Same for 'stos'.
23106 (output_rule_data): Same for 'r1' and 'r2'.
23107 (token_actions): Same for 'defact'.
23108 (goto_actions): Same for 'defgoto'.
23109 (output_base): Same for 'pact' and 'pgoto'.
23110 (output_table): Same for 'table'.
23111 (output_check): Same for 'check'.
23112
23113 * src/output.c (output_table_data): New function.
23114 (output_short_table): Remove.
23115 (output_short_or_char_table): Remove.
23116
23117 * src/output.c (output_parser): Replace most of the skeleton copy code
23118 with something new. Skeletons are now processed character by character
23119 rather than line by line, and Bison looks for '%%' macros. This is the
23120 first step in making Bison's output process (a lot) more flexible.
23121 (output_parser): Use the macro table.
23122
231232001-08-25 Robert Anisko <robert.anisko@epita.fr>
23124
23125 * src/main.c (main): Initialize the macro table.
23126
231272001-08-25 Robert Anisko <robert.anisko@epita.fr>
23128
23129 * src/lex.c (percent_table): Add tok_define.
23130 * src/lex.h: Add tok_define.
23131
231322001-08-25 Robert Anisko <robert.anisko@epita.fr>
23133
23134 * src/macrotab.c: New file.
23135 * src/macrotab.h: New file.
23136 * src/Makefile.am: Update.
23137
231382001-08-25 Robert Anisko <robert.anisko@epita.fr>
23139
23140 * lib/hash.c: New file.
23141 * lib/hash.h: New file.
23142 * lib/Makefile.am: Update.
23143
231442001-08-15 Akim Demaille <akim@epita.fr>
23145
23146 Version 1.28c.
23147
231482001-08-15 Marc Autret <autret_m@epita.fr>
23149
23150 * src/reader.c (readgram): Indent output macro YYSTYPE.
23151 (packsymbols): Likewise.
23152 (output_token_defines): Likewise.
23153 * src/files.c: Standardize.
23154 (compute_header_macro): New.
23155 (defines_obstack_save): New. Use compute_header_macro.
23156 (output_files): Update. Use defines_obstack_save.
23157
231582001-08-15 Akim Demaille <akim@epita.fr>
23159
23160 * doc/bison.texinfo (Table of Symbols): Document
23161 YYSTACK_USE_ALLOCA.
23162
231632001-08-15 Akim Demaille <akim@epita.fr>
23164
23165 * missing: Update from CVS Automake.
23166 * config/config.guess, config/config.sub, config/texinfo.tex:
23167 Update from gnu.org.
23168
231692001-08-15 Akim Demaille <akim@epita.fr>
23170
23171 * Makefile.maint: Sync with CVS Autoconf.
23172
231732001-08-14 Pascal Bart <pascal.bart@epita.fr>
23174
23175 * doc/bison.texinfo: Include GNU Free Documentation License from
23176 `fdl.texi'.
23177 * doc/fdl.texi: Add to package.
23178
231792001-08-14 Marc Autret <autret_m@epita.fr>
23180
23181 Turn on %{source,header}_extension features.
23182
23183 * src/lex.c (percent_table): Un-CPP out header_extension and
23184 source_extension.
23185 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
23186 (compute_exts_from_src): Remove conditions. It restores priorities
23187 between options.
23188
231892001-08-14 Marc Autret <autret_m@epita.fr>
23190
23191 * src/files.c (compute_base_names): Add extensions computing when
23192 `--file-prefix' used.
23193 Standardize function calls.
23194
231952001-08-13 Marc Autret <autret_m@epita.fr>
23196
23197 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
23198 defining it (defined but null disables alloca).
23199
232002001-08-13 Marc Autret <autret_m@epita.fr>
23201
23202 * src/bison.simple (_yy_memcpy): CPP reformat.
23203
232042001-08-13 Pascal Bart <pascal.bart@epita.fr>
23205
23206 * tests/atconfig.in (CPPFLAGS): Fix.
23207
232082001-08-10 Pascal Bart <pascal.bart@epita.fr>
23209
23210 * doc/bison.texinfo: Include GNU General Public License from
23211 `gpl.texi'.
23212 * doc/gpl.texi: Add to package.
23213
232142001-08-10 Marc Autret <autret_m@epita.fr>
23215
23216 * src/print_graph.h: Fix.
23217 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
23218
232192001-08-10 Akim Demaille <akim@epita.fr>
23220
23221 * src/system.h: Provide default declarations for stpcpy, strndup,
23222 and strnlen.
23223
232242001-08-10 Robert Anisko <anisko_r@epita.fr>
23225
23226 * doc/bison.texinfo (Locations): Update @$ stuff.
23227
232282001-08-09 Robert Anisko <anisko_r@epita.fr>
23229
23230 * src/bison.simple (YYLLOC_DEFAULT): Update.
23231 (yyparse): Adjust.
23232
232332001-08-08 Marc Autret <autret_m@epita.fr>
23234
23235 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
23236 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
23237 Reported by Fabrice Bauzac.
23238
232392001-08-08 Marc Autret <autret_m@epita.fr>
23240
23241 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
23242 * src/vcg.c (output_node): Fix.
23243 * src/vcg.h: Cleanup.
23244 * src/print_graph.c: Add comments.
23245 (node_output_size): New global variable. Simplify the formatting of
23246 the VCG graph output.
23247 (print_actions): Unused code is now used. It notifies the final state
23248 and no action states in the VCG graph. It also give the reduce actions.
23249 The `shift and goto' edges are red and the `go to state' edges are
23250 blue.
23251 Get the current node name and node_obstack by argument.
23252 (node_obstack): New variable.
23253 (print_state): Manage node_obstack.
23254 (print_core): Use node_obstack given by argument.
23255 A node is not only computed here but in print_actions also.
23256 (print_graph): CPP out useless code instead of commenting it.
23257
232582001-08-07 Pascal Bart <pascal.bart@epita.fr>
23259
23260 * tests/atconfig.in (CPPFLAGS): Fix.
23261
232622001-08-07 Akim Demaille <akim@epita.fr>
23263
23264 * src/print_graph.c (quote): New.
23265 (print_core): Use it.
23266
232672001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
23268
23269 * src/vcg.c (complain.h): Include it.
23270 Unepitaize `return' invocations.
23271 [NDEBUG] (main): Remove.
23272 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
23273 * src/files.c (open_files): Initialize graph_obstack.
23274 * src/print_graph.c (print_actions): CPP out useless code.
23275 (print_core): Don't output the last `\n' in labels.
23276 Use `quote'.
23277 * src/files.c (output_files): Output the VCG file.
23278 * src/main.c (main): Invoke print_graph ();
23279
232802001-08-06 Marc Autret <autret_m@epita.fr>
23281
23282 Automaton VCG graph output.
23283 Using option ``-g'' or long option ``--graph'', you can generate
23284 a gram_filename.vcg file containing a VCG description of the LALR (1)
23285 automaton of your grammar.
23286
23287 * src/main.c: Call to print_graph() function.
23288 * src/getargs.h: Update.
23289 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
23290 (graph_flag): New flag.
23291 (longopts): Update.
23292 (getargs): Add case `g'.
23293 * src/files.c (graph_obstack): New obstack struct.
23294 (open_files): Initialize new obstack.
23295 (output_files): Saves graph_obstack if required.
23296 * src/files.h (graph_obstack): New extern declaration.
23297 * src/Makefile.am: Add new source files.
23298
232992001-08-06 Marc Autret <autret_m@epita.fr>
23300
23301 * src/print_graph.c, src/print_graph.h (graph): New.
23302 * src/vcg.h: New file.
23303 * src/vcg.c: New file, VCG graph handling.
23304
233052001-08-06 Marc Autret <autret_m@epita.fr>
23306
23307 Add of %source_extension and %header_extension which specify
23308 the source or/and the header output file extension.
23309
23310 * src/files.c (compute_base_names): Remove initialisation of
23311 src_extension and header_extension.
23312 (compute_exts_from_gf): Update.
23313 (compute_exts_from_src): Update.
23314 (output_files): Update.
23315 * src/reader.c (parse_header_extension_decl): New.
23316 (parse_source_extension_decl): New.
23317 (read_declarations): New case statements for the new tokens.
23318 * src/lex.c (percent_table): Add entries for %source_extension
23319 and %header_extension.
23320 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
23321
233222001-08-06 Marc Autret <autret_m@epita.fr>
23323
23324 * configure.in: Bump to 1.28c.
23325 * doc/bison.texinfo: Texinfo thingies.
23326
233272001-08-04 Pascal Bart <pascal.bart@epita.fr>
23328
23329 * tests/atconfig.in (CPPFLAGS): Add.
23330 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
23331
233322001-08-03 Akim Demaille <akim@epita.fr>
23333
23334 Version 1.28b.
23335
233362001-08-03 Akim Demaille <akim@epita.fr>
23337
23338 * tests/Makefile.am (check-local): Ship testsuite.
23339 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
23340 Include `string.h'.
23341
233422001-08-03 Akim Demaille <akim@epita.fr>
23343
23344 * configure.in: Try using -Wformat when compiling.
23345
233462001-08-03 Akim Demaille <akim@epita.fr>
23347
23348 * configure.in: Bump to 1.28b.
23349
233502001-08-03 Akim Demaille <akim@epita.fr>
23351
23352 * src/complain.c: Adjust strerror_r portability issues.
23353
233542001-08-03 Akim Demaille <akim@epita.fr>
23355
23356 Version 1.28a.
23357
233582001-08-03 Akim Demaille <akim@epita.fr>
23359
23360 * src/getargs.c, src/getarg.h (skeleton)): Constify.
23361 * src/lex.c (literalchar): Avoid name clashes on `buf'.
23362 * src/getargs.c: Include complain.h.
23363 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
23364 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
23365
233662001-08-03 Akim Demaille <akim@epita.fr>
23367
23368 * src/reader.c (readgram): Display hidden chars in error messages.
23369
233702001-08-03 Akim Demaille <akim@epita.fr>
23371
23372 Update to gettext 0.10.39.
23373
233742001-08-03 Akim Demaille <akim@epita.fr>
23375
23376 * lib/strspn.c: New.
23377
233782001-08-01 Marc Autret <autret_m@epita.fr>
23379
23380 * doc/bison.texinfo: Update.
23381 * doc/bison.1 (mandoc): Update.
23382 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
23383 * src/files.c: Support output files extensions computing.
23384 (src_extension): New static variable.
23385 (header_extension): New static variable.
23386 (tr): New function.
23387 (get_extension_index): New function, gets the index of an extension
23388 filename in a string.
23389 (compute_exts_from_gf): New function, computes extensions from the
23390 grammar file extension.
23391 (compute_exts_from_src): New functions, computes extensions from the
23392 C source file extension, file given by ``-o'' option.
23393 (compute_base_names): Update.
23394 (output_files): Update.
23395
233962001-08-01 Robert Anisko <anisko_r@epita.fr>
23397
23398 * doc/bison.texi: Document @$.
23399 (Locations): New section.
23400
234012001-07-18 Akim Demaille <akim@epita.fr>
23402
23403 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
23404 * config/prev-version.txt, config/move-if-change: New.
23405 * Makefile.am: Adjust.
23406
234072001-07-08 Pascal Bart <pascal.bart@epita.fr>
23408
23409 * src/bison.simple (yyparse): Suppress warning `comparaison
23410 between signed and unsigned'.
23411
234122001-07-05 Pascal Bart <pascal.bart@epita.fr>
23413
23414 * src/getargs.h (raw_flag): Remove.
23415 * src/getargs.c: Die on `-r'/`--raw'.
23416 * src/lex.c (parse_percent_token): Die on `%raw'.
23417 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
23418 * tests/calc.at: Suppress test with option `--raw'.
23419
234202001-07-14 Akim Demaille <akim@epita.fr>
23421
23422 * config/: New.
23423 * configure.in: Require Autoconf 2.50.
23424 Update to gettext 0.10.38.
23425
234262001-03-16 Akim Demaille <akim@epita.fr>
23427
23428 * doc/bison.texinfo: ANSIfy the examples.
23429
234302001-03-16 Akim Demaille <akim@epita.fr>
23431
23432 * getargs.c (skeleton): New variable.
23433 (longopts): --skeleton is a new option.
23434 (shortopts, getargs): -S is a new option.
23435 * getargs.h: Declare skeleton.
23436 * output.c (output_parser): Use it.
23437
234382001-03-16 Akim Demaille <akim@epita.fr>
23439
23440 * m4/strerror_r.m4: New.
23441 * m4/error.m4: Run AC_FUNC_STRERROR_R.
23442 * lib/error.h, lib/error.c: Update.
23443
234442001-03-16 Akim Demaille <akim@epita.fr>
23445
23446 * src/getargs.c (longopts): Clean up.
23447
234482001-02-21 Akim Demaille <akim@epita.fr>
23449
23450 * src/reader.c (gensym): `gensym_count' is your own.
23451 Use a static buf to create the symbol name, as token_buffer is no
23452 longer a buffer.
23453
234542001-02-08 Akim Demaille <akim@epita.fr>
23455
23456 * src/conflicts.c (conflict_report): Be sure not to append to res
23457 between two calls, which could happen if both first sprintf were
23458 skipped, but not the first cp += strlen.
23459
234602001-02-08 Akim Demaille <akim@epita.fr>
23461
23462 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
23463 New, from fileutils 4.0.37.
23464 * configure.in: Require Autoconf 2.49c. I took some time before
23465 making this decision. This is the only way out for portability
23466 issues in Bison, it would mean way too much duplicate effort to
23467 import in Bison features implemented in 2.49c since 2.13.
23468 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
23469
234702001-02-02 Akim Demaille <akim@epita.fr>
23471
23472 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
23473 * lib/xalloc.h, lib/xmalloc.c: Update.
23474
234752001-01-19 Akim Demaille <akim@epita.fr>
23476
23477 Get rid of the ad hoc handling of token_buffer in the scanner: use
23478 the obstacks.
23479
23480 * src/lex.c (token_obstack): New.
23481 (init_lex): Initialize it. No longer call...
23482 (grow_token_buffer): this. Remove it.
23483 Adjust all the places which used it to use the obstack.
23484
234852001-01-19 Akim Demaille <akim@epita.fr>
23486
23487 * src/lex.h: Rename all the tokens:
23488 s/\bENDFILE\b/tok_eof/g;
23489 s/\bIDENTIFIER\b/tok_identifier/g;
23490 etc.
23491 Let them be enums, not #define, to ease debugging.
23492 Adjust all the code.
23493
234942001-01-18 Akim Demaille <akim@epita.fr>
23495
23496 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
23497 * src/lex.c (maxtoken, grow_token_buffer): Static.
23498
234992001-01-18 Akim Demaille <akim@epita.fr>
23500
23501 Since we now use obstacks, more % directives can be enabled.
23502
23503 * src/lex.c (percent_table): Also accept `%yacc',
23504 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
23505 `%debug'.
23506 Handle the actions for `%semantic_parser' and `%pure_parser' here,
23507 instead of returning a token.
23508 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
23509 * src/reader.c (read_declarations): Adjust.
23510 * src/files.c (open_files): Don't call `compute_base_names', don't
23511 compute `attrsfile' since they depend upon data which might be
23512 *in* the input file now.
23513 (output_files): Do it here.
23514 * src/output.c (output_headers): Document the fact that this patch
23515 introduces a guaranteed SEGV for semantic parsers.
23516 * doc/bison.texinfo: Document them.
23517 * tests/suite.at: Exercise these %options.
23518
235192000-12-20 Akim Demaille <akim@epita.fr>
23520
23521 Also handle the output file (--verbose) with obstacks.
23522
23523 * files.c (foutput): Remove.
23524 (output_obstack): New.
23525 Adjust all dependencies.
23526 * src/conflicts.c: Return a string.
23527 * src/system.h (obstack_grow_string): Rename as...
23528 (obstack_sgrow): this. Be ready to work with non literals.
23529 (obstack_fgrow4): New.
23530
235312000-12-20 Akim Demaille <akim@epita.fr>
23532
23533 * src/files.c (open_files): Fix the computation of short_base_name
23534 in the case of `-o foo.tab.c'.
23535
235362000-12-20 Akim Demaille <akim@epita.fr>
23537
23538 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
23539 (copy_dollar): Now that everything uses obstacks, get rid of the
23540 FILE * parameters.
23541
235422000-12-20 Akim Demaille <akim@epita.fr>
23543
23544 * src/files.c (open_files): Actually the `.output' file is based
23545 on the short_base_name, not base_name.
23546 * tests/suite.at (Checking output file names): Adjust.
23547
235482000-12-20 Akim Demaille <akim@epita.fr>
23549
23550 * src/bison.s1: Remove, we now use directly...
23551 * src/bison.simple: this.
23552 * src/Makefile.am: Use pkgdata instead of data.
23553
235542000-12-20 Akim Demaille <akim@epita.fr>
23555
23556 * src/files.c (guard_obstack): New.
23557 (open_files): Initialize it.
23558 (output_files): Dump it...
23559 * src/files.h: Export it.
23560 * src/reader.c (copy_guard): Use it.
23561
235622000-12-19 Akim Demaille <akim@epita.fr>
23563
23564 * src/files.c (outfile, defsfile, actfile): Removed as global
23565 vars.
23566 (open_files): Don't compute them.
23567 (output_files): Adjust.
23568 (base_name, short_base_name): Be global.
23569 Adjust dependencies.
23570
235712000-12-19 Akim Demaille <akim@epita.fr>
23572
23573 * src/files.c (strsuffix): New.
23574 (stringappend): Be just like strcat but allocate.
23575 (base_names): Eve out from open_files.
23576 Try to simplify the rather hairy computation of base_name and
23577 short_base_name.
23578 (open_files): Use it.
23579 * tests/suite.at (Checking output file names): New test.
23580
235812000-12-19 Akim Demaille <akim@epita.fr>
23582
23583 * src/system.h (obstack_grow_literal_string): Rename as...
23584 (obstack_grow_string): this.
23585 * src/output.c (output_parser): Recognize `%% actions' instead of
23586 `$'.
23587 * src/bison.s1: s/$/%% actions/.
23588 * src/bison.hairy: Likewise.
23589
235902000-12-19 Akim Demaille <akim@epita.fr>
23591
23592 * src/output.c (output_parser): Compute the `#line' lines when
23593 there are.
23594 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
23595 Suggested by Hans Aberg.
23596
235972000-12-19 Akim Demaille <akim@epita.fr>
23598
23599 Let the handling of the skeleton files be local to the procedures
23600 that use it.
23601
23602 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
23603 longer static.
23604 (fparser, open_extra_files): Remove.
23605 (open_files, output_files): Don't take care of fparser.
23606 * src/files.h: Adjust.
23607 * src/output.c (output_parser): Open and close the file to the
23608 skeleton.
23609 * src/reader.c (read_declarations): When %semantic_parser, open
23610 fguard.
23611
236122000-12-19 Akim Demaille <akim@epita.fr>
23613
23614 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
23615 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
23616
236172000-12-19 Akim Demaille <akim@epita.fr>
23618
23619 * src/files.c (open_files): Yipee! We no longer need all the code
23620 looking for `/tmp' since we have no tmp file.
23621
236222000-12-19 Akim Demaille <akim@epita.fr>
23623
23624 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
23625 New macros.
23626 * src/files.c (open_files): Less dependency on MSDOS etc.
23627
236282000-12-14 Akim Demaille <akim@epita.fr>
23629
23630 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
23631 Provide a default definition.
23632 Use it when executing the default @ action.
23633 * src/reader.c (reader_output_yylsp): No longer include
23634 `timestamp' and `text' in the default YYLTYPE.
23635
236362000-12-12 Akim Demaille <akim@epita.fr>
23637
23638 * src/reader.c (copy_definition, parse_union_decl, copy_action)
23639 (copy_guard): Quote the file names.
23640 Reported by Laurent Mascherpa.
23641
236422000-12-12 Akim Demaille <akim@epita.fr>
23643
23644 * src/output.c (output_headers, output_program, output): Be sure
23645 to escape special characters when outputting filenames.
23646 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
23647 (output_headers): Don't depend on them, Use ACTSTR.
23648
236492000-11-17 Akim Demaille <akim@epita.fr>
23650
23651 * lib/obstack.h: Formatting changes.
23652 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
23653 prevents type checking.
23654 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
23655 cast the value to (void *): assigning a `foo *' to a `void *'
23656 variable is valid.
23657 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
23658 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
23659 append characters.
23660
236612000-11-17 Akim Demaille <akim@epita.fr>
23662
23663 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
23664 as...
23665 (suite.m4, regression.m4, calc.m4): these.
23666 * tests/atgeneral.m4: Update from CVS Autoconf.
23667
236682000-11-17 Akim Demaille <akim@epita.fr>
23669
23670 * tests/regression.m4 (%union and --defines): New test,
23671 demonstrating a current bug in the obstack implementation.
23672
236732000-11-17 Akim Demaille <akim@epita.fr>
23674
23675 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
23676 macros.
23677 Use them to declare the variables which are global or local to
23678 `yyparse'.
23679
236802000-11-17 Akim Demaille <akim@epita.fr>
23681
23682 * acconfig.h: Remove, no longer used.
23683
236842000-11-07 Akim Demaille <akim@epita.fr>
23685
23686 * src: s/Copyright (C)/Copyright/g.
23687
236882000-11-07 Akim Demaille <akim@epita.fr>
23689
23690 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
23691 defining.
23692 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
23693
236942000-11-07 Akim Demaille <akim@epita.fr>
23695
23696 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
23697 Merge in a single CPP if/else.
23698
236992000-11-07 Akim Demaille <akim@epita.fr>
23700
23701 * src/output.c (output): Remove useless variables.
23702 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
23703 argument `data' for consistency with the prototypes.
23704 Qualify it `const'.
23705 (obstack_copy, obstack_copy0): Rename the second argument as
23706 `address' for consistency. Qualify it `const'.
23707 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
23708 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
23709 `const' their input argument (`data' or `address').
23710 Adjust the corresponding macros to include `const' in casts.
23711
237122000-11-03 Akim Demaille <akim@epita.fr>
23713
23714 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
23715 s/PFILE1/BISON_HAIRY/.
23716 Adjust dependencies.
23717
237182000-11-03 Akim Demaille <akim@epita.fr>
23719
23720 For some reason, this was not applied.
23721
23722 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23723 `unlink': it's no longer used.
23724
237252000-11-03 Akim Demaille <akim@epita.fr>
23726
23727 * src/files.c (skeleton_find): New function, eved out of...
23728 (open_files, open_extra_files): here.
23729
237302000-11-03 Akim Demaille <akim@epita.fr>
23731
23732 Don't use `atexit'.
23733
23734 * src/files.c (obstack_save): New function.
23735 (done): Rename as...
23736 (output_files): this.
23737 Use `obstack_save'.
23738 * src/main.c (main): Don't use `atexit' to register `done', since
23739 it no longer has to remove tmp files, just call `output_files'
23740 when there are no errors.
23741
237422000-11-02 Akim Demaille <akim@epita.fr>
23743
23744 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23745 `unlink': it's no longer used.
23746 * src/files.h: Formatting changes.
23747
237482000-11-02 Akim Demaille <akim@epita.fr>
23749
23750 Remove the last uses of mktemp and unlink/delete.
23751
23752 * src/files.c (fdefines, ftable): Removed.
23753 (defines_ostack, table_obstack): New.
23754 Adjust dependencies of the former into uses of the latter.
23755 * src/output.c (output_short_or_char_table, output_short_table):
23756 Convert to using obstacks.
23757 * src/reader.c (copy_comment2): Accept one FILE * and two
23758 obstacks.
23759 (output_token_defines, reader_output_yylsp): Use obstacks.
23760 * src/system.h (obstack_fgrow3): New.
23761 * po/POTFILES.in: Adjust.
23762
237632000-11-01 Akim Demaille <akim@epita.fr>
23764
23765 Change each use of `fattrs' into a use of `attrs_obstack'.
23766
23767 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
23768 * src/files.c (fattrs): Remove.
23769 (attrs_obstack): New.
23770 Adjust all dependencies.
23771 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
23772
237732000-11-01 Akim Demaille <akim@epita.fr>
23774
23775 Introduce obstacks.
23776 Change each use of `faction' into a use of `action_obstack'.
23777
23778 * lib/obstack.h, lib/obstack.c: New files.
23779 * src/files.c (faction): Remove.
23780 (action_obstack): New.
23781 Adjust all dependencies.
23782
237832000-10-20 Akim Demaille <akim@epita.fr>
23784
23785 * lib/quote.h (PARAMS): New macro. Use it.
23786
237872000-10-16 Akim Demaille <akim@epita.fr>
23788
23789 * src/output.c (output_short_or_char_table): New function.
23790 (output_short_table, output_token_translations): Use it.
23791 (goto_actions): Use output_short_table.
23792
237932000-10-16 Akim Demaille <akim@epita.fr>
23794
23795 * src/symtab.c (bucket_new): New function.
23796 (getsym): Use it.
23797
23798 * src/output.c (output_short_table): New argument to display the
23799 comment associated with the table.
23800 Adjust dependencies.
23801 (output_gram): Use it.
23802 (output_rule_data): Nicer output layout for YYTNAME.
23803
238042000-10-16 Akim Demaille <akim@epita.fr>
23805
23806 * src/lex.c (read_typename): New function.
23807 (lex): Use it.
23808 * src/reader.c (copy_dollar): Likewise.
23809
238102000-10-16 Akim Demaille <akim@epita.fr>
23811
23812 * src/reader.c (copy_comment2): Expect the input stream to be on
23813 the `/' which is suspected to open a comment, instead of being
23814 called after `//' or `/*' was read.
23815 (copy_comment, copy_definition, parse_union_decl, copy_action)
23816 (copy_guard): Adjust.
23817
238182000-10-16 Akim Demaille <akim@epita.fr>
23819
23820 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
23821 `read_signed_integer'.
23822
238232000-10-16 Akim Demaille <akim@epita.fr>
23824
23825 * src/reader.c (copy_dollar): New function.
23826 (copy_guard, copy_action): Use it.
23827
238282000-10-16 Akim Demaille <akim@epita.fr>
23829
23830 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
23831 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
23832 New files, from Fileutils 4.0.27.
23833 * src/main.c (printable_version): Remove.
23834 * src/lex.c, src/reader.c: Use `quote'.
23835
238362000-10-04 Akim Demaille <akim@epita.fr>
23837
23838 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
23839
238402000-10-04 Akim Demaille <akim@epita.fr>
23841
23842 * doc/bison.texinfo: Various typos spotted by Neil Booth.
23843
238442000-10-04 Akim Demaille <akim@epita.fr>
23845
23846 When a literal string is used to define two different tokens,
23847 `bison -v' segfaults.
23848 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
23849
23850 * tests/regression.m4: New file.
23851 Include the core of the sample provided by Piotr Gackiewicz.
23852 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
23853 properly.
23854
238552000-10-04 Akim Demaille <akim@epita.fr>
23856
23857 * src/reader.c (parse_expect_decl): Keep `count' within the size
23858 of `buffer'.
23859 From Neil Booth.
23860
238612000-10-02 Paul Eggert <eggert@twinsun.com>
23862
23863 * bison.s1 (yyparse): Assign the default value
23864 unconditionally, to avoid a GCC warning and make the parser a
23865 tad smaller.
23866
238672000-10-02 Akim Demaille <akim@epita.fr>
23868
23869 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
23870 options.
23871
238722000-10-02 Akim Demaille <akim@epita.fr>
23873
23874 * src/derives.c, src/print.c, src/reduce.c: To ease the
23875 translation, move some `\n' out of the translated strings.
23876
238772000-10-02 Akim Demaille <akim@epita.fr>
23878
23879 The location tracking mechanism is precious for parse error
23880 messages. Nevertheless, it is enabled only when `@n' is used in
23881 the grammar, which is a different issue (you can use it in error
23882 message, but not in the grammar per se). Therefore, there should
23883 be another means to enable it.
23884
23885 * src/getargs.c (getargs): Support `--locations'.
23886 (usage): Report it.
23887 * src/getargs.h (locationsflag): Export it.
23888 * src/lex.c (percent_table): Support `%locations'.
23889 * src/reader.c (yylsp_needed): Remove this variable, now replaced
23890 with `locationsflag'.
23891 * doc/bison.texinfo: Document `--locations' and `%locations'.
23892 Sort the options.
23893 * tests/calc.m4: Test it.
23894
23895 For regularity of the names, replace each
23896 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
23897 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
23898 In addition replace each `flag' with `_flag'.
23899
239002000-10-02 Akim Demaille <akim@epita.fr>
23901
23902 Also test parse error messages, including with YYERROR_VERBOSE.
23903
23904 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
23905 associative).
23906 Use it to check the computations.
23907 Use it to check `nonassoc' is honored.
23908 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
23909 `--yyerror-verbose'.
23910 (_AT_CHECK_CALC): Adjust to this option.
23911 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
23912
239132000-10-02 Akim Demaille <akim@epita.fr>
23914
23915 Test also `--verbose', `--defines' and `--name-prefix'. Testing
23916 the latter demonstrates a flaw in the handling of non debugging
23917 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
23918 was used in order to simplify:
23919
23920 #if YYDEBUG
23921 if (yydebug)
23922 {
23923 ...
23924 }
23925 #endif
23926
23927 into
23928
23929 if (yydebug)
23930 {
23931 ...
23932 }
23933
23934 unfortunately this leads to a CPP conflict when
23935 `--name-prefix=foo' is used since it produces `#define yydebug
23936 foodebug'.
23937
23938 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
23939 (YYDPRINTF): New macro.
23940 Spread its use.
23941 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
23942 the bison options.
23943 Also test `--verbose', `--defines' and `--name-prefix'.
23944
239452000-10-02 Akim Demaille <akim@epita.fr>
23946
23947 Improve the readability of the produced parsers.
23948
23949 * src/bison.s1: Formatting changes.
23950 Improve the comment related to the `$' mark.
23951 (yydefault): Don't fall through to `yyresume': `goto' there.
23952 * src/output.c (output_parser): When the `$' is met, skip the end
23953 of its line.
23954 New variable, `number_of_dollar_signs', to check there's exactly
23955 one `$' in the parser skeleton.
23956
239572000-10-02 Akim Demaille <akim@epita.fr>
23958
23959 * lib/xstrdup.c: New file, from the fileutils.
23960 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
23961 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
23962 instead of strlen + xmalloc + strcpy.
23963 * src/symtab.c (copys): Remove, use xstrdup instead.
23964
239652000-10-02 Akim Demaille <akim@epita.fr>
23966
23967 * src/gram.h (associativity): New enum type which replaces the
23968 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
23969 `right_assoc', `left_assoc' and `non_assoc'.
23970 Adjust all dependencies.
23971 * src/reader.c: Formatting changes.
23972 (LTYPESTR): Don't define it, use it as a literal in
23973 `reader_output_yylsp'.
23974 * src/symtab.h (symbol_class): New enum type which replaces the
23975 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
23976 `sunknown', `stoken and `snterm'.
23977
239782000-10-02 Akim Demaille <akim@epita.fr>
23979
23980 * src/getargs.c (fixed_outfiles): Rename as...
23981 (yaccflag): for consistency and accuracy.
23982 Adjust dependencies.
23983
239842000-10-02 Akim Demaille <akim@epita.fr>
23985
23986 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
23987 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
23988 difficult and introduced a lot of core dump. It turns out that
23989 Bison used an implementation of `xmalloc' based on `calloc', and
23990 at various places it does depend upon the initialization to 0. I
23991 have not tried to isolate the pertinent places, and all the former
23992 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
23993 someone should address this issue.
23994
23995 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
23996 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
23997 files.
23998 Adjust dependencies.
23999 * src/warshall.h: New file.
24000 Propagate.
24001
240022000-10-02 Akim Demaille <akim@epita.fr>
24003
24004 Various anti-`extern in *.c' changes.
24005
24006 * src/system.h: Include `assert.h'.
24007
240082000-10-02 Akim Demaille <akim@epita.fr>
24009
24010 * src/state.h (nstates, final_state, first_state, first_shift)
24011 (first_reduction): Move their exportation from here...
24012 * src/LR0.h: to here.
24013 Adjust dependencies.
24014 * src/getargs.c (statisticsflag): New variable.
24015 Add support for `--statistics'.
24016 Adjust dependencies.
24017
24018 Remove a lot of now useless `extern' statements in most files.
24019
240202000-10-02 Akim Demaille <akim@epita.fr>
24021
24022 * src/LR0.h: New file.
24023 Propagate its use.
24024
240252000-10-02 Akim Demaille <akim@epita.fr>
24026
24027 * src/print.h: New file.
24028 Propagate its use.
24029 * src/print.c: Formatting and ordering changes.
24030 (verbose, terse): Replace with...
24031 (print_results): this new function.
24032 Adjust dependencies.
24033
240342000-10-02 Akim Demaille <akim@epita.fr>
24035
24036 * src/conflicts.c (conflict_report): New function.
24037 (conflict_log, verbose_conflict_log): Replace with...
24038 (print_conflicts): this function.
24039 Adjust dependencies.
24040 * src/conflicts.h: New file.
24041 Propagate its inclusion.
24042
240432000-10-02 Akim Demaille <akim@epita.fr>
24044
24045 * src/nullable.h: New file.
24046 Propagate its inclusion.
24047 * src/nullable.c: Formatting changes.
24048
240492000-10-02 Akim Demaille <akim@epita.fr>
24050
24051 * src/reduce.h: New file.
24052 Propagate its inclusion.
24053 * src/reduce.c: Topological sort and other formatting changes.
24054 (bool, TRUE, FALSE): Move their definition to...
24055 * src/system.h: here.
24056
240572000-10-02 Akim Demaille <akim@epita.fr>
24058
24059 * src/files.c: Formatting changes.
24060 (tryopen, tryclose, openfiles): Rename as...
24061 (xfopen, xfclose, open_files): this.
24062 (stringappend): static.
24063 * src/files.h: Complete the list of exported symbols.
24064 Propagate its use.
24065
240662000-10-02 Akim Demaille <akim@epita.fr>
24067
24068 * src/reader.h: New file.
24069 Propagate its use instead of tedious list of `extern' and
24070 prototypes.
24071 * src/reader.c: Formatting changes, topological sort,
24072 s/register//.
24073
240742000-10-02 Akim Demaille <akim@epita.fr>
24075
24076 * src/lex.h: Prototype `lex.c' exported functions.
24077 * src/reader.c: Adjust.
24078 * src/lex.c: Formatting changes.
24079 (safegetc): Rename as...
24080 (xgetc): this.
24081
240822000-10-02 Akim Demaille <akim@epita.fr>
24083
24084 * src/lalr.h: New file.
24085 Propagate its inclusion instead of prototypes and `extern'.
24086 * src/lalr.c: Formatting changes, topological sorting etc.
24087
240882000-10-02 Akim Demaille <akim@epita.fr>
24089
24090 * src/output.c (token_actions): Introduce a temporary array,
24091 YYDEFACT, that makes it possible for this function to use
24092 output_short_table.
24093
240942000-10-02 Akim Demaille <akim@epita.fr>
24095
24096 `user_toknums' is output as a `short[]' in `output.c', while it is
24097 defined as a `int[]' in `reader.c'. For consistency with the
24098 other output tables, `user_toknums' is now defined as a table of
24099 shorts.
24100
24101 * src/reader.c (user_toknums): Be a short table instead of an int
24102 table.
24103 Adjust dependencies.
24104
24105 Factor the short table outputs.
24106
24107 * src/output.c (output_short_table): New function.
24108 * src/output.c (output_gram, output_stos, output_rule_data)
24109 (output_base, output_table, output_check): Use it.
24110
241112000-10-02 Akim Demaille <akim@epita.fr>
24112
24113 * src/output.c (output): Topological sort of the functions, in
24114 order to get rid of the `static' prototypes.
24115 No longer use `register'.
24116 * src/output.h: New file.
24117 Propagate its inclusion in files explicitly prototyping functions
24118 from output.c.
24119
241202000-09-21 Akim Demaille <akim@epita.fr>
24121
24122 * src/atgeneral.m4: Update from Autoconf.
24123
241242000-09-21 Akim Demaille <akim@epita.fr>
24125
24126 * src/closure.h: New file.
24127 * src/closure.c: Formatting changes, topological sort over the
24128 functions, use of closure.h.
24129 (initialize_closure, finalize_closure): Rename as...
24130 (new_closure, free_closure): these. Adjust dependencies.
24131 * src/LR0.c: Formatting changes, topological sort, use of
24132 cloture.h.
24133 (initialize_states): Rename as...
24134 (new_states): this.
24135 * src/Makefile.am (noinst_HEADERS): Adjust.
24136
241372000-09-20 Akim Demaille <akim@epita.fr>
24138
24139 * src/acconfig.h: Don't protect config.h against multiple
24140 inclusion.
24141 Don't define PARAMS.
24142 * src/system.h: Define PARAMS.
24143 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
24144 purpose of config.h. system.h must not try to fix wrong
24145 definitions in config.h.
24146
241472000-09-20 Akim Demaille <akim@epita.fr>
24148
24149 * src/derives.h: New file.
24150 * src/main.c, src/derives.h: Use it.
24151 Formatting changes.
24152 * src/Makefile.am (noinst_HEADERS): Adjust.
24153
241542000-09-20 Akim Demaille <akim@epita.fr>
24155
24156 * tests/atgeneral.m4: Update from Autoconf.
24157 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
24158 (AT_CHECK_CALC): New macros.
24159 Use these macros to test bison with options `', `--raw',
24160 `--debug', `--yacc', `--yacc --debug'.
24161
241622000-09-19 Akim Demaille <akim@epita.fr>
24163
24164 * src/output.c: Formatting changes.
24165 * src/machine.h: Remove, leaving its contents in...
24166 * src/system.h: here.
24167 Include stdio.h.
24168 Adjust all dependencies on stdio.h and machine.h.
24169 * src/getargs.h: New file.
24170 Let all `extern' declarations about getargs.c be replaced with
24171 inclusion of `getargs.h'.
24172 * src/Makefile.am (noinst_HEADERS): Adjust.
24173
24174 * tests/calc.m4 (yyin): Be initialized in main, not on the global
24175 scope.
24176 (yyerror): Returns void, not int.
24177 * doc/bison.texinfo: Formatting changes.
24178
241792000-09-19 Akim Demaille <akim@epita.fr>
24180
24181 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
24182 portable.
24183
241842000-09-18 Akim Demaille <akim@epita.fr>
24185
24186 * configure.in: Append WARNING_CFLAGS to CFLAGS.
24187 * src/Makefile.am (INCLUDES): Don't.
24188 Be ready to fetch headers in lib/.
24189
241902000-09-18 Akim Demaille <akim@epita.fr>
24191
24192 * doc/bison.texinfo: Update the copyright.
24193 ANSIfy and GNUify the examples.
24194 Remove the old menu.
24195
241962000-09-18 Akim Demaille <akim@epita.fr>
24197
24198 First set of tests: use the `calc' example from the documentation.
24199
24200 * src/bison.s1 (yyparse): Condition the code using `yytname' which
24201 is defined only when YYDEBUG is.
24202 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
24203 * src/files.c (tryopen, tryclose): Formatting changes.
24204 Move to the top and be static.
24205 * src/reader.c (read_signed_integer): Likewise.
24206 * tests/calc.m4: New file.
24207 * Makefile.am, suite.m4: Adjust.
24208 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
24209
242102000-09-18 Akim Demaille <akim@epita.fr>
24211
24212 Add support for an Autotest test suite for Bison.
24213
24214 * m4/m4.m4, m4/atconfig.m4: New files.
24215 * m4/Makefile.am (EXTRA_DIST): Adjust.
24216 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
24217 files.
24218 * src/getargs.c: Display a more standard --version message.
24219 * src/reader.c (reader): Formatting changes.
24220 No longer depend upon VERSION_STRING.
24221 * configure.in: No longer use `dnl'.
24222 Set up the test suite and the new directory `tests/.
24223 (VERSION_STRING): Remove.
24224
242252000-04-14 Akim Demaille <akim@epita.fr>
24226
24227 * src/reader.c (copy_comment2): New function, same as former
24228 `copy_comment', but outputs into two FILE *.
24229 (copy_comment): Use it.
24230 (parse_union_decl): Use it.
24231 (get_type, parse_start_decl): Use the same `invalid' message.
24232 (parse_start_decl, parse_union_decl): Use the same `multiple'
24233 message.
24234 (parse_union_decl, copy_guard, copy_action): Use the same
24235 `unmatched' message.
24236 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
24237
242382000-03-31 Akim Demaille <akim@epita.fr>
24239
24240 * src/files.c (tryopen, tryclose): Move to the top.
24241 Be static.
24242
242432000-03-31 Akim Demaille <akim@epita.fr>
24244
24245 * src/main.c (main): Don't call `done', exit does it.
24246
242472000-03-31 Akim Demaille <akim@epita.fr>
24248
24249 * allocate.c: s/return (foo)/return foo/.
24250 * lalr.c: Likewise.
24251 * LR0.c: Likewise.
24252 * output.c: Likewise.
24253 * reader.c: Likewise.
24254 * symtab.c: Likewise.
24255 * vmsgetargs.c: Likewise.
24256
242572000-03-31 Akim Demaille <akim@epita.fr>
24258
24259 Clean up the error reporting functions.
24260
24261 * src/report.c: New file.
24262 * src/report.h: Likewise.
24263 * src/Makefile.am: Adjust.
24264 * m4/error.m4: New file.
24265 * m4/Makefile.am: Adjust.
24266 * configure.in (jm_PREREQ_ERROR): Call it.
24267 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
24268 Remove.
24269 (fatal, fatals): Remove. All callers use complain.c::fatal.
24270 (warn, warni, warns, warnss, warnss): Remove. All callers use
24271 complain.c::complain.
24272 (toomany): Remove, use fatal instead.
24273 * src/files.c (done): No argument, use complain_message_count.
24274 * src/main.c (main): Register `done' to `atexit'.
24275
24276 * src/getargs.c (usage): More `fputs', less `fprintf'.
24277
242782000-03-28 Akim Demaille <akim@epita.fr>
24279
24280 * lib/: New directory.
24281 * Makefile.am (SUBDIRS): Adjust.
24282 * configure.in: Adjust.
24283 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
24284 useless.
24285 * src/alloca.c: Moved to lib/.
24286 * src/getopt.c: Likewise.
24287 * src/getopt1.c: Likewise.
24288 * src/getopt.h: Likewise.
24289 * src/ansi2knr.c: Likewise.
24290 * src/ansi2knr.1: Likewise.
24291 * src/Makefile.am: Adjust.
24292 * lib/Makefile.am: New file.
24293
242942000-03-28 Akim Demaille <akim@epita.fr>
24295
24296 * src/getargs.c (usage): Refresh the help message.
24297
242982000-03-17 Akim Demaille <akim@epita.fr>
24299
24300 * src/getopt1.c: Updated from textutils 2.0e
24301 * src/getopt.c: Likewise.
24302 * src/getopt.h: Likewise.
24303
243042000-03-17 Akim Demaille <akim@epita.fr>
24305
24306 * src/Makefile.am (bison.simple): Fix the awk program: quote only
24307 the file name, not the whole `#line LINE FILE'.
24308
243092000-03-17 Akim Demaille <akim@epita.fr>
24310
24311 On syntax errors, report the token on which we choked.
24312
24313 * src/bison.s1 (yyparse): In the label yyerrlab, when
24314 YYERROR_VERBOSE, add yychar in msg.
24315
243162000-03-17 Akim Demaille <akim@epita.fr>
24317
24318 * src/reader.c (copy_at): New function.
24319 (copy_guard): Use it.
24320 (copy_action): Use it.
24321
243222000-03-17 Akim Demaille <akim@epita.fr>
24323
24324 Be kind to translators, save some useless translations.
24325
24326 * src/main.c (banner): New function.
24327 (fatal_banner): Use it.
24328 (warn_banner): Use it.
24329
243302000-03-17 Akim Demaille <akim@epita.fr>
24331
24332 * src/reader.c (copy_definition): Use copy_string and
24333 copy_comment. Removed now unused `match', `ended',
24334 `cplus_comment'.
24335 (copy_comment, copy_string): Moved, to be visible from
24336 copy_definition.
24337
243382000-03-17 Akim Demaille <akim@epita.fr>
24339
24340 * src/reader.c (copy_string): Declare `static inline'. No
24341 problems with inline, since it is checked by configure.
24342 (copy_comment): Likewise.
24343
243442000-03-17 Akim Demaille <akim@epita.fr>
24345
24346 * src/reader.c (packsymbols): Formatting changes.
24347
243482000-03-17 Akim Demaille <akim@epita.fr>
24349
24350 * src/reader.c (copy_comment): New function, factored out from:
24351 (copy_action): Use it. Removed now unused `match', `ended',
24352 `cplus_comment'.
24353 (copy_guard): Likewise.
24354
243552000-03-17 Akim Demaille <akim@epita.fr>
24356
24357 * src/reader.c (copy_string): New function, factored out from:
24358 (copy_action): Use it.
24359 (copy_guard): Likewise.
24360
243612000-03-17 Akim Demaille <akim@epita.fr>
24362
24363 Change the handling of @s so that they behave exactly like $s.
24364 There is now a pseudo variable @$ (readble and writable), location
24365 of the lhs of the rule (by default ranging from the location of
24366 the first symbol of the rhs, to the location of the last symbol,
24367 or, if the rhs is empty, YYLLOC).
24368
24369 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
24370 yyval.
24371 (yyparse): When providing a default semantic action, provide a
24372 default location action.
24373 (after the $): No longer change `*YYLSP', just stack YYLOC the
24374 same way you stack YYVAL.
24375 * src/reader.c (read_declarations): Use warns.
24376 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
24377 (copy_action, case '@'): Likewise.
24378 Use a standard error message, to save useless work from
24379 translators.
24380
243812000-03-17 Akim Demaille <akim@epita.fr>
24382
24383 * src/bison.s1: Formatting and cosmetics changes.
24384 * src/reader.c: Likewise.
24385 Update the Copyright notice.
24386
243872000-03-17 Akim Demaille <akim@epita.fr>
24388
24389 * src/bison.s1 (#line): All set to `#line' only, since the
24390 Makefile now handles them.
24391
243922000-03-16 Akim Demaille <akim@epita.fr>
24393
24394 * src/output.c (output_rule_data): Output the documentation of
24395 some of the tables.
24396 (Copyright notice): Update.
24397 Formatting changes.
24398
243992000-03-16 Akim Demaille <akim@epita.fr>
24400
24401 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
24402 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
24403 One `#if YYDEBUG' remains, since it uses variables which are
24404 defined only if `YYDEBUG != 0'.
24405
244062000-03-16 Akim Demaille <akim@epita.fr>
24407
24408 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
24409 and related variables so that the similarities are highlighted.
24410
244112000-03-16 Akim Demaille <akim@epita.fr>
24412
24413 * src/bison.s1: Properly indent CPP directives.
24414
244152000-03-16 Akim Demaille <akim@epita.fr>
24416
24417 * src/bison.s1: Properly indent the `alloca' CPP section.
24418
244192000-03-16 Akim Demaille <akim@epita.fr>
24420
24421 Do not hard code values of directories in `configure.in'.
24422 Update the `configure' tool chain.
24423
24424 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
24425 src/makefile.am.
24426 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
24427 (AC_OUTPUT): Add m4/Makefile.
24428 Bump to bison 1.28a, 1.29 has never been released.
24429 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
24430 handled via src/Makefile.am.
24431 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
24432 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
24433 autoheader.
24434 * Makefile.am (SUBDIRS): Add m4.
24435 (ACLOCAL_AM_FLAGS): New variable.
24436 (AUTOMAKE_OPTIONS): Add check-news.
24437 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
24438 the proper line number and file name.
24439 (DEFS): Propagate the location of bison library files and of the
24440 locale files.
24441 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
24442 builddir.
24443 * acinclude.m4: Remove, replaced by the directory m4.
24444 * m4/Makefile.am (EXTRA_DIST): New variable.
24445 * m4/gettext.m4: New file, from the fileutils.
24446 * m4/lcmessage.m4: Likewise
24447 * m4/progtest.m4: Likewise.
24448 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
24449
244502000-03-10 Akim Demaille <akim@epita.fr>
24451
24452 * src/closure.c:
24453 Formatting changes of various comments.
24454 Respect the GNU coding standards at various places.
24455 Don't use `_()' when no translation is needed.
24456
244571999-12-13 Jesse Thilo <jthilo@gnu.org>
24458
24459 * src/files.c:
24460 OS/2 honors TMPDIR environment variable.
24461
244621999-12-13 Jesse Thilo <jthilo@gnu.org>
24463
24464 * doc/bison.texinfo: Tweaked spelling and grammar.
24465 Updated ISBN.
24466 Removed reference to price of printed copy.
24467 Mention BISON_SIMPLE and BISON_HAIRY.
24468
244691999-12-13 Jesse Thilo <jthilo@gnu.org>
24470
24471 * configure.in, NEWS:
24472 Bison 1.29 released.
24473
244741999-10-27 Jesse Thilo <jthilo@gnu.org>
24475
24476 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
24477 Added reference card.
24478
244791999-07-26 Jesse Thilo <jthilo@gnu.org>
24480
24481 * po/ru.po: Added Russian translation.
24482
244831999-07-26 Jesse Thilo <jthilo@gnu.org>
24484
24485 * configure.in: Added Russian translation.
24486
244871999-07-06 Jesse Thilo <jthilo@gnu.org>
24488
24489 * configure.in, NEWS, README:
24490 Released version 1.28.
24491
244921999-06-14 Jesse Thilo <jthilo@gnu.org>
24493
24494 * src/system.h:
24495 Squashed redefinition warning on some systems.
24496
24497 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
24498 Have configure build version string instead of relying on ANSI string
24499 concatentation.
24500
245011999-06-14 Jesse Thilo <jthilo@gnu.org>
24502
24503 * po/POTFILES.in: Got rid of version.c.
24504
245051999-06-14 Jesse Thilo <jthilo@gnu.org>
24506
24507 * acconfig.h, configure.in:
24508 Have configure build version string instead of relying on ANSI string
24509 concatentation.
24510
245111999-06-08 Jesse Thilo <jthilo@gnu.org>
24512
24513 * doc/bison.1:
24514 Dropped mention of `+' for long-named options.
24515
245161999-05-30 Jesse Thilo <jthilo@gnu.org>
24517
24518 * src/files.c: Added <unistd.h> for unlink().
24519
24520 * src/Makefile.am, src/system.h:
24521 I18n fixes.
24522
245231999-05-30 Jesse Thilo <jthilo@gnu.org>
24524
24525 * README: Added a FAQ list.
24526
24527 * configure.in, acconfig.h:
24528 I18n fixes.
24529
245301999-05-30 Jesse Thilo <jthilo@gnu.org>
24531
24532 * doc/FAQ, doc/Makefile.am:
24533 Added a FAQ list.
24534
245351999-05-19 Jesse Thilo <jthilo@gnu.org>
24536
24537 * src/alloc.h, src/symtab.h, src/version.c:
24538 Protected inclusion of "config.h" with HAVE_CONFIG_H.
24539
245401999-04-18 Jesse Thilo <jthilo@gnu.org>
24541
24542 * src/.cvsignore, src/Makefile.am:
24543 Reorganized: sources in `src', documentation in `doc'.
24544
24545 * src/lex.c (literalchar):
24546 fixed the code for escaping double quotes (thanks
24547 Jonathan Czisny.)
24548
245491999-04-18 Jesse Thilo <jthilo@gnu.org>
24550
24551 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
24552 Adjusted paths to reflect directory reorganization.
24553
245541999-04-18 Jesse Thilo <jthilo@gnu.org>
24555
24556 * doc/.cvsignore, doc/Makefile.am:
24557 Reorganized: sources in `src', documentation in `doc'.
24558
245591999-04-18 Jesse Thilo <jthilo@gnu.org>
24560
24561 * configure.in:
24562 Updated AC_INIT file to reflect directory reorganization.
24563
24564 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
24565 Reorganized: sources in `src', documentation in `doc'.
24566
245671999-04-13 Jesse Thilo <jthilo@gnu.org>
24568
24569 * src/allocate.c:
24570 Don't declare calloc() and realloc() if not necessary.
24571
245721999-04-13 Jesse Thilo <jthilo@gnu.org>
24573
24574 * configure.in, acconfig.h, acinclude.m4:
24575 Don't declare calloc() and realloc() if not necessary.
24576
245771999-03-23 Jesse Thilo <jthilo@gnu.org>
24578
24579 * po/.cvsignore: Added i18n support.
24580
245811999-03-23 Jesse Thilo <jthilo@gnu.org>
24582
24583 * acconfig.h, configure.in, Makefile.am:
24584 Added i18n support.
24585
245861999-03-22 Jesse Thilo <jthilo@gnu.org>
24587
24588 * src/bison.s1: Fixed #line numbers.
24589
245901999-03-15 Jesse Thilo <jthilo@gnu.org>
24591
24592 * po/es.po, po/fr.po, po/nl.po, po/de.po:
24593 Added PO files from Translation Project.
24594
245951999-03-03 Jesse Thilo <jthilo@gnu.org>
24596
24597 * Makefile.am:
24598 Added support for non-ANSI compilers (ansi2knr).
24599
246001999-02-16 Jesse Thilo <jthilo@gnu.org>
24601
24602 * configure.in: Bumped version number to 1.27.
24603
24604 * Makefile.am:
24605 Added `bison.simple' to list of files removed by `make distclean'.
24606
246071999-02-12 Jesse Thilo <jthilo@gnu.org>
24608
24609 * src/files.c, src/files.h:
24610 Defined locations of parser files in config.h instead of Makefile.
24611
246121999-02-12 Jesse Thilo <jthilo@gnu.org>
24613
24614 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
24615 Defined locations of parser files in config.h instead of Makefile.
24616
246171999-02-09 Jesse Thilo <jthilo@gnu.org>
24618
24619 * Makefile.am:
24620 Removed inappropriate use of $< macro.
24621
246221999-02-05 Jesse Thilo <jthilo@gnu.org>
24623
24624 * po/Makefile.in.in, po/POTFILES.in:
24625 Add `po' directory skeleton.
24626
246271999-01-27 Jesse Thilo <jthilo@gnu.org>
24628
24629 * README: Document help-bison list.
24630
24631 * configure.in: Add check for mkstemp().
24632
246331999-01-20 Jesse Thilo <jthilo@gnu.org>
24634
24635 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
24636 Hush a few compiler warnings.
24637
24638 * src/files.c:
24639 Add tryclose(), which verifies that fclose was successful.
24640 Hush a couple of compiler warnings.
24641
246421999-01-20 Jesse Thilo <jthilo@gnu.org>
24643
24644 * Makefile.am, OChangeLog:
24645 ChangeLog is now automatically generated. Include the old version as
24646 OChangeLog.
24647
246481999-01-14 Jesse Thilo <jthilo@gnu.org>
24649
24650 * 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:
24651 Update FSF address.
24652
246531999-01-14 Jesse Thilo <jthilo@gnu.org>
24654
24655 * doc/bison.texinfo: Fix formatting glitch.
24656
24657 * doc/bison.texinfo: Update FSF address.
24658
246591999-01-14 Jesse Thilo <jthilo@gnu.org>
24660
24661 * acconfig.h: Update FSF address.
24662
246631999-01-08 Jesse Thilo <jthilo@gnu.org>
24664
24665 * src/system.h:
24666 Don't define PACKAGE here, since config.h defines it.
24667
246681998-12-30 Jesse Thilo <jthilo@gnu.org>
24669
24670 * src/reader.c: Update copyright date.
24671
24672 * src/main.c:
24673 Ditch sprintf to statically-sized buffers in fatal/warn functions in
24674 favor of output directly to stderr (avoids buffer overruns).
24675
24676 * src/reader.c: Some checks for premature EOF.
24677
24678 * 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:
24679 Use prototypes if the compiler understands them.
24680
24681 * src/files.c: Honor TMPDIR on Unix hosts.
24682 Use prototypes if the compiler understands them.
24683
24684 * src/reader.c:
24685 Fix a couple of buffer overrun bugs.
24686 Use prototypes if the compiler understands them.
24687
24688 * src/system.h: Include unistd.h and ctype.h.
24689 Use #ifdef instead of #if for NLS symbols.
24690
246911998-12-30 Jesse Thilo <jthilo@gnu.org>
24692
24693 * doc/bison.texinfo:
24694 Delete comment "consider using @set for edition number, etc..." since
24695 we now are doing so.
24696
246971998-12-30 Jesse Thilo <jthilo@gnu.org>
24698
24699 * configure.in:
24700 Use prototypes if the compiler understands them.
24701
24702 * NEWS: Document 1.26 highlights.
24703
24704 * Makefile.am: Require Automake 1.3 or later.
24705
24706 * acconfig.h:
24707 Use prototypes if the compiler understands them.
24708
247091998-12-29 Jesse Thilo <jthilo@gnu.org>
24710
24711 * src/version.c:
24712 Use VERSION symbol from automake for version number.
24713
247141998-12-29 Jesse Thilo <jthilo@gnu.org>
24715
24716 * acconfig.h, configure.in, version.cin:
24717 Use VERSION symbol from automake for version number.
24718
247191998-11-28 Jesse Thilo <jthilo@gnu.org>
24720
24721 * Makefile.am:
24722 Distribute original version of simple parser (bison.s1), not built
24723 version (bison.simple).
24724
247251998-11-28 Jesse Thilo <jthilo@gnu.org>
24726
24727 * doc/bison.texinfo: Add info dir entry.
24728
24729 * doc/bison.texinfo:
24730 Let automake put version number into documentation.
24731
247321998-11-26 Jesse Thilo <jthilo@gnu.org>
24733
24734 * src/bison.cld, src/build.com, src/vmshlp.mar:
24735 Add non-RCS files from /gd/gnu/bison.
24736
247371998-11-26 Jesse Thilo <jthilo@gnu.org>
24738
24739 * doc/bison.1:
24740 Document the BISON_HAIRY and BISON_SIMPLE variables.
24741
247421998-11-25 Jesse Thilo <jthilo@gnu.org>
24743
24744 * src/version.c: Build version.c automatically.
24745
24746 * src/reader.c:
24747 Fix token numbering (used to start at 258, not 257).
24748
24749 * src/system.h: Include config.h.
24750
24751 * src/getargs.c: Update bug report address.
24752
24753 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
24754 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
24755
247561998-11-25 Jesse Thilo <jthilo@gnu.org>
24757
24758 * Makefile.am:
24759 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24760
24761 * configure.in, version.cin:
24762 Build version.c automatically.
24763
24764 * AUTHORS: Add AUTHORS file.
24765
24766 * README: Update bug report address.
24767
24768 * bison.simple:
24769 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24770
24771 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
24772 Add automake stuff.
24773
247741998-11-25 Jesse Thilo <jthilo@gnu.org>
24775
24776 * doc/bison.texinfo: Clean up some formatting.
24777
247781998-05-05 Richard Stallman <rms@gnu.org>
24779
24780 * doc/bison.texinfo:
24781 Explain better why to make a pure parser.
24782
247831998-01-05 Richard Stallman <rms@gnu.org>
24784
24785 * src/files.c (openfiles):
24786 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
24787 find a temporary directory, if possible. Do not unlink files while
24788 they are open.
24789
247901997-08-25 Richard Stallman <rms@gnu.org>
24791
24792 * src/reader.c (stack_offset;):
24793 Change some warni to warns.
24794
24795 * src/lex.c (literalchar): Use warns, not warni.
24796
247971997-06-28 Richard Stallman <rms@gnu.org>
24798
24799 * src/bison.s1: Add a Bison version comment.
24800
24801 * src/main.c (fatal, warn, berror):
24802 Use program_name.
24803
248041997-06-28 Richard Stallman <rms@gnu.org>
24805
24806 * Makefile.in (bison_version): New variable.
24807 (dist): Use that variable.
24808 (bison.s1): Substitute the Bison version into bison.simple.
24809
24810 * bison.simple: Add a Bison version comment.
24811
248121997-06-18 Richard Stallman <rms@gnu.org>
24813
24814 * src/main.c (fatal, warn, berror):
24815 Make error messages standard.
24816 (toomany): Improve error message text.
24817
24818 * 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:
24819 new.h renamed to alloc.h.
24820
248211997-06-18 Richard Stallman <rms@gnu.org>
24822
24823 * Makefile.in: new.h renamed to alloc.h.
24824
248251997-05-24 Richard Stallman <rms@gnu.org>
24826
24827 * src/lex.c (literalchar):
24828 Fix the code for escaping \, " and '.
24829
24830 (lex): Avoid trouble when there are many chars
24831 to discard in a char literal with just several chars in it.
24832
248331997-05-17 Richard Stallman <rms@gnu.org>
24834
24835 * src/bison.s1:
24836 Use malloc, if using alloca is troublesome.
24837 (YYSTACK_USE_ALLOCA): New flag macro.
24838 Define it for some systems and compilers.
24839 (YYSTACK_ALLOC): New macro.
24840 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24841 If it was malloc'd, free it.
24842
248431997-05-17 Richard Stallman <rms@gnu.org>
24844
24845 * bison.simple:
24846 Use malloc, if using alloca is troublesome.
24847 (YYSTACK_USE_ALLOCA): New flag macro.
24848 Define it for some systems and compilers.
24849 (YYSTACK_ALLOC): New macro.
24850 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24851 If it was malloc'd, free it.
24852
248531997-04-23 Richard Stallman <rms@gnu.org>
24854
24855 * src/bison.s1:
24856 (alloca) [__hpux]: Always define as __builtin_alloca.
24857
248581997-04-23 Richard Stallman <rms@gnu.org>
24859
24860 * bison.simple:
24861 (alloca) [__hpux]: Always define as __builtin_alloca.
24862
248631997-04-22 Richard Stallman <rms@gnu.org>
24864
24865 * src/bison.s1:
24866 [__hpux]: Include alloca.h (right for HPUX 10)
24867 instead of declaring alloca (right for HPUX 9).
24868
24869 * src/bison.s1 (__yy_memcpy):
24870 Declare arg `count' as unsigned int.
24871 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24872
248731997-04-22 Richard Stallman <rms@gnu.org>
24874
24875 * bison.simple:
24876 [__hpux]: Include alloca.h (right for HPUX 10)
24877 instead of declaring alloca (right for HPUX 9).
24878
24879 * bison.simple (__yy_memcpy):
24880 Declare arg `count' as unsigned int.
24881 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24882
248831997-01-03 Richard Stallman <rms@gnu.org>
24884
24885 * src/allocate.c: [__STDC__ or _MSC_VER]:
24886 Declare calloc and realloc to return void *.
24887
248881997-01-02 Richard Stallman <rms@gnu.org>
24889
24890 * src/system.h:
24891 [_MSC_VER]: Include stdlib.h and process.h.
24892 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
24893
24894 * src/main.c (main): Return FAILURE as a value.
24895 (printable_version): Declare arg as int, not char.
24896
248971997-01-02 Richard Stallman <rms@gnu.org>
24898
24899 * Makefile.in (dist):
24900 Explicitly check for symlinks, and copy them.
24901
249021996-12-19 Richard Stallman <rms@gnu.org>
24903
24904 * src/files.c:
24905 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
24906
249071996-12-18 Paul Eggert <eggert@gnu.org>
24908
24909 * src/bison.s1 (yyparse):
24910 If __GNUC__ and YYPARSE_PARAM are both defined,
24911 declare yyparse to have a void * argument.
24912
249131996-12-18 Paul Eggert <eggert@gnu.org>
24914
24915 * bison.simple (yyparse):
24916 If __GNUC__ and YYPARSE_PARAM are both defined,
24917 declare yyparse to have a void * argument.
24918
249191996-12-17 Richard Stallman <rms@gnu.org>
24920
24921 * src/reduce.c (nbits): Add some casts.
24922
249231996-08-12 Richard Stallman <rms@gnu.org>
24924
24925 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
24926
249271996-08-12 Richard Stallman <rms@gnu.org>
24928
24929 * bison.simple: Test _MSDOS as well as _MSDOS_.
24930
249311996-07-31 Richard Stallman <rms@gnu.org>
24932
24933 * src/bison.s1:
24934 [__sun && __i386]: Include alloca.h.
24935
249361996-07-31 Richard Stallman <rms@gnu.org>
24937
24938 * bison.simple:
24939 [__sun && __i386]: Include alloca.h.
24940
249411996-07-30 Richard Stallman <rms@gnu.org>
24942
24943 * src/bison.s1: Comment change.
24944
24945 * src/bison.s1: Test _MSDOS_, not MSDOS.
24946
249471996-07-30 Richard Stallman <rms@gnu.org>
24948
24949 * bison.simple: Comment change.
24950
24951 * bison.simple: Test _MSDOS_, not MSDOS.
24952
249531996-06-01 Richard Stallman <rms@gnu.org>
24954
24955 * 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:
24956 Insert `_' macro around many string constants.
24957
24958 * src/main.c:
24959 Insert `_' macro around many string constants.
24960
24961 (main): Call setlocale, bindtextdomain and textdomain.
24962
24963 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
24964 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
24965 [ENABLE_NLS]: Include libintl.h.
24966 [ENABLE_NLS] (gettext): Define.
24967 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
24968 (N_, PACKAGE, LOCALEDIR): New macros.
24969
249701996-06-01 Richard Stallman <rms@gnu.org>
24971
24972 * POTFILES.in: New file.
24973
24974 * Makefile.in (allocate.o):
24975 Define target explicitly.
24976
24977 * Makefile.in (CFLAGS): Set to @CFLAGS@.
24978 (LDFLAGS): Set to @LDFLAGS@.
24979 (configure): Run autoconf only if preceding `cd' succeeds.
24980 (bison.s1): Redirect output to temporary file then move the
24981 temporary to the target, rather than redirecting directly to bison.s1.
24982 (clean): Remove config.status and config.log.
24983 (distclean): Don't remove config.status here.
24984
249851996-05-12 Richard Stallman <rms@gnu.org>
24986
24987 * src/bison.s1:
24988 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24989
249901996-05-12 Richard Stallman <rms@gnu.org>
24991
24992 * bison.simple:
24993 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24994
249951996-05-11 Richard Stallman <rms@gnu.org>
24996
24997 * src/bison.s1 (__yy_memcpy):
24998 Really reorder the args, as was supposedly done on Feb 14 1995.
24999 (yyparse): Calls changed accordingly.
25000
250011996-05-11 Richard Stallman <rms@gnu.org>
25002
25003 * Makefile.in (dist): Don't use $(srcdir).
25004
25005 * bison.simple (__yy_memcpy):
25006 Really reorder the args, as was supposedly done on Feb 14 1995.
25007 (yyparse): Calls changed accordingly.
25008
250091996-01-27 Richard Stallman <rms@gnu.org>
25010
25011 * src/output.c (output_rule_data):
25012 Test YYERROR_VERBOSE in the conditional
25013 around the definition of ttyname.
25014
250151995-12-29 Richard Stallman <rms@gnu.org>
25016
25017 * src/bison.s1:
25018 Fix line numbers in #line commands.
25019
250201995-12-29 Richard Stallman <rms@gnu.org>
25021
25022 * bison.simple:
25023 Fix line numbers in #line commands.
25024
250251995-12-27 Richard Stallman <rms@gnu.org>
25026
25027 * src/bison.s1 (YYPARSE_PARAM_DECL):
25028 In C++, make it always null.
25029 (YYPARSE_PARAM_ARG): New macro.
25030 (yyparse): Use YYPARSE_PARAM_ARG.
25031
250321995-12-27 Richard Stallman <rms@gnu.org>
25033
25034 * bison.simple (YYPARSE_PARAM_DECL):
25035 In C++, make it always null.
25036 (YYPARSE_PARAM_ARG): New macro.
25037 (yyparse): Use YYPARSE_PARAM_ARG.
25038
250391995-11-29 Richard Stallman <rms@gnu.org>
25040
25041 * doc/bison.texinfo:
25042 Describe literal string tokens, %raw, %no_lines, %token_table.
25043
250441995-11-29 Daniel Hagerty <hag@gnu.org>
25045
25046 * doc/bison.texinfo: Fixed update date
25047
250481995-10-16 Richard Stallman <rms@gnu.org>
25049
25050 * src/version.c: Version 1.25.
25051
250521995-10-16 Richard Stallman <rms@gnu.org>
25053
25054 * NEWS: *** empty log message ***
25055
250561995-10-16 Richard Stallman <rms@gnu.org>
25057
25058 * doc/bison.1, doc/bison.rnh:
25059 Add new options.
25060
250611995-10-15 Richard Stallman <rms@gnu.org>
25062
25063 * src/vmsgetargs.c, src/getargs.c:
25064 Added -n, -k, and -raw switches.
25065 (noparserflag, toknumflag, rawtoknumflag): New variables.
25066
25067 * src/symtab.h (SALIAS):
25068 New #define for adding aliases to %token.
25069 (struct bucket): Added `alias' field.
25070
25071 * src/reduce.c (reduce_grammar):
25072 Revise error message.
25073 (print_notices): Remove final `.' from error message.
25074
25075 * src/reader.c (reader_output_yylsp):
25076 New function.
25077 (readgram): Use `#if 0' around code that accepted %command
25078 inside grammar rules: The documentation doesn't allow it,
25079 and it will fail since the %command processors scan for the next %.
25080 (parse_token_decl): Extended the %token
25081 declaration to allow a multi-character symbol as an alias.
25082 (parse_thong_decl): New function.
25083 (read_declarations): Added %thong declarations.
25084 (read_declarations): Handle NOOP to deal with allowing
25085 % declarations as another means to specify the flags.
25086 (readgram): Allow %prec prior to semantics embedded in a rule.
25087 (skip_to_char, read_declarations, copy_definition)
25088 (parse_token_decl, parse_start_decl, parse_type_decl)
25089 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
25090 (get_type_name, copy_guard, copy_action, readgram)
25091 (get_type, packsymbols): Revised most error messages.
25092 Changed `fatal' to `warnxxx' to avoid aborting for error.
25093 Revised and use multiple warnxxx functions to avoid using VARARGS1.
25094 (read_declarations): Improve the error message for
25095 an invalid character. Do not abort.
25096 (read_declarations, copy_guard, copy_action): Use
25097 printable_version to avoid unprintable characters in printed output.
25098 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
25099 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
25100 Allow the type of a non-terminal can be given
25101 more than once, as long as all specifications give the same type.
25102
25103 * src/output.c:
25104 (output_headers, output_trailers, output, output_gram)
25105 (output_rule_data): Implement noparserflag variable.
25106 Implement toknumflag variable.
25107 (output): Call reader_output_yylsp to output LTYPESTR.
25108
25109 * src/main.c (main):
25110 If reader sees an error, don't process the grammar.
25111 (fatals): Updated to not use VARARGS1.
25112 (printable_version, int_to_string, warn, warni, warns, warnss)
25113 (warnsss): New error reporting functions. Avoid abort for error.
25114
25115 * src/lex.h:
25116 Added THONG and NOOP for alias processing.
25117 Added SETOPT for the new code that allows setting options with %flags.
25118
25119 * src/lex.c:
25120 Include getopt.h. Add some extern decls.
25121 (safegetc): New function to deal with EOF gracefully.
25122 (literalchar); new function to deal with reading \ escapes.
25123 (lex): Use literalchar.
25124 (lex): Implemented "..." tokens.
25125 (literalchar, lex, parse_percent_token): Made tokenbuffer
25126 always contain the token. This includes growing the token
25127 buffer while reading an integer.
25128 (parse_percent_token): Replaced if-else statement with percent_table.
25129 (parse_percent_token): Added % declarations as another
25130 way to specify the flags -n, -l, and -r. Also added hooks for
25131 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
25132 major changes to files.c.
25133 (lex) Retain in the incoming stream a character following
25134 an incorrect '/'.
25135 (skip_white_space, lex): Revised most error messages
25136 and changed fatal to warn to avoid aborting.
25137 (percent_table): Added %thong declarations.
25138
25139 * src/gram.h: Comment changes.
25140
25141 * src/files.c (openfiles, open_extra_files, done):
25142 Add faction flag
25143 and actfile file. Handle noparserflag. Both for -n switch.
25144
25145 * src/conflicts.c (resolve_sr_conflict):
25146 Remove use of alloca.
25147
251481995-06-01 Jim Meyering <meyering@gnu.org>
25149
25150 * doc/bison.texinfo: *** empty log message ***
25151
251521995-05-06 Richard Stallman <rms@gnu.org>
25153
25154 * src/bison.s1: Comment change.
25155
251561995-05-06 Richard Stallman <rms@gnu.org>
25157
25158 * bison.simple: Comment change.
25159
251601995-05-03 Richard Stallman <rms@gnu.org>
25161
25162 * src/version.c: Version now 1.24.
25163
25164 * src/bison.s1: Change distribution terms.
25165
25166 * src/version.c: Version now 1.23.
25167
251681995-05-03 Richard Stallman <rms@gnu.org>
25169
25170 * doc/bison.texinfo:
25171 Rewrite "Conditions for Using Bison".
25172 Update version to 1.24.
25173
251741995-05-03 Richard Stallman <rms@gnu.org>
25175
25176 * bison.simple: Change distribution terms.
25177
251781995-02-23 Richard Stallman <rms@gnu.org>
25179
25180 * src/files.c: Test __VMS_POSIX as well as VMS.
25181
251821995-02-14 Jim Meyering <meyering@gnu.org>
25183
25184 * src/bison.s1 (__yy_memcpy):
25185 Renamed from __yy_bcopy to avoid
25186 confusion. Reverse FROM and TO arguments to be consistent with
25187 those of memcpy.
25188
251891995-02-14 Jim Meyering <meyering@gnu.org>
25190
25191 * bison.simple (__yy_memcpy):
25192 Renamed from __yy_bcopy to avoid
25193 confusion. Reverse FROM and TO arguments to be consistent with
25194 those of memcpy.
25195
251961994-11-10 David J. MacKenzie <djm@gnu.org>
25197
25198 * NEWS: reformat
25199
25200 * NEWS: New file.
25201
25202 * Makefile.in (DISTFILES): Include NEWS.
25203
25204 * Makefile.in (DISTFILES):
25205 Include install-sh, not install.sh.
25206
25207 * configure.in: Update to Autoconf v2 macro names.
25208
252091994-10-05 David J. MacKenzie <djm@gnu.org>
25210
25211 * Makefile.in: fix typo
25212
25213 * Makefile.in (prefix, exec_prefix):
25214 Let configure set them.
25215
252161994-09-28 David J. MacKenzie <djm@gnu.org>
25217
25218 * Makefile.in: Set datadir to $(prefix)/share.
25219
252201994-09-15 Richard Stallman <rms@gnu.org>
25221
25222 * src/bison.s1:
25223 Update copyright notice and GPL version.
25224
252251994-09-15 Richard Stallman <rms@gnu.org>
25226
25227 * bison.simple:
25228 Update copyright notice and GPL version.
25229
252301994-07-12 Richard Stallman <rms@gnu.org>
25231
25232 * src/reduce.c, src/reader.c:
25233 entered into RCS
25234
252351994-05-05 David J. MacKenzie <djm@gnu.org>
25236
25237 * Makefile.in: entered into RCS
25238
252391994-03-26 Richard Stallman <rms@gnu.org>
25240
25241 * src/bison.s1: entered into RCS
25242
252431994-03-26 Richard Stallman <rms@gnu.org>
25244
25245 * bison.simple: entered into RCS
25246
252471994-03-25 Richard Stallman <rms@gnu.org>
25248
25249 * src/main.c: entered into RCS
25250
252511994-03-24 Richard Stallman <rms@gnu.org>
25252
25253 * src/conflicts.c: entered into RCS
25254
252551994-01-02 Richard Stallman <rms@gnu.org>
25256
25257 * Makefile.in: *** empty log message ***
25258
252591993-11-21 Richard Stallman <rms@gnu.org>
25260
25261 * src/bison.s1: *** empty log message ***
25262
252631993-11-21 Richard Stallman <rms@gnu.org>
25264
25265 * doc/bison.texinfo: entered into RCS
25266
25267 * doc/bison.texinfo: *** empty log message ***
25268
252691993-11-21 Richard Stallman <rms@gnu.org>
25270
25271 * bison.simple: *** empty log message ***
25272
252731993-10-25 David J. MacKenzie <djm@gnu.org>
25274
25275 * doc/bison.texinfo: *** empty log message ***
25276
252771993-10-19 Richard Stallman <rms@gnu.org>
25278
25279 * src/bison.s1: *** empty log message ***
25280
252811993-10-19 Richard Stallman <rms@gnu.org>
25282
25283 * bison.simple: *** empty log message ***
25284
252851993-10-14 Richard Stallman <rms@gnu.org>
25286
25287 * src/bison.s1: *** empty log message ***
25288
252891993-10-14 Richard Stallman <rms@gnu.org>
25290
25291 * bison.simple: *** empty log message ***
25292
252931993-09-14 David J. MacKenzie <djm@gnu.org>
25294
25295 * doc/bison.texinfo: *** empty log message ***
25296
252971993-09-13 Noah Friedman <friedman@gnu.org>
25298
25299 * Makefile.in: *** empty log message ***
25300
253011993-09-10 Richard Stallman <rms@gnu.org>
25302
25303 * src/conflicts.c: *** empty log message ***
25304
25305 * src/system.h: entered into RCS
25306
253071993-09-10 Richard Stallman <rms@gnu.org>
25308
25309 * doc/bison.1: entered into RCS
25310
253111993-09-06 Noah Friedman <friedman@gnu.org>
25312
25313 * src/version.c: entered into RCS
25314
253151993-09-06 Noah Friedman <friedman@gnu.org>
25316
25317 * Makefile.in: *** empty log message ***
25318
253191993-07-30 David J. MacKenzie <djm@gnu.org>
25320
25321 * Makefile.in: *** empty log message ***
25322
253231993-07-24 Richard Stallman <rms@gnu.org>
25324
25325 * src/bison.s1: *** empty log message ***
25326
253271993-07-24 Richard Stallman <rms@gnu.org>
25328
25329 * bison.simple: *** empty log message ***
25330
253311993-07-08 David J. MacKenzie <djm@gnu.org>
25332
25333 * Makefile.in: *** empty log message ***
25334
253351993-07-04 Richard Stallman <rms@gnu.org>
25336
25337 * src/bison.s1: *** empty log message ***
25338
253391993-07-04 Richard Stallman <rms@gnu.org>
25340
25341 * bison.simple: *** empty log message ***
25342
253431993-06-26 David J. MacKenzie <djm@gnu.org>
25344
25345 * src/getargs.c: entered into RCS
25346
253471993-06-26 David J. MacKenzie <djm@gnu.org>
25348
25349 * doc/bison.texinfo: *** empty log message ***
25350
25351 * doc/bison.1: New file.
25352
253531993-06-25 Richard Stallman <rms@gnu.org>
25354
25355 * src/getargs.c: New file.
25356
253571993-06-16 Richard Stallman <rms@gnu.org>
25358
25359 * src/bison.s1: *** empty log message ***
25360
253611993-06-16 Richard Stallman <rms@gnu.org>
25362
25363 * bison.simple: *** empty log message ***
25364
253651993-06-03 Richard Stallman <rms@gnu.org>
25366
25367 * src/bison.s1: New file.
25368
253691993-06-03 Richard Stallman <rms@gnu.org>
25370
25371 * doc/bison.texinfo: *** empty log message ***
25372
253731993-06-03 Richard Stallman <rms@gnu.org>
25374
25375 * bison.simple: New file.
25376
253771993-05-19 Richard Stallman <rms@gnu.org>
25378
25379 * doc/bison.texinfo: New file.
25380
253811993-05-07 Noah Friedman <friedman@gnu.org>
25382
25383 * Makefile.in: *** empty log message ***
25384
253851993-04-28 Noah Friedman <friedman@gnu.org>
25386
25387 * src/reader.c: *** empty log message ***
25388
253891993-04-23 Noah Friedman <friedman@gnu.org>
25390
25391 * src/alloc.h: entered into RCS
25392
253931993-04-20 David J. MacKenzie <djm@gnu.org>
25394
25395 * src/version.c: *** empty log message ***
25396
25397 * src/files.c, src/allocate.c:
25398 entered into RCS
25399
25400 * src/reader.c: *** empty log message ***
25401
25402 * src/lex.c: entered into RCS
25403
25404 * src/conflicts.c: New file.
25405
25406 * src/symtab.c: entered into RCS
25407
25408 * src/alloc.h: New file.
25409
25410 * src/LR0.c: entered into RCS
25411
254121993-04-18 Noah Friedman <friedman@gnu.org>
25413
25414 * src/reader.c: New file.
25415
25416 * src/version.c: *** empty log message ***
25417
254181993-04-18 Noah Friedman <friedman@gnu.org>
25419
25420 * Makefile.in: *** empty log message ***
25421
254221993-04-17 Noah Friedman <friedman@gnu.org>
25423
25424 * Makefile.in: *** empty log message ***
25425
254261993-04-15 Richard Stallman <rms@gnu.org>
25427
25428 * src/main.c, src/files.c:
25429 New file.
25430
254311993-04-15 Noah Friedman <friedman@gnu.org>
25432
25433 * configure.in: entered into RCS
25434
25435 * configure.in: *** empty log message ***
25436
25437 * configure.in: New file.
25438
254391993-04-14 Richard Stallman <rms@gnu.org>
25440
25441 * Makefile.in: New file.
25442
254431993-04-13 Richard Stallman <rms@gnu.org>
25444
25445 * src/version.c: New file.
25446
254471993-03-25 Richard Stallman <rms@gnu.org>
25448
25449 * src/output.c: entered into RCS
25450
254511992-09-25 Richard Stallman <rms@gnu.org>
25452
25453 * configure.bat: entered into RCS
25454
254551992-06-22 Richard Stallman <rms@gnu.org>
25456
25457 * src/vmsgetargs.c: entered into RCS
25458
254591992-06-22 Richard Stallman <rms@gnu.org>
25460
25461 * doc/bison.rnh: entered into RCS
25462
254631992-04-20 David J. MacKenzie <djm@gnu.org>
25464
25465 * README: entered into RCS
25466
254671992-01-22 Richard Stallman <rms@gnu.org>
25468
25469 * src/machine.h: entered into RCS
25470
254711991-12-21 Richard Stallman <rms@gnu.org>
25472
25473 * src/lalr.c, src/closure.c:
25474 entered into RCS
25475
254761991-12-20 Richard Stallman <rms@gnu.org>
25477
25478 * src/state.h: entered into RCS
25479
254801991-12-18 Richard Stallman <rms@gnu.org>
25481
25482 * src/print.c, src/nullable.c, src/derives.c:
25483 entered into RCS
25484
254851991-11-03 David J. MacKenzie <djm@gnu.org>
25486
25487 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
25488 entered into RCS
25489
254901988-09-09 Richard Stallman <rms@gnu.org>
25491
25492 * src/bison.hairy: entered into RCS
25493
254941987-12-16 Richard Stallman <rms@gnu.org>
25495
25496 * REFERENCES: entered into RCS
25497
25498
25499 -----
25500
25501 Copyright (C) 1987-1988, 1991-2010 Free Software Foundation,
25502 Inc.
25503
25504 Copying and distribution of this file, with or without
25505 modification, are permitted provided the copyright notice and this
25506 notice are preserved.