]> git.saurik.com Git - bison.git/blob - ChangeLog
b6fe8058002cec7f6e5c2b308725fe7c914266a5
[bison.git] / ChangeLog
1 2010-06-17 Paul Eggert <eggert@cs.ucla.edu>
2
3 Update from GFDL GFDL 1.2 to 1.3.
4 * doc/bison.texinfo: Update GFDL version number.
5 * doc/fdl.texi: Update to version 1.3, taken from:
6 http://www.gnu.org/licenses/fdl.texi
7
8 2010-06-17 Paul Eggert <eggert@cs.ucla.edu>
9
10 Do not use date ranges in copyright notices.
11 See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices
12
13 * HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha:
14 * TODO, bootstrap, bootstrap.conf:
15 * build-aux/update-b4-copyright, cfg.mk, configure.ac:
16 * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4:
17 * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc:
18 * data/java-skel.m4, data/java.m4, data/lalr1.cc:
19 * data/lalr1.java, data/location.cc:
20 * data/xslt/bison.xsl:
21 * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl:
22 * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint:
23 * djgpp/README.in, djgpp/config.bat, djgpp/config.sed:
24 * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat:
25 * djgpp/subpipe.c, djgpp/subpipe.h:
26 * djgpp/testsuite.sed, doc/bison.texinfo:
27 * doc/refcard.tex, etc/README, etc/bench.pl.in:
28 * examples/calc++/Makefile.am, examples/extexi:
29 * lib/abitset.c, lib/abitset.h:
30 * lib/bbitset.h, lib/bitset.c, lib/bitset.h:
31 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
32 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
33 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
34 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
35 * lib/libiberty.h, lib/main.c, lib/timevar.c:
36 * lib/timevar.def, lib/timevar.h, lib/vbitset.c:
37 * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4:
38 * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4:
39 * src/AnnotationList.c, src/AnnotationList.h:
40 * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c:
41 * src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c:
42 * src/assoc.h, src/closure.c, src/closure.h, src/complain.c:
43 * src/complain.h, src/conflicts.c, src/conflicts.h:
44 * src/derives.c, src/derives.h, src/files.c, src/files.h:
45 * src/flex-scanner.h, src/getargs.c, src/getargs.h:
46 * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c:
47 * src/ielr.h, src/lalr.c, src/lalr.h:
48 * src/location.c, src/location.h, src/main.c:
49 * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c:
50 * src/named-ref.h, src/nullable.c, src/nullable.h:
51 * src/output.c, src/output.h, src/parse-gram.y:
52 * src/print-xml.c, src/print-xml.h, src/print.c, src/print.h:
53 * src/print_graph.c, src/print_graph.h, src/reader.c:
54 * src/reader.h, src/reduce.c, src/reduce.h, src/relation.c:
55 * src/relation.h, src/scan-code.h, src/scan-code.l:
56 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
57 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
58 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
59 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
60 * tests/actions.at, tests/atlocal.in, tests/c++.at:
61 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
62 * tests/existing.at, tests/glr-regression.at:
63 * tests/headers.at, tests/input.at, tests/java.at:
64 * tests/local.at, tests/named-refs.at:
65 * tests/output.at, tests/push.at, tests/reduce.at:
66 * tests/regression.at, tests/sets.at, tests/skeletons.at:
67 * tests/synclines.at, tests/testsuite.at, tests/torture.at:
68 * data/Makefile.am, data/location.cc, doc/Makefile.am, src/Makefile.am:
69 * tests/Makefile.am, lib/Makefile.am, examples/Makefile.am:
70 * etc/Makefile.am:
71 Don't use date ranges in copyright notices.
72
73 2010-05-11 Akim Demaille <demaille@gostai.com>
74
75 lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
76 * data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
77 header file to the implementation file, after the user %code
78 sections.
79 * NEWS (2.5): Document this.
80
81 2010-05-07 Akim Demaille <demaille@gostai.com>
82
83 c++: use YYRHSLOC.
84 * data/lalr1.cc (YYRHSLOC): New.
85 (YYLLOC_DEFAULT): Use it.
86 * data/glr.cc: If location_type was user defined, do not include
87 location.hh, and do not produce location.hh and position.hh.
88 * tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC.
89 Check that glr.cc supports user defined location_type.
90 * NEWS: Document this.
91
92 2010-05-10 Akim Demaille <demaille@gostai.com>
93
94 doc: fix lalr1.cc documentation.
95 * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature.
96 (C++ Bison Interface): Fix lalr1.cc skeleton name.
97 (C++ Parser Interface): Fix semantic_type and location_type names.
98 Document yy::parser::token.
99 Reported by Jerry Quinn.
100
101 2010-05-04 Akim Demaille <demaille@gostai.com>
102
103 lalr1.cc: don't generate location.hh when location_type is defined
104 * data/bison.m4 (b4_percent_define_use): New.
105 (b4_percent_define_get): Use it.
106 Accept a default value.
107 * data/c++.m4: Do not provide a default value for the %define
108 variable location_type, rather, use b4_percent_define_get with a
109 default argument where its value is needed.
110 * data/lalr1.cc: Do not load location.cc (which outputs both
111 location.hh and position.hh) if the user defined location_type.
112 Do not include location.hh either.
113 * data/glr.cc: Likewise.
114
115 2010-05-04 Akim Demaille <demaille@gostai.com>
116
117 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
118 * tests/calc.at (Span): Instead of begin/end, as in the built-in
119 location class, use first and last.
120 Define YYLLOC_DEFAULT to adjust to these changes.
121 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
122 location_type changes.
123
124 2010-05-04 Akim Demaille <demaille@gostai.com>
125
126 tests: enhance AT_SYNCLINES_COMPILE.
127 * tests/synclines.at (AT_TEST_SYNCLINE): Move GCC 4.5 protection
128 into...
129 (AT_SYNCLINES_COMPILE): here.
130 Add more distcc patterns.
131
132 2010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
133
134 tests: fix maintainer-xml-check.
135 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
136 Update output to include comments now produced by --graph.
137 (xsl:template match="automaton"): As for --graph, name the
138 digraph after the grammar file.
139 * src/print-xml.c (escape_bufs): Enlarge array.
140 (print_xml): Add bug-report and url attributes to
141 bison-xml-report element.
142
143 2010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
144
145 In DOT output, convert from "/*" comments to "//" comments.
146 This handles the possibility that a "*/" might appear in
147 variable portions of those comments at some point in the future.
148 * src/graphviz.c (start_graph): Implement.
149
150 2010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
151
152 Document that undefined %prec identifier warnings will remain.
153 * NEWS (2.4.3): Here.
154 (2.4.2): Here.
155
156 2010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
157
158 Revert 2009-12-30 change for undefined %prec token complaints.
159 That is, keep them as warnings because that should be sufficient
160 to satisfy POSIX without creating backward compatibility issues.
161 Suggested by Richard Stallman at
162 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
163 * NEWS (2.5): Remove mention of complaint.
164 * src/reader.c (grammar_rule_check): Convert complaint back to
165 warning.
166 * tests/input.at (%prec's token must be defined): Update.
167
168 2010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
169
170 build: don't require src/bison during bootstrap.
171 Suggested by Eric Blake at
172 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
173 * bootstrap.conf (bootstrap_epilogue): New function to make sure
174 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
175
176 2010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
177
178 i18n: fix untranslatable string.
179 Reported by Goran Uddeborg at
180 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
181 * src/muscle-tab.c (muscle_percent_define_insert): Here.
182
183 2010-04-13 Akim Demaille <demaille@gostai.com>
184
185 tests: calc: minor refactoring.
186 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
187
188 2010-04-13 Akim Demaille <demaille@gostai.com>
189
190 tests: calc: simplify location management.
191 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
192 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
193 define the appropriate AT_LOC accessors.
194 * tests/calc.at: Use AT_LOC accessors.
195
196 2010-04-13 Akim Demaille <demaille@gostai.com>
197
198 test location_type.
199 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
200 Define AT_LOCATION_TYPE_IF.
201 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
202 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
203 used, provide a user location type and use it.
204 (Simple LALR1 C++ Calculator): Add a test case for location_type.
205
206 2010-04-13 Akim Demaille <demaille@gostai.com>
207
208 tests: check fclose's return value.
209 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
210
211 2010-04-13 Akim Demaille <demaille@gostai.com>
212
213 tests: don't depend on the actual location type.
214 * tests/calc.at: Use yy::parser::location_type rather than
215 yy::location, since the former is always right, and might point to
216 another type than the latter.
217
218 2010-04-13 Akim Demaille <demaille@gostai.com>
219
220 formatting changes.
221 * tests/calc.at: Formatting changes.
222
223 2010-04-13 Akim Demaille <demaille@gostai.com>
224
225 lalr1.cc: remove useless forward declaration.
226 * data/lalr1.cc: Include location.hh before stack.hh.
227 Remove the useless forward declarations of position and location.
228 Reported by Chris Morley.
229 * data/glr.cc: Likewise.
230
231 2010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
232
233 * NEWS (2.4.3): Mention fix for Sun Studio C++.
234
235 2010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
236
237 tests: fix for newer Sun Studio C++.
238 Reported by Dagobert Michelsen at
239 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
240 * THANKS (Dagobert Michelsen): Add.
241 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
242 Autoconf macro for handling the restrict keyword.
243 * gnulib: Update to latest, which no longer overrides that macro
244 from Autoconf.
245
246 2010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
247
248 portability: fix pointer arithmetic to conform to C standard.
249 Reported by Tys Lefering at
250 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
251 This fix is already implemented in glr.c and does not apply to
252 lalr1.java.
253 * data/lalr1.cc (yy::parser::parse): Increase size of
254 yyerror_range and adjust subscripting so you don't have to
255 subtract one from the beginning of the array.
256 * data/yacc.c (b4_declare_parser_state_variables,
257 yyparse, yypush_parse): Likewise.
258
259 2010-04-05 Akim Demaille <demaille@gostai.com>
260
261 remove useless include.
262 * src/graphviz.h: Don't include stdbool.h.
263
264 2010-04-05 Akim Demaille <demaille@gostai.com>
265
266 graph: sign the output file.
267 * src/graphviz.c (start_graph): Issue comments about Bison.
268 Suggested by Tys Lefering.
269
270 2010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
271
272 portability: fix test suite for GCC 4.5's new #error message.
273 Reported by Tys Lefering at
274 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
275 * NEWS (2.4.3): Mention.
276 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
277
278 2010-03-30 Akim Demaille <demaille@gostai.com>
279
280 fix comments.
281 * src/graphviz.h: Add missing license notice.
282 Document.
283
284 2010-03-25 Akim Demaille <demaille@gostai.com>
285
286 tests: fix 250: parse.error=verbose overflow.
287 * tests/regression.at (parse.error=verbose overflow): Avoid the
288 double inclusion of stdlib.h as it triggers hard errors.
289
290 2010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
291
292 portability: fix for BSD make.
293 Reported by Johan van Selst at
294 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
295 * tests/Makefile.am ($(TESTSUITE)): Qualify package.m4 in
296 this dependency list as in package.m4's target rule.
297
298 2010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
299
300 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
301 Reported by Johan van Selst at
302 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
303 * NEWS (2.4.3): New.
304 * THANKS (Johan van Selst): Add.
305 * gnulib: Update to latest.
306
307 2010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
308
309 maint: update for changes to gnulib's announce-gen.
310 * HACKING (Announce): RELEASE_TYPE=major must now be written
311 RELEASE_TYPE=stable.
312
313 2010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
314
315 Version 2.4.2.
316 * NEWS (2.4.2): Set version and date. For the recent test suite
317 portability fixes, don't be so optimistic about their success
318 given the lack of feedback on the affected platforms.
319
320 2010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
321
322 tests: fix maintainer-xml-check for recent changes.
323 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
324 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
325 output file whose name conflicts with a previous output file
326 is now never generated.
327
328 2010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
329
330 portability: fix several issues with M4 subprocess.
331
332 M4's output pipe was not being drained upon fatal errors during
333 scan_skel. As a result, broken-pipe messages from M4 were seen
334 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
335 failure in the test suite. The problem was that, on platforms
336 where the default disposition for SIGPIPE is ignore instead of
337 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
338 then reported it. However, there's some sort of race condition,
339 because the new test group occasionally succeeded.
340 Reported by Albert Chin at
341 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
342
343 There were also problems with the test suite livelocking on
344 Tru64 5.1b. Reported by Didier Godefroy at
345 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
346 Switching to create_pipe_bidi suggested by Akim Demaille.
347
348 To attempt to solve both of these problems, switch to gnulib's
349 create_pipe_bidi and register M4 process as a slave. Along the
350 way, clean up file name conflict handling, which was affected by
351 the broken-pipe problem before the switch.
352 * NEWS (2.4.2): Document.
353 * THANKS (Didier Godefroy): Add.
354 * bootstrap.conf (gnulib_modules): Add pipe.
355 * gnulib: Update to latest to make sure we have all the latest
356 fixes.
357 * lib/Makefile.am (libbison_a_SOURCES): Remove subpipe.h and
358 subpipe.c.
359 * po/POTFILES.in (lib/subpipe.c): Remove.
360 * src/files.c (compute_output_file_names): Update invocations
361 of output_file_name_check.
362 (output_file_name_check): In the case that the grammar file
363 would be overwritten, use complain instead of fatal, but replace
364 the output file name with /dev/null. Use the /dev/null solution
365 for the case of two conflicting output files as well because it
366 seems safer in case Bison one day tries to open both files at
367 the same time.
368 * src/files.h (output_file_name_check): Update prototype.
369 * src/output.c (output_skeleton): Use create_pipe_bidi and
370 wait_subprocess. Assert that scan_skel completely drains the
371 pipe.
372 * src/scan-skel.l (at_directive_perform): Update
373 output_file_name_check invocation.
374 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
375 grammar file actually isn't overwritten.
376 (Conflicting output files: -o foo.y): Update expected output.
377 * tests/skeletons.at (Fatal errors but M4 continues producing
378 output): New test group.
379
380 2010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
381
382 Update POTFILES.
383 * HACKING (Release Procedure): Add reminder about keeping
384 POTFILES files up-to-date.
385 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
386
387 2010-02-01 Joel E. Denny <jdenny@clemson.edu>
388
389 Code cleanup.
390 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
391 which is already defined in atconfig.
392
393 2010-01-21 Joel E. Denny <jdenny@clemson.edu>
394
395 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
396
397 2010-01-21 Joel E. Denny <jdenny@clemson.edu>
398
399 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
400 * HACKING (Release Procedure): Update notes on copyright years.
401 * Makefile.am (update-package-copyright-year): New target rule.
402 * build-aux/update-package-copyright-year: New file.
403 * cfg.mk (update-copyright): Add update-package-copyright-year
404 as a dependency.
405
406 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
407
408 * bootstrap: Import improvements from latest gnulib.
409
410 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
411
412 build: require Automake 1.11.1 to avoid a security flaw.
413 * HACKING (Release Procedure): Don't document Automake security
414 flaw here.
415 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
416 why here.
417
418 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
419
420 gnulib: update to latest.
421
422 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
423
424 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
425
426 2010-01-15 Joel E. Denny <jdenny@clemson.edu>
427
428 Thank the developer of the initial push parser implementation.
429 This unfortunate oversight is several years old.
430 * THANKS (Odd Arild Olsen): Add.
431
432 2010-01-04 Joel E. Denny <jdenny@clemson.edu>
433
434 Fix some comments concerning LR(0) versus LALR(1).
435
436 Stop equating LR(0) with nondeterminism and LALR(1) with
437 determinism. That is, if all states are consistent, then LR(0)
438 tables are deterministic. On the other hand, LALR(1) tables
439 might be nondeterministic before conflict resolution, and GLR
440 permits LALR(1) tables to remain nondeterministic.
441 * src/LR0.c, src/LR0.h: Here.
442 * src/lalr.c, src/lalr.h: Here.
443 * src/main.c (main): Here.
444 * src/state.c, src/state.h: Here.
445
446 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
447 parser tables.
448
449 2010-01-04 Joel E. Denny <jdenny@clemson.edu>
450
451 maint: run "make update-copyright"
452
453 2009-12-30 Joel E. Denny <jdenny@clemson.edu>
454
455 POSIX: complain if %prec's token was not defined.
456 * NEWS (2.5): Document.
457 * src/reader.c (grammar_rule_check): Convert warning to
458 complaint.
459 * tests/input.at (%prec's token must be defined): Update.
460
461 2009-12-30 Joel E. Denny <jdenny@clemson.edu>
462
463 POSIX: warn if %prec's token was not defined.
464 Reported by Florian Krohm at
465 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
466 * NEWS (2.4.2): Document.
467 * src/reader.c (grammar_rule_check): Implement.
468 (grammar_current_rule_prec_set): Add comments explaining that we
469 here assume a %prec identifier is a token, but we still manage
470 to support POSIX.
471 * tests/input.at (%prec's token must be defined): New test
472 group.
473
474 2009-12-31 Joel E. Denny <jdenny@clemson.edu>
475
476 * HACKING (Release Procedure): Recommend a secure automake.
477
478 2008-12-11 Akim Demaille <demaille@gostai.com>
479
480 Propagate i18n changes into glr.c.
481 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
482 building the error message format dynamically.
483 * data/lalr1.java: Formatting changes.
484
485 2009-12-22 Joel E. Denny <jdenny@clemson.edu>
486
487 Port small part of master's 11707b2b so future ports are easier.
488 * data/lalr1.java (YYParser::yysyntax_error): Untabify.
489
490 2008-12-11 Akim Demaille <demaille@gostai.com>
491
492 Simplify the i18n of the error messages.
493 * data/lalr1.cc: Comment changes.
494
495 2008-11-11 Akim Demaille <demaille@gostai.com>
496
497 Prefer M4 to CPP.
498 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
499 YYERROR_VERBOSE.
500
501 2008-11-11 Akim Demaille <demaille@gostai.com>
502
503 Support i18n of the parse error messages.
504 * TODO (lalr1.cc/I18n): Remove.
505 * data/lalr1.cc (yysyntax_error_): Support the translation of the
506 error messages, as done in yacc.c.
507 Stay within the yy* pseudo namespace.
508
509 2009-12-22 Joel E. Denny <jdenny@clemson.edu>
510
511 Port small part of master's 8901f32e so future ports are easier.
512 * data/lalr1.cc (yy::parser::yysyntax_error_): Always add second
513 argument, but name it in the function definition only when
514 verbose error messages are enabled and it'll thus be used.
515 (yy::parser::parse): Update use of yysyntax_error_.
516
517 2009-12-29 Joel E. Denny <jdenny@clemson.edu>
518
519 portability: `<' and `>' are not always defined on addresses.
520 Specifically, don't sort objects by their memory addresses when
521 they're not allocated in the same array or other object. Though
522 I haven't found a test case where that fails on my platform, C
523 says the behavior is undefined.
524 * src/AnnotationList.c (AnnotationList__insertInto): Remove
525 FIXME. Use new id field of InadequacyList nodes rather than
526 their memory addresses when sorting.
527 (AnnotationList__compute_from_inadequacies): Add
528 inadequacy_list_node_count argument to pass to
529 InadequacyList__new_conflict.
530 * src/AnnotationList.h
531 (AnnotationList__compute_from_inadequacies): Update prototype
532 and documentation for new argument.
533 * src/InadequacyList.c (InadequacyList__new_conflict): Add
534 node_count argument and use it to assign a unique ID.
535 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
536 (InadequacyList): Add id field.
537 (InadequacyList__new_conflict): Update prototype and
538 documentation for new argument.
539 * src/ielr.c (ielr_compute_annotation_lists): Update
540 AnnotationList__compute_from_inadequacies invocation.
541
542 2009-12-20 Joel E. Denny <jdenny@clemson.edu>
543
544 Fix handling of yychar manipulation in user semantic actions.
545 The problem was that yacc.c didn't always update the yychar
546 translation afterwards. However, other skeletons appear to be
547 fine. glr.c appears to already translate yychar before every
548 use. lalr1.cc does not define yychar and does not document its
549 replacement, yyla, for users. It does provide yyclearin, but
550 that does not manipulate yyla and thus requires no translation
551 update. In lalr1.java, yychar is out of scope during semantic
552 actions.
553 * NEWS (2.5): Document.
554 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
555 yytoken here.
556 (yyparse, yypush_parse): Instead, translate before every use of
557 yytoken, and add comments explaining this approach.
558 * tests/actions.at (Destroying lookahead assigned by semantic
559 action): New test group checking that translation happens before
560 lookahead destructor calls at parser return. Previously,
561 incorrect destructors were called.
562 * tests/conflicts.at (%error-verbose and consistent
563 errors): New test group checking that translation happens at
564 syntax error detection before the associated verbose error
565 message and the associated lookahead destructor calls. While
566 the destructor call is fixed by this patch, the verbose error
567 message is currently incorrect due to another bug (see
568 comments in test group), so this is an expected failure for now.
569
570 2009-12-21 Joel E. Denny <jdenny@clemson.edu>
571
572 YYFAIL: warn about uses and remove from lalr1.java.
573 * NEWS (2.5): Document.
574 * data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
575 and make it private. Update all uses.
576 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
577
578 2009-12-21 Joel E. Denny <jdenny@clemson.edu>
579
580 YYFAIL: deprecate.
581 * NEWS (2.4.2): Document deprecation and the phase-out plan.
582 * data/lalr1.java (parser::YYStack::YYFAIL): Add comment about
583 deprecation.
584 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
585 YYFAIL from GCC cpp's -Wunused-macros.
586 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
587 documentation.
588 (LocalWords): Remove YYFAIL.
589
590 2009-12-17 Joel E. Denny <jdenny@clemson.edu>
591
592 Code cleanup.
593 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
594 function, which is no longer used.
595
596 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
597
598 Add gcc's -Wundef to test suite and fix another warning from it.
599 * NEWS (2.4.2): Update description of -Wundef fix.
600 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
601 (WARN_CFLAGS_TEST): New substitution.
602 * data/glr.c: Avoid warning about __STRICT_ANSI__.
603 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
604 WARN_CFLAGS.
605 (NO_WERROR_CFLAGS): Likewise.
606 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
607
608 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
609
610 * data/yacc.c: Reformat m4 a little.
611
612 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
613
614 Document gcc -Wundef fix.
615 * NEWS (2.4.2): Here.
616 * THANKS (Jonathan Nieder): Add.
617
618 2009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
619
620 Simplify y.tab.c when location tracking is disabled.
621 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
622 tracking is not enabled. Instead, unconditionally define
623 YY_LOCATION_PRINT as a no-op for backward compatibility.
624
625 2009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
626
627 Avoid warnings from gcc -Wundef y.tab.c.
628 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
629 defined before using them.
630 * data/lalr1.cc: Likewise.
631 * data/yacc.c: Likewise.
632
633 2009-12-15 Joel E. Denny <jdenny@clemson.edu>
634
635 autoconf: update to latest for fix of M4 detection.
636 Reported by Eric Blake.
637 * submodules/autoconf: Update.
638
639 2009-12-15 Joel E. Denny <jdenny@clemson.edu>
640
641 portability: use -DGNULIB_POSIXCHECK.
642 Reported by Eric Blake. See discussions at
643 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
644 and
645 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
646 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
647 * bootstrap.conf (gnulib_modules): Add all the printf modules
648 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
649 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
650 (excluded_files): Remove m4/printf-posix.m4.
651 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
652 lib/libbison.a so gnulib libraries can be linked.
653
654 2009-12-14 Joel E. Denny <jdenny@clemson.edu>
655
656 Enable assertion output and --disable-assert for configure.
657 * bootstrap.conf (gnulib_modules): Add assert module.
658 * src/system.h (aver): Define as assert, and summarize the
659 discussion on this issue.
660
661 2009-12-14 Joel E. Denny <jdenny@clemson.edu>
662
663 Expand GLR acronym in summary of Bison.
664 Based on discussion with Akim Demaille starting at
665 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
666 * doc/bison.texinfo (Introduction): Here.
667 * src/getargs.c (usage): Here.
668
669 2009-10-03 Alex Rozenman <rozenman@gmail.com>
670
671 Document named references.
672 * doc/bison.texinfo (Actions): Add new example and xref to
673 Using Named References node.
674 (Using Named References): New node.
675
676 2009-10-16 Joel E. Denny <jdenny@clemson.edu>
677
678 cleanup.
679 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
680 of char*.
681 (Sbitset__isEmpty): Use Sbitset instead of char*.
682 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
683 instead of char. This helps to avoid casting errors.
684 (Sbitset__or): Use Sbitset instead of char*.
685
686 2009-10-16 Joel E. Denny <jdenny@clemson.edu>
687
688 portability: don't assume 8-bit bytes.
689 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
690 * src/Sbitset.h (Sbitset__nbytes): Here.
691 (Sbitset__byteAddress): Here.
692 (Sbitset__bit_mask): Here.
693 (Sbitset__last_byte_mask): Here.
694 (Sbitset__ones): Here.
695 (SBITSET__FOR_EACH): Here.
696
697 2009-10-11 Joel E. Denny <jdenny@clemson.edu>
698
699 portability: use va_start and va_end in the same function.
700 * src/complain.c (error_message): Move va_end from here...
701 (ERROR_MESSAGE): ... to here.
702
703 2009-10-08 Joel E. Denny <jdenny@clemson.edu>
704
705 * data/bison.m4: Update comments for rename to muscle-tab.h.
706
707 2009-10-08 Joel E. Denny <jdenny@clemson.edu>
708
709 Rename muscle_tab.* to muscle-tab.* for consistency with master.
710 * src/Makefile.am (bison_SOURCES): Update.
711 * src/getargs.c, src/ielr.c, src/lalr.c, src/main.c,
712 src/output.c, src/parse-gram.y, src/print.c, src/reader.c,
713 src/tables.c: Update include.
714 * src/muscle_tab.c, src/muscle_tab.h: Rename to...
715 * src/muscle-tab.c, src/muscle-tab.h: ... these and update
716 include.
717
718 2009-10-07 Joel E. Denny <jdenny@clemson.edu>
719
720 Minor code cleanup.
721 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
722 replace all uses with UNIQSTR_CONCAT.
723 * src/uniqstr.c (uniqstr_vsprintf): New function.
724 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
725 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
726 macros.
727
728 2009-10-04 Joel E. Denny <jdenny@clemson.edu>
729
730 Minor code cleanup.
731 * src/parse-gram.y: Clean up sorting of declarations.
732 Use types to simplify %printer declarations where possible.
733 Provide %printer for BRACKETED_ID and symbol.prec.
734 * src/symtab.c: Whitespace change.
735
736 2009-10-04 Joel E. Denny <jdenny@clemson.edu>
737
738 tests: skip tests of file names that platform does not support.
739 Reported by Michael Raskin at
740 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
741 * THANKS (Michael Raskin): Add.
742 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
743 to fail at least for file names containing ":" or "\".
744
745 2009-09-23 Joel E. Denny <jdenny@clemson.edu>
746
747 yysyntax_error: avoid duplicate lookahead collection.
748 Except when memory reallocation is required, this change
749 eliminates the need to invoke yysyntax_error twice and thus to
750 repeat the collection of lookaheads. It also prepares for
751 future extensions that will make those repetitions more
752 expensive and that will require additional memory management in
753 yysyntax_error. Finally, it fixes an obscure bug already
754 exercised in the test suite.
755 * data/yacc.c (yysyntax_error): Add arguments for message
756 buffer variables stored in the parser. Instead of size, return
757 status similar to yyparse status but indicating success of
758 message creation. Other than the actual reallocation of the
759 message buffer, import and clean up memory management code
760 from...
761 (yyparse, yypush_parse): ... here.
762 * tests/regression.at (%error-verbose overflow): No longer an
763 expected failure.
764
765 2009-09-23 Joel E. Denny <jdenny@clemson.edu>
766
767 yysyntax_error: test memory management more.
768 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
769 * tests/regression.at (%error-verbose and YYSTACK_USE_ALLOCA):
770 New test group.
771 (%error-verbose overflow): New test group that reveals an
772 obscure bug. Expected fail for now.
773
774 2008-12-11 Akim Demaille <demaille@gostai.com>
775
776 Pass the token type to yysyntax_error.
777 * data/yacc.c (yysyntax_error): Take the transated token instead
778 of the raw number.
779 Adjust callers.
780
781 2008-12-11 Akim Demaille <demaille@gostai.com>
782
783 Simplify the i18n of the error messages.
784 * data/yacc.c (yysyntax_error): Rewrite, using a switch instead
785 of building dynamically the format string.
786
787 2009-10-03 Joel E. Denny <jdenny@clemson.edu>
788
789 Remove dead code.
790 * src/symtab.c (symbol_pack): Here because every symbol's number
791 is always defined by this time.
792
793 2009-10-03 Alex Rozenman <rozenman@gmail.com>
794
795 Add additional space after periods in NEWS.
796 * NEWS (2.5): here.
797
798 2009-09-29 Joel E. Denny <jdenny@clemson.edu>
799
800 Use the correct conversion specifier for size_t.
801 Reported by Jim Meyering.
802 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
803 because Sbitset__Index is size_t.
804 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
805
806 2009-09-27 Joel E. Denny <jdenny@clemson.edu>
807
808 tests: don't abuse AT_BISON_CHECK.
809 * tests/regression.at (parse-gram.y: LALR = IELR): Move
810 additional shell commands outside of AT_BISON_CHECK.
811
812 2009-09-26 Joel E. Denny <jdenny@clemson.edu>
813
814 tests: check that parse-gram.y's IELR and LALR are identical.
815 * tests/atlocal.in (abs_top_srcdir): New shell variable.
816 * tests/regression.at (parse-gram.y: LALR = IELR): New test
817 group.
818
819 2009-09-16 Akim Demaille <demaille@gostai.com>
820
821 doc: comment changes.
822 * doc/bison.texinfo: Comment changes.
823
824 2009-09-16 Akim Demaille <demaille@gostai.com>
825
826 doc: spell checking.
827 * doc/bison.texinfo: here.
828
829 2009-09-19 Alex Rozenman <rozenman@gmail.com>
830
831 Keep sub-messages aligned. Fix strings for translation.
832 * src/location.h (location_print): Add return value.
833 * src/location.c (location_print): Return number of printed
834 characters.
835 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
836 new functions.
837 * src/complain.cpp (indent_ptr): New static variable.
838 (error_message, complain_at_indent, warn_at_indent): Implement
839 the alignment mechanism.
840 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
841 for translations. Use new alignment mechanism.
842 * tests/named-ref.at: Adjust test-cases.
843 * NEWS (2.5): Add an announcement about named references.
844
845 2009-09-13 Joel E. Denny <jdenny@clemson.edu>
846
847 tests: clean up push.at test group titles.
848 * tests/push.at: Remove "Push Parsing: " from test group titles
849 because these are already under the banner "Push Parsing Tests".
850
851 2009-09-12 Alex Rozenman <rozenman@gmail.com>
852
853 Provide an additional sub-message for clarity.
854 Add "symbol not found in production" error message when
855 an "invalid reference" is detected in named references
856 resolution.
857 * src/scan-code.l: Update "invalid reference" case.
858 * tests/named-ref.at: Adjust test-cases.
859
860 2009-09-10 Joel E. Denny <jdenny@clemson.edu>
861
862 Clean up yacc.c a little.
863 * data/yacc.c: Clean up M4 for readability, and make output
864 whitespace more consistent. For the main parse function
865 comment, instead of saying "yyparse or yypush_parse", say either
866 "yyparse" or "yypush_parse" depending on which it actually is.
867
868 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
869
870 Complain about unused %define variables and %code qualifiers.
871 * NEWS (2.5): Document.
872 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
873 * doc/bison.texinfo (Decl Summary): Document complaint, and
874 improve %define documentation a little otherwise.
875 * tests/input.at (Reject unused %code qualifiers): Update.
876 (%define errors): Update.
877 (%define, --define, --force-define): Update.
878 (%define backward compatibility): Update.
879 (Unused %define api.pure): Update.
880 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
881
882 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
883
884 Use aver not assert.
885 * src/output.c: Don't include assert.h.
886 (output_skeleton): Use aver not assert.
887 * src/system.h (aver): In documentation of why, add links to
888 Paul Eggert's explanations in the mailing lists.
889
890 2009-09-05 Alex Rozenman <rozenman@gmail.com>
891
892 Use "Unresolved reference" error message when no symbols were found
893 in a symbolic reference resolution. Remove .expr and -expr from
894 the shown reference when the reference is unresolved.
895 * src/scan-code.l: Change the error message, adjust location columns,
896 rename variable "exact_mode" to "explicit_bracketing".
897 * tests/named-ref.at: Adjust existing tests and add a new one.
898
899 2009-09-03 Akim Demaille <demaille@gostai.com>
900
901 * NEWS (2.4.2): Add "Internationalization" item.
902
903 2009-09-03 Akim Demaille <demaille@gostai.com>
904
905 bootstrap: fix/improve find_tool.
906 * bootstrap (find_tool): Improve error messages.
907 Fix typo about find_tool_names.
908
909 2009-08-29 Joel E. Denny <jdenny@clemson.edu>
910
911 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
912 See
913 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
914 * src/scan-code.h (code_props_rule_action_init): Rename
915 named_ref arg to name so it doesn't shadow named_ref type. This
916 makes it consistent with the function definition in scan-code.l
917 anyway.
918
919 2009-08-28 Joel E. Denny <jdenny@clemson.edu>
920
921 %define: accept unquoted values.
922 * NEWS (2.5): Group all %define changes together, and document
923 this one. Remove quotes in IELR and canonical LR entry.
924 * doc/bison.texinfo: Remove quotes in most examples throughout.
925 (Decl Summary): Update %define documentation.
926 (Table of Symbols): Likewise.
927 * src/ielr.c (LrType): Update documentation.
928 * src/parse-gram.y (content.opt): Add production for ID.
929 * tests/calc.at: Remove quotes in most tests.
930 * tests/existing.at: Likewise.
931 * tests/input.at: Likewise.
932 * tests/local.at: Likewise.
933 * tests/push.at: Likewise.
934 * tests/reduce.at: Likewise.
935 * tests/torture.at: Likewise.
936
937 2009-08-28 Joel E. Denny <jdenny@clemson.edu>
938
939 %define lr.type: make values lowercase IDs.
940 That is, "LALR" => "lalr", "IELR" => "ielr", and
941 "canonical LR" => "canonical-lr".
942 * NEWS (2.5): Update documentation.
943 * doc/bison.texinfo (Decl Summary): Likewise.
944 * src/ielr.c (ielr): Use new values.
945 * src/ielr.h (ielr): Update documentation.
946 * src/reader.c (prepare_percent_define_front_end_variables): Use
947 and validate new values.
948 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
949 grammars.
950 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
951
952 2009-08-27 Eric Blake <ebb9@byu.net>
953
954 scan-gram: avoid portability trap with ctype usage.
955 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
956 Avoid compiler warning.
957
958 2009-08-27 Joel E. Denny <jdenny@clemson.edu>
959
960 tests: use perl for printing special sequences to files.
961 And skip tests if perl is not available. This is better than
962 playing tricks with shell portability. Suggested by Akim
963 Demaille.
964 * tests/input.at (Bad character literals): Use it here for
965 omitting final newlines.
966 (Bad escapes in literals): Use it here for special characters.
967
968 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
969
970 tests: show a use of %define lr.default-reductions "consistent"
971 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
972 prevents the omission of expected tokens for %error-verbose.
973
974 2009-08-26 Akim Demaille <demaille@gostai.com>
975
976 tests: portability fix.
977 * tests/input.at (Bad escapes in literals): Don't expect "echo
978 '\0'" to output \ then 0.
979
980 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
981
982 Actually handle the yytable zero value correctly this time.
983 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Don't
984 mention zero values in the YYTABLE comments.
985 * data/glr.c (yytable_value_is_error): Don't check for zero
986 value.
987 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
988 * data/yacc.c (yytable_value_is_error): Likewise.
989 * data/lalr1.java (yy_table_value_is_error_): Likewise.
990 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
991 * src/tables.h: In header comments, explain why it's useless to
992 check for a zero value in yytable.
993
994 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
995
996 More fixes related to last two patches.
997 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
998 defined.
999 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Fix
1000 yytable comments: zero indicates syntax error not default
1001 action.
1002 * data/glr.c (yyis_pact_ninf): Rename to...
1003 (yypact_value_is_default): ... this.
1004 (yyisDefaultedState): Update for rename.
1005 (yyis_table_ninf): Rename to...
1006 (yytable_value_is_error): ... this, and check for value zero
1007 besides just YYTABLE_NINF.
1008 (yygetLRActions): Check for default value from yypact. It
1009 appears that this check is always performed before this function
1010 is invoked, and so adding the check here is probably redundant.
1011 However, the code may evolve after this subtlety is forgotten.
1012 Also, update for rename to yytable_value_is_error. Because that
1013 macro now checks for zero, a different but equivalent branch of
1014 the if-then-else here is evaluated.
1015 (yyreportSyntaxError): Update for rename to
1016 yytable_value_is_error. The zero condition was mishandled
1017 before.
1018 (yyrecoverSyntaxError): Update for renames. No behavioral
1019 changes.
1020 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1021 New function.
1022 (yy_table_value_is_error_): New function.
1023 (parse): Use new functions where possible. No behavioral
1024 changes.
1025 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1026 The zero condition was mishandled before.
1027 * data/yacc.c (yyis_pact_ninf): Rename to...
1028 (yypact_value_is_default): ... this.
1029 (yyis_table_ninf): Rename to...
1030 (yytable_value_is_error): ... this, and check for value zero
1031 besides just YYTABLE_NINF.
1032 (yysyntax_error): Update for rename to yytable_value_is_error.
1033 The zero condition was mishandled before.
1034 (yyparse): Update for renames. No behavioral changes.
1035 * src/tables.h: Improve comments about yypact, yytable, etc.
1036 more. Most importantly, say yytable value of zero means syntax
1037 error not default action.
1038
1039 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
1040
1041 Fix %error-verbose for conflicts resolved by %nonassoc.
1042 * NEWS (2.5): Document.
1043 * data/glr.c (yyreportSyntaxError): Fix this by checking
1044 yyis_table_ninf.
1045 * data/yacc.c (yysyntax_error): Likewise.
1046 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1047 yytable_ninf_.
1048 * data/lalr1.java (yysyntax_error): Likewise.
1049 * tests/conflicts.at (%nonassoc and eof): Update expected output
1050 and remove FIXME.
1051
1052 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
1053
1054 Some code and documentation improvements.
1055 * data/c.m4 (b4_table_value_equals): New macro to capture
1056 some repeated code.
1057 * data/glr.c (yyis_pact_ninf): Use it here.
1058 (yyis_table_ninf): Likewise.
1059 (yyreportSyntaxError): Improve internal comments.
1060 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1061 Use it everywhere possible.
1062 (yyis_table_ninf): Likewise.
1063 (yysyntax_error): Improve internal comments.
1064 * data/lalr1.cc (yysyntax_error_): Likewise.
1065 * data/lalr1.java (yysyntax_error): Likewise.
1066 * src/tables.h: Improve comments about yypact, yytable, etc.
1067
1068 2009-08-21 Joel E. Denny <jdenny@clemson.edu>
1069
1070 Use locale when quoting.
1071 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1072 quote rather than implementing quoting here.
1073
1074 2009-08-20 Eric Blake <ebb9@byu.net>
1075
1076 Make previous patch more robust.
1077 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1078 argmatch.h.
1079 (output_skeleton): Use it.
1080 Suggested by Akim Demaille.
1081
1082 Import latest m4/m4.m4.
1083 * submodules/autoconf: Update to autoconf 2.64.
1084 * configure.ac (M4_GNU_OPTION): New define.
1085 * src/output.c (output_skeleton): Use it to resolve FIXME.
1086 * NEWS: Mention this.
1087
1088 2009-08-19 Joel E. Denny <jdenny@clemson.edu>
1089
1090 Fix complaints about escape sequences.
1091 Discussed starting at
1092 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1093 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1094 For a \0 and similar escape sequences meaning the null
1095 character, report an invalid escape sequence instead of an
1096 invalid null character because the latter does not actually
1097 appear in the user's input.
1098 In all escape sequence complaints, don't escape the initial
1099 backslash, and don't quote when the sequence appears at the end
1100 of the complaint line unless there's whitespace that quotearg
1101 won't escape.
1102 Consistently say "invalid" not "unrecognized".
1103 Consistently prefer "empty character literal" over "extra
1104 characters in character literal" warning for invalid escape
1105 sequences; that is, consistently discard those sequences.
1106 * tests/input.at (Bad escapes in literals): New.
1107
1108 2009-08-19 Akim Demaille <demaille@gostai.com>
1109
1110 doc: fixes.
1111 * doc/bison.texinfo: Fix minor Texinfo errors.
1112
1113 2009-08-19 Akim Demaille <demaille@gostai.com>
1114
1115 doc: %initial-action to initialize yylloc.
1116 Reported by Bill Allombert.
1117 * doc/bison.texinfo: Set fill-column to 76.
1118 (Location Type): Document the use of %initial-action to initialize
1119 yylloc.
1120
1121 2009-08-18 Joel E. Denny <jdenny@clemson.edu>
1122
1123 maint: update for gnulib's recent update-copyright changes
1124 * gnulib: Update.
1125 * .x-update-copyright (COPYING): Add as it's no longer implied
1126 when .x-update-copyright is present.
1127 * cfg.mk (update-copyright-local): Remove, now ignored.
1128 (update-copyright): Declare update-b4-copyright as a dependency.
1129
1130 2009-08-17 Akim Demaille <demaille@gostai.com>
1131
1132 build: require gettext 0.17.
1133
1134 Suggested by Bruno Haible.
1135 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1136 * configure.ac: require gettext 0.17 to ensure compatibility with
1137 gnulib.
1138
1139 2009-08-17 Akim Demaille <demaille@gostai.com>
1140
1141 build: lower gettext requirements.
1142
1143 Bison was uselessly requiring the formatstring macros from
1144 gettext, which resulted in mo files not being installed on systems
1145 that perfectly supported Bison mo files. Lower the requirement.
1146 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1147
1148 * configure.ac: Require need-ngettext instead of
1149 need-formatstring-macros.
1150 Reported by Martin Jabocs.
1151 Suggested by Bruno Haible.
1152 * INSTALL: Restructure.
1153 (Internationalization): New.
1154
1155 2009-08-14 Joel E. Denny <jdenny@clemson.edu>
1156
1157 maint: fix use of copyright year intervals.
1158 * gnulib: Update.
1159 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1160 as now recommended in gnulib/NEWS.
1161 * build-aux/update-b4-copyright: Fix.
1162 * cfg.mk (update-copyright-env): Configure update-copyright.
1163
1164 2009-08-13 Joel E. Denny <jdenny@clemson.edu>
1165
1166 Make it easier to write deterministic tests.
1167 Continues Akim's work from his 2009-06-10 commits.
1168 * src/reader.c (check_and_convert_grammar): Don't add any
1169 symbols after the first symbols_do invocation.
1170 * src/symtab.c (symbols_sorted): New static global.
1171 (user_token_number_redeclaration): Update comments.
1172 (symbol_from_uniqstr): If a new symbol is being created, assert
1173 that symbols_sorted hasn't been allocated yet.
1174 (symbols_free): Free symbols_sorted.
1175 (symbols_cmp, symbols_cmp_qsort): New functions.
1176 (symbols_do): Sort symbol_table into symbols_sorted on first
1177 invocation.
1178 * tests/input.at (Numbered tokens): Recombine tests now that the
1179 output should be deterministic across multiple numbers.
1180
1181 2009-08-12 Akim Demaille <demaille@gostai.com>
1182
1183 distcheck: fix.
1184
1185 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
1186
1187 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
1188
1189 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
1190
1191 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
1192
1193 Miscellaneous code readability improvements.
1194
1195 * src/reader.c (reader): Move %define front-end variable
1196 defaults and checking into...
1197 (prepare_percent_define_front_end_variables): ... this new
1198 function.
1199
1200 * src/scan-gram.l (INITIAL): For consistency with string
1201 literals, don't store open quote on character literal. It's
1202 discarded before returning anyway.
1203 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1204 Make length test more readable, and make the character stored
1205 for an empty literal more obvious while consistent with the
1206 previous behavior.
1207
1208 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1209 USER_NUMBER_HAS_STRING_ALIAS throughout.
1210 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1211 that is repeated in symtab.h. Improve argument names to make it
1212 clear which side of the symbol-string alias pair is which.
1213 (symbol_check_alias_consistency): Improve local variable names
1214 for the same purpose.
1215 * src/symtab.h (struct symbol): Make comments about aliases
1216 clearer.
1217 (symbol_make_alias): Improve comments and argument name.
1218 * src/output.c (token_definitions_output): Update for rename to
1219 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1220
1221 2009-08-08 Alex Rozenman <rozenman@gmail.com>
1222
1223 Convert "misleading reference" messages to warnings.
1224 * src/scan-code.l: New function 'show_sub_messages', more
1225 factoring.
1226 * tests/named-ref.at: Adjust tests.
1227
1228 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
1229
1230 maint: run "make update-copyright"
1231
1232 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
1233
1234 maint: make update-b4-copyright easier to use
1235 * build-aux/update-b4-copyright: In warnings, report line
1236 numbers rather than character positions.
1237 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1238 that update-copyright runs it.
1239 * gnulib: Update.
1240
1241 2009-08-05 Joel E. Denny <jdenny@clemson.edu>
1242
1243 maint: clean up update-b4-copyright code
1244 * build-aux/update-b4-copyright: Do not accept 2-digit
1245 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1246 Don't accept a `[' in a b4_copyright argument.
1247 Format code more consistently.
1248 Don't assume b4*copyright never occurs.
1249
1250 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1251
1252 maint: automate b4_copyright updates.
1253 * Makefile.am (update-b4-copyright): New target rule.
1254 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
1255 * build-aux/update-b4-copyright: New.
1256 * data/yacc.c: Remove stray characters around b4_copyright
1257 invocations.
1258
1259 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1260
1261 maint: automate annual package-wide copyright-year update.
1262 * .x-update-copyright: New.
1263 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1264 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1265 update-copyright. Remove gnumakefile, which is implied by
1266 maintainer-makefile.
1267 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1268 * gnulib: Update.
1269 * maint.mk: Remove, now copied from gnulib.
1270 * examples/extexi: Add missing "(C)" in copyright statement so
1271 update-copyright can recognize it.
1272 * src/LR0.h: Likewise.
1273 * src/print.h: Likewise.
1274 * src/print_graph.h: Likewise.
1275 * src/gram.c: Add missing comma in copyright statement.
1276 * src/gram.h: Likewise.
1277
1278 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1279
1280 Fix "make distcheck".
1281 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1282 of just calc.stamp.
1283
1284 2009-08-01 Joel E. Denny <jdenny@clemson.edu>
1285
1286 Pacify "gcc -Wunused" for the input function from Flex.
1287 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1288 and later.
1289 * src/scan-code.l: Add "%option noinput", which I cannot find in
1290 the Flex manual, but which Flex has supported since at least as
1291 far back as 2.5.4. However, if any of our developers still use
1292 Flex 2.5.4, they'll need to stop configuring with
1293 --enable-gcc-warnings because "%option noinput" didn't work
1294 correctly until Flex 2.5.6.
1295 * src/scan-gram.l: Likewise.
1296 * src/scan-skel.l: Likewise.
1297
1298 2009-07-31 Alex Rozenman <rozenman@gmail.com>
1299
1300 Fix --enable-gcc-warnings problems.
1301 * src/reader.c: Adjust variable names.
1302 * src/scan-code.l: Fix prototypes and adjust names.
1303 * src/named-ref.c: Remove redundant "if".
1304
1305 2009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1306
1307 Fix a --enable-gcc-warnings problem.
1308 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1309 variable.
1310
1311 2009-07-24 Alex Rozenman <rozenman@gmail.com>
1312
1313 Fix some memory leaks.
1314 * src/named-ref.c: Add a pointer check (named_ref_free).
1315 * src/scan-code.l: New function (variant_table_free). Called in
1316 code_scanner_free.
1317 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1318
1319 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1320
1321 Warn about character literals not of length one.
1322 * NEWS (2.5): Document.
1323 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1324 the length.
1325 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1326 * tests/input.at (Bad character literals): New test group.
1327
1328 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1329
1330 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1331
1332 2009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1333
1334 Some M4 cleanup in the testsuite.
1335 Suggested by Eric Blake at
1336 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1337 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1338 complicate the code by distinguishing between a missing value
1339 and an empty string value for an optional argument. This fix is
1340 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1341 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1342 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1343 arguments are not needed because of the following changes.
1344 Fix stale comments.
1345 Bison developers should use GNU M4 and should not use
1346 POSIXLY_CORRECT when building the test suite, so do not
1347 complicate the code by avoiding $10 and above.
1348 Do not quote an empty string value for an optional argument, and
1349 do not distinguish between a missing value and an empty string
1350 value.
1351
1352 2009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
1353
1354 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
1355
1356 2009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1357
1358 Revert unnecessary column realignment in --help output.
1359 Reported by Akim Demaille at
1360 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1361 * src/getargs.c (usage): Here.
1362
1363 2009-07-04 Alex Rozenman <rozenman@gmail.com>
1364
1365 Alphabetical order in src/Makefile.am.
1366 * src/Makefile.am: Adjust.
1367
1368 2009-07-04 Alex Rozenman <rozenman@gmail.com>
1369
1370 Style changes and factoring.
1371 * src/named-ref.h: Add comments.
1372 * src/parse-gram.y: Readability and style changes.
1373 * src/reader.c: Factoring: assign_named_ref function.
1374 * src/scan-code.l: Factoring and style changes. Rename
1375 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1376 Use "unsigned" type for variant index. Improve readablity.
1377 * src/scan-gram.l: Change error messages and add comments.
1378 * src/symlist.h: symbol_list_null: New function decl.
1379 * src/symlist.c: symbol_list_null: Implement here.
1380 * tests/named-refs.at: Adjust for new error messages.
1381
1382 2009-06-29 Eric Blake <ebb9@byu.net>
1383
1384 scan-code: avoid compiler warnings
1385 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1386
1387 2009-06-29 Akim Demaille <demaille@gostai.com>
1388
1389 build: avoid concurrent extraction of calc++.
1390 * examples/calc++/Makefile.am (calc.stamp): New.
1391 Depend on it to create the sources of calc++ so that concurrent
1392 builds don't launch several "extexi" in parallel.
1393 Not only this is inefficient, this also builds incorrect sources
1394 with several extractions mixed together.
1395
1396 2009-06-27 Alex Rozenman <rozenman@gmail.com>
1397
1398 Implement support for named symbol references.
1399 * src/parse-gram.y: Add new syntax (named_ref.opt).
1400 * src/reader.c: Store named refs in symbol lists.
1401 * src/reader.h: New argument for symbol_append and
1402 action_append functions.
1403 * src/scan-code.h: Add new field (named_ref) into
1404 code_props data structure. Keeps named ref of midrule
1405 actions.
1406 * src/scan-code.l: Support for named refs in semantic
1407 action code. New function 'parse_named_ref'.
1408 * src/scan-gram.l: Support bracketed id.
1409 * src/symlist.c: Store named refs in symbol lists.
1410 * src/symlist.h: New field in symbol list: named_ref.
1411 * src/named-ref.h: New file, a struct for named_ref.
1412 * src/named-ref.cp: New file, named_ref_new function.
1413 * src/local.mk: Add two new files.
1414 * tests/testsuite.at: Include new test group:
1415 * tests/named-refs.at: this new file.
1416
1417 2009-06-25 Akim Demaille <demaille@gostai.com>
1418
1419 hash: check insertion for memory exhaustion.
1420 * src/uniqstr.c (uniqstr_new): New.
1421
1422 2009-06-11 Akim Demaille <demaille@gostai.com>
1423
1424 style changes.
1425 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1426 * src/print-xml.c: Style changes.
1427 * tests/conflicts.at: Comment changes.
1428
1429 2009-06-11 Akim Demaille <demaille@gostai.com>
1430
1431 xml: beware of user strings used to give a %prec to rules.
1432 * tests/conflicts.at (%prec with user strings): New.
1433 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1434 XML output.
1435
1436 2009-06-11 Akim Demaille <demaille@gostai.com>
1437
1438 hash: check insertion for memory exhaustion.
1439 * src/muscle-tab.c (muscle_insert, muscle_grow)
1440 * src/state.c (state_hash_insert): Check the return value of
1441 hash_insert.
1442
1443 2009-06-10 Akim Demaille <demaille@gostai.com>
1444
1445 deterministic test suite.
1446 Some consistency checks on symbols are performed after all the
1447 symbols were read, by an iteration over the symbol table. This
1448 traversal is nondeterministic, which can be a problem for test
1449 cases.
1450 Avoid this.
1451 Addresses another form of nondeterminism reported by Joel E. Denny.
1452 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1453
1454 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1455 test in two.
1456 Use different file names for the three tests to make the
1457 maintenance easier.
1458
1459 2009-06-10 Akim Demaille <demaille@gostai.com>
1460
1461 deterministic user-token-number redeclaration errors.
1462 Address nondeterminism reported by Joel E. Denny.
1463 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1464
1465 * src/uniqstr.h: Comment changes.
1466 * src/location.h (boundary_cmp, location_cmp): New.
1467 * src/symtab.c (user_token_number_redeclaration): New.
1468 (symbol_translation): Use it.
1469 * tests/input.at (Numbered tokens): Adjust the expected output.
1470
1471 2009-05-25 Akim Demaille <demaille@gostai.com>
1472
1473 gnulib: update.
1474 * gnulib: Update to latest.
1475 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1476 * m4/.gitignore: Regen.
1477 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1478 Call xalloc_die on hash_insert failures.
1479 Requested by the new __warn_unused_result__ attribute of
1480 hash_insert.
1481
1482 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1483
1484 Convert multiple variable definition warnings to complaints.
1485 * NEWS (2.5): Add a new entry for that change.
1486 * doc/bison.texinfo (Decl Summary): Update %define entry.
1487 (Bison Options): Update -D/--define/-F/--force-define entry.
1488 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
1489 * src/muscle_tab.h (muscle_percent_define_insert): Update
1490 comments.
1491 * tests/input.at (`%define errors'): Update.
1492 (`%define, --define, --force-define'): Update.
1493
1494 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1495
1496 -F/--force-define and relative %define/-D/--define priorities.
1497 * NEWS (2.5): Add documentation to -D/--define entry.
1498 * build-aux/cross-options.pl: Hard-code association of
1499 --force-define with %define.
1500 * doc/bison.texinfo (Decl Summary): In %define entry,
1501 cross-reference command-line options.
1502 (Bison Options): Add documentation to -D/--define entry.
1503 (Option Cross Key): Widen column for --force-define row.
1504 * src/getargs.c (usage): Document -F/--force-define. Realign
1505 options in output.
1506 (short_options, long_options, getargs): Parse -F/--force-define,
1507 and update muscle_percent_define_insert invocation.
1508 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
1509 (muscle_percent_define_insert): Add argument with that type.
1510 * src/muscle_tab.c (muscle_percent_define_insert): Implement
1511 -F/--force-define behavior and priorities.
1512 * src/parse-gram.y (prologue_declaration): Update
1513 muscle_percent_define_insert invocations.
1514 * tests/input.at (`%define, --define'): Rename to...
1515 (`%define, --define, --force-define'): ... this and extend.
1516
1517 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1518
1519 Update some comments to make sense for -D.
1520 * data/bison.m4 (b4_check_user_names): In header comments, say
1521 "user occurrence" instead of "grammar occurrence".
1522 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
1523 (muscle_percent_code_grow): Likewise just for consistency.
1524
1525 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1526
1527 * data/c++.m4: Update copyright year.
1528
1529 2009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1530
1531 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1532
1533 2009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1534
1535 Handle a trailing `:' in a user-supplied C++ namespace better.
1536 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1537 among the closing braces here. This fix might make the
1538 generated code easier to debug, but otherwise it should be
1539 insignificant because a trailing `:' is a C++ error already.
1540
1541 2009-05-19 Akim Demaille <demaille@gostai.com>
1542
1543 remove useless variable.
1544 * src/getargs.c (skeleton_arg): Remove now useless variable.
1545 Should help the compiler see that this printf-like call is sane.
1546
1547 2009-05-11 Akim Demaille <demaille@gostai.com>
1548
1549 doc: use C++ headers.
1550 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1551 headers.
1552
1553 2009-05-05 Akim Demaille <demaille@gostai.com>
1554
1555 fix hexadecimal token number support.
1556 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
1557
1558 2009-05-05 Akim Demaille <demaille@gostai.com>
1559
1560 tests: check token numbers.
1561 * tests/input.at (Numbered tokens): New.
1562
1563 2009-05-04 Akim Demaille <demaille@gostai.com>
1564
1565 bison: catch bad symbol names.
1566 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1567 * tests/input.at: Adjust.
1568
1569 2009-05-04 Akim Demaille <demaille@gostai.com>
1570
1571 space changes.
1572 * src/scan-gram.l: Untabify to be robust to zealous editors.
1573
1574 2009-05-04 Akim Demaille <demaille@gostai.com>
1575
1576 identifiers: dashes are letters.
1577 Dashes can now start identifiers (symbols and directives).
1578
1579 * src/scan-gram.l ({letter}): Add dash.
1580 ({id}): Remove it.
1581 * tests/input.at (Symbols): Adjust.
1582 Remove stray comment.
1583 * tests/regression.at (Invalid inputs): Adjust error message.
1584 * doc/bison.texinfo (Symbols): Update.
1585
1586 2009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1587
1588 Declare %code to be a permanent feature.
1589 * NEWS (2.4.2): Here.
1590 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
1591 experimental.
1592 (Decl Summary): Likewise.
1593
1594 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1595
1596 Convert underscores to dashes in some %define variable names.
1597 For now, just api.push-pull and lr.keep-unreachable-states.
1598 Maintain old names for backward compatibility.
1599 * NEWS (2.5): Document.
1600 * data/c.m4 (b4_identification): Update comment.
1601 * data/yacc.c: Update access.
1602 * doc/bison.texinfo: Update.
1603 * etc/bench.pl.in (bench_grammar): Update use.
1604 * src/files.c (tr): Move to...
1605 * src/getargs.c, src/getargs.h (tr): ... here because I can't
1606 think of a better place to expose it. My logic is that, for all
1607 uses of tr so far, command-line arguments can be involved, and
1608 getargs.h is already included.
1609 * src/main.c (main): Update access.
1610 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
1611 variable names to new variable names before assigning value.
1612 * src/reader.c (reader): Update setting default.
1613 * tests/calc.at: Update uses.
1614 * tests/conflicts.at (Unreachable States After Conflict
1615 Resolution): Update use.
1616 * tests/input.at (%define enum variables): Update use.
1617 (%define backward compatibility): New test group.
1618 * tests/push.at: Update uses.
1619 * tests/reduce.at: Update uses.
1620 * tests/torture.at: Update uses.
1621
1622 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1623
1624 Set all front-end %define defaults in one place.
1625 * src/main.c (main): Move lr.keep_unreachable_states default...
1626 * src/reader.c (reader): ... to here.
1627
1628 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1629
1630 Rename lr.default_reductions to lr.default-reductions.
1631 * NEWS (2.5): Here.
1632 * doc/bison.texinfo: Here.
1633 * src/lalr.c (initialize_LA): Here.
1634 * src/print.c (print_reductions): Here.
1635 * src/reader.c (reader): Here.
1636 * src/tables.c (action_row): Here.
1637 * tests/input.at (%define enum variables): Here.
1638 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1639
1640 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1641
1642 Pacify ./configure --enable-gcc-warnings.
1643 * tests/input.at (Symbols): Prototype yyerror and yylex.
1644
1645 2009-04-21 Akim Demaille <demaille@gostai.com>
1646
1647 tests: check the use of dashes and periods in symbols.
1648 * tests/input.at (Symbol): New test group.
1649
1650 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1651
1652 Document how `%define "var" "value"' is not M4-friendly.
1653 * src/parse-gram.y (variable): In comments here.
1654
1655 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1656
1657 Add copyright updates missed during previous cherry pick.
1658 * src/output.c: Here.
1659 * src/parse-gram.y: Here.
1660 * src/scan-gram.l: Here.
1661
1662 2009-04-20 Akim Demaille <demaille@gostai.com>
1663
1664 variables: accept dashes.
1665 * src/scan-gram.l ({id}): Also accept dashes after the initial
1666 letter.
1667 ({directive}): Use {id}.
1668 * src/parse-gram.y: Comment and formatting changes.
1669 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
1670 symbols.
1671 * src/complain.h, src/complain.c (yacc_at): New.
1672 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
1673 symbol names.
1674 * src/output.c (token_definitions_output): Do not #define token
1675 names with dashes.
1676
1677 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1678
1679 Clean up recent patches a little.
1680 Reported by Akim Demaille.
1681 * doc/bison.texinfo (Understanding): Fix typos.
1682 * src/print.c (print_reductions): Don't use negated variable.
1683
1684 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1685
1686 List accepted values for a %define enum variable with an invalid value.
1687 Suggested by Akim Demaille at
1688 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1689 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1690 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
1691 * tests/input.at (%define lr.default_reductions invalid values): Merge
1692 into...
1693 (%define enum variables): ... here, and update output.
1694
1695 2009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1696
1697 Rename "default rule" to "default reduction".
1698 This includes changing variable names in code, changing
1699 comments, and renaming %define lr.default_rules to %define
1700 lr.default_reductions.
1701 * NEWS (2.5): Update IELR documentation.
1702 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
1703 Adjust YYDEFACT and yydefact_ documentation.
1704 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1705 and lr.type documentation. Make some other wording
1706 improvements.
1707 (Glossary): Adjust cross-references and Default Reduction
1708 definition.
1709 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1710 Remove a confusing comment pointed out by Akim Demaille.
1711 (initialize_LA): Adjust code.
1712 * src/print-xml.c (print_reductions): Adjust code.
1713 * src/print.c (print_reductions): Adjust code.
1714 * src/reader.c (reader): Adjust code.
1715 * src/tables.c (action_row): Adjust code.
1716 (token_actions): Adjust code.
1717 * src/tables.h: Adjust YYDEFACT documentation.
1718 * tests/input.at (%define lr.default_rules invalid values):
1719 Rename test group to...
1720 (%define lr.default_reductions invalid values): ... this, and
1721 update grammar file and expected output.
1722 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1723 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1724
1725 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1726
1727 Document %define lr.type and lr.default_rules.
1728 * NEWS (2.5): Add an entry.
1729 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1730 besides just LALR(1) and GLR(1).
1731 * doc/bison.texinfo (Introduction): Likewise.
1732 (Language and Grammar): Bison is no longer limited to LALR(1)
1733 restrictions.
1734 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1735 when trying to distinguish from GLR. Talk about LR(1) grammars
1736 rather than LALR(1) grammars.
1737 (Decl Summary): In %define api.push_pull entry, say it applies
1738 to deterministic parsers in C rather than LALR(1) parsers in C.
1739 Add lr.default_rules entry.
1740 Add lr.type entry.
1741 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1742 restrictions.
1743 (Generalized LR Parsing): Same changes as for the previous GLR
1744 section.
1745 (Memory Management): Say deterministic rather than LALR(1).
1746 (Understanding): Correct some bison output.
1747 Index discussion of "accepting state".
1748 Say deterministic rather than LALR(1).
1749 (Bison Options): In --yacc entry, say deterministic rather than
1750 LALR(1).
1751 In --report, --graph, and --xml entries, just don't mention
1752 LALR(1).
1753 (C++ Parsers): Say deterministic rather than LALR(1).
1754 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1755 (Glossary): Add Accepting State, Consistent State, Default Rule,
1756 and IELR(1) definitions.
1757 In Generalized LR (GLR) definition, make same changes as in
1758 previous GLR sections.
1759 In LALR(1) definition, say Bison uses LALR(1) by default rather
1760 than implying Bison is limited to LALR(1).
1761 (LocalWords): Add IELR.
1762
1763 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1764
1765 Finish implementing %define lr.type.
1766 Its value can be "LALR", "IELR", or "canonical LR".
1767 * lib/timevar.def (TV_IELR_PHASE1): New var.
1768 (TV_IELR_PHASE2): New var.
1769 (TV_IELR_PHASE3): New var.
1770 (TV_IELR_PHASE4): New var.
1771 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1772 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1773 Sbitset.h, ielr.h, and ielr.c.
1774 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1775 trace_types): Add trace_ielr.
1776 * src/lalr.h, src/lalr.c (ngotos): Export it.
1777 (F): Rename to...
1778 (goto_follows): ... this, update all uses, and export it.
1779 (set_goto_map): Export it.
1780 (map_goto): Export it.
1781 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1782 handled in ielr.
1783 (initialize_LA): Export it. Move lookback allocation to...
1784 (lalr): ... here because, for canonical LR, initialize_LA must
1785 be invoked but lookback and much of the rest of LALR isn't
1786 needed.
1787 * main.c (main): Instead of lalr, invoke ielr, which invokes
1788 lalr.
1789 * src/reader.c (reader): Default lr.type to "LALR".
1790 Default lr.default_rules to "accepting" if lr.type is "canonical
1791 LR". Leave the default as "all" otherwise.
1792 Check for a valid lr.type value.
1793 * src/state.h, src/state.c (struct state_list): Add state_list
1794 member.
1795 (state_new): Initialize state_list member to NULL.
1796 (state_new_isocore): New function, exported.
1797 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1798 exercises all values of lr.type.
1799 (GNU AWK Grammar): Rename test group to...
1800 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1801 AT_TEST_EXISTING_GRAMMAR.
1802 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
1803 (GNU pic Grammar): Rename test group to...
1804 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1805 AT_TEST_EXISTING_GRAMMAR.
1806 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1807 all values of lr.type.
1808 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1809 (Lane Split): Likewise.
1810 (Complex Lane Split): Likewise.
1811 (Split During Added Lookahead Propagation): Likewise.
1812
1813 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1814
1815 Add new files for IELR and canonical LR implementation.
1816 * src/AnnotationList.c: New.
1817 * src/AnnotationList.h: New.
1818 * src/InadequacyList.c: New.
1819 * src/InadequacyList.h: New.
1820 * src/Sbitset.c: New.
1821 * src/Sbitset.h: New.
1822 * src/ielr.c: New.
1823 * src/ielr.h: New.
1824
1825 2009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1826
1827 Implement %define lr.default_rules.
1828 Its value describes the states that are permitted to contain
1829 default rules: "all", "consistent", or "accepting".
1830 * src/reader.c (reader): Default lr.default_rules to "all".
1831 Check for a valid lr.default_rules value.
1832 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1833 is "accepting", then only mark the accepting state as
1834 consistent.
1835 (initialize_LA): Tell state_lookahead_tokens_count whether
1836 lr.default_rules is "accepting".
1837 * src/tables.c (action_row): If lr.default_rules is not "all",
1838 then disable default rules in inconsistent states.
1839 * src/print.c (print_reductions): Use this opportunity to
1840 perform some assertions about whether lr.default_rules was
1841 obeyed correctly.
1842 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1843 helps with checking the parser tables for a grammar.
1844 * tests/input.at (%define lr.default_rules invalid values): New
1845 test group.
1846 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1847 AT_TEST_TABLES_AND_PARSE.
1848 (`no %define lr.default_rules'): New test group generated by
1849 AT_TEST_LR_DEFAULT_RULES.
1850 (`%define lr.default_rules "all"'): Likewise.
1851 (`%define lr.default_rules "consistent"'): Likewise.
1852 (`%define lr.default_rules "accepting"'): Likewise.
1853
1854 2009-04-20 Akim Demaille <demaille@gostai.com>
1855
1856 Consistently refer to Yacc, not YACC.
1857 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1858
1859 2009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1860
1861 Pacify make maintainer-check-posix.
1862 * tests/input.at (%define, --define): Move bison command-line
1863 options before grammar file name.
1864
1865 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1866
1867 Document semicolon warnings.
1868 * NEWS (2.5): Here.
1869
1870 2008-12-08 Akim Demaille <demaille@gostai.com>
1871
1872 Fix portability issue in the test suite.
1873 * tests/local.at (AT_MATCHES_CHECK): New.
1874 Based on Perl instead of Sed. Sed has too many portability
1875 pitfalls, not ever Sed is GNU Sed.
1876 * tests/actions.at (Fix user actions without a trailing semicolon):
1877 Use it.
1878
1879 2008-12-07 Di-an Jan <dianj@freeshell.org>
1880
1881 Implement the FIXME that ends an user action with a semicolon
1882 if it seems necessary.
1883 * src/scan-code.l (flex rules section): Flag cpp directive from
1884 any `#' to the first unescaped end-of-line. Semicolon is not
1885 needed after `;', `{', '}', or cpp directives and is needed after
1886 any other token (whitespaces and comments have no effect).
1887 * tests/actions.at (Fix user actions without a trailing semicolon):
1888 New test.
1889 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
1890 to make user actions complete statements.
1891 Adjust column numbers in error messages.
1892 * tests/regression.at (Fix user actions without a trailing semicolon):
1893 Remove. Covered by new test.
1894
1895 2009-04-14 Akim Demaille <demaille@gostai.com>
1896
1897 doc: minor fixes.
1898 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1899 (Table of Symbols): Remove duplicate entry for %debug.
1900
1901 2009-04-10 Eric Blake <ebb9@byu.net>
1902
1903 submodules: update to latest
1904 * submodules/autoconf: Use latest upstream Autoconf.
1905
1906 2009-04-06 Eric Blake <ebb9@byu.net>
1907
1908 Work around autoconf 2.63b bug in testsuite.
1909 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1910 autoconf bug related to # in test.
1911
1912 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1913
1914 * NEWS (2.5): Describe new -D/--define feature.
1915
1916 2008-11-10 Akim Demaille <demaille@gostai.com>
1917
1918 --trace=muscles
1919 * src/getargs.h, src/getargs.c (trace_muscle): New.
1920 (trace_types, trace_args): Support it.
1921 * src/output.c (output_skeleton): Use it.
1922
1923 2008-11-10 Akim Demaille <demaille@gostai.com>
1924
1925 muscles_output.
1926 * src/output.c (muscles_output): New, extracted from...
1927 (output_skeleton): here.
1928 Adjust.
1929
1930 2008-11-21 Akim Demaille <demaille@gostai.com>
1931
1932 Display the changes in cross-options.texi.
1933 * build-aux/cross-options.pl ($sep): New, to separate items.
1934 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
1935 the changes.
1936
1937 2008-11-20 Di-an Jan <dianj@freeshell.org>
1938
1939 Improves options in the manual.
1940 * doc/bison.texinfo (-g, -x): Add space before argument.
1941 (Option Cross Key): Implement FIXME: listing directives also.
1942 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
1943 (Short Option): Special case -d. Put arguments inside @option.
1944 (Bison Directive): Add column, automatically extracted from
1945 src/scan-gram.l (actual name passed as the first argument)
1946 with special case for %define.
1947 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
1948 to build-aux/cross-options.pl.
1949 * src/getargs.c (usage): Document limitations of cross-options.pl.
1950 * src/scan-gram.l: Likewise.
1951
1952 2009-02-25 Akim Demaille <demaille@gostai.com>
1953
1954 Copyright years.
1955 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1956
1957 2008-12-08 Akim Demaille <demaille@gostai.com>
1958
1959 Install autoconf as a submodule to get m4sugar.
1960 * .gitmodules: Add submodules/autoconf.
1961 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1962 submodules/autoconf.
1963
1964 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1965
1966 Simplify last patch slightly.
1967 * src/getargs.c (getargs): Here.
1968
1969 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1970
1971 Fix last warning from --enable-gcc-warnings.
1972 * src/getargs.c (getargs): Don't assign const address to non-const
1973 pointer.
1974
1975 2008-11-17 Di-an Jan <dianj@freeshell.org>
1976
1977 Handle --enable-gcc-warnings.
1978 * src/getargs.c (command_line_location): Set parameters to void.
1979
1980 2008-11-11 Akim Demaille <demaille@gostai.com>
1981
1982 AT_FULL_COMPILE.
1983 * tests/actions.at, tests/regression.at: Use it.
1984
1985 2008-11-07 Akim Demaille <demaille@gostai.com>
1986
1987 Pass command line location to skeleton_arg and language_argmatch.
1988 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1989 The location argument is now mandatory.
1990 Adjust all dependencies.
1991 (getargs): Use command_line_location.
1992
1993 2008-11-07 Akim Demaille <demaille@gostai.com>
1994
1995 -D, --define.
1996 * src/getargs.c (usage): Document -D.
1997 Fix help string for --locations.
1998 (command_line_location): New.
1999 (short_options, long_options, getargs): Support -D, --define.
2000 (getargs): Move -d support at the right place.
2001 * doc/bison.texinfo (Bison Options): Update.
2002 * tests/input.at (%define, --define): New.
2003
2004 2008-11-07 Akim Demaille <demaille@gostai.com>
2005
2006 Initialize the muscle table before parsing the command line.
2007 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
2008 (getargs): Define file_name.
2009 * src/main.c (main): Initialize muscle_tab before calling
2010 getargs.
2011 * src/muscle_tab.c (muscle_init): No longer define file_name, as
2012 its value is not available yet.
2013
2014 2008-11-09 Akim Demaille <demaille@gostai.com>
2015
2016 Require the generation of parse-gram.output.
2017 * src/Makefile.am (YACC): Pass --report=all.
2018
2019 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2020
2021 * NEWS (2.5): New stub.
2022
2023 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2024
2025 Fix options documentation.
2026 * build-aux/cross-options.pl: As in --help output, write optional
2027 arguments as [=ARG] not =[ARG].
2028 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2029
2030 2008-11-07 Akim Demaille <demaille@gostai.com>
2031
2032 Fix --help.
2033 * src/getargs.c (usage): Fix help string for -W.
2034
2035 2008-11-07 Akim Demaille <demaille@gostai.com>
2036
2037 Handle more general types of option arguments.
2038 * build-aux/cross-options.pl: The argument ends at the first
2039 space, not the first non-symbol character.
2040 Use @var for each word appearing the argument description.
2041
2042 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2043
2044 Remove spurious initial empty lines.
2045 * data/location.cc: End the @output lines with an @.
2046
2047 2008-11-04 Akim Demaille <demaille@gostai.com>
2048
2049 Remove spurious initial empty lines.
2050 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2051 * data/yacc.c: End the @output lines with an @.
2052
2053 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2054
2055 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2056 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2057 requirements for a correct m4 are stricter.
2058 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
2059 * configure.ac: Update to use AC_PROG_GNU_M4.
2060 Reported by Eric Blake.
2061
2062 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2063
2064 Help with updating web manual.
2065 * HACKING: Incorporate instructions from gnulib/doc/README.
2066 * bootstrap.conf (gnulib_modules): Add gendocs.
2067
2068 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2069
2070 Fix strange %define locations for default values.
2071 Reported by Akim Demaille at
2072 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2073 and discussed again starting at
2074 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2075 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2076 because location information is bogus.
2077 Use angle brackets to delimit fake file name because square brackets
2078 look like underexpanded m4. Choose a better fake file name.
2079 Use negative line numbers.
2080 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2081 * src/location.c (location_print): If line for a boundary is negative,
2082 only print that boundary's file name.
2083 * src/location.h: Document that.
2084 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2085 defaults): Update output.
2086
2087 2008-11-07 Akim Demaille <demaille@gostai.com>
2088
2089 Locations without columns for command line arguments.
2090 * src/location.c (location_print): Don't display negative columns.
2091 * src/location.h: Document this.
2092
2093 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2094
2095 Add reminder about uploading public key to keys.gnupg.net.
2096 * HACKING (Release Procedure): Here.
2097
2098 2009-03-31 Akim Demaille <demaille@gostai.com>
2099
2100 bootstrap: --help to stdout.
2101 * bootstrap (usage): Don't send --help to stderr.
2102 Use a here doc instead of a long string.
2103
2104 2009-03-31 Akim Demaille <demaille@gostai.com>
2105
2106 bootstrap: README-hacking no longer exists
2107 * bootstrap (checkout_only_file): Set to HACKING.
2108
2109 2009-03-26 Akim Demaille <demaille@gostai.com>
2110
2111 doc: merge HACKING and README-hacking.
2112 Two files is confusing.
2113 Reported by Alexandre Duret-Lutz.
2114
2115 * README-hacking: Merge into...
2116 * HACKING (Working from the repository): here.
2117
2118 2009-03-26 Akim Demaille <demaille@gostai.com>
2119
2120 doc: update README-hacking.
2121 * README-hacking: We now use git and git submodules.
2122 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2123
2124 2009-03-26 Akim Demaille <demaille@gostai.com>
2125
2126 lalr1.cc: avoid GCC 4.3 warnings.
2127 GCC 4.3 now warns about "a || b && c" and asks for explicit
2128 parentheses.
2129 Reported by Alexandre Duret-Lutz.
2130 * data/location.cc: Update copyright years.
2131 (Position::operator==): Use parens to make precedence explicit.
2132 Compare lines and columns first, as they are more likely to be
2133 different, and they are faster to compare.
2134
2135 2009-03-26 Akim Demaille <demaille@gostai.com>
2136
2137 gnulib: update.
2138 * gnulib: Update to latest.
2139 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
2140 use +=.
2141
2142 2009-01-08 Akim Demaille <demaille@gostai.com>
2143
2144 Fix grep portability issues.
2145 Grep on Solaris does not support -q.
2146 Reported by Summum Bonum.
2147
2148 * NEWS: Add a stub for 2.4.2.
2149 * THANKS: Add Summum Bonum.
2150 * tests/atlocal.in (EGREP): New.
2151 (CC, CXX, XSLTPROC): Make it possible to override them via
2152 envvars.
2153 * tests/java.at: Use $EGREP instead of egrep.
2154 Use AT_CHECK's ignore instead of grep's -q.
2155
2156 2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
2157
2158 Version 2.4.1.
2159 * NEWS: Set version and date.
2160 * lib/Makefile.am: Update copyright year.
2161 * tests/atlocal.in: Update copyright year.
2162
2163 2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
2164
2165 Semicolon feature removal is not about future language support.
2166 * NEWS: The semicolon feature is no longer active for newer languages,
2167 so don't claim that it causes trouble for them.
2168
2169 2008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
2170
2171 * gnulib: Update submodule to HEAD.
2172
2173 2008-12-09 Akim Demaille <demaille@gostai.com>
2174
2175 Update data/README.
2176 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2177
2178 2008-12-05 Eric Blake <ebb9@byu.net>
2179
2180 Build testsuite with newer autoconf.
2181 * tests/output.at (m4_expand): Don't override in newer autoconf,
2182 where the underlying implementation changed.
2183 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2184 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2185 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2186 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2187 since some of them contain unbalanced ')'.
2188
2189 2008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
2190
2191 * NEWS: Clarify a little.
2192
2193 2008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
2194
2195 * NEWS: Update for recent changes.
2196
2197 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2198
2199 Fix unexpanded macros in GLR defines file.
2200 Reported by Csaba Raduly at
2201 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2202 * THANKS (Csaba Raduly): Add.
2203 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2204 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2205 lexer in a separate module that includes the defines file.
2206 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
2207 source.
2208 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2209 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2210 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2211 (AT_DATA_SOURCE_PROLOGUE): New.
2212 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2213 (AT_DATA_SOURCE): New.
2214 (AT_FULL_COMPILE): New, copied from master branch and extended to
2215 support an additional source file.
2216
2217 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2218
2219 Don't let maintainer-*-check targets force a version update.
2220 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2221 handled.
2222
2223 2008-11-17 Di-an Jan <dianj@freeshell.org>
2224
2225 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2226 Align menus. Adjust word wrapping. Use node names for menu names.
2227 (Examples): Don't abbreviate node names.
2228 (LocalWords): Remove abbreviations.
2229 (Copying): Make description a sentence.
2230 (Java Action Features): Remove period to match the rest of menu.
2231
2232 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
2233
2234 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
2235 * configure.ac: Adjust usage.
2236 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2237 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2238 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
2239
2240 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2241
2242 Don't add a semicolon to actions for %skeleton or %language.
2243 It breaks Java test cases as reported by Akim Demaille.
2244 * src/scan-code.l: Implement.
2245
2246 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2247
2248 Clean up %skeleton and %language priority implementation.
2249 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
2250 remove static qualifier because others will soon need to see it.
2251 (language_prio): Likewise.
2252 (getargs): Use command_line_prio rather than 0.
2253 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
2254 enum fields.
2255 (skeleton_prio): Extern it.
2256 (language_prio): Extern it.
2257 * src/parse-gram.y: Use grammar_prio rather than 1.
2258
2259 2008-11-04 Akim Demaille <demaille@gostai.com>
2260
2261 * NEWS: Mention the trailing semicolon in action.
2262
2263 2008-11-04 Akim Demaille <demaille@gostai.com>
2264
2265 Reformat NEWS.
2266 * NEWS: Use more outline-mode markup.
2267 Suggested by Jim Meyering.
2268
2269 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
2270
2271 Fix user actions without a trailing semicolon.
2272 Reported by Sergei Steshenko at
2273 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
2274 * THANKS (Sergei Steshenko): Add.
2275 * src/scan-code.l (SC_RULE_ACTION): Fix it.
2276 * tests/regression.at (Fix user actions without a trailing semicolon):
2277 New test case.
2278
2279 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2280
2281 Initiate further development.
2282 * NEWS: Create an empty section for new entries.
2283 * gnulib: Update submodule to HEAD.
2284
2285 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2286
2287 * NEWS: Version 2.4.
2288
2289 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2290
2291 Prepare for next release.
2292 * NEWS: Briefly mention changes since 2.3b.
2293 * README: Say GNU m4 1.4.6, which we've been requiring in release
2294 announcements already, not 1.4.3, which breaks the build.
2295
2296 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2297
2298 Say %language is experimental.
2299 We're thinking of extending it's effect on output file naming. See the
2300 thread at
2301 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
2302 * NEWS: Say it's experimental.
2303 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
2304 recommend it over %skeleton for now.
2305 (Bison Options): Likewise.
2306 (C++ Bison Interface): Use %skeleton not %language.
2307 (Calc++ Parser): Use %skeleton not %language.
2308 * src/getargs.c (usage): Say it's experimental.
2309
2310 2008-11-01 Di-an Jan <dianj@freeshell.org>
2311 Paolo Bonzini <bonzini@gnu.org>
2312
2313 Support all Java parser class modifiers.
2314 * data/java.m4 (b4_percent_define_get3): New.
2315 (b4_final_if, b4_strictfp_if): New.
2316 * data/lalr1.java (final, strictfp, extends, implements): Support.
2317 * doc/bison.texinfo (final, strictfp, extends, implements): Add
2318 documentation.
2319 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
2320 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
2321 (AT_CHECK_JAVA_GREP): New.
2322 (Java parser class modifiers): New test.
2323 (Java parser class extends and implements): New test.
2324
2325 Model exception propagation better with throws and lex_throws.
2326 * data/java.m4 (b4_list2): New.
2327 (throws): Change default.
2328 * data/lalr1.java (yyaction): Add throws.
2329 (parse): Add lex_throws in addition to throws.
2330 * doc/bison.texinfo (throws, lex_throws): Add documentation.
2331 * tests/java.at (Java throws specifications): New test.
2332
2333 Improve documentation for Java parsers.
2334 * doc/bison.texinfo (Java Parsers): Add subsections.
2335 Don't quote first argument of %define.
2336 (Java Bison Interface): Document output files. Move documentation
2337 of parser class and merge into Java Parser Interface. Document
2338 features that error out. Document directives with no effect.
2339 Move note about Javadoc higher.
2340 (Java Semantic Values): Explicitly mention stype.
2341 Document that generic types cannot be used.
2342 (Java Location Values): Use @deftypeivar. Document constructors.
2343 Correct return value for toString.
2344 (Java Parser Interface): List undocumented constants/fields.
2345 Move documentation of fields added by %parse-param closer to list
2346 of members. Document that token names are added as fields.
2347 Document constructors accurately. Remove error method.
2348 (Java Scanner Interface): Move note on %pure-parser to Java Bison
2349 Interface. Describe %code lexer and yylex accutately.
2350 Remove documentation that does not match the code.
2351 (Java Action Features): New.
2352 (Java Differences): Add reference. Add item on semantic values.
2353 Add note about @{ ... @}. Clarify %% epilogue placement.
2354 (Java Declarations Summary): New.
2355
2356 Fix Java skeleton.
2357 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
2358 (b4_remove_comma): Quote test argument.
2359 (b4_identification): Remove "bison" field.
2360 * tests/java.at (Java parser class and package names): New test.
2361 (Java %parse-param and %lex-param): New test.
2362 (Java stype, position_class and location_class): New test.
2363
2364 2008-10-31 Di-an Jan <dianj@freeshell.org>
2365
2366 * data/lalr1.jave: Update copyright years.
2367 (YYParser): Correct name of "generated from" file in Javadoc:
2368 use b4_file_name instead of @ofile@.
2369 (Location constructor): Correct Javadoc parameter name.
2370 (yylloc): Add missing opening m4 quote after b4_location_if.
2371 This removes a stray [ in the Javadoc of Lexer.getStartPos.
2372 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
2373 (YYParser constructor): Correct Javadoc parameter name.
2374
2375 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
2376
2377 Always put auxiliary code files in the same dir as other output files.
2378 * src/files.c (compute_file_name_parts): When the user specifies
2379 --output but not --file-prefix, extract the directory prefix from the
2380 file prefix not from the grammar file name. This affects the location
2381 of files like location.hh generated by the C++ skeleton. The includes
2382 in the other output files require this fix.
2383 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
2384 for expected output files.
2385 (Output files): Add a test for the above.
2386
2387 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
2388
2389 * gnulib: Update submodule to HEAD.
2390
2391 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2392
2393 Update copyright year.
2394 * src/files.c: Here.
2395
2396 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
2397
2398 Don't overwrite the input file.
2399 * src/files.c (output_file_name_check): Fatal error if using input file
2400 for output.
2401 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
2402 argument.
2403 (Conflicting output files): Add test.
2404
2405 2008-10-28 Akim Demaille <demaille@gostai.com>
2406
2407 Space changes.
2408 * data/lalr1.cc: Formatting changes.
2409
2410 2008-10-28 Akim Demaille <demaille@gostai.com>
2411
2412 Don't define debugging functions when !YYDEBUG.
2413 * data/lalr1.cc (debug_stream, set_debug_stream)
2414 (debug_level_type, debug_level, set_debug_level): Don't
2415 declare them when YYDEBUG is not defined.
2416 The implementation are already YYDEBUG-aware.
2417
2418 2008-10-28 Akim Demaille <demaille@gostai.com>
2419
2420 Prefer "continue" for empty loop bodies.
2421 * etc/bench.pl.in: Use "continue" instead of {}.
2422
2423 2008-10-28 Akim Demaille <demaille@gostai.com>
2424
2425 Space and comments changes.
2426 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
2427 * data/c.m4, data/lalr1.cc: Space changes.
2428
2429 2008-10-28 Akim Demaille <demaille@gostai.com>
2430
2431 Make gnulib a submodule.
2432 * gnulib: New.
2433 * .gitmodules (gnulib): New.
2434
2435 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2436
2437 Fix yyerror_range for user-defined location type in C++. Reported by
2438 Georg Sauthoff at
2439 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
2440 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
2441 * THANKS (Georg Sauthoff): Add.
2442
2443 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
2444
2445 Update several administrative files mainly to facilitate releasing.
2446 * HACKING (Administrivia): Make the git-merge-changelog notes more
2447 helpful.
2448 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
2449 (Release Procedure): Update for git and add numerous details that were
2450 previously missing.
2451 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
2452 * maint.mk (announcement): Don't list bison as a bootstrap tool so
2453 that announcements don't claim we bootstrapped with whatever bison
2454 happened to be in PATH. Add flex as a bootstrap tool.
2455 * Makefile.maint: Remove, previously replaced by maint.mk.
2456 * Makefile.cfg: Remove, and migrate settings to...
2457 * cfg.mk: ... here for the sake of `make announcement'.
2458 * bootstrap.conf (gnulib_modules): Add announce-gen.
2459 * README: Say GNU Bison instead of just Bison. Suggested by Karl
2460 Berry.
2461
2462 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
2463
2464 Small but important bugfixes for the Java skeleton.
2465 * data/lalr1.java (yyerror): Change Location to b4_location_type.
2466 (yy_symbol_print): Call toString on yyvaluep.
2467
2468 2008-08-29 Akim Demaille <demaille@gostai.com>
2469
2470 Clarify UPDATED use.
2471 * doc/bison.texinfo: It refers to the last edition of this file,
2472 not to the release date of Bison.
2473 Reported by Joel E. Denny.
2474
2475 2008-08-29 Akim Demaille <demaille@gostai.com>
2476
2477 * README: Update FAQ pointer.
2478 Reported by Joel E. Denny.
2479
2480 2008-08-27 Eric Blake <ebb9@byu.net>
2481
2482 Resync m4sugar from autoconf.
2483 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
2484 (m4_init): Adjust to latest m4.git changes.
2485 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
2486 effects.
2487 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
2488 (_m4_list_cmp): Reduce side effects.
2489
2490 2008-08-27 Akim Demaille <demaille@gostai.com>
2491
2492 Check yyerrok in calc.at.
2493 * tests/calc.at (calc.y): Use yyerrok on "( error )".
2494 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
2495 expected.
2496
2497 2008-08-27 Akim Demaille <demaille@gostai.com>
2498
2499 Support yyerrok in lalr1.cc.
2500 YYBACKUP is still to import back into lalr1.cc.
2501 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
2502
2503 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2504
2505 For maintainer-check*, don't recompile for a $(VERSION) update.
2506 * cfg.mk: New file.
2507 (_is-dist-target): Override the one in GNUmakefile.
2508 * Makefile.am (EXTRA_DIST): Add cfg.mk.
2509
2510 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2511
2512 Update for recent change to gnulib.
2513 * src/parse-gram.y: Don't include strverscmp.h. It comes from
2514 string.h now.
2515
2516 2008-08-15 Eric Blake <ebb9@byu.net>
2517
2518 Remaining m4sugar merge from autoconf.
2519 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
2520 * data/m4sugar/foreach.m4: New file, copied from autoconf.
2521 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
2522 * src/output.c (output_skeleton): Tell m4 how to find it.
2523
2524 Partial m4sugar merge from autoconf: m4_map.
2525 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
2526 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
2527 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
2528 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
2529 for empty list.
2530 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
2531 Likewise.
2532 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
2533 declares it.
2534
2535 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
2536
2537 Keep .version and PACKAGE_VERSION in sync.
2538 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
2539 dependency, and add comments justifying this in more detail. Discussed
2540 starting at
2541 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
2542
2543 2008-08-06 Eric Blake <ebb9@byu.net>
2544
2545 Partial m4sugar merge from autoconf: m4_shiftn.
2546 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
2547 (m4_shift2, m4_shift3): New macros.
2548 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
2549 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
2550 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
2551 * data/java.m4 (b4_remove_comma): Likewise.
2552
2553 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
2554 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
2555 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
2556 (m4_init): Consolidate wrapped text into single m4_wrap.
2557 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
2558 in wrapped text.
2559
2560 2008-08-05 Eric Blake <ebb9@byu.net>
2561
2562 Partial m4sugar merge from autoconf: builtins, version.m4.
2563 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
2564 (m4_prepend): Remove, as it is unused and inherently quadratic,
2565 whereas m4_append is linear in newer m4.
2566 (m4_mkstemp): New builtin.
2567 (m4_symbols): Make rename conditional.
2568 (m4_version_prereq): Ensure fatal error if used in bison, which
2569 intentionally lacks version.m4.
2570
2571 Fix comments in m4sugar.
2572 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
2573
2574 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2575
2576 Update for recent .gitignore fix in Gnulib.
2577 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
2578 anchored .gitignore entries.
2579
2580 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2581
2582 Set gnu or gnits strictness.
2583 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
2584 development and gnits strictness for releases. Based on Eric Blake's
2585 suggestion at
2586 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
2587
2588 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2589
2590 * NEWS: Clarify documentation of %language.
2591
2592 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
2593
2594 Support usage of git-merge-changelog.
2595 * .gitattributes: New.
2596 * HACKING: Document usage of git-merge-changelog.
2597 * bootstrap: Install git-merge-changelog entries in .git/config
2598 if appropriate.
2599
2600 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2601
2602 Remove remaining dependence on CVS Id keyword.
2603 * ChangeLog: For the sake of people still using CVS, don't use dollars
2604 when mentioning Id.
2605 * data/xslt/bison.xsl: Remove Id from header comments, where it was
2606 unusual anyway.
2607 * data/xslt/xml2dot.xsl: Likewise.
2608 * data/xslt/xml2text.xsl: Likewise.
2609 * data/xslt/xml2xhtml.xsl: Likewise.
2610 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
2611 * doc/Makefile.am (neutralize): Remove, no longer needed.
2612 (.x.1): Don't use neutralize.
2613 (edit): Don't substitute for ID.
2614 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
2615
2616 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2617
2618 Fix dependence on computed configure variables.
2619 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
2620 $(top_srcdir)/configure.ac so that changes to computed variables, such
2621 as PACKAGE_VERSION, are seen.
2622 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
2623
2624 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
2625
2626 Update copyright dates for recent changes.
2627 * Makefile.am: Here.
2628 * src/Makefile.am: Here.
2629 * src/reduce.c: Here.
2630 * tests/reduce.at: Here.
2631
2632 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
2633
2634 Use git-version-gen for version names between releases.
2635 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
2636 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
2637 * .prev-version: New.
2638 * .version.in: Remove.
2639 * ChangeLog: Remove the Id previously used for capturing the CVS
2640 revision.
2641 * GNUmakefile: Remove, now copied from Gnulib.
2642 * Makefile.am: Add code suggested by comments in
2643 build-aux/git-version-gen.
2644 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
2645 .prev-version, and .version.
2646 * NEWS (2.3b+): Rename to...
2647 (?.?): ... this because we're dropping the "+" version naming scheme,
2648 but, in general, we still can't be sure of our next release name.
2649 * bootstrap: Add a quick hack to remove from .gitignore the
2650 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
2651 entry. This should really be fixed in gnulib instead.
2652 * bootstrap.conf (gnulib_modules): Add gnumakefile.
2653 * configure.ac (AC_INIT): Set version name by invoking
2654 build-aux/git-version-gen.
2655 (AC_CONFIG_FILES): Remove .version, now generated by
2656 build-aux/git-version-gen.
2657 * maint.mk: New, copied from coreutils.
2658 * doc/.cvsignore (bison.1): Add.
2659 * doc/.gitignore (/bison.1): Add.
2660 * doc/bison.1: Remove, generated.
2661 * src/.cvsignore (revision.c): Remove.
2662 * src/.gitignore (/revision.c): Remove.
2663 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
2664 (BUILT_SOURCES): Remove revision.c.
2665 (revision.c): Remove.
2666 * src/getargs.c (version): Don't print revision after the VERSION.
2667 * src/revision.h: Remove.
2668
2669 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2670
2671 Fix untranslatable composition of sentences. Reported by Goran
2672 Uddeborg at
2673 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
2674 * THANKS (Goran Uddeborg): Add.
2675 * src/reduce.c (reduce_print): Report the number of nonterminals and
2676 rules useless in the grammar in separate sentences.
2677 * tests/reduce.at (Useless Rules): Update output.
2678 (Reduced Automaton): Likewise.
2679 (Underivable Rules): Likewise.
2680 (Empty Language): Likewise.
2681
2682 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2683
2684 Fix some .gitignore and .cvsignore problems.
2685 * bootstrap (insert_sorted_if_absent): Replace all uses with...
2686 (insert_vc_ignore): ... this new function, which prepends `/' to all
2687 .gitignore entries before passing them to insert_sorted_if_absent.
2688 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
2689 .cvsignore files are maintained even though Bison developers run
2690 bootstrap while using Git.
2691 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
2692 unneeded by Bison.
2693 (gnulib): Add.
2694 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
2695 unneeded. Reported by Eric Blake.
2696 * lib/.gitignore (/*~): Add.
2697 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
2698 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
2699 Blake.
2700 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
2701
2702 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2703
2704 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
2705 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
2706 * bootstrap.conf (gnulib_modules): Add unsetenv.
2707 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
2708 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
2709 (/setenv.m4): Add.
2710 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
2711 the first argument because it may become position-dependent, and unset
2712 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
2713 Add comments explaining these issues in more detail.
2714
2715 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
2716
2717 Add .gitignore everywhere based on .cvsignore.
2718 * .gitignore: New.
2719 * build-aux/.gitignore: New.
2720 * data/.gitignore: New.
2721 * doc/.gitignore: New.
2722 * etc/.gitignore: New.
2723 * examples/.gitignore: New.
2724 * examples/calc++/.gitignore: New.
2725 * lib/.gitignore: New.
2726 * m4/.gitignore: New.
2727 * po/.gitignore: New.
2728 * runtime-po/.gitignore: New.
2729 * src/.gitignore: New.
2730 * tests/.gitignore: New.
2731
2732 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2733
2734 * NEWS (2.3b+): New section, empty for now.
2735 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
2736
2737 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2738
2739 * NEWS (2.3b): Update release date since there has been a delay in
2740 getting the announcements and tarballs out.
2741
2742 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2743
2744 * NEWS: Version 2.3b.
2745 * configure.ac (AC_INIT): Likewise.
2746 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
2747
2748 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2749
2750 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
2751 been doing it for years.
2752 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
2753 (Release Procedure): Add FIXME about make alpha being unmaintained.
2754
2755 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
2756
2757 * data/yacc.c: Reformat m4 a little for readability.
2758 * src/lalr.c (build_relations): Correct comment.
2759
2760 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2761
2762 DJGPP specific issue.
2763 * djgpp/config.sed: Fixes required to run configure scripts generated
2764 by autoconf 2.62.
2765
2766 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2767
2768 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
2769 coordinator@translationproject.org.
2770
2771 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2772
2773 * THANKS: Add Eric Blake.
2774
2775 2008-04-23 Eric Blake <ebb9@byu.net>
2776
2777 Revert prior patch, by working around autoconf regression.
2778 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
2779 ("Output file name: ("): Uncomment test.
2780 ("Output file name: )"): Likewise.
2781 Based on an idea from Noah Misch.
2782
2783 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2784
2785 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
2786 2.61. Reported by Juan Manuel Guerrero at
2787 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
2788 * tests/output.at ("Output file name: ("): Comment out test case for
2789 now.
2790 ("Output file name: )"): Likewise.
2791
2792 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2793
2794 * GNUmakefile: Update git-version-gen invocation so make dist
2795 succeeds.
2796
2797 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2798
2799 Update to the current gnulib CVS repository, and fix trigraph handling
2800 in Bison.
2801 * bootstrap: Update gnulib CVS repository URL.
2802 (symlink_to_dir): Encapsulate the code that guarantees the destination
2803 directory exists into...
2804 (check_dst_dir): ... this new function, and...
2805 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
2806 fail when copying files into lib/uniwidth/.
2807 * src/output.c (prepare_symbols): When writing yytname muscles, where
2808 symbol names will be encoded in C-string literals, tell quotearg to
2809 escape trigraphs. This used to be the default in gnulib.
2810 * tests/regression.at (Token definitions): Because of the change in
2811 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
2812 escapes trigraphs in symbol names. Thus, yytname no longer has
2813 trigraphs unnecessarily doubly escaped. Update test case output.
2814 Extend test case to be sure Bison's own error messages will no longer
2815 have trigraphs in symbol names unnecessarily escaped once.
2816
2817 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2818
2819 Fix make dist infinite loop reported by Juan Manuel Guerrero at
2820 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
2821 * .cvsignore: Add .version.
2822 * .version.in: New.
2823 * bootstrap.conf (gnulib_modules): Add git-version-gen.
2824 * configure.ac (AC_CONFIG_FILES): Add .version.
2825 * build-aux/.cvsignore: Add git-version-gen.
2826
2827 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2828
2829 * NEWS (2.3a+): Mention that -g now takes an argument.
2830 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
2831 consistency. Update the -g and -x entries now that they take
2832 arguments. Use brackets to indicate optional arguments.
2833 * src/getargs.c (usage): Explain the relationship between arguments of
2834 long and short options more completely. Document --defines and -d
2835 separately since the former takes an argument but, for POSIX Yacc, the
2836 latter does not.
2837 (short_options): Let -W take an optional argument like --warnings.
2838 (getargs): Sort cases.
2839
2840 2008-02-28 Akim Demaille <demaille@gostai.com>
2841
2842 * doc/bison.texinfo: Fix a few typos.
2843
2844 2008-02-28 Akim Demaille <akim@epita.fr>
2845
2846 * doc/bison.texinfo (Bison Options): Document -W.
2847 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
2848
2849 2008-02-28 Akim Demaille <akim@epita.fr>
2850
2851 * src/getargs.c (short_options): Split and sort for readability.
2852 -g and -x take optional arguments, just like their long options.
2853 * build-aux/cross-options.pl: Use /x to make the regexp easier to
2854 understand.
2855 Fix the handling of $opt which resulted in all the argument to be
2856 considered as optional.
2857
2858 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
2859
2860 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
2861 say its interface is experimental.
2862 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2863 Java.
2864 (Bison Options): In the -L and --language entry, mention Java.
2865 (Java Bison Interface): Say the interface is experimental.
2866 * src/getargs.c (usage): Mention -L and --language.
2867
2868 * NEWS (2.3a+): Say the push parsing interface is experimental.
2869 * doc/bison.texinfo (Push Decl): Likewise.
2870 (Decl Summary): Likewise in the "%define api.push_pull" entry.
2871 (Push Parser Function): Likewise.
2872 (Pull Parser Function): Likewise.
2873 (Parser Create Function): Likewise.
2874 (Parser Delete Function): Likewise.
2875 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
2876 yypull_parse, and yypush_parse entries.
2877
2878 * NEWS (2.3a+): Mention XML support, and say the schema is
2879 experimental.
2880 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
2881 * src/getargs.c (usage): Say the XML schema is experimental.
2882
2883 * NEWS (2.3a+): Say option instead of flag.
2884
2885 2008-02-21 Wojciech Polak <polak@gnu.org>
2886
2887 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
2888 text.
2889
2890 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
2891
2892 Fix impure push parser compile error reported by Bob Rossi at
2893 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
2894 * data/yacc.c: Clean up whitespace in the output a little.
2895 (yypstate_allocated): Define for impure push parsers regardless of
2896 whether the pull interface is also requested.
2897 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
2898 check impure push parsers without the pull interface.
2899
2900 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
2901 yyerror takes arguments specified by %parse-param while yypstate_new
2902 does not.
2903 * doc/bison.texinfo (Parser Create Function): Document that
2904 yypstate_new returns 0 for multiple impure parser instances.
2905 * tests/push.at (Push Parsing: Multiple impure instances): Update
2906 expected stderr output.
2907
2908 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2909
2910 * runtime-po/POTFILES.in (push.c): Remove.
2911
2912 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2913
2914 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
2915 * data/push.c: Rename to...
2916 * data/yacc.c: ... this, overwriting it.
2917 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
2918 `%push-pull-parser' -> `%define api.push_pull "both"'.
2919 Remove old yacc.c tests, and update push.c tests to yacc.c.
2920
2921 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2922
2923 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
2924 `"%code top" blocks' instead of `%code "top" blocks'.
2925 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
2926 Clean up whitespace in the output a little.
2927
2928 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2929
2930 Fix documentation problems reported by Tim Josling at
2931 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
2932 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
2933 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
2934 integers. Explain the effect of literal string aliases on error
2935 messages. Copy token 0 documentation from the C++ skeleton
2936 documentation.
2937
2938 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2939
2940 Accept a token number in a %left, %right, or %nonassoc for POSIX
2941 conformance. Reported by Tim Josling at
2942 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
2943 * NEWS (2.3a+): Mention.
2944 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
2945 and code numbers are treated by precedence declarations.
2946 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
2947 of symbols.1.
2948 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
2949 of symbol.
2950 (symbol.prec): New, just like symbol but allows INT.
2951 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
2952 longer holds.
2953 * tests/regression.at (Token number in precedence declaration): New
2954 test case.
2955
2956 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2957
2958 DJGPP specific issues.
2959 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
2960 be changed. Copyright timestamp adjusted.
2961 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
2962 be changed. Copyright timestamp adjusted.
2963 * djgpp/config.site: Copyright timestamp adjusted.
2964 * djgpp/config_h.sed: Copyright timestamp adjusted.
2965 * djgpp/djunpack.bat: Copyright timestamp adjusted.
2966 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
2967 filename translation list.
2968 * djgpp/subpipe.c (init_subpipe): Check the environment variables
2969 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
2970 files shall be created. Before trying to use the temp dir where the
2971 environment variable points to check that the dir really exists. If
2972 not default to the cwd as temp dir. Copyright timestamp adjusted.
2973 * djgpp/subpipe.h: Copyright timestamp adjusted.
2974 * djgpp/testsuite.sed: Copyright timestamp adjusted.
2975
2976 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2977
2978 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
2979
2980 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
2981
2982 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
2983 Problem reported by Claudio Saavedra in
2984 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
2985
2986 2008-01-05 Wojciech Polak <polak@gnu.org>
2987
2988 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
2989 document's title with the input grammar file name.
2990
2991 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
2992
2993 Automate regression testing of the XML/XSLT implementation. Discussed
2994 starting at
2995 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2996 * configure.ac (XSLTPROC): New substitution.
2997 * Makefile.am (maintainer-xml-check): New phony target invoking...
2998 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2999 invoking make maintainer-check with BISON_TEST_XML=1.
3000 * tests/atlocal.in (XSLTPROC): New.
3001 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3002 not to report reachable memory when Bison is expected to have a
3003 non-zero exit status and (2) to compare XML/XSLT output with --graph
3004 and --report=all output for every working grammar when
3005 BISON_TEST_XML=1.
3006 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3007 (AT_BISON_CHECK_XML): New.
3008 (AT_QUELL_VALGRIND): New.
3009 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3010 (AT_CHECK): ... don't redefine this since this was the old way to
3011 quell Valgrind.
3012 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3013 AT_BISON_CHECK invocations.
3014 * tests/c++.at: Likewise.
3015 * tests/calc.at: Likewise.
3016 * tests/conflicts.at: Likewise.
3017 * tests/cxx-type.at: Likewise.
3018 * tests/existing.at: Likewise.
3019 * tests/glr-regression.at: Likewise.
3020 * tests/headers.at: Likewise.
3021 * tests/input.at: Likewise.
3022 * tests/java.at: Likewise.
3023 * tests/output.at: Likewise.
3024 * tests/push.at: Likewise.
3025 * tests/reduce.at: Likewise.
3026 * tests/regression.at: Likewise.
3027 * tests/sets.at: Likewise.
3028 * tests/skeletons.at: Likewise.
3029 * tests/synclines.at: Likewise.
3030 * tests/torture.at: Likewise.
3031 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3032 tends to hang xsltproc.
3033 (Big horizontal): Likewise.
3034
3035 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3036
3037 In XML output, remove redundant class attribute on symbol element.
3038 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3039 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3040 look up a symbol to determine whether it's a nonterminal or terminal.
3041 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3042 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3043
3044 Add prec/assoc information to XML output.
3045 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3046 %prec, add a percent_prec attribute.
3047 * src/print-xml.c (print_grammar): For each terminal that has a
3048 precedence or associativity, add a prec or assoc attribute.
3049 (xml_indent): New.
3050 (xml_puts): Use xml_indent.
3051 (xml_printf): Use xml_indent.
3052 * src/print-xml.h (xml_indent): Prototype.
3053
3054 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3055 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3056
3057 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3058
3059 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3060 (bison:ruleByNumber): ... this for clarity.
3061 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3062 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3063 (xsl:template match="reduction"): Update.
3064 (xsl:template match="item"): Update.
3065 (xsl:template match="reduction"): Update.
3066
3067 In the XML output, don't print the list of rules where symbols appear.
3068 Compute it in XSLT instead. Discussed at
3069 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3070 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3071 (bison:ruleByRhs): New.
3072 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3073 bison:ruleByRhs.
3074 (xsl:template match="terminal/rule"): Remove.
3075 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3076 bison:ruleByRhs.
3077 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3078 Remove.
3079 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3080 bison:ruleByRhs and mode="number-link" for rule template.
3081 (xsl:template match="terminal/rule"): Remove.
3082 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3083 bison:ruleByRhs and mode="number-link" for rule template.
3084 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3085 Rewrite as...
3086 (xsl:template match="rule" mode="number-link"): ... this.
3087 * src/print-xml.c (print_grammar): Don't print the list of rules.
3088
3089 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3090
3091 Don't let --report affect XML output; always print all information.
3092 Discussed at
3093 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3094 * src/conflicts.c (log_resolution): Implement.
3095 * src/print-xml.c (print_core): Implement.
3096 (print_state): Implement.
3097 (print_xml): Implement.
3098
3099 * NEWS (2.3a+): Fix quotes.
3100 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3101 don't let %verbose clear the list specified by --report.
3102
3103 2007-11-26 Akim Demaille <akim@epita.fr>
3104
3105 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3106
3107 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3108
3109 In the XML output, list useless and unused symbols and rules with the
3110 useful ones and add a "usefulness" attribute. Discussed starting at
3111 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3112 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3113 (grammar_rules_print_xml): Print all rules instead of just those
3114 useful in the grammar, and add a "usefulness" attribute.
3115 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3116 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3117 (print_grammar): Print all nonterminals instead of just useful ones,
3118 and add a "usefulness" attribute to nonterminals and terminals.
3119 (print_xml): Don't print a separate "reductions" or
3120 "rules-useless-in-parser" element.
3121 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3122 (reduce_xml): Remove.
3123 (reduce_token_unused_in_grammar): New.
3124 (reduce_nonterminal_useless_in_grammar): New.
3125 * src/reduce.h (reduce_xml): Remove prototype.
3126 (reduce_token_unused_in_grammar): Add prototype.
3127 (reduce_nonterminal_useless_in_grammar): Add prototype.
3128 * data/xslt/xml2text.xsl: Update for XML changes.
3129 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3130 * tests/reduce.at (Useless Terminals): Update output.
3131 (Useless Rules): Update output.
3132 (Reduced Automaton): Update output.
3133
3134 Say "Terminals unused in grammar" instead of "Unused terminals".
3135 * NEWS (2.3a+): Update.
3136 * doc/bison.texinfo (Understanding): Update example output.
3137 * src/reduce.c (reduce_output): Implement.
3138 * data/xslt/xml2text.xsl: Implement.
3139 * data/xslt/xml2xhtml.xsl: Implement.
3140
3141 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3142
3143 Accept --report-file=FILE to override the default `.output' filename.
3144 * NEWS (2.3a+): Mention.
3145 * doc/bison.texinfo (Bison Options): Add an entry.
3146 * src/files.c (compute_output_file_names): Don't override
3147 spec_verbose_file if already set.
3148 * src/getargs.c (usage): Document --report-file.
3149 (REPORT_FILE_OPTION): New anonymous enum member.
3150 (long_options): Add entry for it.
3151 (getargs): Add case for it setting spec_verbose_file.
3152
3153 * build-aux/cross-options.pl: Don't record a short option just because
3154 there's an arg.
3155 * doc/.cvsignore: Add yacc.1.
3156
3157 2007-11-14 Akim Demaille <akim@epita.fr>
3158
3159 * doc/yacc.1.in: New.
3160 * configure.ac, doc/Makefile.am: Adjust.
3161 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
3162 config.h symbol.
3163 Use AC_SUBST for assignments too.
3164 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
3165
3166 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3167
3168 * src/gram.c: Remove comments that duplicate comments in gram.h.
3169
3170 When reporting useless rules and nonterminals, say "useless in grammar"
3171 instead of "useless", and say "useless in parser" instead of "never
3172 reduced". Discussed starting at
3173 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
3174 * NEWS (2.3a+): Mention this change.
3175 * data/xslt/xml2text.xsl: Update output text and expected input XML
3176 element names to match changes below.
3177 * data/xslt/xml2xhtml.xsl: Likewise.
3178 (xsl:template match="bison-xml-report"): Add missing entry in Table of
3179 Contents: "Rules useless in parser due to conflicts".
3180 * doc/bison.texinfo (Decl Summary): Reword a little.
3181 (Understanding): Update example output for changes below.
3182 * src/gram.c: (rule_useful_p): Rename to...
3183 (rule_useful_in_grammar_p): ... this.
3184 (rule_useless_p): Rename to...
3185 (rule_useless_in_grammar_p): ... this.
3186 (rule_never_reduced_p): Rename to...
3187 (rule_useless_in_parser_p): ... this.
3188 (grammar_rules_print): Update for renames.
3189 (grammar_rules_print_xml): Update for renames.
3190 (grammar_rules_never_reduced_report): Rename to...
3191 (grammar_rules_useless_report): ... this since it is used for either
3192 kind of useless rule.
3193 * src/gram.h: Reword comments and update function names in prototypes.
3194 * src/main.c (main): Say "rule useless in parser due to conflicts".
3195 * src/print-xml.c (print_rules_never_reduced): Rename to...
3196 (print_rules_useless_in_parser): ... this, and rename output XML
3197 element "rules-never-reduced" to "rules-useless-in-parser".
3198 (print_xml): Update for rename.
3199 * src/print.c (print_results): Say "Rules useless in parser due to
3200 conflicts".
3201 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
3202 (nonterminals_reduce): Say "nonterminal useless in grammar".
3203 (reduce_output): Say "Nonterminals useless in grammar".
3204 Say "Rules useless in grammar".
3205 (reduce_xml): Rename output XML element "useless" to
3206 "useless-in-grammar".
3207 (reduce_print): Don't report the count of grammatically useless rules
3208 as "rules never reduced" just because %yacc is specified.
3209 In the correct report of this count, say nonterminal(s) and rule(s)
3210 "useless in grammar".
3211 * tests/conflicts.at (S/R in initial): Update expected output.
3212 (Defaulted Conflicted Reduction): Likewise.
3213 (Unreachable States After Conflict Resolution): Likewise.
3214 * tests/existing.at (GNU pic Grammar): Likewise.
3215 * tests/reduce.at (Useless Nonterminals): Likewise.
3216 (Useless Rules): Likewise.
3217 (Reduced Automaton): Likewise.
3218 (Underivable Rules): Likewise.
3219 (Empty Language): Likewise.
3220
3221 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3222
3223 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
3224 here document and before the EOF so that BSD's implementation of Bourne
3225 shell doesn't parse the delimiter as part of the here document.
3226 * doc/.cvsignore: Add cross-options.texi.
3227 * src/getargs.c (usage): Add a blank line after the warning categories.
3228
3229 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
3230
3231 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
3232
3233 2007-11-05 Akim Demaille <akim@epita.fr>
3234
3235 Remove Id: from bison.1.
3236 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
3237 (perl -0777 -pi -e 's/\.PP\nId): New.
3238 (.x.1): Use it to ignore the version control revision.
3239
3240 2007-11-05 Akim Demaille <demaille@gostai.com>
3241
3242 * build-aux/Makefile.am: Ship cross-options.pl.
3243 * doc/Makefile.am: Always refer to cross-options.texi with
3244 $(srcdir).
3245 (MAINTAINERCLEANFILES): Add it.
3246
3247 2007-11-04 Akim Demaille <demaille@gostai.com>
3248
3249 Generate the long/short option cross-table.
3250 * build-aux/cross-options.pl: New.
3251 * doc/Makefile.am (cross-options.texi): New.
3252 * doc/bison.texinfo: Use it.
3253
3254 2007-11-04 Akim Demaille <demaille@gostai.com>
3255
3256 Generate bison.1 using help2man.
3257 * doc/common.x, doc/bison.x: New.
3258 * doc/Makefile.am (bison.1, .x.1): New.
3259 The code is taken from autoconf-2.61/man/Makefile.am.
3260 * configure.ac: Look for help2man.
3261
3262 2007-11-04 Akim Demaille <demaille@gostai.com>
3263
3264 Complete --help.
3265 * src/getargs.c (usage): Document -W, make it clear that -d,
3266 -g and -x have optional arguments.
3267
3268 2007-11-04 Akim Demaille <demaille@gostai.com>
3269
3270 Find sha1sum when named gsha1sum.
3271 * bootstrap (find_tool): New.
3272 ($SHA1SUM): New.
3273
3274 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3275
3276 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
3277 at
3278 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
3279 * NEWS (2.3a+): Mention.
3280 * data/bison.m4 (b4_pure_if): Don't define it here.
3281 * data/c.m4 (b4_identification): Depend on individual skeletons to
3282 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
3283 values of the %define variables api.pure or api.push_pull. Define
3284 YYPURE, YYPUSH, and YYPULL accordingly.
3285 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
3286 glr.cc has already defined b4_pure_flag.
3287 * data/push.c: Define b4_pure_if based on `%define api.pure'.
3288 Remove YYPUSH and YYPULL since they're back in b4_identification again.
3289 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
3290 * doc/bison.texinfo (Pure Decl): Update.
3291 (Push Decl): Update.
3292 (Decl Summary): Add api.pure to %define entry.
3293 In %pure-parser entry, say it's deprecated and reference %define.
3294 (Pure Calling): Update.
3295 (Error Reporting): Update.
3296 (C++ Scanner Interface): Update.
3297 (How Can I Reset the Parser): Update.
3298 (Table of Symbols): In %pure-parser entry, say it's deprecated and
3299 reference %define.
3300 * src/getargs.c (pure_parser): Remove global variable.
3301 * src/getargs.h (pure_parser): Remove extern.
3302 * src/output.c (prepare): Don't define pure_flag muscle.
3303 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
3304 wrapper around `%define api.pure'.
3305 * tests/calc.at (Simple LALR Calculator): Update.
3306 (Simple GLR Calculator): Update.
3307 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
3308 Update.
3309 (GLR: Resolve ambiguity, pure, locations): Update.
3310 (GLR: Merge conflicting parses, pure, no locations): Update.
3311 (GLR: Merge conflicting parses, pure, locations): Update.
3312 * tests/glr-regression.at (Uninitialized location when reporting
3313 ambiguity): Update
3314 * tests/input.at (Unused %define api.pure): New test case.
3315 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
3316 AT_PURE_IF and AT_PURE_AND_LOC_IF.
3317 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3318
3319 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3320
3321 %define push_pull -> %define api.push_pull. Discussed starting at
3322 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
3323 * data/push.c: Expect the new name.
3324 * data/yacc.c: Likewise.
3325 * doc/bison.texinfo (Push Decl): Update.
3326 (Decl Summary): Update %define entry.
3327 (Push Parser Function): Update.
3328 (Pull Parser Function): Update.
3329 (Parser Create Function): Update.
3330 (Parser Delete Function): Update.
3331 * tests/calc.at (Simple LALR Calculator): Update.
3332 * tests/input.at (%define enum variables): Update.
3333 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3334 (Push Parsing: Multiple impure instances): Update.
3335 (Push Parsing: Unsupported Skeletons): Update.
3336 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
3337 (Exploding the Stack Size with Malloc): Update.
3338
3339 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
3340 other entries some.
3341
3342 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
3343
3344 For the XML output's terminal element, rename @number to @token-number,
3345 and add @symbol-number. In the nonterminal element, rename @number to
3346 @symbol-number. Discussed starting at
3347 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
3348 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
3349 renames.
3350 (xsl:template match="nonterminal"): Likewise.
3351 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
3352 (xsl:template match="nonterminal"): Likewise.
3353 * src/print-xml.c (print_grammar): Implement.
3354
3355 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3356
3357 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
3358 2007-10-11 change, the child elements here are items not rules.
3359 (xsl:template match="item"): New.
3360 (xsl:template match="rule"): Update for new reduced itemset.
3361 (xsl:template match="point"): Remove.
3362 (xsl:template match="empty"): For consistency with --graph, don't
3363 output "/* empty */".
3364 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
3365 line-wrap, don't pass a negative value as first-line-length since this
3366 won't work with the following changes.
3367 (xsl:template name="line-wrap"): Simplify slightly.
3368 (xsl:template name="ws-search"): Eliminate recursion.
3369 * src/print_graph.c (print_core): Don't print a reduction's lookahead
3370 set next to an item whose dot is not at the end of the RHS even if it
3371 happens to be associated with the same rule.
3372
3373 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3374
3375 Add %define lr.keep_unreachable_states.
3376 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
3377 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
3378 * src/main.c (main): Implement it.
3379 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3380 Extend to test it, and fix a typo.
3381
3382 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3383
3384 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
3385 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
3386 the example .output text.
3387 * tests/regression.at (Extra lookahead sets in report): Improve wording
3388 of comments.
3389
3390 2007-10-17 Wojciech Polak <polak@gnu.org>
3391
3392 * src/print-xml.c (print_grammar): Renamed
3393 <terminal> and <nonterminal> attributes:
3394 "type" to "number" and "symbol" to "name".
3395 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
3396 Use new attribute names.
3397 (xsl:template match="nonterminal"): Likewise.
3398 * data/xslt/xml2xhtml.xsl: Likewise.
3399
3400 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
3401
3402 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
3403 (Option Cross Key): Likewise.
3404
3405 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
3406 next to an item whose dot is not at the end of the RHS even if it
3407 happens to be associated with the same rule.
3408 * src/print.c (print_core): Likewise.
3409 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
3410 (Resolved SR Conflicts): Update output.
3411 * tests/regression.at (Extra lookahead sets in report): New test case.
3412
3413 2007-10-11 Wojciech Polak <polak@gnu.org>
3414
3415 * src/print-xml.c (print_core): Remove item set
3416 redundancy.
3417 * data/xslt/bison.xsl (bison:ruleNumber): New key.
3418 Improve processing time. Suggested by Joel E. Denny.
3419 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
3420 Write xsl:param "required" attribute as comment.
3421 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
3422 (xsl:template match="rule"): Support new reduced itemset.
3423 (xsl:template match="point"): Remove.
3424 * data/xslt/xml2xhtml.xsl: Likewise.
3425
3426 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3427
3428 * src/getargs.c (version): Update copyright year.
3429
3430 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3431
3432 Make xml2dot.xsl and --graph produce the same output.
3433 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
3434 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
3435 escaped later.
3436 (xsl:template name="output-node"): Use the new escape template instead
3437 of the string-replace template directly.
3438 (xsl:template name="output-edge"): Likewise.
3439 (xsl:template name="escape"): New, escapes backslashes and newlines in
3440 addition to quotation marks.
3441 * src/graphviz.c (start_graph, output_node, output_edge): Add
3442 whitespace to output for legibility.
3443
3444 Make xml2text.xsl and --report produce the same output, and remove the
3445 XML "conflicts" element since a conflict summary is easily extracted
3446 from the automaton.
3447 * data/xslt/bison.xsl: New.
3448 (xsl:template match="state" mode="bison:count-conflicts): New.
3449 * data/xslt/xml2text.xsl: Import bison.xsl.
3450 (xsl:template match="bison-xml-report"): Instead of styling the
3451 "conflicts" element, style the "automaton" element with mode
3452 "conflicts". Unlike the former, the latter lists S/R and R/R
3453 conflicts for a state on the same line.
3454 (xsl:template match="conflicts"): Remove.
3455 (xsl:template match="conflict"): Remove.
3456 (xsl:template match="terminal"): Line-wrap the list of rules in which
3457 the terminal is used.
3458 (xsl:template match="nonterminal"): Likewise for nonterminals.
3459 (xsl:template match="automaton" mode="conflicts"): New.
3460 (xsl:template match="state" mode="conflicts"): New.
3461 (xsl:template name="line-wrap"): New.
3462 (xsl:template name="ws-search"): New.
3463 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
3464 (xsl:template match="bison-xml-report"): Instead of styling the
3465 "conflicts" element, style the "automaton" element with mode
3466 "conflicts."
3467 (xsl:template match="conflicts"): Remove.
3468 (xsl:template match="conflict"): Remove.
3469 (xsl:template match="automaton" mode="conflicts"): New.
3470 (xsl:template match="state" mode="conflicts): New.
3471 * src/conflicts.c (conflicts_output_xml): Remove.
3472 * src/conflicts.h (conflicts_output_xml): Remove prototype.
3473 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
3474 * src/print.c (print_grammar): Consistently wrap at the 66th column so
3475 the corresponding XSLT is easier. Also, never wrap between a word and
3476 the comma that follows it.
3477
3478 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3479
3480 Improve C++ namespace support. Discussed starting at
3481 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
3482 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
3483 b4_namespace_close): New macros that interpret the %define variable
3484 "namespace" so its value can contain "::" to indicate nested
3485 namespaces.
3486 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
3487 the above macros.
3488 * data/lalr1.cc (b4_namespace): Likewise.
3489 * data/location.cc (b4_namespace): Likewise.
3490 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
3491 inside a new table in the general %define entry. Document `%define
3492 namespace' there as well. Point the %name-prefix entry to it since it
3493 explains it more completely in the case of C++.
3494 (C++ Bison Interface): Mention `%define namespace' instead of
3495 %name-prefix.
3496 (Table of Symbols): Remove the `%define push_pull' entry. The %define
3497 entry suffices.
3498 * tests/c++.at (Relative namespace references): New test case.
3499 (Absolute namespace references): New test case.
3500 (Syntactically invalid namespace references): New test case.
3501 * tests/input.at (C++ namespace reference errors): New test case.
3502
3503 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3504
3505 Add syncline support and location accessor to internal %define
3506 interfaces.
3507 * data/bison.m4 (b4_percent_define_get_loc): New.
3508 (b4_percent_define_get_syncline): New.
3509 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
3510 (b4_percent_define_default): Record defining location as line 1 rather
3511 than 0 for the sake of synchronizing #line's, and define
3512 b4_percent_define_syncline(VARIABLE).
3513 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
3514 * src/muscle_tab.c (muscle_syncline_grow): New.
3515 (muscle_code_grow): Use muscle_syncline_grow.
3516 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
3517 define b4_percent_define_syncline(VARIABLE).
3518 (muscle_percent_define_get_loc): New.
3519 (muscle_percent_define_get_syncline): New.
3520 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
3521 remove some unused variables.
3522 (muscle_percent_define_default): Record defining location as line 1
3523 rather than 0 for the sake of synchronizing #line's, and define
3524 b4_percent_define_syncline(VARIABLE).
3525 (muscle_percent_define_check_values): Use
3526 muscle_percent_define_get_loc.
3527 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
3528 (muscle_percent_define_get_syncline): Prototype.
3529 * tests/skeletons.at (%define Boolean variables: invalid skeleton
3530 defaults): Update output for location change.
3531 (Complaining during macro argument expansion): Extend to test
3532 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
3533
3534 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
3535
3536 Fix some error-reporting macro bugs.
3537 * data/bison.m4 (b4_cat): New.
3538 (b4_error, b4_error_at): Use b4_cat to send error directives directly
3539 to stdout so they don't become arguments to other macros. Update
3540 comments and add examples.
3541 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
3542 add examples.
3543 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
3544 after printing the error directive so that M4 doesn't report subsequent
3545 problems that are induced by this problem.
3546 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
3547 instead of just in them. Recognize @\n in both places. Both expand to
3548 the empty string. Needed by b4_cat.
3549 * tests/skeletons.at (Complaining during macro argument expansion):
3550 New test case.
3551 (Fatal errors make M4 exit immediately): New test case.
3552
3553 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
3554
3555 Implement --print-datadir.
3556 * src/getargs.c (usage): Mention.
3557 (PRINT_DATADIR_OPTION): New anonymous enum member.
3558 (long_options): Add entry for it.
3559 (getargs): Add case for it calling compute_pkgdatadir.
3560 * src/output.c (output_skeleton): Encapsulate data directory
3561 computation from here...
3562 (prepare): ... and from here...
3563 (compute_pkgdatadir): ... into this new function.
3564 * src/output.h (compute_pkgdatadir): Prototype.
3565
3566 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
3567
3568 * src/print-xml.c (escape_bufs): New static global variable
3569 replacing...
3570 (xml_escape_n): ... the static local variable buf here.
3571 (print_xml): Free memory for escape_bufs.
3572 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
3573
3574 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
3575
3576 Replace `%push-parser' and `%push-pull-parser' with
3577 `%define push_pull "push"' and `%define push_pull "both"'.
3578 `%define push_pull "pull"' is the default.
3579 * doc/bison.texinfo (Push Decl, Push Parser Function,
3580 Pull Parser Function, Parser Create Function, Parser Delete Function):
3581 Update declarations.
3582 (Decl Summary, Table of Symbols): Replace %push-parser and
3583 %push-pull-parser entries with a %define push_pull entry.
3584 * data/bison.m4 (b4_percent_define_check_values): New macro.
3585 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
3586 definitions...
3587 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
3588 definitions...
3589 * data/push.c: ... to here and compute them from the value of the
3590 %define variable push_pull.
3591 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
3592 parsing requests here...
3593 * data/yacc.c: ... hack this to switch to push.c any time
3594 b4_use_push_pull_flag or the %define variable push_pull is set. This
3595 will go away when we mv push.c yacc.c.
3596 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
3597 push parsing is not supported since unused %define variables are
3598 reported anyway.
3599 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
3600 * src/muscle_tab.h (muscle_percent_define_check_values): Update
3601 comments for consistency with b4_percent_define_check_values.
3602 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
3603 muscles.
3604 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
3605 Remove.
3606 (prologue_declaration): Remove %push-parser and %push-pull-parser
3607 rules.
3608 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
3609 * tests/calc.at: Update declarations.
3610 * tests/input.at (%define enum variables): New test case.
3611 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
3612 declaration.
3613 (Push Parsing: Multiple impure instances): Update declaration.
3614 (Push Parsing: Unsupported Skeletons): New test case.
3615 * tests/torture.at (Exploding the Stack Size with Alloca): Update
3616 declaration.
3617 (Exploding the Stack Size with Malloc): Update declaration.
3618
3619 2007-09-24 Wojciech Polak <polak@gnu.org>
3620
3621 Add XSLT transformations.
3622
3623 * data/xslt/xml2dot.xsl: Transform XML into DOT.
3624 * data/xslt/xml2text.xsl: Transform XML into plain text.
3625 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
3626 * data/Makefile.am (xsltdir): New variable.
3627 (dist_xslt_DATA): Add xslt/*.xsl files.
3628
3629 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
3630
3631 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
3632 Problem reported by Wojciech Polak.
3633 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
3634 (xml_printf): Undo change I made on 21 September; that is,
3635 indent 2 spaces, not 1.
3636
3637 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
3638
3639 Pacify ./configure --enable-gcc-warnings.
3640 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
3641 `char const *' instead of `char *'.
3642 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
3643 local variable `sep'.
3644
3645 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3646
3647 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
3648 elsewhere.
3649 * src/print-xml.c: Prefer "const" after types; that's more consistent.
3650 (xml_printf): Indent just 1 space for level.
3651 (e_char, xlate_char): Remove.
3652 (xml_escape_string): Rewrite to avoid undefined behavior (used
3653 storage that was freed from the stack).
3654 (xml_escape_n): Don't bother checking for subscript error.
3655
3656 2007-09-21 Wojciech Polak <polak@gnu.org>
3657
3658 Add Bison XML Automaton Report.
3659
3660 Add support for an -x option to generate an XML report.
3661 It is not documented yet.
3662 * src/print-xml.c: New file.
3663 * src/print-xml.h: Likewise.
3664 * lib/timevar.def (TV_XML): New var.
3665 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
3666 * src/conflicts.c: Include print-xml.h.
3667 (solved_conflicts_xml_obstack): New var.
3668 (log_resolution, conflicts_solve, conflicts_free):
3669 Add support for XML report.
3670 (conflicts_output_val): New function.
3671 * src/conflicts.h (conflicts_output_val): New decl.
3672 * src/files.c (spec_xml_file): New var.
3673 (compute_output_file_names, output_file_names_free): Add XML support.
3674 * src/files.h (spec_xml_file): New decl.
3675 * src/getargs.c (xml_flag): New var.
3676 (usage, short_options, long_options, getargs): Add XML support.
3677 * src/getargs.h (xml_flag): New decl.
3678 * src/gram.c: Include print-xml.h.
3679 (rule_lhs_print_xml, rule_rhs_print_xml):
3680 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
3681 New functions.
3682 * src/gram.h: Declare external ones.
3683 * src/main.c: Include print-xml.h.
3684 (main): Add XML support.
3685 * src/reduce.c: Include print-xml.h.
3686 (reduce_xml): New function.
3687 * src/reduce.h: Declare it.
3688 * src/state.c: Include print-xml.h.
3689 (state_new): Add XML support.
3690 (state_rule_lookahead_tokens_print_xml): New function.
3691 * src/state.h: Declare it.
3692 (struct state): New member solved_conflicts_xml.
3693 * src/symtab.c (symbol_class_get_string): New function.
3694 * src/symtab.h: Declare it.
3695
3696 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3697
3698 * GNUmakefile: Switch to coreutils's version.
3699 * bootstrap: Likewise.
3700 * Makefile.cfg: Adjust to new GNUmakefile.
3701 * README-hacking: Likewise.
3702
3703 Import from gnulib:
3704
3705 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
3706 Bruno Haible <bruno@clisp.org>
3707
3708 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
3709 and is a script that invokes bison. Tighten the code. Add comments.
3710
3711 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
3712
3713 Spell "boolean" as "Boolean". Reported by Akim Demaille.
3714 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
3715 * doc/bison.texinfo (Decl Summary): Fix.
3716 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
3717 * tests/input.at (Boolean %define variables): Update output.
3718 * tests/skeletons.at (%define boolean variables: invalid skeleton
3719 defaults): Rename to...
3720 (%define Boolean variables: invalid skeleton defaults): ... this and
3721 update output.
3722
3723 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
3724
3725 In impure push mode, don't allow more than one yypstate to be allocated
3726 since multiple impure parsers would corrupt yynerrs.
3727 * data/push.c (yypstate_allocated): New static global variable
3728 initialized to 0.
3729 (yypull_parse): If yypstate_new returns 0, don't report it as memory
3730 exhaustion if yypstate_allocated is 1, but still return 2.
3731 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
3732 already 1. Otherwise, set it to 1.
3733 (yypstate_delete): Set it to 0.
3734 * tests/push.at (Push Parsing: Multiple impure instances): New test
3735 case.
3736
3737 2007-08-17 Bob Rossi <bob@brasko.net>
3738
3739 * doc/bison.texinfo (Push Decl): Document the push parser.
3740 (Table of Symbols): Ditto.
3741 (Pure Decl): Ditto.
3742 (Decl Summary): Ditto.
3743 (Multiple Parsers, Push Parser Function, Pull Parser Function,
3744 Parser Create Function, Parser Delete Function):
3745 Add new push parser symbols.
3746 (Table of Symbols): Document push-parser, push-pull-parser,
3747 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
3748
3749 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
3750
3751 Update to GPLv3.
3752 * doc/gpl-3.0.texi: New file.
3753 * doc/gpl.texi: Remove.
3754 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
3755 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
3756 * README-hacking, TODO, bootstrap, bootstrap.conf:
3757 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
3758 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
3759 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
3760 * data/lalr1.cc, data/lalr1.java, data/location.cc:
3761 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
3762 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
3763 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
3764 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
3765 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
3766 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
3767 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
3768 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
3769 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
3770 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
3771 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
3772 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
3773 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
3774 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
3775 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
3776 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
3777 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
3778 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
3779 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
3780 * src/complain.c, src/complain.h, src/conflicts.c:
3781 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
3782 * src/files.h, src/flex-scanner.h, src/getargs.c:
3783 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
3784 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
3785 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
3786 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
3787 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
3788 * src/print.c, src/print.h, src/print_graph.c:
3789 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
3790 * src/reduce.h, src/relation.c, src/relation.h:
3791 * src/revision.h, src/scan-code.h, src/scan-code.l:
3792 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
3793 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
3794 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
3795 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
3796 * tests/Makefile.am, tests/actions.at, tests/c++.at:
3797 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
3798 * tests/existing.at, tests/glr-regression.at:
3799 * tests/headers.at, tests/input.at, tests/java.at:
3800 * tests/local.at, tests/output.at, tests/push.at:
3801 * tests/reduce.at, tests/regression.at, tests/sets.at:
3802 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
3803 * tests/torture.at:
3804 Update to GPLv3.
3805
3806 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3807
3808 Get rid of broken %no-parser, -n, and --no-parser implementation and
3809 documentation.
3810 * TODO: Don't mention them.
3811 * doc/bison.1: Likewise.
3812 * doc/bison.texinfo (Decl Summary): Likewise.
3813 (Bison Options): Likewise.
3814 (Option Cross Key): Likewise.
3815 * src/getargs.c (no_parser_flag): Remove global variable.
3816 (usage): Don't print description of -n and --no-parser.
3817 (long_options): Remove --no-parser entry here.
3818 (getargs): Remove -n case in the switch here.
3819 * src/getargs.h (no_parser_flag): Remove extern.
3820 * tests/regression.at (Web2c Actions): Remove comment that mentions
3821 --no-parser.
3822
3823 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3824
3825 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
3826 name user variables starting with `yy'. Just pass NULL instead of a
3827 dummy local &yylval to yypush_parse.
3828 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
3829 starting with `yy'.
3830
3831 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
3832
3833 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
3834 true since it's then always used regardless of whether yyoverflow is
3835 defined. Reported by Christian Burger at
3836 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
3837 * THANKS: Add Christian Burger.
3838
3839 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3840 node names: say "Decl Summary" not "Bison Declaration Summary".
3841
3842 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
3843
3844 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
3845 determine whether this function has already complained about an invalid
3846 value for a %define boolean variable, don't check whether Bison has
3847 ever examined the value. As written, the check was a tautology.
3848 Instead, record and check for this complaint using a separate muscle.
3849
3850 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3851
3852 Fix push parsing memory leak reported by Brandon Lucia at
3853 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
3854 * THANKS: Add Brandon Lucia.
3855 * data/push.c (yypstate_delete): Free the stack if it was reallocated
3856 but the parse never completed and thus freed it.
3857 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
3858 * tests/testsuite.at: Include push.at.
3859 * test/push.at: New.
3860 (Push Parsing: Memory Leak for Early Deletion): New test case.
3861
3862 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
3863
3864 Improve handling of multiple S/R conflicts in the same state and of S/R
3865 conflicts involving multiple reductions.
3866 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
3867 set for a state here or Bison will abort if it is reassigned on a
3868 later conflicted reduction in the same state.
3869 Similarly, don't finalize and assign the solved conflicts report here
3870 or it will be lost if it is reassigned on a later conflicted reduction
3871 in the same state.
3872 (set_conflicts): Instead, assign them both here after all S/R conflicts
3873 in the state have been fully examined.
3874 * src/print.c (shift_set): Rename to...
3875 (no_reduce_set): ... this.
3876 (print_reductions): Update for rename, and add %nonassoc error action
3877 tokens to no_reduce_set so that, when printing the first remaining
3878 reduction on an error action token, the reduction is enclosed in
3879 brackets.
3880 (print_results): Update for rename.
3881 * tests/conflicts.at (Solved conflicts report for multiple reductions
3882 in a state): New test case.
3883 (%nonassoc error actions for multiple reductions in a state): New test
3884 case.
3885
3886 * src/main.c (main): Don't depend on C99 features.
3887
3888 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3889
3890 * build-aux/.cvsignore: Add compile.
3891 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
3892 uniwidth.
3893
3894 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
3895
3896 * bootstrap (slurp): Create target directories that don't exist.
3897 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
3898
3899 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3900
3901 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
3902 than item number.
3903 * closure.c (closure): Likewise.
3904 * state.h (reductions): Comment sorting of rules.
3905 (state): Comment sorting of items.
3906
3907 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
3908
3909 Fix C++ test cases after recent Gnulib changes. Discussed starting at
3910 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
3911 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
3912 definition in order to avoid Gnulib headers since we don't use config.h
3913 here.
3914 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
3915 rather than AT_DATA so that config.h is included.
3916
3917 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
3918
3919 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
3920 instead of fprintf. Guard these functions with #if YYDEBUG instead of
3921 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
3922 and so that YYFPRINTF is guaranteed to be defined here.
3923
3924 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3925
3926 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
3927 with...
3928 (muscle_percent_define_check_values): ... this more helpful function.
3929 Again, it's not used yet, but it will be.
3930 * src/muscle_tab.h: Likewise.
3931
3932 Improve some comments in parser table construction.
3933 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
3934 (generate_states): Don't mention ruleset, which is internal to closure.
3935 * src/closure.c (closure): Explain sorting of core and itemset, which
3936 is required for this function to behave correctly.
3937 * src/closure.h (closure): Mention sorting.
3938
3939 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
3940
3941 * src/lalr.c (state_lookahead_tokens_count): For code readability,
3942 move the check for disabled transitions to an aver since conflict
3943 resolution hasn't happened yet.
3944
3945 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
3946 labels a state as inconsistent just because it has error transitions.
3947 The original form of this check appeared in revision 1.1 of lalr.c,
3948 which was committed on 1991-12-21. Now (at least), changing the
3949 consistency label on such a state appears to have no useful effect in
3950 any of the places it is examined, which I enumerate below. The key
3951 point to understanding each item in this enumeration is that a state
3952 with an error transition is labelled consistent in the first place only
3953 if it has no rules, so the check cannot matter for states that have
3954 rules. (1) Labelling a state as inconsistent will cause set_conflicts
3955 to try to identify its conflicts, and a state must have *rules* to have
3956 conflicts. (2) Labelling a state as inconsistent will affect how
3957 action_row sets the default *rule* for the state. (3) Labelling a
3958 state as inconsistent will cause build_relations to add lookback edges
3959 to *rules* in that state.
3960 * src/state.h (struct state): Word the comment for member consistent
3961 more carefully.
3962
3963 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3964
3965 Don't depend on C99 features.
3966 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
3967 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
3968 * src/reader.c (check_and_convert_grammar): Fix for-loop.
3969 * src/state.c (state_mark_reachable_states): Fix for-loop.
3970 (state_remove_unreachable_states): Fix for-loop.
3971
3972 Don't widen struct state with member reachable just to temporarily
3973 record reachability. Instead, use a local bitset.
3974 * src/state.h (struct state): Remove member.
3975 * src/state.c (state_new): Don't initialize it.
3976 (state_mark_reachable_states): Rename to...
3977 (state_record_reachable_states): ... this, and use bitset.
3978 (state_remove_unreachable_states): Use bitset.
3979
3980 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
3981
3982 * src/Makefile.am (yacc): Quote target action commands properly so
3983 that the yacc script isn't corrupt. Reported by Hans Aberg at
3984 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
3985
3986 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
3987 the case of pure parsers. Reported by Frans Englich at
3988 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
3989 * THANKS: Add Frans Englich.
3990
3991 * NEWS (2.3a+): In the %code entry, reference section `Bison
3992 Declaration Summary' from the manual now since the %code summary has
3993 moved there.
3994 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3995 in the rules section must be terminated by semicolons.
3996
3997 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3998
3999 Extend the front-end API for %define variables to more completely
4000 mirror the back-end. This will be useful in the future.
4001 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4002 Update comments to mention the new front-end counterparts of these
4003 macros.
4004 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4005 for muscle_string_decode and muscle_location_decode.
4006 (muscle_string_decode): New static function.
4007 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4008 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4009 functions.
4010 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4011 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4012 implementation more closely.
4013 (muscle_percent_define_invalid_value): New function.
4014 * src/muscle_tab.h (muscle_percent_define_get,
4015 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4016 Prototype.
4017
4018 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4019
4020 * NEWS (2.3a+): Mention yesterday's state-removal change.
4021 (2.3a): Remove the %language entry, which was added after 2.3a.
4022 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4023 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4024 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4025 tests/existing.at: Update copyright date.
4026
4027 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4028
4029 If conflict resolution makes states unreachable, remove those states,
4030 report rules that are then unused, and don't report conflicts in those
4031 states.
4032 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4033 New global function.
4034 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4035 function.
4036 * src/main.c (main): After conflict resolution, remove the unreachable
4037 states and update all data structures that reference states by number.
4038 * src/state.c (state_new): Initialize each state's reachable member to
4039 false.
4040 (state_mark_reachable_states): New static function.
4041 (state_remove_unreachable_states): New global function.
4042 * src/state.h (struct state): Add member bool reachable.
4043 (state_remove_unreachable_states): Prototype.
4044 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4045 New test case.
4046 * tests/existing.at (GNU pic Grammar): Update test case output now that
4047 an unused rule is discovered.
4048
4049 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4050
4051 Minor code cleanup in parser table construction.
4052 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4053 (new_itemsets, save_reductions): Update for rename to nitemset.
4054 * src/closure.c (nritemset): Rename to...
4055 (nitemset): ... this since the "r" appears to meaningless and isn't
4056 used in the comments.
4057 (closure): Update for rename.
4058 * src/closure.h (nritemset): Update extern to...
4059 (nitemset): ... this.
4060 * src/lalr.c (LA): Fix a typo in comments.
4061 * src/print.c (print_core): Update for rename to nitemset.
4062 * src/print_graph.c (print_graph): Likewise.
4063 * src/state.h: Fix some typos in header comments.
4064
4065 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4066
4067 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4068 still sticks to ASCII. Sorry!
4069
4070 * README-hacking: New file, taken mostly from coreutils, with changes
4071 for Bison. Contains much of the contents of:
4072 * README-cvs: Remove.
4073 * bootstrap: Sync from gnulib.
4074 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4075 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4076
4077 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4078
4079 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4080 Setzer.
4081 (Java Differences): Fix some typos.
4082 * THANKS: Add Sebastian Setzer.
4083
4084 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
4085
4086 * data/java.m4 (b4_single_class_if): Remove.
4087 (b4_abstract_if): Look at "%define abstract".
4088 (b4_lexer_if): New.
4089 (b4_union_name): Rename...
4090 (b4_yystype): ... to this. Map to "%define stype".
4091 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4092 b4_maybe_throws): Fix quoting.
4093 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4094 * data/lalr1.java (Lexer interface): Always define.
4095 (Lexer interface within parser class): Remove.
4096 (YYLexer class): New, used when "%code lexer" is present.
4097 (constructor): When "%code lexer" is used, pass %lex-param
4098 to the lexer constructor.
4099 (yylex, yyparse): Remove %lex-param from method invocations
4100 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4101
4102 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4103 abstract". Rename "%define union_name" to "%define stype".
4104 Rename method names according to previous patch.
4105 (Java Scanner Interface): Describe "%code lexer" instead of
4106 "%pure-parser" and "%define single_class".
4107 (Java Differences): Mention "%code lexer".
4108
4109 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4110 Include scanner here, using macros from tests/local.at.
4111 (AT_DATA_CALC_Y): Remove final argument.
4112 (_AT_CHECK_JAVA_CALC): Likewise.
4113 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4114 of %locations and %error-verbose.
4115 (main): Test with and without %lex-param.
4116 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4117 (AT_BISON_OPTION_POPDEFS): Pop it.
4118
4119 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4120
4121 DJGPP spefic issue. Inhibit the use of disallowed characters for
4122 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4123 and concern testsuite case 46.
4124 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4125 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4126 * djgpp/config.bat: Inhibit the use of disallowed characters.
4127
4128 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4129
4130 Miscellaneous %define and %code cleanup.
4131 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4132 values are interpreted.
4133 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4134 documentation a little more.
4135 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4136 muscle_percent_define_insert, muscle_percent_code_grow): New
4137 functions/macros.
4138 * src/muscle_tab.h (muscle_percent_define_insert,
4139 muscle_percent_code_grow): Prototype.
4140 * src/parse-gram.y (prologue_declaration): Use
4141 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4142 %define and %code directives.
4143
4144 Make it easy to share %define boolean variables between the front-end
4145 and back-end. Though not used yet, this will be useful in the future.
4146 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
4147 Bison uses of names rather than just skeleton uses of names.
4148 (b4_percent_define_get, b4_percent_define_ifdef): Rename
4149 b4_percent_define_skeleton_variables(VARIABLE) to
4150 b4_percent_define_bison_variables(VARIABLE).
4151 (b4_percent_code_get, b4_percent_code_ifdef): Rename
4152 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
4153 b4_percent_code_bison_qualifiers(QUALIFIER).
4154 (b4_check_user_names_wrap): Update for renames.
4155 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
4156 muscle_percent_define_default): New functions mimicking
4157 b4_percent_define_flag_if and b4_percent_define_default.
4158
4159 For %define variables, report locations for invalid values and
4160 redefinitions.
4161 * data/bison.m4 (b4_percent_define_flag_if): Read
4162 b4_percent_define_loc(VARIABLE) to report the location of an invalid
4163 value for VARIABLE.
4164 (b4_percent_define_default): Save a special location in
4165 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
4166 must later be reported as invalid.
4167 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
4168 functions.
4169 (muscle_percent_define_insert): Record the location of VARIABLE in
4170 muscle percent_define_loc(VARIABLE), and use it to report the previous
4171 location for a redefinition.
4172 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
4173 (muscle_percent_define_default): Update like b4_percent_define_default.
4174 (muscle_grow_user_name_list): Rename to...
4175 (muscle_user_name_list_grow): ... this for consistency and use
4176 muscle_location_grow.
4177 * src/muscle_tab.h (muscle_location_grow): Prototype.
4178 * tests/input.at (%define errors): Update expected output.
4179 * tests/skeletons.at (%define boolean variables: invalid skeleton
4180 defaults): New test case.
4181
4182 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
4183
4184 * src/print.c (lookahead_set, state_default_rule): Remove.
4185 (print_reductions): Replace state_default_rule invocation with
4186 equivalent use of yydefact, which was computed in token_actions in
4187 tables.c.
4188 (print_results): Don't allocate lookahead_set.
4189
4190 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
4191
4192 * data/lalr1.java: Prefix all private members with yy.
4193
4194 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
4195
4196 Use YYFPRINTF instead of fprintf where appropriate. Reported by
4197 Sebastien Fricker at
4198 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
4199 * THANKS: Add Sebastien Fricker.
4200 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
4201 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
4202 accept a variable number of arguments.
4203
4204 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4205
4206 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
4207
4208 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4209
4210 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
4211 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
4212 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
4213
4214 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
4215
4216 Undo my 2007-02-07 change, switching back to the c-strcase module
4217 introduced in the 2007-02-03 change. Bruno Haible reported that
4218 the 2007-02-07 change would be dangerous in Turkish if we add a
4219 language whose name contains "i", since "i" is not lowercase "I"
4220 in Turkish.
4221 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
4222 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
4223 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
4224 * m4/.cvsignore: Remove strcase.m4.
4225 * src/getargs.c: Revert 2007-02-07 change, as follows.
4226 Include c-strcase.h.
4227 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
4228
4229 2007-02-11 Bruno Haible <bruno@clisp.org>
4230
4231 Enable the Java related testsuite tests when the only Java compiler
4232 found is a gcj < 4.3. Discussed at
4233 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
4234 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
4235
4236 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
4237
4238 * data/Makefile.am: Update copyright date.
4239 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
4240 yypstate_new returns NULL.
4241 (yypstate_new): Return NULL if malloc does.
4242 * src/reader.c (packgram): Move translation of rule actions from the
4243 beginning of packgram to...
4244 (check_and_convert_grammar): ... here right before packgram is invoked
4245 so it's easier to write more complete comments, and remove redundant
4246 code.
4247
4248 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
4249
4250 As in semantic actions, make @$ in %initial-action, %destructor, and
4251 %printer imply %locations.
4252 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
4253 scanning @$.
4254 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
4255 (@$ in %initial-action implies %locations,
4256 @$ in %destructor implies %locations,
4257 @$ in %printer implies %locations): ... these new test cases.
4258
4259 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
4260
4261 Undo most of the 2007-02-03 change, switching to the strcase module
4262 now that gnulib strcase has been fixed.
4263 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
4264 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
4265 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
4266 * m4/.cvsignore: Add strcase.m4.
4267 * src/getargs.c: Revert 2007-02-03 change, as follows.
4268 Don't include c-strcase.h.
4269 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
4270 strcasecmp has "unspecified behavior" outside the POSIX locale,
4271 but it works fine in practice if at least one argument is ASCII,
4272 as is the case in Bison.
4273
4274 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
4275
4276 * tests/java.at: Skip tests if only one of javac/java is present.
4277 Reported by Joel E. Denny.
4278 * tests/atlocal.in: Adjust copyright years.
4279
4280 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
4281
4282 * data/lalr1.java (Stack): Work around old verifiers that disallow
4283 access to the private fields of an inner class, from the outer class.
4284 We can make Stack's fields public because user code doesn't have access
4285 to the instance of Stack used by parse(). Reported by Paul Eggert.
4286
4287 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
4288
4289 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
4290 the right spot for these files?
4291 * bootstrap.conf (gnulib_modules): Add c-strcase.
4292 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
4293 c-strncasecmp.c.
4294 * src/getargs.c: Include c-strcase.h.
4295 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
4296 to avoid unspecified behavior.
4297
4298 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
4299
4300 * doc/bison.texinfo (Decl Summary): Correct typo.
4301
4302 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
4303
4304 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
4305 Complain if the value does not match empty, "true" or "false".
4306 * data/c++.m4: Adjust default definitions of %define variables.
4307 * data/java.m4: Adjust default definitions of %define variables.
4308 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
4309 to above behavior.
4310 * tests/input.at (Boolean %define variables): Test new behavior.
4311
4312 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
4313
4314 * NEWS: Mention java.
4315 * TODO: Remove things that are done.
4316 * bootstrap.conf: Add javacomp-script and javaexec-script.
4317 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
4318
4319 * data/Makefile.am: Add new files.
4320 * data/java-skel.m4: New.
4321 * data/java.m4: New.
4322 * data/lalr1.java: New.
4323
4324 * doc/bison.texinfo: Put "A Complete C++ Example" under
4325 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
4326 under Other Languages.
4327
4328 * src/getargs.c (valid_languages): Add Java.
4329 * src/getargs.h (struct bison_language): Update size of string fields.
4330
4331 * tests/Makefile.am: Add java.at.
4332 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
4333 * tests/java.at: New.
4334 * tests/testsuite.at: Include it.
4335
4336 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
4337
4338 Clean up.
4339 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
4340 at_directive_argv arguments so these no longer have to be global
4341 variables. Also, update the implementation for the following changes.
4342 (fail_for_at_directive_too_many_args,
4343 fail_for_at_directive_too_few_args): Add at_directive_name argument.
4344 (at_directive_name): Remove as at_directive_argv[0] will be used for
4345 this now.
4346 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
4347 for the directive name.
4348 (at_directive_argc, at_directive_argv): Make these local within
4349 skel_lex instead of global.
4350 (INITIAL): Update directive start action for above changes.
4351 (SC_AT_DIRECTIVE_ARG): Rename to...
4352 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
4353 (SC_AT_DIRECTIVE_SKIP_WS): Update.
4354 (scan_skel): Move yylex_destroy to...
4355 (skel_scanner_free): ... here.
4356 * tests/skeletons.at (installed skeleton file name): Rename to...
4357 (installed skeleton file names): ... this.
4358
4359 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
4360
4361 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4362 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
4363 Summary" not "Directives".
4364 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
4365 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
4366 since the former is now the more complete one.
4367 (Prologue Alternatives): Likewise and do the same for %defines.
4368 (Table of Symbols): Add summary of %code, add summary of %define, and
4369 move full %code documentation to...
4370 (Decl Summary): ... here for consistency with other entries in these
4371 sections.
4372 Move %define entry in order to keep this list alphabetized.
4373 Reword %define entry a little to put less emphasis on the skeleton
4374 concept, which most users shouldn't have to think about.
4375
4376 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
4377
4378 Adjust to recent gnulib changes.
4379 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
4380 Add string.h, string_.h, unistd_.h, wchar_.h.
4381 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
4382 * src/system.h: Don't include <stpcpy.h>; this is now done by
4383 <string.h>.
4384
4385 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
4386
4387 Simplify implementation of unqualified %code, implement macros for
4388 uniform treatment of boolean %define flags. Document %define.
4389 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
4390 b4_percent_code_ifdef): New.
4391 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
4392 * data/c++.m4: Define default value for global_tokens_and_yystype.
4393 * data/glr.cc: Likewise.
4394 * data/location.cc: Use b4_percent_define_flag_if.
4395
4396 * doc/bison.texinfo (Decl Summary): Document %define.
4397
4398 * src/parse-gram.y (Unqualified %code): Change muscle name to
4399 b4_percent_code().
4400 (content.opt): Default to empty.
4401
4402 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4403
4404 Implement support for relative and absolute skeleton file names.
4405 Discussed starting at
4406 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
4407 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
4408 (Bison Options): Document in --skeleton entry.
4409 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
4410 full_skeleton can't necessarily hold all of pkgdatadir.
4411 If the specified skeleton file name contains a `/', don't prepend
4412 pkgdatadir.
4413 * src/parse-gram.y (prologue_declaration): If the specified skeleton
4414 file name contains a `/', prepend the grammar file directory.
4415 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
4416 * skeletons.at: New file.
4417 (relative skeleton file names): New test case.
4418 (installed skeleton file names): New test case.
4419 * tests/testsuite.at: Include skeletons.at.
4420
4421 * bootstrap: Update copyright to 2007.
4422
4423 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
4424
4425 * bootstrap: Remove occurrences of .#bootmp from the files.
4426
4427 2007-01-17 Akim Demaille <akim@epita.fr>
4428
4429 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
4430 nonterminals.
4431 Use per-type %printer.
4432
4433 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4434
4435 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
4436 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4437 djgpp/config.site, src/files.c, src/files.h, src/main.c,
4438 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
4439 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
4440 tests/glr-regression.at, tests/input.at, tests/local.at,
4441 tests/output.at, tests/torture.at: Update copyright to 2007.
4442
4443 2007-01-16 Akim Demaille <akim@epita.fr>
4444
4445 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
4446 error code.
4447 (Calc++ Scanner): Exit with failure if we can't open the input
4448 file.
4449 Accept "-" standing for stdin.
4450 (Calc++ Top Level): Print the result only if the parsing was
4451 successful.
4452
4453 2007-01-16 Akim Demaille <akim@epita.fr>
4454
4455 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
4456
4457 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
4458 and Joel E. Denny <jdenny@ces.clemson.edu>
4459
4460 Clean up %define and %code implementation in M4 some. Most
4461 importantly, rename all related macros to be in the b4_percent_define
4462 and b4_percent_code namespaces. Also, complete support for `.' in
4463 %define variable names and %code qualifiers.
4464 * data/bison.m4 (b4_check_user_names): Check for special
4465 "SKELETON-NAMESPACE(name)" macros instead of using two nested
4466 m4_foreach loops.
4467 (b4_get_percent_define, b4_get_percent_code): Rename to...
4468 (b4_percent_define_get, b4_percent_code_get): ... these.
4469 Extend documentation with examples.
4470 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
4471 b4_percent_define_skeleton_variables and
4472 b4_percent_code_skeleton_qualifiers.
4473 Expect any value for the %define variable `foo' to be stored in the
4474 macro named `b4_percent_define(foo)'; expect any %code blocks for the
4475 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
4476 expect any unqualified %code blocks to be stored in a macro named
4477 `b4_percent_code_unqualified'.
4478 Use m4_indir so that %define variable names and %code qualifiers can
4479 contain `.', which is allowed by the grammar parser.
4480 (b4_percent_define_default): New macro to set a default value for a
4481 %define variable.
4482 (m4_wrap): Update wrapped code, and fix some underquoting.
4483 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
4484 Expect grammar uses of %define variables and %code qualifiers to be
4485 defined in b4_percent_define_user_variables and
4486 b4_percent_code_user_qualifiers.
4487 * data/c++.m4: Use b4_percent_define_default rather than
4488 m4_define_default. Fix some underquoting. Skeleton usage of %define
4489 variable define_location_comparison now implies skeleton usage of
4490 %define variable filename_type.
4491 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4492 data/push.c, data/yacc.c: Update macro names.
4493 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
4494 muscle names.
4495
4496 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4497
4498 DJGPP specific issues.
4499
4500 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
4501 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
4502
4503 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4504
4505 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
4506 run parsers in all tests so that Valgrind is invoked during
4507 maintainer-check-valgrind.
4508 (Duplicate representation of merged trees): Free all semantic values.
4509 (Duplicated user destructor for lookahead): Likewise.
4510
4511 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4512
4513 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
4514 command-line prefix.
4515 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
4516 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
4517 miss Valgrind messages.
4518 (Exploding the Stack Size with Malloc): Likewise.
4519
4520 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4521
4522 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
4523 locals. Reported by Juan Manuel Guerrero at
4524 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
4525 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
4526 Fix some indentation also.
4527 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
4528 explaining this issue.
4529
4530 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
4531 and Joel E. Denny <jdenny@ces.clemson.edu>
4532
4533 Simplify union and prologue handling, and escape union and lex/parse
4534 params with digraphs.
4535 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
4536 values to the empty string since these are no longer guaranteed
4537 initialized by the front-end.
4538 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
4539 braces around b4_user_stype since this is no longer done by the
4540 front-end.
4541 * src/files.c, src/files.h (pre_prologue_obstack,
4542 post_prologue_obstack): Remove.
4543 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
4544 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
4545 with digraphs. This fixes lex params and parse params.
4546 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
4547 * src/output.c (prepare): Remove muscle insertion of the prologues.
4548 (output): Remove freeing of pre_prologue_obstack and
4549 post_prologue_obstack.
4550 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
4551 than prologue_augment for prologue parsing so you don't need prologue
4552 obstacks.
4553 (grammar_declaration): For %union RHS, use `braceless' instead of
4554 "{...}" so that braces are already stripped and code is escaped with
4555 digraphs.
4556 * src/reader.c (prologue_augment): Remove.
4557 (reader): Remove initialization of pre_prologue_obstack and
4558 post_prologue_obstack.
4559 * src/reader.h (prologue_augment): Remove.
4560
4561 * data/c.m4: Remove stray parenthesis.
4562
4563 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4564
4565 Remove quotes from variables names in %define directives and from
4566 qualifiers in %code directives, and restrict the characters that are
4567 allowed in them to M4-friendly ones. For %define, continue to support
4568 the quoted form as a deprecated feature. Discussed starting at
4569 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
4570 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
4571 %code.
4572 * doc/bison.texinfo (Prologue Alternatives): Update.
4573 (Decl Summary): In %defines entry, update mention of `%code requires'
4574 and `%code provides'.
4575 (C++ Location Values): Update %define uses.
4576 (Calc++ Parser Interface): Likewise.
4577 (Calc++ Parser): Likewise, and update `%code requires' uses.
4578 (Table of Symbols): Update %code documentation.
4579 * src/parse-gram.y (prologue_declaration): For %define variables, use
4580 `variable' instead of `STRING'.
4581 (grammar_declaration): For %code qualifiers, use `ID' instead of
4582 `STRING'.
4583 (variable): New nonterminal that takes an `ID' or a `STRING'.
4584 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
4585 and %define uses.
4586 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
4587 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
4588 (%define errors): Update %define uses.
4589
4590 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4591
4592 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
4593 instead of muscle_insert for %define values so that M4-special
4594 characters are replaced with digraphs.
4595 * tests/input.at (%define errors): Extend to check weird values.
4596
4597 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4598
4599 Instead of having skeletons declare all valid %define variables and
4600 %code qualifiers, provide macros that retrieve the associated values
4601 and build these lists automatically. Thus Bison will now warn when a
4602 variable or qualifier is not used by the skeleton in the current
4603 invocation regardless of whether it might sometimes be used by that
4604 skeleton in other invocations. Also, move all %define value macros to
4605 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
4606 form, which is replaced by %code.
4607 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
4608 (b4_check_user_names): ... this, and change the series of valid name
4609 arguments to a single list argument for names used in the skeleton
4610 similar to the existing list argument for names used in the grammar.
4611 Warn instead of complaining.
4612 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
4613 values and %code code, to format %code code properly, and to build
4614 lists of all %define variables and %code qualifiers used in the
4615 skeleton: b4_skeleton_percent_define_variables and
4616 b4_skeleton_percent_code_qualifiers.
4617 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
4618 Remove, and...
4619 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
4620 the skeleton names lists can finish building first. In place of
4621 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
4622 expect the lists b4_user_percent_define_variables and
4623 b4_user_percent_code_qualifiers.
4624 * data/c++.m4: Where setting default values for b4_parser_class_name,
4625 b4_location_type, b4_filename_type, b4_namespace, and
4626 b4_define_location_comparison, update their names to the
4627 b4_percent_define_ namespace.
4628 * data/glr.c: Don't use b4_check_percent_define_variables and
4629 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4630 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
4631 (b4_parser_class_name, b4_namespace): Define these using
4632 b4_get_percent_define for parser_class_name and namespace.
4633 * data/location.cc: Use b4_get_percent_define.
4634 * data/push.c: Don't use b4_check_percent_define_variables and
4635 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4636 * data/yacc.c: Likewise, and don't call m4_exit in
4637 b4_use_push_for_pull_if or m4_wrap code will never execute.
4638 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
4639 Rename to...
4640 (muscle_grow_user_name_list): ... this for consistency with the
4641 terminology used in bison.m4.
4642 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
4643 %define variable names, and rename muscle used_percent_define_variables
4644 to user_percent_define_variables.
4645 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
4646 user_percent_code_qualifiers.
4647 (content): Remove.
4648 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
4649 {CODE} form is no longer accepted.
4650 * tests/input.at (Reject bad %code qualifiers): Rename to...
4651 (Reject unused %code qualifiers): ... this, and update test output.
4652 (%define error): Update test output.
4653
4654 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
4655
4656 Check for unrecognized %define variables similar to checking for
4657 unrecognized %code qualifiers. Check for redefined %define variables.
4658 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
4659 generalizes...
4660 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
4661 (b4_check_percent_define_variables): New, also wraps it.
4662 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
4663 variables using b4_check_percent_define_variables.
4664 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
4665 all those exercised in the test suite and all those listed in the
4666 `Default values' section of c++.m4. Are there others?
4667 * data/push.c, data/yacc.c: Declare no valid %define variables.
4668 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
4669 similar to muscle_find, but it works even when the muscle stores a
4670 const value.
4671 (muscle_grow_used_name_list): New function for constructing the used
4672 name list muscles that b4_check_for_unrecognized_names requires.
4673 * src/parse-gram.y (prologue_declaration): Warn if a variable is
4674 %define'd more than once. Define the b4_used_percent_define_variables
4675 muscle with muscle_grow_used_name_list.
4676 (grammar_declaration): Abbreviate %code code with
4677 muscle_grow_used_name_list.
4678 * tests/input.at (%define errors): New.
4679
4680 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4681
4682 Provide warn_at, complain_at, and fatal_at function callbacks to the
4683 skeletons, and use this for %code qualifier complaints.
4684 * data/bison.m4 (b4_error_at): New, invoked by...
4685 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
4686 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
4687 @fatal_at(...@) directives.
4688 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
4689 qualifiers in b4_used_percent_code_qualifiers and to use
4690 b4_complain_at.
4691 * src/location.c, src/location.h (boundary_set_from_string): New global
4692 function.
4693 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
4694 function.
4695 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
4696 to b4_used_percent_code_qualifiers.
4697 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
4698 function.
4699 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
4700 (lineno): Rename to...
4701 (out_lineno): ... this so I don't misunderstand it again.
4702 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
4703 here; these newlines are in the input but not the output file.
4704 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
4705 (at_directive_perform): ... this new static function, and add handling
4706 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
4707 directives.
4708 * tests/input.at (Reject bad %code qualifiers): Update test output with
4709 locations and extend.
4710
4711 * tests/output.at (Output file name: [, Output file name: ]): Remove
4712 bogus comment about these tests failing.
4713
4714 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4715
4716 Clean up b4_check_percent_code_qualifiers a little.
4717 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
4718 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
4719 documentation and add examples.
4720 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
4721 qualifiers here.
4722
4723 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4724
4725 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
4726 unreliable -- especially when they're hidden inside another macro.
4727 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
4728 data/c.m4: Remove m4_divert(-1).
4729 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4730 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
4731 m4_divert_push(0) and m4_divert_pop(0).
4732 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
4733 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
4734 pushed and popped by m4sugar, should be first on the stack.
4735
4736 Provide warn, complain, and fatal function callbacks to the skeletons.
4737 This provides more flexibility than m4_fatal, improves the error
4738 message format, and captures messages for translation. Discussed
4739 starting at
4740 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
4741 * data/bison.m4 (b4_error): New, invoked by...
4742 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
4743 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
4744 directives. Because these M4 macros might be called when the current
4745 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
4746 the previous removal of uses of m4_divert, which caused trouble.
4747 (b4_check_percent_code_qualifiers): Use b4_complain instead of
4748 m4_fatal to report unrecognized %code qualifiers.
4749 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
4750 push parser requests.
4751 * data/glr.c: Use b4_complain instead of m4_fatal to report
4752 non-deterministic push parser requests.
4753 Update @output usage to @output(...@) form.
4754 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
4755 report missing %defines. Update @output usage to @output(...@) form.
4756 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
4757 @output(...@) form.
4758 * src/main.c (main): Invoke skel_scanner_free.
4759 * src/scan-skel.h (skel_scanner_free): Prototype new function.
4760 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
4761 obstack_for_string from flex-scanner.h.
4762 (YY_DECL): Use to declare skel_lex static.
4763 (decode_at_digraphs): Remove; now handled in the new
4764 SC_AT_DIRECTIVE_ARG start condition.
4765 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
4766 functions.
4767 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
4768 at_directive_argv): New static globals.
4769 (INITIAL): Use fail_for_invalid_at.
4770 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
4771 recognize the start of a generalized `@directive(...@)' form and
4772 start...
4773 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
4774 directive args (using the new obstack_for_string), to decode the
4775 contained @ diagraphs, and to perform the directive. It recognizes
4776 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
4777 @output(...@).
4778 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
4779 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
4780 `@,'.
4781 (scan_skel): Initialize obstack_for_string on the first call.
4782 (skel_scanner_free): New function to free obstack_for_string.
4783 * tests/input.at (Reject bad %code qualifiers): Update test output.
4784
4785 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
4786
4787 Consolidate the 4 prologue alternative directives (%code, %requires,
4788 %provides, and %code-top) into a single %code directive with an
4789 optional qualifier field. Discussed at
4790 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
4791 * NEWS (2.3a+): Rewrite the existing entry for the prologue
4792 alternatives.
4793 * doc/bison.texinfo (Prologue Alternatives): Update.
4794 (Decl Summary): Update to %code "requires" and %code "provides".
4795 (Calc++ Parser): Update to %code "requires".
4796 (Table of Symbols): Remove entries for %requires, %provides, and
4797 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
4798 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
4799 are replaced by b4_percent_code_provides and b4_percent_code_requires,
4800 which are skeleton-specific.
4801 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
4802 declare what %code qualifiers it supports and to complain if any other
4803 qualifiers were used in the grammar.
4804 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
4805 and b4_user_code([b4_percent_code_provides]) in place of
4806 b4_user_requires and b4_user_provides.
4807 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
4808 Add b4_user_code([b4_percent_code_top]) and
4809 b4_user_code([b4_percent_code]).
4810 Invoke b4_check_percent_code_qualifiers.
4811 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4812 PERCENT_REQUIRES): Remove.
4813 (grammar_declaration): Remove RHS's for %code-top, %provides, and
4814 %requires. Rewrite the %code RHS as the unqualified form defining the
4815 muscle b4_percent_code. Add another RHS for the qualified %code form,
4816 which defines muscles of the form b4_percent_code_QUALIFIER and the
4817 b4_used_percent_code_qualifiers muscle.
4818 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4819 PERCENT_REQUIRES): Remove.
4820 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
4821 %code "requires" and %code "provides".
4822 * tests/input.at (Reject bad %code qualifiers): New.
4823
4824 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4825
4826 Use the new code_props interface for destructors and printers.
4827 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
4828 printer_location members, and change the type of the destructor and
4829 printer members to code_props.
4830 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
4831 symbol_printer_get, semantic_type_destructor_set,
4832 semantic_type_printer_set, default_tagged_destructor_set,
4833 default_tagless_destructor_set, default_tagged_printer_set,
4834 default_tagless_printer_set): Use code_props in arguments and return
4835 types in place of char const * and location.
4836 (symbol_destructor_location_get, symbol_printer_location_get): Remove
4837 since the locations are now contained in the return of
4838 symbol_destructor_get and symbol_printer_get.
4839 * src/output.c (symbol_destructors_output, symbol_printers_output):
4840 Replace with...
4841 (symbol_code_props_output): ... this to eliminate duplicate code.
4842 (output_skeleton): Update to use symbol_code_props_output.
4843 * src/reader.c (symbol_should_be_used): Update use of
4844 symbol_destructor_get.
4845 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4846 Update uses of the various _destructor_set and _printer_set functions.
4847 * src/symtab.c: (default_tagged_destructor_location,
4848 default_tagless_destructor_location, default_tagged_printer_location,
4849 default_tagless_printer_location): Remove since we...
4850 (default_tagged_destructor, default_tagless_destructor,
4851 default_tagged_printer, default_tagless_printer): ... change the type
4852 of these to code_props.
4853 (symbol_new, semantic_type_new, symbol_destructor_set,
4854 semantic_type_destructor_set, symbol_destructor_get,
4855 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
4856 symbol_check_alias_consistency, default_tagged_destructor_set,
4857 default_tagless_destructor_set, default_tagged_printer_set,
4858 default_tagless_printer_set): Update.
4859 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
4860 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
4861 code_props members.
4862 (symbol_print): Use SYMBOL_CODE_PRINT.
4863
4864 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4865
4866 Use the new code_props interface for rule actions.
4867 * src/symlist.h (symbol_list): Replace action, action_location, and
4868 used members with a code_props action_props member.
4869 * src/reader.c (symbol_should_be_used, grammar_rule_check,
4870 grammar_midrule_action, grammar_current_rule_merge_set,
4871 grammar_current_rule_symbol_append, packgram): Update.
4872 * src/scan-code.h (translate_rule_action): Remove, no longer used.
4873 * src/scan-code.l (handle_action_dollar): Update.
4874 (translate_rule_action): Remove, no longer used.
4875 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
4876
4877 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4878
4879 Use the new code_props interface in parse-gram.y.
4880 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
4881 Update all uses of translate_* functions to use the new code_props
4882 interface and to use gram_scanner_last_string_free and
4883 code_scanner_last_string_free where possible.
4884 (grammar_declaration): symbol_list_destructor_set and
4885 symbol_list_printer_set now perform the translation, so don't do it
4886 here. Use gram_scanner_last_string_free where possible.
4887 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
4888 translate_code): Remove, no longer used.
4889 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
4890 symbol_list_printer_set): Perform code translation here rather than
4891 depending on the caller to do so.
4892
4893 * src/symlist.h (struct symbol_list): Correct some documentation typos.
4894 * src/scan-gram.h (gram_last_string): Remove declaration.
4895 * src/scan-gram.l (last_string): Declare it static.
4896
4897 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4898
4899 Encapsulate code properties and related functionality for the various
4900 destructors, printers, and actions into a code_props structure and
4901 interface. This patch merely implements code_props in scan-code.h and
4902 scan-code.l. Future patches will rewrite other modules to use it.
4903 Discussed starting at
4904 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
4905 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
4906 consistently initialize const structs that have an empty location
4907 field.
4908 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
4909 to ensure consistency.
4910 * src/scan-code.h (code_props): New structure.
4911 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
4912 function, macro, and const global variable for initializing a
4913 code_props with no code.
4914 (code_props_plain_init, code_props_symbol_action_init,
4915 code_props_rule_action_init, code_props_translate_code): The rest of
4916 the new code_props functional interface. Among other things, the init
4917 functions set the code_props kind field so that
4918 code_props_translate_code will know whether to behave like
4919 translate_symbol_action, translate_rule_action, or translate_code.
4920 These old translate functions must remain until all other modules are
4921 updated to use the new code_props interface.
4922 (code_scanner_last_string_free): New function similar to
4923 gram_scanner_last_string_free.
4924 (code_scanner_free): Add documentation.
4925 * src/scan-code.l: Implement the new interface.
4926 (code_lex): Make it static, add a code_props* argument, and remove the
4927 rule argument.
4928 (last_string): New static global similar to the one in scan-gram.l.
4929 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
4930 instead of rule.
4931 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
4932 code_props since Bison may one day use this information for destructors
4933 and printers.
4934 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
4935 (handle_action_dollar): Use symbol_list_n_get and set used flag
4936 directly since symbol_list_n_used_set is removed.
4937 (translate_action): Add a code_props* argument and remove the rule,
4938 action, and location arguments. Pass the code_props* on to code_lex.
4939 (translate_rule_action, translate_symbol_action, translate_code):
4940 Rewrite as wrappers around the new code_props interface.
4941 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
4942 it would eventually need to break the encapsulation of code_props.
4943
4944 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4945
4946 * etc/.cvsignore: New.
4947
4948 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4949
4950 Add maintainer-push-check to run maintainer-check using push parsing in
4951 place of pull parsing where available.
4952 * Makefile.am (maintainer-push-check): New.
4953 * data/bison.m4 (b4_use_push_for_pull_if): New.
4954 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
4955 appropriately based on their existing values.
4956 (yypush_parse): Don't print push-parser-specific diagnostics if push
4957 parsing is being used in place of pull parsing.
4958 * data/yacc.c: If push parsing should replace pull parsing, redirect to
4959 push.c.
4960 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
4961 variable, and insert b4_use_push_for_pull_flag into muscles.
4962 * tests/Makefile.am (maintainer-push-check): New.
4963
4964 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4965
4966 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
4967 (whether successful or failed) so that yypush_parse can be invoked
4968 again to start a new parse using the same yypstate.
4969 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
4970 check multiple yypull_parse invocations on the same yypstate. For pull
4971 mode, extend to check multiple yyparse invocations.
4972 (Exploding the Stack Size with Alloca): Extend to try with
4973 %push-pull-parser.
4974 (Exploding the Stack Size with Malloc): Likewise.
4975
4976 * tests/calc.at (Simple LALR Calculator): Don't specify
4977 %skeleton "push.c" since %push-pull-parser implies that now.
4978 * tests/headers.at (export YYLTYPE): Don't check for the push
4979 declarations. Otherwise, this test case can't be used to see if push
4980 mode can truly emulate pull mode.
4981 * tests/input.at (Torturing the Scanner): Likewise.
4982 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
4983 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
4984 AT_YACC_IF, which now includes the case of push mode since %skeleton
4985 need not be used for push mode. This will be more intuitive once
4986 push.c is renamed to yacc.c.
4987
4988 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4989
4990 For push mode, convert yyparse from a macro to a function, invoke yylex
4991 instead of passing a yylexp argument to yypull_parse, and don't
4992 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4993 Discussed starting at
4994 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4995 * data/bison.m4 (b4_pull_if): New.
4996 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4997 * data/push.c: Improve M4 quoting a little.
4998 (b4_generate_macro_args, b4_parenthesize): Remove.
4999 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5000 any time a pull parser is requested.
5001 Don't #define this as a wrapper around yypull_parse. Instead, when
5002 both push and pull are requested, make it a function that does that
5003 same thing.
5004 (yypull_parse): If there's a b4_prefix, #define this to
5005 b4_prefix[pull_parse] when both push and pull are requested.
5006 Don't define this as a function unless both push and pull are
5007 requested.
5008 Remove the yylexp argument and hard-code yylex invocation instead.
5009 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5010 %push-parser.
5011 * src/getargs.c (pull_parser): New global initialized to true.
5012 * getargs.h (pull_parser): extern it.
5013 * src/output.c (prepare): Insert pull_flag muscle.
5014 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5015 (prologue_declaration): Set both push_parser and pull_parser = true for
5016 %push-pull-parser. Set push_parser = true and pull_parser = false for
5017 %push-parser.
5018 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5019 %push-parser since there's no backward-compatibility concern here.
5020 Scan %push-pull-parser.
5021 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5022 instead of %push-parser.
5023 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5024 prototype it in the module that calls yyparse.
5025 * tests/input.at (Torturing the Scanner): Likewise.
5026 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5027
5028 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5029
5030 Update etc/bench.pl. Optimize push mode a little (the yyn change
5031 deserves most of the credit).
5032 * Makefile.am (SUBDIRS): Add etc subdirectory.
5033 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5034 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5035 yytoken, yyval, and yyloc declarations to...
5036 (yyparse or yypush_parse): ... here to improve performance. For
5037 yypush_parse invocations after the first, be sure to assign yyn its old
5038 value again.
5039 (yypstate_new): Don't bother initializing the yyresult field since the
5040 initial value isn't used.
5041 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5042 remove the #define that, in push mode, set it to yyps->NAME.
5043 * etc/Makefile.am: New.
5044 * etc/bench.pl: Remove and build it instead from...
5045 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5046 "tests/bison" from the build directory by default rather than just
5047 invoking "bison" from $PATH.
5048 (calc_grammar): Update push parser code: don't declare yylval globally,
5049 don't define yyparse_wrapper, and don't #define yyparse.
5050 (bench_grammar): Update to check all working combinations of yacc.c,
5051 push.c, impure, pure, pull, and push.
5052
5053 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5054
5055 For push mode, add pull wrappers around yypush_parse.
5056 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5057 (yypull_parse): New function wrapping yypush_parse.
5058 (yyparse): New #define wrapping yypull_parse.
5059 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5060 is declared.
5061 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5062 prototype yylex in the module that calls yyparse, and don't prototype
5063 yyparse there. Otherwise, the yyparse expansion won't compile.
5064 * tests/input.at (Torturing the Scanner): Likewise.
5065
5066 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5067
5068 Enable push parsers to operate in impure mode. Thus, %push-parser no
5069 longer implies %pure-parser. The point of this change is to move
5070 towards being able to test the push parser code by running the entire
5071 test suite as if %push-parser had been declared.
5072 * data/push.c (yypush_parse): For impure mode, remove the
5073 yypushed_char, yypushed_val, and yypushed_loc arguments.
5074 Instead, declare these as local variables initialized to the global
5075 yychar, yylval, and yylloc.
5076 For the first yypush_parse invocation only, restore the initial values
5077 of these global variables when it's time to read a token since they
5078 have been overwritten.
5079 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5080 %push-parser.
5081 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5082 %pure-parser along with %push-parser since this test case was designed
5083 for pure push parsers.
5084 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5085 (AT_YACC_OR_PUSH_IF): New.
5086 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5087 add a note that it's still wrong for some cases (as it has been for a
5088 while).
5089 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5090 %push-parser no longer implies %pure-parser.
5091
5092 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5093
5094 Remove some unnecessary differences between the pull parser code and
5095 the push parser code. This patch enables yynerrs in push mode.
5096 * data/push.c: Reformat M4 a little.
5097 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5098 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5099 because push mode is on. Instead, if pure mode is on, move yynerrs
5100 to...
5101 (b4_declare_parser_state_variables): ... here.
5102 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5103 to yyps->NAME so it can be used in yypush_parse.
5104 (yypush_parse): Don't omit uses of yynerrs in push mode.
5105
5106 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5107
5108 Fix bug such that the first pushed token's value and location are
5109 sometimes overwritten (sometimes by %initial-action) before being used.
5110 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5111 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5112 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5113 more closely mimic the pull parser logic.
5114 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5115 time to read a token, which is after any initialization of yylval and
5116 yylloc.
5117 (gottoken): Rename label to...
5118 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5119 user namespace.
5120
5121 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5122
5123 Rearrange initialization of the parser state variables so that the
5124 skeleton doesn't have to have a copy for pull mode and another for push
5125 mode. This patch also fixes at least a bug such that yylloc was not
5126 initialized (with b4_location_initial_line and
5127 b4_location_initial_column) upon calling yypush_parse. However, that
5128 initialization now overwrites the first token's location;
5129 %initial-action assigning @$ already did the same thing, and both bugs
5130 will be fixed in a later patch.
5131 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5132 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5133 yyss, yyvs, yyls, and yystacksize.
5134 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5135 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5136 yylsp.
5137 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5138 yyps->NAME so it can be used in yypush_parse.
5139 (yyparse or yypush_parse): For yypush_parse, don't print the
5140 "Starting parse" diagnostic for invocations after the first.
5141 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5142 yypush_parse, only do it for the first invocation.
5143 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5144 initialization to occur in yypush_parse but only on the first
5145 invocation.
5146
5147 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5148
5149 * data/push.c: Add CPP guards around push parser declarations in both
5150 the header and the code file.
5151 In the code file, move the push parser declarations to the same place
5152 they appear in the header file.
5153 Clean up the M4 some, especially the inconsistent underquoting in
5154 some b4_c_function_def and b4_c_function_decl uses.
5155
5156 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5157
5158 Encapsulate the push parser state variables into an M4 macro so the
5159 push skeleton doesn't have to list them again for pull mode's yyparse.
5160 For push mode, remove yypush_parse's local equivalents of these
5161 variables to eliminate unnecessary copying between the two sets at
5162 run-time. This patch also fixes at least a bug related to multiple
5163 %initial-action invocations in push mode.
5164 * data/push.c (b4_declare_parser_variables): Rename to...
5165 (b4_declare_scanner_communication_variables): ... this for clarity and
5166 update both uses.
5167 (b4_declare_yyparse_variables): Remove and move its contents to the one
5168 spot where it was invoked.
5169 (b4_declare_parser_state_variables): New macro containing the parser
5170 state variables required by push mode.
5171 (struct yypstate): Replace all fields but yynew with
5172 b4_declare_parser_state_variables.
5173 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
5174 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
5175 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
5176 (yyparse or yypush_parse): For yyparse in pull mode, replace local
5177 parser state variable declarations with
5178 b4_declare_parser_state_variables.
5179 Don't initialize parser state variables when calling yypush_parse since
5180 yypstate_new already does that.
5181 Invoke the user's initial action only upon the first yypush_parse
5182 invocation.
5183 Remove all code that copies between the local parser state variables
5184 and the yypstate.
5185
5186 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5187
5188 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
5189 prevent a name collision in a future patch where these names will
5190 sometimes be #define'd.
5191 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
5192 since it no longer has the same name as the existing argument.
5193 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
5194
5195 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
5196 and Joel E. Denny <jdenny@ces.clemson.edu>
5197
5198 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5199 that the argument is case-insensitive, and there's no `=' here.
5200 For the %skeleton entry, mention that %language is better.
5201 (Bison Options): Likewise for --language and --skeleton. Move the
5202 --skeleton entry so that the `Tuning the parser' section is sorted
5203 alphabetically on long options.
5204 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
5205 %language directive in detail here; cross-reference the %language
5206 documentation instead.
5207 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
5208 `%require "2.3b"' so that the example is always up-to-date.
5209 (Table of Symbols): Add entries for %language and %skeleton.
5210 * examples/extexi (normalize): Instead of replacing every %require
5211 argument with the current Bison version, just substitute for
5212 `@value{VERSION}'. This guarantees that we're testing what actually
5213 appears in the documentation.
5214 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
5215 rather than `@VERSION@'.
5216
5217 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5218
5219 * NEWS: Reword the %language news a bit, and put it earlier.
5220
5221 * src/getargs.c (skeleton_arg): Last arg is now location const *.
5222 Rewrite to simplify the logic.
5223 (language_argmatch): Likewise.
5224 (program_name): We now own this var.
5225 * src/getargs.h (struct bison_language): Use char[] rather than
5226 const char *.
5227
5228 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
5229 Java is supported.
5230 * src/complain.c (program_name): Remove decl; no longer needed.
5231 * src/main.c (program_name): Remove; now belongs to getargs.
5232
5233 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
5234
5235 * NEWS: Document %language.
5236
5237 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
5238
5239 * data/c-skel.m4, data/c++-skel.m4: New files.
5240 * data/glr.c: Complain on push parsers.
5241
5242 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
5243 over %skeleton.
5244 (Decl Summary): Document %language and %skeleton.
5245 (Command line): Document -L.
5246
5247 * examples/extexi: Rewrite %require directive.
5248 * examples/calc++/Makefile.am: Pass VERSION to extexi.
5249
5250 * src/files.c (compute_exts_from_gc): Look in language structure
5251 for .y extension.
5252 (compute_file_name_parts): Check whether .tab should be added.
5253 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
5254 (language, skeleton_arg, language_argmatch): New.
5255 (long_options): Add --language.
5256 (getargs): Use skeleton_arg, add -L/--language.
5257 * src/getargs.h: Include location.h.
5258 (struct bison_language, language, skeleton_arg, language_argmatch): New.
5259 * src/output.c (prepare): Pick default skeleton from struct language.
5260 Don't dispatch C skeletons here.
5261 * src/parse-gram.y (PERCENT_LANGUAGE): New.
5262 (prologue_declaration): Add "%language" rule, use skeleton_arg.
5263 * src/scan-gram.l ("%language"): New rule.
5264
5265 * tests/calc.at: Test %skeleton and %language.
5266 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
5267 (AT_GLR_IF): Look for %skeleton "glr.cc".
5268 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
5269 (AT_YACC_IF): Reject %language.
5270
5271 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5272
5273 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
5274 since it wasn't used; only the typedef name 'semantic_type' is needed.
5275 Also, omit trailing white space.
5276
5277 * bootstrap: Sync from coreutils.
5278 (gnulib_extra_files): Add build-aux/announce.gen.
5279 (slurp): Adjust .gitignore files like .cvsignore files.
5280 * build-aux/announce-gen: Remove from CVS, since bootstrap
5281 now creates this.
5282
5283 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
5284
5285 Make %push-parser imply %pure-parser. This fixes several bugs; see
5286 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
5287 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
5288 pure_parser = true.
5289 * data/push.c: Don't bother testing b4_push_if when deciding whether
5290 to expand b4_declare_parser_variables globally.
5291 (yypush_parse): Likewise in here.
5292
5293 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
5294 (yy_reduce_print): Reformat M4 for readability.
5295
5296 2006-12-15 Bob Rossi <bob@brasko.net>
5297 and Joel Denny <jdenny@ces.clemson.edu>
5298
5299 * data/push.c (yypstate): Add typedef, and update all uses of
5300 struct yypstate to just yypstate.
5301 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
5302
5303 2006-12-14 Bob Rossi <bob@brasko.net>
5304
5305 * data/push.c (yypush_parse): Declare prototype regardless of
5306 %locations option.
5307
5308 2006-12-14 Bob Rossi <bob@brasko.net>
5309
5310 * data/push.c (yyparse): Remove the prototype and the #define when in
5311 push-parser mode.
5312
5313 2006-12-13 Bob Rossi <bob@brasko.net>
5314
5315 * data/push.c (yypstate_init): Rename to...
5316 (yypstate_new): ... this and use b4_c_function_def.
5317 (yypstate_delete): New.
5318 (yypush_parse): Change parameters yynval and yynlloc to be const.
5319 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
5320 yypstate_delete functions.
5321
5322 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
5323
5324 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
5325 strange test case titles. Reported by Bob Rossi.
5326
5327 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
5328
5329 * TODO: Add pointer to Sylvain Schmitz's work on static detection
5330 of potential ambiguities in GLR grammers.
5331
5332 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
5333
5334 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
5335 `bison ', use m4_index instead of m4_substr since chopping up a string
5336 containing M4-special characters causes problems here.
5337
5338 Fix a couple of bugs related to special characters in user-specified
5339 file names, and make it easier for skeletons to compute output file
5340 names with the same file name prefix as Bison-computed output file
5341 names.
5342 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
5343 b4_parser_file_name and b4_spec_defines_file instead of
5344 @output_parser_name@ and @output_header_name@, which are now redundant.
5345 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
5346 b4_parser_file_name, b4_spec_defines_file, and the new
5347 @basename(FILENAME@) instead of @output_parser_name@ and
5348 @output_header_name@, which inappropriately escaped the file names as
5349 C string literals.
5350 * src/files.c (all_but_ext): Remove static qualifier.
5351 (compute_output_file_names): Move `free (all_but_ext)' to...
5352 (output_file_names_free): ... here since all_but_ext is needed later.
5353 * src/files.h (all_but_ext): Extern.
5354 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
5355 exactly what MUSCLE_INSERT_STRING used to do.
5356 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
5357 characters are escaped properly.
5358 * src/output.c (prepare): Define muscle file_name_all_but_ext as
5359 all_but_ext.
5360 For pkgdatadir muscle, maintain previous functionality by using
5361 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
5362 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
5363 digraphs would never be expanded. Hopefully no one has M4-special
5364 characters in his Bison installation path.
5365 * src/scan-skel.l: Don't parse @output_header_name@ and
5366 @output_parser_name@ anymore since they're now redundant.
5367 In @output, use decode_at_digraphs.
5368 Parse a new @basename command that invokes last_component.
5369 (decode_at_digraphs): New.
5370 (BASE_QPUTS): Remove unused.
5371 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
5372 (Output file name): New tests.
5373
5374 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
5375
5376 Warn about output files that are generated by the skeletons and that
5377 conflict with other output files.
5378 * data/glr.c: Don't generate the header file here when glr.cc does.
5379 * src/files.c (file_names, file_names_count): New static globals.
5380 (compute_output_file_names): Invoke output_file_name_check for files
5381 not generated by the skeletons and remove existing checks.
5382 (output_file_name_check): New function that warns about conflicting
5383 output file names.
5384 (output_file_names_free): Free file_names.
5385 * src/files.h (output_file_name_check): Declare.
5386 * src/scan-skel.l: Invoke output_file_name_check for files generated by
5387 the skeletons.
5388 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
5389 (Conflicting output files): New tests.
5390
5391 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5392
5393 * doc/bison.texinfo: Fix a couple of typos.
5394
5395 2006-12-08 Bob Rossi <bob@brasko.net>
5396
5397 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
5398 Rename to...
5399 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
5400 update all uses.
5401 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
5402 (yypush_parse): Rename yypvars argument to yyps and remove redundant
5403 local pv.
5404 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
5405 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
5406
5407 2006-12-07 Bob Rossi <bob@brasko.net>
5408 and Joel Denny <jdenny@ces.clemson.edu>
5409
5410 * data/push.c (yypvarsinit): Change return type from void* to struct
5411 yypvars*. No longer cast to void* on return.
5412 (struct yypvars): Remove yylen since it need not be remembered between
5413 yypushparse invocations.
5414 (yypushparse): Don't copy between yylen and pv->yylen.
5415
5416 2006-12-05 Bob Rossi <bob@brasko.net>
5417
5418 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
5419 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
5420 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
5421 (struct yypvars): Remove b4_declare_parser_variables.
5422 (yypvarsinit): Remove init code for removed variables.
5423 (global scope): Do not declare b4_declare_parser_variables if
5424 push or pure mode.
5425 (yypushparse): Add b4_declare_parser_variables.
5426 Init new local variables, and remove init code for removed
5427 yypvars variables.
5428 (yyparse): Delete.
5429 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
5430 and yyparse for other modes.
5431 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
5432 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
5433 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
5434 (AT_PURE_LEX_IF): True if pure or push parser.
5435
5436 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
5437
5438 Document Yacc prologue alternatives and default %destructor's and
5439 %printer's as experimental. Don't mention Java yet. Discussed at
5440 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
5441 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
5442 (2.3a): Annotate this entry to say the old forms of these features were
5443 also experimental.
5444 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
5445 Table of Symbols): Say they're experimental. Comment out any mention
5446 of Java (we'll want this back eventually).
5447
5448 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5449
5450 Support a file name argument to %defines. Deprecate `=' in
5451 %file-prefix, %name-prefix, and %output. Discussed at
5452 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
5453 * NEWS (2.3a+): Mention.
5454 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
5455 form of %defines, and remove `=' from entries for %file-prefix,
5456 %name-prefix, and %output.
5457 * src/parse-gram.y (prologue_declaration): Implement.
5458 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
5459 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
5460 all but one occurrence of %name-prefix.
5461 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
5462 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
5463 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
5464 occurrence of each of %file-prefix and %output. Add check for %defines
5465 with argument.
5466 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
5467 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
5468 Remove the `=' from %output.
5469
5470 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
5471
5472 Don't escape $ in test case titles since Autoconf 2.61 now does that
5473 correctly.
5474 * tests/actions.at (Default %printer and %destructor are not for error
5475 or $undefined): Here.
5476 (Default %printer and %destructor are not for $accept): Here.
5477 * tests/input.at (Invalid $n and @n): Here.
5478
5479 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
5480
5481 Rename <!> to <>. Discussed starting at
5482 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
5483 * NEWS (2.3a+): Update.
5484 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
5485 Update.
5486 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
5487 * src/scan-gram.l (INITIAL): Implement.
5488 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
5489 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
5490 comment.
5491 * tests/actions.at (Default tagless %printer and %destructor,
5492 Default tagged and per-type %printer and %destructor,
5493 Default %printer and %destructor are not for error or $undefined,
5494 Default %printer and %destructor are not for $accept,
5495 Default %printer and %destructor for mid-rule values): Update.
5496 * tests/input.at (Default %printer and %destructor redeclared,
5497 Unused values with default %destructor): Update.
5498
5499 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
5500
5501 Don't let %prec take a nonterminal.
5502 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
5503 token.
5504 * tests/input.at (%prec takes a token): New test checking that %prec
5505 won't take a nonterminal.
5506
5507 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5508
5509 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
5510 it was double-quoted.
5511 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
5512 grammar is maintained with Bison's highest standards.
5513 * src/getargs.c: Fix some typos in Doxygen comments.
5514
5515 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5516
5517 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
5518 later. Reported by Paul Eggert in
5519 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
5520 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
5521 * src/scan-code.l (translate_action): Don't bother invoking
5522 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
5523 (code_scanner_free): Instead of invoking
5524 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
5525 which frees more.
5526 * src/scan-gram.l (gram_scanner_free): Likewise.
5527 * src/scan-skel.l (scan_skel): Likewise.
5528
5529 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5530
5531 * src/files.c (tr): Change return type to void.
5532 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
5533 has been called previously for the same key.
5534 (muscle_find): Return storage instead of value so that
5535 --enable-gcc-warnings doesn't produce warnings that the return discards
5536 const. aver that the value and storage are the same since storage
5537 could potentially be NULL when value is not.
5538 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
5539 same as 0.
5540
5541 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5542
5543 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
5544 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
5545 us a slightly cleaner distribution, and also works.
5546 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
5547 gnulib changes.
5548
5549 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
5550 and Paul Eggert <eggert@cs.ucla.edu>
5551
5552 Don't let Bison leak memory except when it complains.
5553 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
5554 (spec_defines_file, dir_prefix): Now char *, not const char *,
5555 since they are freed.
5556 * src/files.c: Likewise.
5557 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
5558 Likewise.
5559 (tr): Now operates in-place. All uses changed.
5560 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
5561 values.
5562 (compute_file_name_parts, compute_output_file_names): Don't store
5563 read-only data in variables that will be freed.
5564 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
5565 src_extension, and header_extension.
5566 (output_file_names_free): New public function to free
5567 spec_verbose_file, spec_graph_file, spec_defines_file,
5568 parser_file_name, and dir_prefix.
5569 * src/getargs.c (getargs): Don't store read-only data in variables that
5570 will be freed.
5571 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
5572 (which previously existed but was unused), and quotearg_free.
5573 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
5574 * src/muscle_tab.c: Likewise.
5575 (muscle_entry): Make the value char const *,
5576 and add a new storage member that is char * and can be freed.
5577 (muscle_entry_free): New private function.
5578 (muscle_init): Use it instead of free.
5579 (muscle_insert, muscle_grow): Update and use new storage member.
5580 (muscle_code_grow): Free the string passed to muscle_grow
5581 since it's not needed anymore.
5582 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
5583 add a new `char *code' member.
5584 ("{...}"): Declare semantic type as code.
5585 * src/scan-code.h (translate_rule_action):
5586 (translate_symbol_action, translate_code, translate_action): Return
5587 `char const *' rather than `char *' since external code should not free
5588 these strings.
5589 * src/scan-code.l: Likewise.
5590 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
5591 which is "{...}" in the parser.
5592 * tests/Makefile.am (maintainer-check-valgrind): Set
5593 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
5594 Valgrind.
5595 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
5596 complain.
5597 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
5598 expecting a non-zero exit status sets --leak-check=summary and
5599 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
5600 this case, and we don't want to hear about it.
5601
5602 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5603
5604 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
5605 instead of from the template, to simplify configuration a bit.
5606 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
5607 and m4/wint_t.m4, as they are needed with the latest gnulib.
5608
5609 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5610
5611 Disable unset/unused mid-rule value warnings by default, and recognize
5612 --warnings=midrule-values to enable them. Discussed starting at
5613 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
5614 * NEWS (2.3a+): Mention.
5615 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
5616 warnings): Add entry for midrule-values subargument.
5617 * src/reader.c (symbol_should_be_used): Don't return true just because
5618 the value is a set/used mid-rule value unless
5619 --warnings=midrule-values was specified.
5620 * tests/input.at (Unused values, Unused values before symbol
5621 declarations): Run tests with and without --warnings=midrule-values.
5622
5623 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
5624 than LIST_FREE directly.
5625
5626 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5627
5628 Finish implementing --warnings=error, which should not be implied by
5629 --warnings=all (or by its synonyms -W and --warnings without
5630 subarguments).
5631 * src/complain.c (set_warning_issued): New function to report that
5632 warnings are being treated as errors and to record an error if so.
5633 Invoke...
5634 (warn_at, warn): ... here.
5635 * src/getargs.c (warnings_args, warnings_types): Reorder so that
5636 "error - warnings are errors" does not appear above "all - all of the
5637 above".
5638 (getargs): For -W and --warnings without subarguments, don't let
5639 FLAGS_ARGMATCH set warnings_error in warnings_flag.
5640 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
5641
5642 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5643
5644 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
5645 empty subargument list. For example: `bison --warnings= parser.y'.
5646
5647 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5648
5649 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
5650 the parser header file so that gcc doesn't warn.
5651
5652 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5653
5654 Split the default %destructor/%printer into two kinds: <*> and <!>.
5655 Discussed starting at
5656 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
5657 * NEWS (2.3a+): Mention.
5658 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
5659 previous change today related to mid-rules.
5660 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
5661 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
5662 (TYPE_TAG_ANY): Add as <*>.
5663 (TYPE_TAG_NONE): Add as <!>.
5664 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
5665 for <*> and <!>.
5666 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
5667 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
5668 * src/symlist.c (symbol_list_default_new): Split into tagged and
5669 tagless versions.
5670 (symbol_list_destructor_set, symbol_list_printer_set): Split
5671 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
5672 SYMLIST_DEFAULT_TAGLESS.
5673 * src/symlist.h: Update symbol_list_default*_new prototypes.
5674 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
5675 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
5676 * src/symtab.c (default_destructor, default_destructor_location,
5677 default_printer, default_printer_location): Split each into tagged and
5678 tagless versions.
5679 (symbol_destructor_get, symbol_destructor_location_get,
5680 symbol_printer_get, symbol_printer_location_get): Implement tagged
5681 default and tagless default cases.
5682 (default_destructor_set, default_printer_set): Split each into tagged
5683 and tagless versions.
5684 * src/symtab.h: Update prototypes.
5685 * tests/actions.at (Default %printer and %destructor): Rename to...
5686 (Default tagless %printer and %destructor): ... this, and extend.
5687 (Per-type %printer and %destructor): Rename to...
5688 (Default tagged and per-type %printer and %destructor): ... this, and
5689 extend.
5690 (Default %printer and %destructor for user-defined end token): Extend.
5691 (Default %printer and %destructor are not for error or $undefined):
5692 Update.
5693 (Default %printer and %destructor are not for $accept): Update.
5694 (Default %printer and %destructor for mid-rule values): Extend.
5695 * tests/input.at (Default %printer and %destructor redeclared): Extend.
5696 (Unused values with default %destructor): Extend.
5697
5698 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5699
5700 Don't apply the default %destructor/%printer to an unreferenced midrule
5701 value. Mentioned at
5702 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
5703 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
5704 like $@n instead of just @n so that the default %destructor/%printer
5705 logic doesn't see them as user-defined symbols.
5706 (symbol_is_dummy): Check for both forms of the name.
5707 * src/reader.c (packgram): Remove the `$' from each midrule symbol
5708 name for which the midrule value is referenced in any action.
5709 * tests/actions.at (Default %printer and %destructor for mid-rule
5710 values): New test.
5711 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
5712 for change to dummy symbol names.
5713
5714 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5715
5716 Warn about unset midrule $$ if the corresponding $n is used.
5717 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
5718 $n usage.
5719 (packgram): Before invoking grammar_rule_check on any rule, make sure
5720 all actions have already been scanned in order to set `used' flags.
5721 Otherwise, checking that a midrule's $$ is set will not always work
5722 properly because the midrule check must forward-reference the midrule's
5723 parent rule.
5724 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
5725 warning.
5726
5727 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5728
5729 More improvements to the documentation of the prologue alternatives:
5730 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
5731 Bison manual.
5732 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
5733 some text to clarify the relative importance of the new directives and
5734 to show how these directives may be viewed as code labels.
5735
5736 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
5737
5738 Similar to the recently removed %before-header, add %code-top as the
5739 alternative to the pre-prologue. Mentioned at
5740 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
5741 Also, let the prologue alternatives appear in the grammar section.
5742 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
5743 (prologue_declaration): Move the existing prologue alternatives to...
5744 (grammar_declaration): ... here and add %code-top.
5745 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
5746
5747 Clean up and extend documentation for the prologue alternatives.
5748 * NEWS (2.3a+): Describe prologue alternatives.
5749 * doc/bison.texinfo (Prologue): Move discussion of prologue
5750 alternatives to...
5751 (Prologue Alternatives): ... this new section, and extend it to discuss
5752 all 4 directives in detail.
5753 (Table of Symbols): Clean up discussion of prologue alternatives and
5754 add %code-top.
5755
5756 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5757
5758 DJGPP specific issues.
5759
5760 * djgpp/config.bat: config.hin has been moved to lib. Adjust
5761 config.bat accordingly.
5762 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
5763 * djgpp/config.site: Likewise.
5764
5765 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
5766
5767 Replace %*-header with %provides, %requires, %code. See discussion at
5768 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
5769
5770 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
5771 (b4_user_start_header): Remove.
5772 * data/glr.c: Use new macros instead of b4_*start_header
5773 and b4_*end_header.
5774 * data/glr.cc: Likewise.
5775 * data/lalr1.cc: Likewise.
5776 * data/push.c: Likewise.
5777 * data/yacc.c: Likewise.
5778
5779 * doc/bison.texinfo: Remove %before-header, rename
5780 %{start,end,after}-header to %requires, %provides, %code.
5781
5782 * src/parse-gram.y: Likewise (also rename token names accordingly).
5783 * src/scan-gram.l: Likewise.
5784 * tests/actions.at: Likewise.
5785
5786 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
5787
5788 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
5789 Problem reported by Joel E. Denny.
5790
5791 2006-10-14 Jim Meyering <jim@meyering.net>
5792
5793 (Sync from coreutils.)
5794 Work also when the working directory (with e.g. coreutils sources)
5795 is version controlled with git, rather than CVS.
5796 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
5797 rather than CVS.
5798 In messages and comments, say e.g., "checked-out sources",
5799 rather than "CVS sources".
5800 (version_controlled_file): New function. Work for git as well as
5801 for CVS. Don't use grep's -q option.
5802 (slurp): Call it here, in place of CVS-specific code.
5803
5804 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
5805
5806 Fix testsuite for ./configure --enable-gcc-warnings:
5807 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
5808 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
5809 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
5810 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
5811 * test/regression.at (Diagnostic that expects two alternatives):
5812 Likewise.
5813
5814 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5815
5816 * bootstrap.conf (gnulib_modules): Add config-h.
5817 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
5818 worry about HAVE_CONFIG_H.
5819 * lib/abitset.c: Likewise.
5820 * lib/bitset.c: Likewise.
5821 * lib/bitset_stats.c: Likewise.
5822 * lib/bitsetv-print.c: Likewise.
5823 * lib/bitsetv.c: Likewise.
5824 * lib/ebitset.c: Likewise.
5825 * lib/get-errno.c: Likewise.
5826 * lib/lbitset.c: Likewise.
5827 * lib/subpipe.c: Likewise.
5828 * lib/timevar.c: Likewise.
5829 * lib/vbitset.c: Likewise.
5830 * lib/bitset.c: Include "bitset.h" first, to test interface.
5831 * lib/bitset_stats.c: Include "bitset_stats.h" first.
5832 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
5833 * lib/bitsetv.c: Include "bitsetv.h" first.
5834 * lib/get-errno.c: Include "get-errno.h" first.
5835 * m4/.cvsignore: Add config-h.m4.
5836 * tests/actions.at (Default %printer and %destructor for ...):
5837 Adjust expected line numbers in output to reflect removal of #if
5838 HAVE_CONFIG_H lines.
5839 * tests/glr-regression.at (Missed %merge type warnings when ...):
5840 Likewise.
5841 * tests/regression.at (Braced code in declaration in rules section):
5842 Likewise.
5843 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
5844 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
5845 Include <config.h> unconditionally.
5846
5847 * bootstrap: Sync from coreutils, as follows:
5848
5849 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5850
5851 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
5852 variable was sometimes used without being initialized. This
5853 messed up the installation of the INSTALL file in some cases.
5854
5855 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5856
5857 * bootstrap (usage, main program, symlink_to_gnulib): Add option
5858 --copy. Inspired by a suggestion from Bruno Haible.
5859
5860 2006-10-03 Jim Meyering <jim@meyering.net>
5861
5862 * bootstrap: Undo last change to this file, since now gnulib-tool
5863 sticks with the automake default in generating dependencies.
5864
5865 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5866
5867 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
5868 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
5869
5870 * doc/bison.1: Add copyright notice.
5871
5872 * data/glr.c: Don't include <stdarg.h>; not used.
5873
5874 * NEWS: The -g and --graph options now output graphs in Graphviz
5875 DOT format, not VCG format.
5876 * doc/bison.1: Likewise.
5877 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
5878 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
5879 of this change in
5880 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
5881 * TODO: Remove Graphviz entry.
5882 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
5883 remove vcg.c, vcg.h, vcg_defaults.h.
5884 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
5885 * src/graphviz.c, src/graphviz.h: New files.
5886 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
5887 * src/files.h: Make comment more generic.
5888 * src/main.c (main): Likewise.
5889 * src/print_graph.h: Likewise.
5890 * src/getargs.c (usage): Make usage description more generic.
5891 * src/print_graph.c: Include graphviz.h rather than vcg.h.
5892 (static_graph, fgraph): Remove. All uses changed to pass
5893 arguments instead of sharing a static var.
5894 (print_core, print_actions, print_state, print_graph):
5895 Output graphviz format rather than VCG format.
5896 * tests/.cvsignore: Remove *.vcg; add *.dot.
5897 * tests/output.at: Expect *.dot files, not *.vcg files.
5898
5899 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
5900 accommodates the 2006-10-08 change.
5901
5902 2006-10-11 Bob Rossi <bob@brasko.net>
5903
5904 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
5905 (b4_yyssa, b4_yyerror_range): New macros.
5906 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
5907 (yypvarsinit): Remove init of removed fields.
5908 (yypushparse): Remove use of removed fields; use new macros instead.
5909
5910 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5911
5912 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
5913 in a push parser. Reindent slightly to match yacc.c better.
5914
5915 2006-10-11 Bob Rossi <bob@brasko.net>
5916
5917 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
5918 yymsg_alloc fields.
5919 (yypvarsinit, yypushparse): Remove init of removed fields.
5920 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
5921
5922 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5923
5924 * THANKS: Add Paolo Bonzini and Bob Rossi.
5925
5926 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
5927
5928 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
5929 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
5930 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
5931 b4_define_user_cde and uses): Remove.
5932 (b4_comment, b4_prefix, b4_sync_start): New.
5933 * data/bison.m4: New file, with most of the content removed from c.m4.
5934 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
5935 * src/output.c (output_skeleton): Pass bison.m4.
5936 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
5937 only if specified.
5938
5939 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
5940
5941 Fix test failure reported by Tom Lane in
5942 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
5943 and try to make such failures easier to catch in the future.
5944 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
5945 that's now the caller's responsibility.
5946 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
5947 Set yychar = YYEOF if it's negative.
5948 * tests/actions.at (yylex): Abort if asked to read past EOF.
5949 * tests/conflicts.at (yylex): Likewise.
5950 * tests/cxx-type.at (yylex): Likewise.
5951 * tests/glr-regression.at (yylex): Likewise.
5952 * tests/input.at (yylex): Likewise.
5953 * tests/regression.at (yylex): Likewise.
5954 * tests/torture.at (yylex): Likewise.
5955
5956 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
5957
5958 Fix problems with translating English-language diagnostics.
5959 * bootstrap: Fix bug introduced in recent bootstrap changes, with
5960 respect to bison-runtime pot generation. The YY_ stuff
5961 wasn't being captured.
5962 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
5963 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
5964 * runtime-po/POTFILES.in: Add data/push.c.
5965
5966 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
5967
5968 Merge bootstrap changes from coreutils.
5969
5970 2006-09-28 Jim Meyering <jim@meyering.net>
5971
5972 Automatically generated dependencies are important even
5973 when all of the sources in a directory come from gnulib.
5974 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5975 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5976
5977 2006-09-23 Jim Meyering <jim@meyering.net>
5978
5979 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5980
5981 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5982
5983 * bootstrap: Add support for --force.
5984 (usage): New function. Describe usage less tersely.
5985 (CVS_only_file): New var.
5986
5987 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
5988
5989 * data/push.c (YYPUSH_MORE): Make it an enum instead.
5990 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5991 Adjust white space and comments to match GNU style better.
5992
5993 2006-09-20 Bob Rossi <bob@brasko.net>
5994
5995 * data/push.c (yyresult_get): Remove function.
5996 (YYPUSH_MORE): Add #define.
5997 (yypushparse): Modify return value.
5998
5999 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6000
6001 * stamp-h.in: Remove; no longer needed.
6002 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6003 Remove config.h, config.hin, intl (no longer created).
6004 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6005 stamp-h1.
6006
6007 Sync bootstrap from coreutils, as follows:
6008
6009 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6010
6011 * bootstrap (symlink_to_gnulib): New function.
6012 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6013 to copies-of-gnulib.
6014 (cp_mark_as_generated, slurp, gnulib_files):
6015 Avoid making a copy if it's the same as the old version.
6016 (gnulib_files): Add support for this variable (used by Bison).
6017
6018 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6019
6020 * src/getargs.c (usage): Rework to use conventions similar to
6021 coreutils, to make translation a bit easier and the code a bit
6022 smaller. Problem reported by Tim Van Holder.
6023
6024 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6025
6026 Use some of gnulib's new modules, taken from coreutils.
6027
6028 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6029 * bootstrap.conf: New file.
6030 (gnulib_modules): Add configmake, inttypes, unistd.
6031 (XGETTEXT_OPTIONS): Add complain, complain_at,
6032 fatal, fatal_at, warn, warn_at, unexpected_end.
6033 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6034 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6035 (gl_EARLY): Add.
6036 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6037 (gl_INIT): Add
6038 (GNULIB_AUTOCONF_SNIPPET): Remove.
6039 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6040 the pickiest.
6041 * lib/.cvsignore: Add inttypes_.h.
6042 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6043 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6044 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6045 no-longer-necessary initializations.
6046 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6047 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6048 use the unistd module.
6049 * src/system.h: Likewise.
6050 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6051 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6052 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6053 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6054 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6055 * src/system.h: Include inttypes.h unconditionally, now that we
6056 use the inttypes module. Don't bother to include stdint.h, since
6057 inttypes.h now does that for us.
6058 (LOCALEDIR): Remove, now that we use the configmake module.
6059 * src/getargs.c: Include configmake.h.
6060 * src/main.c: Likewise.
6061 * src/output.c: Likewise.
6062 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6063 not from $abs_top_builddir, since config.h moved.
6064
6065
6066 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6067 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6068
6069 * src/parse-gram.y (symbol_declaration): Don't put statements
6070 before declarations; it's not portable to C89.
6071 * src/scan-code.l (handle_action_at): Likewise.
6072
6073 * src/scan-code.l: Always initialize braces_level; the old code
6074 left it uninitialized and therefore had undefined behavior.
6075
6076 Don't attempt to redefine 'assert', since it runs afoul of
6077 systems where standard headers (mistakenly) include <assert.h>.
6078 Instead, define and use our own alternative, called 'aver'.
6079 * src/reader.c: Don't include assert.h, since we no longer
6080 use assert.
6081 * src/scan-code.l: Likewise.
6082 * src/system.h (assert): Remove, replacing with....
6083 (aver): New function, taking a bool arg. All uses changed.
6084 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6085 not merely an integer.
6086
6087 2006-09-15 Bob Rossi <bob@brasko.net>
6088
6089 Add support for push parsing. Based on the original work of
6090 Odd Arild Olsen <oao@fibula.no>.
6091 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6092 * data/c.m4 (YYPUSH): New.
6093 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
6094 * data/push.c: New file.
6095 * src/getargs.c (push_parser): New var.
6096 * src/getargs.h (push_parser): New declaration.
6097 * src/output.c (prepare): Add macro insertion of `push_flag'.
6098 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6099 (prologue_declaration): Parse %push-parser.
6100 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6101 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6102 list of removed lines from the traces observed.
6103 (AT_CHECK_CALC_LALR): Added push parser tests.
6104
6105 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6106
6107 * NEWS: Version 2.3a.
6108 * configure.ac (AC_INIT): Likewise.
6109
6110 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6111 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6112 due to header ordering dependencies. I don't know why the #define
6113 was there.
6114
6115 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6116 runtime cost when YYDEBUG is not defined, and so that some tests
6117 that used to fail now work. Problem and initial suggestion by
6118 Paolo Bonzini.
6119 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6120 * data/glr.cc (b4_parser_class_name):
6121 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6122 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6123 (yydebug_) [YYDEBUG]: New member.
6124 (yycdebug_): Now defined only if YYDEBUG.
6125 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6126 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6127 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6128 if YYYDEBUG.
6129 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6130 Define only if YYDEBUG.
6131 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6132 set_debug_level.
6133 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6134 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6135 AT_CHECK_CALC_GLR_CC that are working now.
6136
6137 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6138
6139 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6140 We don't need them in glr.cc, and glr.c defines them.
6141 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6142 assumes that defining it to anything is the same as defining
6143 it to 1. Problem reported by Paolo Bonzini.
6144
6145 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6146
6147 * data/c.m4 (b4_null, b4_case): Define.
6148 * src/output.c (prepare_symbols): Use b4_null.
6149 (user_actions_output): Use b4_case.
6150
6151 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6152
6153 * data/glr.c (b4_shared_declarations): Put start-header first,
6154 before any #includes that we generate, so that feature-test
6155 macros work. Problem reported by Michael Deutschmann in
6156 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
6157 * data/lalr1.cc: Likewise.
6158 * doc/bison.texinfo (Prologue): Document that feature-test macros
6159 should be defined before any Bison declarations.
6160 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
6161 that depend on location.hh after, not before, Bison decls, since
6162 we now include location.hh after the first user prologue.
6163
6164 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
6165 Sander Brandenburg in
6166 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
6167 Also, fix minor white space and comment issues.
6168 (Prologue): Mention that it's better to define feature-test macros
6169 before Bison declarations. Problem reported by Michael Deutschmann.
6170
6171 * README-cvs: Fix typo: "&" should be "&&". Problem reported
6172 by Jim Meyering.
6173 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
6174 This adjusts to recent gnulib changes.
6175
6176 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6177
6178 Finish implementation of per-type %destructor/%printer. Discussed
6179 starting at
6180 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
6181 and
6182 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
6183 * NEWS (2.3+): Add a description of this feature to the default
6184 %destructor/%printer description.
6185 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
6186 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6187 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
6188 list node contains a semantic type.
6189 * src/symtab.c, src/symtab.h: Extend with a table that associates
6190 semantic types with their %destructor's and %printer's.
6191 (semantic_type_from_uniqstr, semantic_type_get,
6192 semantic_type_destructor_set, semantic_type_printer_set): New functions
6193 composing the public interface of that table.
6194 (symbol_destructor_get, symbol_destructor_location_get,
6195 symbol_printer_get, symbol_printer_location_get): If there's no
6196 per-symbol %destructor/%printer, look up the per-type before trying
6197 the default.
6198 * tests/actions.at (Per-type %printer and %destructor): New test case.
6199 * tests/input.at (Default %printer and %destructor redeclared):
6200 Extend to check that multiple occurrences of %symbol-default in a
6201 single %destructor/%printer declaration is an error.
6202 (Per-type %printer and %destructor redeclared, Unused values with
6203 per-type %destructor): New test cases.
6204
6205 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6206
6207 Require default %destructor/%printer to be declared using
6208 %symbol-default instead of an empty symbol list, and start working on
6209 new per-type %destructor/%printer. Discussed at
6210 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
6211 * NEWS (2.3+): Add %symbol-default to example.
6212 * bison.texinfo (Freeing Discarded Symbols): Likewise.
6213 (Table of Symbols): Add entry for %symbol-default.
6214 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
6215 (generic_symlist, generic_symlist_item): New nonterminals for creating
6216 a list in which each item is a symbol, semantic type, or
6217 %symbol-default.
6218 (grammar_declaration): Use generic_symlist in %destructor and %printer
6219 declarations instead of symbols.1 or an empty list.
6220 (symbol_declaration, precedence_declaration, symbols.1): Update actions
6221 for changes to symbol_list.
6222 * src/reader.c: Update for changes to symbol_list.
6223 * src/scan-code.l: Likewise.
6224 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
6225 * src/symlist.c, src/symlist.h: Extend such that a list node may
6226 represent a semantic type or a %symbol-default in addition to just an
6227 ordinary symbol. Add switched functions for setting %destructor's and
6228 %printer's.
6229 * tests/actions.at, tests/input.at: Add %symbol-default to all default
6230 %destructor/%printer declarations.
6231
6232 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
6233
6234 Whether the default %destructor/%printer applies to a particular symbol
6235 isn't a question of whether the user *declares* that symbol (in %token,
6236 for example). It's a question of whether the user by any means
6237 *defines* the symbol at all (by simply using a char token, for
6238 example). $end is defined by Bison whereas any other token with token
6239 number 0 is defined by the user. The error token is always defined by
6240 Bison regardless of whether the user declares it with %token, but we
6241 may one day let the user define error as a nonterminal instead.
6242 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
6243 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
6244 the meaning of "user-defined".
6245 * tests/actions.at (Default %printer and %destructor for user-declared
6246 end token): Rename to...
6247 (Default %printer and %destructor for user-defined end token): ...
6248 this.
6249
6250 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
6251 computation of whether to apply the default, don't maintain a list of
6252 every Bison-defined symbol. Instead, just check for a first character
6253 of '$', which a user symbol cannot have, and check for the error token.
6254
6255 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
6256
6257 Don't apply the default %destructor or %printer to the error token,
6258 $undefined, or $accept. This change fits the general rule that the
6259 default %destructor and %printer are only for user-declared symbols,
6260 and it solves several difficulties that are described in the new test
6261 cases listed below.
6262 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
6263 * tests/actions.at (Default %printer and %destructor are not for error
6264 or $undefined, Default %printer and %destructor are not for $accept):
6265 New test cases.
6266
6267 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
6268
6269 Allow %start after the first rule.
6270 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
6271 when parsing the first rule.
6272 (check_and_convert_grammar): Search for it here after all grammar
6273 declarations have been parsed. Skip midrules, which have dummy LHS
6274 nonterminals.
6275 * src/symtab.c (symbol_is_dummy): New function.
6276 * src/symtab.h (symbol_is_dummy): Declare it.
6277 * tests/input.at (%start after first rule): New test.
6278
6279 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6280
6281 Redo some of the previous commit: add back the ability to use
6282 non-aliased/undeclared string literals since it might be useful to
6283 those declaring %token-table.
6284 * src/reader.c (check_and_convert_grammar): Undo changes in previous
6285 commit: don't worry about complaints from symbols_pack.
6286 * src/symtab.c (symbol_new, symbol_class_set,
6287 symbol_check_alias_consistency): Undo changes in previous commit: count
6288 each string literal as a new symbol and token, assign it a symbol
6289 number, and don't complain about non-aliased string literals.
6290 (symbols_pack): Since symbol_make_alias still does not decrement symbol
6291 and token counts but does still set aliased tokens to the same number,
6292 symbol_pack_processor now leaves empty slots in the symbols array.
6293 Remove those slots.
6294 * tests/regression.at (Undeclared string literal): Remove test case
6295 added in previous commit since non-aliased string literals are allowed
6296 again.
6297 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
6298 remove unnecessary string literal declarations.
6299 * tests/sets.at (Firsts): Likewise.
6300
6301 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6302
6303 Don't allow an undeclared string literal, but allow a string literal to
6304 be used before its declaration.
6305 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
6306 symbols_pack complained.
6307 * src/symtab.c (symbol_new): Don't count a string literal as a new
6308 symbol.
6309 (symbol_class_set): Don't count a string literal as a new token, and
6310 don't assign it a symbol number since symbol_make_alias does that.
6311 (symbol_make_alias): It's not necessary to decrement the symbol and
6312 token counts anymore. Don't assume that an alias declaration occurs
6313 before any uses of the identifier or string, and thus don't assert that
6314 one of them has the highest symbol number so far.
6315 (symbol_check_alias_consistency): Complain if there's a string literal
6316 that wasn't declared as an alias.
6317 (symbols_pack): Bail if symbol_check_alias_consistency failed since
6318 symbol_pack asserts that every token has been assigned a symbol number
6319 although undeclared string literals have not.
6320 * tests/regression.at (String alias declared after use, Undeclared
6321 string literal): New test cases.
6322 (Characters Escapes, Web2c Actions): Declare string literals as
6323 aliases.
6324 * tests/sets.at (Firsts): Likewise.
6325
6326 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
6327
6328 In the grammar scanner, STRING_FINISH unclosed constructs and return
6329 them to the parser in order to improve error messages.
6330 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
6331 SC_BRACED_CODE, SC_PROLOGUE): Implement.
6332 * tests/input.at (Unclosed constructs): New test case.
6333 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
6334 seen.
6335
6336 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
6337 unused global.
6338
6339 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
6340
6341 Handle string aliases for character tokens correctly.
6342 * src/symtab.c (symbol_user_token_number_set): If the token has an
6343 alias, check and set its alias's user token number instead of its own,
6344 which is set to indicate the alias. Previously, every occurrence of
6345 the character token in the grammar overwrote that alias indicator with
6346 the character code.
6347 * tests/input.at (String aliases for character tokens): New test.
6348
6349 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
6350
6351 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
6352
6353 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
6354
6355 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
6356 to prevent failures when building on older platforms.
6357 Check for autopoint failure.
6358 Set XGETTEXT_OPTIONS to values that check for C format strings,
6359 so that translators are warned about them (this also helps
6360 prevent core dumps).
6361
6362 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
6363 function, since it simplifies our code a bit.
6364
6365 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
6366 rather than -W, so we don't get bogus warnings about sign comparisons.
6367 Add -Wpointer-arith, since that warning is useful (it reports code
6368 that does not conform to C89 and that some compilers reject).
6369 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
6370 since it's no longer needed.
6371
6372 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
6373
6374 Clean up scanners a bit.
6375 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
6376 definitions so gcc won't warn when obstack_for_string is unused.
6377 * src/scan-code.l: config.h and system.h are already #include'd by
6378 scan-code-c.c, so get rid of them here.
6379 * src/scan-gram.l: Likewise.
6380 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
6381 definitions rather than duplicating the rest of it.
6382 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
6383
6384 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
6385
6386 Suppress signed/unsigned comparison warnings for yycheck.
6387 * data/c.m4 (b4_safest_int_type): New macro.
6388 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
6389 a signed int type, cast it to b4_safest_int_type first.
6390 * data/yacc.c: Likewise.
6391 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
6392 also overwritten.
6393
6394 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6395
6396 * doc/bison.texinfo: Fix some typos.
6397
6398 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
6399
6400 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
6401 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
6402
6403 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
6404 the latest gnulib does this a different way.
6405 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
6406 translation was patched, so stop omitting it.
6407
6408 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6409
6410 Enable declaration of default %printer/%destructor. Make the parser
6411 use these for all user-declared grammar symbols for which the user does
6412 not declare a specific %printer/%destructor. Thus, the parser uses it
6413 for token 0 if the user declares it but not if Bison generates it as
6414 $end. Discussed starting at
6415 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
6416 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
6417 and
6418 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
6419 * NEWS (2.3+): Mention.
6420 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
6421 declare a %destructor for a mid-rule's semantic value. It's just
6422 impossible to declare one specific to it.
6423 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
6424 code. Describe default %destructor form.
6425 * src/parse-gram.y (grammar_declaration): Parse default
6426 %printer/%destructor declarations.
6427 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
6428 and symbol_destructor_location_get rather than accessing the destructor
6429 and destructor_location members of struct symbol.
6430 (symbol_printers_output): Likewise but for %printer's.
6431 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
6432 again.
6433 * src/symtab.c (default_destructor, default_destructor_location,
6434 default_printer, default_printer_location): New static global
6435 variables to record the default %destructor and %printer.
6436 (symbol_destructor_get, symbol_destructor_location_get,
6437 symbol_printer_get, symbol_printer_location_get): New functions to
6438 compute the appropriate %destructor and %printer for a symbol.
6439 (default_destructor_set, default_printer_set): New functions to set the
6440 default %destructor and %printer.
6441 * src/symtab.h: Prototype all those new functions.
6442 * tests/actions.at (Default %printer and %destructor): New test to
6443 check that the right %printer and %destructor are called, that they're
6444 not called for $end, and that $$ and @$ work correctly.
6445 (Default %printer and %destructor for user-declared end token): New
6446 test to check that the default %printer and %destructor are called for
6447 a user-declared end token.
6448 * tests/input.at (Default %printer and %destructor redeclared, Unused
6449 values with default %destructor): New tests to check related grammar
6450 warnings and errors.
6451
6452 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6453
6454 Clean up handling of %destructor for the end token (token 0).
6455 Discussed starting at
6456 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
6457 and
6458 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
6459
6460 Make the skeletons consistent in how they pop the end token and invoke
6461 its %destructor.
6462 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
6463 state, which has token number 0, since this would invoke the
6464 %destructor for the end token.
6465 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
6466 until after shifting the end token, or else it won't be popped.
6467 * data/yacc.c (yyparse): Likewise.
6468
6469 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
6470 it's the end token. Upon termination, destroy an unshifted lookahead
6471 even when it's the end token.
6472 * data/lalr1.cc (yy::parser::parse): Likewise.
6473 * data/yacc.c (yyparse): Likewise.
6474
6475 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
6476 value warnings for the end token when the user gives the end token a
6477 %destructor.
6478
6479 * tests/actions.at (Printers and Destructors): Test all the above.
6480
6481 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
6482
6483 Update to latest gnulib and gettext versions.
6484 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
6485 Add fopen-safer.
6486 (gnulib_files): Add m4/warning.m4. Don't worry about files
6487 overwritten by autopoint.
6488 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
6489 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
6490 rejects them.
6491 Don't use autoreconf; instead, invoke autopoint etc. by hand,
6492 so that we can remove the intl files at a better time.
6493 (intl_files_to_remove): Remove aclocal.m4, since it gets
6494 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
6495 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
6496 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
6497 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
6498 Remove datarootdir hack; no longer needed.
6499 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
6500 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
6501 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
6502 strdup.h.
6503 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
6504 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
6505
6506 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
6507
6508 * bootstrap: Adjust to today's change to gnulib-tool by invoking
6509 it with --assume-autoconf='latest-stable'.
6510
6511 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
6512
6513 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
6514 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
6515 YYSTYPE' and `{'.
6516 * src/muscle_tab.h (muscle_grow): Replace the header comments with
6517 those from muscle_tab.c since the old ones are misleading.
6518
6519 2006-07-13 Akim Demaille <akim@epita.fr>
6520
6521 Support %define "KEY" {VALUE}.
6522 * src/scan-code.h, src/scan-code.l (translate_action)
6523 (translate_rule_action, translate_symbol_action, translate_code):
6524 Return char *, not const char *.
6525 * src/parse-gram.y (declaration): Rename as...
6526 (prologue_declaration): this.
6527 (string_content): Remove this nonterminal, use STRING.
6528 (braceless, content, content.opt): New nonterminal.
6529 Use them.
6530 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
6531 as value.
6532 * src/scan-gram.l (getargs.h): Don't include it.
6533
6534 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
6535
6536 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
6537 rather than a for-loop that declares a local bool variable. This
6538 should work around a compatibility problem with a Cray x1e C++
6539 compiler reported by Hung Nguyen in
6540 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
6541 The for-loop was introduced in the 2004-11-17 change but I don't
6542 know why it was needed.
6543
6544 2006-07-12 Akim Demaille <akim@epita.fr>
6545
6546 * data/c.m4: Comment changes.
6547
6548 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
6549
6550 * src/complain.c (error_message, ERROR_MESSAGE): New.
6551 To factor...
6552 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
6553 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
6554
6555 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6556
6557 * NEWS: Instead of %union, you can define and use your own union type
6558 YYSTYPE if your grammar contains at least one <type> tag.
6559 Your YYSTYPE need not be a macro; it can be a typedef.
6560 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
6561 (Union Decl, Decl Summary): Document this.
6562 * data/glr.c (YYSTYPE): Implement this.
6563 * data/glr.cc (YYSTYPE): Likewise.
6564 * data/lalr1.cc (YYSTYPE): Likewise.
6565 * data/yacc.c (YYSTYPE): Likewise.
6566 * src/output.c (prepare): Output tag_seen_flag.
6567 * src/parse-gram.y (declaration, grammar_declaration):
6568 Use 'union_seen' rather than 'typed' to determine whether
6569 %union has been seen, since grammars can now be typed without
6570 %union.
6571 (symbol_declaration, type.opt, symbol_def):
6572 Keep track of whether a tag has been seen.
6573 * src/reader.c (union_seen, tag_seen): New vars.
6574 (typed): remove.
6575 * src/reader.h (union_seen, tag_seen, typed): Likewise.
6576 * src/scan-code.l (untyped_var_seen): New variable.
6577 (handle_action_dollar): Adjust to above changes.
6578 (handle_action_dollar, handle_action_at):
6579 Improve overflow checking for outlandish numbers.
6580 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
6581 avoid new diagnostics generated by above changes.
6582 * tests/regression.at (YYSTYPE typedef): Add test to check
6583 for type tags without %union.
6584
6585 * src/symlist.c (symbol_list_length): Return int, not unsigned
6586 int, since callers expect int. This may need to get revisited
6587 once we have proper integer overflow checking.
6588
6589 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
6590 object is now static.
6591
6592 * src/getargs.c (flags_argmatch): Return void, not int,
6593 to pacify ./configure --enable-gcc-warnings.
6594
6595 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
6596 since last_string is already defined to FLEX_PREFIX (last_string).
6597
6598 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6599
6600 Implement --warnings/-W.
6601 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
6602 replaced by...
6603 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
6604 Adjust callers.
6605 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
6606 (warnings_args, warnings_types): New.
6607 (getargs, short_options, long_options): Accept -W/--warnings.
6608 Sort the options by alphabetical order, upper case letter right
6609 before its lower case.
6610
6611 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6612
6613 Change %merge result type clash warnings to errors. Discussed at
6614 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
6615 * src/reader.c (record_merge_function_type): Use complain_at.
6616 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6617 declared later): Update test case results.
6618
6619 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
6620
6621 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
6622 to be in alphabetical order.
6623 (trace_args): Spelling fixes.
6624
6625 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6626
6627 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
6628 so they don't collide with user-defined macros.
6629 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
6630 this was never guaranteed, and now that we're using gnulib stdint,
6631 which defines int_fast16_t to long int, the problem is exposed.
6632
6633 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
6634
6635 * data/c.m4 (b4_basename): Simplify a bit, since we don't
6636 need the full POSIX semantics (and weren't implementing them
6637 anyway).
6638
6639 Adjust to Autoconf 2.60 and today's gnulib.
6640 * bootstrap (gnulib_modules): Add stdint.
6641 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
6642 no longer copies it.
6643 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
6644 since stdint needs the former and wcwidth (which is now required
6645 by mbswidth) needs the latter.
6646 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
6647 work around a compatibility glitch between gettext 0.14.6 and
6648 Autoconf 2.60.
6649 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
6650 Do not check for uintptr_t, since new stdint module does the right
6651 thing.
6652 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
6653 Add stdint.h, stdint_.h, wcwidth.h.
6654 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
6655 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
6656 stdint.m4, wchar_t.m4, wcwidth.m4.
6657 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
6658 usual order for ../lib/*.h files.
6659 (file_name_split): Use last_component, not base_name, to adjust
6660 to gnulib changes.
6661 * src/parse-gram.h: Include <strverscmp.h> in the usual order
6662 for ../lib/*.h files.
6663 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
6664 Define unconditionally, since we now assume the stdint module.
6665 * src/scan-skel.l: Include <dirname.h>.
6666 (BASE_QPUTS): Use last_component, not base_name.
6667 * src/system.h: Include <unlocked-io.h> in the usual order
6668 for ../lib/*.h files. Include <stdint.h> unconditionally,
6669 since we now use the stdint module.
6670 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
6671 HAVE_UINTPTR_T, since we now use the stdint module.
6672 (base_name): Remove decl, since files now include <dirname.h>
6673 to get the decl.
6674
6675 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6676
6677 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
6678 New, default to 1.
6679 * data/yacc.c, data/glr.c, data/location.cc: Use them.
6680 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
6681 default.
6682 * tests/calc.at: Adjust.
6683
6684 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
6685
6686 * data/c.m4 (b4_basename): New.
6687 (b4_syncline): Also output the location of its invocation (from
6688 the skeleton).
6689 (b4_user_action, b4_define_user_action, b4_user_actions)
6690 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
6691 (b4_user_stype): New.
6692 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
6693
6694 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6695
6696 In the grammar file, the first column is 1 not 0 on the first line as
6697 on every other line.
6698 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
6699 * tests/input.at (Torturing the Scanner): Update output.
6700
6701 * src/scan-gram.l (scanner_cursor): Declare it static.
6702
6703 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6704
6705 In warnings, say "previous declaration" rather than "first
6706 declaration".
6707 * src/symtab.c (redeclaration): Do that here.
6708 * src/reader.c (record_merge_function_type): In the case of a result
6709 type clash, report the previous declaration rather than the very first
6710 one in the grammar file.
6711 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6712 declared later): Add a third declaration to check this behavior.
6713 * tests/input.at (Incompatible Aliases): Update output.
6714
6715 2006-06-27 Akim Demaille <akim@epita.fr>
6716
6717 * doc/Doxyfile.in: New.
6718 * doc/Makefile.am: Use it.
6719 * src/lalr.h, src/symtab.h: Initial doxygenation.
6720
6721 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6722
6723 Don't miss %merge result type warnings just because the LHS types are
6724 declared after the %merge. This continues the effort of the previous
6725 patch.
6726 * src/reader.c (get_merge_function): Don't set the merger type yet.
6727 (record_merge_function_type): New function for setting the merger type
6728 and checking for clashes.
6729 (grammar_current_rule_merge_set): Set the location of the %merge for
6730 the current rule.
6731 (packgram): Invoke record_merge_function_type for each rule now that
6732 all symbol type declarations have been parsed.
6733 * src/reader.h (merger_list.type_declaration_location): New member
6734 storing the location of the first %merge from which the type for this
6735 merging function was derived.
6736 * src/symlist.h (symbol_list.merger_declaration_location): New member
6737 storing the location of a rule's %merge, if any.
6738 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6739 declared later): New test to catch the error fixed by the above patch.
6740
6741 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6742
6743 Get action warnings (grammar_rule_check) right even when symbol
6744 declarations appear after the rules. Discussed at
6745 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
6746 and
6747 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
6748 Don't mistake the type of $$ in a midrule to be that of its parent
6749 rule's $$.
6750 * src/reader.c (grammar_current_rule_end): Don't invoke
6751 grammar_rule_check yet since not all symbol declarations may have been
6752 parsed yet.
6753 (grammar_midrule_action): Likewise.
6754 Don't record whether the midrule's $$ has been used yet since actions
6755 haven't been translated yet.
6756 Record the midrule's parent rule and its RHS index within the parent
6757 rule.
6758 (grammar_current_rule_action_append): Don't translate the action yet
6759 since not all symbol declarations may have been parsed yet and, thus,
6760 warnings about types for $$, $n, @$, and @n can't be reported yet.
6761 (packgram): Translate the action and invoke grammar_rule_check now that
6762 all symbol declarations have been parsed.
6763 * src/scan-code.l (handle_action_dollar): Now that this is invoked
6764 after parsing the entire grammar file, the symbol list here in the case
6765 of a midrule is actually the midrule's empty RHS, so reference its
6766 parent rule's RHS where necessary.
6767 On the other hand, now that you can already know it's a midrule, you
6768 aren't forced to think $$ has the same type as its parent rule's $$.
6769 (handle_action_at): In the case of a midrule, reference the parent rule
6770 where necessary.
6771 * src/symlist.c (symbol_list_new): Initialize new midrule-related
6772 members.
6773 (symbol_list_length): Now that this is invoked after all rules have
6774 been parsed, a NULL symbol (rather than a NULL symbol list node)
6775 terminates a rule. symbol_list_print already does this correctly.
6776 * src/symlist.h (symbol_list.midrule_parent_rule,
6777 symbol_list.midrule_parent_rhs_index): New members so that midrules can
6778 remember their relationships with their parents.
6779 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
6780 fixed by the above patch.
6781 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
6782 implementing...
6783 (Unused values): ... this old test case and...
6784 (Unused values before symbol declarations): ... this new test case.
6785 This one is the same as `Unused values' except that all symbol
6786 declarations appear after the rules in order to catch the rest of the
6787 errors fixed by the above patch.
6788
6789 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6790
6791 More cleanup.
6792 * src/reader.c (current_rule): Declare it static since it's no longer
6793 used outside this file.
6794 (grammar_current_rule_action_append): Remove redundant arguments from
6795 translate_rule_action invocation.
6796 * src/reader.h (current_rule): Remove this unused extern.
6797 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
6798 * src/scan-code.l (translate_rule_action): Likewise.
6799
6800 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
6801
6802 Clean up yesterday's patch.
6803 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
6804 to...
6805 * src/reader.c (grammar_current_rule_action_append): ... here for
6806 consistency with grammar_current_rule_symbol_append.
6807 * tests/regression.at (Braced code in declaration in rules section):
6808 Make yyerror and yylex static as usual.
6809
6810 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
6811
6812 Fix bug that mistakes braced code in a declaration in the rules section
6813 to be a rule action. Mentioned at
6814 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
6815 * src/scan-gram.l: Move midrule action detection from the start of the
6816 scanning of any braced code to...
6817 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
6818 action. For readability, use $2 and @2 rather than the equivalent
6819 global variables.
6820 * tests/regression.at (Braced code in declaration in rules section):
6821 New test to catch the error fixed by the above patch.
6822
6823 Work on code readability some.
6824 * src/scan-code.l (current_rule): Get rid of this misleading and
6825 redundant declaration: it's actually extern'ed in reader.h.
6826 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
6827 translate_action): Add a rule argument and use it instead of the global
6828 current_rule.
6829 (translate_rule_action): This already receives current_rule through an
6830 argument, so pass it on to translate_action instead of assigning
6831 current_rule to current_rule.
6832 (translate_symbol_action, translate_code): Pass rule = NULL to
6833 translate_action.
6834
6835 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
6836
6837 Rename %before-definitions to %start-header and %after-definitions to
6838 %end-header. Don't use these declarations to separate pre-prologue
6839 blocks from post-prologue blocks. Add new order-independent
6840 declarations %before-header and %after-header as alternatives to the
6841 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
6842 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
6843 * NEWS (2.3+): Update for these changes.
6844 * data/glr.c (b4_before_definitions): Update to...
6845 (b4_start_header): ... this.
6846 (b4_after_definitions): Update to...
6847 (b4_end_header): ... this.
6848 * data/glr.cc: Likewise.
6849 * data/lalr1.cc: Likewise.
6850 * data/yacc.c: Likewise.
6851 * doc/bison.texinfo (The prologue): Update names, and replace remaining
6852 prologue blocks with %*-header declarations.
6853 (Calc++ Parser): Likewise.
6854 (Decl Summary): Update names.
6855 (Table of Symbols): Update description.
6856 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
6857 (PERCENT_END_HEADER): ... this.
6858 (PERCENT_BEFORE_DEFINITIONS): Update to...
6859 (PERCENT_START_HEADER): ... this.
6860 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6861 (declaration): Update token names and m4 macro names.
6862 When parsing %end-header and %start-header, invoke translate_code
6863 before muscle_code_grow, and no longer set global booleans to remember
6864 whether these declarations have been seen.
6865 Parse new %after-header and %before-header.
6866 * src/reader.c (before_definitions, after_definitions): Remove.
6867 (prologue_augment): Accept a new bool argument to specify whether to
6868 augment the pre-prologue or post-prologue.
6869 * src/reader.h (before_definitions, after_definitions): Remove these
6870 extern's.
6871 (prologue_augment): Add new bool argument.
6872 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
6873 (PERCENT_END_HEADER): ... this.
6874 (PERCENT_BEFORE_DEFINITIONS): Update to...
6875 (PERCENT_START_HEADER): ... this.
6876 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6877 * tests/actions.at (Printers and Destructors): Update names.
6878
6879 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
6880
6881 Add comparison operators for C++ location classes. Discussed at
6882 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
6883 * data/c++.m4 (b4_define_location_comparison): New boolean %define
6884 declaration indicating whether filename_type has an operator==. If
6885 filename_type is `std::string', it defaults to `1', `0' otherwise.
6886 * data/location.cc: Iff b4_define_location_comparison is `1', add
6887 operator== and operator!= for class position and for class location.
6888
6889 Some minor fixes.
6890 * src/scan-action.l: Remove unused file.
6891 * src/symtab.c (symbol_printer_set): Use printer_location not
6892 destructor_location.
6893 * src/symtab.h (struct symbol): Replace incorrect source comment for
6894 printer members.
6895 * tests/input.at (Incompatible Aliases): Update output with correct
6896 printer location.
6897
6898 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
6899
6900 Don't put the pre-prologue in the header file. For the yacc.c code
6901 file and the glr.c header and code files, move the pre-prologue before
6902 the token definitions. Add new %before-definitions and
6903 %after-definitions to declare code that will go in both the header file
6904 and code file. Discussed at
6905 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
6906 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
6907 and
6908 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
6909 * NEWS (2.3+): Describe these changes.
6910 * data/glr.c (b4_pre_prologue): Move from within to before...
6911 (b4_shared_declarations): ... this.
6912 Add new b4_before_definitions before b4_token_enums.
6913 Add new b4_after_definitions at the end.
6914 * data/glr.cc (b4_pre_prologue): Replace with...
6915 (b4_before_definitions): ... this in the header file.
6916 (b4_after_definitions): New near the end of the header file.
6917 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
6918 code file right before including the header file.
6919 (b4_before_definitions): New in the previous position of
6920 b4_pre_prologue in the header file.
6921 (b4_after_definitions): New near the end of the header file.
6922 * data/yacc.c: Clean up some m4 quoting especially in the header file.
6923 (b4_token_enums_defines): In the code file, move to right before
6924 YYSTYPE for consistency with the header file.
6925 (b4_before_definitions): New right before b4_token_enums_defines in
6926 both the header and code file.
6927 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
6928 header and code file.
6929 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
6930 of prologues for %union dependencies.
6931 (Decl Summary): In %defines description, mention the effect of
6932 %before-definitions and %after-definitions on the header file.
6933 (Calc++ Parser): Forward declare driver in a %before-definitions rather
6934 than in the pre-prologue so that make check succeeds.
6935 (Table of Symbols): Add entries for %before-definitions and
6936 %after-definitions.
6937 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
6938 %before-definitions.
6939 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
6940 (declaration): Parse those declarations and append to
6941 b4_before_definitions and b4_after_definitions, respectively.
6942 * src/reader.c (before_definitions, after_definitions): New bools to
6943 track whether those declarations have been seen.
6944 (prologue_augment): Add to the post-prologue if %union,
6945 %before-definitions, or %after-definitions has been seen.
6946 * src/reader.h (before_definitions, after_definitions): New extern's.
6947 * src/scan-gram.l: Scan the new declarations.
6948 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
6949 prologue block in a %before-definitions or a %after-definitions based
6950 on whether the %union is declared.
6951 * tests/regression.at (Early token definitions with --yacc, Early token
6952 definitions without --yacc): Move tests for token definitions into the
6953 post-prologue since token names are no longer defined in the
6954 pre-prologue.
6955
6956 2006-06-20 Akim Demaille <akim@epita.fr>
6957
6958 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
6959 (symbol_get): Use it.
6960 * src/parse-gram.y: Use it.
6961
6962 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
6963
6964 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
6965 build succeeds when configured with --enable-gcc-warnings.
6966
6967 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
6968
6969 * src/parse-gram.y (char_name): New function.
6970 (CHAR, STRING, string_content): For %printer, properly escape.
6971 (ID): Prefer fputs to fprintf.
6972 (id): Reindent to be consistent with other rules.
6973 Properly quote char.
6974
6975 The Translation Project changed its way of publishing translations
6976 to maintainers. I haven't received any responses to my request
6977 for supporting the old way, or for documenting the new way. I
6978 have modified 'bootstrap' to use screen scraping
6979 (in this case, HTML scraping). This is unreliable and inelegant,
6980 but I don't see any better way. Yuck.
6981 * bootstrap (TP_URL, WGET_COMMAND): New vars.
6982 (get_translations): New function, which uses HTML scraping to
6983 deduce locations of latest translations.
6984 Use this function to grab both bison and bison-runtime .po files.
6985 Don't bother priming the pump for the runtime-po domain any more,
6986 as it's now translated better than bison is.
6987
6988 2006-06-19 Akim Demaille <akim@epita.fr>
6989
6990 * src/scan-gram.l: No longer "parse" things after `%union' until
6991 `{'. Rather, return a single "%union" token.
6992 No longer make symbols: return strings, and leave the conversion
6993 to symbols to the parser.
6994 (SC_PRE_CODE, token_type): Remove.
6995 * src/parse-gram.y (%union): New field `character'.
6996 Sort tokens.
6997 (CHAR): New token.
6998 (ID, ID_COLON): Now that the scanner no longer makes them
6999 identifiers, adjust all uses to invoke symbol_get.
7000 (id_colon): New, wraps the conversion from string to symbol.
7001 (%union): Accept a possible union_name.
7002 (symbol): Now can be a char.
7003 * data/c.m4 (b4_union_name): Leave a default value.
7004 * data/glr.c, data/yacc.c: Use it.
7005
7006 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7007
7008 For associating token numbers with token names for "yacc.c", don't use
7009 #define statements unless `--yacc' is specified; always use enum
7010 yytokentype. Most important discussions start at:
7011 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7012 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7013 and
7014 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7015 * NEWS (2.3+): Mention.
7016 * data/c.m4 (b4_yacc_if): New.
7017 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7018 token #define's.
7019 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7020 on token name definitions.
7021 * src/getargs.c (usage): Capitalize `Yacc' in English.
7022 * src/output.c (prepare): Define b4_yacc_flag.
7023 * tests/regression.at (Early token definitions): Test that tokens names
7024 are defined before the pre-prologue not just before the post-prologue.
7025 Remove this test case and copy to...
7026 (Early token definitions with --yacc): ... this to test #define's.
7027 (Early token definitions without --yacc): ... and this to test enums.
7028
7029 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7030
7031 * NEWS: Reword the post-2.3 change to not be so optimistic about
7032 removing the old "look-ahead" spelling.
7033 Update previous look-ahead/lookahead change reports.
7034 * REFERENCES: look-ahead -> lookahead (since that's
7035 what he actually wrote).
7036 * doc/refcard.tex: look ahead -> lookahead,
7037 look-ahead -> lookahead
7038
7039 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7040
7041 For consistency, use `lookahead' instead of `look-ahead' or
7042 `look_ahead'. Discussed starting at
7043 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7044 and then at
7045 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7046 * NEWS: For the next release, note the change to `--report'.
7047 * TODO, doc/bison.1: Update English.
7048 * doc/bison.texinfo: Update English.
7049 (Understanding Your Parser, Bison Options): Document as
7050 `--report=lookahead' rather than `--report=look-ahead'.
7051 * src/conflicts.c: Update English in comments.
7052 (lookahead_set): Rename from look_ahead_set.
7053 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7054 (resolve_sr_conflict): Rename local look_ahead_tokens to
7055 lookahead_tokens, and update other uses.
7056 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7057 count_rr_conflicts, conflicts_free): Update uses.
7058 * src/getargs.c (report_args): Move "lookahead" before alternate
7059 spellings.
7060 (report_types): Update uses.
7061 (usage): For `--report' usage description, state `lookahead' spelling
7062 rather than `look-ahead'.
7063 * src/getargs.h (report.report_lookahead_tokens): Rename from
7064 report_look_ahead_tokens.
7065 * src/lalr.c: Update English in comments.
7066 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7067 (state_lookahead_tokens_count): Rename from
7068 state_look_ahead_tokens_count.
7069 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7070 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7071 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7072 Update other uses.
7073 Update English in output.
7074 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7075 * src/print.c: Update English in comments.
7076 (lookahead_set): Rename from look_ahead_set.
7077 (print_reduction): Rename argument lookahead_token from
7078 look_ahead_token.
7079 (print_core, state_default_rule, print_reductions, print_results):
7080 Update uses.
7081 * src/print_graph.c: Update English in comments.
7082 (print_core): Update uses.
7083 * src/state.c: Update English in comments.
7084 (reductions_new): Update uses.
7085 (state_rule_lookahead_tokens_print): Rename from
7086 state_rule_look_ahead_tokens_print, and update other uses.
7087 * src/state.h: Update English in comments.
7088 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7089 (state_rule_lookahead_tokens_print): Rename from
7090 state_rule_look_ahead_tokens_print.
7091 * src/tables.c: Update English in comments.
7092 (conflict_row, action_row): Update uses.
7093 * tests/glr-regression.at
7094 (Incorrect lookahead during deterministic GLR,
7095 Incorrect lookahead during nondeterministic GLR): Rename
7096 print_look_ahead to print_lookahead.
7097 * tests/torture.at: Update English in comments.
7098 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7099 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7100 (Many lookahead tokens): Update uses.
7101 * data/glr.c: Update English in comments.
7102 * lalr1.cc: Likewise.
7103 * yacc.c: Likewise.
7104 * src/conflicts.h: Likewise.
7105 * src/lalr.h: Likewise.
7106 * src/main.c: Likewise.
7107 * src/output.c: Likewise.
7108 * src/parse-gram.c: Likewise.
7109 * src/tables.h: Likewise.
7110 * tests/calc.at: Likewise.
7111
7112 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7113
7114 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7115
7116 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7117
7118 * TODO: Add request from Nelson H. F. Beebe to be able to install
7119 Bison without installing the yacc script.
7120
7121 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7122
7123 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7124 and yytext if they're already #define'd.
7125 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7126 * src/scan-code-c.c: ... here.
7127 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7128 <config.h>.
7129
7130 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7131
7132 Get Bison to build again when configured with --enable-gcc-warnings.
7133 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7134 missing #include's.
7135 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7136 loc argument as it shadows a global.
7137 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7138 invocation.
7139
7140 * src/.cvsignore: Add scan-code.c.
7141
7142 2006-06-07 Akim Demaille <akim@epita.fr>
7143
7144 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7145 to...
7146 * src/scan-code.l: here.
7147 * tests/input.at (Torturing the Scanner): Fix another location
7148 error.
7149
7150 2006-06-07 Akim Demaille <akim@epita.fr>
7151
7152 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7153
7154 2006-06-06 Akim Demaille <akim@epita.fr>
7155
7156 Extract the parsing of user actions from the grammar scanner.
7157 As a consequence, the relation between the grammar scanner and
7158 parser is much simpler. We can also split "composite tokens" back
7159 into simple tokens.
7160 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
7161 * src/scan-gram.l (add_column_width, adjust_location): Move to and
7162 rename as...
7163 * src/location.h, src/location.c (add_column_width)
7164 (location_compute): these.
7165 Fix the column count: the initial column is 0.
7166 (location_print): Be robust to ending column being 0.
7167 * src/location.h (boundary_set): New.
7168 * src/main.c: Adjust to scanner_free being renamed as
7169 gram_scanner_free.
7170 * src/output.c: Include scan-code.h.
7171 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
7172 Use boundary_set.
7173 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
7174 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
7175 which is now, again, a separate token.
7176 Adjust all dependencies.
7177 Whereever actions with $ and @ are used, use translate_code.
7178 (action): Remove this nonterminal which is now useless.
7179 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
7180 (grammar_current_rule_action_append): Use translate_code.
7181 (packgram): Bound check ruleno, itemno, and rule_length.
7182 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
7183 (last_string, last_braced_code_loc, max_left_semantic_context)
7184 (scanner_initialize, scanner_free, scanner_last_string_free)
7185 (gram_out, gram_lineno, YY_DECL_): Move to...
7186 * src/scan-gram.h: this new file.
7187 (YY_DECL): Rename as...
7188 (GRAM_DECL): this.
7189 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
7190 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7191 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7192 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7193 Move these declarations, and...
7194 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
7195 these to...
7196 * src/flex-scanner.h: this new file.
7197 * src/scan-gram.l (rule_length, rule_length_overflow)
7198 (increment_rule_length): Remove.
7199 (last_braced_code_loc): Rename as...
7200 (gram_last_braced_code_loc): this.
7201 Adjust to the changes of the parser.
7202 Move all the handling of $ and @ into...
7203 * src/scan-code.l: here.
7204 * src/scan-gram.l (handle_dollar, handle_at): Remove.
7205 (handle_action_dollar, handle_action_at): Move to...
7206 * src/scan-code.l: here.
7207 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
7208 scan-code.h, scan-code-c.c, scan-gram.h.
7209 (EXTRA_bison_SOURCES): Add scan-code.l.
7210 (BUILT_SOURCES): Add scan-code.c.
7211 (yacc): Be robust to white spaces.
7212
7213 * tests/conflicts.at, tests/input.at, tests/reduce.at,
7214 * tests/regression.at: Adjust the column numbers.
7215 * tests/regression.at: Adjust the error message.
7216
7217 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7218
7219 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7220 Use Akim's wording from
7221 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
7222
7223 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7224
7225 Between Bison releases, manually append `+' to the previous Bison
7226 release number, and use that as a signal to automatically print the
7227 ChangeLog's CVS Id keyword from --version. Discussed starting at
7228 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
7229 * ChangeLog: Add Id header.
7230 * configure.ac (AC_INIT): Append `+' to `2.3'.
7231 * src/.cvsignore: Add revision.c.
7232 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
7233 (BUILT_SOURCES): Add revision.c.
7234 (revision.c): New target rule. This file defines a new global variable
7235 named revision. It initializes it with either the Id from ChangeLog
7236 or, if VERSION doesn't contain `+', with the empty string.
7237 * src/getargs.c (version): Print the value of revision.
7238 * src/revision.h: Extern revision.
7239
7240 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
7241
7242 * NEWS: Version 2.3.
7243 * configure.ac (AC_INIT): Likewise.
7244
7245 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
7246
7247 * data/glr.c (YYRECOVERING): Define to be a function-like macro
7248 with no arguments, not as an object-like macro. This is for
7249 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
7250 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
7251 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
7252 Document this.
7253
7254 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
7255
7256 * src/getargs.c (usage): Back out yesterday's modification of the
7257 --help output so that we don't have to wait for translation before
7258 releasing 2.3.
7259
7260 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
7261
7262 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
7263 Problem reported by Akim Demaille.
7264
7265 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
7266
7267 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7268
7269 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
7270
7271 * data/yacc.c (yy_reduce_print): Omit trailing white space in
7272 generated source code. Problem reported by Frans Englich in
7273 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
7274
7275 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
7276
7277 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
7278 shell, not within 'make', so that 'make' by an ordinary builder
7279 (using GNU make) does not worry about configuring gzip. This also
7280 works around a bug reported independently by Keith Thompson and by
7281 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
7282 stderr rather than stdout, messing up the build logs.
7283
7284 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7285
7286 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
7287 to make sure that YYID will never be unused. This fixes a 'make
7288 maintainer-check' failure caused by the recent changes to the 'Trivial
7289 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
7290 not used.
7291 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
7292
7293 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7294
7295 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
7296 state before an empty RHS is always resolved here. Only the location
7297 of that state is guaranteed to be resolved, and that's enough. This
7298 fixes the remaining bug reported by Derek M. Jones in
7299 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7300 * tests/glr-regression.at (Uninitialized location when reporting
7301 ambiguity): Test the above case.
7302 Also, the embedded comments in this test case claim it checks the case
7303 of an empty RHS that has inherited the initial location. However, the
7304 corresponding LHS was already resolved, so yyresolveLocations didn't
7305 actually have reason to modify it. Fix this by forcing
7306 nondeterministic operation at the beginning of the parse.
7307
7308 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
7309
7310 * data/c.m4 (b4_yy_symbol_print_generate):
7311 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
7312 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
7313 of the bugs reported today by Derek M Jones in
7314 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7315 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
7316 defined to be a type name without parens or brackets.
7317 (Location Type): Similarly for YYLTYPE.
7318 * tests/regression.at (Trivial grammars): Put in a test for this
7319 bug that will be caught by 'make maintainer-check' (though not,
7320 alas, by 'make check' unless your compiler is picky).
7321
7322 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
7323
7324 * NEWS: Version 2.2.
7325 * configure.ac (AC_INIT): Likewise.
7326
7327 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
7328
7329 * data/glr.c (yyreportTree): Make room in yystates for the state
7330 preceding the RHS. This fixes the segmentation fault reported by Derek
7331 M. Jones in
7332 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
7333 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
7334 to the user. Reported for yyreportTree by Derek M. Jones later in the
7335 same thread.
7336 * THANKS: Add Derek M. Jones.
7337 Update my email address.
7338 Fix typo in Steve Murphy's name.
7339
7340 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
7341
7342 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
7343 checking against YYLAST that caused the parser to miss a potential
7344 alternative in its diagnostic.
7345 Problem reported by Maria Jose Moron Fernandez in
7346 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
7347 * data/lalr1.cc (yysyntax_error_): Likewise.
7348 * data/yacc.c (yysyntax_error): Likewise.
7349 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
7350 tokens, in case we run into an older C compiler.
7351 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
7352 Use them to check for the off-by-one error fixed above.
7353
7354 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
7355 YYSIZE_T, not size_t.
7356 * tests/regression.at (Trivial grammars): New test, to catch
7357 the error fixed by the above patch.
7358
7359 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7360
7361 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
7362 scheme.
7363 Reported by Steve Murphy.
7364
7365 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7366
7367 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
7368 * data/glr.cc: b4_location_flag is now b4_locations_flag.
7369
7370 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7371
7372 Implement --trace=m4.
7373 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
7374 * src/output.c (output_skeleton): When set, pass -dV to m4.
7375
7376 Factor the handling of flags in m4.
7377 * src/output.c (prepare): Rename the muscle names debug, defines,
7378 error_verbose to debug_flag, defines_flag, error_verbose_flag.
7379 * data/c.m4: Adjust.
7380 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
7381 Use b4_define_flag_if to define other b4_FLAG_if macros.
7382 (b4_location_if): As a consequence, rename as...
7383 (b4_locations_if): this, for consistency.
7384 Adjust all the skeletons.
7385
7386 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7387
7388 * etc/bench.pm: Shorten bench names.
7389
7390 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
7391
7392 * src/output.h, src/output.c (error_verbose): Move to...
7393 * src/getargs.h, src/getargs.c: here.
7394 Sort the flags.
7395 Adjust dependencies.
7396
7397 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
7398
7399 * data/c.m4 (b4_copyright): Put the special exception for Bison
7400 skeletons here, so we don't have to put it in each skeleton. All
7401 uses changed. Suggested by Akim Demaille. Also, wrap the
7402 copyright notice, in case it is longer than 80 columns. Replace
7403 comma by newline after title.
7404
7405 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
7406
7407 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
7408 incompatibility, not a bug. Mention that it wasn't fixed as of
7409 flex 2.5.33.
7410
7411 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7412
7413 * examples/extexi: Enforce the precedence of concatenation over
7414 >>.
7415 Reported by Tommy Nordgren.
7416
7417 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
7418
7419 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
7420 with the member "token".
7421 Reported by Martin Nylin.
7422
7423 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
7424
7425 * data/glr.c: Switch to Bison 2.2 special-exception language in
7426 the copyright notice. Use more-regular format for titles and
7427 copyright notices.
7428 * data/glr.cc: Likewise.
7429 * data/location.cc: Likewise.
7430 * data/yacc.cc: Likewise.
7431 * doc/bison.texinfo (Conditions): Document this.
7432 * NEWS: likewise. Upgrade version to 2.2.
7433
7434 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
7435
7436 * data/glr.cc: Remove dead code.
7437
7438 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
7439
7440 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
7441 that variable and the line breaks the bootstrap. Problem reported
7442 by Juan M. Guerrero.
7443
7444 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7445
7446 * doc/bison.texinfo (Multiple start-symbols): New.
7447
7448 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
7449
7450 * etc/README, etc/bench.pl: New.
7451
7452 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
7453
7454 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
7455 rule.
7456 Reported by Mickael Labau.
7457 * tests/input.at (Torturing the Scanner): Test it.
7458
7459 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
7460
7461 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
7462 Problem reported by Bob Rossi.
7463
7464 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
7465
7466 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
7467 and didn't really work.
7468 For the index, use @ifnotinfo, not @iftex.
7469 Minor cleanups of spacing and terminology.
7470
7471 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
7472
7473 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
7474 of AT_NAME_PREFIX when %name-prefix is not used.
7475
7476 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
7477
7478 Apply --prefix to C++ skeletons too: they change the namespace.
7479 The test suite already exercize these cases.
7480 * data/c++.m4 (b4_namespace): New.
7481 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
7482 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
7483 * data/yacc.c, data/glr.c: Remove a useless `[]'.
7484 * doc/bison.texinfo: Document it.
7485 (Option Cross Key): Use @multitable in all formats. It looks
7486 nicer, even in TeX outputs.
7487 (Rules): Use the same code whatever the output type is.
7488 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
7489 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
7490 * tests/calc.at: Use it, instead of hard coding `yy'.
7491
7492 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7493
7494 * TODO: Remove dead items.
7495
7496 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7497
7498 * doc/FAQ: Remove, merged into...
7499 * doc/bison.texinfo (FAQ): this.
7500 * doc/Makefile.am (EXTRA_DIST): Adjust.
7501
7502 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
7503
7504 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
7505 even if empty.
7506 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
7507 * doc/bison.texinfo (Calc++ Scanner): Use it.
7508
7509 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
7510
7511 Fix two nits reported by twlevo, plus one more that I discovered.
7512
7513 * src/assoc.h (assoc_to_string): Give a name to the arg, as
7514 this is the usual Bison style.
7515 * src/location.h (location_print): Likewise.
7516
7517 * src/reader.h (token_name): Likewise.
7518
7519 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
7520
7521 Fix some nits reported by twlevo.
7522 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
7523 and "POSIX". Use more-modern syntax for URLs. Mention C++
7524 and ask for Java. Don't hardwire OS version numbers. Add
7525 copyright notice.
7526 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
7527 * src/conflicts.c (solved_conflicts_obstack): Now static.
7528
7529 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
7530
7531 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
7532 page. Say "you can use it" not "you may use it" as on the web page;
7533 we're describing capabilities not granting permission.
7534
7535 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
7536
7537 * data/glr.c (yyresolveLocations): Rename local variables to avoid
7538 shadowing warnings. Use usual patter for iterating through RHS.
7539 * tests/glr-regression.at
7540 (Uninitialized location when reporting ambiguity):
7541 Modify yylex so that it uses its argument, rather than trying
7542 to rely on ARGSUSED (which doesn't work for gcc with warnings).
7543 const char -> char const.
7544
7545 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
7546 Don't use tabs inside commands; it messes up 'ps'.
7547 Problem reported by twlevo.
7548
7549 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
7550
7551 * tests/glr-regression.at (Uninitialized location when reporting
7552 ambiguity): New test case.
7553 * data/glr.c (yyresolveLocations): New function, which uses
7554 YYLLOC_DEFAULT.
7555 (yyresolveValue): Invoke yyresolveLocations before reporting an
7556 ambiguity.
7557 * doc/bison.texinfo (Default Action for Locations): Note
7558 YYLLOC_DEFAULT's usage for ambiguity locations.
7559 (GLR Semantic Actions): Cross-reference those notes.
7560
7561 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
7562
7563 * tests/glr-regression.at (Leaked semantic values when reporting
7564 ambiguity): Remove unnecessary union and type declarations.
7565 (Leaked lookahead after nondeterministic parse syntax error): New test
7566 case.
7567 * data/glr.c (yyparse): Check for zero stacks remaining before
7568 attempting to shift the lookahead so that you don't lose it.
7569
7570 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7571
7572 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
7573 * tests/glr-regression.at (Leaked semantic values when reporting
7574 ambiguity): New test case.
7575 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
7576 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
7577 now unnecessary yystackp parameter.
7578 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
7579 destructors can be called.
7580
7581 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
7582 in existing testcases.
7583
7584 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7585
7586 Don't leak semantic values for parent RHS when a user action cuts the
7587 parser, and clean up related code a bit.
7588 * tests/glr-regression.at (Leaked merged semantic value if user action
7589 cuts parse): Rename to...
7590 (Leaked semantic values if user action cuts parse): ... this. Add check
7591 for leaked parent RHS values.
7592 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
7593 between an unresolved state (non-empty chain of semantic options) and
7594 an incomplete one (signaled by an empty chain).
7595 (yyresolveStates): Document the interface. Move all manipulation of a
7596 successfully or unsuccessfully resolved yyGLRState to...
7597 (yyresolveValue): ... here so that yyresolveValue always leaves a
7598 yyGLRState with consistent data and thus is easier to understand.
7599 Remove the yyvalp and yylocp parameters since they are always just
7600 taken from the yys parameter. When reporting a discarded merged value
7601 in debugging output, note that it is incompletely merged. Document the
7602 interface.
7603 (yyresolveAction): If resolving any of the RHS states fails, destroy
7604 them all rather than leaking them. Thus, as long as user actions are
7605 written to clean up the RHS correctly, yyresolveAction always cleans up
7606 the RHS of a semantic option. Document the interface.
7607
7608 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
7609
7610 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
7611 led to a segmentation fault in GNU Pascal. Problem reported
7612 by Waldek Hebisch.
7613
7614 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
7615
7616 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
7617 mid-rule action inside a nonterminal symbol in order to declare a
7618 destructor for its semantic value.
7619
7620 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
7621
7622 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
7623 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
7624 __cplusplus && ! defined _STDLIB_H && !
7625 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
7626 defined free))]: Include <stdlib.h> rather than rolling our own
7627 declarations of malloc and free, to avoid problems with
7628 incompatible declarations (using 'throw') C++'s stdlib.h. This
7629 should fix Debian bug 340012
7630 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
7631 reported by Guillaume Melquiond.
7632
7633 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7634
7635 * NEWS: Clarify symbols versus types in unused-value warnings.
7636
7637 * configure.ac (AC_INIT): Bump version number.
7638
7639 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7640
7641 * NEWS: Version 2.1a.
7642 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
7643 since C99 requires this.
7644
7645 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
7646
7647 * m4/c-working.m4: New file.
7648 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
7649
7650 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
7651
7652 * Makefile.maint: Merge from coreutils.
7653
7654 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
7655
7656 More portability fixes for problems summarized by Nelson H. F. Beebe.
7657
7658 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
7659 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
7660 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
7661 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
7662 messes up because C++ code is compiled in 32-bit mode but linked
7663 in 64-bit mode.
7664
7665 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
7666
7667 More portability fixes for problems summarized by Nelson H. F. Beebe.
7668
7669 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
7670 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
7671
7672 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
7673 nodist_PROGRAMS, since we don't need to actually compile the
7674 example if we're just doing a plain 'make'. This avoids bothering
7675 the installer unnecessarily about problems due to weird C++
7676 compilers.
7677
7678 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
7679
7680 More portability fixes for problems summarized by Nelson H. F. Beebe.
7681
7682 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
7683 than #include "...", and compile with -I'.'. The old method was
7684 not portable, according to Posix and the C standard, and it does
7685 not work with Sun C 5.7, where previous #line directives affect
7686 the working directory used in later #include "..." directives.
7687
7688 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7689
7690 Various DJGGP specific issues in /djgpp
7691
7692 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
7693
7694 More portability fixes for problems summarized by Nelson H. F. Beebe.
7695
7696 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
7697 '#include <map>' works and that you can apply ++ to iterators.
7698
7699 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
7700
7701 Work around portability problems summarized by Nelson H. F. Beebe in
7702 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
7703
7704 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7705 that '#include <string>' works.
7706
7707 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
7708 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
7709 "warning: sorry: semantics of inline function static data `const
7710 unsigned char translate_table[262]' are wrong (you'll wind up with
7711 multiple copies)".
7712
7713 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
7714 or, xor to not_, and_, or_, and xor_, respectively. This works
7715 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
7716 random system header somewhere that includes the equivalent of
7717 <iso646.h>.
7718
7719 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
7720 -E" works; it apparently doesn't work with PathScale EKO Compiler
7721 Suite Version 2.0.
7722
7723 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
7724
7725 During deterministic GLR operation, user actions should be able to
7726 influence the parse by changing yychar. To make this easier to fix and
7727 to make glr.c easier to evolve in general, don't maintain yytoken in
7728 parallel with yychar; just compute yytoken when needed.
7729 * tests/glr-regression.at (Incorrect lookahead during deterministic
7730 GLR): Check that setting yychar in a user action has the intended
7731 effect.
7732 * data/glr.c (yyGLRStack): Remove yytokenp member.
7733 (yyclearin): Don't set *yytokenp.
7734 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
7735 yychar rather than *yytokenp to determine the current lookahead.
7736 Compute yytoken locally when needed.
7737 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
7738 point to.
7739
7740 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
7741 after `--report' documentation.
7742
7743 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
7744
7745 * src/parse-gram.y (grammar_declaration): Location of printer
7746 symbol is @1, not list->location. Bug reported by twlevo.
7747 * tests/input.at (Incompatible Aliases): Adjust to above change.
7748
7749 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
7750
7751 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
7752 all the test at once. This makes the output easier to read in the
7753 normal case.
7754
7755 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
7756 got from <http://bro-ids.org/download.html>. The bug is that
7757 when two actions appeared in succession, the second one was
7758 scanned before the first one was added to the grammar rule
7759 as a midrule action. Bison then output the incorrect warning
7760 "parse.y:905.17-906.36: warning: unused value: $3".
7761 * src/parse-gram.y (BRACED_CODE, action): These are no longer
7762 associated with a value.
7763 (rhs): Don't invoke grammar_current_rule_action_append.
7764 (action): Invoke it here instead.
7765 * src/reader.c (grammar_midrule_action): Now extern.
7766 (grammar_current_rule_action_append): Don't invoke
7767 grammar_midrule_action; that is now the scanner's job.
7768 * src/reader.h (last_string, last_braced_code_loc):
7769 (grammar_midrule_action): New decls.
7770 * src/scan-gram.l (last_string): Now extern, sigh.
7771 (last_braced_code_loc): New extern variable.
7772 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
7773 rule already has an action.
7774 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
7775 * tests/input.at (AT_CHECK_UNUSED_VALUES):
7776 Add some tests to check that the above changes fixed the bug.
7777
7778 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
7779
7780 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
7781 All used changed. Check whether the symbol has a destructor,
7782 not whether it is typed.
7783 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
7784 that the values are still reported as unused. All line numbers
7785 adjusted.
7786
7787 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
7788
7789 Work around a bug in bro 0.8, which underparenthesizes its
7790 definition of YYLLOC_DEFAULT.
7791 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
7792 their arguments.
7793 * data/lalr1.cc: Likewise.
7794 * data/yacc.cc: Likewise.
7795
7796 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
7797
7798 Work around a bug in Pike 7.0, and give the Pike folks a
7799 better way to override the usual int widths.
7800 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
7801 user can override the types.
7802 (short): #undef, to work around a bug in Pike 7.0.
7803 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
7804 (union yyalloc.yyss): Use yytype_int16 rather than short.
7805 All uses changed.
7806 (yysigned_char): Remove.
7807 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
7808 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
7809 * tests/regression.at (Web2c Actions): Adjust to above changes.
7810
7811 * src/reader.c (check_and_convert_grammar): New function.
7812 (reader): Close the input file even if something went wrong during
7813 parsing. Minor file descriptor leak reported by twlevo.
7814
7815 * src/assoc.c (assoc_to_string): Use a default: abort (); case
7816 to pacify gcc -Wswitch-default.
7817 * src/scan-gram.l (adjust_location): Use a default: break; case
7818 to pacify gcc -Wswitch-default.
7819 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
7820 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7821 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7822 Move these decls to scan-skel.l, since they don't need to be
7823 visible elsewhere.
7824 * src/scan-skel.l: Accept the above decls.
7825 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
7826 is used.
7827
7828 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
7829
7830 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7831 since we don't want to insist on a version number at the start
7832 of the changelog every time.
7833 * Makefile.maint: Sync from coreutils a bit better.
7834 (sc_trailing_blank): Renamed from sc_trailing_space.
7835 All uses changed.
7836 (sc_no_if_have_config_h, sc_require_config_h):
7837 (sc_prohibit_assert_without_use): New rules.
7838 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
7839 (sc_dd_max_sym_length): Fix leading spaces in rule.
7840 (sc_system_h_headers): Prefix with @.
7841 (sc_useless_cpp_parens, m4-check): Output line numbers.
7842 (changelog-check): Allow version only in head.
7843 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
7844 satisfy new Makefile.maint rule.
7845 * data/glr.c: Likewise.
7846 * data/glr.cc: Likewise.
7847 * data/lalr1.cc: Likewise.
7848 * data/yacc.c: Likewise.
7849 * lib/ebitsetv.c: Likewise.
7850 * lib/lbitset.c: Likewise.
7851 * lib/subpipe.c: Likewise.
7852 * lib/timevar.c: Likewise.
7853 * src/system.h: Likewise.
7854 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
7855 * djgpp/Makefile.maint: Add copyright notice.
7856 * djgpp/README.in: Likewise.
7857 * djgpp/config.bat: Likewise.
7858 * djgpp/config.site: Likewise.
7859 * djgpp/config_h.sed: Likewise.
7860 * djgpp/djunpack.bat: Likewise.
7861 * djgpp/config.sed: Fix copyright notice to match standard format.
7862 * djgpp/subpipe.h: Likewise.
7863 * lib/bitsetv-print.c: Likewise.
7864 * lib/bitsetv.c: Likewise.
7865 * lib/subpipe.h: Likewise.
7866 * lib/timevar.c: Likewise.
7867 * lib/timevar.h: Likewise.
7868 * djgpp/subpipe.c: Use standard recipe for config.h.
7869 * lib/abitset.c: Likewise.
7870 * lib/bitset.c: Likewise.
7871 * lib/bitset_stats.c: Likewise.
7872 * lib/bitsetv-print.c: Likewise.
7873 * lib/bitsetv.c: Likewise.
7874 * lib/ebitsetv.c: Likewise.
7875 * lib/get-errno.c: Likewise.
7876 * lib/lbitset.c: Likewise.
7877 * lib/subpipe.c: Likewise.
7878 * lib/timevar.c: Likewise.
7879 * lib/vbitset.c: Likewise.
7880 * tests/local.at: Likewise.
7881 * src/scan-gram.l: Don't include verify.h, since system.h does
7882 that for us.
7883 * .x-sc_require_config_h: New file.
7884 * .x-sc_unmarked_diagnostics: New file.
7885
7886 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
7887
7888 Be a bit more systematic about using 'abort'.
7889 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
7890 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
7891 Put 'default: abort ();' before some other case, to satisfy older
7892 pedantic compilers.
7893 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7894 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
7895 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
7896 * src/conflicts.c (resolve_sr_conflict): Likewise.
7897 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
7898 (get_decision_str, get_orientation_str, get_node_alignment_str):
7899 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
7900 (get_linestyle_str, get_arrowstyle_str): Likewise.
7901 * src/conflicts.c (resolve_sr_conflict):
7902 Use a default case rather than one for the one remaining enum
7903 value, to catch invalid enum values as well.
7904 * src/lalr.c (set_goto_map, map_goto):
7905 Prefer "assert (FOO);" to "if (!FOO) abort ();".
7906 * src/nullable.c (nullable_compute, token_definitions_output):
7907 Likewise.
7908 * src/reader.c (packgram, reader): Likewise.
7909 * src/state.c (transitions_to, state_new, state_reduction_find):
7910 Likewise.
7911 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
7912 (symbol_pack): Likewise.
7913 * src/tables.c (conflict_row, pack_vector): Likewise.
7914 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
7915 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
7916 * src/system.h: Don't include <assert.h>.
7917 (assert): New macro.
7918
7919 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
7920 (Destructor Decl, Parser Function, Pure Calling):
7921 Describe rules for braces inside C code more carefully.
7922
7923 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
7924
7925 Fix some porting glitches found by Nelson H. F. Beebe.
7926 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
7927 compilers that don't understand that abort () does not return.
7928 * src/state.c (transitions_to): Likewise.
7929 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7930 that '#include <cstdlib>' works.
7931 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
7932 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
7933 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
7934 for the benefit of some pre-C99 compilers.
7935
7936 * bootstrap: Undo changes to gnulib files that autoreconf made.
7937
7938 Minor fixups to get 'make maintainer-check' to work.
7939 * configure.ac: Don't use -Wnested-externs, as it's incompatible
7940 with the new verify.h implementation.
7941 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
7942 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
7943 * data/yacc.c (YYUSE): Likewise.
7944 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
7945 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
7946 * src/parse-gram.y (declaration): Don't pass a string constant
7947 to a function that expects char *, since GCC might complain
7948 about the constant value.
7949 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
7950 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
7951 before #defining them.
7952 * tests/glr-regression.at
7953 (Incorrectly initialized location for empty right-hand side in GLR):
7954 In yyerror, use the msg arg.
7955 (Corrupted semantic options if user action cuts parse):
7956 (Incorrect lookahead during deterministic GLR):
7957 (Incorrect lookahead during nondeterministic GLR):
7958 Don't name a local var 'index'; it shadows string.h's 'index'.
7959
7960 2006-01-19 Akim Demaille <akim@epita.fr>
7961
7962 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
7963 location, not just parts of it.
7964
7965 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
7966
7967 * NEWS: Document the fact that multiple %unions are now allowed.
7968 * doc/bison.texinfo (Union Decl): Likewise.
7969 * TODO: This feature is now implemented, so remove it from
7970 the wishlist.
7971
7972 * Makefile.maint: Merge with coreutils Makefile.maint.
7973 (CVS_LIST): Use build-aux version if available.
7974 (VERSION_REGEXP): New macro.
7975 (syntax-check-rules): Add sc_no_if_have_config_h,
7976 sc_prohibit_assert_without_use, sc_require_config_h,
7977 sc_useless_cpp_parens.
7978 (sc_obsolete_symbols): Check for O_NDELAY.
7979 (sc_dd_max_sym_length): Track coreutils.
7980 (sc_unmarked_diagnostics): Look in all files, not just *.c.
7981 (sc_useless_cpp_parens): New rule.
7982 (news-date-check): Look for version or today's date.
7983 (changelog-check): Don't require version number near head.
7984 (copyright-check): Use current year instead of hardwiring 2005.
7985 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
7986 (announcement): Add --gpg-key-ID.
7987
7988 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
7989 with "file system".
7990
7991 Avoid undefined behavior that addressed just before the start of an
7992 array. Problem reported by twlevo.
7993 * src/reader.c (packgram): Prepend a new sentinel before ritem.
7994 * src/lalr.c (build_relations): Rely on new sentinel.
7995 * src/gram.c (gram_free): Adjust to new sentinel.
7996
7997 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7998
7999 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8000 yylookaheadNeeds. All uses updated.
8001 (yysplitStack): Rename local yynewLookaheadStatuses to
8002 yynewLookaheadNeeds.
8003 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8004 GLR): In comments, change `lookahead status' to `lookahead need'.
8005
8006 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8007
8008 * data/glr.c (yysplitStack): A little stylistic rewrite.
8009
8010 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8011
8012 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8013
8014 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8015
8016 * doc/bison.texinfo: Fix some typos.
8017 (GLR Semantic Actions): New subsection discussing special
8018 considerations because GLR semantic actions might be deferred.
8019 (Actions): Mention look-ahead usage of yylval.
8020 (Actions and Locations): Mention look-ahead usage of yylloc.
8021 (Special Features for Use in Actions): Add YYEOF entry and mention it
8022 in the yychar entry.
8023 In the yychar entry, remove mention of the local yychar case (pure
8024 parser) since this is irrelevant information when writing semantic
8025 actions and since it's already discussed in `Table of Symbols' where
8026 yychar is otherwise described as an external variable.
8027 In the yychar entry, don't call it the `current' look-ahead since it
8028 isn't when semantic actions are deferred.
8029 In the yychar and yyclearin entries, add note about deferred semantic
8030 actions.
8031 Add yylloc and yylval entries discussing look-ahead usage.
8032 (Look-Ahead Tokens): When discussing yychar, don't call it the
8033 `current' look-ahead, and do mention yylval and yylloc.
8034 (Error Recovery): Cross-reference `Action Features' when mentioning
8035 yyclearin.
8036 (Table of Symbols): In the yychar entry, don't call it the `current'
8037 look-ahead.
8038 In the yylloc and yylval entries, mention look-ahead usage.
8039
8040 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
8041
8042 * tests/glr-regression.at: Update copyright year to 2006.
8043
8044 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8045
8046 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8047 use during nondeterministic operation to track which stacks have
8048 actually needed the current lookahead.
8049 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8050 Allocate, deallocate, resize, and otherwise shuffle space for
8051 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8052 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8053 appropriately during nondeterministic operation.
8054 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8055 members to store the current lookahead to be used by the deferred
8056 user action.
8057 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8058 from which the RHS is taken. Set the lookahead members of the new
8059 yySemanticOption according to the lookahead status for stack yyk.
8060 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8061 yyaddDeferredAction.
8062 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8063 members of yySemanticOption before invoking yyuserAction, and then set
8064 them back to their current values afterward.
8065 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8066 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8067 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8068 titles for consistency.
8069 (Leaked merged semantic value if user action cuts parse): In order to
8070 suppress lint warnings, use arguments in merge function, and assign
8071 char value < 128 in main.
8072 (Incorrect lookahead during deterministic GLR): New test case.
8073 (Incorrect lookahead during nondeterministic GLR): New test case.
8074
8075 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8076
8077 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
8078 !yyvaluep as signal that no semantic value is available to print.
8079 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8080 to print a semantic value.
8081
8082 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8083
8084 * tests/glr-regression.at: For consistency with my newer test cases,
8085 don't thank myself.
8086
8087 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8088
8089 * data/glr.c (yyresolveValue): When merging semantic options, if at
8090 least one user action succeeds but a later one cuts the parse, then
8091 destroy the semantic value before returning rather than leaking it.
8092 (yyresolveStates): If a user action cuts the parse and thus
8093 yyresolveValue fails, ignore the (unset) semantic value rather than
8094 corrupting the yyGLRState, and empty the semantic options list since
8095 the user actions should have called all necessary destructors.
8096 Simplify code with YYCHK.
8097 * tests/glr-regression.at (Corrupted semantic options if user action
8098 cuts parse): New test case.
8099 (Undesirable destructors if user action cuts parse): New test case.
8100 Before applying any of this patch, this test case never actually failed
8101 for me... but only because the corrupted semantic options usually
8102 masked this bug.
8103 (Leaked merged semantic value if user action cuts parse): New test
8104 case.
8105
8106 2006-01-05 Akim Demaille <akim@epita.fr>
8107
8108 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8109
8110 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8111
8112 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8113 _MSC_VER. Problem reported by Cenzato Marco.
8114 (b4_c_function_def): Use it.
8115 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8116 b4_c_modern.
8117 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8118 than rolling our own.
8119
8120 2006-01-04 Akim Demaille <akim@epita.fr>
8121
8122 Also warn about non-used mid-rule values.
8123 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8124 member.
8125 (symbol_list_new): Adjust.
8126 * src/reader.c (symbol_typed_p): New.
8127 (grammar_rule_check): Use it.
8128 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8129 Check its rule.
8130 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8131 Use it.
8132 * tests/actions.at (Exotic Dollars): Adjust.
8133
8134 2006-01-04 Akim Demaille <akim@epita.fr>
8135
8136 * src/reader.c (grammar_midrule_action): If $$ is set in a
8137 mid-rule, move the `used' bit to its lhs.
8138 * tests/input.at (Unused values): New.
8139 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8140
8141 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8142
8143 * doc/bison.texinfo (Bison Options): Say more accurately what
8144 --yacc does.
8145 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8146 about declarations in the grammar when in Yacc mode, as POSIX does
8147 not require a diagnostic when the grammar uses extensions.
8148
8149 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
8150
8151 Warn about dubious constructions like "%token T T".
8152 Reported by twlevo.
8153 * src/symtab.h (struct symbol.declared): New member.
8154 * src/symtab.c (symbol_new): Initialize it to false.
8155 (symbol_class_set): New arg DECLARING, specifying whether
8156 this is a declaration that we want to warn about, if there
8157 is more than one of them. All uses changed.
8158
8159 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
8160 Allow multiple %union directives, whose contents concatenate.
8161 * src/parse-gram.y (grammar_declaration): Likewise.
8162 Use muscle_code_grow, so that we don't need stype_line any more.
8163 All uses changed.
8164
8165 * src/muscle_tab.c (muscle_grow): Fix comment.
8166
8167 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
8168 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
8169 Update copyright year to 2006.
8170
8171 2006-01-03 Akim Demaille <akim@epita.fr>
8172
8173 Have glr.cc pass (some of) the calc.at tests.
8174 * data/glr.cc (b4_parse_param_orig): New.
8175 (b4_parse_param): Improve its definition, and bound it more
8176 clearly in the skeleton.
8177 (b4_epilogue): Append, instead of prepending, in order to keep
8178 #line consistency.
8179 Simplify the generation of auxiliary functions: locations and
8180 purity are mandated.
8181 (b4_global_tokens_and_yystype): Honor it.
8182 * data/location.cc (c++.m4): Don't include it.
8183 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
8184 and AT_SKEL_CC_IF.
8185 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
8186 AT_LALR1_CC_IF.
8187 Be sure to initialize the first position's filename.
8188 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
8189 mandated anyway.
8190 (AT_CHECK_CALC_GLR_CC): New.
8191 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
8192
8193 2006-01-02 Akim Demaille <akim@epita.fr>
8194
8195 * src/output.c (output_skeleton): Don't hard wire the inclusion of
8196 c.m4.
8197 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
8198 * data/glr.cc: Do not include stack.hh.
8199
8200 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
8201
8202 * data/glr.c: Reformat whitespace with tabs.
8203 (b4_lpure_formals): Remove this unused m4 macro.
8204 * tests/cxx-type.at: Reformat whitespace with tabs.
8205 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
8206 since it's a member. Rename type to isNterm for clarity.
8207
8208 2005-12-29 Akim <akim@sulaco.local>
8209
8210 Let glr.cc catch up with symbol_value_print.
8211 * data/glr.cc (b4_yysymprint_generate): Replace by...
8212 (b4_yy_symbol_print_generate): this.
8213 (yy_symbol_print, yy_symbol_value_print): Declare them.
8214
8215 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
8216
8217 * src/location.h (boundary): Note that a line or column equal
8218 to INT_MAX indicates an overflow.
8219 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
8220 (rule_length_overflow, increment_rule_length, add_column_width):
8221 New functions.
8222 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
8223 (<SC_BRACED_CODE>"}"):
8224 Use increment_rule_length rather than incrementing it by hand.
8225 (adjust_location, handle_syncline): Diagnose overflow.
8226 (handle_action_dollar, handle_action_at):
8227 Fix bug with monstrosities like $-2147483648.
8228 Remove now-unnecessary checks.
8229 (scan_integer): Verify assumptions and remove now-unnecessary checks.
8230 (convert_ucn_to_byte): Verify assumptions.
8231 (handle_syncline): New arg LOC. All callers changed.
8232 Don't store through a value derived from char const * pointer.
8233
8234 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
8235 GCC warnings.
8236
8237 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
8238
8239 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
8240 Remove unnecessary forward static decls.
8241
8242 2005-12-27 Akim Demaille <akim@epita.fr>
8243
8244 * src/reader.c (grammar_current_rule_check): Also check that $$
8245 is used.
8246 Take the rule to check as argument, hence rename as...
8247 (grammar_rule_check): this.
8248 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
8249 Rename as...
8250 (grammar_rule_begin, grammar_rule_end): these, for consistency.
8251 (grammar_midrule_action, grammar_symbol_append): Now static.
8252 * tests/torture.at (input): Don't rely on the default action
8253 being always performed.
8254 * tests/calc.at: "Set" $$ even when the action is "cut" with
8255 YYERROR or other.
8256 * tests/actions.at (Exotic Dollars): Instead of using unused
8257 values, check that the warning is issued.
8258
8259 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
8260
8261 * NEWS: Improve wording for unused-value warnings.
8262
8263 2005-12-22 Akim Demaille <akim@epita.fr>
8264
8265 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
8266 (b4_yysymprint_generate): Rename as...
8267 (b4_yy_symbol_print_generate): this.
8268 Generate yy_symbol_print instead of yysymprint.
8269 Generate also yy_symbol_value_print, and use it.
8270
8271 2005-12-22 Akim Demaille <akim@epita.fr>
8272
8273 * NEWS: Warn about unused values.
8274 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
8275 a `used' member.
8276 (symbol_list_n_get, symbol_list_n_used_set): New.
8277 (symbol_list_n_type_name_get): Use symbol_list_n_get.
8278 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
8279 * src/reader.c (grammar_current_rule_check): Check that values are
8280 used.
8281 * src/symtab.c (symbol_print): Accept 0.
8282 * tests/existing.at: Remove the type information.
8283 Empty the actions.
8284 Remove useless actions (beware of mid-rule actions: perl -000
8285 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
8286 * tests/actions.at (Exotic Dollars): Use unused values.
8287 * tests/calc.at: Likewise.
8288 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8289 Likewise.
8290
8291 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
8292 rule_useful_p.
8293
8294 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
8295
8296 Undo 2005-12-01 tentative license wording change. The wording is
8297 still being reviewed by the lawyers, and we don't want to wait for
8298 them before publishing a test release. For now, revert to the
8299 previous wording.
8300 * NEWS: Undo 2005-12-01 change.
8301 * data/glr.c: Revert to previous license wording.
8302 * data/glr.cc: Likewise.
8303 * data/lalr1.cc: Likewise.
8304 * data/location.cc: Likewise.
8305 * data/yacc.c: Likewise.
8306
8307 * NEWS: Reword %destructor vs YYABORT etc.
8308 * data/glr.c: Use American spacing, for consistency.
8309 * data/glr.cc: Likewise.
8310 * data/lalr1.cc: Likewise.
8311 * data/yacc.c: Likewise.
8312 * data/yacc.c: Reformat comments slightly.
8313 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
8314 for consistency. Fix some spelling errors and reword recently-included
8315 text slightly.
8316 * tests/cxx-type.at: Cast results of malloc, for C++.
8317
8318 2005-12-21 Joel E. Denny <address@hidden>
8319
8320 * tests/cxx-type.at: Construct a tree, count the parents of shared
8321 nodes, and free each node once and only once. Previously, the memory
8322 for semantic values was leaked instead.
8323
8324 2005-12-21 Joel E. Denny <address@hidden>
8325
8326 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
8327 (yylval, yylloc): If pure, #define to yystackp->yyval and
8328 yystackp->yyloc similar to yychar and yynerrs.
8329 (yyparse): If pure, remove local yylval and yylloc. Add local
8330 yystackp to accommodate pure definitions of yylval and yylloc.
8331 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
8332 yylvalp and yyllocp to &yylval and &yylloc.
8333 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
8334 namespace. Previously, nerrs and char were missing, but lval and lloc
8335 weren't necessary.
8336 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
8337 yylvalp and yyllocp parameters since, if pure, these are now always
8338 accessible through yystackp. If not pure, they are still accessible
8339 globally.
8340 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
8341 `if (YYID (N))' to pacify lint.
8342
8343 2005-12-21 Akim Demaille <akim@epita.fr>
8344
8345 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
8346 destroy the RHS symbols of a rule.
8347 * data/yacc.c (yylen): Initialize to 0.
8348 Keep its value to the number of items to possibly shift.
8349 In particular, a regular successful parse that ends on YYFINAL by
8350 a (internal) YYACCEPT must not have yylen != 0.
8351 (yyerrorlab, yyreturn): Pop the RHS.
8352 Reorder a bit to emphasize the `shifting' bits of code.
8353 (YYPOPSTACK): Now accept a number of items to pop.
8354 * data/lalr1.cc: Likewise.
8355 * data/glr.c: Formatting changes.
8356 Use goto instead of fall through.
8357 * doc/bison.texinfo (Destructor Decl): Complete.
8358
8359 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8360
8361 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8362 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
8363 * djgpp/config.bat: Replace every occurence of the file name
8364 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8365 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8366 * djgpp/config.sed: Replace every occurence of the file name
8367 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8368 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8369 * djgpp/djunpack.bat: DJGPP specific file.
8370 * djgpp/fnchange.lst: DJGPP specific file.
8371 * djgpp/README.in: Add new information about how to unpack the bison
8372 source on MSDOS and other systems which have 8.3 file name restrictions
8373 using djunpack.bat and fnchange.lst.
8374
8375 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
8376
8377 * bootstrap (build_cvs_prefix): Remove; unused.
8378 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
8379 when getting gnulib.
8380
8381 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
8382
8383 * data/glr.c: Reorder typedef declarations for structs to match order
8384 of struct declarations.
8385 Rename yystack everywhere to yystackp except in yyparse where it's not
8386 a pointer.
8387 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
8388 consistency.
8389 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
8390 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
8391 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
8392 lint.
8393
8394 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
8395
8396 * tests/sets.at (Accept): Fix typos in regular expression used to
8397 sed out the final state number.
8398
8399 Work around portability problem on Solaris 10: flex-generated
8400 files include <stdio.h> before <config.h>, which messes up
8401 because the latter defines __EXTENSIONS__. Address the problem
8402 by creating two new little files that include <config.h> first,
8403 then include the flex-generated files. Rewrite everyone else
8404 to include <config.h> first, as well.
8405 * lib/timevar.c: Always include "config.h".
8406 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
8407 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
8408 (EXTRA_bison_SOURCES): New macro.
8409 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
8410 * src/system.h: Don't include config.h.
8411 * src/LR0.c: Include <config.h> first.
8412 * src/assoc.c: Likewise.
8413 * src/closure.c: Likewise.
8414 * src/complain.c: Likewise.
8415 * src/conflicts.c: Likewise.
8416 * src/derives.c: Likewise.
8417 * src/files.c: Likewise.
8418 * src/getargs.c: Likewise.
8419 * src/gram.c: Likewise.
8420 * src/lalr.c: Likewise.
8421 * src/location.c: Likewise.
8422 * src/main.c: Likewise.
8423 * src/muscle_tab.c: Likewise.
8424 * src/nullable.c: Likewise.
8425 * src/output.c: Likewise.
8426 * src/parse-gram.y: Likewise.
8427 * src/print.c: Likewise.
8428 * src/print_graph.c: Likewise.
8429 * src/reader.c: Likewise.
8430 * src/reduce.c: Likewise.
8431 * src/relation.c: Likewise.
8432 * src/state.c: Likewise.
8433 * src/symlist.c: Likewise.
8434 * src/symtab.c: Likewise.
8435 * src/tables.c: Likewise.
8436 * src/uniqstr.c: Likewise.
8437 * src/vcg.c: Likewise.
8438
8439 * src/parse-gram.y: Fix minor problems uncovered by lint.
8440 (current_lhs, current_lhs_location): Now static.
8441 (current_assoc): Remove unused variable.
8442
8443 Cleanups so that Bison-generated parsers have less lint.
8444 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
8445 Prepend /*ARGSUSED*/, for lint's sake.
8446 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
8447 definition if 'lint' is defined.
8448 (YYID): New macro (or function, if lint).
8449 All uses of /*CONSTCOND*/0 replaced by YYID(0).
8450 * data/yacc.c: Likewise.
8451 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
8452 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
8453 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
8454 is C++ only.
8455 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
8456 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
8457 Use YYID(0) rather than 0, for lint.
8458 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
8459 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
8460
8461 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
8462
8463 * tests/glr-regression.at
8464 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8465 Close memory leak reported by twlevo.
8466
8467 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
8468
8469 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
8470 all stacks.
8471 (yyparse): Iterate another stack in order to call user destructors.
8472 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8473 New test case.
8474 (Duplicated user destructor for lookahead): This test now is expected
8475 to succeed.
8476
8477 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
8478
8479 * NEWS: Document the following change.
8480 * data/yacc.c: Say "parser skeleton" rather than "file", since
8481 it's no longer just a file.
8482 * data/glr.c: Grant a special exception for C GLR parsers, that
8483 reads like the already-existing exception for C LALR(1) parsers.
8484 * data/glr.cc: Likewise.
8485 * data/lalr1.cc: Likewise.
8486 * data/location.cc: Likewise.
8487 * data/yacc.c: Reword the "written by" statement to clarify that
8488 it was the parser skeleton, not the entire output file.
8489 * data/glr.c: Written by Paul Hilfinger.
8490 * data/glr.cc: Written by Akim Demaille.
8491 * data/lalr1.cc: Likewise.
8492
8493 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
8494
8495 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
8496 Fix typos in previous change that broke 'make check'.
8497 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
8498 supported in C.
8499 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
8500 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
8501 We can revert this once things settle down.
8502
8503 * src/conflicts.c (conflicts_print): Don't print file name twice
8504 when %expect fails because there were no conflicts.
8505 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
8506 change.
8507 * tests/conflicts.at (%expect not enough, %expect too much):
8508 (%expect with reduce conflicts): Adjust to new behavior.
8509
8510 2005-11-18 Akim Demaille <akim@epita.fr>
8511
8512 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
8513 errors.
8514 * NEWS: Document this.
8515 * doc/bison.texinfo (Expect Decl): Likewise.
8516
8517 2005-11-16 Akim Demaille <akim@epita.fr>
8518
8519 Generalize the display of semantic values and locations in traces.
8520 * data/glr.c (yy_reduce_print): Fix indices (again).
8521 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
8522 literal integers.
8523 * data/lalr1.cc (yyreduce_print): Rename as...
8524 (yy_reduce_print): this.
8525 Display values and locations.
8526 * data/yacc.c (yy_reduce_print): Likewise.
8527 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
8528 (yysymprint): Move higher to be visible from yy_reduce_print).
8529 (yyparse): Adjust.
8530 * tests/calc.at: Adjust the expected length of the traces.
8531
8532 2005-11-14 Akim Demaille <akim@epita.fr>
8533
8534 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
8535 from 1 to N, while values and location start at 0.
8536 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
8537
8538 2005-11-14 Akim Demaille <akim@epita.fr>
8539
8540 * data/glr.c (yy_reduce_print): Fix the $ number.
8541
8542 2005-11-14 Akim Demaille <akim@epita.fr>
8543
8544 "Use" parse parameters.
8545 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
8546 * data/glr.c, data/glr.cc: Use them.
8547 * data/glr.c (YYUSE): Have a C++ definition that supports
8548 non-pointer types.
8549
8550 2005-11-14 Akim Demaille <akim@epita.fr>
8551
8552 * data/glr.c (yyexpandGLRStack): Declare only if defined.
8553
8554 2005-11-14 Akim Demaille <akim@epita.fr>
8555
8556 * data/glr.cc: New.
8557 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
8558
8559 2005-11-12 Akim Demaille <akim@epita.fr>
8560
8561 Let position and location be PODs.
8562 * data/location.cc (position::initialize, location::initialize): New.
8563 (position::position, location::location): Define only if
8564 b4_location_constructors is defined.
8565 * data/lalr1.cc (b4_location_constructors): Define it for backward
8566 compatibility.
8567 * doc/bison.texinfo (Initial Action Decl): Use initialize.
8568
8569 2005-11-12 Akim Demaille <akim@epita.fr>
8570
8571 * data/lalr1.cc: Move the body of the ctor and dtor into the
8572 parser file (instead of the header).
8573 Wrap the implementations in a "namespace yy".
8574
8575 2005-11-12 Akim Demaille <akim@epita.fr>
8576
8577 Have glr.c include its header file when created.
8578 * data/glr.c (b4_shared_declarations): New.
8579 Output them verbatim in the parser if !%defines, otherwise
8580 output then in the header file, and include it instead.
8581
8582 2005-11-11 Akim Demaille <akim@epita.fr>
8583
8584 * data/glr.c: Comment changes.
8585
8586 2005-11-11 Akim Demaille <akim@epita.fr>
8587
8588 When yydebug, report semantic and location values for reductions.
8589 * data/glr.c (yy_reduce_print): Report the semantic values and the
8590 locations.
8591 (YY_REDUCE_PRINT): Adjust.
8592 (yyglrReduce): Use them.
8593 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
8594 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
8595 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
8596 traces.
8597
8598 2005-11-10 Akim Demaille <akim@epita.fr>
8599
8600 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
8601 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
8602 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
8603
8604 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
8605
8606 * m4/cxx.m4, examples/Makefile.am: Don't build
8607 examples/calc++ if no C++ compiler is available. (trivial change)
8608
8609 2005-11-09 Akim Demaille <akim@epita.fr>
8610
8611 * src/scan-skel.l: Use a couple of asserts.
8612
8613 2005-11-03 Akim Demaille <akim@epita.fr>
8614
8615 In some (weird) cases, the final state number is incorrect.
8616 Reported by Alexandre Duret-Lutz.
8617 * src/LR0.c (state_list_append): Remove the computation of
8618 final_state.
8619 (save_reductions): Do it here.
8620 (get_state): Alpha conversion.
8621 (generate_states): Use a for loop.
8622 * src/gram.h (item_number_is_rule_number)
8623 (item_number_is_symbol_number): New.
8624 * src/state.c: Use assert.
8625 * src/system.h: Include assert.h.
8626 * tests/sets.at (Accept): New.
8627
8628 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8629
8630 * data/glr.c (yyfill): Adjust comment.
8631 (yyresolveAction): Initialize default location properly
8632 for empty right-hand sides.
8633 (yydoAction): Ditto.
8634 Add comment explaining apparently dead code.
8635 * tests/glr-regression.at
8636 (Incorrectly initialized location for empty right-hand side in GLR):
8637 New test.
8638
8639 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
8640
8641 * bootstrap (cleanup_gnulib): New function. Use it to clean up
8642 gnulib when interrupted. This fixes some race conditions and
8643 works around some portability problems (one noted by Paul
8644 Hilfinger).
8645
8646 2005-10-22 Akim <akim@epita.fr>
8647
8648 * Makefile.cfg: Adjust to config -> build-aux.
8649 Reported by twledo.
8650
8651 2005-10-21 Akim Demaille <akim@epita.fr>
8652
8653 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
8654 the %parse-params.
8655 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
8656 * data/yacc.c (b4_Pure_if): Rename as...
8657 (b4_yacc_pure_if): this.
8658 (YY_SYMBOL_PRINT, yyparse): Adjust.
8659 * doc/bison.texinfo: Formatting changes.
8660
8661 2005-10-21 Akim Demaille <akim@epita.fr>
8662
8663 Finish the transition config -> build-aux.
8664 * configure.ac, Makefile.am: Use build-aux.
8665 * config/prev-version, config/announce-gen, config/Makefile.am:
8666 Move to...
8667 * build-aux/prev-version, build-aux/announce-gen,
8668 * build-aux/Makefile.am: here.
8669
8670 2005-10-14 Akim Demaille <akim@epita.fr>
8671
8672 * examples/calc++/test: Use set -x only when VERBOSE.
8673
8674 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
8675
8676 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
8677 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
8678
8679 2005-10-13 Akim Demaille <akim@epita.fr>
8680
8681 * src/scan-skel.l: Output the base name parts of the parser and
8682 header file names.
8683 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
8684 additional checks.
8685 Use this to exercise C++ outputs in subdirs.
8686 Reported by Oleg Smolsky.
8687
8688 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
8689
8690 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
8691 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
8692 Problem reported by John P. Hartmann.
8693 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
8694 already defined it.
8695
8696 2005-10-12 Akim Demaille <akim@epita.fr>
8697
8698 * src/parse-gram.y (version_check): Exit 63 to please missing
8699 (stands for "version mismatch).
8700 * tests/input.at, doc/bison.texinfo: Adjust.
8701
8702 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
8703
8704 Work around portability problems with Visual Age C compiler
8705 (xlc and xlC_r) reported by John P. Hartmann.
8706 * data/location.cc (initial_column, initial_line): Remove.
8707 All uses replaced by 0 and 1.
8708 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
8709 that xlc complains about.
8710 * src/scan-skel.l (skel_wrap): Likewise.
8711 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
8712 as __STDC__.
8713 * data/yacc.c (YYMODERN_C): New macro, which also looks at
8714 __STDC_VERSION__. Use it everywhere instead of looking at
8715 __STDC__ and __cplusplus.
8716
8717 2005-10-10 Akim Demaille <akim@epita.fr>
8718
8719 * examples/calc++/test: Be quiet unless VERBOSE.
8720
8721 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
8722
8723 * data/c.m4 (yydestruct, yysymprint):
8724 Use YYUSE instead of casting to void.
8725 * data/glr.c (YYUSE): New macro.
8726 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8727 Use it instead of rolling our own.
8728 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8729 (YYCHK1):
8730 Use /*CONSTCOND*/ to suppress lint warnings.
8731 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8732 (YY_STACK_PRINT): Use 'false' not '0'.
8733 (YYUSE): New macro.
8734 (yysymprint_, yydestruct_): Use it instead of rolling our own.
8735 * data/yacc.c (YYUSE): New macro.
8736 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
8737 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
8738 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
8739
8740
8741 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
8742 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
8743
8744 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
8745
8746 Undo the parts of the unlocked-I/O change that substituted
8747 putc or puts for printf. This might hurt performance a bit,
8748 but some people prefer the printf style.
8749 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
8750 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
8751 All uses replaced by YYFPRINTF and YYDPRINTF.
8752 * data/yacc.c: Likewise.
8753 * lib/bitset.c (bitset_print): Likewise.
8754 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
8755 putc and puts.
8756 * lib/lbitset.c (debug_lbitset): Likewise.
8757 * src/closure.c (print_firsts, print_fderives): Likewise.
8758 * src/gram.c (grammar_dump): Likewise.
8759 * src/lalr.c (look_ahead_tokens_print): Likewise.
8760 * src/output.c (escaped_output): Likewise.
8761 (user_actions_output): Break apart two printfs.
8762 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
8763 * src/reduce.c (reduce_print): Likewise.
8764 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8765 * src/system.h: Include unlocked-io.h rathe than stdio.h.
8766
8767 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8768 Use assignments rather than casts-to-void to suppress
8769 unused-variable warnings. This pacifies 'lint'.
8770 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
8771 unused-variable warnings.
8772
8773 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8774
8775 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8776
8777 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
8778
8779 Use unlocked I/O for a minor performance improvement on hosts like
8780 GNU/Linux and Solaris that support unlocked I/O. The basic idea
8781 is to use the gnlib unlocked-io module, and to prefer putc and
8782 puts to printf when either will work (since the latter doesn't
8783 come in an unlocked flavor).
8784 * bootstrap (gnulib_modules): Add unlocked-io.
8785 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
8786 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
8787 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
8788 and similarly for puts and putc and printf.
8789 * data/yacc.c: Likewise.
8790 * lib/bitset.c (bitset_print): Likewise.
8791 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
8792 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
8793 to printf.
8794 * lib/lbitset.c (debug_lbitset): Likewise.
8795 * src/closure.c (print_firsts, print_fderives): Likewise.
8796 * src/gram.c (grammar_dump): Likewise.
8797 * src/lalr.c (look_ahead_tokens_print): Likewise.
8798 * src/output.c (escaped_output): Likewise.
8799 (user_actions_output): Coalesce two printfs.
8800 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
8801 * src/reduce.c (reduce_print): Likewise.
8802 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8803 * src/system.h: Include unlocked-io.h rather than stdio.h.
8804
8805 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
8806 this confuses xgettext.
8807
8808 2005-10-02 Akim Demaille <akim@epita.fr>
8809
8810 * bootstrap (gnulib_modules): Add strverscmp.
8811 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
8812 * m4/.cvsignore: Add strverscmp.m4.
8813 * src/parse-gram.y (%require): New token, new rule.
8814 (version_check): New.
8815 * src/scan-gram.l (%require): Adjust.
8816 * tests/input.at (AT_REQUIRE): New.
8817 Use it.
8818 * doc/bison.texinfo (Require Decl): New.
8819 (Calc++ Parser): Use %require.
8820
8821 2005-10-02 Akim Demaille <akim@epita.fr>
8822
8823 * data/location.cc: New.
8824
8825 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
8826 Akim Demaille <akim@epita.fr>
8827
8828 Make sure -odir/foo.cc creates dir/location.hh etc.
8829 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
8830 (spec_file_prefix, spec_verbose_file, spec_graph_file)
8831 (spec_defines_file): Now const.
8832 (dir_prefix): New.
8833 (short_base_name): Remove.
8834 * src/files.c: Adjust.
8835 (dirname.h): Include.
8836 (base_name): Don't prototype it.
8837 (finput): Remove, duplicates gram_in.
8838 (full_base_name, short_base_name): Replace by...
8839 (all_but_ext, all_but_tab_ext): these.
8840 (compute_base_names): Rename as...
8841 (compute_file_name_parts): this.
8842 Update to compute the new variables, including dir_prefix.
8843 Adjust dependencies.
8844 * src/output.c (prepare): Output them.
8845 * src/reader.c: Adjust to use gram_in, not finput.
8846 * src/scan-skel.l (@dir_prefix@): New.
8847
8848 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8849
8850 * lib/subpipe.c: New function end_of_output_subpipe() added
8851 to allow support for non-posix systems. This is a no-op function
8852 for posix systems.
8853
8854 * lib/subpipe.h: New function end_of_output_subpipe() added
8855 to allow support for non-posix systems. This is a no-op function
8856 for posix systems.
8857
8858 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
8859 handle the lack of pipe/fork functionality on non-posix systems.
8860
8861 * djgpp/Makefile.maint: DJGPP specific file.
8862
8863 * djgpp/README.in: DJGPP specific file.
8864
8865 * djgpp/config.bat: DJGPP specific configuration file.
8866
8867 * djgpp/config.sed: DJGPP specific configuration file.
8868
8869 * djgpp/config.site: DJGPP specific configuration file.
8870
8871 * djgpp/config_h.sed: DJGPP specific configuration file.
8872
8873 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
8874
8875 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
8876
8877 2005-10-02 Akim Demaille <akim@epita.fr>
8878
8879 * data/location.cc: New, extract from...
8880 * data/lalr1.cc: here.
8881 (location.hh): Include it after the user prologue, in case the
8882 filename type is defined by the user.
8883 Forward declation location and position before the pre-prologue.
8884 (yyresult_): Rename as...
8885 (yyresult): this, it's a local variable, not an attribute.
8886 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
8887
8888 2005-10-01 Akim Demaille <akim@epita.fr>
8889
8890 * examples/extexi: Restore the #line generation.
8891
8892 2005-09-30 Akim Demaille <akim@epita.fr>,
8893 Alexandre Duret-Lutz <adl@gnu.org>
8894
8895 Move the token type and YYSTYPE in the parser class.
8896 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
8897 (parser::token): New, from the moved free definition of tokens.
8898 (parser::semantic_value): Now a full definition instead of an
8899 indirection to YYSTYPE.
8900 (b4_post_prologue): No longer included in the header file, but
8901 in the implementation file.
8902 * doc/bison.texi (C+ Language Interface): Update.
8903 * src/parse-gram.y: Support unary %define.
8904 * tests/actions.at: Define global_tokens_and_yystype for backward
8905 compatibility until we update the tests.
8906 * tests/calc.at: Idem.
8907 (first_line, first_column, last_line, last_column): Define for lalr1.cc
8908 to simplify the code.
8909
8910 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
8911
8912 Port to SunOS 4.1.4, which lacks strtoul and strerror.
8913 Ah, the good old days! Problem reported by Peter Klein.
8914 * bootstrap (gnulib_modules): Add strerror, strtoul.
8915 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
8916 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
8917
8918 2005-09-29 Akim Demaille <akim@epita.fr>
8919
8920 * data/c.m4 (b4_error_verbose_if): New.
8921 * data/lalr1.cc: Use it.
8922 (YYERROR_VERBOSE_IF): Remove.
8923 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
8924 parser members, replaced by...
8925 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
8926 local variables.
8927 (yysyntax_error_): Takes the state number as argument.
8928 (yyreduce_print_): Use the argument yyrule, not the former
8929 attribute yyn_.
8930
8931 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
8932
8933 * bootstrap (gnulib_modules): Add verify.
8934 * lib/.cvsignore: Add verify.h.
8935 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
8936 * src/system.h (verify): Remove.
8937 Include verify.h instead.
8938 * src/tables.c (tables_generate): Use new API for 'verify'.
8939
8940 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
8941
8942 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
8943 local variables whose names begin with 'yy'.
8944 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8945 Trivial changes from Joel E. Denny.
8946
8947 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
8948 it itself.
8949 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
8950 don't use alloca any more.
8951
8952 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
8953 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
8954 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
8955 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
8956 to match yacc.c, to test more hosts.
8957
8958 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
8959
8960 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
8961 doesn't affect behavior.
8962 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
8963 Solaris, AIX, MSC.
8964 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
8965 This works a bit better with glibc, if user code has already included
8966 stdlib.h.
8967 * doc/bison.texinfo (Bison Parser): Document that users can't
8968 arbitrarily use malloc and free for other purposes. Document
8969 that <alloca.h> and <malloc.h> might be included.
8970 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
8971 user must declare alloca.
8972
8973 * HACKING (release): Forwarn the Translation Project about
8974 stable releses.
8975
8976 2005-09-20 Akim Demaille <akim@epita.fr>
8977
8978 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
8979
8980 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
8981
8982 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
8983 (YYSTACK_ALLOC_MAXIMUM): Use it.
8984 (yysyntax_error): New function.
8985 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
8986 multiple syntax errors are reported, and alloca is being used.
8987 Instead, reallocate buffers twice as big each time, so that
8988 we waste at most half the allocated memory. Start with a small
8989 (128-byte) buffer that will suffice in most cases anyway.
8990 Use yysyntax_error to do most of the work.
8991
8992 * doc/bison.texinfo (Error Reporting, Table of Symbols):
8993 yynerrs is the number of errors reported, not the number of
8994 errors encountered.
8995
8996 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8997 Mark it as expected to fail.
8998 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8999 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9000 Don't start user-code symbols with "yy", to avoid name space problems.
9001
9002 2005-09-19 Akim Demaille <akim@epita.fr>
9003
9004 Remove the traits, failed experiment.
9005 It never proved useful, and anyway because of the current
9006 definition, it was not possible to have several specialization of
9007 this traits, making it useless.
9008 * data/lalr1.cc (yy:traits): Remove.
9009 Inline its definitions in the parser class.
9010
9011 2005-09-19 Akim Demaille <akim@epita.fr>
9012
9013 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9014 least Mac OSX with a /usr/local install of gettext.
9015
9016 2005-09-19 Akim Demaille <akim@epita.fr>
9017
9018 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9019 and yytoken for similarity with the other skeletons.
9020
9021 2005-09-19 Akim Demaille <akim@epita.fr>
9022
9023 * NEWS, configure.ac: update version number to 2.1a.
9024
9025 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9026
9027 * NEWS: Version 2.1.
9028
9029 * NEWS: Remove notice of yytname change, since it was never in an
9030 official release.
9031 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9032 diagnostic.
9033 * src/output.c (prepare): Likewise.
9034 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9035 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9036 is not defined. This is an awful hack, but it's enough for now.
9037 All callers changed.
9038 * tests/glr-regression-at (make_value): Args are const pointers now,
9039 to avoid GCC warning.
9040 (Duplicated user destructor for lookahead): New test. Currently
9041 skipped. It fails on my host but I'm not sure it'll always fail.
9042
9043 2005-09-16 Akim Demaille <akim@epita.fr>
9044
9045 * src/symtab.h (struct symbol): Declare the printer and destructor
9046 as const, to avoid accidental calls to free.
9047 (symbol_destructor_set, symbol_printer_set): Adjust.
9048 * src/symtab.c: Adjust.
9049
9050 2005-09-16 Akim Demaille <akim@epita.fr>
9051
9052 * data/c.m4 (b4_token_enums): New.
9053 (b4_token_defines): Rename as...
9054 (b4_token_enums_defines): this.
9055 (b4_token_defines): New, output only the #defines.
9056 * data/yacc.c, data/glr.c: Adjust.
9057 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9058 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9059 as default values.
9060
9061 2005-09-16 Akim Demaille <akim@epita.fr>
9062
9063 * data/lalr1.cc (yylex_): Remove, inline its code.
9064 (yyreport_syntax_error_): Remove, replaced by...
9065 (yysyntax_error_): this which returns a string and leaves to the
9066 caller the call to the users' error function.
9067 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9068 Move from members of the parser object...
9069 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9070 to local variables of the parse function.
9071
9072 2005-09-16 Akim Demaille <akim@epita.fr>
9073
9074 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9075 since it's in Bison's name space.
9076
9077 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9078
9079 * data/glr.c (yyresolveValue): Add default case to pacify
9080 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9081
9082 * NEWS: Document when yyparse started to return 2.
9083 * doc/bison.texinfo (Parser Function): Document when yyparse
9084 returns 2.
9085
9086 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9087 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9088 changed.
9089 (class position): file_name -> filename (reverting). All uses changed.
9090
9091 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9092
9093 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9094 do anything if $@ exists. This reverts part of the 2005-07-07
9095 patch.
9096
9097 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9098
9099 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9100 contains obsolete information and isn't worth distributing as a
9101 separate file anyway.
9102 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9103 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9104 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9105 (yyparse): Abort if user code uses longjmp to throw an unexpected
9106 value.
9107
9108 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9109
9110 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9111 Suggested by twlevo@xs4all.nl.
9112
9113 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9114 This avoids a diagnostic from gcc -Wswitch-enum.
9115 Problem reported by twlevo@xs4all.nl.
9116
9117 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9118 standards. Use "file name" or "file" or "name", depending on
9119 the context.
9120 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9121 not to hack/foo.tab.c.
9122 (Calc++ Top Level): 2nd arg of main is not const.
9123 * data/glr.c: b4_filename -> b4_file_name.
9124 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9125 All uses changed.
9126 (class position): filename -> file_name. All uses changed.
9127 * data/yacc.c: b4_filename -> b4_file_name.
9128 * lib/bitset.h: filename -> file_name in local vars.
9129 * lib/bitset_stats.c: Likewise.
9130 * src/files.c: Likewise.
9131 * src/scan-skel.l ("@output ".*\n): Likewise.
9132 * src/files.c (file_name_split): Renamed from filename_split.
9133 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
9134
9135 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9136
9137 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9138 to accommodate latest gnulib.
9139
9140 * tests/glr-regression.at (Duplicate representation of merged trees):
9141 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9142
9143 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9144 needed.
9145
9146 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9147
9148 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
9149 All uses changed. Invoke user destructor after an error during a
9150 split parse (trivial change from Joel E. Denny).
9151
9152 * tests/glr-regression.at
9153 (User destructor after an error during a split parse): New test case.
9154 Problem reported by Joel E. Denny in:
9155 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
9156
9157 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9158
9159 * README-cvs: Give URLs for recommended tools.
9160 Mention Gzip version problem, and bootstrapping issues.
9161 Remove troubleshooting section, as it's somewhat obsolete.
9162
9163 * bootstrap (no_cache): New var, to accommodate different wget
9164 variants. Use it instead of '-C off'. Problem reported by
9165 twlevo@xs4all.nl.
9166
9167 * data/glr.c (yydestroyStackItem): New function.
9168 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
9169 debugging information. Problem reported by Joel E. Denny.
9170
9171 2005-08-25 Akim Demaille <akim@epita.fr>
9172
9173 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9174
9175 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
9176
9177 * data/glr.c (yyrecoverSyntaxError, yyreturn):
9178 Don't invoke destructor on unresolved entries.
9179 * tests/glr-regression.at
9180 (User destructor for unresolved GLR semantic value): New test case.
9181 Problem reported by Joel E. Denny in:
9182 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
9183
9184 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
9185
9186 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
9187 Add strnlen.c.
9188 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
9189 lib-prefix.m4, po.m4.
9190
9191 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
9192 in yydestruct diagnostic, since it might not be an error.
9193 Problem reported by Joel Denny near end of
9194 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9195 * data/lalr1.cc (yyerturn): Likewise.
9196 * data/yacc.c (yyreturn): Likewise.
9197 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
9198
9199 * src/files.c: Remove obsolete FIXME comment.
9200
9201 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
9202 with the other templates, and to fix bogus run-on messages such
9203 as the one reported at the end of
9204 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9205 All callers changed to avoid the newline.
9206 (yyprocessOneStack): Output two lines rather than one, to accommodate
9207 the above change. This changes the debug output format slightly.
9208
9209 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
9210 reported by Joel E. Denny in
9211 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
9212 (trivial change).
9213 * tests/glr-regression.at (Duplicate representation of merged trees):
9214 New test, from Joel E. Denny in:
9215 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
9216 * THANKS: Add Joel E. Denny.
9217
9218 * configure.ac (AC_INIT): Bump to 2.0c.
9219
9220 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
9221
9222 * NEWS: Version 2.0b.
9223
9224 * Makefile.am (SUBDIRS): Put examples before tests, so that
9225 "make check" doesn't finish with "All 1 tests passed".
9226
9227 * tests/regression.at (Token definitions): Don't rely on
9228 AT_PARSER_CHECK for data that contains backslashes. It currently
9229 uses 'echo', and 'echo' isn't portable if its argument contains
9230 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
9231 that the byte '\0xff' is not printable in the C locale; it is,
9232 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
9233 not printable, so use '\0x81' to test.
9234
9235 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
9236 version of GCC, since the macro is used with non-GCC compilers.
9237
9238 Fix core dump reported by Pablo De Napoli in
9239 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
9240 * tests/regression.at (Invalid inputs with {}): New test.
9241 * src/parse-gram.y (token_name): Translate type before using
9242 it as an index.
9243
9244 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
9245 the user's name space. All uses changed to __attribute__
9246 ((__unused__)).
9247 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
9248 Add __attribute__ ((__noreturn__)).
9249
9250 * etc/clcommit: Remove. We weren't using it, and it failed
9251 "make maintainer-distcheck".
9252 * Makefile.maint: Merge from coreutils.
9253 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
9254 (syntax-check-rules): Change list of rules as described below.
9255 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
9256 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
9257 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
9258 (sc_trailing_space): New rules.
9259 (sc_xalloc_h_in_src): Remove.
9260 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
9261 (sc_space_tab, sc_error_exit_success, sc_changelog):
9262 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
9263 (makefile-check, po-check, author_mark_check):
9264 (makefile_path_separator_check, copyright-check):
9265 Use grep -n, to make it easier to find violations.
9266 Use CVS_LIST and CVS_LIST_EXCEPT.
9267 (header_regexp, h_re): Remove.
9268 (dd_c): New macro.
9269 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
9270 (my-distcheck): Use more-modern GCC flags.
9271 (signatures, %.asc): Remove.
9272 (rel-files, announcement): Remove signatures.
9273 Restore old updating code, even though we don't use it, so
9274 that we're the same as coreutils.
9275 (alpha, beta, major): Depend on news-date-check.
9276 Make the upload commands.
9277
9278 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
9279 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
9280 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
9281 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
9282 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
9283 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
9284 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
9285 * tests/sets.at: Likewise.
9286
9287 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
9288 we comment out the Autoconf version number.
9289 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
9290 it's error-prone and "make maintainer-distcheck" rejects it.
9291
9292 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
9293 Indent calls to "error" to pacify "make maintainer-distcheck",
9294 when the calls are not intended to be translated.
9295 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
9296
9297 * src/Makefile.am (DEFS): Use +=, to pacify
9298 "make maintainer-distcheck".
9299 (bison_SOURCES): Add scan-skel.h.
9300 (sc_tight_scope): New rule, from coreutils.
9301
9302 * src/files.c (src_extension, header_extension):
9303 Now static, not extern.
9304 * src/getargs.c (short_options): Likewise.
9305 * src/muscle_tab.c (muscle_table): Likewise.
9306 * src/parse-gram.y (current_class, current_type, current_prec):
9307 Likewise.
9308 * src/reader.c (grammar_end, previous_rule_end): Likewise.
9309 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
9310 * src/main.c (main): Cast bindtextdomain and textdomain calls to
9311 void, to avoid warning when NLS is disabled.
9312 * src/output.c: Include scan-skel.h.
9313 (scan_skel): Remove decl, since scan-skel.h does this.
9314 (output_skeleton):
9315 Indent calls to "error" to pacify "make maintainer-distcheck".
9316 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
9317 * src/reader.h (gram_end, gram_lineno): New decls to pacify
9318 "make maintainer-distcheck".
9319 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
9320 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
9321 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
9322 (skel_lex_destroy, scan_skel): Move these decls to...
9323 * src/scan-skel.h: New file.
9324 * src/uniqstr.c (uniqstr_assert):
9325 Indent calls to "error" to pacify "make maintainer-distcheck".
9326
9327 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
9328 not @VAR@.
9329
9330 * tests/torture.at: Revamp to avoid misuse of atoi that
9331 "make maintainer-distcheck" complained about.
9332
9333 * examples/extexi (message): Don't print a message more than once,
9334 and omit line-number decoration that makes Emacs compile think
9335 that informative messages are worth worrying about.
9336
9337 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
9338
9339 * configure.ac: Update version number.
9340
9341 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
9342 accidentally.
9343 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
9344 autogenerated by the maintainer.
9345 * examples/calc++/.cvsignore: Add *.yy.
9346
9347 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
9348 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9349 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9350
9351 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
9352
9353 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
9354 from maintainer-distcheck about casting the argument of 'free'.
9355
9356 * NEWS: Mention recent yytname changes.
9357 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
9358
9359 * bootstrap: For translations that have not yet been upgraded to
9360 the new runtime-po domain, prime the pump by extracting the
9361 relevant strings from the obsolete translations. This code can be
9362 removed once the bison-runtime domain has been translated by each
9363 team.
9364
9365 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
9366 now that token names are already quoted.
9367
9368 Fix problem reported by Anthony Heading.
9369 * data/glr.c (YYTOKEN_TABLE): New macro.
9370 (yytname): Define if YYTOKEN_TABLE.
9371 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
9372 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
9373 (YYERROR_VERBOSE): Define the same way the other skeletons do.
9374 * src/output.c (prepare_symbols): Output token_table_flag.
9375
9376 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
9377
9378 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
9379 again if the first call fails.
9380
9381 * data/glr.c (yytnamerr): New function.
9382 (yyreportSyntaxError): Use it to dequote most string literals.
9383 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
9384 with other skeletons. All uses changed.
9385 (yytnameerr_): New function.
9386 (yyreport_syntax_error): Use it to dequote most string literals.
9387 * data/yacc.c (yytnamerr): New function.
9388 (yyerrlab): Use it to decode most string literals.
9389 * doc/bison.texinfo (Decl Summary, Calling Convention):
9390 Clarify quoting convention of yytname.
9391 * src/output.c (prepare_symbols): Quote all names. This undoes
9392 the 2005-04-17 change, which is now accomplished (mostly) via
9393 changes in the parsers as described above.
9394 * tests/regression.at (Token definitions, Web2c Actions):
9395 Undo most 2005-04-17 change here, too.
9396
9397 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
9398
9399 Fix more problems reported by twlevo@xs4all.nl.
9400 * tests/cxx-type.at: Don't pipe output of ./types through sed to
9401 remove trailing spaces. This loses the exit status of ./types,
9402 and isn't needed since ./types shouldn't be emitting trailing
9403 spaces.
9404 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
9405 as the stack isn't valid in that case.
9406
9407 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9408 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9409 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9410 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
9411 is used.
9412 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
9413 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9414 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9415 Likewise.
9416
9417 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
9418 overly-picky compilers that reject 'char *foo = "bar";'.
9419
9420 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
9421 to FILE * parameter, not to stderr. This fixes a typo introduced
9422 in the 2005-07-12 change.
9423
9424 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
9425 warnings from GCC 4.
9426
9427 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
9428 (yyglrShiftDefer, yysplitStack):
9429 Remove unused parameters b4_pure_formals. All uses changed.
9430 (yyglrShift): Remove unused parameters b4_user_formals.
9431 All uses changed.
9432 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
9433
9434 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
9435
9436 Destructor cleanups and regularization among the three skeletons.
9437 * NEWS: Document the behavior changes.
9438 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
9439 stack before failing, as the cleanup code will do it for us now.
9440 * data/lalr1.cc (yyerrlab): Likewise.
9441 * data/glr.c (yyparse): Pop everything off the stack before
9442 freeing it, so that destructors get called properly.
9443 * data/lalr1.cc (yyreturn): Likewise.
9444 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
9445 This is more consistent.
9446 * doc/bison.texinfo (Destructor Decl): Mention more reasons
9447 why destructors might be called. 1.875 -> 2.1.
9448 (Destructor Decl, Decl Summary, Table of Symbols):
9449 Some English-language cleanups for %destructor.
9450 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9451 Add output line for destructor of start symbol.
9452 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
9453 because of that same extra output line.
9454
9455 * NEWS: Document minor wording changes in diagnostics of
9456 Bison-generated parsers.
9457 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
9458 Remove unused formals. All uses changed.
9459 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
9460 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
9461 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
9462 Rename yyoverflowab to yyexhaustedlab.
9463 When memory exhaustion occurs during syntax-error reporting,
9464 report it separately rather than in a single diagnostic; this
9465 eases translation.
9466 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
9467 (Memory Exhausted): Renamed from Parser Stack Overflow.
9468 Revamp wording slightly to prefer "memory exhaustion".
9469 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
9470
9471 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
9472
9473 Add i18n support to the GLR skeleton. Partially fix the C++
9474 skeleton; a C++ expert needs to finish this. Remove debugging
9475 msgids; there's little point to having them translated, since they
9476 can be understood only by someone who can read the
9477 (English-language) source code.
9478
9479 Generate runtime-po/bison-runtime.pot automatically, so that we
9480 don't have to worry about garbage getting in that file. We'll
9481 make sure after the next official release that old msgids don't
9482 get lost. See
9483 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
9484
9485 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
9486 Now auto-generated.
9487 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
9488 Fix typos in explanations of the runtime file.
9489 * bootstrap: Change gettext keyword from YYI18N to YY_.
9490 Use standard Makefile.in.in in runtime-po, since we'll arrange
9491 for backward-compatible bison-runtime.po files in a different way.
9492 * data/glr.c (YY_): New macro, from yacc.c.
9493 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
9494 Translate messages intended for users.
9495 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
9496 the wording in the other skeletons. We don't know that the memory
9497 is virtual.
9498 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
9499 Use same method that yacc.c uses.
9500 Don't translate debugging messages.
9501 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
9502 it doesn't work (yet), and requires C++ expertise to fix.
9503 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
9504 Move defn to a more logical place, to be consistent with other
9505 skeletons.
9506 Don't translate debugging messages.
9507 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
9508 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
9509 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
9510 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
9511
9512 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
9513 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
9514 void, not int.
9515 * tests/glr-regression.at (Badly Collapsed GLR States):
9516 Likewise.
9517 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9518 yylex should return 0 at EOF rather than aborting.
9519
9520 Improve tests for stack overflow in GLR parser.
9521 Problem reported by twlevo@xs4all.nl.
9522 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
9523 All uses removed.
9524 (yyStackOverflow): Just longjmp, but with value 2 so that caller
9525 can handle the problem.
9526 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
9527 (yyparse): New local variable yyresult to record the result.
9528 Use result of setjmp to set it, rather than storing itinto
9529 struct.
9530 (yyDone): Remove label.
9531 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
9532 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
9533 if YYABORT is used).
9534 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
9535 yyparse status; put status > 1 into diagnostic.
9536 Check that status==2 works.
9537 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
9538 Use exit status 3 for failure to open (which shouldn't happen).
9539
9540 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
9541
9542 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
9543 1 on syntax error; just let yyparse do its thing.
9544 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
9545 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
9546 (Exploding the Stack Size with Alloca):
9547 (Exploding the Stack Size with Malloc):
9548 Expect exit status 2, not 1, since the parser is supposed to blow
9549 its stack. Problem reported by twlevo@xs4all.nl.
9550
9551 * data/glr.c (yyparse): Don't assume that the initial calls
9552 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
9553 Print a stack-overflow message and fail instead.
9554 Initialize the line-number information before creating the stack,
9555 so that the stack-overflow message can report line zero safely.
9556
9557 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
9558
9559 Fix problems reported by twlevo@xs4all.nl.
9560 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
9561 (yyuserMerge): Provide a default case if b4_mergers is empty.
9562 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
9563 * tests/glr-regression.at
9564 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9565 Add casts to pacify C++ compilers.
9566 * tests/glr-regression.at (Improper merging of GLR delayed action
9567 sets): Declare yylex before using it.
9568 * tests/Makefile.am (maintainer-check-g++): Fix a stray
9569 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
9570 test for valgrind; valgrind is independent of g++.
9571 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
9572 for compatibility with POSIX 1003.1-2001 (if running coreutils).
9573 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
9574 Use a destructor, so that we can expand the stack. Change
9575 YYSTYPE to char * so that we can free it. Cast result of malloc.
9576
9577 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9578
9579 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
9580 a valgrind failure. Problem reported by twlevo@xs4all.nl.
9581
9582 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
9583
9584 * PACKAGING: New file, suggested by Bruno Haible and taken from
9585 similar wording in gettext's PACKAGING file.
9586 * NEWS: Mention PACKAGING.
9587 * Makefile.am (EXTRA_DIST): Add PACKAGING.
9588
9589 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
9590
9591 * NEWS: Document recent i18n improvements.
9592 * bootstrap: Get runtime translations into runtime-po.
9593 Create runtime-po files automatically, if possible.
9594 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
9595 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
9596 does not infringe on the user's name space.
9597 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
9598 * doc/bison.texinfo (Internationalization): Revamp the English
9599 and Texinfo syntax a bit, to try to make it clearer.
9600 (Bison Options, Option Cross Key): Mention --print-localedir.
9601 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
9602 YYENABLE_NLS. Quote a bit more.
9603 * runtime-po/.cvsignore: New file.
9604 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
9605 * runtime-po/Rules-quot: Remove; now created by bootstrap.
9606 * runtime-po/quot.sed: Likewise.
9607 * runtime-po/boldquot.sed: Likewise.
9608 * runtime-po/en@quot.header: Likewise.
9609 * runtime-po/en@boldquot.header: Likewise.
9610 * runtime-po/insert-header.sin: Likewise.
9611 * runtime-po/remove-potcdate.sin: Likewise.
9612 * runtime-po/Makevars: Likewise.
9613 * runtime-po/LINGUAS: Likewise.
9614 * runtime-po/de.po: Likewise; we will rely on the translation project
9615 to maintain this, so "bootstrap" should get it.
9616 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
9617 its value.
9618 * src/main.c (main): Bind the bison-runtime domain, too.
9619
9620 2005-07-12 Bruno Haible <bruno@clisp.org>
9621
9622 * data/yacc.c: Include <libintl.h> when NLS is enabled.
9623 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
9624 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
9625 * runtime-po: New directory.
9626 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
9627 $(DOMAIN).pot-update rule, so that old messages are never dropped.
9628 * runtime-po/Rules-quot: New file, copied from po/.
9629 * runtime-po/quot.sed: Likewise.
9630 * runtime-po/boldquot.sed: Likewise.
9631 * runtime-po/en@quot.header: Likewise.
9632 * runtime-po/en@boldquot.header: Likewise.
9633 * runtime-po/insert-header.sin: Likewise.
9634 * runtime-po/remove-potcdate.sin: Likewise.
9635 * runtime-po/Makevars: New file.
9636 * runtime-po/POTFILES.in: New file.
9637 * runtime-po/LINGUAS: New file.
9638 * runtime-po/bison-runtime.pot: New file.
9639 * runtime-po/de.po: New file.
9640 * m4/bison.m4: New file.
9641 * Makefile.am (SUBDIRS): Add runtime-po.
9642 (aclocaldir, aclocal_DATA): New variables.
9643 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
9644 Define aclocaldir.
9645 * src/getargs.c (usage): Document --print-localedir option.
9646 (PRINT_LOCALEDIR_OPTION): New enum item.
9647 (long_options): Add --print-localedir option.
9648 (getargs): Handle --print-localedir option.
9649 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
9650 (Internationalization): New section.
9651
9652 2005-07-12 Akim Demaille <akim@epita.fr>
9653
9654 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
9655 for consistency with the rest of the code.
9656 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
9657 Add separators.
9658
9659 2005-07-12 Akim Demaille <akim@epita.fr>
9660
9661 * src/parse-gram.y: Use %printer instead of YYPRINT.
9662
9663 2005-07-12 Akim Demaille <akim@epita.fr>
9664
9665 * src/symtab.h, src/symtab.c (symbol_print): New.
9666 * src/symlist.h, src/symlist.c (symbol_list_print): New.
9667 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
9668
9669 2005-07-12 Akim Demaille <akim@epita.fr>
9670
9671 * data/glr.c (b4_syncline): Fix (swap) the definitions of
9672 b4_at_dollar and b4_dollar_dollar.
9673
9674 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
9675
9676 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
9677 and Pennello's paper.
9678
9679 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
9680
9681 * data/yacc.c (yyparse): Undo previous patch. Instead,
9682 set yylsp[0] and yyvsp[0] only if the initial action
9683 sets yylloc and yylval, respectively.
9684
9685 * data/yacc.c (yyparse): In the initial action, set
9686 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
9687 This avoids the use of undefined variables if the initial
9688 action does not set yylloc and/or yylval.
9689
9690 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
9691
9692 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
9693 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
9694 Remove from CVS. These files are automatically generated.
9695 * examples/extexi: Clarify that this file is now part of Bison,
9696 not GNU M4, and that it works with any POSIX-compatible Awk.
9697 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
9698 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
9699 so that we also get calc++-parser.yy. Geneate it.
9700 Use $(AWK), not gawk, since any conforming Awk will do.
9701 Put comment before action, since older 'make' can't handle comment
9702 in action.
9703 $(BUILT_SOURCES): List all built sources, not just some of them.
9704 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
9705 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
9706 $($(calc_sources_generated)): Remove unnecessary test for existence
9707 of target. (This had a shell syntax error anyway; a stray "x".)
9708 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
9709 calc++-parser.yy.
9710 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
9711
9712 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
9713 implied by the other modules.
9714
9715 2005-07-06 Akim Demaille <akim@epita.fr>
9716
9717 Bind examples/calc++ to the package.
9718 * examples/calc++/Makefile: Remove, replaced by...
9719 * examples/calc++/Makefile.am: ... this new file.
9720 * examples/calc++/test: Remove input.
9721 * examples/calc++/compile: Remove.
9722 * examples/Makefile.am: New.
9723 * configure.ac, Makefile.am: Adjust.
9724 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
9725
9726 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
9727
9728 * data/glr.c (yyFail): Drastically simplify; since the format argument
9729 never had any % directives, we can simply pass it to yyerror.
9730 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
9731 be modified later, as that is the usual style in glr.c.
9732 Problems reported by Paul Hilfinger.
9733
9734 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
9735 and size overflow errors.
9736 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
9737 in case the user prolog sets feature-test macros like _GNU_SOURCE.
9738 (YYSIZEMAX): New macro.
9739 (yystpcpy): New function, taken from yacc.c.
9740 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
9741 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
9742 so that we don't have to maintain their signatures.
9743 (yyFail): Check for buffer overflow, by using vsnprintf rather
9744 than vsprintf. Allocate a bigger buffer if possible.
9745 Report an error if buffer allocation fails.
9746 (yyStackOverflow): New function.
9747 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
9748 the initialization was successful. It might fail if storage was
9749 exhausted.
9750 (yyexpandGLRStack): Add more checks for storage allocation failure.
9751 Use yyStackOverflow to report failures.
9752 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
9753 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
9754 Don't assume stack number fits in int.
9755 (yysplitStack): Check for storage allocation failure.
9756 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
9757 can print diagnostics on storage allocation failure. All callers
9758 changed.
9759 (yyresolveValue): Use yybool for boolean.
9760 (yyreportSyntaxError): Check for size-calculation overflow.
9761 This code is taken from yacc.c.
9762 (yyparse): Check for storage allocation errors when allocating
9763 the initial stack.
9764
9765 2005-07-05 Akim Demaille <akim@epita.fr>
9766
9767 Extract calc++ from the documentation.
9768 * doc/bison.texinfo (Calc++): Add the extraction marks.
9769 * examples/extexi: New, from the aborted GNU Programming 2E.
9770 Separate the different paragraph of a file with empty lines.
9771 * examples/Makefile: Use it to extract the whole calc++ example.
9772
9773 2005-06-24 Akim Demaille <akim@epita.fr>
9774
9775 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
9776 class typedefs.
9777
9778 2005-06-22 Akim Demaille <akim@epita.fr>
9779
9780 * doc/bison.texinfo (C++ Language Interface): First stab.
9781 (C++ Parsers): Remove.
9782
9783 2005-06-22 Akim Demaille <akim@epita.fr>
9784
9785 * data/lalr1.cc (yylex_): Honor %lex-param.
9786
9787 2005-06-22 Akim Demaille <akim@epita.fr>
9788
9789 Start a set of simple examples.
9790 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
9791 * examples/calc++/calc++-driver.hh,
9792 * examples/calc++/calc++-parser.yy,
9793 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
9794 * examples/calc++/compile, examples/calc++/test: New.
9795
9796 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
9797
9798 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
9799 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
9800 which stems from the 2005-05-27 patch.
9801
9802 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9803
9804 * data/glr.c: Modify treatment of unused parameters to permit use
9805 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
9806
9807 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
9808
9809 Fix infringement on user name space reported by Janos Zoltan Szabo.
9810 * data/yacc.c (yyparse): strlen -> yystrlen.
9811
9812 2005-05-30 Akim Demaille <akim@epita.fr>
9813
9814 * data/lalr1.cc (_): New.
9815 Translate the various messages.
9816
9817 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
9818
9819 Fix infringement on user name space reported by Bruno Haible.
9820 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
9821 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
9822 the user's name space.
9823 (alloca): Include <stdlib.h> to get it, if it's not built in.
9824 (YYMALLOC, YYFREE): Define only if needed.
9825 (malloc, free): Declare, but only if needed, as this infringes on
9826 the user name space.
9827
9828 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
9829
9830 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
9831 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
9832 with %d format.
9833 * lib/ebitset.c (min, max): Undef before defining.
9834 * lib/vbitset.c (min, max): Likewise.
9835 * lib/subpipe.c (create_subpipe): Save local variables in case
9836 vfork clobbers them.
9837
9838 2005-05-24 Bruno Haible <bruno@clisp.org>
9839
9840 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
9841 error message syntax used by gcc-4.0.
9842
9843 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
9844
9845 * README: Mention m4 1.4.3. Remove obsolete advice about
9846 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
9847
9848 * bootstrap: Remove workaround for problem I encountered with
9849 gettext 0.14.1; it seems to be fixed now.
9850
9851 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
9852
9853 * NEWS: Version 2.0a.
9854
9855 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
9856 the previous change.
9857
9858 Various maintainer cleanups.
9859 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
9860 conftest*, for benefit of CVS commands run at the same time as
9861 "configure". Add build-aux, since "bootstrap" now creates it and
9862 its subfiles.
9863 * Makefile.cfg (move_if_change): Remove.
9864 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
9865 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
9866 (po_repo, do-po-update, po-update, wget_files, get-targets):
9867 (config.guess-url_prefix, config.sub-url_prefix):
9868 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
9869 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
9870 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
9871 Remove.
9872 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
9873 this is now the recommended name.
9874 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
9875 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
9876 ylwrap. These files now go into build-aux.
9877 * config/move-if-change: Remove.
9878 * config/prev-version.txt: Bump from 1.75 to 2.0.
9879
9880 * bootstrap: Add stdio-safer, unistd-safer modules.
9881 Remove m4/glibc2.m4 (introduced by latest gnulib, but
9882 we don't need it).
9883 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
9884 fopen-safer.c, stdio-safer.h, unistd-safer.h.
9885 * lib/subpipe.c: Include "unistd-safer.h".
9886 (create_subpipe): Make sure all the newly-created
9887 file descriptors are > 2, so that diagnostics don't
9888 get sent down them (which might cause Bison to hang, in theory).
9889 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
9890 * src/files.c (xfopen): Use fopen_safer, not fopen.
9891
9892 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
9893 yesterday's yacc.c fix.
9894
9895 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
9896
9897 * data/glr.c, data/lalr1.cc: Update copyright date.
9898
9899 Fix a destructor bug reported by Wolfgang Spraul in
9900 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
9901 * data/yacc.c (yyabortlab): Don't call destructor, and
9902 don't set yychar to EMPTY.
9903 (yyoverflowlab): Don't call destructor.
9904 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
9905 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
9906 since we no longer output the message "discarding lookahead token
9907 end of input ()".
9908
9909 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9910
9911 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
9912 fix a small glitch in debugging output.
9913 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
9914 after YY_SYMBOL_PRINT where needed.
9915
9916 (struct yyGLRState): Add some comments.
9917 (struct yySemanticOption): Add some comments.
9918 (union yyGLRStackItem): Add comment.
9919
9920 (yymergeOptionSets): Correct this to properly perform the union,
9921 avoiding infinite reported by Michael Rosien.
9922 Update comment.
9923
9924 * tests/glr-regression.at: Add test for GLR merging error reported
9925 by M. Rosien.
9926
9927 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
9928
9929 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
9930 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
9931 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
9932 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
9933 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
9934 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
9935 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
9936 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
9937 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
9938 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
9939 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
9940 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
9941 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
9942 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
9943 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
9944 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
9945 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
9946 src/derives.h, src/files.c, src/files.h, src/getargs.c,
9947 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
9948 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
9949 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
9950 src/output.h, src/parse-gram.c, src/parse-gram.h,
9951 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
9952 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
9953 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
9954 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
9955 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
9956 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
9957 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
9958 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
9959 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
9960 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
9961 tests/reduce.at, tests/regression.at, tests/sets.at,
9962 tests/synclines.at, tests/testsuite.at, tests/torture.at:
9963 Update FSF postal mail address.
9964
9965 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
9966
9967 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
9968 Problem reported by Ralf Menzel.
9969
9970 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
9971
9972 * tests/actions.at: Test that stack overflow invokes destructors.
9973 From Marcus Holland-Moritz.
9974 * data/yacc.c (yyerrlab): Move the code that destroys the stack
9975 from here....
9976 (yyreturn): to here. That way, destructors are called properly
9977 even if the stack overflows, or the user calls YYACCEPT or
9978 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
9979 (yyoverflowlab): Destroy the lookahead.
9980
9981 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
9982
9983 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
9984
9985 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
9986
9987 * NEWS: Bison-generated C parsers no longer quote literal strings
9988 associated with tokens.
9989 * src/output.c (prepare_symbols): Don't escape strings,
9990 since users don't want to see C escapes.
9991 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
9992 in diagnostics.
9993 * tests/input.at (Torturing the Scanner): Likewise.
9994 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
9995
9996 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9997
9998 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9999 the data size is known to be too small and we can't increase it.
10000 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10001
10002 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10003
10004 * src/parse-gram.y: Include quotearg.h.
10005 (string_as_id): Quote $1 before using it as a key, since the
10006 lexer no longer quotes it for us.
10007 (string_content): Don't strip quotes, since lexer no longer
10008 quotes it for us.
10009 * src/scan-gram.l: Include quotearg.h.
10010 ("\""): Omit quote.
10011 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10012 a key, since the rest of the lexer doesn't quote it.
10013 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10014 * tests/regression.at (Token definitions): Check for backslashes
10015 in token strings.
10016
10017 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10018 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10019 (yyparse): Revamp code to generate long syntax error message, to
10020 make it easier to translate, and to avoid problems with arithmetic
10021 overflow. Change "virtual memory" to "memory" in diagnostic, since
10022 we don't know whether the memory is virtual.
10023
10024 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10025
10026 * NEWS: Bison-generated C parsers now use the _ macro to
10027 translate strings.
10028 * data/yacc.c (_) [!defined _]: New macro.
10029 All English strings wrapped inside this macro.
10030 * doc/bison.texinfo (Bison Parser): Document _.
10031 * po/POTFILES.in: Include src/parse-gram.c, since it now
10032 includes translateable strings that parse-gram.y doesn't.
10033
10034 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10035
10036 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10037 reverting the 2004-10-11 change to this function.
10038 (symbol_check_alias_consistency): Don't call symbol_type_set
10039 if the type name is already correct.
10040 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10041
10042 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10043
10044 * tests/regression.at (Token definitions): Don't use a token named
10045 c, as that generates a "#define c ..." that runs afoul of buggy
10046 stdlib.h that uses the identifier c as a member of struct
10047 drand48_data. Problem reported by Horst Wente.
10048
10049 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10050
10051 * bootstrap: Change translation URL from
10052 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10053 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10054 redirection glitches. Problem reported by twlevo@xs4all.nl.
10055
10056 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10057
10058 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10059 after operands; POSIX says this isn't portable for the c99 command.
10060
10061 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10062
10063 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10064 immediately if a data overrun has occurred; this may help us track
10065 down what may be a spurious failure on MacOS.
10066
10067 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10068
10069 Respond to problems reported by twlevo@xs4all.nl.
10070
10071 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10072
10073 * src/vcg.h: Comment fix.
10074 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10075 (G_CMAX): Change to -1 instead of INT_MAX.
10076
10077 * data/yacc.c (yyparse): Omit spaces before #line.
10078
10079 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10080
10081 * src/tables.c (state_number_to_vector_number): Put it inside an
10082 "#if 0", since it's not currently used. Problem reported by
10083 Roland McGrath.
10084
10085 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10086
10087 * src/output.c (escaped_output): Renamed from
10088 escaped_file_name_output, since we now use it for symbol tags as
10089 well. All uses changed.
10090 (symbol_destructors_output, symbol_printers_output):
10091 Escape symbol tags too.
10092 Problem reported by Matyas Forstner in
10093 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10094
10095 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10096 not needed.
10097 * src/output.c (user_actions_output, token_definitions_output,
10098 symbol_destructors_output, symbol_printers_output): Likewise.
10099 * src/reader.c (prologue_augment): Likewise.
10100 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10101
10102 * src/vcg.c (output_edge): Don't quote linestyle arg.
10103 Problem reported by twlevo@xs4all.nl.
10104
10105 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10106
10107 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10108 example, reported by Derek M Jones. Also, make the example even
10109 more outrageous, to better illustrate how bad the problem is.
10110
10111 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10112
10113 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10114 putsym. Typo reported by Sebastian Piping.
10115
10116 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10117
10118 * doc/bison.texinfo (Language and Grammar): some -> same
10119 (Epilogue): int he -> in the
10120 Typos reported by Sebastian Piping via Justin Pence.
10121
10122 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10123
10124 * tests/glr-regression.at (Improper handling of embedded actions
10125 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10126 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10127 with dollar signs in test names.
10128 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10129 for a similar reason.
10130
10131 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10132
10133 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10134 wants to redefine G_VIEW.
10135
10136 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10137
10138 * src/vcg.c (get_view_str): Remove case for normal_view.
10139 Problem reported by twlevo@xs4all.nl.
10140
10141 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10142
10143 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10144 Problem reported by twlevo@xs4all.nl.
10145
10146 * doc/bison.texinfo: Change @dircategory from "GNU programming
10147 tools" to "Software development". Requested by Richard Stallman
10148 via Karl Berry.
10149
10150 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
10151
10152 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
10153 Problem reported by twlevo@xs4all.nl.
10154
10155 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
10156
10157 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
10158 keyword; it's not needed with modern compilers, and it doesn't
10159 affect correctness with older compilers. Suggested by
10160 twlevo@xs4all.nl.
10161
10162 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
10163
10164 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
10165 gcc -Wswitch-default.
10166 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10167 * data/yacc.c (yyparse): Likewise.
10168
10169 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
10170
10171 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
10172 already. Let config.h define any nonstandard values.
10173
10174 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
10175
10176 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
10177 for the benefit of slower hosts. Problem reported by
10178 Nelson H. F. Beebe.
10179
10180 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
10181
10182 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
10183 being defined and not used.
10184 * data/lalr1.cc (yyparse): Likewise.
10185 Use "if (false)" rather than "if (0)".
10186
10187 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
10188
10189 * TODO: Mention that we should allow NUL bytes in tokens.
10190
10191 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
10192
10193 * src/scan-skel.l (<<EOF>>): Don't close standard output.
10194 Problem reported by Hans Aberg.
10195
10196 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
10197
10198 * src/getargs.c (version): Happy new year; update overall
10199 program copyright date from 2004 to 2005.
10200
10201 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
10202 Problem reported by Hans Aberg.
10203 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
10204 (Output file names.): Add a test for the case when standard output
10205 is closed.
10206
10207 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
10208
10209 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
10210 to fix an oversight in the Bison 2.0 manual.
10211
10212 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
10213
10214 * NEWS: Version 2.0. Reformat the existing news items since
10215 1.875, so that related items are grouped together.
10216 * configure.ac (AC_INIT): Bump version to 2.0.
10217 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
10218
10219 * tests/torture.at (Exploding the Stack Size with Alloca): Set
10220 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
10221 otherwise, we're not testing alloca. Unfortunately there's no
10222 simple way to consult HAVE_ALLOCA here.
10223
10224 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
10225 for yymsg, too.
10226
10227 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
10228 hand. This avoids a warning about comparing int to size_t when
10229 GCC warnings are enabled.
10230
10231 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
10232
10233 * NEWS: Bison-generated parsers no longer default to using the
10234 alloca function (when available) to extend the parser stack, due
10235 to widespread problems in unchecked stack-overflow detection.
10236 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
10237 responsibility to set it to a positive value. This lets the user
10238 specify a value that is not a preprocessor constant.
10239 * data/yacc.c (YYMAXDEPTH): Likewise.
10240 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
10241 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
10242 to be a compile-time constant. However, explain the constraints on it.
10243 Also, explain the constraints on YYINITDEPTH.
10244 (Table of Symbols): Explain that alloca is no longer the default.
10245 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
10246 to 1.
10247
10248 * doc/bison.texinfo (Location Default Action): Mention that n must
10249 be zero when k is zero. Suggested by Frank Heckenbach.
10250
10251 2004-12-22 Akim Demaille <akim@epita.fr>
10252
10253 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
10254 (parser::state_type, parser::semantic_type, parser::location_type):
10255 Private, not public.
10256 (parser::parse): Return ints, not bool.
10257 Returning a bool introduces a problem: 0 corresponds to false, and
10258 it seems weird to return false on success. Returning true changes
10259 the conventions for yyparse.
10260 Alternatively we could return void and send an exception.
10261 There is no clear consensus (yet?).
10262 (state_stack, semantic_stack, location_stack): Rename as...
10263 (state_stack_type, semantic_stack_type, location_stack_type): these.
10264 Private, not public.
10265 * tests/c++.at: New.
10266 * tests/testsuite.at, tests/Makefile.am: Adjust.
10267
10268 2004-12-21 Akim Demaille <akim@epita.fr>
10269
10270 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
10271
10272 2004-12-21 Akim Demaille <akim@epita.fr>
10273
10274 Don't impose std::string for filenames.
10275
10276 * data/lalr1.cc (b4_filename_type): New.
10277 (position::filename): Use it.
10278 (parser.hh): Move the inclusion of stack.hh and location.hh below
10279 the user code, so that needed headers for the filename type can be
10280 included first.
10281 Forward declare them before the user code.
10282 * tests/Makefile.am (check-local, installcheck-local): Pass
10283 TESTSUITEFLAGS to the TESTSUITE.
10284
10285 2004-12-20 Akim Demaille <akim@epita.fr>
10286
10287 Use more STL like names: my_class instead of MyClass.
10288
10289 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
10290 (SemanticStack, SemanticType, StateStack, StateType)
10291 (TokenNumberType, Stack, Slice, Traits, Parser::location)
10292 (Parser::value): Rename as...
10293 (location_stack, location_type, rhs_number_type, semantic_stack)
10294 (semantic_type, state_stack, state_type, token_number_type, stack)
10295 (slice, traits, parser::yylloc, parser::yylval): these.
10296
10297 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
10298
10299 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
10300
10301 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
10302 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10303
10304 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
10305
10306 Remove uses of 'short int' and 'unsigned short int'. This raises
10307 some arbitrary limits. It uses more memory but nowadays that's
10308 not much of an issue.
10309
10310 This change does not affect the generated parsers; that's a different
10311 task, as some users will want to conserve memory there.
10312
10313 Ideally we should use size_t to represent all object counts, and
10314 something like ptrdiff_t to represent signed differences of object
10315 counts; but that will require more code-cleanup than I have the
10316 time to do right now.
10317
10318 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
10319 Use size_t, not int or short int, to count objects.
10320 * src/closure.c (nritemset, closure): Likewise.
10321 * src/closure.h (nritemset, closure): Likewise.
10322 * src/nullable.c (nullable_compute): Likewise.
10323 * src/print.c (print_core): Likewise.
10324 * src/print_graph.c (print_core): Likewise.
10325 * src/state.c (state_compare, state_hash): Likewise.
10326 * src/state.h (struct state): Likewise.
10327 * src/tables.c (default_goto, goto_actions): Likewise.
10328
10329 * src/gram.h (rule_number, rule): Use int, not short int.
10330 * src/output.c (prepare_rules): Likewise.
10331 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
10332 errs, reductions): Likewise.
10333 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
10334 Likewise.
10335 * src/tables.c (vector_number, tally, action_number,
10336 ACTION_NUMBER_MINIMUM): Likewise.
10337 * src/output.c (muscle_insert_short_int_table): Remove.
10338
10339 2004-12-17 Akim Demaille <akim@epita.fr>
10340
10341 * data/lalr1.cc: Extensive Doxygenation.
10342 (error_): Rename as...
10343 (error): this, since it is visible to the user.
10344 Adjust callers.
10345 (Parser::message): Now an automatic variable from...
10346 (Parser::yyreport_syntax_error_): here.
10347 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
10348 Parser::error.
10349 * tests/input.at: Escape $.
10350
10351 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
10352
10353 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
10354 Parenthesize rhs to avoid obscure problems with mistakes like
10355 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
10356 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10357 b4_rhs_location): Likewise.
10358 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10359 b4_rhs_location): Likewise.
10360
10361 2004-12-16 Akim Demaille <akim@epita.fr>
10362
10363 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
10364 yacc.c: be sure to stay within yycheck_.
10365 * tests/actions.at: Re-enable C++ tests.
10366
10367 2004-12-16 Akim Demaille <akim@epita.fr>
10368
10369 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
10370 real.
10371
10372 2004-12-16 Akim Demaille <akim@epita.fr>
10373
10374 Use #define to handle the %name-prefix.
10375
10376 * data/glr.c, data/yacc.c: Comment changes.
10377 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
10378 so that one can refer to yylex in the parser file, and have it
10379 renamed, as is the case with other skeletons.
10380
10381 2004-12-16 Akim Demaille <akim@epita.fr>
10382
10383 Move lalr1.cc internals into yy*.
10384
10385 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
10386 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
10387 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
10388 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
10389 (empty_, final_, terror_, errcode_, ntokens_)
10390 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
10391 (looka_, ilooka_, error_range_, nerrs_):
10392 Rename as...
10393 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
10394 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
10395 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
10396 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
10397 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
10398 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
10399 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
10400 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
10401 these.
10402
10403 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
10404
10405 Fix some problems reported by twlevo at xs4all.
10406 * src/symtab.c (symbol_new): Report an error if the input grammar
10407 contains too many symbols. This is better than calling abort() later.
10408 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
10409 (struct node, struct graph):
10410 Rename member expand to stretch. All uses changed.
10411 (struct graph): Remove member layoutalgorithm. All uses removed.
10412 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
10413 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
10414 All uses changed.
10415 (N_STRETCH): Rename from N_EXPAND. All uses changed.
10416
10417 2004-12-15 Akim Demaille <akim@epita.fr>
10418
10419 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
10420 Add more Doxygen comments.
10421 (symprint_, stack_print_, reduce_print_, destruct_, pop)
10422 (report_syntax_error_, translate_): Rename as...
10423 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
10424 (yypop_, yyreport_syntax_error_, yytranslate_): this.
10425
10426 2004-12-15 Akim Demaille <akim@epita.fr>
10427
10428 * data/lalr1.cc (lex_): Rename as...
10429 (yylex_): this.
10430 Move the trace here.
10431 Take the %name-prefix into account.
10432 Reported by Alexandre Duret-Lutz.
10433
10434 2004-12-15 Akim Demaille <akim@epita.fr>
10435
10436 Simplify the C++ parser constructor.
10437
10438 * data/lalr1.cc (debug_): Rename as...
10439 (yydebug_): so that the parser's internals are always in the yy*
10440 pseudo namespace.
10441 Adjust uses.
10442 (b4_parse_param_decl): Remove the leading comma as it is now only
10443 called as unique argument list.
10444 (Parser::Parser): Remove the constructor accepting a location and
10445 an initial debugging level.
10446 Remove from the other ctor the argument for the debugging level.
10447 (debug_level_type, debug_level, set_debug_level): New.
10448
10449 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
10450 constructor calls.
10451
10452 2004-12-15 Akim Demaille <akim@epita.fr>
10453
10454 Remove b4_root related material: failure experiment
10455 (which goal was to allow to derive from a class).
10456
10457 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
10458 definitions and uses.
10459
10460 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
10461
10462 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
10463 not 2, since it's not portable to subtract 1 from the start of an
10464 array. The new item 0 is never set or used. All uses changed.
10465
10466 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
10467 the default definition of YYLLOC_DEFAULT. Problem reported
10468 by Frank Heckenbach.
10469
10470 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
10471
10472 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
10473 the normal case and one for the error case. Just use the
10474 first one uniformly. Problem reported by Frank Heckenbach.
10475 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
10476 use exactly the same macro in both places.
10477 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
10478 so that the normal-case YYRHSLOC works for the error case too.
10479 All uses changed.
10480 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
10481 (YYLLOC_DEFAULT): Use the same macro as glr.c.
10482 * doc/bison.texinfo (Location Default Action): Don't claim that
10483 we have an array of locations. Use the same macro for both glr
10484 and lalr parsers. Mention YYRHSLOC. Mention what happens when
10485 the index is 0.
10486
10487 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10488
10489 * HACKING: Update email addresses to send announcements to.
10490
10491 * configure.ac (AC_INIT): Bump version to 1.875f.
10492
10493 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10494
10495 * NEWS: Version 1.875e.
10496 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
10497
10498 * src/scan-skel.l: Include "complain.h", for "fatal".
10499
10500 * src/relation.h (relation_print, relation_digraph):
10501 Relation sizes are of type relation_node, not size_t (this is
10502 merely a doc fix, since the two types are equivalent).
10503 (relation_transpose): Relation sizes are of type relation_node,
10504 not int.
10505 * src/relation.c: Likewise.
10506 (top, infinity): Now of type relation_node, not int.
10507 (traverse, relation_transpose): Use relation_node, not int.
10508
10509 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
10510 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
10511 (yyparse): Remove unused local introduced in 2004-10-25 patch.
10512
10513 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
10514 specifying whether the test should be skipped. Use it tp
10515 specify that the [%defines %skeleton "lalr1.cc"] tests currently
10516 fail on some hosts, and should be skipped.
10517
10518 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
10519
10520 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
10521 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
10522 unless otherwise specified below.
10523
10524 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
10525 to allocate kernel_base, kernel_items, kernel_size, since
10526 they needn't be initialized to 0.
10527 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
10528 * src/closure.c (new_closure): Likewise, for itemset.
10529 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
10530 * src/lalr.c (set_goto_map): Likewise, for temp_map.
10531 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
10532 (build_relations): Likewise for edge, states1, includes.
10533 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
10534 * src/reader.c (packgram): Likewise, for ritem, rules.
10535 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
10536 * src/relation.c (relation_digraph): Likewise for VERTICES.
10537 (relation_transpose): Likewise for new_R, end_R.
10538 * src/symtab.c (symbols_token_translations_init): Likewise for
10539 token_translations.
10540 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
10541 (token_actions): Likewise for yydefact, actrow, conflrow,
10542 conflict_list.
10543 (save_column): Likewise for froms[symno], tos[symno].
10544 (goto_actions): Likewise for state_count.
10545 (pack_table): Likewise for base, pos, check.
10546 (tables_generate): Likewise for width.
10547
10548 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
10549 for initial core. Just have a separate core, so we needn't worry
10550 about whether kernel_size and kernel_base are initialized.
10551
10552 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
10553 kernel_size, kernel_items): Remove unnecessary initialization.
10554 * src/conflicts.c (conflicts): Likewise.
10555 * src/derives.c (derives): Likewise.
10556 * src/muscle_tablc (muscle_insert): Likewise.
10557 * src/relation.c (relation_digraph): Likewise.
10558 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
10559 conflrow, conflict_table, conflict_list, table, check):
10560 Likewise.
10561
10562 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
10563 This is because all callers pass unsigned int.
10564 * src/closure.h (new_closure): Likewise.
10565
10566 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
10567 (build_relations): Initialize includes[i] in all cases.
10568 * src/reader.c (packgram): Always initialize rules[ruleno].prec
10569 and rules[ruleno].precsym. Initialize members in order.
10570 * src/relation.c (relation_transpose): Always initialize new_R[i]
10571 and end_R[i].
10572 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
10573
10574 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
10575 conflict_list[0] was always 0, but now it isn't initialized.
10576
10577 * src/table.c (table_grow): When conflict_table grew, the grown
10578 area wasn't cleared. Fix this.
10579
10580 * lib/.cvsignore: Add strdup.c, strdup.h.
10581 * m4/.cvsignore: Add strdup.m4.
10582
10583 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
10584
10585 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
10586 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
10587 GOTO_NUMBER_MAXIMUM, since we occasionally compute
10588 ngotos + 1 without checking for overflow.
10589 (build_relations): Use END_NODE, not -1, to denote end of edges.
10590 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
10591 build_relations): Use goto_number, not int, for goto numbers.
10592 * src/tables.c (save_column, default_goto): Likewise.
10593
10594 2004-11-23 Akim Demaille <akim@epita.fr>
10595
10596 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
10597 of #defining from yystype.
10598 Don't typedef yystype, C++ does not need it.
10599 This lets it possible to forward declare it as union.
10600
10601 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
10602
10603 * bootstrap (gnulib_modules): Add extensions.
10604 Problem reported by Jim Meyering.
10605
10606 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
10607
10608 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
10609 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
10610 src/system.h, src/tables.c: XFREE -> free, to accommodate
10611 recent change to gnulib xalloc.h.
10612 Problem reported by Jim Meyering.
10613
10614 2004-11-17 Akim Demaille <akim@epita.fr>
10615
10616 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
10617
10618 2004-11-17 Akim Demaille <akim@epita.fr>,
10619 Alexandre Duret-Lutz <adl@gnu.org>
10620
10621 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
10622 changes.
10623 (YYCDEBUG): Adjust.
10624 Use it instead of cdebug_.
10625 (Parser::debug_stream, Parser::set_debug_stream): New.
10626 (Parser::symprint_): Define cdebug_ for temporary backward
10627 compatibility.
10628 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
10629 debug_stream ().
10630
10631 2004-11-17 Akim Demaille <akim@epita.fr>
10632
10633 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
10634 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
10635 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
10636 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10637
10638 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
10639
10640 * data/glr.c (yyloc_default): Remove; not used.
10641 Problem reported by Frank Heckenbach.
10642
10643 2004-10-25 Akim Demaille <akim@epita.fr>
10644
10645 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
10646 Introduce another definition to address simple location arrays.
10647 (yyGLRStack): New member: yyerror_range.
10648 (yyrecoverSyntaxError, yyparse): Update it.
10649 (yyrecoverSyntaxError): Use it when shifting the error token to
10650 have an accurate range, equivalent to the one computed by both
10651 yacc.c and lalr1.cc.
10652 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
10653 that column numbers start at column 0, as per GNU Coding
10654 Standards, the others tests, and the doc.
10655 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
10656 Adjust to the above change (first column is 0).
10657 And adjust the location of the "<error>", now covering the whole
10658 line.
10659
10660 2004-10-22 Akim Demaille <akim@epita.fr>
10661 and Paul Eggert <eggert@cs.ucla.edu>
10662
10663 Remove some arbitrary limits on goto numbers and relations.
10664 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
10665 initial values, since they're never used.
10666 (set_goto_map): ngotos is now unsigned, so test for overflow
10667 by seeing whether it wraps around to zero.
10668 * src/lalr.h (goto_number): Now size_t, not short int.
10669 (GOTO_NUMBER_MAXIMUM): Remove.
10670 * src/relation.c (relation_print, traverse, relation_transpose):
10671 Check for END_NODE rather than looking at sign.
10672 * src/relation.h (END_NODE): New macro.
10673 (relation_node): Now size_t, not short int.
10674
10675 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
10676
10677 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
10678 keyword, not an identifier. Problem reported by Baron Schwartz in
10679 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
10680
10681 2004-10-11 Akim Demaille <akim@epita.fr>
10682
10683 * src/symtab.c (symbol_check_alias_consistency): Also check
10684 type names, destructors, and printers.
10685 Reported by Alexandre Duret-Lutz.
10686 Recode the handling of associativity and precedence in terms
10687 of symbol_precedence_set.
10688 Accept no redeclaration at all, not even equal to the previous
10689 value.
10690 (redeclaration): New.
10691 Use it to factor redeclaration complaints.
10692 (symbol_make_alias): Don't set the type of the alias, let
10693 symbol_check_alias_consistency do it as for other features.
10694 * src/symtab.h (symbol): Add new member prec_location, and
10695 type_location.
10696 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
10697 * tests/input.at (Incompatible Aliases): New.
10698
10699 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
10700
10701 .cvsignore fixes to accommodate gnulib changes,
10702 and the practice of naming build directories "_build".
10703 * .cvsignore: Add "_*". Sort.
10704 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
10705 * m4/.cvsignore: Add "*_gl.m4".
10706
10707 2004-10-06 Akim Demaille <akim@epita.fr>
10708
10709 * src/parse-gram.y (add_param): Fix the truncation of trailing
10710 spaces.
10711
10712 2004-10-05 Akim Demaille <akim@epita.fr>
10713
10714 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
10715 whether the reducion was empty or not. This leaves room to
10716 improve the use of YYLLOC_DEFAULT in such a case.
10717 lalr1.cc is still experimental, so changing this is acceptable.
10718 And finally, there are probably not many users who changed the
10719 handling of locations in GLR, so changing is admissible too.
10720
10721 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
10722 empty reduction, set @$ to an empty location ending the previously
10723 stacked symbol.
10724 Adjust uses to make sure the code is triggered on empty
10725 reductions.
10726 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
10727 expected output: empty reductions have empty locations.
10728
10729 2004-09-29 Akim Demaille <akim@epita.fr>
10730
10731 * data/lalr1.cc: Move towards a more standard C++ coding style
10732 for templates: Class < T > -> Class<T>.
10733
10734 2004-09-29 Akim Demaille <akim@epita.fr>
10735
10736 * data/lalr1.cc: Reinstall the former ctor, for sake of
10737 compatibility, but warn it will be removed.
10738 Move towards a more standard C++ coding style (i.e., type *var ->
10739 type* var).
10740
10741 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
10742
10743 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
10744 since it's less likely to work if NULs are involved in the future.
10745
10746 2004-09-27 Akim Demaille <akim@epita.fr>
10747
10748 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
10749
10750 2004-09-27 Akim Demaille <akim@epita.fr>
10751
10752 * data/lalr1.cc (b4_parse_param_decl_1): New.
10753 (b4_parse_param_decl): Use it to have different names between attribute
10754 and argument names.
10755 (b4_cc_constructor_call): Likewise.
10756
10757 2004-09-24 Akim Demaille <akim@epita.fr>
10758
10759 * src/parse-gram.y (add_param): Strip the leading and trailing
10760 blanks from a formal argument declaration.
10761 (YY_LOCATION_PRINT): New.
10762
10763 2004-09-24 Akim Demaille <akim@epita.fr>
10764
10765 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
10766 after the location.
10767
10768 2004-09-24 Akim Demaille <akim@epita.fr>
10769
10770 * doc/bison.texinfo (Table of Symbols): Sort.
10771
10772 2004-09-21 Akim Demaille <akim@epita.fr>
10773
10774 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
10775 the useless parentheses.
10776 Suggested by Paul Eggert.
10777
10778 2004-09-20 Akim Demaille <akim@epita.fr>
10779
10780 Let the initial-action act on the look-ahead, and use it for the
10781 "initial push" (corresponding to an hypothetical beginning-of-file).
10782 And let lalr1.cc honor %initial-action.
10783
10784 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
10785 example.
10786 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
10787 (Parser::Parser): Remove the ctor that used to initialize it.
10788 (Parser::parse): Like in the other skeletons, issue the "starting
10789 parse" message before any action.
10790 Honor %initial-action.
10791 Initialize the stacks with the lookahead.
10792 * data/yacc.c: Let $$ and @$ in %initial-action designate the
10793 look-ahead.
10794 Push them in the stacks.
10795 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
10796
10797 2004-09-20 Akim Demaille <akim@epita.fr>
10798
10799 * doc/bison.texinfo (Initial Action Decl): New.
10800
10801 2004-09-20 Akim Demaille <akim@epita.fr>
10802
10803 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
10804 clearer criterion to define it.
10805 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
10806 When reducing on an empty RHS, use the latest stacked location as
10807 location.
10808 yylloc is not always available.
10809 * data/glr.c: Likewise.
10810 Also, honor initial-actions.
10811
10812 2004-09-20 Akim Demaille <akim@epita.fr>
10813
10814 * data/yacc.c (YY_LOCATION_PRINT): New.
10815 Define when we know YYLTYPE's structure, i.e., when the default
10816 YYLLOC_DEFAULT is used.
10817 * data/c.m4 (b4_yysymprint_generate): Use it.
10818 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
10819 value of the result.
10820 (error_start_): Replace with...
10821 (error_range_): this location array.
10822 This allows to replace code relying on the implementation of
10823 locations by portable code.
10824 * data/yacc.c (yylerrsp): Replace with...
10825 (yyerror_range): this.
10826 Every time a token is popped, update yyerror_range[0], to have an
10827 accurate location for the error token.
10828 * data/glr.c (YY_LOCATION_PRINT): New.
10829 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
10830 deference a pointer.
10831 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
10832 report the location in %printers.
10833
10834 * src/scan-skel.l: Instead of abort, report error messages to ease
10835 understanding skeleton scanning failures.
10836
10837 2004-09-16 Akim Demaille <akim@epita.fr>
10838
10839 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
10840 (iterator, const_iterator): these, to be more in the C++ spirit.
10841 Also, return reverse iterators so that when displaying the stack
10842 we display its bottom first.
10843 (Parser::stack_print_, Parser::reduce_print_): Match the messages
10844 from yacc.c.
10845 We should probably use vector here though.
10846
10847 2004-09-16 Akim Demaille <akim@epita.fr>
10848
10849 Have more complete shift traces.
10850
10851 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
10852 to report Shifts instead of ad hoc YYDPRINTF invocations,
10853 including for the error token.
10854 * data/lalr1.cc (symprint_): Output the location.
10855 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
10856 output the location within the %printer.
10857 Activate GLR tests, at least to make sure they compile properly.
10858 They still don't pass though.
10859 * tests/calc.at: Adjust expect verbose output, since now "Entering
10860 state..." is on a different line than the "Shifting" message.
10861
10862 2004-09-08 Akim Demaille <akim@epita.fr>
10863
10864 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
10865 Bison directive from the Bison file to the invocation of this
10866 macro, so that these directives are passed to
10867 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
10868 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
10869 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
10870 the extra Bison directives instead of the whole series.
10871 Change the grammar so that there are recoverable errors, and
10872 unrecoverable errors. Now we can have the parser give up before
10873 consuming the whole input. As a result we now can observe that
10874 the lookahead is freed when needed.
10875 Change the parser source to parse argv[1] instead of a hard coded
10876 string.
10877 Simplify yylex, and give a value and location to EOF.
10878 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
10879 passed directives already coded in the file.
10880 Add some tests to check the location of "error".
10881 For some tests, the C++ parser is correct, and not yacc.c.
10882 For other tests, they provide different, but unsatisfying, values,
10883 so keep the C++ value so that at least one parser is "correct"
10884 according to the test suite.
10885 (Actions after errors): Remove, this is subsumed by the
10886 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
10887
10888 2004-09-06 Akim Demaille <akim@epita.fr>
10889
10890 * data/lalr1.cc: Adjust the indentation of the labels.
10891 (Parser::pop): New.
10892 Use it.
10893
10894 2004-09-06 Akim Demaille <akim@epita.fr>
10895
10896 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
10897 argument, an informative message.
10898 Call YY_SYMBOL_PRINT.
10899 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
10900 * data/lalr1.cc (destruct_): Likewise.
10901 In addition, no longer depend on b4_yysymprint_generate and
10902 b4_yydestruct_generate to generate these functions, do it "by
10903 hand".
10904
10905 2004-09-03 Akim Demaille <akim@epita.fr>
10906
10907 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
10908 invoked, yydestruct the lookahead.
10909 * tests/calc.at (Calculator $1): Update the expected lengths of
10910 traces: there is an added line for the discarded lookahead.
10911 * doc/bison.texinfo (Destructor Decl): Some rewording.
10912 Define "discarded" symbols.
10913
10914 2004-09-02 Akim Demaille <akim@epita.fr>
10915
10916 * data/lalr1.cc (translate_, destruct_): No reason to be static.
10917
10918 2004-09-02 Akim Demaille <akim@epita.fr>
10919
10920 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
10921 (YYDSYMPRINTF): Rename as...
10922 (YY_SYMBOL_PRINT): this.
10923 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
10924 two.
10925 Use it instead of direct symprint_ calls.
10926 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
10927 one.
10928
10929 2004-09-02 Akim Demaille <akim@epita.fr>
10930
10931 * data/lalr1.cc (b4_yysymprint_generate): New.
10932 (symprint_): New member function, defined when YYDEBUG.
10933 Use it consistently instead of token/nterm debugging output by
10934 hand.
10935 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
10936 %printer calls to use cdebug_ when using lalr1.cc.
10937
10938 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
10939
10940 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
10941 with #ifdef YYDEBUG.
10942
10943 2004-08-26 Akim Demaille <akim@epita.fr>
10944
10945 * doc/bison.texinfo (Implementing Loops): Rename as...
10946 (Implementing Gotos/Loops): this.
10947
10948 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
10949
10950 Adjust to latest gnulib.
10951 * bootstrap (gnulib_modules): Add xalloc-die.
10952 Set LC_ALL=C so that file names sort consistently.
10953 Prefer the gnulib copies of gettext.m4, glibc21.m4,
10954 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
10955 uintmax_t.m4, ulonglong.m4.
10956 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
10957 po.m4 since we are now using _gl.m4 instead.
10958
10959 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
10960
10961 * src/scan-action.l: Remove. Scanning of semantic actions is
10962 handled in scan-gram.l.
10963
10964 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
10965
10966 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
10967
10968 * src/location.h (struct): The file member is a uniqstr.
10969 (equal_boundaries): Use UNIQSTR_EQ for comparison.
10970
10971 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
10972
10973 Fix bug with non-%union parsers that have printers or destructors,
10974 which led to a Bison core dump. Reported by Peter Fales in
10975 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
10976
10977 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
10978 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
10979 not to our own type.
10980 * src/output.c (symbol_destructors_output, symbol_printers_output):
10981 Don't assume %union.
10982 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
10983 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
10984 UNION-FLAG. All callers changed.
10985 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
10986 Use type char, not unsigned int, when declaring an array of char;
10987 this lets us remove a cast.
10988 (Printers and Destructors): Add non-%union test cases.
10989
10990 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10991
10992 * doc/bison.texinfo: Minor editorial changes, mostly to the new
10993 GLR writeups. E.g., avoid frenchspacing and the future tense,
10994 change "lookahead" to "look-ahead", and change "wrt" to "with
10995 respect to".
10996
10997 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10998
10999 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11000 New sections, split off from the GLR Parsers section. Put the new
11001 Simple GLR Parser near the start of the GLR section, for clarity.
11002 Rewrite connective text.
11003
11004 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
11005
11006 * doc/bison.texinfo (Simple GLR Parsers): New section.
11007
11008 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11009
11010 * NEWS, TODO, doc/bison.texinfo:
11011 Use "look-ahead" instead of "lookahead", to be consistent.
11012 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11013 while we're fixing "look-ahead".
11014 * src/conflicts.c (shift_set): Renamed from shiftset.
11015 (look_ahead_set): Renamed from lookaheadset.
11016 * src/print.c: Likewise.
11017 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11018 name for "lookahead".
11019 (report_types, usage): Likewise.
11020 * src/getargs.h (report_look_ahead_tokens): Renamed from
11021 report_lookaheads.
11022 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11023 compute_lookaheads.
11024 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11025 (look_ahead_tokens_print): Renamed from lookaheads_print.
11026 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11027 state_rule_lookaheads_print.
11028 * src/state.h: Likewise.
11029 (reductions.look_ahead_tokens): Renamed from lookaheads.
11030 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11031 AT_DATA_LOOKAHEADS_GRAMMAR.
11032
11033 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11034
11035 * README: Update location of patched M4 distribution.
11036
11037 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11038
11039 Don't assume the C++ compiler takes the same arguments as the C compiler
11040 (trivial change).
11041 * configure.ac (O0CXXFLAGS): New var.
11042 * tests/atlocal.in (CXXFLAGS): Use it.
11043
11044 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11045
11046 Fix some "make check" problems with C++ reported by
11047 Albert Chin-A-Young for Tru64 C++ in this thread:
11048 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11049
11050 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11051 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11052 Output to a .cc file for C++, not to a .c file.
11053 * tests/calc.at (AT_CHECK_CALC): Likewise.
11054 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11055 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11056
11057 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11058
11059 * tests/calc.at, tests/actions.at: Workaround for SGI
11060 C++ compiler. (trivial change)
11061
11062 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11063
11064 Spent a few hours checking out which prerequisite versions the
11065 current sources actually require. I went all the way back to
11066 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11067 a seemingly endless set of combinations of versions more recent
11068 than that. The bottom line is that the current sources require
11069 fairly recent versions of the build tools, and it'll be some work
11070 to change this.
11071 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11072 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11073 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11074 Add comments explaining why those particular versions are
11075 currently needed.
11076
11077 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11078 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
11079 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
11080
11081 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11082 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11083
11084 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11085
11086 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11087 0.11.5. Suggested by Bruno Haible.
11088 * bootstrap: Remove gettext version checking.
11089
11090 * doc/bison.texinfo (Decl Summary): Also mention that %union
11091 can depend on prerequisite types. Problem reported by Tim
11092 Van Holder.
11093
11094 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11095
11096 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11097 * README-alpha: Don't tell people not to package this.
11098
11099 * bootstrap: Don't assume $(...) works; use `...` instead.
11100 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11101 gettext better.
11102
11103 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11104 put into the -d output file, and mention what to do if YYSTYPE is
11105 defined as a macro.
11106
11107 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11108
11109 Undo change made earlier today: it caused autopoint to not bring
11110 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11111 autopoint's.
11112
11113 * bootstrap: Check that gettext version matches what's in
11114 configure.ac. Warn users to ignore robots.txt ERROR 404.
11115 * bootstrap: Undo today's earlier change (logged below).
11116 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
11117
11118 The gettext version checking is causing more trouble than it's
11119 curing; remove it. Problem reported by Paul Hilfinger.
11120
11121 * bootstrap: Issue a warning that one can expect a message
11122 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11123 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11124
11125 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11126
11127 Ensure that the C++ compiler used for testing actually works on a
11128 simple test program; if not, skip the C++-related tests. Problem
11129 reported by Vin Shelton in:
11130 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
11131
11132 * m4/cxx.m4: New file.
11133 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11134 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11135 * tests/local.at (AT_COMPILE_CXX): Use it.
11136
11137 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11138
11139 * data/glr.c (yylloc): Output this macro even if locations are not
11140 being generated, as the GLR parser needs it even in that case.
11141 Problem reported by Troy A. Johnson
11142 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11143
11144 * configure.ac (AC_INIT): Update to 1.875e.
11145
11146 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11147
11148 * NEWS: Version 1.875d.
11149 * configure.ac (AC_INIT): Likewise.
11150 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
11151
11152 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
11153 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
11154 lalr1.cc runs afoul of the first, and the last two are no longer
11155 supported by GCC 3.4.0.
11156 * README: Mention GNU m4 1.4 or later; mention m4 patches.
11157 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
11158
11159 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
11160
11161 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
11162 unsigned int, for compatibility with latest gnulib hash module.
11163 * src/state.c (state_hash, state_hasher): Likewise.
11164 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
11165 * src/uniqstr.c (hash_uniqstr): Likewise.
11166
11167 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
11168
11169 * NEWS: Unescaped newlines are no longer allowed in char & strings.
11170
11171 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
11172 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
11173 character and string literals.
11174 (unexpected_end): New function.
11175 (unexpected_eof): Use it.
11176 (unexpected_newline): New function.
11177 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
11178 actions.
11179
11180 * NEWS: Document %expect-rr.
11181
11182 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
11183 Fix typo by replacing $1 with $option.
11184 Remove more 'intl'-related files.
11185 Don't DEFUN AM_INTL_SUBDIR twice.
11186
11187 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
11188 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
11189 strtoul.c.
11190 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
11191 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
11192 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
11193 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
11194 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
11195 * src/.cvsignore: Add *.output.
11196
11197 * src/parse-gram.y: Put copyright notice inside %{ %} so it
11198 gets copied to the output file.
11199
11200 2004-04-28 Paul Eggert <eggert@twinsun.com>
11201
11202 Get files from the gnulib and po repositories, instead of relying
11203 on them being in our CVS. Upgrade to latest versions of gnulib
11204 and Automake.
11205
11206 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
11207 * bootstrap: Bootstrap from gnulib and po repositories.
11208 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
11209 * README-cvs: Document these changes. Remove version numbers from
11210 mentions of build tools, since they change so often. Mention Flex.
11211
11212 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
11213 (gl_USE_SYSTEM_EXTENSIONS): Add.
11214 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
11215 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
11216 does this for us.
11217 (AC_ISC_POSIX): Remove; we no longer support this
11218 ancient OS, as it gets in the way of latest Autoconf & gnulib.
11219 (AC_HEADER_STDC): Remove: we now assume C89 or better.
11220 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
11221 Do not check for C89 headers, except for locale.h which is used
11222 by the Yacc library and must port to K&R hosts.
11223 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
11224 Do not check for C89 functions, except for setlocale which is
11225 used by the Yacc library.
11226 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
11227 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
11228 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
11229 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
11230 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
11231 AM_GNU_GETTEXT): Remove; now done by:
11232 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
11233 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
11234 for us.
11235
11236 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
11237 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
11238 Define to empty, as gnulib.mk will do the rest for us.
11239 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
11240 for us.
11241 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
11242 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
11243
11244 * src/files.c: Include gnulib's xstrndup.h.
11245
11246 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
11247 (REALLOC): Use xnrealloc, for likewise.
11248 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
11249 (strnlen, memrchr): Remove decls; functions no longer used.
11250 Include <stpcpy.h>.
11251
11252 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
11253 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11254 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
11255 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
11256 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
11257 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
11258 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
11259 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
11260 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
11261 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
11262 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
11263 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11264 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
11265 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
11266 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
11267 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
11268 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
11269 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
11270 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
11271 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
11272 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
11273 Remove, as these files are now generated automatically
11274 by bootstrap or automake.
11275
11276 * po/ChangeLog: Remove: all but one entry was a duplicate
11277 of this file, and I moved that 2000-11-02 entry here.
11278
11279 * config/.cvsignore: Add Makefile, depcomp, install-sh.
11280 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
11281 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
11282 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
11283 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
11284 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
11285 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
11286 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
11287 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
11288 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
11289 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
11290 xstrndup.h.
11291 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
11292 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
11293 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
11294 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
11295 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
11296 * src/.cvsignore: Remove *_.c.
11297
11298
11299 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
11300 support it. (The latest stable gzip doesn't.)
11301
11302 2004-04-27 Paul Eggert <eggert@twinsun.com>
11303
11304 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
11305 case, as stos_ is now used by destructors due to the 2004-02-09
11306 change.
11307
11308 Remove more K&R C support.
11309 * lib/libiberty.y (PARAMS): Remove. All uses removed.
11310 * lib/subpipe.c (errno): Remove decl.
11311 Include <stdlib.h> unconditionally.
11312 (EXIT_FAILURE): Remove macro.
11313 * src/complain.c (vfprintf, strerror): Remove.
11314 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
11315 unconditionally.
11316 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
11317 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
11318 (strchr, strspn, memchr): Remove decls.
11319 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
11320 unconditionally. Do not declare perror.
11321 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
11322 unconditionally.
11323
11324 * src/complain.c (_): Remove useless defn, as system.h defines this.
11325
11326 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
11327 with latest obstack.h.
11328 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
11329 to procedure types, as obstack.h now does that for us.
11330 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
11331
11332 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
11333 so that this include file can stand alone.
11334 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
11335 does this now. Include subpipe.h first after config.h, to
11336 test whether it can stand alone.
11337
11338 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
11339 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
11340 unused declaration.
11341
11342 * tests/synclines.at (%union synch line): Put a dummy member in
11343 the union, because empty unions aren't allowed in C. Caught
11344 by GCC 3.4.0.
11345
11346 2004-04-13 Jim Meyering <jim@meyering.net>
11347
11348 * src/conflicts.c (conflicts_print): Correct format string typo:
11349 use `%%' to produce literal `%'. (trivial change)
11350
11351 2004-03-30 Paul Eggert <eggert@twinsun.com>
11352
11353 * src/getargs.c (version): Update copyright year to 2004.
11354
11355 * data/c.m4 (b4_int_type): Use 'short int' rather than
11356 'short', and similarly for 'long', 'unsigned', etc.
11357 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
11358 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
11359 yy_yypstack, yydumpstack): Likewise.
11360 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
11361 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
11362 Likewise.
11363 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
11364 yy_stack_print, yyparse): Likewise.
11365 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
11366 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
11367 * lib/bitset.c (bitset_print): Likewise.
11368 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
11369 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11370 * lib/bitsetv.c (bitsetv_dump): Likewise.
11371 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
11372 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
11373 Likewise.
11374 * src/LR0.c (allocate_itemsets): Likewise.
11375 * src/gram.h (rule_number, rule): Likewise.
11376 * src/lalr.h (goto_number): Likewise.
11377 * src/nullable.c (nullable_compute): Likewise.
11378 * src/output.c (prepare_rules): Likewise.
11379 * src/relation.c (relation_print, relation_digraph): Likewise.
11380 * src/relation.h (relation_node): Likewise.
11381 * src/state.h (state_number, transitions, errs, reductions,
11382 struct state): Likewise.
11383 * src/symtab.h (symbol_number, struct symbol): Likewise.
11384 * src/tables.c (vector_number, tally, action_number,
11385 default_goto, goto_actions): Likewise.
11386 * tests/existing.at (GNU Cim Grammar): Likewise.
11387 * tests/regression.at (Web2c Actions): Likewise.
11388
11389 * src/output.c (muscle_insert_short_int_table): Renamed from
11390 muscle_insert_short_table. All uses changed.
11391
11392 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11393
11394 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
11395 (declaration): Replace expected_conflicts with expected_sr_conflicts.
11396 Add %expect-rr rule.
11397
11398 * src/scan-gram.l: Recognize %expect-rr.
11399
11400 * src/conflicts.h (expected_sr_conflicts): Rename from
11401 expected_conflicts.
11402 (expected_rr_conflicts): Declare.
11403
11404 * src/conflicts.c (expected_sr_conflicts): Rename from
11405 expected_conflicts.
11406 (expected_rr_conflicts): Define.
11407 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
11408 for GLR parsers.
11409 Use expected_sr_conflicts in place of expected_conflicts.
11410 Warn if expected_rr_conflicts used in non-GLR parser.
11411
11412 * doc/bison.texinfo: Add documentation for %expect-rr.
11413
11414 2004-03-08 Paul Eggert <eggert@gnu.org>
11415
11416 Add support for hex token numbers. Suggested by Odd Arild Olsen in
11417 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
11418
11419 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
11420 in lalr1.cc.
11421 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
11422 * src/scan-gram.l (scan_integer): New function.
11423 ({int}): Use it.
11424 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
11425 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
11426 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
11427 Say "long int", not "long", for uniformity with GNU style.
11428
11429 2004-02-25 Paul Eggert <eggert@twinsun.com>
11430
11431 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
11432 compilers. This fixes a problem with Intel's C++ compiler being
11433 chatty, reported by Guido Trentalancia in
11434 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
11435
11436 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
11437
11438 Support %destructor and merge error locations in lalr1.cc.
11439
11440 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
11441 (Parser::stos_): Define unconditionally.
11442 (Parser::destruct_): New method. Generate its body with
11443 b4_yydestruct_generate.
11444 (Parser::error_start_): New attribute.
11445 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
11446 token which are discarded.
11447 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
11448 error_start_ when erroneous token are discarded.
11449 (Parser::parse) <yyerrlab1>: Compute the location of the error
11450 token so that it covers all the discarded tokens.
11451 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
11452 it can be called with `%skeleton "lalr1.cc"', and do that.
11453
11454 2004-02-02 Paul Eggert <eggert@twinsun.com>
11455
11456 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
11457 $(top_srcdir)/lib and ../lib. This fixes a bug reported
11458 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
11459 There's no need to mention top_builddir since Automake does that
11460 for us.
11461 (INCLUDES): Remove, as Automake says it's obsolescent.
11462 Contents migrated into AM_CPPFLAGS as described above.
11463 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
11464
11465 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11466
11467 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
11468 (yyreportSyntaxError): Handle case where lookahead token is
11469 YYEMPTY.
11470
11471 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11472
11473 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
11474 resulting parsers are compilable with C++.
11475
11476 2003-12-23 Paul Eggert <eggert@twinsun.com>
11477
11478 * config/depcomp, config/install-sh: Sync with Automake 1.8.
11479 * src/output.c (output_skeleton): Rename local var.
11480 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
11481 Bison tokens, as this runs afoul of the 2003-10-07 change that
11482 disallowed NUL bytes in character constants or string literals.
11483
11484 * tests/local.at: Require Autoconf 2.59's Autotest.
11485 * tests/testsuite.at: Don't include local.at, since we now assume
11486 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
11487 including it.
11488 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
11489 multiple inclusion warnings.
11490
11491 2003-12-02 Akim Demaille <akim@epita.fr>
11492
11493 * doc/bison.texinfo (How Can I Reset the Parser): More about start
11494 conditions.
11495 From Bruno Haible.
11496
11497 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
11498
11499 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
11500
11501 2003-10-07 Paul Eggert <eggert@twinsun.com>
11502
11503 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
11504 if testsuite doesn't exist.
11505
11506 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
11507 literals, unfortunately.
11508 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
11509 Complain about NUL bytes in character constants or string literals.
11510
11511 2003-10-05 Paul Eggert <eggert@twinsun.com>
11512
11513 * NEWS: Don't document %no-default-prec, as it's still
11514 too experimental.
11515 * doc/bison.texinfo: Document %no-default-prec only if
11516 the defaultprec flag is set. Normally it's not.
11517
11518 2003-10-04 Paul Eggert <eggert@twinsun.com>
11519
11520 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
11521 non-modifiable lvalue, instead of a modifiable one.
11522 * doc/bison.texinfo (Actions): Document that $$ can
11523 be assigned to. Do not claim that $$ and $N are
11524 array element references: user code should not rely on this.
11525
11526 2003-10-01 Paul Eggert <eggert@twinsun.com>
11527
11528 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
11529 (grammar_declaration): Use it.
11530 * src/scan-gram.l: New token %no-default-prec.
11531 * tests/conflicts.at: Revamp tests to use %no-default-prec.
11532 * NEWS, doc/bison.texinfo: Document the above.
11533
11534 2003-10-01 Akim Demaille <akim@epita.fr>
11535
11536 VCG no longer supports long_straight_phase.
11537
11538 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
11539 * src/print_graph.c (print_graph): Adjust.
11540
11541 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
11542 and Paul Eggert <eggert@twinsun.com>
11543
11544 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
11545 Table of Symbols): Document %default-prec.
11546 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
11547 (grammar_declaration): Set default_prec on %default-prec.
11548 * src/scan-gram.l (%default-prec): New token.
11549 * src/reader.h (default_prec): New flag.
11550 * src/reader.c: Likewise.
11551 (packgram): Handle it.
11552 * tests/conflicts.at (%default-prec without %prec,
11553 %default-prec with %prec, %default-prec 1): New tests.
11554
11555 2003-09-30 Paul Eggert <eggert@twinsun.com>
11556
11557 * tests/testsuite.at: Include local.at, not input.at, fixing
11558 a typo in the 2003-08-25 patch.
11559
11560 2003-08-27 Akim Demaille <akim@epita.fr>
11561
11562 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
11563 GCC warnings.
11564
11565 2003-08-26 Akim Demaille <akim@epita.fr>
11566
11567 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
11568 "<\#" to avoid magic from Gnus when posting parts of this script.
11569
11570 2003-08-26 Akim Demaille <akim@epita.fr>
11571
11572 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
11573 (Parser::parse): here.
11574 Adjust: nerrs and errstatus is now replaced by...
11575 (Parser::nerrs_, Parser::errstatus_): New.
11576
11577 2003-08-25 Akim Demaille <akim@epita.fr>
11578
11579 * config/announce-gen, Makefile.cfg: New.
11580 * Makefile.am: Adjust.
11581 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
11582 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
11583
11584 2003-08-25 Akim Demaille <akim@epita.fr>
11585
11586 When reducing initial empty rules, Bison parser read an initial
11587 location that is not defined. This results in garbage, and that
11588 affects Bison's own parser. Therefore we need (i) to extend Bison
11589 to support a means to initialize this location, and (ii) to use
11590 this CVS Bison to fix CVS Bison's parser.
11591
11592 * src/reader.h, reader.c (epilogue_augment): Remove, replace
11593 with...
11594 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
11595 * src/parse-gram.y: Adjust.
11596 (%initial-action): New.
11597 (%error-verbose): Since we require CVS Bison, there is no reason
11598 not to use it.
11599 * src/scan-gram.l: Adjust.
11600 * src/Makefile.am (YACC): New, to make sure we use our own parser.
11601 * data/yacc.c (yyparse): Use b4_initial_action.
11602
11603 2003-08-25 Akim Demaille <akim@epita.fr>
11604
11605 * doc/bison.texinfo: Don't promote stdout for error messages.
11606
11607 2003-08-25 Akim Demaille <akim@epita.fr>
11608
11609 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
11610 From Alexandre Duret-Lutz.
11611
11612 2003-08-25 Akim Demaille <akim@epita.fr>
11613
11614 Version 1.875c.
11615
11616 2003-08-25 Akim Demaille <akim@epita.fr>
11617
11618 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
11619 Use them.
11620
11621 2003-08-25 Akim Demaille <akim@epita.fr>
11622
11623 * data/lalr1.cc (Parser::reduce_print_): New.
11624 Use it.
11625
11626 2003-08-25 Akim Demaille <akim@epita.fr>
11627
11628 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
11629 error recovery loops. This patch is based on
11630 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
11631 Also, augment the similarity between lalr1.cc and yacc.c.
11632 Note: the locations of error recovery rules are not correct yet.
11633
11634 * data/lalr1.cc: Comment changes to augment the similarity between
11635 lalr1.cc and yacc.c.
11636 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
11637 (yyerrlab1): Remove, but where it used to be (now the bottom part of
11638 yyerrlab), when hitting EOF, pop the whole stack here instead of
11639 merely falling thru the default error handling mechanism.
11640 (yyerrorlab): New label, with the old contents of YYERROR,
11641 plus the following change: pop the stack of rhs corresponding
11642 to the production that invoked YYERROR. That is how Yacc
11643 behaves (required by POSIX).
11644 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
11645 fail.
11646
11647 2003-08-25 Akim Demaille <akim@epita.fr>
11648
11649 Tune local.at so that people can "autom4te -l autotest calc.at -o
11650 calc" for instance, to extract a sub test suite.
11651
11652 * tests/testsuite.at: Move the initialization, Autotest version
11653 requirement, and AT_TESTED invocation into...
11654 * tests/local.at: here.
11655 * tests/testsuite.at: Include it for compatibility with Autoconf
11656 2.57.
11657 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
11658 be ignore.
11659
11660 2003-08-04 Paul Eggert <eggert@twinsun.com>
11661
11662 Rework code slightly to avoid gcc -Wtraditional warnings.
11663 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
11664 The returned value is now stored in *YY0. All callers changed.
11665 * src/output.c (merge_output): Adjust to the above change.
11666
11667 2003-07-26 Paul Eggert <eggert@twinsun.com>
11668
11669 * data/glr.c (YYASSERT): New macro.
11670 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
11671 yyresolveStates, yyprocessOneStack):
11672 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
11673 Derived from a suggestion by Frank Heckenbach.
11674
11675 2003-07-25 Paul Eggert <eggert@twinsun.com>
11676
11677 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
11678 for portability to K&R C (after ansi2knr, presumably). See
11679 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
11680 by Frank Heckenbach, though I have omitted the structure-initialization
11681 part of his glr-knr.diff patch since I recall that the Portable
11682 C Compiler didn't require that change.
11683
11684 Let the user specify how to allocate and free memory.
11685 Derived from a suggestion by Frank Heckenbach in
11686 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
11687 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
11688 All uses of free, malloc, realloc changed to use these macros,
11689 and unnecessary casts removed.
11690 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
11691
11692 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
11693
11694 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
11695 use s.empty() rather than s == "" to test for empty string; see
11696 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
11697 (trivial change)
11698
11699 2003-06-25 Akim Demaille <akim@epita.fr>
11700
11701 * config/depcomp, config/install-sh: Update from masters.
11702
11703 2003-06-20 Paul Eggert <eggert@twinsun.com>
11704
11705 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
11706 and return properly parenthesized result.
11707 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
11708 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11709 Remove unnecessary parentheses from uses.
11710 * doc/bison.texinfo (Location Default Action): Describe the
11711 conventions for parentheses.
11712
11713 2003-06-19 Paul Eggert <eggert@twinsun.com>
11714
11715 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
11716 yyreportTree): Do not assume that size_t is the same width as int,
11717 when printing sizes. Print sizes using an unsigned format.
11718 Problem reported by Frank Heckenbach in
11719 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
11720
11721 Port to Forte Developer 7 C compiler.
11722 * data/glr.c (struct YYLTYPE): If locations are not being used,
11723 declare a single dummy member, as empty structs do not conform
11724 to the C standard.
11725 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
11726 the Forte Developer 7 C compiler complains that end-of-loop
11727 code is not reached.
11728
11729 2003-06-17 Paul Eggert <eggert@twinsun.com>
11730
11731 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
11732 avoid warnings from picky compilers about redefinition of PARAMS.
11733
11734 2003-06-17 Paul Eggert <eggert@twinsun.com>
11735
11736 Version 1.875b.
11737
11738 * NEWS: Document 1.875b.
11739
11740 * lib/bbitset.h: Do not include config.h; that's the includer's job.
11741 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
11742 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
11743 Don't use 'index' in comments, as it's a builtin fn on some hosts.
11744 * lib/bitset_stats.c: Include gettext.h unconditionally, as
11745 per recent gettext manual's suggestion.
11746 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
11747 Use prototypes, not old-style definitions.
11748 * lib/lbitset.c (lbitset_unused_clear): Likewise.
11749 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
11750 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
11751 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
11752 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
11753 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
11754 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
11755 vbitset_or_and_cmp, vbitset_copy): Likewise.
11756
11757 * lib/libiberty.h: Do not include config.h; that's the includer's job.
11758 Do not include <stdlib.h>.
11759 (PARAMS): Define unconditionally for C89.
11760 (ATTRIBUTE_NORETURN): Remove.
11761 (ATTRIBUTE_UNUSED): Define unconditionally.
11762
11763 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
11764 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
11765 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
11766 * lib/vbitset.c, lib/vbitset.h: New files.
11767 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11768 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
11769 from libbitset.
11770
11771 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
11772 `How Can I Reset @code{yyparse}', since texinfo does not allow
11773 arbitrary @ in node names.
11774
11775 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
11776 shouldn't be needed according to the gettext 0.12.1 documentation
11777 but which seem to be needed anyway: codeset.m4 glibc21.m4
11778 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
11779 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
11780 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
11781
11782 * lib/.cvsignore: Add stdbool.h.
11783 * m4/.cvsignore: Add nls.m4, po.m4.
11784
11785 Upgrade to CVS gnulib.
11786 * stdbool_.h: File renamed from stdbool.h.in.
11787 * configure.ac (AM_STDBOOL_H): Invoke this instead of
11788 AC_HEADER_STDBOOL.
11789 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
11790 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
11791 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
11792 (MOSTLYCLEANFILES): New var.
11793 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
11794 (stdbool.h): New rule.
11795 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
11796 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
11797 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
11798 m4/quote.m4: Upgrade to today's gnulib.
11799
11800 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
11801 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
11802 the tests right now.
11803 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
11804 yyerror are declared before use; C99 requires this.
11805
11806 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11807
11808 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
11809 first.
11810 (yyrecoverSyntaxError): Correct the logic for setting and testing
11811 yyerrState.
11812 Correct comment on handling EOF.
11813 Allow states with only a default reduction, rather than failing
11814 (I can't quite reconstruct why these were not allowed before).
11815
11816 Fixes to avoid problem that $-N rules in GLR parsers can cause
11817 buffer overruns, corrupting state.
11818
11819 * src/output.c (prepare_rules): Output max_left_semantic_context
11820 definition.
11821 * src/reader.h (max_left_semantic_context): New variable declaration.
11822 * src/scan-gram.l (max_left_semantic_context): Define.
11823 (handle_action_dollar): Update max_left_semantic_context.
11824 * data/glr.c (YYMAXLEFT): New definition.
11825 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
11826 (yyresolveAction): Ditto.
11827
11828 Fixes to problems with location handling in GLR parsers reported by
11829 Frank Heckenbach (2003/06/05).
11830
11831 * data/glr.c (YYLTYPE): Make trivial if locations not used.
11832 (YYRHSLOC): Add parentheses, and define only if locations used.
11833 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
11834 locations not used.
11835 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
11836 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
11837
11838 * tests/cxx-type.at: Exercise location information; update tests
11839 to differentiate output with and without locations.
11840 Remove forward declarations of yylex and yyerror---caused errors
11841 because default YYLTYPE not yet defined.
11842 Change semantic actions to compute strings, rather than printing
11843 them directly (to test proper passing of semantics values). Change
11844 output to prefix notation and update test data and expected results.
11845 (yylex): Track locations.
11846 (stmtMerge): Return value rather than printing, and include arguments
11847 in value.
11848
11849 2003-06-03 Paul Eggert <eggert@twinsun.com>
11850
11851 Avoid warnings generated by GCC 2.95.4 when Bison is
11852 configured with --enable-gcc-warnings.
11853 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
11854 yy::]b4_parser_class_name[::translate_,
11855 yy::Stack::operator[] (unsigned),
11856 yy::Stack::operator[] (unsigned) const,
11857 yy::Slice::operator[] (unsigned),
11858 yy::Slice::operator[] (unsigned) const):
11859 Rename local vars to avoid warnings.
11860 * tests/glr-regression.at (Improper handling of embedded actions
11861 and $-N in GLR parsers): Remove unused local variable from yylex.
11862 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
11863 (void) as arg when not pure, since we now assume C89 when building
11864 Bison. Pacify GCC by using parameter.
11865
11866 2003-06-02 Paul Eggert <eggert@twinsun.com>
11867
11868 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
11869 yy::Location::lines, yy::Location::columns): Rename arguments
11870 to avoid shadowing; this removes a warning generated by GCC 3.3.
11871
11872 2003-06-01 Paul Eggert <eggert@twinsun.com>
11873
11874 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
11875 to g++, as GCC 3.3 complains if you do it.
11876 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
11877 everything that WARNING_CFLAGS has, except omit warnings
11878 not suitable for C++.
11879 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
11880 * tests/atlocal.in (CXXFLAGS): New var.
11881 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
11882
11883 Fix a GLR parser bug I reported in February; see
11884 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
11885 The problem was that GLR parsers did not conform to the C standard,
11886 because actions like { $1 = $2 + $3; } expanded to expressions
11887 that invoked YYFILL in separate subexpressions, and YYFILL assigned
11888 to a local variable. The C standard says that expressions
11889 like (var = f ()) + (var = f ()) have undefined behavior.
11890 Another problem was that GCC sometimes issues warnings that
11891 yyfill and its parameters are unused.
11892
11893 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
11894 as possibly unused.
11895 (yyfill): New function.
11896 (YYFILL): Use it.
11897 (yyuserAction): Change type of yynormal to bool, so that it matches
11898 the new yyfill signature. Mark it as possibly unused.
11899
11900
11901 Follow up on a bug I reported in February, where a Bison-generated
11902 parser can loop. Provide a test case and a fix for yacc.c. I
11903 don't have a fix for lalr1.cc or for glr.c, unfortunately.
11904 The original bug report is in:
11905 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
11906
11907 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
11908 macro's size was becoming unwieldy.
11909 (yyerrlab): Do not discard an empty lookahead symbol, as this
11910 might destroy garbage.
11911 (yyerrorlab): New label, with the old contents of YYERROR,
11912 plus the following change: pop the stack of rhs corresponding
11913 to the production that invoked YYERROR. That is how Yacc
11914 behaves, and POSIX requires this behavior.
11915 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
11916 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
11917 Define 'alarm' to do nothing if unistd.h is not available.
11918 Add a new rule "exp: '-' error;" to test the above change to
11919 data/yacc.c. Use 'alarm' to abort any test taking longer than
11920 10 seconds, as it's probably looping.
11921 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
11922 Also, the new yacc.c generates two fewer diagnostics for an
11923 existing test.
11924
11925 2003-05-24 Paul Eggert <eggert@twinsun.com>
11926
11927 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
11928 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
11929 This fixes a problem reported by John Bowman when the Compaq/HP
11930 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
11931 -ansi -Wall -gall).
11932 * data/yacc.c (union yyalloc): Likewise.
11933 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
11934
11935 Switch from 'int' to 'bool' where that makes sense.
11936
11937 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
11938 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
11939 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
11940 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
11941 Return or accept bool, not int. All callers changed.
11942 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
11943 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
11944 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
11945 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
11946 bitset_or_and_cmp_): Likewise.
11947 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
11948 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
11949 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
11950 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
11951 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
11952 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
11953 bitset_stats_or_and_cmp): Likewise.
11954 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
11955 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
11956 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
11957 ebitset_xor_cmp): Likewise.
11958 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
11959 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
11960 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
11961 lbitset_xor_cmp): Likewise.
11962 * lib/bbitset.h: Include <stdbool.h>.
11963 (struct bitset_vtable): The following members now return bool, not
11964 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
11965 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
11966 or_and_cmp).
11967 * src/conflicts.c (count_rr_conflicts): Likewise.
11968 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
11969 All uses changed.
11970 * lib/ebitset.c (ebitset_obstack_init): Likewise.
11971 * lib/lbitset.c (lbitset_obstack_init): Likewise.
11972 * src/getargs.c (debug_flag, defines_flag, locations_flag,
11973 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11974 graph_flag): Likewise.
11975 * src/getargs.h (debug_flag, defines_flag, locations_flag,
11976 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11977 graph_flag): Likewise.
11978 * src/output.c (error_verbose): Likewise.
11979 * src/output.h (error_verbose): Likewise.
11980 * src/reader.c (start_flag, typed): Likewise.
11981 * src/reader.h (typed): Likewise.
11982 * src/getargs.c (LOCATIONS_OPTION): New constant.
11983 (long_options, getargs): Use it.
11984 * src/lalr.c (build_relations): Use bool, not int.
11985 * src/nullable.c (nullable_compute): Likewise.
11986 * src/print.c (print_reductions): Likewise.
11987 * src/tables.c (action_row, pack_vector): Likewise.
11988 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
11989 * src/output.c (prepare): Use it.
11990 * src/output.c (token_definitions_output,
11991 symbol_destructors_output, symbol_destructors_output): Use string,
11992 not boolean integer, to keep track of whether to output separator.
11993 * src/print_graph.c (print_core): Likewise.
11994 * src/state.c (state_rule_lookaheads_print): Likewise.
11995
11996 * config/install-sh: Sync from automake 1.7.5.
11997
11998 2003-05-14 Paul Eggert <eggert@twinsun.com>
11999
12000 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12001 semicolon after a grammar declaration, in the interest of possible
12002 future changes to the Bison input language.
12003 Do not allow a stray semicolon at the start of the grammar.
12004 (rhses.1): Allow one or more semicolons after any rule, including
12005 just before "|" as required by POSIX.
12006 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12007 grammar.
12008
12009 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12010
12011 %parse-param support for lalr1.cc.
12012
12013 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12014 b4_cc_constructor_calls, b4_cc_constructor_call,
12015 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12016 definitions.
12017 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12018 parse-param arguments.
12019 (yy::b4_parser_class_name): Declare instance variables to
12020 hold parse-param arguments.
12021 * tests/calc.at: s/value/semantic_value/ because value clashes
12022 with a member of yy::b4_parser_class_name. Adjust C++ code
12023 to handle %parse-param. Enable %parse-param test in C++.
12024
12025 2003-05-12 Paul Eggert <eggert@twinsun.com>
12026
12027 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12028 English a bit. Fix fclose typo. Change "const char" to "char
12029 const", and use ANSI C rather than K&R for "main". Suggest
12030 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12031 and suggest yy_switch_to_buffer.
12032
12033 2003-05-05 Paul Eggert <eggert@twinsun.com>
12034
12035 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12036 C89. This avoids a diagnostic on compilers that define __STDC__
12037 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
12038 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12039
12040 2003-05-03 Paul Eggert <eggert@twinsun.com>
12041
12042 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12043 Do not overrun array bounds.
12044 This should fix a bug reported today by Olatunji Oluwabukunmi in
12045 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
12046
12047 2003-04-29 Akim Demaille <akim@epita.fr>
12048
12049 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12050 * src/getargs.c, src/getargs.h: here, as bool, not int.
12051 (nondeterministic_parser): New.
12052 * src/parse-gram.y, src/scan-gram.l: Support
12053 %nondeterministic-parser.
12054 * src/output.c (prepare): Use nondeterministic_parser instead
12055 of glr_parser where appropriate.
12056 * src/tables.c (conflict_row, action_row, save_row)
12057 (token_actions, token_actions, pack_vector): Ditto.
12058
12059 2003-04-29 Akim Demaille <akim@epita.fr>
12060
12061 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12062
12063 2003-04-29 Akim Demaille <akim@epita.fr>
12064
12065 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12066 with %pure-parser and %locations to exercise the patch from Yakov
12067 Markovitch below.
12068
12069 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12070
12071 * data/yacc.c: (b4_lex_param): Corrected for the case where
12072 %lex-param is provided and %pure-parser isn't.
12073
12074 2003-04-27 Paul Eggert <eggert@twinsun.com>
12075
12076 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
12077 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
12078 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12079 if it is not defined.
12080 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12081
12082 2003-04-26 Paul Eggert <eggert@twinsun.com>
12083
12084 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12085 Declare to be of type suitable for the ninf value itself, not of
12086 type suitable for the corresponding table, since the latter might
12087 be unsigned but the ninf value might be negative. This fixes a
12088 bug reported by Alexandre Duret-Lutz in
12089 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
12090
12091 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12092 invokes it. We shouldn't invoke it twice because it will attempt
12093 to put error.o in the archive twice. This fixes a glitch reported
12094 by Martin Mokrejs in
12095 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12096
12097 2003-04-21 Paul Eggert <eggert@twinsun.com>
12098
12099 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12100 to gnulib.
12101
12102 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12103
12104 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12105 Fix obvious typo that results in uncompilable GLR parsers
12106 when both %pure-parser and %locations are used. (trivial change)
12107
12108 2003-04-17 Paul Eggert <eggert@twinsun.com>
12109
12110 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12111 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12112 Do not insert the expected token via unput, as this runs afoul
12113 of a POSIX-compatibility bug in flex 2.5.31.
12114 All uses changed to BEGIN the parent state,
12115 since we no longer insert the expected token via unput.
12116 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12117 that is no longer emitted after the above change.
12118
12119 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12120 the first one. This change is from Paul Hilfinger, and it fixes
12121 regression reported by Werner Lemberg in
12122 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
12123
12124 (resolve_sr_conflict): Don't invoke state_errs_set
12125 unless one or more tokens have been explicitly made errors.
12126 Otherwise, the above change causes Bison to abort.
12127
12128 * tests/existing.at (GNU pic Grammar): New test case, taken from
12129 Lemberg's email.
12130
12131 2003-03-31 Akim Demaille <akim@epita.fr>
12132
12133 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12134
12135 2003-03-31 Akim Demaille <akim@epita.fr>
12136
12137 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12138 output.
12139
12140 2003-03-31 Akim Demaille <akim@epita.fr>
12141
12142 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12143 From Paul Hilfinger.
12144
12145 2003-03-29 Akim Demaille <akim@epita.fr>
12146
12147 * m4/error.m4: Do not put under dynamic conditions some code which
12148 expansion is under static control.
12149
12150 2003-03-29 Akim Demaille <akim@epita.fr>
12151
12152 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12153
12154 2003-03-29 Akim Demaille <akim@epita.fr>
12155
12156 * doc/bison.texinfo (Strings are Destroyed): New.
12157
12158 2003-03-13 Paul Eggert <eggert@twinsun.com>
12159
12160 * .cvsignore: Add configure.lineno.
12161 * src/.cvsignore: Add yacc.
12162 * tests/.cvsignore: Add testsuite.log.
12163 * doc/fdl.texi: Sync with latest FSF version.
12164
12165 2003-03-12 Paul Eggert <eggert@twinsun.com>
12166
12167 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
12168 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
12169 cursor, instead of leaving it undefined. This fixes a bug
12170 reported by Tim Van Holder in
12171 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
12172 * tests/input.at (Torturing the Scanner): Test the scanner on
12173 an empty input file, which was Tim Van Holder's test case.
12174
12175 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
12176 <sys/resource.h> can be included, include sys/time.h and
12177 sys/times.h first, if available. This works around the SunOS
12178 4.1.4 porting bug reported by Bruce Becker in
12179 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
12180
12181 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
12182 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
12183 AC_HEADER_SYS_WAIT.
12184
12185 Merge changes from gnulib. This was prompted because the CVS
12186 snapshot didn't build on Solaris 7 due to strnlen problems.
12187
12188 These changes need to be merged back into gnulib:
12189 * lib/hash.c: Include <stdbool.h> unconditionally.
12190 * m4/onceonly.m4 (m4_quote): New macro.
12191 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
12192 Quote AC_FOREACH variable-expansions properly.
12193 The 2003-01-03 obstack.h change also needs merging.
12194 {end of changes requiring merging}
12195
12196 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12197 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
12198 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
12199 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
12200 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
12201 New files, imported from gnulib.
12202 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
12203 above.
12204
12205 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
12206 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
12207 gnulib sources.
12208
12209 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
12210 Add.
12211 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
12212 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
12213 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
12214 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
12215 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
12216 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
12217 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
12218 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
12219 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
12220 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
12221 (jm_PREREQ_ARGMATCH): Remove.
12222 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
12223 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
12224
12225 * src/system.h: Include <stdbool.h> unconditionally.
12226
12227 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
12228 assuming at least C89 in the bitset code for some time now.
12229
12230 2003-03-03 Akim Demaille <akim@epita.fr>
12231
12232 * ro.po: New.
12233
12234 2003-03-02 Akim Demaille <akim@epita.fr>
12235
12236 * doc/bison.texinfo (Table of Symbols): Reactivate the
12237 documentation for %lex-param, and %parse-param.
12238
12239 2003-03-02 Akim Demaille <akim@epita.fr>
12240
12241 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
12242 generate verbose error messages.
12243 Use the number of tokens as an upper bound in yytname, as it
12244 cannot be a non terminal.
12245
12246 2003-03-02 Akim Demaille <akim@epita.fr>
12247
12248 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
12249 message.
12250
12251 2003-03-02 Akim Demaille <akim@epita.fr>
12252
12253 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
12254 Use them to exercise yycheck overrun.
12255 Based on Andrew Suffield's grammar.
12256
12257 2003-03-02 Akim Demaille <akim@epita.fr>
12258
12259 Create tests/local.at for Bison generic testing macros.
12260
12261 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
12262 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
12263 This new file.
12264 * tests/calc.at (AT_CHECK_CALC): Adjust.
12265 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
12266 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
12267 * tests/local.at: here.
12268 (AT_COMPILE_CXX): Tags the tests using it as c++.
12269 Ignore the test if CXX is not functional.
12270
12271 2003-03-01 Paul Eggert <eggert@twinsun.com>
12272
12273 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
12274 not loc->end, since loc->end might contain garbage and this leads
12275 to undefined behavior on some platforms.
12276 (id_loc, token_start): Use (IF_LINTed) initial values that do not
12277 depend on *loc, so that the reader doesn't give the the false
12278 impression that *loc is initialized.
12279 (<INITIAL>"%%"): Do not bother setting code_start, since its value
12280 does not survive the return.
12281
12282 2003-03-01 Akim Demaille <akim@epita.fr>
12283
12284 * src/scan-gram.l (code_start): Always initialize it when entering
12285 into yylex, as SC_EPILOGUE is activated *before* the corresponding
12286 yylex invocation. An alternative would be making it static, but
12287 then it starts with the second %%'s beginning, instead of its end.
12288
12289 2003-02-28 Paul Eggert <eggert@twinsun.com>
12290
12291 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
12292 around a UnixWare 7.1.1 porting bug reported by John Hughes in
12293 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
12294
12295 2003-02-26 Paul Eggert <eggert@twinsun.com>
12296
12297 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
12298 Remove Sequent/Pyramid discussion (nobody uses them any more).
12299 Merge VMS and MS-DOS discussion; these ports may well be dead
12300 but let's keep mentioning them for now. Put <> around email
12301 addresses. Add copyright notice.
12302
12303 2003-02-24 Paul Eggert <eggert@twinsun.com>
12304
12305 * data/glr.c (yy_reduce_print): yylineno -> yylno,
12306 to avoid collision with flex use of yylineno.
12307 Problem reported by Bruce Lilly in
12308 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
12309 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12310 * data/yacc.c (yy_reduce_print): Likewise.
12311
12312 * config/depcomp: Sync with Automake 1.7.3.
12313
12314 2003-02-21 Akim Demaille <akim@epita.fr>
12315
12316 * data/lalr1.cc: Use temporary variables instead of casts to
12317 change integer types.
12318 Suggested by Paul Eggert.
12319
12320 2003-02-21 Akim Demaille <akim@epita.fr>
12321
12322 * doc/bison.texinfo: Use "location" consistently to refer to @n,
12323 to avoid confusions with lalr1.cc's notion of Position.
12324 Suggested by Paul Eggert.
12325
12326 2003-02-20 Akim Demaille <akim@epita.fr>
12327
12328 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
12329 before initial_columns.
12330 (location.hh): Use consistent variable names when defining the
12331 operator<<.
12332 Use "last" so that we subtract from Positions, not from unsigned.
12333
12334 2003-02-20 Akim Demaille <akim@epita.fr>
12335
12336 * data/lalr1.cc (position.hh): New subfile, including the extended
12337 and Doxygen'ed documentation of class Position.
12338 (location.hh): Use it.
12339 Document a` la Doxygen.
12340 With the help of Benoit Perrot.
12341
12342 2003-02-20 Akim Demaille <akim@epita.fr>
12343
12344 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
12345 AT_YACC_IF.
12346 Redefine AT_YYERROR_SEES_LOC_IF using it.
12347 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
12348 not defined.
12349 Don't use the location in yy::Parser::error_ and
12350 yy::Parser::print_ when not %locations.
12351 Activate more lalr1.cc tests.
12352
12353 2003-02-19 Akim Demaille <akim@epita.fr>
12354
12355 * data/lalr1.cc: When displaying a line number, be sure to make it
12356 an int.
12357
12358 2003-02-19 Akim Demaille <akim@epita.fr>
12359
12360 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
12361 Remove, useless.
12362 (YYABORT, YYACCEPT, YYERROR): New.
12363 * tests/calc.at: Renable the lalr1.cc test.
12364
12365 2003-02-19 Akim Demaille <akim@epita.fr>
12366
12367 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
12368 error recovery, mixing with/without pops and discarding of the
12369 lookahead.
12370 Exercise YYERROR.
12371 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
12372
12373 2003-02-17 Paul Eggert <eggert@twinsun.com>
12374
12375 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
12376 * tests/testsuite.at (AT_COMPILE): Use them.
12377 This fixes the testsuite problem reported by Robert Lentz in
12378 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
12379
12380 2003-02-12 Paul Eggert <eggert@twinsun.com>
12381
12382 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
12383 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
12384 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
12385 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
12386 Check for malloc failure, for consistency with yacc.c.
12387 (yytname_size): Remove, for consistency with yacc.c.
12388
12389 The bug still remains in data/lalr1.cc, as I didn't have time
12390 to fix it there.
12391
12392 2003-02-06 Akim Demaille <akim@epita.fr>
12393
12394 * configure.ac (GXX): Rename as...
12395 (CXX): this, to keep the original Autoconf semantics.
12396 Require 2.57.
12397 * data/lalr1.cc: Fix b4_copyright invocations.
12398 If YYDEBUG is not defined, don't depend upon name_ being defined.
12399 (location.hh): Include string and iostream.
12400 (Position::filename): New member.
12401 (Position::Position ()): New.
12402 (operator<< (Position)): New.
12403 (operator- (Position, int)): New.
12404 (Location::first, Location::last): Rename as...
12405 (Location::begin, Location::end): these, to mock the conventional
12406 iterator names.
12407 (operator<< (Location)): New.
12408 * tests/atlocal.in (CXX): New.
12409 * tests/testsuite.at (AT_COMPILE_CXX): New.
12410 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
12411 locations in a more synthetic way.
12412 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
12413 lalr1.cc is used.
12414 Adjust the C locations to match those from Emacs: first column is
12415 column 0.
12416 Change all the expected results.
12417 Conform to the GCS: simplify the locations when applicable.
12418 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
12419 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
12420 these CPP macros with the m4 macros new defined by...
12421 (AT_CHECK_PUSHDEFS): this, i.e.:
12422 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
12423 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
12424 New macros.
12425 (AT_CHECK_POPDEFS): Undefine them.
12426 (AT_CHECK_CALC_LALR1_CC): New.
12427 Use it for the first lalr1.cc test.
12428
12429 2003-02-04 Akim Demaille <akim@epita.fr>
12430
12431 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
12432 Location as is defined.
12433
12434 2003-02-04 Akim Demaille <akim@epita.fr>
12435
12436 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
12437 name_ being defined.
12438
12439 2003-02-03 Paul Eggert <eggert@twinsun.com>
12440
12441 * src/gram.h (start_symbol): Remove unused decl.
12442
12443 Use more-consistent naming conventions for local vars.
12444
12445 * src/derives.c (derives_compute): Change type of local var from
12446 int to rule_number.
12447 * src/gram.c (grammar_rules_partial_print): Likewise.
12448 * src/print.c (print_core): Likewise.
12449 * src/reduce.c (reduce_grammar_tables): Likewise.
12450
12451 * src/gram.c (grammar_dump): Change name of item_number *
12452 local var from r to rp.
12453 * src/nullable.c (nullable_compute): Likewise.
12454
12455 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
12456
12457 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
12458 for symbol or symbol_number var.
12459 * src/reader.c (grammar_start_symbol_set): Likewise.
12460 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
12461 Likewise.
12462 * src/state.c (transitions_to): Likewise.
12463 * src/state.h: Likewise.
12464 * src/tables.c (symbol_number_to_vector_number): Likewise.
12465
12466 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
12467 char * var.
12468
12469 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
12470 var.
12471
12472 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
12473 var.
12474
12475 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
12476 Use str, not s, for char * var. Use ch, not c, for character var.
12477 Use size for size var.
12478
12479 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
12480 char * var.
12481 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
12482 uniqstr var.
12483 * src/uniqstr.h: Likewise.
12484
12485 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12486 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12487 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
12488 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
12489 param to have same name as that of enum, so that we don't use
12490 "s" to stand for a non-state.
12491
12492 2003-02-02 Akim Demaille <akim@epita.fr>
12493
12494 * src/scan-skel.l: Scan more than one inert character per yylex
12495 invocation.
12496
12497 2003-02-01 Paul Eggert <eggert@twinsun.com>
12498
12499 Version 1.875a.
12500
12501 * po/LINGUAS: Add ms.
12502
12503 2003-01-30 Akim Demaille <akim@epita.fr>
12504
12505 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
12506
12507 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12508
12509 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
12510 of $1.
12511
12512 Changes in response to error report by S. Eken: GLR mode does not
12513 handle negative $ indices or $ indices in embedded rules correctly.
12514 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
12515
12516 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
12517 (b4_rhs_location): Ditto.
12518 (yyfill): New function to copy from stack tree into array
12519 incrementally.
12520 (yyuserAction): Modify to allow incremental move of semantic values
12521 to rhs array when in GLR mode.
12522 Define YYFILL to use in user-defined actions to fill semantic array
12523 as needed.
12524 Remove dummy use of yystack, as there is now a guaranteed use.
12525 (yydoAction): Modify to allow incremental move of semantic values
12526 to rhs array when in GLR mode.
12527 (yyresolveAction): Ditto.
12528 (yyglrShiftDefer): Update comment.
12529 (yyresolveStates): Use X == NULL for pointers, not !X.
12530 (yyglrReduce): Ditto.
12531 (yydoAction): Ditto
12532
12533 * tests/glr-regr1.at: Rename to ...
12534 * tests/glr-regression.at: Add new regression test for the problems
12535 described above (adapted from S. Eken).
12536 Update copyright notice.
12537 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
12538 * tests/Makefile.am: Ditto.
12539
12540 2003-01-28 Paul Eggert <eggert@twinsun.com>
12541
12542 * data/lalr1.cc: Do not use @output_header_name@ unless
12543 b4_defines_flag is set. This fixes two bugs reported by
12544 Tim Van Holder in
12545 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
12546 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
12547
12548 2003-01-21 Paul Eggert <eggert@twinsun.com>
12549
12550 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
12551 we don't need to worry about yyerrlab1 being reported as an
12552 "unused label" by non-GCC C compilers. The downside is that if
12553 locations are used then a couple of statements are duplicated each
12554 time YYERROR is invoked, but the upside is that the warnings
12555 should vanish.
12556 (yyerrlab1): Move code to YERROR.
12557 (yyerrlab2): Remove. Change uses back to yyerrlab1.
12558 This reverts some of the 2002-12-27 change.
12559
12560 2003-01-17 Paul Eggert <eggert@twinsun.com>
12561
12562 * src/output.c (symbol_printers_output): Fix typo that led
12563 to core dump. Problem reported by Antonio Rus in
12564 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
12565
12566 2003-01-13 Akim Demaille <akim@epita.fr>,
12567 Quoc Peyrot <chojin@lrde.epita.fr>,
12568 Robert Anisko <anisko_r@lrde.epita.fr>
12569
12570 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
12571 when the stacks contain one element, as the loop would otherwise
12572 free the last state, and then use the top state (the one we just
12573 popped). This means that the initial elements will not be freed
12574 explicitly, as is the case in yacc.c; it is not a problem, as
12575 these elements have fake values.
12576
12577 2003-01-11 Paul Eggert <eggert@twinsun.com>
12578
12579 * NEWS: %expect-violations are now just warnings, reverting
12580 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
12581 bootstrapping problem reported by Matthias Klose; see
12582 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
12583 * src/conflicts.c (conflicts_print): Likewise.
12584 * tests/conflicts.at (%expect not enough, %expect too much,
12585 %expect with reduce conflicts): Likewise.
12586 * doc/bison.texinfo (Expect Decl): Document this. Also mention
12587 that the warning is enabled if the number of conflicts changes
12588 (not necessarily increases).
12589
12590 * src/getargs.c (version): Update copyright year.
12591
12592 2003-01-09 Akim Demaille <akim@epita.fr>
12593
12594 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
12595
12596 2003-01-08 Paul Eggert <eggert@twinsun.com>
12597
12598 * Makefile.maint (WGETFLAGS):
12599 New macro, containing "-C off" to disable proxy caches.
12600 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
12601 (rel-check): Use $(WGET) instead of wget.
12602
12603 2003-01-06 Paul Eggert <eggert@twinsun.com>
12604
12605 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
12606 the GLR paper of Scott, Johnstone and Hussain.
12607
12608 2003-01-04 Paul Eggert <eggert@twinsun.com>
12609
12610 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
12611 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
12612 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
12613 (EXTRA_LIBRARIES): New var, for liby.a.
12614 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
12615 (EXTRA_SCRIPTS): New var, for yacc.
12616
12617 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
12618 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
12619 Problem reported by Nelson H. F. Beebe.
12620
12621 2003-01-03 Paul Eggert <eggert@twinsun.com>
12622
12623 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
12624 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
12625 when compiling Bison 1.875's `bitset bset = obstack_alloc
12626 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
12627
12628 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
12629 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
12630 grow to a huge size with typical invocation.
12631
12632 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
12633 Use the pattern recommended by Autoconf 2.57, except also protect
12634 against double-definition.
12635 * src/system.h: Likewise.
12636 Portability issues reported by Nelson H. F. Beebe.
12637
12638 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
12639 All uses changed. Provide a definition in both C and C++.
12640 (yytrue, yyfalse): Define even if defined (__cplusplus).
12641
12642 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
12643 Reported by Nelson H. F. Beebe.
12644
12645 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
12646
12647 2003-01-02 Paul Eggert <eggert@twinsun.com>
12648
12649 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
12650 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
12651 Bug reported by Nelson H. F. Beebe.
12652
12653 2003-01-01 Paul Eggert <eggert@twinsun.com>
12654
12655 * Version 1.875.
12656
12657 2002-12-30 Paul Eggert <eggert@twinsun.com>
12658
12659 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
12660 Moved here from...
12661 (<INITIAL>","): Here. This causes stray "," to be treated
12662 more uniformly.
12663
12664 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
12665 last brace in braced code when not in Yacc mode, for compatibility
12666 with Bison 1.35. This resurrects the 2001-12-15 patch to
12667 src/reader.c.
12668
12669 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
12670 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
12671
12672 2002-12-28 Paul Eggert <eggert@twinsun.com>
12673
12674 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
12675 that of SYM's type. This fixes Debian bug 168069, reported by
12676 Thomas Olsson.
12677
12678 2002-12-28 Paul Eggert <eggert@twinsun.com>
12679
12680 Version 1.75f.
12681
12682 Switch back to the Yacc style of conflict reports, undoing some
12683 of the 2002-07-30 change.
12684 * doc/bison.texinfo (Understanding): Use Yacc style for
12685 conflict reports. Also, use new way of locating rules.
12686 * src/conflicts.c (conflict_report):
12687 Renamed from conflict_report_yacc, removing the old
12688 'conflict_report'. Translate the entire conflict report at once,
12689 so that we don't assume that "," has the same interpretation in
12690 all languages.
12691 (conflicts_output): Use Yacc-style conflict report for each state,
12692 instead of our more-complicated style.
12693 (conflicts_print): Use Yacc-style conflict report, except print
12694 the input file name when not emulating Yacc.
12695 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
12696 Conflicted Reduction, %expect not enough, %expect too much,
12697 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
12698 * tests/existing.at (GNU Cim Grammar): Likewise.
12699 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
12700
12701 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
12702 fatal): Don't invoke fflush; it's not needed and it might even be
12703 harmful for stdout, as stdout might not be open.
12704 * src/reduce.c (reduce_print): Likewise.
12705
12706 2002-12-27 Paul Eggert <eggert@twinsun.com>
12707
12708 Fix a bug where error locations were not being recorded correctly.
12709 This problem was originally reported by Paul Hilfinger in
12710 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
12711
12712 * data/yacc.c (yyparse): New local var yylerrsp, to record the
12713 top of the location stack's error locations.
12714 (yyerrlab): Set it. When discarding a token, push its location
12715 onto yylerrsp so that we don't lose track of the error's end.
12716 (yyerrlab1): Now is only the target of YYERROR, so that we can
12717 properly record the location of the action that failed. For GCC
12718 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
12719 GCC warning about yyerrlab1 being unused if YYERROR is unused.
12720 (yyerrlab2): New label, which yyerrlab now falls through to.
12721 Compute the error's location by applying YYLLOC_DEFAULT to
12722 the locations of all the symbols that went into the error.
12723 * doc/bison.texinfo (Location Default Action): Mention that
12724 YYLLOC_DEFAULT is also invoked for syntax errors.
12725 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12726 Error locations include the locations of all the tokens that were
12727 discarded, not just the last token.
12728
12729 2002-12-26 Paul Eggert <eggert@twinsun.com>
12730
12731 * src/files.c: Include quote.h.
12732 (compute_output_file_names): Warn if we detect conflicting
12733 outputs to the same file. This should catch the misunderstanding
12734 exemplified by Debian Bug 165349, reported by Bruce Stephens..
12735
12736 * src/conflicts.c (conflicts_print): If the user specifies
12737 "%expect N", report an error if there are any reduce/reduce
12738 conflicts. This is what the manual says should happen.
12739 This fixes Debian bug 130890, reported by Anthony DeRobertis.
12740 * tests/conflicts.at (%expect with reduce conflicts): New test.
12741
12742 Don't use m4_include on relative file names, as it doesn't work as
12743 desired if there happens to be a file with that name under ".".
12744
12745 * m4sugar/version.m4: Remove; it was included but it wasn't used.
12746 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
12747 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
12748 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
12749 * src/output.c (output_skeleton): Use full path names when
12750 specifying a file to include; don't rely on include path, as
12751 it's unreliable when the working file contains a file with
12752 that name.
12753
12754 2002-12-25 Paul Eggert <eggert@twinsun.com>
12755
12756 Remove obsolete references to bison.simple and bison.hairy.
12757 Problem mentioned by Aubin Mahe in
12758 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
12759 * data/glr.c: Comment fix.
12760 * doc/bison.1: Remove references. Also, mention "yacc".
12761
12762 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
12763 with -g option.
12764
12765 * src/parse-gram.y (declaration): Use enum "report_states" rather
12766 than its numeric value 1.
12767
12768 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
12769 opening a new one. This fixes Debian bug 165349, reported by
12770 Bruce Stephens.
12771
12772 2002-12-24 Paul Eggert <eggert@twinsun.com>
12773
12774 Version 1.75e.
12775
12776 * Makefile.maint (cvs-update): Don't assume that the shell
12777 supports $(...), as Solaris sh doesn't.
12778
12779 * src/parse-gram.y (lloc_default): Remove test for empty
12780 nonterminals at the end, since it didn't change the result.
12781
12782 2002-12-24 Paul Eggert <eggert@twinsun.com>
12783
12784 If the user does not define YYSTYPE as a macro, Bison now declares it
12785 using typedef instead of defining it as a macro. POSIX requires this.
12786 For consistency, YYLTYPE is also declared instead of defined.
12787
12788 %union directives can now have a tag before the `{', e.g., the
12789 directive `%union foo {...}' now generates the C code
12790 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
12791 The default union tag is `YYSTYPE', for compatibility with Solaris 9
12792 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
12793 instead of `yyltype'.
12794
12795 `yystype' and `yyltype' are now obsolescent macros instead of being
12796 typedefs or tags; they are no longer documented and will be
12797 withdrawn in a future release.
12798
12799 * data/glr.c (b4_location_type): Remove.
12800 (YYSTYPE): Renamed from yystype.
12801 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
12802 (struct YYLTYPE): Renamed from struct yyltype.
12803 (YYLTYPE): Renamed from yyltype.
12804 (yyltype, yystype): New (and obsolescent) macros,
12805 for backward compatibility.
12806 * data/yacc.c: Likewise.
12807
12808 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
12809 does not specify a union tag. This is for compatibility with
12810 Solaris 9 yacc.
12811
12812 * src/parse-gram.y (add_param): 2nd arg is now char * not char
12813 const *, since it is now modified by stripping surrounding { }.
12814 (current_braced_code): Remove.
12815 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
12816 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
12817 trailing " {...}". Now of type <chars>.
12818 (grammar_declaration): Adjust to bundled tokens.
12819 (code_content): Remove; stripping is now done by add_param.
12820 (print_token_value): Print contents of bundled tokens.
12821 (token_name): New function.
12822
12823 * src/reader.h (braced_code, current_braced_code): Remove.
12824 (token_name): New decl.
12825
12826 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
12827 token_type, not braced_code code_kind. All uses changed.
12828 (SC_PRE_CODE): New state, for scanning after a keyword that
12829 has (or usually has) an immediately-following braced code.
12830 (token_type): New local var, to keep track of which token type
12831 to return when scanning braced code.
12832 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
12833 <INITIAL>"%parse-param", <INITIAL>"%printer",
12834 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
12835 instead of returning a token type immediately.
12836 (<INITIAL>"{"): Set token type.
12837 (<SC_BRACED_CODE>"}"): Use it.
12838 (handle_action_dollar, handle_action_at): Now returns bool
12839 indicating success. Fail if ! current_rule; this prevents a core dump.
12840 (handle_symbol_code_dollar, handle_symbol_code_at):
12841 Remove; merge body into caller.
12842 (handle_dollar, handle_at): Complain in invalid contexts.
12843
12844 * NEWS, doc/bison.texinfo: Document the above.
12845 * NEWS: Fix years and program names in copyright notice.
12846
12847 2002-12-17 Paul Eggert <eggert@twinsun.com>
12848
12849 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
12850 Reporting, Table of Symbols): Omit mentions of %lex-param and
12851 %parse-param from the documentation for now.
12852
12853 2002-12-15 Paul Eggert <eggert@twinsun.com>
12854
12855 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
12856 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
12857 lookahead symbol, and which sets yychar in parser actions) and it
12858 disagreed with the Bison documentation. Bug
12859 reported by Andrew Walrond.
12860
12861 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
12862 as the caller now does that.
12863 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
12864 (YYEMPTY): Parenthesize right hand side, since others use it.
12865 (yyparse): Don't assume that our generated code is the only code
12866 that sets yychar.
12867
12868 2002-12-13 Paul Eggert <eggert@twinsun.com>
12869
12870 Version 1.75d.
12871
12872 POSIX requires a "yacc" command.
12873 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
12874 (MOSTLYCLEANFILES): Add yacc.
12875 (yacc): New rule.
12876 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
12877 as an alias for bison y.
12878
12879 * po/LINGUAS: Add da.
12880
12881 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
12882 problem with latest <getopt.h>.
12883 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
12884
12885 * doc/fdl.texi: Upgrade to 1.2.
12886 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
12887 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
12888 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
12889 gnulib.
12890 * config/install-sh: Sync with autotools.
12891
12892 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
12893 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12894 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
12895 locations are requested.
12896 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
12897 locations are requested.
12898
12899 2002-12-12 Paul Eggert <eggert@twinsun.com>
12900
12901 Remove unportable casts and storage allocation tricks.
12902 While we're at it, remove almost all casts, since they
12903 usually aren't needed and are a sign of trouble.
12904
12905 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
12906
12907 * src/derives.c (derives_compute): Do not subtract NTOKENS from
12908 the pointer DSET returned by malloc; this isn't portable.
12909 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
12910 Similarly for DERIVES.
12911 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
12912 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
12913 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
12914
12915 * src/derives.c (derives_compute): Do not bother invoking
12916 int_of_rule_number, since rule numbers are integers.
12917
12918 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
12919 rather than XMALLOC (char, N).
12920
12921 * src/files.c (filename_split): Rewrite to avoid cast.
12922
12923 * src/gram.h (symbol_number_as_item_number,
12924 item_number_as_symbol_number, rule_number_as_item_number,
12925 item_number_as_rule_number):
12926 Now inline functions rather than macros, to avoid casts.
12927 * src/state.h (state_number_as_int): Likewise.
12928 * src/tables.c (state_number_to_vector_number,
12929 symbol_number_to_vector_number): Likewise.
12930
12931 * src/gram.h (int_of_rule_number): Remove; no longer used.
12932
12933 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
12934 since the resulting storage is always stored into.
12935
12936 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
12937 where it's needed.
12938
12939 * src/muscle_tab.c (muscle_m4_output):
12940 Now inline. Return bool, not int.
12941 * src/state.c (state_compare): Likewise.
12942 * src/symtab.c (symbol_check_defined,
12943 symbol_check_alias_consistency, symbol_pack, symbol_translation,
12944 hash_compare_symbol, hash_symbol):
12945 Likewise.
12946 * src/uniqstr.c (uniqstr_print): Likewise.
12947 * src/muscle_tab.c (muscle_m4_output_processor):
12948 New function, to avoid casts.
12949 * src/state.c (state_comparator, stage_hasher): Likewise.
12950 * src/symtab.c (symbol_check_defined_processor,
12951 symbol_check_alias_consistency_processor, symbol_pack_processor,
12952 symbol_translation_processor, hash_symbol_comparator,
12953 hash_symbol_hasher): Likewise.
12954 * src/uniqstr.c (uniqstr_print_processor): Likewise.
12955 * src/muscle_tab.c (muscles_m4_output):
12956 Use new functions instead of casting old functions unportably.
12957 * src/state.c (state_hash_new): Likewise.
12958 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
12959 symbols_token_translations_init):
12960 Likewise.
12961 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
12962
12963 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
12964 var instead of casting to long, to avoid casts.
12965 (prepare_states): Use MALLOC rather than alloca, so that we don't
12966 have to worry about alloca.
12967 * src/state.c (state_hash_lookup): Likewise.
12968
12969 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
12970 local var instead of casting to unsigned char, to avoid casts.
12971
12972 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
12973 STATE_ALLOC): Remove.
12974 (transitions_new, errs_new, reductions_new, state_new): Use malloc
12975 rather than calloc, and use offsetof to avoid allocating slightly
12976 too much storage.
12977 (state_new): Initialize all members.
12978
12979 * src/state.c (state_hash): Use unsigned accumulator, not signed.
12980
12981 * src/symtab.c (symbol_free): Remove; unused.
12982 (symbol_get): Remove cast in lhs of assignment.
12983 (symbols_do): Now static. Accept generic arguments, not
12984 hashing-related ones.
12985
12986 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
12987 (symbol_processor): Remove.
12988 (symbols_do): Remove decl; now static.
12989
12990 * src/system.h (alloca): Remove; decl no longer needed.
12991 (<stddef.h>): Include, for offsetof.
12992 (<inttypes.>, <stdint.h>): Include if available.
12993 (uintptr_t): New type, if system lacks it.
12994 (CALLOC, MALLOC, REALLOC): New macros.
12995 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12996 new macros.
12997
12998 * src/tables.c (table_size): Now int, to pacify GCC.
12999 (table_grow, table_ninf_remap): Use signed table size.
13000 (save_row): Don't bother initializing locals when not needed.
13001 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13002 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13003
13004 * src/vcg.h: Correct misspellings.
13005
13006 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13007
13008
13009 * src/getargs.c (getargs): Don't assume EOF == -1.
13010
13011 2002-12-09 Paul Eggert <eggert@twinsun.com>
13012
13013 Change identifier spellings to avoid collisions with names
13014 that are reserved by POSIX.
13015
13016 Don't use names ending in _t, since POSIX reserves them.
13017 For consistency, remove _e and _s endings -- they're weren't
13018 needed to remove ambiguity. All uses changed.
13019 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13020 turn was just renamed from struniq_t.
13021 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13022 which in turn was just renamed from struniq_processor_t.
13023 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13024 in turn was renamed from hash_compare_struniq_t.
13025 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13026 (state_list): Renamed from state_list_t.
13027 * src/assoc.h (assoc): Renamed from assoc_t.
13028 * src/conflicts.c (enum conflict_resolution): Renamed from
13029 enum conflict_resolution_e.
13030 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13031 (rule_list): Renamed from rule_list_t.
13032 * src/getargs.h (enum trace): Renamed from enum trace_e.
13033 (enum report): Renamed from enum report_e.
13034 * src/gram.h (item_number): Renamed from item_number_t.
13035 (rule_number): Renamed from rule_number_t.
13036 (struct rule_s): Remove the "rule_s" part; not used.
13037 (rule): Renamed from rule_t.
13038 (rule_filter): Renamed from rule_filter_t.
13039 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13040 (goto_list): Renamed from goto_list_t.
13041 * src/lalr.h (goto_number): Renamed from goto_number_t.
13042 * src/location.h (location): Renamed from location_t.
13043 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13044 and moved here from:
13045 * src/muscle_tab.h (muscle_entry_t): here.
13046 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13047 (rule_list): Renamed from rule_list_t.
13048 * src/print_graph.c (static_graph): Renamed from graph.
13049 * src/reader.h (braced_code): Renamed from braced_code_t.
13050 Remove brace_code_e tag.
13051 * src/relation.h (relation_node): Renamed from relation_node_t.
13052 (relation_nodes): Renamed from relation_nodes_t.
13053 (relation): Renamed from relation_t.
13054 * src/state.h (state_number): Renamed from state_number_t.
13055 (struct state): Renamed from struct state_s.
13056 (state): Renamed from state_t.
13057 (transitions): Renamed from transitions_t. Unused (and
13058 misspelled) transtion_s tag removed.
13059 (errs): Renamed from errs_t. Unused errs_s tag removed.
13060 (reductions): Renamed from reductions_t. Unused tag
13061 reductions_s removed.
13062 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13063 (struct symbol_list): Renamed from struct symbol_list_s.
13064 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13065 (struct symbol): Renamed from struct symbol_s.
13066 (symbol): Renamed from symbol_t.
13067 * src/tables.c (vector_number): Renamed from vector_number_t.
13068 (action_number): Renamed from action_t.
13069 * src/tables.h (base_number): Renamed from base_t.
13070 * src/vcg.h (enum color): Renamed from enum color_e.
13071 (enum textmode): Renamed from enum textmode_e.
13072 (enum shape): Renamed from enum shape_e.
13073 (struct colorentry): Renamed from struct colorentry_s.
13074 (struct classname): Renamed from struct classname_s.
13075 (struct infoname): Renamed from struct infoname_s.
13076 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13077 (enum decision): Renamed from enum decision_e.
13078 (enum orientation): Renamed from enum orientation_e.
13079 (enum alignment): Renamed from enum alignment_e.
13080 (enum arrow_mode): Renamed from enum arrow_mode_e.
13081 (enum crossing_type): Renamed from enum crossing_type_e.
13082 (enum view): Renamed from enum view_e.
13083 (struct node): Renamed from struct node_s.
13084 (node): Renamed from node_t.
13085 (enum linestyle): Renamed from enum linestyle_e.
13086 (enum arrowstyle): Renamed from enum arrowstyle_e.
13087 (struct edge): Renamed from struct edge.
13088 (edge): Renamed from edge_t.
13089 (struct graph): Renamed from struct graph_s.
13090 (graph): Renamed from graph_t.
13091 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13092 Rename value_t -> value.
13093 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13094 value_t_as_yystype -> value_as_yystype.
13095
13096 Don't include <errno.h> in the mainstream code, since it
13097 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13098 * lib/get-errno.c, lib/get-errno.h: New files.
13099 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13100 get-errno.c.
13101 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13102 * src/output.c (output_skeleton): Likewise.
13103 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13104 instead of errno.
13105 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13106 Likewise.
13107 (handle_action_dollar, handle_action_at): Likewise.
13108 * src/system.h: Do not include <errno.h>.
13109 (TAB_EXT): Renamed from EXT_TAB.
13110 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13111
13112 Avoid str[a-z]*, since <string.h> reserves that name space.
13113 Change all instances of "struniq" in names to "uniqstr", and
13114 likewise for "STRUNIQ" and "UNIQSTR".
13115 * src/uniqstr.c: Renamed from src/struniq.c.
13116 * src/uniqstr.h: Renamed from src/struniq.h.
13117 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13118 * src/files.c (strsuffix): Remove; unused.
13119 (concat2): Renamed from stringappend. Now static.
13120 * src/files.h (strsuffix, stringappend): Remove; unused.
13121 * src/parse-gram.y (<chars>): Renamed from <string>.
13122 (<uniqstr>): Renamed from <struniq>.
13123 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13124 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13125 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13126 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13127 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13128 (N_EXPAND): Renamed from N_STRETCH.
13129
13130 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13131 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13132 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13133 Remove; unused.
13134 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13135 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13136 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13137 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13138 (BASE_MAXIMUM): Renamed from BASE_MAX.
13139 (BASE_MINIMUM): Renamed from BASE_MIN.
13140 (ACTION_MAX): Remove; unused.
13141 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13142 Unnecessary casts removed from above defines.
13143
13144
13145 Fix misspelling in names.
13146 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13147 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
13148 G_NODE_ALIGNEMENT.
13149
13150
13151 * lib/timevar.c (timevar_report): Renamed from time_report,
13152 for consistency with other names.
13153 * lib/timevar.h (timevar_report): New decl.
13154 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
13155
13156
13157 Sort include-file uses.
13158
13159 Reorder all include files under src to be in the order "system.h".
13160 then the ../lib include files in angle brackets (alphabetized),
13161 then the . include files in double-quotes (alphabetized). Fix
13162 dependency breakages encountered in this process, as follows:
13163 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
13164 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
13165 * src/state.h: Include "symtab.h".
13166
13167 2002-12-08 Paul Eggert <eggert@twinsun.com>
13168
13169 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
13170 since this causes problems when __file__ contains character
13171 sequences like "@" that are treated specially by src/scan-skel.l.
13172 Instead, just use the file's basename. This fixes the bug
13173 reported by Martin Mokrejs in
13174 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
13175
13176 2002-12-06 Paul Eggert <eggert@twinsun.com>
13177
13178 Add support for rules that do not have trailing semicolons, as
13179 POSIX requires. Improve the quality of locations in Bison
13180 diagnostics.
13181
13182 * src/location.c: Include <quotearg.h>.
13183 (empty_location): Now const.
13184 (location_print): New function. Follow the recommendation of the
13185 GNU Coding Standards for locations that span file boundaries.
13186 * src/location.h: Do not include <quotearg.h>; no longer needed.
13187 (boundary): New type.
13188 (location_t): Use it. This allows locations to span file boundaries.
13189 All member uses changed: file -> start.file or end.file (as needed),
13190 first_line -> start.line, first_column -> start.column,
13191 last_line -> end.line, last_column -> end.column.
13192 (equal_boundaries): New function.
13193 (LOCATION_RESET, LOCATION_STEP): Remove.
13194 (LOCATION_PRINT): Remove. All callers changed to use location_print.
13195 (empty_location): Now const.
13196 (location_print): New decl.
13197 * src/parse-gram.y (lloc_default): New function, which handles
13198 empty locations more accurately.
13199 (YYLLOC_DEFAULT): Use it.
13200 (%token COLON): Remove.
13201 (%token ID_COLON): New token.
13202 (rules): Use it.
13203 (declarations, rules): Remove trailing semicolon.
13204 (declaration, rules_or_grammar_declaration):
13205 Allow empty (";") declaration.
13206 (symbol_def): Remove empty actions; no longer needed.
13207 (rules_or_grammar_declaration): Remove trailing semicolon.
13208 (semi_colon.opt): Remove.
13209 * src/reader.h: Include location.h.
13210 (scanner_cursor): New decl.
13211 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
13212 rolling our own.
13213 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
13214 of *loc.
13215 (STEP): Remove. No longer needed, now that adjust_location does
13216 the work. All uses removed.
13217 (scanner_cursor): New var.
13218 (adjust_location): Renamed from extend_location. It now sets
13219 *loc and adjusts the scanner cursor. All uses changed.
13220 Don't bother testing for CR.
13221 (handle_syncline): Remove location arg; now updates scanner cursor.
13222 All callers changed.
13223 (unexpected_end_of_file): Now accepts start boundary of token or
13224 comment, not location. All callers changed. Update scanner cursor,
13225 not the location.
13226 (SC_AFTER_IDENTIFIER): New state.
13227 (context_state): Renamed from c_context. All uses changed.
13228 (id_loc, code_start, token_start): New local vars.
13229 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
13230 processing of Yacc white space and equivalents here.
13231 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
13232 instead of returning ID immediately, since we need to search for
13233 a subsequent colon.
13234 (<INITIAL>"'", "\""): Save token_start.
13235 (<INITIAL>"%{", "{", "%%"): Save code_start.
13236 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
13237 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
13238 BEGIN context_state at end, not INITIAL.
13239 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
13240 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
13241 Return correct token start.
13242 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
13243 the start of a character, string or multiline comment is found.
13244 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
13245 Reduction): Adjust reported locations to match the more-precise
13246 results now expected.
13247 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
13248 * tests/reduce.at (Useless Rules, Reduced Automaton,
13249 Underivable Rules): Likewise.
13250 * tests/regression.at (Invalid inputs): No longer `expecting ";"
13251 or "|"' now that so many other tokens are allowed by the new grammar.
13252
13253 * src/complain.h (current_file): Remove duplicate decl;
13254 current_file is now owned by files.h.
13255 * src/complain.c, src/scan-gram.l: Include files.h.
13256
13257 2002-12-06 Paul Eggert <eggert@twinsun.com>
13258
13259 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
13260 promotes to int; it might be unsigned int.
13261 * data/yacc.c (yy_reduce_print): Likewise.
13262
13263 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
13264 be #defined in the prologue, not in the Bison declarations.
13265 This fixes Debian Bug 102878, reported by Shaul Karl.
13266
13267 2002-12-02 Paul Eggert <eggert@twinsun.com>
13268
13269 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
13270 * lib/strtoul.c: New file, from gnulib.
13271 This fixes a porting bug reported by Peter Klein in
13272 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
13273
13274 2002-11-30 Paul Eggert <eggert@twinsun.com>
13275
13276 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
13277 and put only a forward declaration in the prologue. This is for
13278 consistency with the other scanner helper functions.
13279
13280 Type clashes now generate warnings, not errors, since it
13281 appears that POSIX may allow some grammars with type clashes.
13282 * src/reader.c (grammar_current_rule_check): Warn about
13283 type clashes instead of complaining.
13284 * tests/input.at (Type Clashes): Expect warnings, not complaints.
13285
13286 Add Yacc library, since POSIX requires it.
13287 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
13288 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
13289 * lib/main.c, lib/yyerror.c: New files.
13290
13291 gram_error can be static; it need not be extern.
13292 * src/reader.h (gram_error): Remove decl.
13293 * src/parse-gram.y (gram_error): Now static. Add static decl.
13294 (print_token_value): Omit parameter names from forward decl,
13295 for consistency.
13296
13297 2002-11-29 Paul Eggert <eggert@twinsun.com>
13298
13299 * doc/bison.texinfo: Emphasize that yylex and yyerror must
13300 be declared before being used. E.g., one should typically
13301 declare them in the prologue. Use GNU coding style in examples.
13302 Put "const" consistently after the type it modifies. Mention
13303 that C99 supports "inline". Mention that yyerror traditionally
13304 returns "int".
13305
13306 %parse-param and %lex-param now take just one argument, the
13307 declaration; the argument name is deduced from the declaration.
13308
13309 * doc/bison.texinfo (Parser Function, Pure Calling, Error
13310 Reporting, Table of Symbols): Document this.
13311 * src/parse-gram.y (add_param): New function.
13312 (COMMA): Remove.
13313 (declaration): Implement new rule for %parse-param and %lex-param.
13314 * src/scan-gram.l: "," now elicits a warning, rather than being
13315 a token; this is more compatible with byacc.
13316 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
13317
13318 2002-11-27 Paul Eggert <eggert@twinsun.com>
13319
13320 Rename identifiers to avoid real and potential collisions.
13321
13322 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
13323 to avoid collision with lex macro described by Bruce Lilly in
13324 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
13325 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13326 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
13327 * src/parse-gram.y (print_token_value): Renamed from yyprint.
13328 All uses changed.
13329 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
13330 The name "yycontrol" violates the name space rules, and this stuff
13331 wasn't being used anyway.
13332 (input): Remove action; this stuff wasn't being used.
13333 (gram_error): Rename local variable yylloc -> loc.
13334 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
13335 (YY_DECL): Don't use "yy" at start of local variables.
13336 All uses changed, e.g., yylloc -> loc.
13337 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
13338 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
13339 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
13340 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
13341
13342 * src/parse-gram.y (gram_error): loc is now const *.
13343 * src/reader.h (gram_error): Likewise.
13344
13345 2002-11-24 Paul Eggert <eggert@twinsun.com>
13346
13347 Version 1.75c.
13348
13349 * tests/actions.at (Actions after errors): Use an output format
13350 more similar to that of the Printers and Destructors test.
13351 Test the position of the ';' token too.
13352 (Printers and Destructors): Likewise.
13353 (Printers and Destructors: %glr-parser): Remove for now, to avoid
13354 unnecessarily alarming people when the test fails.
13355
13356 * data/yacc.c (yyerrlab1): Move this label down, so that the
13357 parser does not discard the lookahead token if the user code
13358 invokes YYERROR. This change is required for POSIX conformance.
13359
13360 * lib/error.c: Sync with gnulib.
13361
13362 2002-11-22 Paul Eggert <eggert@twinsun.com>
13363
13364 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
13365 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
13366 * lib/xmalloc.c: Likewise.
13367
13368 2002-11-20 Paul Eggert <eggert@twinsun.com>
13369
13370 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
13371
13372 2002-11-20 Paul Eggert <eggert@twinsun.com>
13373
13374 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
13375 should use `if (! x) abort ();' rather than `assert (x);', and
13376 anyway it's one less thing to worry about configuring.
13377
13378 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
13379 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
13380 and replace all instances of assert with abort.
13381 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
13382 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
13383
13384 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
13385 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
13386 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
13387 hash_find_entry, hash_rehash, hash_insert): Likewise.
13388 * src/conflicts.c (resolve_sr_conflict): Likewise.
13389 * src/lalr.c (set_goto_map, map_goto): Likewise.
13390 * src/nullable.c (nullable_compute): Likewise.
13391 * src/output.c (prepare_rules, token_definitions_output): Likewise.
13392 * src/reader.c (packgram, reader): Likewise.
13393 * src/state.c (state_new, state_free, state_transitions_set,
13394 state_reduction_find): Likewise.
13395 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
13396 symbol_pack): Likewise.
13397 * src/tables.c (conflict_row, pack_vector): Likewise.
13398 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13399 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13400 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
13401 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
13402
13403 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
13404 (ARGMATCH_CONSTRAINT): New macro.
13405 (ARGMATCH_ASSERT): Use it.
13406
13407 * src/system.h (verify): New macro.
13408 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
13409 rather than assert.
13410 * src/tables.c (tables_generate): Likewise.
13411
13412 * src/struniq.c (struniq_assert): Now returns void, and aborts
13413 if the assertion is false.
13414 (struniq_assert_p): Remove.
13415 * src/struniq.h: Likewise.
13416
13417 2002-11-18 Paul Eggert <eggert@twinsun.com>
13418
13419 * data/glr.c (yygetLRActions): Replace `yyindex' with
13420 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
13421 This fixes the regression with Sun ONE Studio 7 cc that I reported in
13422 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
13423
13424 2002-11-18 Akim Demaille <akim@epita.fr>
13425
13426 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
13427 space.
13428 From Tim Van Holder.
13429
13430 2002-11-17 Paul Eggert <eggert@twinsun.com>
13431
13432 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
13433 to "SyntaxError" for consistency with my 2002-11-15 change.
13434
13435 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
13436 not define to {}, since this breaks the common use of `YYDPRINTF
13437 ((...));' if a single statement is desired (e.g. before `else').
13438 Work around GCC warnings by surrounding corresponding calls with
13439 {} if needed.
13440 (yyhasResolvedValue): Remove unused function.
13441 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
13442 loop body.
13443 (yyreportSyntaxError): Renamed from yyreportParseError.
13444 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
13445 All uses changed.
13446 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
13447 extern when possible. Remove unused initializations.
13448
13449 2002-11-16 Akim Demaille <akim@epita.fr>
13450
13451 Augment the similarity between GLR and LALR traces.
13452
13453 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
13454 (YY_REDUCE_PRINT): New.
13455 (yyparse): Use them.
13456 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
13457 YYDPRINT here.
13458 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
13459 state reached after the reduction/recovery, since...
13460 (yyparse, yyprocessOneStack): Report the state we are entering in.
13461
13462 2002-11-16 Akim Demaille <akim@epita.fr>
13463
13464 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
13465 Add support for --trace=skeleton.
13466 * src/scan-skel.l: %option debug.
13467 Scan strings of non-@ or \n instead of character by character.
13468 (scan_skel): Handle trace_skeleton.
13469 (QPUTS): New.
13470 (@output_parser_name@, @output_header_name@): ``Restore'' their
13471 support (used to be M4 macros).
13472 * data/yacc.c: Quote larger chunks, a la glr.c.
13473 * data/lalr1.cc: Likewise.
13474 The header guards are no longer available, so use some other
13475 string than `YYLSP_NEEDED'.
13476
13477 2002-11-16 Akim Demaille <akim@epita.fr>
13478
13479 Make the ``Printers and Destructors'' test more verbose, taking
13480 `yacc.c''s behavior as (possibly wrong) reference.
13481
13482 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
13483 instead of fprint on stdout.
13484 Set and report the last_line of the symbols.
13485 Consistently display values and locations.
13486
13487 2002-11-16 Paul Eggert <eggert@twinsun.com>
13488
13489 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
13490
13491 2002-11-15 Paul Eggert <eggert@twinsun.com>
13492
13493 * tests/actions.at (Actions after errors): New test case.
13494
13495 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
13496 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
13497 tests/action.at, tests/calc.at, tests/conflicts.at,
13498 tests/cxx-type.at, tests/regression.at:
13499 "parse error" -> "syntax error" for POSIX compatibility.
13500 "parsing stack overflow..." -> "parser stack overflow" so
13501 that code matches Bison documentation.
13502
13503 2002-11-15 Akim Demaille <akim@epita.fr>
13504
13505 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
13506 take two BRACED_CODE, not two string_content.
13507 Free the scanner's obstack when we are done.
13508 (code_content): New.
13509 * tests/calc.at: Adjust.
13510 * doc/bison.texinfo: Adjust.
13511 Also, make sure to include the `,' for these declarations.
13512
13513 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
13514
13515 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
13516 definition; avoids potential autoreconf problems.
13517
13518 2002-11-15 Akim Demaille <akim@epita.fr>
13519
13520 Always check the value returned by yyparse.
13521
13522 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
13523 returned by yyparse.
13524 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
13525 Adjust calls.
13526 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
13527 returned by yyparse.
13528
13529 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13530
13531 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
13532 on input.at test.
13533
13534 2002-11-14 Paul Eggert <eggert@twinsun.com>
13535
13536 * src/output.c (output_skeleton): Call xfopen instead of
13537 duplicating xfopen's body.
13538
13539 Fix bugs reported by Nelson H. F. Beebe in
13540 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
13541
13542 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
13543 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
13544 Group compiler. Instead, use "$CC -E bar.c". Include the .h
13545 file twice in the grammar, as an extra check.
13546
13547 * tests/input.at (Torturing the Scanner): Surround the
13548 backslash-newline tests with "#if 0", to make it less likely that
13549 we'll run into compiler bugs. Bring back solitary \ inside
13550 comment, but add a closing comment to work around HP C bug. Don't
13551 test backslash-newline in C character constant.
13552
13553 2002-11-14 Akim Demaille <akim@epita.fr>
13554
13555 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
13556 status of the compiler.
13557 Calling `exit 1' is no longer needed.
13558 Reported by Nelson H. F. Beebe.
13559
13560 2002-11-14 Akim Demaille <akim@epita.fr>
13561
13562 * tests/atlocal.in (CPPFLAGS): We have config.h.
13563 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
13564 New.
13565 * tests/actions.at, tests/calc.at, tests/conflicts.at,
13566 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
13567 * tests/regression.at, tests/torture.at: Use them for all the
13568 grammars that are to be compiled.
13569 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
13570 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
13571 * doc/bison.texinfo (GLR Parsers): Document `inline'.
13572
13573 2002-11-14 Akim Demaille <akim@epita.fr>
13574
13575 * doc/bison.texinfo: Various formatting changes (alignments in
13576 samples, additional @group/@end group, GCS in samples.
13577 Use @deffn instead of simple @table to define the directives,
13578 macros, variables etc.
13579
13580 2002-11-13 Paul Eggert <eggert@twinsun.com>
13581
13582 Fix some bugs reported by Albert Chin-A-Young in
13583 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
13584
13585 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
13586 -o c"; the HP C compiler chatters during compilation.
13587 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
13588 * tests/headers.at (export YYLTYPE): Likewise.
13589
13590 * tests/input.at (Torturing the Scanner): Remove lines containing
13591 solitary backslashes, as they tickle a bug in the HP C compiler.
13592
13593 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
13594 comments, since they're not portable. Use GNU coding style.
13595
13596 2002-11-13 Akim Demaille <akim@epita.fr>
13597
13598 * data/yacc.c: Leave bigger chunks of quoted text.
13599 (YYDSYMPRINTF): New.
13600 Use it to report symbol activities.
13601 * data/glr.c (YYDSYMPRINTF): New.
13602 Use it.
13603
13604 2002-11-12 Paul Eggert <eggert@twinsun.com>
13605
13606 Version 1.75b.
13607
13608 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
13609 (yyglrReduce): Return yyok, not 0.
13610 This should avoid the enumerated-type warnings reported
13611 by Nelson H. F. Beebe in
13612 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
13613
13614 * lib/bbitset.h (BITSET_INLINE): Remove.
13615 * lib/bitset.h [! BITSET_INLINE]: Remove.
13616 (bitset_set, bitset_reset, bitset_test): Rename local vars
13617 to avoid shadowing warnings by GCC.
13618
13619 * data/glr.c (inline): Remove #define. It's the user's
13620 responsibility to #define it away, just like 'const'.
13621 This fixes one of the bugs reported by Nelson H. F. Beebe in
13622 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
13623
13624 * Makefile.maint (po-check): Scan .l and .y files instead of the
13625 .c and the .h files that they generate. This fixes the bug
13626 reported by Tim Van Holder in:
13627 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
13628 Look for N_ as well as for _. Try to avoid matching #define for
13629 N_ and _.
13630 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
13631 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
13632 * src/scan-gram.l: Revamp regular expressions so that " and '
13633 do not confuse xgettext.
13634
13635 * src/struniq.h (struniq_new): Do not declare the return type
13636 to be 'const'; this violates the C standard.
13637 * src/struniq.c (struniq_new): Likewise.
13638
13639 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
13640
13641 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
13642 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
13643 linker.
13644
13645 2002-11-12 Akim Demaille <akim@epita.fr>
13646
13647 * Makefile.maint: Sync with Autoconf:
13648 (local_updates): New.
13649
13650 2002-11-12 Akim Demaille <akim@epita.fr>
13651
13652 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
13653
13654 2002-11-12 Akim Demaille <akim@epita.fr>
13655
13656 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
13657 locations.
13658
13659 2002-11-12 Akim Demaille <akim@epita.fr>
13660
13661 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
13662 not yyvalue.
13663
13664 2002-11-12 Akim Demaille <akim@epita.fr>
13665
13666 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
13667 Use it to test the GLR parser.
13668
13669 2002-11-12 Akim Demaille <akim@epita.fr>
13670
13671 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
13672 defines it.
13673 * data/glr.c (yystos): New.
13674 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
13675 (YYDSYMPRINT): New.
13676 (yyval): Don't define it, it is handled via M4.
13677 (yyrecoverParseError): Free verbosely the discarded symbols.
13678 * data/yacc.c (yysymprint): Remove, rather...
13679 (b4_yysymprint_generate): invoke.
13680 * data/c.m4 (b4_yysymprint_generate): New.
13681 Accept pointers as arguments, as opposed to the version from
13682 yacc.c.
13683 (b4_yydestruct_generate): Likewise.
13684 * tests/cations.at (Printers and Destructors): Use Bison directives
13685 instead of CPP macros.
13686 Don't rely on internal details.
13687
13688 2002-11-12 Akim Demaille <akim@epita.fr>
13689
13690 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
13691 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
13692 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
13693 it against YYEMPTY and so forth), work on yytoken (i.e., set
13694 it to YYEMPTY etc.).
13695 (yydestruct): Replace with a b4_yydestruct_generate invocation.
13696 (b4_symbol_actions): Remove.
13697 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
13698 for 0, end-of-input.
13699
13700 2002-11-12 Akim Demaille <akim@epita.fr>
13701
13702 * doc/bison.texinfo (Destructor Decl): New.
13703
13704 2002-11-12 Akim Demaille <akim@epita.fr>
13705
13706 * src/tables.c (tables_generate): Use free for pointers that
13707 cannot be NULL, not XFREE.
13708 (pack_vector): Use assert, not fatal, for bound violations.
13709 * src/state.c (state_new): Likewise.
13710 * src/reader.c (reader): Likewise.
13711 * src/lalr.c (set_goto_map): Likewise.
13712 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
13713 the file name.
13714
13715 2002-11-12 Akim Demaille <akim@epita.fr>
13716
13717 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
13718 Restore.
13719 * src/scan-gram.l (last_string): Is global to the file, not to
13720 yylex.
13721 * src/parse-gram.y (input): Don't append the epilogue here,
13722 (epilogue.opt): do it here, and free the scanner's obstack.
13723 * src/reader.c (epilogue_set): Rename as...
13724 (epilogue_augment): this.
13725 * data/c.m4 (b4_epilogue): Defaults to empty.
13726
13727 2002-11-12 Akim Demaille <akim@epita.fr>
13728
13729 * src/getargs.c (long_options): Remove duplicates.
13730 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
13731 Remove.
13732 * doc/bison.rnh: Remove.
13733 * doc/bison.texinfo (VMS Invocation): Remove.
13734
13735 2002-11-12 Akim Demaille <akim@epita.fr>
13736
13737 * src/struniq.h, src/struniq.c (struniq_t): Is const.
13738 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
13739
13740 Use struniq for symbols.
13741
13742 * src/symtab.h (symbol_t): The tag member is a struniq.
13743 (symbol_type_set): Adjust.
13744 * src/symtab.c (symbol_new): Takes a struniq.
13745 (symbol_free): Don't free the tag member.
13746 (hash_compare_symbol_t, hash_symbol_t): Rename as...
13747 (hash_compare_symbol, hash_symbol): these.
13748 Use the fact that tags as struniqs.
13749 (symbol_get): Use struniq_new.
13750 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
13751 Returns a strniq.
13752 * src/reader.h (merger_list, grammar_currentmerge_set): The name
13753 and type members are struniqs.
13754 * src/reader.c (get_merge_function)
13755 (grammar_current_rule_merge_set): Adjust.
13756 (TYPE, current_type): Are struniq.
13757
13758 Use struniq for file names.
13759
13760 * src/files.h, src/files.c (infile): Split into...
13761 (grammar_file, current_file): these.
13762 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
13763 * src/reduce.c (reduce_print): Likewise.
13764 * src/getargs.c (getargs): Likewise.
13765 * src/complain.h, src/complain.c: Likewise.
13766 * src/main.c (main): Call struniqs_new early enough to use it for
13767 file names.
13768 Don't free the input file name.
13769
13770 2002-11-12 Akim Demaille <akim@epita.fr>
13771
13772 * src/symtab.c (symbol_free): Remove dead deactivated code:
13773 type_name are properly removed.
13774 Don't use XFREE to free items that cannot be NULL.
13775 * src/struniq.h, src/struniq.c: New.
13776 * src/main.c (main): Initialize/free struniqs.
13777 * src/parse-gram.y (%union): Add astruniq member.
13778 (yyprint): Adjust.
13779 * src/scan-gram.l (<{tag}>): Return a struniq.
13780 Free the obstack bit that used to store it.
13781 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
13782
13783 2002-11-11 Paul Eggert <eggert@twinsun.com>
13784
13785 Revamp to fix many (but not all) of the C- and M4-related quoting
13786 problems. Among other things, this fixes the Bison bug reported
13787 by Jan Hubicka when processing the Bash grammar; see:
13788 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
13789
13790 Use new @ escapes consistently. Represent brackets with @{ and @}
13791 rather than @<:@ and @:>@, since this works a bit better with dumb
13792 editors like vi. Represent @ with @@, since @ is now consistently
13793 an escape. Use @oline@ and @ofile@ rather than __oline__ and
13794 __ofile__, to avoid unexpected expansions. Similarly, use @output
13795 rather than #output.
13796
13797 * data/c.m4 (b4_copyright): Omit file name from comment, since
13798 the file name could contain "*/".
13799 (b4_synclines_flag): Don't quote the 2nd argument; it should already
13800 be quoted. All uses changed.
13801
13802 * data/glr.c: Use new @ escapes consistently.
13803 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
13804 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
13805 Remove, since they couldn't handle arbitrary characters in file
13806 names.
13807 * data/lalr1.cc: Likewise.
13808 * data/yacc.c: Likewise.
13809
13810 * src/files.c (output_infix): Remove; all uses removed.
13811 * src/files.h: Likewise.
13812
13813 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
13814 mishandled funny characters in file names, and anyway it isn't
13815 needed any more.
13816 * data/yacc.c: Likewise.
13817 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
13818
13819 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
13820 * data/yacc.c: Likewise.
13821
13822 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
13823 strings now.
13824 (muscle_init): Quote filename as a C string.
13825 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
13826 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
13827 * src/output.c (escaped_file_name_output): New function.
13828 (prepare_symbols): Quote tokens for M4.
13829 (prepare): Don't insert output_infix, output_prefix,
13830 output_parser_name, output_header_name; this is now down by scan-skel.
13831 Insert skeleton as a C string.
13832
13833 * src/output.c (user_actions_output, symbol_destructors_output,
13834 symbol_printers_output): Quote filenames for C and M4.
13835 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13836
13837 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
13838 escapes other than \\ and \'; this simplifies the code.
13839 (<SC_STRING>): Likewise, for \\ and \".
13840 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
13841 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
13842 Use new escapes @{ and @} for [ and ].
13843
13844 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
13845 them with auto vars.
13846 Switch to new escape scheme, where @ is the escape character uniformly.
13847 Abort if a stray escape character is found. Avoid unbounded input
13848 buffer when parsing non-escaped text.
13849
13850 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
13851 __oline__, #output, $@, and @{ do not have unintended meanings.
13852
13853 2002-11-09 Paul Eggert <eggert@twinsun.com>
13854
13855 Fix the test failure due to GCC warnings described in
13856 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
13857 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
13858 evaluate to 0 if it's impossible for NINF to be in the respective
13859 table.
13860 (yygetLRActions, yyrecoverParseError): Use them.
13861
13862 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
13863 counted in the token inserted at end of file. Now takes
13864 location_t *, not location_t, so that the location can be
13865 adjusted. All uses changed.
13866
13867 * tests/regression.at (Invalid inputs): Adjust wording in
13868 diagnostic to match the new behavior.
13869
13870 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
13871 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
13872 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
13873 abort ();'. This reduces the runtime of the "Many lookaheads"
13874 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
13875 GCC 3.2.
13876
13877 2002-11-07 Paul Eggert <eggert@twinsun.com>
13878
13879 * src/parse-gram.y (CHARACTER): Remove unused token.
13880 All uses removed.
13881
13882 * src/scan-gram.l: Remove stack option. We no longer use the
13883 stack, since the stack was never deeper than 1; instead, use the
13884 new auto var c_context to record the stacked value.
13885
13886 Remove nounput option. At an unexpected end of file, we now unput
13887 the minimal input necessary to end cleanly; this simplifies the
13888 code.
13889
13890 Avoid unbounded token sizes where this is easy.
13891
13892 (unexpected_end_of_file): New function.
13893 Use it to systematize the error message on unexpected EOF.
13894 (last-string): Now auto, not static.
13895 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
13896 (scanner_last_string_free): Remove; not used.
13897 (percent_percent_count): Move decl to just before use.
13898 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
13899 not the (never otherwised-used) CHARACTER.
13900
13901 2002-11-07 Akim Demaille <akim@epita.fr>
13902
13903 Let yyerror always receive the msg as last argument, so that
13904 yyerror can be variadic.
13905
13906 * data/yacc.c (b4_yyerror_args): New.
13907 Use it when calling yyerror.
13908 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
13909 Use it when calling yyerror.
13910 * doc/bison.texinfo (Error Reporting): Adjust.
13911 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
13912 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
13913
13914 2002-11-06 Akim Demaille <akim@epita.fr>
13915
13916 #line should have quoted strings.
13917 Ideally, this should be done by m4_quotearg.
13918
13919 * src/scan-skel.l: Include quotearg.h.
13920 Quote __ofile__.
13921 * src/output.c (symbol_printers_output)
13922 (symbol_destructors_output): Quote the file name.
13923
13924 2002-11-06 Akim Demaille <akim@epita.fr>
13925
13926 * tests/regression.at (Invalid inputs): Adjust to the recent
13927 messages.
13928
13929 2002-11-06 Akim Demaille <akim@epita.fr>
13930
13931 Restore --no-lines.
13932 Reported by Jim Kent.
13933
13934 * data/c.m4 (b4_syncline): New.
13935 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
13936 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
13937 * src/output.c (user_actions_output): Likewise.
13938 (prepare): Define 'b4_synclines_flag'.
13939 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
13940
13941 2002-11-06 Akim Demaille <akim@epita.fr>
13942
13943 * src/main.c (main): Free `infile'.
13944 * src/scan-gram.l (handle_syncline): New.
13945 Recognize `#line'.
13946 * src/output.c (user_actions_output, symbol_destructors_output)
13947 (symbol_printers_output): Use the location's file name, not
13948 infile.
13949 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13950
13951 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13952
13953 * src/tables.c (matching_state): Don't allow states to match if
13954 either has GLR conflict entries.
13955
13956 2002-11-05 Paul Eggert <eggert@twinsun.com>
13957
13958 * src/scan-gram.l: Use more accurate diagnostics, e.g.
13959 "integer out of range" rather than "invalid value".
13960 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
13961 accordingly.
13962
13963 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
13964 Also, remove one static variable in the scanner.
13965
13966 * src/scan-gram.l (braces_level): Now auto, not static.
13967 Initialize to zero if the compiler is being picky.
13968 (INITIAL): Clear braces_level instead of incrementing it.
13969 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
13970 as POSIX 1003.1-2001 requires.
13971 * src/system.h (IF_LINT): New macro, taken from coreutils.
13972 * configure.ac: Define "lint" if --enable-gcc-warnings.
13973
13974 2002-11-05 Akim Demaille <akim@epita.fr>
13975
13976 * src/scan-gram.l: When it starts with `%', complain about the
13977 whole directive, not just that `invalid character: %'.
13978
13979 2002-11-04 Akim Demaille <akim@epita.fr>
13980
13981 * Makefile.maint: Update from Autoconf.
13982 (update, cvs-update, po-update, do-po-update): New.
13983
13984 2002-11-04 Akim Demaille <akim@epita.fr>
13985
13986 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
13987 and yyerror.
13988 Have yyerror `use' its arguments.
13989 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
13990 returns true when location & yacc & pure & parse-param.
13991 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
13992
13993 2002-11-04 Akim Demaille <akim@epita.fr>
13994
13995 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13996 clashes.
13997 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13998 font-lock-mode.
13999 Use complain_at.
14000 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14001 slot 0.
14002
14003 2002-11-03 Paul Eggert <eggert@twinsun.com>
14004
14005 * src/reader.c (get_merge_function, grammar_current_rule_check):
14006 Use consistent diagnostics for reporting type name clashes.
14007 Quote the types with <>, for consistency with Yacc.
14008 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14009
14010 2002-11-03 Akim Demaille <akim@epita.fr>
14011
14012 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14013 New.
14014 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14015 (b4_parse_param): Remove.
14016 Use b4_identification.
14017 Propagate b4_pure_args where needed to pass them to yyerror.
14018 * data/glr.m4 (b4_parse_param): Remove.
14019 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14020 (b4_lpure_formals): New.
14021 Use b4_identification.
14022 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14023 b4_user_formals and b4_user_args.
14024 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14025 (yyreportAmbiguity): When using a pure parser, also need
14026 the location, and the parse-params.
14027 Adjust callers.
14028 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14029 When using a pure parser, also need the parse-params.
14030 Adjust callers.
14031 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14032 (%pure-parser + %parse-param) LALR and GLR parsers.
14033 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14034 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14035 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14036 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14037 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14038 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14039 * doc/bison.texinfo: Untabify the whole file.
14040 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14041 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14042 (Error Reporting): Adjust to these new directives.
14043 Document %error-verbose, deprecate YYERROR_VERBOSE.
14044
14045 2002-11-03 Akim Demaille <akim@epita.fr>
14046
14047 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14048 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14049 command line options.
14050 * tests/cxx-type.at: Formatting changes.
14051
14052 2002-11-03 Paul Eggert <eggert@twinsun.com>
14053
14054 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14055 to count columns correctly, and to check for invalid inputs.
14056
14057 Use mbsnwidth to count columns correctly. Account for tabs, too.
14058 Include mbswidth.h.
14059 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14060 (extend_location): New function.
14061 (YY_LINES): Remove.
14062
14063 Handle CRLF in C code rather than in Lex code.
14064 (YY_INPUT): New macro.
14065 (no_cr_read): New function.
14066
14067 Scan UCNs, even though we don't fully handle them yet.
14068 (convert_ucn_to_byte): New function.
14069
14070 Handle backslash-newline correctly in C code.
14071 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14072 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14073 all uses changed.
14074 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14075 Use {splice} wherever C allows backslash-newline.
14076 YY_STEP after space, newline, vertical-tab.
14077 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
14078
14079 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14080
14081 ({int}, handle_action_dollar, handle_action_at): Check for integer
14082 overflow.
14083
14084 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14085
14086 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14087 as well as \000. Check for UCHAR_MAX, not 255.
14088 Allow \x with an arbitrary positive number of digits, as in C.
14089 Check for overflow here.
14090 Allow \? and UCNs, for compatibility with C.
14091
14092 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14093 with quote slot used by complain_at.
14094
14095 * tests/input.at: Add tests for backslash-newline, m4 quotes
14096 in symbols, long literals, and funny escapes in strings.
14097
14098 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14099 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14100 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14101 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14102 * m4/mbswidth.m4: New file, from GNU coreutils.
14103
14104 * doc/bison.texinfo (Grammar Outline): Document // comments.
14105 (Symbols): Document that trigraphs have no special meaning in Bison,
14106 nor is backslash-newline allowed.
14107 (Actions): Document that trigraphs have no special meaning.
14108
14109 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14110 no longer used.
14111
14112 2002-11-02 Paul Eggert <eggert@twinsun.com>
14113
14114 * src/reader.c: Don't include quote.h; not needed.
14115 (get_merge_function): Reword warning to be consistent with
14116 type clash diagnostic in grammar_current_rule_check.
14117
14118 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14119 bug in trigraph handling.
14120
14121 * src/output.c (prepare_symbols): When printing token names,
14122 escape "[" as "@<:@" and likewise for "]".
14123
14124 * src/system.h (errno): Remove declaration, as we are now
14125 assuming C89 or better, and C89 guarantees errno.
14126
14127 2002-10-30 Paul Eggert <eggert@twinsun.com>
14128
14129 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14130 Check for close failures.
14131 * src/files.h (xfclose): Return void, not int, since it always
14132 returned zero.
14133 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14134 indicates one.
14135 * src/output.c (output_skeleton): Use xfclose rather than fclose
14136 and ferror. xfclose now checks ferror.
14137
14138 * data/glr.c (YYLEFTMOST_STATE): Remove.
14139 (yyreportTree): Use a stack-based leftmost state. This avoids
14140 our continuing battles with bogus warnings about initializers.
14141
14142 2002-10-30 Akim Demaille <akim@epita.fr>
14143
14144 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14145 #if.
14146
14147 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14148
14149 * tests/glr-regr1.at: New test for reported regressions.
14150 * tests/testsuite.at: Add glr-regr1.at test.
14151 * tests/Makefile.am: Add glr-regr1.at test.
14152
14153 2002-10-24 Paul Eggert <eggert@twinsun.com>
14154
14155 Version 1.75a.
14156
14157 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
14158 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
14159 we use malloc. Don't assume 'A' through 'Z' are contiguous.
14160 Don't assume strdup exists; POSIX says its an XSI extension.
14161 Check for buffer overflow on input.
14162
14163 2002-10-24 Akim Demaille <akim@epita.fr>
14164
14165 * src/output.c (output_skeleton): Don't disable M4sugar comments
14166 too soon: it results in comments being expanded.
14167 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
14168 first output.
14169
14170 2002-10-24 Akim Demaille <akim@epita.fr>
14171
14172 * data/yacc.c (m4_int_type): New.
14173 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
14174 char' as only yacc.c wants K&R portability.
14175 * data/glr.c (yysigned_char): Remove.
14176 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
14177 Reported by Quoc Peyrot.
14178
14179 2002-10-23 Paul Eggert <eggert@twinsun.com>
14180
14181 * src/main.c (main): With --trace=time, report times even if a
14182 non-fatal error occurs. Formerly, the times were reported in some
14183 such cases but not in others.
14184 * src/reader.c (reader): Just return if a complaint has been issued,
14185 instead of exiting, so that 'main' can report times.
14186
14187 2002-10-22 Akim Demaille <akim@epita.fr>
14188
14189 * src/system.h: Include sys/types.
14190 Reported by Bert Deknuydt.
14191
14192 2002-10-23 Paul Eggert <eggert@twinsun.com>
14193
14194 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
14195 Suggested by Art Haas.
14196
14197 2002-10-22 Paul Eggert <eggert@twinsun.com>
14198
14199 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
14200 decl; not needed any more.
14201 * src/main.c (main): Use return to exit, undoing yesterday's change.
14202 The last OS that we could find where this wouldn't work is
14203 SunOS 3.5, and that's too old to worry about now.
14204
14205 * data/glr.c (struct yyltype): Define members even when not
14206 doing locations. This is more consistent with yacc.c, and it
14207 works around the following bug reports:
14208 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
14209 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
14210
14211 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
14212 @acronym consistently. Standardize on "Yacc" instead of "YACC",
14213 "Algol" instead of "ALGOL". Give a bit more history about BNF.
14214
14215 2002-10-22 Akim Demaille <akim@epita.fr>
14216
14217 * data/README: New.
14218
14219 2002-10-21 Paul Eggert <eggert@twinsun.com>
14220
14221 Be consistent about 'bool'; the old code used an enum in one
14222 module and an int in another, and this violates the C standard.
14223 * m4/stdbool.m4: New file, from coreutils 4.5.3.
14224 * configure.ac (AC_HEADER_STDBOOL): Add.
14225 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
14226 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
14227 * src/symtab.c (hash_compare_symbol_t): Likewise.
14228 * src/system.h (bool, false, true): Use a definition consistent
14229 with ../lib/hash.c. All uses changed.
14230
14231 * src/complain.c (warning_issued): Renamed from warn_message_count,
14232 so that we needn't worry about integer overflow (!).
14233 Now of type bool. All uses changed.
14234 (complaint_issued): Renamed from complain_message_count; likewise.
14235
14236 * src/main.c (main): Use exit to exit with failure.
14237
14238 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
14239 rather than 1 and 0.
14240 * src/main.c (main): Likewise.
14241 * src/getargs.c (getargs): Likewise.
14242 * src/reader.c (reader): Likewise.
14243
14244 * src/getarg.c (getargs): Remove duplicate code for
14245 "Try `bison --help'".
14246
14247 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
14248 What was that "2" for?
14249
14250 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
14251 * src/getargs.c (usage): Likewise.
14252
14253 * src/getargs.c (getargs): When there are too few operands, report
14254 the last one. When there are too many, report the first extra
14255 one. This is how diffutils does it.
14256
14257 2002-10-20 Paul Eggert <eggert@twinsun.com>
14258
14259 Remove K&R vestiges.
14260 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
14261 * src/complain.c (VA_START): Remove. Assume prototypes.
14262 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
14263 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
14264 fatal): Assume prototypes.
14265 * src/complain.h: Assume prototypes.
14266 * src/system.h (PARAMS): Remove.
14267 Include <limits.h> unconditionally, since it's guaranteeed even
14268 for a freestanding C89 compiler.
14269 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
14270 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
14271
14272 2002-10-20 Akim Demaille <akim@epita.fr>
14273
14274 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
14275 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
14276 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
14277 (yyresolveStates, yyresolveAction, yyresolveStack)
14278 (yyprocessOneStack): Use them.
14279 (yy_reduce_print): New.
14280 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
14281
14282 2002-10-20 Akim Demaille <akim@epita.fr>
14283
14284 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
14285 arguments and output `void'.
14286 (b4_c_function): Rename as...
14287 (b4_c_function_def): this.
14288 (b4_c_function_decl, b4_c_ansi_function_def)
14289 (b4_c_ansi_function_decl): New.
14290 Change the interpretation of the arguments: before `int, foo', now
14291 `int foo, foo'.
14292 * data/yacc.c (yyparse): Prototype and define thanks to these.
14293 Adjust b4_c_function_def uses.
14294 * data/glr.c (yyparse): Likewise, but ANSI only.
14295
14296 2002-10-20 Akim Demaille <akim@epita.fr>
14297
14298 * src/output.c (prepare): Move the definition of `tokens_number',
14299 `nterms_number', `undef_token_number', `user_token_number_max'
14300 to...
14301 (prepare_tokens): Here.
14302 (prepare_tokens): Rename as...
14303 (prepare_symbols): this.
14304 (prepare): Move the definition of `rules_number' to...
14305 (prepare_rules): here.
14306 (prepare): Move the definition of `last', `final_state_number',
14307 `states_number' to...
14308 (prepare_states): here.
14309 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
14310
14311 2002-10-20 Akim Demaille <akim@epita.fr>
14312
14313 * src/tables.h, src/tables.c, src/output.c: Comment changes.
14314
14315 2002-10-20 Akim Demaille <akim@epita.fr>
14316
14317 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
14318 * data/c.m4: here.
14319
14320 2002-10-20 Akim Demaille <akim@epita.fr>
14321
14322 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
14323 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
14324 `pair'.
14325 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
14326 `name' to...
14327 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
14328 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
14329 These.
14330
14331 2002-10-19 Paul Eggert <eggert@twinsun.com>
14332
14333 Do not create a temporary file, as that involves security and
14334 cleanup headaches. Instead, use a pair of pipes.
14335 Derived from a suggestion by Florian Krohm.
14336 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
14337 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
14338 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
14339 (BISON_PREREQ_SUBPIPE): Add.
14340 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
14341 Add subpipe.h, subpipe.c.
14342 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
14343 * po/POTFILES.in: Add lib/subpipe.c.
14344 * src/output.c: Include "subpipe.h".
14345 (m4_invoke): Remove decl.
14346 (scan_skel): New decl.
14347 (output_skeleton): Use pipe rather than temporary file for m4 input.
14348 Check that m4sugar.m4 is readable, to avoid deadlock.
14349 Check for pipe I/O error.
14350 * src/scan-skel.l (readpipe): Remove decl.
14351 (scan_skel): New function, to be used in place of m4_invoke.
14352 Read from stream rather than file.
14353
14354 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
14355 float, as this generates a warning on Solaris 8 + GCC 3.2 with
14356 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
14357 this generates a more-accurate value anyway.
14358
14359 * lib/timevar.c (timervar_accumulate): Rename locals to
14360 avoid confusion with similarly-named more-global.
14361 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
14362
14363 * src/output.c (prepare): Use xstrdup to convert char const *
14364 to char *, to avoid GCC warning.
14365
14366 2002-10-19 Akim Demaille <akim@epita.fr>
14367
14368 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
14369 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
14370 Use them to have `calc.y' ready for %pure-parser.
14371 * data/yacc.c (YYLEX): Pass a yylex return type to
14372 b4_c_function_call.
14373
14374 2002-10-19 Akim Demaille <akim@epita.fr>
14375
14376 Prototype support of %lex-param and %parse-param.
14377
14378 * src/parse-gram.y: Add the definition of the %lex-param and
14379 %parse-param tokens, plus their rules.
14380 Drop the `_' version of %glr-parser.
14381 Add the "," token.
14382 * src/scan-gram.l (INITIAL): Scan them.
14383 * src/muscle_tab.c: Comment changes.
14384 (muscle_insert, muscle_find): Rename `pair' as `probe'.
14385 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
14386 (muscle_entry_s): The `value' member is no longer const.
14387 Adjust all dependencies.
14388 * src/muscle_tab.c (muscle_init): Adjust: use
14389 MUSCLE_INSERT_STRING.
14390 Initialize the obstack earlier.
14391 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
14392 (muscle_pair_list_grow): New.
14393 * data/c.m4 (b4_c_function_call, b4_c_args): New.
14394 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
14395 * tests/calc.at: Use %locations, not --locations.
14396 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
14397
14398 2002-10-19 Akim Demaille <akim@epita.fr>
14399
14400 * src/getargs.c (usage): Take status as argument and exit
14401 accordingly.
14402 Report the traditional `Try ... --help' message when status != 0.
14403 (usage, version): Don't take a FILE * as arg, it is pointless.
14404 (getargs): When there is an incorrect number of arguments, make it
14405 an error, and report it GNUlically thanks to `usage ()'.
14406
14407 2002-10-18 Paul Eggert <eggert@twinsun.com>
14408
14409 * data/glr.c (yyreportParseError): Don't assume that sprintf
14410 yields the length of the printed string, as this is not true
14411 on SunOS 4.1.4. Reported by Peter Klein.
14412
14413 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
14414 * tests/conflicts.at (%nonassoc and eof): Likewise.
14415 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
14416
14417 2002-10-17 Akim Demaille <akim@epita.fr>
14418
14419 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
14420 * src/getargs.c (trace_types, trace_args): Adjust.
14421 * src/reader.c (grammar_current_rule_prec_set)
14422 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
14423 Standardize error messages.
14424 And s/@prec/%prec/!
14425 (reader): Use trace_flag to enable scanner/parser debugging,
14426 instead of an adhoc scheme.
14427 * src/scan-gram.l: Remove trailing debugging code.
14428
14429 2002-10-16 Paul Eggert <eggert@twinsun.com>
14430
14431 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
14432 MUSCLE_TAB_H.
14433
14434 * NEWS: Officially drop support for building Bison with K&R C,
14435 since it didn't work anyway and it's not worth worrying about.
14436 * Makefile.maint (wget_files): Remove ansi2knr.c.
14437 (ansi2knr.c-url_prefix): Remove.
14438 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
14439 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14440 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14441
14442 2002-10-15 Paul Eggert <eggert@twinsun.com>
14443
14444 Stop using the "enum_" trick for K&R-style function definitions;
14445 it confused me, and I was the author! Instead, assume that people
14446 who want to use K&R C compilers (when using these modules in GCC,
14447 perhaps?) will run ansi2knr.
14448
14449 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
14450 All uses of "enum_" changed to "enum ".
14451 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14452 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14453
14454 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
14455 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
14456 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
14457 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
14458 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
14459 abitset_not, abitset_ones, abitset_or, abitset_or_and,
14460 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
14461 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
14462 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
14463 Use function prototypes; this removes the need for declaring
14464 static functions simply to provide their prototypes.
14465 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
14466 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
14467 bitset_count_, bitset_create, bitset_dump, bitset_first,
14468 bitset_free, bitset_init, bitset_last, bitset_next,
14469 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
14470 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
14471 bitset_print, bitset_release_memory, bitset_toggle_,
14472 bitset_type_choose, bitset_type_get, bitset_type_name_get,
14473 debug_bitset): Likewise.
14474 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
14475 * lib/bitset_stats.c (bitset_log_histogram_print,
14476 bitset_percent_histogram_print, bitset_stats_and,
14477 bitset_stats_and_cmp, bitset_stats_and_or,
14478 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
14479 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
14480 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
14481 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
14482 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
14483 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
14484 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
14485 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
14486 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
14487 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
14488 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
14489 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
14490 bitset_stats_zero): Likewise.
14491 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14492 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14493 bitsetv_dump, debug_bitsetv): Likewise.
14494 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
14495 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
14496 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
14497 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
14498 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
14499 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
14500 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
14501 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
14502 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
14503 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
14504 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
14505 Likewise.
14506 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
14507 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
14508 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
14509 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
14510 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
14511 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
14512 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
14513 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
14514 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
14515 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
14516 lbitset_xor_cmp, lbitset_zero): Likewise.
14517
14518 2002-10-14 Akim Demaille <akim@epita.fr>
14519
14520 Version 1.75.
14521
14522 2002-10-14 Akim Demaille <akim@epita.fr>
14523
14524 * tests/Makefile.am (maintainer-check-posix): New.
14525
14526 2002-10-14 Akim Demaille <akim@epita.fr>
14527
14528 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
14529 member.
14530
14531 2002-10-14 Akim Demaille <akim@epita.fr>
14532
14533 * src/tables.c (table_ninf_remap): base -> tab.
14534 Reported by Matt Rosing.
14535
14536 2002-10-14 Paul Eggert <eggert@twinsun.com>
14537
14538 * tests/action.at, tests/calc.at, tests/conflicts.at,
14539 tests/cxx-type.at, tests/headers.at, tests/input.at,
14540 tests/regression.at, tests/synclines.at, tests/torture.at:
14541 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
14542 so that the tests still work even if POSIXLY_CORRECT is set.
14543 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
14544
14545 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
14546 for portability to K&R hosts. Fix typo: signed char is guaranteed
14547 only to 127, not to 128.
14548 * data/glr.c (yysigned_char): New type.
14549 * data/yacc.c (yysigned_char): Likewise.
14550 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
14551
14552 2002-10-13 Paul Eggert <eggert@twinsun.com>
14553
14554 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
14555 true due to limited range of data type" warning from GCC.
14556
14557 * data/c.m4 (b4_token_defines): Protect against double-inclusion
14558 by wrapping enum yytokentype's definition inside #ifndef
14559 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
14560
14561 2002-10-13 Akim Demaille <akim@epita.fr>
14562
14563 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
14564 Un yy- yyrhs to avoid the name clash with the global YYRHS.
14565
14566 2002-10-13 Akim Demaille <akim@epita.fr>
14567
14568 * Makefile.maint: Update from Autoconf 2.54.
14569 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
14570
14571 2002-10-13 Akim Demaille <akim@epita.fr>
14572
14573 * src/print.c (print_state): Separate the list of solved conflicts
14574 from the other items.
14575 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
14576
14577 2002-10-13 Akim Demaille <akim@epita.fr>
14578
14579 Let nondeterministic skeletons be usable with deterministic
14580 tables.
14581
14582 With the patch, GAWK compiled by GCC without -O2 passes its test
14583 suite using a GLR parser driven by LALR tables. It fails with -O2
14584 because `struct stat' gives two different answers on my machine:
14585 88 (definition of an auto var) and later 96 (memset on this var).
14586 Hence the stack is badly corrumpted. The headers inclusion is to
14587 blame: if I move the awk.h inclusion before GLR's system header
14588 inclusion, the two struct stat have the same size.
14589
14590 * src/tables.c (pack_table): Always create conflict_table.
14591 (token_actions): Always create conflict_list.
14592 * data/glr.c (YYFLAG): Remove, unused.
14593
14594 2002-10-13 Akim Demaille <akim@epita.fr>
14595
14596 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
14597 (O0FLAGS): New.
14598 (VALGRIND, GXX): New.
14599 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
14600 * tests/bison.in: Run $PREBISON a pre-command.
14601 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
14602 (maintainer-check-g++): New.
14603 * Makefile.am (maintainer-check): New.
14604
14605 2002-10-13 Akim Demaille <akim@epita.fr>
14606
14607 * data/glr.c: Formatting changes.
14608 Tweak some trace messages to match yacc.c's.
14609
14610 2002-10-13 Akim Demaille <akim@epita.fr>
14611
14612 GLR parsers sometimes raise parse errors instead of performing the
14613 default reduction.
14614 Reported by Charles-Henry de Boysson.
14615
14616 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
14617 check the length of the traces when %glr.
14618 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
14619 GLR's traces.
14620 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
14621 Test GLR parsers.
14622 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
14623 (yyltype): Remove the yy prefix from the member names.
14624 (yytable): Complete its comment.
14625 (yygetLRActions): Map error action number from YYTABLE from
14626 YYTABLE_NINF to 0.
14627 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
14628 (which was a bug: it should have been YYTABEL_NINF, and yet it was
14629 not satisfying as we could compare an YYACTION computed from
14630 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
14631 only value for error actions.
14632 (yyreportParseError): In verbose parse error messages, don't issue
14633 `error' in the list of expected tokens.
14634 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
14635 next action to perform to match glr.c's decoding.
14636 (yytable): Complete its comment.
14637
14638 2002-10-13 Paul Eggert <eggert@twinsun.com>
14639
14640 Fix problem reported by Henrik Grubbstroem in
14641 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
14642 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
14643 because the Bison parser reads the second action before reducing
14644 the first one.
14645 * src/scan-gram.l (rule_length): New static var.
14646 Use it to keep track of the rule length in the scanner, since
14647 we can't expect the parser to be in lock-step sync with the scanner.
14648 (handle_action_dollar, handle_action_at): Use this var.
14649 * tests/actions.at (Exotic Dollars): Test for the problem.
14650
14651 2002-10-12 Paul Eggert <eggert@twinsun.com>
14652
14653 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
14654 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
14655 Include <sys/time.h> when checking for clock_t and struct tms.
14656 Use same include order as source.
14657 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
14658 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
14659
14660 * lib/timevar.c: Update copyright date and clarify comments.
14661 (get_time) [IN_GCC]: Keep the GCC version for reference.
14662
14663 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
14664 GCC version as of today, then merge Bison's changes.
14665 Change "GCC" to "Bison" in copyright notice. timevar.def's
14666 author is Akim, so change that too.
14667
14668 * src/reader.c (grammar_current_rule_check):
14669 Don't worry about the default action if $$ is untyped.
14670 Prevents bogus warnings reported by Jim Gifford in
14671 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
14672
14673 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
14674 * data/glr.c, data/lalr1.cc, data/yacc.c:
14675 Output token definitions before the first part of user declarations.
14676 Fixes compatibility problem reported by Jim Gifford for kbd in
14677 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14678
14679 2002-10-11 Paul Eggert <eggert@twinsun.com>
14680
14681 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
14682 (yyparse): here. This undoes some of the 2002-07-25 change.
14683 Compatibility problem reported by Ralf S. Engelschall with
14684 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
14685
14686 2002-10-11 Akim Demaille <akim@epita.fr>
14687
14688 * tests/regression.at Characters Escapes): New.
14689 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
14690 characters.
14691 Reported by Jan Nieuwenhuizen.
14692
14693 2002-10-11 Akim Demaille <akim@epita.fr>
14694
14695 * po/id.po: New.
14696
14697 2002-10-10 Paul Eggert <eggert@twinsun.com>
14698
14699 Portability fixes for bitsets; this also avoids several GCC
14700 warnings.
14701
14702 * lib/abitset.c: Include <stddef.h>, for offsetof.
14703 * lib/lbitset.c: Likewise.
14704
14705 * lib/abitset.c (abitset_bytes): Return a size that is aligned
14706 properly for vectors of objects. Do not assume that adding a
14707 header size to a multiple of a word size yields a value that is
14708 properly aligned for the whole union.
14709 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14710
14711 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
14712 unique names for structures.
14713 * lib/ebitset.c (ebitset_bytes): Likewise.
14714 * lib/lbitset.c (lbitset_bytes): Likewise.
14715
14716 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
14717 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
14718 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
14719 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
14720 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
14721 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
14722 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
14723 to improve the type-checking that GCC can do.
14724 * lib/bitset.c (bitset_op4_cmp): Likewise.
14725 * lib/bitset_stats.c (bitset_stats_count,
14726 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
14727 bitset_stats_copy, bitset_stats_disjoint_p,
14728 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
14729 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
14730 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
14731 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
14732 bitset_stats_and_or_cmp, bitset_stats_andn_or,
14733 bitset_stats_andn_or_cmp, bitset_stats_or_and,
14734 bitset_stats_or_and_cmp): Likewise.
14735 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
14736 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
14737 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
14738 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
14739
14740 * lib/abitset.h: Include bitset.h, not bbitset.h.
14741 * lib/ebitset.h: Likewise.
14742 * lib/lbitset.h: Likewise.
14743
14744 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
14745 All instances of parameters of type enum bitset_opts are now of
14746 type enum_bitset_opts, to conform to the C Standard, and similarly
14747 for enum_bitset_type.
14748 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14749 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14750
14751 Do not use "struct bitset_struct" to mean different things in
14752 different modules. Not only is this confusing, it violates
14753 the C Standard, which requires that structure types in different
14754 modules must be compatible if one is to be passed to the other.
14755 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
14756 All instances of "struct bitset_struct *" replaced with "bitset".
14757 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
14758 (union bitset_union, struct abitset_struct, struct ebitset_struct,
14759 struct lbitset_struct, struct bitset_stats_struct): New types.
14760 All uses of struct bitset_struct changed to union bitset_union,
14761 etc.
14762 * lib/abitset.c (struct abitset_struct, abitset,
14763 struct bitset_struct): Remove.
14764 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
14765 struct bitset_struct): Remove.
14766 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
14767 bitset_struct): Remove.
14768 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
14769 Likewise.
14770
14771 Do not call a function of type T using a call that assumes the
14772 function is of a different type U. Standard C requires that a
14773 function must be called with a type that is compatible with its
14774 definition.
14775 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14776 New decls.
14777 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14778 New functions.
14779 * lib/ebitset.c (PFV): Remove.
14780 * lib/lbitset.c (PFV): Likewise.
14781 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
14782 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
14783 decls.
14784 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
14785 (ebitset_vtable): Use them.
14786 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
14787 lbitset_xor): New functions.
14788 (lbitset_vtable): Use them.
14789
14790 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
14791 Declare.
14792
14793 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
14794 GCC warning.
14795 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
14796 Use offsetof, for simplicity.
14797
14798 2002-10-06 Paul Eggert <eggert@twinsun.com>
14799
14800 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
14801 the same width as int. This reapplies a hunk of the 2002-08-12 patch
14802 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
14803 which was inadvertently undone by the 2002-09-30 patch.
14804 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
14805 the same width as int.
14806
14807 2002-10-04 Paul Eggert <eggert@twinsun.com>
14808
14809 Version 1.50.
14810
14811 * configure.ac (AC_INIT), NEWS: Increment version number.
14812
14813 * doc/bison.texinfo: Minor spelling, grammar, and white space
14814 fixes.
14815 (Symbols): Mention that any negative value returned from yylex
14816 signifies end-of-input. Warn about negative chars. Mention
14817 the portable Standard C character set.
14818
14819 The GNU coding standard says CFLAGS and YFLAGS are reserved
14820 for the installer to set.
14821 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
14822 * src/Makefile.am (AM_CFLAGS): Likewise.
14823 (AM_YFLAGS): Renamed from YFLAGS.
14824
14825 Fix some MAX and MIN problems.
14826 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
14827 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
14828 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
14829 * src/reader.c (reader): Use it.
14830
14831 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
14832 POSIX 1003.1-2001 has removed fgrep.
14833
14834 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
14835
14836 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
14837 interpreted as signed.
14838 * lib/ebitset.c (ebitset_list): Fix bug.
14839
14840 2002-10-01 Paul Eggert <eggert@twinsun.com>
14841
14842 More fixes for 64-bit hosts and large bitsets.
14843
14844 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
14845 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
14846 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
14847 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
14848 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
14849 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
14850 bitset_count_): Likewise.
14851 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
14852 bitset_first, bitset_last): Likewise.
14853 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
14854 bitset_stats_list_reverse, bitset_stats_size,
14855 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
14856 Likewise.
14857 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14858 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14859 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14860 bitsetv_reflexive_transitive_closure): Likewise.
14861 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
14862 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
14863 Likewise.
14864 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
14865 Likewise.
14866
14867 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
14868 Use size_t, not unsigned int, to count bytes.
14869 * lib/abitset.h (abitset_bytes): Likewise.
14870 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
14871 Likewise.
14872 * lib/bitset.h (bitset_bytes): Likewise.
14873 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
14874 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
14875 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14876 * lib/ebitset.c (ebitset_bytes): Likewise.
14877 * lib/ebitset.h (ebitset_bytes): Likewise.
14878 * lib/lbitset.c (lbitset_bytes): Likewise.
14879 * lib/lbitset.h (lbitset_bytes): Likewise.
14880
14881 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
14882 abitset_subset_p, abitset_disjoint_p, abitset_and,
14883 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
14884 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
14885 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
14886 abitset_or_and, abitset_or_and_cmp):
14887 Use bitset_windex instead of unsigned int.
14888 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14889 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
14890 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
14891 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
14892 Likewise.
14893 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
14894
14895 * lib/bitset.c (bitset_print):
14896 Use proper printf formats for widths of integer types.
14897 * lib/bitset_stats.c (bitset_percent_histogram_print,
14898 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
14899 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14900 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14901 * lib/lbitset.c (lbitset_bytes): Likewise.
14902
14903 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
14904 BITSET_SIZE_MAX): New macros.
14905 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
14906 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
14907 to BITSET_WINDEX_MAX.
14908
14909 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
14910 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
14911 since we now return the bitset_bindex type (not int).
14912
14913 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
14914 when computing sizes.
14915 * lib/ebitset.c (ebitset_elts_grow): Likewise.
14916
14917 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
14918 and avoid cast to unsigned.
14919
14920 2002-09-30 Akim Demaille <akim@epita.fr>
14921
14922 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14923 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
14924 Updates from Michael Hayes.
14925
14926 2002-09-30 Art Haas <ahaas@neosoft.com>
14927
14928 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
14929 invocations.
14930 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
14931 defined.
14932
14933 2002-09-27 Akim Demaille <akim@epita.fr>
14934
14935 Version 1.49c.
14936
14937 2002-09-27 Akim Demaille <akim@epita.fr>
14938
14939 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
14940 (Because of AC_LIBSOURCE).
14941
14942 2002-09-27 Akim Demaille <akim@epita.fr>
14943
14944 Playing with Autoscan.
14945
14946 * configure.ac: Remove the old LIBOBJ tweaks.
14947 (AC_REPLACE_FUNCS): Add strrchr and strtol.
14948 * lib/strrchr.c: New.
14949 * lib/strtol.c: New, from the Coreutils 4.5.1.
14950
14951 2002-09-27 Akim Demaille <akim@epita.fr>
14952
14953 Playing with Autoscan.
14954
14955 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
14956 * lib/Makefile.am (libbison_a_SOURCES): No longer include
14957 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
14958 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
14959 Coreutils 4.5.1.
14960
14961 2002-09-24 Akim Demaille <akim@epita.fr>
14962
14963 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
14964 (Frequently Asked Questions, Parser Stack Overflow): New.
14965
14966 2002-09-13 Akim Demaille <akim@epita.fr>
14967
14968 Playing with autoscan.
14969
14970 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
14971 * src/files.c (skeleton_find): Remove, unused.
14972 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
14973 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
14974
14975 2002-09-13 Akim Demaille <akim@epita.fr>
14976
14977 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
14978 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
14979
14980 2002-09-13 Akim Demaille <akim@epita.fr>
14981
14982 * configure.ac: Require 2.54.
14983 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
14984 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
14985 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
14986 Remove, provided by Autoconf macros.
14987
14988 2002-09-12 Akim Demaille <akim@epita.fr>
14989
14990 * m4/prereq.m4: Update, from Coreutils 4.5.1.
14991
14992 2002-09-12 Akim Demaille <akim@epita.fr>
14993
14994 * m4/prereq.m4: Update, from Fileutils 4.1.5.
14995 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14996 Reported by Martin Mokrejs.
14997
14998 2002-09-10 Akim Demaille <akim@epita.fr>
14999
15000 * src/parse-gram.y: Associate a human readable string to each
15001 token type.
15002 * tests/regression.at (Invalid inputs): Adjust.
15003
15004 2002-09-10 Gary V. Vaughan <gary@gnu.org>
15005
15006 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15007 with an Autoconf-2.5x style configure.ac.
15008
15009 2002-09-06 Paul Eggert <eggert@twinsun.com>
15010
15011 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15012 exception applies only to yacc.c. This is a modification of a
15013 patch originally suggested by Akim Demaille.
15014
15015 2002-09-06 Akim Demaille <akim@epita.fr>
15016
15017 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15018 here to...
15019 * data/yacc.c: here.
15020
15021 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15022 LocationType.
15023 (b4_ltype): Default to yy::Location from location.hh.
15024
15025 2002-09-04 Jim Meyering <jim@meyering.net>
15026
15027 * data/yacc.c: Guard the declaration of yytoknum also with
15028 `#ifdef YYPRINT', so it is declared only when used.
15029
15030 2002-09-04 Akim Demaille <akim@epita.fr>
15031
15032 * configure.in: Rename as...
15033 * configure.ac: this.
15034 Bump to 1.49c.
15035
15036 2002-09-04 Akim Demaille <akim@epita.fr>
15037
15038 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15039 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15040 translate maintainer only messages.
15041
15042 2002-08-12 Paul Eggert <eggert@twinsun.com>
15043
15044 Version 1.49b.
15045
15046 * Makefile.am (SUBDIRS): Remove intl.
15047 (DISTCLEANFILES): Remove.
15048 * NEWS: Mention that GNU M4 is now required. Clarify what is
15049 meant by "larger grammars". Mention the pt_BR translation.
15050 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15051 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15052 Bump version from 0.11.2 to 0.11.5.
15053 (BISON_PREREQ_STAGE): Remove.
15054 (AM_GNU_GETTEXT): Use external gettext.
15055 (AC_OUTPUT): Remove intl/Makefile.
15056
15057 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15058
15059 * data/glr.c: Include string.h, for strlen.
15060 (yyreportParseError): Use size_t for yysize.
15061 (yy_yypstack): No longer nested inside yypstates, as nested
15062 functions are not portable. Do not assume size_t is the
15063 same width as int.
15064 (yypstates): Do not assume that ptrdiff_t is the same width
15065 as int, and similarly for yyposn and YYINDEX.
15066
15067 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15068
15069 * lib/Makefile.am (INCLUDES): Do not include from the intl
15070 directory, which has been removed.
15071 * src/Makefile.am (INCLUDES): Likewise.
15072
15073 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15074 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15075 New vars.
15076
15077 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15078 * tests/Makefile.am (EXTRA_DIST): Likewise.
15079
15080 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15081 Do not assume that bitset_windex is the same width as unsigned.
15082
15083 * lib/abitset.c (abitset_unused_clear): Do not assume that
15084 bitset_word is the same width as int.
15085 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15086 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15087 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15088 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15089 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15090
15091 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15092 portability to one's complement hosts!).
15093 * lib/ebitset.c (ebitset_op1): Likewise.
15094 * lib/lbitset.c (lbitset_op1): Likewise.
15095
15096 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15097 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15098 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15099 Sync with fileutils.
15100 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15101 lib/gettext.h: Sync with diffutils.
15102
15103 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15104 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15105
15106 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15107 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15108 check for void *.
15109
15110 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15111 size_t; the old version tried to do this but casted improperly.
15112 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15113 (bitset_test): Now returns int, not unsigned long.
15114
15115 * lib/bitset_stats.c: Include "gettext.h".
15116 (_): New macro.
15117 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15118 name locals "index", as it generates unnecessary warnings on some
15119 hosts that have an "index" function.
15120
15121 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15122 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15123 they need translation.
15124 * src/LR0.c (state_list_append, new_itemsets, get_state,
15125 append_states, generate_states): Likewise.
15126 * src/assoc.c (assoc_to_string): Likewise.
15127 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15128 * src/gram.c (grammar_dump): Likewise.
15129 * src/injections.c (injections_compute): Likewise.
15130 * src/lalr.c (lookaheads_print): Likewise.
15131 * src/relation.c (relation_transpose): Likewise.
15132 * src/scan-gram.l: Likewise.
15133 * src/tables.c (table_grow, pack_vector): Likewise.
15134
15135 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15136 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15137 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15138 * m4/mbstate_t.m4: Sync with fileutils.
15139 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15140
15141 * po/LINGUAS: Add pt_BR.
15142 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15143 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15144 lib/timevar.c.
15145 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15146 manual recommends.
15147 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
15148
15149 * src/complain.c (strerror_r): Remove decl; not needed.
15150 (strerror): Use same pattern as ../lib/error.c.
15151
15152 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
15153
15154 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
15155
15156 * src/main.c (main): Cast result of bindtextdomain and textdomain
15157 to void, to avoid a GCC warning when --disable-nls is in effect.
15158
15159 * src/scan-gram.l: Use strings rather than escapes when possible,
15160 to minimize the number of warnings from xgettext.
15161 (handle_action_dollar, handle_action_at): Don't use isdigit,
15162 as it mishandles negative chars and it may not work as expected
15163 outside the C locale.
15164
15165 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
15166 this is a GCC extension and is not portable to other compilers.
15167
15168 * src/system.h (alloca): Use same pattern as ../lib/error.c.
15169 Do not include <ctype.h>; no longer needed.
15170 Do not include <malloc.h>; no longer needed (and generates
15171 warnings on OpenBSD 3.0).
15172
15173 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
15174 it's not portable.
15175
15176 * tests/regression.at: Do not use 'cc -c input.c -o input';
15177 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
15178
15179 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
15180 exit status as failure, not just exit status 1. Sun C exits
15181 with status 2 sometimes.
15182
15183 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
15184 Use it for the two large tests.
15185
15186 2002-08-02 Akim Demaille <akim@epita.fr>
15187
15188 * src/conflicts.c (conflicts_output): Don't output rules never
15189 reduced here, since anyway that computation doesn't work.
15190 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
15191 (rule_useless_p, rule_never_reduced_p): New.
15192 (grammar_rules_partial_print): Use a filter instead of a range.
15193 Display the title only if needed.
15194 (grammar_rules_print): Adjust.
15195 (grammar_rules_never_reduced_report): New.
15196 * src/tables.c (action_row): Move the computation of rules never
15197 reduced to...
15198 (token_actions): here.
15199 * src/main.c (main): Make the parser before making the report, so
15200 that rules never reduced are computed.
15201 Call grammar_rules_never_reduced_report.
15202 * src/print.c (print_results): Report rules never reduced.
15203 * tests/conflicts.at, tests/reduce.at: Adjust.
15204
15205 2002-08-01 Akim Demaille <akim@epita.fr>
15206
15207 Instead of attaching lookaheads and duplicating the rules being
15208 reduced by a state, attach the lookaheads to the reductions.
15209
15210 * src/state.h (state_t): Remove the `lookaheads',
15211 `lookaheads_rule' member.
15212 (reductions_t): Add a `lookaheads' member.
15213 Use a regular array for the `rules'.
15214 * src/state.c (reductions_new): Initialize the lookaheads member
15215 to 0.
15216 (state_rule_lookaheads_print): Adjust.
15217 * src/state.h, src/state.c (state_reductions_find): New.
15218 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
15219 (count_rr_conflicts): Adjust.
15220 * src/lalr.c (LArule): Remove.
15221 (add_lookback_edge): Adjust.
15222 (state_lookaheads_count): New.
15223 (states_lookaheads_initialize): Merge into...
15224 (initialize_LA): this.
15225 (lalr_free): Adjust.
15226 * src/main.c (main): Don't free nullable and derives too early: it
15227 is used by --verbose.
15228 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
15229
15230 2002-08-01 Akim Demaille <akim@epita.fr>
15231
15232 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
15233 `rule_number_t**'.
15234 (set_derives, free_derives): Rename as...
15235 (derives_compute, derives_free): this.
15236 Adjust all dependencies.
15237 * src/nullable.c (set_nullable, free_nullable): Rename as...
15238 (nullable_compute, nullable_free): these.
15239 (rule_list_t): Store rule_t *, not rule_number_t.
15240 * src/state.c (state_rule_lookaheads_print): Directly compare rule
15241 pointers, instead of their numbers.
15242 * src/main.c (main): Call nullable_free, and derives_free earlier,
15243 as they were lo longer used.
15244
15245 2002-08-01 Akim Demaille <akim@epita.fr>
15246
15247 * lib/timevar.c (get_time): Include children time.
15248 * src/lalr.h (LA, LArule): Don't export them: used with the
15249 state_t.
15250 * src/lalr.c (LA, LArule): Static.
15251 * src/lalr.h, src/lalr.c (lalr_free): New.
15252 * src/main.c (main): Call it.
15253 * src/tables.c (pack_vector): Check whether loc is >= to the
15254 table_size, not >.
15255 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
15256 (tables_generate): do it, since that's also it which allocates
15257 them.
15258 Don't free LA and LArule, main does.
15259
15260 2002-07-31 Akim Demaille <akim@epita.fr>
15261
15262 Separate parser tables computation and output.
15263
15264 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
15265 (conflict_list, conflict_list_cnt, table, check, table_ninf)
15266 (yydefgoto, yydefact, high): Move to...
15267 * src/tables.h, src/tables.c: here.
15268 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15269 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15270 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
15271 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
15272 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
15273 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
15274 (action_row, save_row, token_actions, save_column, default_goto)
15275 (goto_actions, sort_actions, matching_state, pack_vector)
15276 (table_ninf_remap, pack_table, prepare_actions): Move to...
15277 * src/tables.c: here.
15278 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
15279 * src/output.c (token_actions, output_base, output_conflicts)
15280 (output_check): Merge into...
15281 (prepare_actions): this.
15282 (actions_output): Rename as...
15283 (user_actions_output): this.
15284 * src/main.c (main): Call tables_generate and tables_free.
15285
15286 2002-07-31 Akim Demaille <akim@epita.fr>
15287
15288 Steal GCC's --time-report support.
15289
15290 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
15291 stolen/adjusted from GCC.
15292 * m4/stage.m4: Remove time related checks.
15293 * m4/timevar.m4: New.
15294 * configure.in: Adjust.
15295 * src/system.h: Adjust to using timevar.h.
15296 * src/getargs.h, src/getargs.c: Support trace_time for
15297 --trace=time.
15298 * src/main.c (stage): Remove.
15299 (main): Replace `stage' invocations with timevar calls.
15300 * src/output.c: Insert pertinent timevar calls.
15301
15302 2002-07-31 Akim Demaille <akim@epita.fr>
15303
15304 Let --trace have arguments.
15305
15306 * src/getargs.h (enum trace_e): New.
15307 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
15308 (long_options, short_options): --trace/-T takes an optional
15309 argument.
15310 Change all the uses of trace_flag to reflect the new flags.
15311 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
15312
15313 Strengthen `stage' portability.
15314
15315 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
15316 * configure.in: Use it.
15317 Don't check for malloc.h and sys/times.h.
15318 * src/system.h: Include them when appropriate.
15319 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
15320 times and struct tms are available.
15321
15322 2002-07-30 Akim Demaille <akim@epita.fr>
15323
15324 In verbose parse error message, don't report `error' as an
15325 expected token.
15326 * tests/actions.at (Printers and Destructors): Adjust.
15327 * tests/calc.at (Calculator $1): Adjust.
15328 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
15329 error message, do not report the parser accepts the error token in
15330 that state.
15331
15332 2002-07-30 Akim Demaille <akim@epita.fr>
15333
15334 Normalize conflict related messages.
15335
15336 * src/complain.h, src/complain.c (warn, complain): New.
15337 * src/conflicts.c (conflicts_print): Use them.
15338 (conflict_report_yacc): New, extracted from...
15339 (conflicts_print): here.
15340 * tests/conflicts.at, tests/existing.at: Adjust.
15341
15342 2002-07-30 Akim Demaille <akim@epita.fr>
15343
15344 Report rules which are never reduced by the parser: those hidden
15345 by conflicts.
15346
15347 * src/LR0.c (save_reductions): Don't make the final state too
15348 different: save its reduction (accept) instead of having a state
15349 without any action (no shift or goto, no reduce).
15350 Note: the final state is now a ``regular'' state, i.e., the
15351 parsers now contain `reduce 0' as default reduction.
15352 Nevertheless, since they decide to `accept' when yystate =
15353 final_state, they still will not reduce rule 0.
15354 * src/print.c (print_actions, print_reduction): Adjust.
15355 * src/output.c (action_row): Track reduced rules.
15356 (token_actions): Report rules never reduced.
15357 * tests/conflicts.at, tests/regression.at: Adjust.
15358
15359 2002-07-30 Akim Demaille <akim@epita.fr>
15360
15361 `stage' was accidently included in a previous patch.
15362 Initiate its autoconfiscation.
15363
15364 * configure.in: Look for malloc.h and sys/times.h.
15365 * src/main.c (stage): Adjust.
15366 Report only when trace_flag.
15367
15368 2002-07-29 Akim Demaille <akim@epita.fr>
15369
15370 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
15371 state_number_t.
15372 (errs_t): symbol_t*, not symbol_number_t.
15373 (reductions_t): rule_t*, not rule_number_t.
15374 (FOR_EACH_SHIFT): New.
15375 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
15376 * src/print.c, src/print_graph.c: Adjust.
15377
15378 2002-07-29 Akim Demaille <akim@epita.fr>
15379
15380 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
15381
15382 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
15383 (endtoken, accept): these.
15384 * src/reader.c (reader): Set endtoken's default tag to "$end".
15385 Set undeftoken's tag to "$undefined" instead of "$undefined.".
15386 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
15387 Adjust.
15388
15389 2002-07-29 Akim Demaille <akim@epita.fr>
15390
15391 * src/reduce.c (reduce_grammar): When the language is empty,
15392 complain about the start symbol, not the axiom.
15393 Use its location.
15394 * tests/reduce.at (Empty Language): New.
15395
15396 2002-07-26 Akim Demaille <akim@epita.fr>
15397
15398 * src/reader.h, src/reader.c (gram_error): ... can't get
15399 yycontrol without making too strong assumptions on the parser
15400 itself.
15401 * src/output.c (prepare_tokens): Use the real 0th value of
15402 token_translations instead of `0'.
15403 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
15404 visible here.
15405 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
15406 for the time being: %locations ought to provide it to yyerror.
15407
15408 2002-07-25 Akim Demaille <akim@epita.fr>
15409
15410 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
15411 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
15412 * tests/regression.at (Web2c Actions): Adjust.
15413
15414 2002-07-25 Akim Demaille <akim@epita.fr>
15415
15416 Stop storing rules from 1 to nrules + 1.
15417
15418 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
15419 * src/nullable.c, src/output.c, src/print.c, src/reader.c
15420 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
15421 Iterate from 0 to nrules.
15422 Use rule_number_as_item_number and item_number_as_rule_number.
15423 Adjust to `derive' now containing possibly 0.
15424 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
15425 Handle the `- 1' part in rule numbers from/to item numbers.
15426 * src/conflicts.c (log_resolution): Fix the message which reversed
15427 shift and reduce.
15428 * src/output.c (action_row): Initialize default_rule to -1.
15429 (token_actions): Adjust.
15430 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
15431 expected output.
15432 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
15433
15434 2002-07-25 Akim Demaille <akim@epita.fr>
15435
15436 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
15437 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
15438 (b4_c_knr_arg_decl): New.
15439 * data/yacc.c: Use it to define yysymprint, yydestruct, and
15440 yyreport_parse_error.
15441
15442 2002-07-25 Akim Demaille <akim@epita.fr>
15443
15444 * data/yacc.c (yyreport_parse_error): New, extracted from...
15445 (yyparse): here.
15446 (yydestruct, yysymprint): Move above yyparse.
15447 Be K&R compliant.
15448
15449 2002-07-25 Akim Demaille <akim@epita.fr>
15450
15451 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
15452 replace...
15453 (b4_sint_type, b4_uint_type): these.
15454 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
15455 * tests/regression.at (Web2c Actions): Adjust.
15456
15457 2002-07-25 Akim Demaille <akim@epita.fr>
15458
15459 * src/gram.h (TIEM_NUMBER_MAX): New.
15460 (item_number_of_rule_number, rule_number_of_item_number): Rename
15461 as...
15462 (rule_number_as_item_number, item_number_as_rule_number): these.
15463 Adjust dependencies.
15464 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15465 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15466 (symbol_number_to_vector_number): New.
15467 (order): Of vector_number_t* type.
15468 (base_t, BASE_MAX, BASE_MIN): New.
15469 (froms, tos, width, pos, check): Of base_t type.
15470 (action_number_t, ACTION_MIN, ACTION_MAX): New.
15471 (actrow): Of action_number_t type.
15472 (conflrow): Of unsigned int type.
15473 (table_ninf, base_ninf): New.
15474 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
15475 (muscle_insert_int_table, muscle_insert_base_table)
15476 (muscle_insert_rule_number_table): New.
15477 (prepare_tokens): Output `toknum' as int_table.
15478 (action_row): Returns a rule_number_t.
15479 Use ACTION_MIN, not SHRT_MIN.
15480 (token_actions): yydefact is rule_number_t*.
15481 (table_ninf_remap): New.
15482 (pack_table): Use it for `base' and `table'.
15483 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
15484 replaced with...
15485 (YYPACT_NINF, YYTABLE_NINF): these.
15486 (yypact, yytable): Compute their types instead of hard-coded
15487 `short'.
15488 * tests/regression.at (Web2c Actions): Adjust.
15489
15490 2002-07-19 Akim Demaille <akim@epita.fr>
15491
15492 * src/scan-gram.l (id): Can start with an underscore.
15493
15494 2002-07-16 Akim Demaille <akim@epita.fr>
15495
15496 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
15497 Adjust all former `associativity' dependencies.
15498 * src/symtab.c (symbol_new): Default associativity is `undef', not
15499 `right'.
15500 (symbol_check_alias_consistence): Adjust.
15501
15502 2002-07-09 Akim Demaille <akim@epita.fr>
15503
15504 * doc/bison.texinfo: Properly set the ``header'' part.
15505 Use @dircategory ``GNU programming tools'' as per Texinfo's
15506 documentation.
15507 Use @copying.
15508
15509 2002-07-09 Akim Demaille <akim@epita.fr>
15510
15511 * lib/quotearg.h: Protect against multiple inclusions.
15512 * src/location.h (location_t): Add a `file' member.
15513 (LOCATION_RESET, LOCATION_PRINT): Adjust.
15514 * src/complain.c (warn_at, complain_at, fatal_at): Drop
15515 `error_one_per_line' support.
15516
15517 2002-07-09 Akim Demaille <akim@epita.fr>
15518
15519 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
15520 * src/reader.c (lineno): Remove.
15521 Adjust all dependencies.
15522 (get_merge_function): Take a location and use complain_at.
15523 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
15524 * tests/regression.at (Invalid inputs, Mixing %token styles):
15525 Adjust.
15526
15527 2002-07-09 Akim Demaille <akim@epita.fr>
15528
15529 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
15530 recovery rule, and forbid extensions when --yacc.
15531 (gram_error): Use complain_at.
15532 * src/reader.c (reader): Exit if there were parse errors.
15533
15534 2002-07-09 Akim Demaille <akim@epita.fr>
15535
15536 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
15537 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
15538 Reported by R Blake <blakers@mac.com>.
15539
15540 2002-07-09 Akim Demaille <akim@epita.fr>
15541
15542 * data/yacc.c: Output the copyright notive in the header.
15543
15544 2002-07-03 Akim Demaille <akim@epita.fr>
15545
15546 * src/output.c (froms, tos): Are state_number_t.
15547 (save_column): sp, sp1, and sp2 are state_number_t.
15548 (prepare): Rename `final' as `final_state_number', `nnts' as
15549 `nterms_number', `nrules' as `rules_number', `nstates' as
15550 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
15551 unused.
15552 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
15553 * data/lalr1.cc (nsym_): Remove, unused.
15554
15555 2002-07-03 Akim Demaille <akim@epita.fr>
15556
15557 * src/lalr.h, src/lalr.c (goto_number_t): New.
15558 * src/lalr.c (goto_list_t): New.
15559 Propagate them.
15560 * src/nullable.c (rule_list_t): New.
15561 Propagate.
15562 * src/types.h: Remove.
15563
15564 2002-07-03 Akim Demaille <akim@epita.fr>
15565
15566 * src/closure.c (print_fderives): Use rule_rhs_print.
15567 * src/derives.c (print_derives): Use rule_rhs_print.
15568 (rule_list_t): New, replaces `shorts'.
15569 (set_derives): Add comments.
15570 * tests/sets.at (Nullable, Firsts): Adjust.
15571
15572 2002-07-03 Akim Demaille <akim@epita.fr>
15573
15574 * src/output.c (prepare_actions): Free `tally' and `width'.
15575 (prepare_actions): Allocate and free `order'.
15576 * src/symtab.c (symbols_free): Free `symbols'.
15577 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
15578 * src/output.c (m4_invoke): Move to...
15579 * src/scan-skel.l: here.
15580 (<<EOF>>): Close yyout, and free its name.
15581
15582 2002-07-03 Akim Demaille <akim@epita.fr>
15583
15584 Fix some memory leaks, and fix a bug: state 0 was examined twice.
15585
15586 * src/LR0.c (new_state): Merge into...
15587 (state_list_append): this.
15588 (new_states): Merge into...
15589 (generate_states): here.
15590 (set_states): Don't ensure a proper `errs' state member here, do it...
15591 * src/conflicts.c (conflicts_solve): here.
15592 * src/state.h, src/state.c: Comment changes.
15593 (state_t): Rename member `shifts' as `transitions'.
15594 Adjust all dependencies.
15595 (errs_new): For consistency, also take the values as argument.
15596 (errs_dup): Remove.
15597 (state_errs_set): New.
15598 (state_reductions_set, state_transitions_set): Assert that no
15599 previous value was assigned.
15600 (state_free): New.
15601 (states_free): Use it.
15602 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
15603 temporary storage: use `errs' and `nerrs' as elsewhere.
15604 (set_conflicts): Allocate and free this `errs'.
15605
15606 2002-07-02 Akim Demaille <akim@epita.fr>
15607
15608 * lib/libiberty.h: New.
15609 * lib: Update the bitset implementation from upstream.
15610 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
15611 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
15612 * src/main.c: Adjust bitset stats calls.
15613
15614 2002-07-01 Paul Eggert <eggert@twinsun.com>
15615
15616 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
15617 char, so that negative chars don't collide with $.
15618
15619 2002-06-30 Akim Demaille <akim@epita.fr>
15620
15621 Have the GLR tests be `warning' checked, and fix the warnings.
15622
15623 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
15624 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
15625 (yyremoveDeletes): `yyi' and `yyj' are size_t.
15626 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
15627 (yyaddDeferredAction): static.
15628 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
15629 (yyreportParseError): yyprefix is const.
15630 yytokenp is used only when verbose.
15631 (yy__GNUC__): Replace with __GNUC__.
15632 (yypdumpstack): yyi is size_t.
15633 (yypreference): Un-yy local variables and arguments, to avoid
15634 clashes with `yyr1'. Anyway, we are not in the user name space.
15635 (yytname_size): be an int, as is compared with ints.
15636 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
15637 Use them.
15638 * tests/cxx-gram.at: Use quotation to protect $1.
15639 Use AT_COMPILE to enable warnings hunts.
15640 Prototype yylex and yyerror.
15641 `Use' argc.
15642 Include `string.h', not `strings.h'.
15643 Produce and prototype stmtMerge only when used.
15644 yylex takes a location.
15645
15646 2002-06-30 Akim Demaille <akim@epita.fr>
15647
15648 We spend a lot of time in quotearg, in particular when --verbose.
15649
15650 * src/symtab.c (symbol_get): Store a quoted version of the key.
15651 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
15652 Adjust all callers.
15653
15654 2002-06-30 Akim Demaille <akim@epita.fr>
15655
15656 * src/state.h (reductions_t): Rename member `nreds' as num.
15657 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
15658 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
15659
15660 2002-06-30 Akim Demaille <akim@epita.fr>
15661
15662 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
15663 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
15664 (shifts_to): Rename as...
15665 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
15666 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
15667 (TRANSITION_IS_DISABLED, transitions_to): these.
15668
15669 2002-06-30 Akim Demaille <akim@epita.fr>
15670
15671 * src/print.c (print_shifts, print_gotos): Merge into...
15672 (print_transitions): this.
15673 (print_transitions, print_errs, print_reductions): Align the
15674 lookaheads columns.
15675 (print_core, print_transitions, print_errs, print_state,
15676 print_grammar): Output empty lines separator before, not after.
15677 (state_default_rule_compute): Rename as...
15678 (state_default_rule): this.
15679 * tests/conflicts.at (Defaulted Conflicted Reduction),
15680 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
15681 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
15682
15683 2002-06-30 Akim Demaille <akim@epita.fr>
15684
15685 Display items as we display rules.
15686
15687 * src/gram.h, src/gram.c (rule_lhs_print): New.
15688 * src/gram.c (grammar_rules_partial_print): Use it.
15689 * src/print.c (print_core): Likewise.
15690 * tests/conflicts.at (Defaulted Conflicted Reduction),
15691 (Unresolved SR Conflicts): Adjust.
15692 (Unresolved SR Conflicts): Adjust and rename as...
15693 (Resolved SR Conflicts): this, as was meant.
15694 * tests/regression.at (Web2c Report): Adjust.
15695
15696 2002-06-30 Akim Demaille <akim@epita.fr>
15697
15698 * src/print.c (state_default_rule_compute): New, extracted from...
15699 (print_reductions): here.
15700 Pessimize, but clarify the code.
15701 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
15702
15703 2002-06-30 Akim Demaille <akim@epita.fr>
15704
15705 * src/output.c (action_row): Let default_rule be always a rule
15706 number.
15707
15708 2002-06-30 Akim Demaille <akim@epita.fr>
15709
15710 * src/closure.c (print_firsts, print_fderives, closure):
15711 Use BITSET_EXECUTE.
15712 * src/lalr.c (lookaheads_print): Likewise.
15713 * src/state.c (state_rule_lookaheads_print): Likewise.
15714 * src/print_graph.c (print_core): Likewise.
15715 * src/print.c (print_reductions): Likewise.
15716 * src/output.c (action_row): Likewise.
15717 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
15718
15719 2002-06-30 Akim Demaille <akim@epita.fr>
15720
15721 * src/print_graph.c: Use report_flag.
15722
15723 2002-06-30 Akim Demaille <akim@epita.fr>
15724
15725 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
15726 to...
15727 * src/relation.h, src/relation.c (traverse, relation_digraph)
15728 (relation_print, relation_transpose): New.
15729
15730 2002-06-30 Akim Demaille <akim@epita.fr>
15731
15732 * src/state.h, src/state.c (shifts_to): New.
15733 * src/lalr.c (build_relations): Use it.
15734
15735 2002-06-30 Akim Demaille <akim@epita.fr>
15736
15737 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
15738 (item_number_of_rule_number, rule_number_of_item_number): New.
15739 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
15740 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15741 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
15742 Propagate their use.
15743 Much remains to be done, in particular wrt `shorts' from types.h.
15744
15745 2002-06-30 Akim Demaille <akim@epita.fr>
15746
15747 * src/symtab.c (symbol_new): Initialize the `printer' member.
15748
15749 2002-06-30 Akim Demaille <akim@epita.fr>
15750
15751 * src/LR0.c (save_reductions): Remove, replaced by...
15752 * src/state.h, src/state.c (state_reductions_set): New.
15753 (reductions, errs): Rename as...
15754 (reductions_t, errs_t): these.
15755 Adjust all dependencies.
15756
15757 2002-06-30 Akim Demaille <akim@epita.fr>
15758
15759 * src/LR0.c (state_list_t, state_list_append): New.
15760 (first_state, last_state): Now symbol_list_t.
15761 (this_state): Remove.
15762 (new_itemsets, append_states, save_reductions): Take a state_t as
15763 argument.
15764 (set_states, generate_states): Adjust.
15765 (save_shifts): Remove, replaced by...
15766 * src/state.h, src/state.c (state_shifts_set): New.
15767 (shifts): Rename as...
15768 (shifts_t): this.
15769 Adjust all dependencies.
15770 * src/state.h (state_t): Remove the `next' member.
15771
15772 2002-06-30 Akim Demaille <akim@epita.fr>
15773
15774 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
15775 escaped in slot 0.
15776
15777 2002-06-30 Akim Demaille <akim@epita.fr>
15778
15779 Use hash.h for the state hash table.
15780
15781 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
15782 (allocate_storage): Use state_hash_new.
15783 (free_storage): Use state_hash_free.
15784 (new_state, get_state): Adjust.
15785 * src/lalr.h, src/lalr.c (states): Move to...
15786 * src/states.h (state_t): Remove the `link' member, no longer
15787 used.
15788 * src/states.h, src/states.c: here.
15789 (state_hash_new, state_hash_free, state_hash_lookup)
15790 (state_hash_insert, states_free): New.
15791 * src/states.c (state_table, state_compare, state_hash): New.
15792 * src/output.c (output_actions): Do not free states now, since we
15793 still need to know the final_state number in `prepare', called
15794 afterwards. Do it...
15795 * src/main.c (main): here: call states_free after `output'.
15796
15797 2002-06-30 Akim Demaille <akim@epita.fr>
15798
15799 * src/state.h, src/state.c (state_new): New, extracted from...
15800 * src/LR0.c (new_state): here.
15801 * src/state.h (STATE_ALLOC): Move to...
15802 * src/state.c: here.
15803 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
15804 * src/state.h, src/state.c: here.
15805
15806 2002-06-30 Akim Demaille <akim@epita.fr>
15807
15808 * src/reader.c (gensym): Rename as...
15809 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
15810 (getsym): Rename as...
15811 (symbol_get): this.
15812
15813 2002-06-30 Akim Demaille <akim@epita.fr>
15814
15815 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
15816 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
15817 * src/output.c, src/print.c, src/print_graph.c: Propagate.
15818 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
15819
15820 2002-06-30 Akim Demaille <akim@epita.fr>
15821
15822 Make the test suite pass with warnings checked.
15823
15824 * tests/actions.at (Printers and Destructors): Improve.
15825 Avoid unsigned vs. signed issues.
15826 * tests/calc.at: Don't exercise the scanner here, do it...
15827 * tests/input.at (Torturing the Scanner): here.
15828
15829 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15830
15831 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
15832 reorganize first lines parallel to yacc.c.
15833
15834 2002-06-28 Akim Demaille <akim@epita.fr>
15835
15836 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
15837 (b4_token_enum, b4_token_defines): New, factored from...
15838 * data/lalr1.cc, data/yacc.c, glr.c: here.
15839
15840 2002-06-28 Akim Demaille <akim@epita.fr>
15841
15842 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
15843 unused variables.
15844 * src/output.c (merger_output): static.
15845
15846 2002-06-28 Akim Demaille <akim@epita.fr>
15847
15848 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
15849 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
15850 pacify GCC.
15851 * src/output.c (save_row): Initialize all the variables to pacify GCC.
15852
15853 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15854
15855 Accumulated changelog for new GLR parsing features.
15856
15857 * src/conflicts.c (count_total_conflicts): Change name to
15858 conflicts_total_count.
15859 * src/conflicts.h: Ditto.
15860 * src/output.c (token_actions): Use the new name.
15861 (output_conflicts): Change conflp => conflict_list_heads, and
15862 confl => conflict_list for better readability.
15863 * data/glr.c: Use the new names.
15864 * NEWS: Add self to GLR announcement.
15865
15866 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
15867
15868 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
15869 Akim Demaille.
15870
15871 * data/bison.glr: Change name to glr.c
15872 * data/glr.c: Renamed from bison.glr.
15873 * data/Makefile.am: Add glr.c
15874
15875 * src/getargs.c:
15876
15877 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
15878 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
15879
15880 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15881
15882 * data/bison.glr: Be sure to restore the
15883 current #line when returning to the skeleton contents after having
15884 exposed the input file's #line.
15885
15886 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15887
15888 * data/bison.glr: Bring up to date with changes to bison.simple.
15889
15890 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15891
15892 * data/bison.glr: Correct definitions that use b4_prefix.
15893 Various reformatting.
15894 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
15895 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
15896 yytokenp argument; now part of stack.
15897 (yychar): Define to behave as documented.
15898 (yyclearin): Ditto.
15899
15900 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15901
15902 * src/reader.h: Add declaration for free_merger_functions.
15903
15904 * src/reader.c (merge_functions): New variable.
15905 (get_merge_function): New function.
15906 (free_merger_functions): New function.
15907 (readgram): Check for %prec that is not followed by a symbol.
15908 Handle %dprec and %merge declarations.
15909 (packgram): Initialize dprec and merger fields in rules array.
15910
15911 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
15912 conflict_list_cnt, conflict_list_free): New variables.
15913 (table_grow): Also grow conflict_table.
15914 (prepare_rules): Output dprec and merger tables.
15915 (conflict_row): New function.
15916 (action_row): Output conflict lists for GLR parser. Don't use
15917 default reduction in conflicted states for GLR parser so that there
15918 are spaces for the conflict lists.
15919 (save_row): Also save conflict information.
15920 (token_actions): Allocate conflict list.
15921 (merger_output): New function.
15922 (pack_vector): Pack conflict table, too.
15923 (output_conflicts): New function to output yyconflp and yyconfl.
15924 (output_check): Allocate conflict_tos.
15925 (output_actions): Output conflict tables, also.
15926 (output_skeleton): Output b4_mergers definition.
15927 (prepare): Output b4_max_rhs_length definition.
15928 Use 'bison.glr' as default skeleton for GLR parsers.
15929
15930 * src/gram.c (glr_parser): New flag.
15931 (grammar_free): Call free_merger_functions.
15932
15933 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
15934 all pairs of conflicting reductions, rather than just all tokens
15935 causing conflicts. Needed to size conflict tables.
15936 (conflicts_output): Modify call to count_rr_conflicts for new
15937 interface.
15938 (conflicts_print): Ditto.
15939 (count_total_conflicts): New function.
15940
15941 * src/reader.h (merger_list): New type.
15942 (merge_functions): New variable.
15943
15944 * src/lex.h (tok_dprec, tok_merge): New token types.
15945
15946 * src/gram.h (rule_s): Add dprec and merger fields.
15947 (glr_parser): New flag.
15948
15949 * src/conflicts.h (count_total_conflicts): New function.
15950
15951 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
15952
15953 * doc/bison.texinfo (Generalized LR Parsing): New section.
15954 (GLR Parsers): New section.
15955 (Language and Grammar): Mention GLR parsing.
15956 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
15957 Correct typo ("tge" -> "the").
15958
15959 * data/bison.glr: New skeleton for GLR parsing.
15960
15961 * tests/cxx-gram.at: New tests for GLR parsing.
15962
15963 * tests/testsuite.at: Include cxx-gram.at.
15964
15965 * tests/Makefile.am: Add cxx-gram.at.
15966
15967 * src/parse-gram.y:
15968
15969 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
15970
15971 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
15972
15973 2002-06-27 Akim Demaille <akim@epita.fr>
15974
15975 * src/options.h, src/options.c: Remove.
15976 * src/getargs.c (short_options, long_options): New.
15977
15978 2002-06-27 Akim Demaille <akim@epita.fr>
15979
15980 * data/bison.simple, data/bison.c++: Rename as...
15981 * data/yacc.c, data/lalr1.cc: these.
15982 * doc/bison.texinfo (Environment Variables): Remove.
15983
15984 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
15985
15986 * src/getargs.c (report_argmatch): Initialize strtok().
15987
15988 2002-06-20 Akim Demaille <akim@epita.fr>
15989
15990 * data/bison.simple (b4_symbol_actions): New, replaces...
15991 (b4_symbol_destructor, b4_symbol_printer): these.
15992 (yysymprint): Be sure to call YYPRINT only for tokens, and using
15993 user token numbers.
15994
15995 2002-06-20 Akim Demaille <akim@epita.fr>
15996
15997 * data/bison.simple (yydestructor): Rename as...
15998 (yydestruct): this.
15999
16000 2002-06-20 Akim Demaille <akim@epita.fr>
16001
16002 * src/symtab.h, src/symtab.c (symbol_type_set)
16003 (symbol_destructor_set, symbol_precedence_set): The location is
16004 the last argument.
16005 Adjust all callers.
16006
16007 2002-06-20 Akim Demaille <akim@epita.fr>
16008
16009 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16010 internals.
16011 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16012 Takes a location.
16013 * src/symtab.h, src/symtab.c (symbol_class_set)
16014 (symbol_user_token_number_set): Likewise.
16015 Adjust all callers.
16016 Promote complain_at.
16017 * tests/input.at (Type Clashes): Adjust.
16018
16019 2002-06-20 Akim Demaille <akim@epita.fr>
16020
16021 * data/bison.simple (YYLEX): Fix the declaration when
16022 %pure-parser.
16023
16024 2002-06-20 Akim Demaille <akim@epita.fr>
16025
16026 * data/bison.simple (yysymprint): Don't print the token number,
16027 just its name.
16028 * tests/actions.at (Destructors): Rename as...
16029 (Printers and Destructors): this.
16030 Also exercise %printer.
16031
16032 2002-06-20 Akim Demaille <akim@epita.fr>
16033
16034 * data/bison.simple (YYDSYMPRINT): New.
16035 Use it to remove many of the #if YYDEBUG/if (yydebug).
16036
16037 2002-06-20 Akim Demaille <akim@epita.fr>
16038
16039 * src/symtab.h, src/symtab.c (symbol_t): printer and
16040 printer_location are new members.
16041 (symbol_printer_set): New.
16042 * src/parse-gram.y (PERCENT_PRINTER): New token.
16043 Handle its associated rule.
16044 * src/scan-gram.l: Adjust.
16045 (handle_destructor_at, handle_destructor_dollar): Rename as...
16046 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16047 * src/output.c (symbol_printers_output): New.
16048 (output_skeleton): Call it.
16049 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16050 since there are already many grammar files with a user `yyprint'.
16051 Replace the calls to YYPRINT to calls to yysymprint.
16052 * tests/calc.at: Adjust.
16053 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16054 taking advantage of parser very internal details (stack size!).
16055
16056 2002-06-20 Akim Demaille <akim@epita.fr>
16057
16058 * src/scan-gram.l: Complete the scanner with the missing patterns
16059 to pacify Flex.
16060 Use `quote' and `symbol_tag_get' where appropriate.
16061
16062 2002-06-19 Akim Demaille <akim@epita.fr>
16063
16064 * tests/actions.at (Destructors): Augment to test locations.
16065 * data/bison.simple (yydestructor): Pass it the current location
16066 if locations are enabled.
16067 Prototype only when __STDC__ or C++.
16068 Change the argument names to move into the yy name space: there is
16069 user code here.
16070
16071 2002-06-19 Akim Demaille <akim@epita.fr>
16072
16073 * data/bison.simple (b4_pure_if): New.
16074 Use it instead of #ifdef YYPURE.
16075
16076 2002-06-19 Akim Demaille <akim@epita.fr>
16077
16078 * data/bison.simple (b4_location_if): New.
16079 Use it instead of #ifdef YYLSP_NEEDED.
16080
16081 2002-06-19 Akim Demaille <akim@epita.fr>
16082
16083 Prepare @$ in %destructor, but currently don't bind it in the
16084 skeleton, as %location use is not cleaned up yet.
16085
16086 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16087 (handle_action_at): New.
16088 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16089 a braced_code_t and a location as additional arguments.
16090 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16091 unquote one when outputting `b4_dollar_dollar'.
16092 Adjust callers.
16093 * data/bison.simple (b4_eval): Remove.
16094 (b4_symbol_destructor): Adjust.
16095 * tests/input.at (Invalid @n): Adjust.
16096
16097 2002-06-19 Zack Weinberg <zack@codesourcery.com>
16098
16099 * doc/bison.texinfo: Document ability to have multiple
16100 prologue sections.
16101
16102 2002-06-18 Akim Demaille <akim@epita.fr>
16103
16104 * src/files.c (compute_base_names): When computing the output file
16105 names from the input file name, strip the directory part.
16106
16107 2002-06-18 Akim Demaille <akim@epita.fr>
16108
16109 * data/bison.simple.new: Comment changes.
16110 Reported by Andreas Schwab.
16111
16112 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16113
16114 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16115 there are no `label `yyoverflowlab' defined but not used' warnings
16116 when yyoverflow is defined.
16117
16118 2002-06-18 Akim Demaille <akim@epita.fr>
16119
16120 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16121 new member.
16122 (symbol_destructor_set): Adjust.
16123 * src/output.c (symbol_destructors_output): Output the destructor
16124 locations.
16125 Output the symbol name.
16126 * data/bison.simple (b4_symbol_destructor): Adjust.
16127
16128 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16129 and Akim Demaille <akim@epita.fr>
16130
16131 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16132 what's left on the stack when the error recovery hits EOF.
16133 * tests/actions.at (Destructors): Complete to exercise this case.
16134
16135 2002-06-17 Akim Demaille <akim@epita.fr>
16136
16137 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16138 arguments is really empty, not only equal to `[]'.
16139 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16140 member.
16141 (symbol_destructor_set): New.
16142 * src/output.c (symbol_destructors_output): New.
16143 * src/reader.h (brace_code_t, current_braced_code): New.
16144 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16145 (handle_dollar): Rename as...
16146 (handle_action_dollar): this.
16147 (handle_destructor_dollar): New.
16148 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
16149 (grammar_declaration): Use it.
16150 * data/bison.simple (yystos): Is always defined.
16151 (yydestructor): New.
16152 * tests/actions.at (Destructors): New.
16153 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
16154
16155 2002-06-17 Akim Demaille <akim@epita.fr>
16156
16157 * src/symlist.h, src/symlist.c (symbol_list_length): New.
16158 * src/scan-gram.l (handle_dollar, handle_at): Compute the
16159 rule_length only when needed.
16160 * src/output.c (actions_output, token_definitions_output): Output
16161 the full M4 block.
16162 * src/symtab.c: Don't access directly to the symbol tag, use
16163 symbol_tag_get.
16164 * src/parse-gram.y: Use symbol_list_free.
16165
16166 2002-06-17 Akim Demaille <akim@epita.fr>
16167
16168 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
16169 (symbol_list_prepend, get_type_name): Move to...
16170 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
16171 (symbol_list_prepend, symbol_list_n_type_name_get): here.
16172 Adjust all callers.
16173 (symbol_list_free): New.
16174 * src/scan-gram.l (handle_dollar): Takes a location.
16175 * tests/input.at (Invalid $n): Adjust.
16176
16177 2002-06-17 Akim Demaille <akim@epita.fr>
16178
16179 * src/reader.h, src/reader.c (symbol_list_new): Export it.
16180 (symbol_list_prepend): New.
16181 * src/parse-gram.y (%union): `list' is a new member.
16182 (symbols.1): New, replaces...
16183 (terms_to_prec.1, nterms_to_type.1): these.
16184 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
16185 Take a location as additional argument.
16186 Adjust all callers.
16187
16188 2002-06-15 Akim Demaille <akim@epita.fr>
16189
16190 * src/parse-gram.y: Move %token in the declaration section so that
16191 we don't depend upon CVS Bison.
16192
16193 2002-06-15 Akim Demaille <akim@epita.fr>
16194
16195 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
16196 * src/print.c (print_core): Use it.
16197
16198 2002-06-15 Akim Demaille <akim@epita.fr>
16199
16200 * src/conflicts.c (log_resolution): Accept the rule involved in
16201 the sr conflicts instead of the lookahead number that points to
16202 that rule.
16203 (flush_reduce): Accept the current lookahead vector as argument,
16204 instead of the index in LA.
16205 (resolve_sr_conflict): Accept the current number of lookahead
16206 bitset to consider for the STATE, instead of the index in LA.
16207 (set_conflicts): Adjust.
16208 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
16209
16210 2002-06-15 Akim Demaille <akim@epita.fr>
16211
16212 * src/state.h (state_t): Replace the `lookaheadsp' member, a
16213 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
16214 Adjust all dependencies.
16215 * src/lalr.c (initialize_lookaheads): Split into...
16216 (states_lookaheads_count, states_lookaheads_initialize): these.
16217 (lalr): Adjust.
16218
16219 2002-06-15 Akim Demaille <akim@epita.fr>
16220
16221 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
16222 out of...
16223 (grammar_rules_print): here.
16224 * src/reduce.c (reduce_output): Use it.
16225 * tests/reduce.at (Useless Rules, Reduced Automaton)
16226 (Underivable Rules): Adjust.
16227
16228 2002-06-15 Akim Demaille <akim@epita.fr>
16229
16230 Copy BYacc's nice way to report the grammar.
16231
16232 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
16233 New.
16234 Don't print the rules' location, it is confusing and useless.
16235 (rule_print): Use grammar_rhs_print.
16236 * src/print.c (print_grammar): Use grammar_rules_print.
16237
16238 2002-06-15 Akim Demaille <akim@epita.fr>
16239
16240 Complete and rationalize `useless thing' warnings.
16241
16242 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
16243 (symbol_tag_print): New.
16244 Use them everywhere in place of accessing directly the tag member.
16245 * src/gram.h, src/gram.c (rule_print): New.
16246 Use it where a rule used to be printed `by hand'.
16247 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
16248 (reduce_grammar_tables): Report the useless rules.
16249 (reduce_print): Useless things are a warning, not an error.
16250 Report it as such.
16251 * tests/reduce.at (Useless Nonterminals, Useless Rules):
16252 (Reduced Automaton, Underivable Rules): Adjust.
16253 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
16254 * tests/conflicts.at (Unresolved SR Conflicts)
16255 (Solved SR Conflicts): Adjust.
16256
16257 2002-06-15 Akim Demaille <akim@epita.fr>
16258
16259 Let symbols have a location.
16260
16261 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
16262 (getsym): Adjust.
16263 Adjust all callers.
16264 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
16265 Use location_t, not int.
16266 * src/symtab.c (symbol_check_defined): Take advantage of the
16267 location.
16268 * tests/regression.at (Invalid inputs): Adjust.
16269
16270 2002-06-15 Akim Demaille <akim@epita.fr>
16271
16272 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
16273 (input): Don't try to initialize yylloc here, do it in the
16274 scanner.
16275 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
16276 * src/gram.h (rule_t): Change line and action_line into location
16277 and action_location, of location_t type.
16278 Adjust all dependencies.
16279 * src/location.h, src/location.c (empty_location): New.
16280 * src/reader.h, src/reader.c (grammar_start_symbol_set)
16281 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
16282 (grammar_current_rule_symbol_append)
16283 (grammar_current_rule_action_append): Expect a location as argument.
16284 * src/reader.c (grammar_midrule_action): Adjust to attach an
16285 action's location as dummy symbol location.
16286 * src/symtab.h, src/symtab.c (startsymbol_location): New.
16287 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
16288 the line numbers.
16289
16290 2002-06-14 Akim Demaille <akim@epita.fr>
16291
16292 Grammar declarations may be found in the grammar section.
16293
16294 * src/parse-gram.y (rules_or_grammar_declaration): New.
16295 (declarations): Each declaration may end with a semicolon, not
16296 just...
16297 (grammar_declaration): `"%union"'.
16298 (grammar): Branch to rules_or_grammar_declaration.
16299
16300 2002-06-14 Akim Demaille <akim@epita.fr>
16301
16302 * src/main.c (main): Invoke scanner_free.
16303
16304 2002-06-14 Akim Demaille <akim@epita.fr>
16305
16306 * src/output.c (m4_invoke): Extracted from...
16307 (output_skeleton): here.
16308 Free tempfile.
16309
16310 2002-06-14 Akim Demaille <akim@epita.fr>
16311
16312 * src/parse-gram.y (directives, directive, gram)
16313 (grammar_directives, precedence_directives, precedence_directive):
16314 Rename as...
16315 (declarations, declaration, grammar, grammar_declaration)
16316 (precedence_declaration, precedence_declarator): these.
16317 (symbol_declaration): New.
16318
16319 2002-06-14 Akim Demaille <akim@epita.fr>
16320
16321 * src/files.c (action_obstack): Remove, unused.
16322 (output_obstack): Remove it, and all its dependencies, as it is no
16323 longer needed.
16324 * src/reader.c (epilogue_set): Build the epilogue in the
16325 muscle_obstack.
16326 * src/output.h, src/output.c (muscle_obstack): Move to...
16327 * src/muscle_tab.h, src/muscle_tab.h: here.
16328 (muscle_init): Initialize muscle_obstack.
16329 (muscle_free): New.
16330 * src/main.c (main): Call it.
16331
16332 2002-06-14 Akim Demaille <akim@epita.fr>
16333
16334 * src/location.h: New, extracted from...
16335 * src/reader.h: here.
16336 * src/Makefile.am (noinst_HEADERS): Merge into
16337 (bison_SOURCES): this.
16338 Add location.h.
16339 * src/parse-gram.y: Use location_t instead of Bison's.
16340 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
16341 Use location_t instead of ints.
16342
16343 2002-06-14 Akim Demaille <akim@epita.fr>
16344
16345 * data/bison.simple, data/bison.c++: Be sure to restore the
16346 current #line when returning to the skeleton contents after having
16347 exposed the input file's #line.
16348
16349 2002-06-12 Akim Demaille <akim@epita.fr>
16350
16351 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
16352 eager.
16353 * tests/actions.at (Exotic Dollars): New.
16354
16355 2002-06-12 Akim Demaille <akim@epita.fr>
16356
16357 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
16358 ['"/] too eagerly.
16359 * tests/input.at (Torturing the Scanner): New.
16360
16361 2002-06-11 Akim Demaille <akim@epita.fr>
16362
16363 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
16364 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
16365 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
16366 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
16367 * src/reader.c (reader): Use it.
16368
16369 2002-06-11 Akim Demaille <akim@epita.fr>
16370
16371 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
16372 Adjust all callers.
16373 (scanner_last_string_free): New.
16374
16375 2002-06-11 Akim Demaille <akim@epita.fr>
16376
16377 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
16378 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
16379 (last_string, YY_OBS_FREE): New.
16380 Use them when returning an ID.
16381
16382 2002-06-11 Akim Demaille <akim@epita.fr>
16383
16384 Have Bison grammars parsed by a Bison grammar.
16385
16386 * src/reader.c, src/reader.h (prologue_augment): New.
16387 * src/reader.c (copy_definition): Remove.
16388
16389 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
16390 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
16391 (grammar_current_rule_prec_set, grammar_current_rule_check)
16392 (grammar_current_rule_symbol_append)
16393 (grammar_current_rule_action_append): Export.
16394 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
16395 (symbol_list_action_append): Remove.
16396 Hook the routines from reader.
16397 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
16398 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
16399
16400 * src/reader.c (read_declarations): Remove, unused.
16401
16402 * src/parse-gram.y: Handle the epilogue.
16403 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
16404 (grammar_start_symbol_set): this.
16405 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
16406 * src/reader.c (readgram): Remove, unused.
16407 (reader): Adjust to insert eoftoken and axiom where appropriate.
16408
16409 * src/reader.c (copy_dollar): Replace with...
16410 * src/scan-gram.h (handle_dollar): this.
16411 * src/parse-gram.y: Remove `%thong'.
16412
16413 * src/reader.c (copy_at): Replace with...
16414 * src/scan-gram.h (handle_at): this.
16415
16416 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
16417 New.
16418
16419 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
16420 time being.
16421
16422 * src/reader.h, src/reader.c (grammar_rule_end): New.
16423
16424 * src/parse.y (current_type, current_class): New.
16425 Implement `%nterm', `%token' support.
16426 Merge `%term' into `%token'.
16427 (string_as_id): New.
16428 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
16429 type name.
16430
16431 * src/parse-gram.y: Be sure to handle properly the beginning of
16432 rules.
16433
16434 * src/parse-gram.y: Handle %type.
16435 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
16436
16437 * src/parse-gram.y: More directives support.
16438 * src/options.c: No longer handle source directives.
16439
16440 * src/parse-gram.y: Fix %output.
16441
16442 * src/parse-gram.y: Handle %union.
16443 Use the prologue locations.
16444 * src/reader.c (parse_union_decl): Remove.
16445
16446 * src/reader.h, src/reader.c (epilogue_set): New.
16447 * src/parse-gram.y: Use it.
16448
16449 * data/bison.simple, data/bison.c++: b4_stype is now either not
16450 defined, then default to int, or to the contents of %union,
16451 without `union' itself.
16452 Adjust.
16453 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
16454
16455 * src/output.c (actions_output): Don't output braces, as they are
16456 already handled by the scanner.
16457
16458 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
16459 characters to themselves.
16460
16461 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
16462 that the epilogue has a proper #line.
16463
16464 * src/parse-gram.y: Handle precedence/associativity.
16465
16466 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
16467 a terminal.
16468 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
16469 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
16470 at all to define terminals that cannot be emitted.
16471
16472 * src/scan-gram.l: Escape M4 characters.
16473
16474 * src/scan-gram.l: Working properly with escapes in user
16475 strings/characters.
16476
16477 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
16478 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
16479 grammar.
16480 Use more modest sizes, as for the time being the parser does not
16481 release memory, and therefore the process swallows a huge amount
16482 of memory.
16483
16484 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
16485 stricter %token grammar.
16486
16487 * src/symtab.h (associativity): Add `undef_assoc'.
16488 (symbol_precedence_set): Do nothing when passed an undef_assoc.
16489 * src/symtab.c (symbol_check_alias_consistence): Adjust.
16490
16491 * tests/regression.at (Invalid %directive): Remove, as it is now
16492 meaningless.
16493 (Invalid inputs): Adjust to the new error messages.
16494 (Token definitions): The new grammar doesn't allow too many
16495 eccentricities.
16496
16497 * src/lex.h, src/lex.c: Remove.
16498 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
16499 (copy_character, copy_string2, copy_string, copy_identifier)
16500 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
16501 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
16502 (parse_action): Remove.
16503 * po/POTFILES.in: Adjust.
16504
16505 2002-06-11 Akim Demaille <akim@epita.fr>
16506
16507 * src/reader.c (parse_action): Don't store directly into the
16508 rule's action member: return the action as a string.
16509 Don't require `rule_length' as an argument: compute it.
16510 (grammar_current_rule_symbol_append)
16511 (grammar_current_rule_action_append): New, eved out from
16512 (readgram): here.
16513 Remove `action_flag', `rulelength', unused now.
16514
16515 2002-06-11 Akim Demaille <akim@epita.fr>
16516
16517 * src/reader.c (grammar_current_rule_prec_set).
16518 (grammar_current_rule_check): New, eved out from...
16519 (readgram): here.
16520 Remove `xaction', `first_rhs': useless.
16521 * tests/input.at (Type clashes): New.
16522 * tests/existing.at (GNU Cim Grammar): Adjust.
16523
16524 2002-06-11 Akim Demaille <akim@epita.fr>
16525
16526 * src/reader.c (grammar_midrule_action): New, Eved out from
16527 (readgram): here.
16528
16529 2002-06-11 Akim Demaille <akim@epita.fr>
16530
16531 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
16532 New.
16533 (readgram): Use them as replacement of inlined code, crule and
16534 crule1.
16535
16536 2002-06-11 Akim Demaille <akim@epita.fr>
16537
16538 * src/reader.c (grammar_end, grammar_symbol_append): New.
16539 (readgram): Use them.
16540 Make the use of `p' as local as possible.
16541
16542 2002-06-10 Akim Demaille <akim@epita.fr>
16543
16544 GCJ's parser requires the tokens to be defined before the prologue.
16545
16546 * data/bison.simple: Output the token definition before the user's
16547 prologue.
16548 * tests/regression.at (Braces parsing, Duplicate string)
16549 (Mixing %token styles): Check the output from bison.
16550 (Early token definitions): New.
16551
16552 2002-06-10 Akim Demaille <akim@epita.fr>
16553
16554 * src/symtab.c (symbol_user_token_number_set): Don't complain when
16555 assigning twice the same user number to a token, so that we can
16556 use it in...
16557 * src/lex.c (lex): here.
16558 Also use `symbol_class_set' instead of hand written code.
16559 * src/reader.c (parse_assoc_decl): Likewise.
16560
16561 2002-06-10 Akim Demaille <akim@epita.fr>
16562
16563 * src/symtab.c, src/symtab.c (symbol_class_set)
16564 (symbol_user_token_number_set): New.
16565 * src/reader.c (parse_token_decl): Use them.
16566 Use a switch instead of ifs.
16567 Use a single argument.
16568
16569 2002-06-10 Akim Demaille <akim@epita.fr>
16570
16571 Remove `%thong' support as it is undocumented, unused, duplicates
16572 `%token's job, and creates useless e-mail traffic with people who
16573 want to know what it is, why it is undocumented, unused, and
16574 duplicates `%token's job.
16575
16576 * src/reader.c (parse_thong_decl): Remove.
16577 * src/options.c (option_table): Remove "thong".
16578 * src/lex.h (tok_thong): Remove.
16579
16580 2002-06-10 Akim Demaille <akim@epita.fr>
16581
16582 * src/symtab.c, src/symtab.c (symbol_type_set)
16583 (symbol_precedence_set): New.
16584 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
16585 (value_components_used): Remove, unused.
16586
16587 2002-06-09 Akim Demaille <akim@epita.fr>
16588
16589 Move symbols handling code out of the reader.
16590
16591 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
16592 (axiom): Move to...
16593 * src/symtab.h, src/symtab.c: here.
16594
16595 * src/gram.c (start_symbol): Remove: use startsymbol->number.
16596 * src/reader.c (startval): Rename as...
16597 * src/symtab.h, src/symtab.c (startsymbol): this.
16598 * src/reader.c: Adjust.
16599
16600 * src/reader.c (symbol_check_defined, symbol_make_alias)
16601 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16602 (token_translations_init)
16603 Move to...
16604 * src/symtab.c: here.
16605 * src/reader.c (packsymbols): Move to...
16606 * src/symtab.h, src/symtab.c (symbols_pack): here.
16607 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
16608 argument.
16609
16610 2002-06-03 Akim Demaille <akim@epita.fr>
16611
16612 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
16613 then statements.
16614
16615 2002-06-03 Akim Demaille <akim@epita.fr>
16616
16617 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
16618 structs with non literals.
16619 * src/scan-skel.l: never-interactive.
16620 * src/conflicts.c (enum conflict_resolution_e): No trailing
16621 comma.
16622 * src/getargs.c (usage): Split long literal strings.
16623 Reported by Hans Aberg.
16624
16625 2002-05-28 Akim Demaille <akim@epita.fr>
16626
16627 * data/bison.c++: Use C++ ostreams.
16628 (cdebug_): New member.
16629
16630 2002-05-28 Akim Demaille <akim@epita.fr>
16631
16632 * src/output.c (output_skeleton): Be sure to allocate enough room
16633 for `/' _and_ for `\0' in full_skeleton.
16634
16635 2002-05-28 Akim Demaille <akim@epita.fr>
16636
16637 * data/bison.c++: Catch up with bison.simple:
16638 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16639 and Paul Eggert <eggert@twinsun.com>: `error' handing.
16640 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
16641 and popping traces.
16642
16643 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16644
16645 * src/output.c (output_skeleton): Put an explicit path in front of
16646 the skeleton file name, rather than relying on the -I directory,
16647 to partially alleviate effects of having a skeleton file lying around
16648 in the current directory.
16649
16650 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16651
16652 * src/conflicts.c (log_resolution): Correct typo:
16653 obstack_printf should be obstack_fgrow1.
16654
16655 2002-05-26 Akim Demaille <akim@epita.fr>
16656
16657 * src/state.h (state_t): `solved_conflicts' is a new member.
16658 * src/LR0.c (new_state): Set it to 0.
16659 * src/conflicts.h, src/conflicts.c (print_conflicts)
16660 (free_conflicts, solve_conflicts): Rename as...
16661 (conflicts_print, conflicts_free, conflicts_solve): these.
16662 Adjust callers.
16663 * src/conflicts.c (enum conflict_resolution_e)
16664 (solved_conflicts_obstack): New, used by...
16665 (log_resolution): this.
16666 Adjust to attach the conflict resolution to each state.
16667 Complete the description with the precedence/associativity
16668 information.
16669 (resolve_sr_conflict): Adjust.
16670 * src/print.c (print_state): Output its solved_conflicts.
16671 * tests/conflicts.at (Unresolved SR Conflicts)
16672 (Solved SR Conflicts): Exercise --report=all.
16673
16674 2002-05-26 Akim Demaille <akim@epita.fr>
16675
16676 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16677 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16678 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
16679 (token_number_t, item_number_as_token_number)
16680 (token_number_as_item_number, muscle_insert_token_number_table):
16681 Rename as...
16682 (symbol_number_t, item_number_as_symbol_number)
16683 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
16684 these, since it is more appropriate.
16685
16686 2002-05-26 Akim Demaille <akim@epita.fr>
16687
16688 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
16689 `Error:' lines.
16690 * data/bison.simple (yystos) [YYDEBUG]: New.
16691 (yyparse) [YYDEBUG]: Display the symbols which are popped during
16692 error recovery.
16693 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
16694
16695 2002-05-25 Akim Demaille <akim@epita.fr>
16696
16697 * doc/bison.texinfo (Debugging): Split into...
16698 (Tracing): this new section, its former contents, and...
16699 (Understanding): this new section.
16700 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
16701 by...
16702 (report_flag): this.
16703 Adjust all dependencies.
16704 (report_args, report_types, report_argmatch): New.
16705 (usage, getargs): Report/support -r, --report.
16706 * src/options.h
16707 (struct option_table_struct): Rename as..,
16708 (struct option_table_s): this.
16709 Rename the `set_flag' member to `flag' to match with getopt_long's
16710 struct.
16711 * src/options.c (option_table): Split verbose into an entry for
16712 %verbose, and another for --verbose.
16713 Support --report/-r, so remove -r from the obsolete --raw.
16714 * src/print.c: Attach full item sets and lookaheads reports to
16715 report_flag instead of trace_flag.
16716 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
16717
16718 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16719 and Paul Eggert <eggert@twinsun.com>
16720
16721 * data/bison.simple (yyparse): Correct error handling to conform to
16722 POSIX and yacc. Specifically, after syntax error is discovered,
16723 do not reduce further before shifting the error token.
16724 Clean up the code a bit by removing the labels yyerrdefault,
16725 yyerrhandle, yyerrpop.
16726 * NEWS: Document the above.
16727
16728 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16729
16730 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
16731 type; it isn't always big enough, since it doesn't necessarily
16732 include non-terminals.
16733 (yytranslate): Expand definition of yy_token_number_type, so that
16734 the latter can be removed.
16735 (yy_token_number_type): Remove, only one use.
16736 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
16737 don't use TokenNumberType as element type.
16738
16739 * tests/regression.at: Modify expected output to agree with change
16740 to yyr1 and yytranslate.
16741
16742 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
16743
16744 * src/reader.c (parse_action): Use copy_character instead of
16745 obstack_1grow.
16746
16747 2002-05-13 Akim Demaille <akim@epita.fr>
16748
16749 * tests/regression.at (Token definitions): Prototype yylex and
16750 yyerror.
16751
16752 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16753
16754 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
16755 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
16756 32-bit arithmetic.
16757 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
16758
16759 2002-05-07 Akim Demaille <akim@epita.fr>
16760
16761 * tests/synclines.at: Be sure to prototype yylex and yyerror to
16762 avoid GCC warnings.
16763
16764 2002-05-07 Akim Demaille <akim@epita.fr>
16765
16766 Kill GCC warnings.
16767
16768 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
16769 over the RHS of each rule.
16770 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
16771 * src/state.h (state_t): Member `nitems' is unsigned short.
16772 * src/LR0.c (get_state): Adjust.
16773 * src/reader.c (packgram): Likewise.
16774 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
16775 `Type'.
16776 (muscle_insert_int_table): Remove, unused.
16777 (prepare_rules): Remove `max'.
16778
16779 2002-05-06 Akim Demaille <akim@epita.fr>
16780
16781 * src/closure.c (print_firsts): Display of the symbol tags.
16782 (bitmatrix_print): Move to...
16783 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
16784 here.
16785 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
16786
16787 2002-05-06 Akim Demaille <akim@epita.fr>
16788
16789 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
16790 hash_do_for_each.
16791
16792 2002-05-06 Akim Demaille <akim@epita.fr>
16793
16794 * src/LR0.c (new_state, get_state): Instead of using the global
16795 `kernel_size' and `kernel_base', have two new arguments:
16796 `core_size' and `core'.
16797 Adjust callers.
16798
16799 2002-05-06 Akim Demaille <akim@epita.fr>
16800
16801 * src/reader.c (packgram): No longer end `ritem' with a 0
16802 sentinel: it is not used.
16803
16804 2002-05-05 Akim Demaille <akim@epita.fr>
16805
16806 New experimental feature: display the lookaheads in the report and
16807 graph.
16808
16809 * src/print (print_core): When --trace-flag, display the rules
16810 lookaheads.
16811 * src/print_graph.c (print_core): Likewise.
16812 Swap the arguments.
16813 Adjust caller.
16814
16815 2002-05-05 Akim Demaille <akim@epita.fr>
16816
16817 * tests/torture.at (Many lookaheads): New test.
16818
16819 2002-05-05 Akim Demaille <akim@epita.fr>
16820
16821 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
16822 (GENERATE_MUSCLE_INSERT_TABLE): this.
16823 (output_int_table, output_unsigned_int_table, output_short_table)
16824 (output_token_number_table, output_item_number_table): Replace with...
16825 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
16826 (muscle_insert_short_table, muscle_insert_token_number_table)
16827 (muscle_insert_item_number_table): these.
16828 Adjust all callers.
16829 (prepare_tokens): Don't free `translations', since...
16830 * src/reader.h, src/reader.c (grammar_free): do it.
16831 Move to...
16832 * src/gram.h, src/gram.c (grammar_free): here.
16833 * data/bison.simple, data/bison.c++: b4_token_number_max is now
16834 b4_translate_max.
16835
16836 2002-05-05 Akim Demaille <akim@epita.fr>
16837
16838 * src/output.c (output_unsigned_int_table): New.
16839 (prepare_rules): `i' is unsigned.
16840 `prhs', `rline', `r2' are unsigned int.
16841 Rename muscle `rhs_number_max' as `rhs_max'.
16842 Output muscles `prhs_max', `rline_max', and `r2_max'.
16843 Free rline and r1.
16844 * data/bison.simple, data/bison.c++: Adjust to use these muscles
16845 to compute types instead of constant types.
16846 * tests/regression.at (Web2c Actions): Adjust.
16847
16848 2002-05-04 Akim Demaille <akim@epita.fr>
16849
16850 * src/symtab.h (SALIAS, SUNDEF): Rename as...
16851 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
16852 Adjust dependencies.
16853 * src/output.c (token_definitions_output): Be sure not to output a
16854 `#define 'a'' when fed with `%token 'a' "a"'.
16855 * tests/regression.at (Token definitions): New.
16856
16857 2002-05-03 Paul Eggert <eggert@twinsun.com>
16858
16859 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
16860 for K&R C.
16861
16862 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
16863
16864 * Makefile.am (SUBDIRS): Remove intl.
16865 (EXTRA_DIST): Add config/config.rpath.
16866
16867 2002-05-03 Akim Demaille <akim@epita.fr>
16868
16869 * data/bison.simple (m4_if): Don't output empty enums.
16870 And actually, output valid enum definitions :(.
16871
16872 2002-05-03 Akim Demaille <akim@epita.fr>
16873
16874 * configure.bat: Remove, completely obsolete.
16875 * Makefile.am (EXTRA_DIST): Adjust.
16876 Don't distribute config.rpath...
16877 * config/Makefile.am (EXTRA_DIST): Do it.
16878
16879 2002-05-03 Akim Demaille <akim@epita.fr>
16880
16881 * configure.in (GETTEXT_VERSION): New.
16882 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
16883
16884 2002-05-03 Akim Demaille <akim@epita.fr>
16885
16886 * data/bison.simple (b4_token_enum): New.
16887 (b4_token_defines): Use it to output tokens both as #define and
16888 enums.
16889 Suggested by Paul Eggert.
16890 * src/output.c (token_definitions_output): Don't output spurious
16891 white spaces.
16892
16893 2002-05-03 Akim Demaille <akim@epita.fr>
16894
16895 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16896
16897 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
16898
16899 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
16900 Update the stack class, give a try to deque as the default container.
16901
16902 2002-05-02 Akim Demaille <akim@epita.fr>
16903
16904 * data/bison.simple (yyparse): Do not implement @$ = @1.
16905 (YYLLOC_DEFAULT): Adjust to do it.
16906 * doc/bison.texinfo (Location Default Action): Fix.
16907
16908 2002-05-02 Akim Demaille <akim@epita.fr>
16909
16910 * src/reader.c (parse_braces): Merge into...
16911 (parse_action): this.
16912
16913 2002-05-02 Akim Demaille <akim@epita.fr>
16914
16915 * configure.in (ALL_LINGUAS): Remove.
16916 * po/LINGUAS, hr.po: New.
16917
16918 2002-05-02 Akim Demaille <akim@epita.fr>
16919
16920 Remove the so called hairy (semantic) parsers.
16921
16922 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
16923 * src/gram.h, src/gram.c (semantic_parser): Remove.
16924 (rule_t): Remove the guard and guard_line members.
16925 * src/lex.h (token_t): remove tok_guard.
16926 * src/options.c (option_table): Remove %guard and %semantic_parser
16927 support.
16928 * src/output.c, src/output.h (guards_output): Remove.
16929 (prepare): Adjust.
16930 (token_definitions_output): Don't output the `T'
16931 tokens (???).
16932 (output_skeleton): Don't output the guards.
16933 * src/files.c, src/files.c (attrsfile): Remove.
16934 * src/reader.c (symbol_list): Remove the guard and guard_line
16935 members.
16936 Adjust dependencies.
16937 (parse_guard): Remove.
16938 * data/bison.hairy: Remove.
16939 * doc/bison.texinfo (Environment Variables): Remove occurrences of
16940 BISON_HAIRY.
16941
16942 2002-05-02 Akim Demaille <akim@epita.fr>
16943
16944 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
16945 (parse_guard): Rename the formal argument `stack_offset' as
16946 `rule_length', which is more readable.
16947 Adjust callers.
16948 (copy_at, copy_dollar): Instead of outputting the hard coded
16949 values of $$, $n and so forth, output invocation to b4_lhs_value,
16950 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
16951 Note: this patch partially drops `semantic-parser' support: it
16952 always does `rule_length - n', where semantic parsers ought to
16953 always use `-n'.
16954 * data/bison.simple, data/bison.c++ (b4_lhs_value)
16955 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
16956
16957 2002-05-02 Akim Demaille <akim@epita.fr>
16958
16959 * configure.in (AC_INIT): Bump to 1.49b.
16960 (AM_INIT_AUTOMAKE): Short invocation.
16961
16962 2002-05-02 Akim Demaille <akim@epita.fr>
16963
16964 Version 1.49a.
16965
16966 2002-05-01 Akim Demaille <akim@epita.fr>
16967
16968 * src/skeleton.h: Remove.
16969
16970 2002-05-01 Akim Demaille <akim@epita.fr>
16971
16972 * src/skeleton.h: Fix the #endif.
16973 Reported by Magnus Fromreide.
16974
16975 2002-04-26 Paul Eggert <eggert@twinsun.com>
16976
16977 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
16978 Define if we define YYSTYPE and YYLTYPE, respectively.
16979 (YYCOPY): Fix [] quoting problem in the non-GCC case.
16980
16981 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
16982
16983 * src/scan-skel.l: Postprocess quadrigraphs.
16984
16985 * src/reader.c (copy_character): New function, used to output
16986 single characters while replacing `[' and `]' with quadrigraphs, to
16987 avoid troubles with M4 quotes.
16988 (copy_comment): Output characters with copy_character.
16989 (read_additionnal_code): Likewise.
16990 (copy_string2): Likewise.
16991 (copy_definition): Likewise.
16992
16993 * tests/calc.at: Exercise M4 quoting.
16994
16995 2002-04-25 Akim Demaille <akim@epita.fr>
16996
16997 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16998 between `!' and the command.
16999 Reported by Paul Eggert.
17000
17001 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
17002
17003 * tests/calc.at: Exercise prologue splitting.
17004
17005 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17006 `b4_post_prologue' instead of `b4_prologue'.
17007
17008 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17009 muscles.
17010 (output): Free pre_prologue_obstack and post_prologue_obstack.
17011 * src/files.h, src/files.c (attrs_obstack): Remove.
17012 (pre_prologue_obstack, post_prologue_obstack): New.
17013 * src/reader.c (copy_definition): Add a parameter to specify the
17014 obstack to fill, instead of using attrs_obstack unconditionally.
17015 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17016 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17017
17018 2002-04-23 Paul Eggert <eggert@twinsun.com>
17019
17020 * data/bison.simple: Remove unnecessary commentary and white
17021 space differences from 1_29-branch.
17022 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17023
17024 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17025 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17026 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17027 constructors or destructors.
17028
17029 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17030
17031 2002-04-23 Akim Demaille <akim@epita.fr>
17032
17033 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17034 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17035 location with columns.
17036 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17037 All reported by Paul Eggert.
17038
17039 2002-04-22 Akim Demaille <akim@epita.fr>
17040
17041 * src/reduce.c (dump_grammar): Move to...
17042 * src/gram.h, src/gram.c (grammar_dump): here.
17043 Be sure to separate long item numbers.
17044 Don't read the members of a rule's prec if its nil.
17045
17046 2002-04-22 Akim Demaille <akim@epita.fr>
17047
17048 * src/output.c (table_size, table_grow): New.
17049 (MAXTABLE): Remove, replace uses with table_size.
17050 (pack_vector): Instead of dying when the table is too big, grow it.
17051
17052 2002-04-22 Akim Demaille <akim@epita.fr>
17053
17054 * data/bison.simple (yyr1): Its type is that of a token number.
17055 * data/bison.c++ (r1_): Likewise.
17056 * tests/regression.at (Web2c Actions): Adjust.
17057
17058 2002-04-22 Akim Demaille <akim@epita.fr>
17059
17060 * src/reader.c (token_translations_init): 256 is now the default
17061 value for the error token, i.e., it will be assigned another
17062 number if the user assigned 256 to one of her tokens.
17063 (reader): Don't force 256 to error.
17064 * doc/bison.texinfo (Symbols): Adjust.
17065 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17066 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17067 etc. instead of 10, 20, 30 (which was used to `jump' over error
17068 (256) and undefined (2)).
17069
17070 2002-04-22 Akim Demaille <akim@epita.fr>
17071
17072 Propagate more token_number_t.
17073
17074 * src/gram.h (token_number_as_item_number)
17075 (item_number_as_token_number): New.
17076 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17077 Use it to create output_item_number_table and
17078 output_token_number_table.
17079 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17080 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17081 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17082 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17083
17084 2002-04-22 Akim Demaille <akim@epita.fr>
17085
17086 * src/output.h, src/output.c (get_lines_number): Remove.
17087
17088 2002-04-19 Akim Demaille <akim@epita.fr>
17089
17090 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17091 as Lex/Flex'.
17092 (Debugging): More details about enabling the debugging features.
17093 (Table of Symbols): Describe $$, $n, @$, and @n.
17094 Suggested by Tim Josling.
17095
17096 2002-04-19 Akim Demaille <akim@epita.fr>
17097
17098 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17099
17100 2002-04-10 Akim Demaille <akim@epita.fr>
17101
17102 * src/system.h: Rely on HAVE_LIMITS_H.
17103 Suggested by Paul Eggert.
17104
17105 2002-04-09 Akim Demaille <akim@epita.fr>
17106
17107 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17108 full stderr, and strip it according to the bison options, instead
17109 of composing the error message from different bits.
17110 This makes it easier to check for several error messages.
17111 Adjust all the invocations.
17112 Add an invocation exercising the error token.
17113 Add an invocation demonstrating a stupid error message.
17114 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17115 Adjust the tests.
17116 Error message are for stderr, not stdout.
17117
17118 2002-04-09 Akim Demaille <akim@epita.fr>
17119
17120 * src/gram.h, src/gram.c (error_token_number): Remove, use
17121 errtoken->number.
17122 * src/reader.c (reader): Don't specify the user token number (2)
17123 for $undefined, as it uselessly prevents using it.
17124 * src/gram.h (token_number_t): Move to...
17125 * src/symtab.h: here.
17126 (state_t.number): Is a token_number_t.
17127 * src/print.c, src/reader.c: Use undeftoken->number instead of
17128 hard coded 2.
17129 (Even though this 2 is not the same as above: the number of the
17130 undeftoken remains being 2, it is its user token number which
17131 might not be 2).
17132 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17133 `user_token_number_max'.
17134 Output `undef_token_number'.
17135 * data/bison.simple, data/bison.c++: Use them.
17136 Be sure to map invalid yylex return values to
17137 `undef_token_number'. This saves us from gratuitous SEGV.
17138
17139 * tests/conflicts.at (Solved SR Conflicts)
17140 (Unresolved SR Conflicts): Adjust.
17141 * tests/regression.at (Web2c Actions): Adjust.
17142
17143 2002-04-08 Akim Demaille <akim@epita.fr>
17144
17145 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17146 Adding #line.
17147 Remove the duplicate `typedefs'.
17148 (RhsNumberType): Fix the declaration and various other typos.
17149 Use __ofile__.
17150 * data/bison.simple: Use __ofile__.
17151 * src/scan-skel.l: Handle __ofile__.
17152
17153 2002-04-08 Akim Demaille <akim@epita.fr>
17154
17155 * src/gram.h (item_number_t): New, the type of item numbers in
17156 RITEM. Note that it must be able to code symbol numbers as
17157 positive number, and the negation of rule numbers as negative
17158 numbers.
17159 Adjust all dependencies (pretty many).
17160 * src/reduce.c (rule): Remove this `short *' pointer: use
17161 item_number_t.
17162 * src/system.h (MINSHORT, MAXSHORT): Remove.
17163 Include `limits.h'.
17164 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
17165 (shortcpy): Remove.
17166 (MAXTABLE): Move to...
17167 * src/output.c (MAXTABLE): here.
17168 (prepare_rules): Use output_int_table to output rhs.
17169 * data/bison.simple, data/bison.c++: Adjust.
17170 * tests/torture.at (Big triangle): Move the limit from 254 to
17171 500.
17172 * tests/regression.at (Web2c Actions): Ajust.
17173
17174 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
17175 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
17176 passes, but produces negative #line number, once fixed, GCC is
17177 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
17178 C), it passes.
17179 * src/state.h (state_h): Code input lines on ints, not shorts.
17180
17181 2002-04-08 Akim Demaille <akim@epita.fr>
17182
17183 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
17184 and then the grammar.
17185
17186 2002-04-08 Akim Demaille <akim@epita.fr>
17187
17188 * src/system.h: No longer using strndup.
17189
17190 2002-04-07 Akim Demaille <akim@epita.fr>
17191
17192 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
17193 * src/output.c (output_table_data): Return the longest number.
17194 (prepare_tokens): Output `token_number_max').
17195 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
17196 New.
17197 Use them to define yy_token_number_type/TokenNumberType.
17198 Use this type for yytranslate.
17199 * tests/torture.at (Big triangle): Push the limit from 124 to
17200 253.
17201 * tests/regression.at (Web2c Actions): Adjust.
17202
17203 2002-04-07 Akim Demaille <akim@epita.fr>
17204
17205 * tests/torture.at (Big triangle): New.
17206 (GNU AWK Grammar, GNU Cim Grammar): Move to...
17207 * tests/existing.at: here.
17208
17209 2002-04-07 Akim Demaille <akim@epita.fr>
17210
17211 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
17212 nritems.
17213 Adjust dependencies.
17214
17215 2002-04-07 Akim Demaille <akim@epita.fr>
17216
17217 * src/reader.c: Normalize increments to prefix form.
17218
17219 2002-04-07 Akim Demaille <akim@epita.fr>
17220
17221 * src/reader.c, symtab.c: Remove debugging code.
17222
17223 2002-04-07 Akim Demaille <akim@epita.fr>
17224
17225 Rename all the `bucket's as `symbol_t'.
17226
17227 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
17228 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
17229 * src/symtab.c, src/symtab.h (bucket): Rename as...
17230 (symbol_t): this.
17231 (symbol_list_new, bucket_check_defined, bucket_make_alias)
17232 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
17233 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17234 (buckets_new, buckets_free, buckets_do): Rename as...
17235 (symbol_list_new, symbol_check_defined, symbol_make_alias)
17236 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17237 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
17238 (symbols_new, symbols_free, symbols_do): these.
17239
17240 2002-04-07 Akim Demaille <akim@epita.fr>
17241
17242 Use lib/hash for the symbol table.
17243
17244 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
17245 EOF.
17246 * src/lex.c (lex): Set the `number' member of new terminals.
17247 * src/reader.c (bucket_check_defined, bucket_make_alias)
17248 (bucket_check_alias_consistence, bucket_translation): New.
17249 (reader, grammar_free, readgram, token_translations_init)
17250 (packsymbols): Adjust.
17251 (reader): Number the predefined tokens.
17252 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
17253 for predefined tokens.
17254 * src/symtab.h (bucket): Remove all the hash table related
17255 members.
17256 * src/symtab.c (symtab): Replace by...
17257 (bucket_table): this.
17258 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17259 (buckets_new, buckets_do): New.
17260
17261 2002-04-07 Akim Demaille <akim@epita.fr>
17262
17263 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
17264 (start_symbol, max_user_token_number, semantic_parser)
17265 (error_token_number): Initialize.
17266 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
17267 Initialize.
17268 (reader): Don't.
17269 (errtoken, eoftoken, undeftoken, axiom): Extern.
17270
17271 2002-04-07 Akim Demaille <akim@epita.fr>
17272
17273 * src/gram.h (rule_s): prec and precsym are now pointers
17274 to the bucket giving the priority/associativity.
17275 Member `associativity' removed: useless.
17276 * src/reduce.c, src/conflicts.c: Adjust.
17277
17278 2002-04-07 Akim Demaille <akim@epita.fr>
17279
17280 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
17281 Properly escape the symbols' TAG when outputting them.
17282
17283 2002-04-07 Akim Demaille <akim@epita.fr>
17284
17285 * src/lalr.h (LA): Is a bitsetv, not bitset*.
17286
17287 2002-04-07 Akim Demaille <akim@epita.fr>
17288
17289 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
17290 (LArule): this, which is an array to rule_t*.
17291 * src/print.c, src/conflicts.c: Adjust.
17292
17293 2002-04-07 Akim Demaille <akim@epita.fr>
17294
17295 * src/gram.h (rule_t): Rename `number' as `user_number'.
17296 `number' is a new member.
17297 Adjust dependencies.
17298 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
17299
17300 2002-04-07 Akim Demaille <akim@epita.fr>
17301
17302 As a result of the previous patch, it is no longer needed
17303 to reorder ritem itself.
17304
17305 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
17306
17307 2002-04-07 Akim Demaille <akim@epita.fr>
17308
17309 Be sure never to walk through RITEMS, but use only data related to
17310 the rules themselves. RITEMS should be banished.
17311
17312 * src/output.c (output_token_translations): Rename as...
17313 (prepare_tokens): this.
17314 In addition to `translate', prepare the muscles `tname' and
17315 `toknum', which were handled by...
17316 (output_rule_data): this.
17317 Remove, and move the remainder of its outputs into...
17318 (prepare_rules): this new routines, which also merges content from
17319 (output_gram): this.
17320 (prepare_rules): Be sure never to walk through RITEMS.
17321 (output_stos): Rename as...
17322 (prepare_stos): this.
17323 (output): Always invoke prepare_states, after all, just don't use it
17324 in the output if you don't need it.
17325
17326 2002-04-07 Akim Demaille <akim@epita.fr>
17327
17328 * src/LR0.c (new_state): Display `nstates' as the name of the
17329 newly created state.
17330 Adjust to initialize first_state and last_state if needed.
17331 Be sure to distinguish the initial from the final state.
17332 (new_states): Create the itemset of the initial state, and use
17333 new_state.
17334 * src/closure.c (closure): Now that the initial state has its
17335 items properly set, there is no need for a special case when
17336 creating `ruleset'.
17337
17338 As a result, now the rule 0, reducing to $axiom, is visible in the
17339 outputs. Adjust the test suite.
17340
17341 * tests/conflicts.at (Solved SR Conflicts)
17342 (Unresolved SR Conflicts): Adjust.
17343 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
17344 * tests/conflicts.at (S/R in initial): New.
17345
17346 2002-04-07 Akim Demaille <akim@epita.fr>
17347
17348 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
17349 the RHS of the rules.
17350 * src/output.c (output_gram): Likewise.
17351
17352 2002-04-07 Akim Demaille <akim@epita.fr>
17353
17354 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
17355 bucket.
17356 Adjust all dependencies.
17357 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
17358 `number' of the buckets too.
17359 * src/gram.h: Include `symtab.h'.
17360 (associativity): Move to...
17361 * src/symtab.h: here.
17362 No longer include `gram.h'.
17363
17364 2002-04-07 Akim Demaille <akim@epita.fr>
17365
17366 * src/gram.h, src/gram.c (rules_rhs_length): New.
17367 (ritem_longest_rhs): Use it.
17368 * src/gram.h (rule_t): `number' is a new member.
17369 * src/reader.c (packgram): Set it.
17370 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
17371 the end of `rules', and count them out of `nrules'.
17372 (reduce_output, dump_grammar): Adjust.
17373 * src/print.c (print_grammar): It is no longer needed to check for
17374 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
17375 * tests/reduce.at (Reduced Automaton): New test.
17376
17377 2002-04-07 Akim Demaille <akim@epita.fr>
17378
17379 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
17380 lacking `+ 1' to nrules, Bison reported as useless a token if it
17381 was used solely to set the precedence of the last rule...
17382
17383 2002-04-07 Akim Demaille <akim@epita.fr>
17384
17385 * data/bison.c++, data/bison.simple: Don't output the current file
17386 name in #line, to avoid useless diffs between two identical
17387 outputs under different names.
17388
17389 2002-04-07 Akim Demaille <akim@epita.fr>
17390
17391 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
17392 Normalize loops to using `< nrules + 1', not `<= nrules'.
17393
17394 2002-04-07 Akim Demaille <akim@epita.fr>
17395
17396 * TODO: Update.
17397
17398 2002-04-07 Akim Demaille <akim@epita.fr>
17399
17400 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
17401 bucket.value as bucket.number.
17402
17403 2002-04-07 Akim Demaille <akim@epita.fr>
17404
17405 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
17406 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17407 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
17408 RHS, instead of being an index in RITEMS.
17409
17410 2002-04-04 Paul Eggert <eggert@twinsun.com>
17411
17412 * doc/bison.texinfo: Update copyright date.
17413 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
17414 (Symbols): Warn about running Bison in one character set,
17415 but compiling and/or running in an incompatible one.
17416 Warn about character code 256, too.
17417
17418 2002-04-03 Paul Eggert <eggert@twinsun.com>
17419
17420 * src/bison.data (YYSTACK_ALLOC): Depend on whether
17421 YYERROR_VERBOSE is nonzero, not whether it is defined.
17422
17423 Merge changes from bison-1_29-branch.
17424
17425 2002-03-20 Paul Eggert <eggert@twinsun.com>
17426
17427 Merge fixes from Debian bison_1.34-1.diff.
17428
17429 * configure.in (AC_PREREQ): 2.53.
17430
17431 2002-03-20 Akim Demaille <akim@epita.fr>
17432
17433 * src/conflicts.c (log_resolution): Argument `resolution' is const.
17434
17435 2002-03-19 Paul Eggert <eggert@twinsun.com>
17436
17437 * src/bison.simple (YYCOPY): New macro.
17438 (YYSTACK_RELOCATE): Use it.
17439 Remove Type arg; no longer needed. All callers changed.
17440 (yymemcpy): Remove; no longer needed.
17441
17442 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
17443 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17444
17445 2002-03-19 Akim Demaille <akim@epita.fr>
17446
17447 Test and fix the #line outputs.
17448
17449 * tests/atlocal.at (GCC): New.
17450 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
17451 (Prologue synch line, %union synch line, Postprologue synch line)
17452 (Action synch line, Epilogue synch line): New tests.
17453 * src/reader.c (parse_union_decl): Define the muscle stype_line.
17454 * data/bison.simple, data/bison.c++: Use it.
17455
17456 2002-03-19 Akim Demaille <akim@epita.fr>
17457
17458 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
17459 (Solved SR Conflicts, %expect not enough, %expect right)
17460 (%expect too much): Move to...
17461 * tests/conflicts.at: this new file.
17462
17463 2002-03-19 Akim Demaille <akim@epita.fr>
17464
17465 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17466 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
17467 that we can move to enums for instance.
17468 * src/output.c (token_definitions_output): Output a list of
17469 `token-name, token-number' instead of the #define.
17470 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
17471
17472 2002-03-14 Akim Demaille <akim@epita.fr>
17473
17474 Use Gettext 0.11.1.
17475
17476 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
17477
17478 * data/bison.c++: Make the user able to add members to the generated
17479 parser by subclassing.
17480
17481 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
17482
17483 * src/reader.c (read_additionnal_code): `c' should be an integer, not
17484 a character.
17485 Reported by Nicolas Tisserand and Nicolas Burrus.
17486
17487 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17488
17489 * src/reader.c: Warn about lacking semi-colons, do not complain.
17490
17491 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17492
17493 * data/bison.c++: Remove a debug line.
17494
17495 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
17496
17497 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
17498 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
17499 provide a default implementation.
17500
17501 2002-03-04 Akim Demaille <akim@epita.fr>
17502
17503 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
17504 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
17505 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
17506 * tests/semantic.at (Parsing Guards): Similarly.
17507 * src/reader.at (readgram): Complain if the last rule is not ended
17508 with a semi-colon.
17509
17510 2002-03-04 Akim Demaille <akim@epita.fr>
17511
17512 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
17513 * src/closure.c: here.
17514 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
17515 RTC.
17516 * src/warshall.h, src/warshall.c: Remove.
17517 * tests/sets.at (Broken Closure): Adjust.
17518
17519 2002-03-04 Akim Demaille <akim@epita.fr>
17520
17521 * src/output.c (output_skeleton): tempdir is const.
17522 bytes_read is unused.
17523
17524 2002-03-04 Akim Demaille <akim@epita.fr>
17525
17526 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17527 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
17528 Update.
17529 From Michael Hayes.
17530
17531 2002-03-04 Akim Demaille <akim@epita.fr>
17532
17533 * src/closure.c (closure): `r' is unused.
17534
17535 2002-03-04 Akim Demaille <akim@epita.fr>
17536
17537 * tests/sets.at (Broken Closure): Add the ending `;'.
17538 * src/reader.at (readgram): Complain if a rule is not ended with a
17539 semi-colon.
17540
17541 2002-03-04 Akim Demaille <akim@epita.fr>
17542
17543 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
17544 (count_sr_conflicts): Use bitset_count.
17545 * src/reduce.c (inaccessable_symbols): Ditto.
17546 (bits_size): Remove.
17547 * src/warshall.h, src/warshall.c: Convert to bitsetv.
17548
17549 2002-03-04 Akim Demaille <akim@epita.fr>
17550
17551 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
17552 * src/reduce.c: Remove the `bitset_zero's following the
17553 `bitset_create's, as now it is performed by the latter.
17554
17555 2002-03-04 Akim Demaille <akim@epita.fr>
17556
17557 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
17558 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
17559 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
17560 latest sources from Michael.
17561
17562 2002-03-04 Akim Demaille <akim@epita.fr>
17563
17564 * src/output.c (output): Don't free the grammar.
17565 * src/reader.c (grammar_free): New.
17566 * src/main.c (main): Call it and don't free symtab here.
17567
17568 2002-03-04 Akim Demaille <akim@epita.fr>
17569
17570 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
17571 before returning.
17572 Reported by Benoit Perrot.
17573
17574 2002-03-04 Akim Demaille <akim@epita.fr>
17575
17576 Use bitset operations when possible, not loops over bits.
17577
17578 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
17579 bitset_or.
17580 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
17581 * src/reduce.c (useless_nonterminals): Formatting changes.
17582 * src/warshall.c (TC): Use bitset_or.
17583
17584 2002-03-04 Akim Demaille <akim@epita.fr>
17585
17586 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
17587 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
17588 Ditto.
17589
17590 2002-03-04 Akim Demaille <akim@epita.fr>
17591
17592 * src/lalr.c (F): Now a bitset*.
17593 Adjust all dependencies.
17594
17595 2002-03-04 Akim Demaille <akim@epita.fr>
17596
17597 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
17598 Adjust all dependencies.
17599
17600 2002-03-04 Akim Demaille <akim@epita.fr>
17601
17602 * src/L0.c, src/LR0.h (nstates): Be size_t.
17603 Adjust comparisons (signed vs unsigned).
17604 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
17605 bitset*.
17606 Adjust all dependencies.
17607
17608 2002-03-04 Akim Demaille <akim@epita.fr>
17609
17610 * src/closure.c (firsts): Now, also a bitset.
17611 Adjust all dependencies.
17612 (varsetsize): Remove, now unused.
17613 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
17614
17615 2002-03-04 Akim Demaille <akim@epita.fr>
17616
17617 * src/print.c: Convert to use bitset.h, not hand coded iterations
17618 over ints.
17619
17620 2002-03-04 Akim Demaille <akim@epita.fr>
17621
17622 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
17623
17624 2002-03-04 Akim Demaille <akim@epita.fr>
17625
17626 * src/closure.c (ruleset): Be a bitset.
17627 (rulesetsize): Remove.
17628
17629 2002-03-04 Akim Demaille <akim@epita.fr>
17630
17631 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17632 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
17633 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
17634 * src/closure.c (fderives): Be an array of bitsets.
17635
17636 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
17637
17638 * data/bison.c++: Merge the two generated headers. Insert a copyright
17639 notice in each output file.
17640
17641 2002-02-28 Akim Demaille <akim@epita.fr>
17642
17643 * data/bison.c++: Copy the prologue of bison.simple to fetch
17644 useful M4 definitions, such as b4_header_guard.
17645
17646 2002-02-25 Akim Demaille <akim@epita.fr>
17647
17648 * src/getargs.c (version): Give the name of the authors, and use a
17649 translator friendly scheme for the bgr
17650 copyright notice.
17651
17652 2002-02-25 Akim Demaille <akim@epita.fr>
17653
17654 * src/output.c (header_output): Remove, now handled completely via
17655 M4.
17656
17657 2002-02-25 Akim Demaille <akim@epita.fr>
17658
17659 * m4/m4.m4: New, from CVS Autoconf.
17660 * configure.in: Invoke it.
17661 * src/output.c (output_skeleton): Use its result instead of the
17662 hard coded name.
17663
17664 2002-02-25 Akim Demaille <akim@epita.fr>
17665
17666 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
17667 Fileutils 4.1.5.
17668 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
17669 * src/output.c (output_skeleton): Use mkstemp to create a real
17670 temporary file.
17671 Move the filling of `skeleton' and its muscle to...
17672 (prepare): here.
17673 (output): Move the definition of the prologue muscle to...
17674 (prepare): here.
17675 * src/system.h (DEFAULT_TMPDIR): New.
17676
17677 2002-02-14 Paul Eggert <eggert@twinsun.com>
17678
17679 Remove the support for C++ namespace cleanliness; it was
17680 causing more problems than it was curing, since it didn't work
17681 properly on some nonstandard C++ compilers. This can wait
17682 for a proper C++ parser.
17683
17684 * NEWS: Document this.
17685 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
17686 of C++, as it's treated like C now.
17687 * src/bison.simple (YYSTD): Remove.
17688 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
17689 Treat C++ just like Standard C instead of trying to support
17690 namespace cleanliness.
17691
17692 2002-02-14 Akim Demaille <akim@epita.fr>
17693
17694 * tests/regression.at (else): Adjust to Andreas' change.
17695
17696 2002-02-14 Akim Demaille <akim@epita.fr>
17697
17698 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
17699
17700 2002-02-13 Andreas Schwab <schwab@suse.de>
17701
17702 * src/output.c (output_rule_data): Don't output NULL, it might
17703 not be defined yet.
17704
17705 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
17706
17707 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
17708 (Copyright notice): Update.
17709
17710 2002-02-11 Akim Demaille <akim@epita.fr>
17711
17712 * tests/regression.at (%nonassoc and eof): Don't include
17713 nonportable headers.
17714
17715 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
17716
17717 * data/bison.c++: Correct error recovery. Make the user able to
17718 initialize the starting location.
17719
17720 2002-02-07 Akim Demaille <akim@epita.fr>
17721
17722 * tests/input.at: New.
17723
17724 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17725
17726 * data/bison.c++: Replace some direct m4 expansions by constants. Be
17727 more consistent when naming methods and variables. Put preprocessor
17728 directives around tables only needed for debugging.
17729
17730 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17731
17732 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
17733 C++ parsers.
17734 (yy::b4_name::parse): Use print_.
17735
17736 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17737
17738 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
17739
17740 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
17741
17742 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
17743 C++ parsers.
17744 (yy::b4_name::parse): Build verbose error messages, and use error_.
17745
17746 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17747
17748 * data/bison.c++: Fix m4 quoting in comments.
17749
17750 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
17751
17752 * data/bison.c++: Adjust the parser code. Fix some muscles that were
17753 not expanded by m4.
17754
17755 2002-02-05 Akim Demaille <akim@epita.fr>
17756
17757 * data/bison.c++: Adjust to the M4 back end.
17758 More is certainly needed.
17759
17760 2002-02-05 Akim Demaille <akim@epita.fr>
17761
17762 Give a try to M4 as a back end.
17763
17764 * lib/readpipe.c: New, from wdiff.
17765 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
17766 BISON_HAIRY.
17767 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
17768 specific values. Now it is m4 that performs the lookup.
17769 * src/parse-skel.y: Remove.
17770 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
17771 * src/output.c (actions_output, guards_output)
17772 (token_definitions_output): No longer keeps track of the output
17773 line number, hence remove the second argument.
17774 (guards_output): Check against the guard member of a rule, not the
17775 action member.
17776 Adjust callers.
17777 (output_skeleton): Don't look for the skeleton location, let m4 do
17778 that.
17779 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
17780 file will be used.
17781 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
17782 (prepare): Given that for the time being changesyntax is not
17783 usable in M4, rename the muscles using `-' to `_'.
17784 Define `defines_flag', `output_parser_name' and `output_header_name'.
17785 * src/output.h (actions_output, guards_output)
17786 (token_definitions_output): Adjust prototypes.
17787 * src/scan-skel.l: Instead of scanning the skeletons, it now
17788 processes the output of m4: `__oline__' and `#output'.
17789 * data/bison.simple: Adjust to be used by M4(sugar).
17790 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
17791 to date.
17792 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
17793 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
17794 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
17795 shamelessly stolen from CVS Autoconf.
17796
17797 2002-02-05 Akim Demaille <akim@epita.fr>
17798
17799 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
17800 * configure.in: Check for the declarations of free and malloc.
17801 * src/muscle_tab.c: Adjust.
17802
17803 2002-02-05 Akim Demaille <akim@epita.fr>
17804
17805 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
17806 which have no values.
17807
17808 2002-02-05 Akim Demaille <akim@epita.fr>
17809
17810 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
17811 * data/: here.
17812
17813 2002-01-29 Paul Eggert <eggert@twinsun.com>
17814
17815 * src/bison.simple (YYSIZE_T): Do not define merely because
17816 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
17817 On some platforms, <alloca.h> does not declare YYSTD (size_t).
17818
17819 2002-01-27 Akim Demaille <akim@epita.fr>
17820
17821 Fix `%nonassoc and eof'.
17822
17823 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
17824 which were not properly copied! Replace
17825 memcpy (res->errs, src->errs, src->nerrs);
17826 with
17827 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
17828 !!!
17829 * tests/regression.at (%nonassoc and eof): Adjust to newest
17830 Autotest: `.' is not in the PATH.
17831
17832 2002-01-27 Akim Demaille <akim@epita.fr>
17833
17834 * tests/sets.at (AT_EXTRACT_SETS): New.
17835 (Nullable): Use it.
17836 (Firsts): New.
17837
17838 2002-01-26 Akim Demaille <akim@epita.fr>
17839
17840 * tests/actions.at, tests/calc.at, tests/headers.at,
17841 * tests/torture.at: Adjust to the newest Autotest which no longer
17842 forces `.' in the PATH.
17843
17844 2002-01-25 Akim Demaille <akim@epita.fr>
17845
17846 * tests/regression.at (%nonassoc and eof): New.
17847 Suggested by Robert Anisko.
17848
17849 2002-01-24 Akim Demaille <akim@epita.fr>
17850
17851 Bison dumps core when trying to complain about broken input files.
17852 Reported by Cris van Pelt.
17853
17854 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
17855 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
17856 into...
17857 (Invalid inputs): Strengthen: exercise parse_percent_token.
17858
17859 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
17860
17861 * src/Makefile.am: Add bison.c++.
17862 * src/bison.c++: New skeleton.
17863
17864 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
17865
17866 * po/it.po: New.
17867
17868 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
17869
17870 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
17871
17872 2002-01-20 Marc Autret <marc@gnu.org>
17873
17874 * src/files.c (compute_output_file_names): Fix
17875
17876 2002-01-20 Marc Autret <marc@gnu.org>
17877
17878 * tests/output.at: New test.
17879 * src/files.c (compute_base_names): Don't map extensions when
17880 the YACC flag is set, use defaults.
17881 Reported by Evgeny Stambulchik.
17882
17883 2002-01-20 Marc Autret <marc@gnu.org>
17884
17885 * src/system.h: Need to define __attribute__ away for non-GCC
17886 compilers as well (i.e., the vendor C compiler).
17887 Suggested by Albert Chin-A-Young.
17888
17889 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
17890
17891 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
17892 canonical definition.
17893 * src/system.h: Use the canonical definition for PARAMS (avoids
17894 a conflict with the macro from lib/hash.h).
17895
17896 2002-01-11 Akim Demaille <akim@epita.fr>
17897
17898 * configure.in: Use AC_FUNC_STRNLEN.
17899 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
17900
17901 2002-01-09 Akim Demaille <akim@epita.fr>
17902
17903 * src/files.c, src/files.h (output_infix): New.
17904 (tab_extension): Remove.
17905 (compute_base_names): Compute the former, drop the latter.
17906 * src/output.c (prepare): Insert the muscles `output-infix', and
17907 `output-suffix'.
17908 * src/parse-skel.y (string, string.1): New.
17909 (section.header): Use it.
17910 (section.yacc): Remove.
17911 (prefix): Remove too.
17912 * src/scan-skel.l: Adjust.
17913 * src/bison.simple, src/bison.hairy: Adjust.
17914
17915 2002-01-09 Akim Demaille <akim@epita.fr>
17916
17917 * configure.in (WERROR_CFLAGS): Compute it.
17918 * src/Makefile.am (CFLAGS): Pass it.
17919 * tests/atlocal.in (CFLAGS): Idem.
17920 * src/files.c: Fix a few warnings.
17921 (get_extension_index): Remove, unused.
17922
17923 2002-01-08 Akim Demaille <akim@epita.fr>
17924
17925 * src/getargs.c (AS_FILE_NAME): New.
17926 (getargs): Use it to convert DOSish file names.
17927 * src/files.c (base_name): Rename as full_base_name to avoid
17928 clashes with `base_name ()'.
17929 (filename_split): New.
17930 (compute_base_names): N-th rewrite, using filename_split.
17931
17932 2002-01-08 Akim Demaille <akim@epita.fr>
17933
17934 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
17935 New, stolen from the Fileutils 4.1.
17936 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17937 * configure.in: Check for the presence of memrchr, and of its
17938 prototype.
17939
17940 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
17941
17942 * lib/hash.h (__P): Added definition for this macro.
17943 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
17944 BUILT_SOURCES, to ensure they are generated first.
17945 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
17946 %error-verbose to allow bootstrapping with bison 1.30x.
17947
17948 2002-01-06 Akim Demaille <akim@epita.fr>
17949
17950 * src/reader.c (parse_braces): Don't fetch the next char, the
17951 convention is to fetch on entry.
17952 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
17953 'switch' without a following semicolon.
17954 * tests/regression.at (braces parsing): New.
17955
17956 2002-01-06 Akim Demaille <akim@epita.fr>
17957
17958 Bison is dead wrong in its RR conflict reports.
17959
17960 * tests/torture.at (GNU Cim Grammar): New.
17961 * src/conflicts.c (count_rr_conflicts): Fix.
17962
17963 2002-01-06 Akim Demaille <akim@epita.fr>
17964
17965 Creating package.m4 from configure.ac causes too many problems.
17966
17967 * tests/Makefile.am (package.m4): Create it by hand,
17968 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
17969
17970 2002-01-06 Akim Demaille <akim@epita.fr>
17971
17972 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
17973 skeleton.h.
17974
17975 2002-01-04 Paul Eggert <eggert@twinsun.com>
17976
17977 * doc/bison.texinfo (Debugging):
17978 Remove YYSTDERR; it's no longer defined or used.
17979 Also, s/cstdio.h/cstdio/.
17980
17981 2002-01-03 Akim Demaille <akim@epita.fr>
17982
17983 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
17984
17985 2002-01-03 Akim Demaille <akim@epita.fr>
17986
17987 * src/parse-skel.y (process_skeleton): Don't bind the parser's
17988 tracing code to --trace, wait for a better --trace option, with
17989 args.
17990
17991 2002-01-03 Akim Demaille <akim@epita.fr>
17992
17993 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
17994 The ISO C++ standard is extremely clear about it: stderr is
17995 considered a macro, not a regular symbol (see table 94 `Header
17996 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17997 Therefore std:: does not apply to it. It still does with fprintf.
17998 Also, s/cstdio.h/cstdio/.
17999
18000 2002-01-03 Akim Demaille <akim@epita.fr>
18001
18002 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18003 for non system headers.
18004
18005 2002-01-02 Akim Demaille <akim@epita.fr>
18006
18007 Equip the skeleton chain with location tracking, runtime trace,
18008 pure parser and scanner.
18009
18010 * src/parse-skel.y: Request a pure parser, locations, and prefix
18011 renaming.
18012 (%union): Having several members with the same type does not help
18013 type mismatches, simplify.
18014 (YYPRINT, yyprint): New.
18015 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18016 (skel_error): this.
18017 Handle locations.
18018 * src/scan-skel.l: Adjust to these changes.
18019 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18020 (LOCATION_PRINT, skel_control_t): New.
18021
18022 2001-12-30 Akim Demaille <akim@epita.fr>
18023
18024 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18025 replace `gb' with BLANKS.
18026 * src/scan-skel.l: Adjust.
18027
18028 2001-12-30 Akim Demaille <akim@epita.fr>
18029
18030 * src/system.h: We don't need nor want bcopy.
18031 Throw away MS-DOS crap: we don't need getpid.
18032 * configure.in: We don't need strndup. It was even causing
18033 problems: because Flex includes the headers *before* us,
18034 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18035 not visible.
18036 * lib/xstrndup.c: New.
18037 * src/scan-skel.l: Use it.
18038 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18039 * src/parse-skel.y: Use %directives instead of #defines.
18040
18041 2001-12-30 Akim Demaille <akim@epita.fr>
18042
18043 * src/skeleton.h: New.
18044 * src/output.c (output_parser, output_master_parser): Remove, dead
18045 code.
18046 * src/output.h (get_lines_number, actions_output, guards_output)
18047 (token_definitions_output): Prototype them.
18048 * src/parse-skel.y: Add the license notice.
18049 Include output.h and skeleton.h.
18050 (process_skeleton): Returns void, and takes a single parameter.
18051 * src/scan-skel.l: Add the license notice.
18052 Include skeleton.h.
18053 Don't use %option yylineno: it seems that then Flex imagines
18054 REJECT has been used, and therefore it won't reallocate its
18055 buffers (which makes no other sense to me than a bug). It results
18056 in warnings for `unused: yy_flex_realloc'.
18057
18058 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
18059
18060 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18061 (MUSCLE_INSERT_PREFIX): ...to there.
18062 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18063 (MUSCLE_INSERT_PREFIX): Move from here...
18064
18065 * src/bison.hairy: Add a section directive. Put braces around muscle
18066 names. This parser skeleton is still broken, but Bison should not
18067 choke on a bad muscle 'syntax'.
18068 * src/bison.simple: Add a section directive. Put braces around muscle
18069 names.
18070
18071 * src/files.h (strsuffix, stringappend): Add declarations.
18072 (tab_extension): Add declaration.
18073 (short_base_name): Add declaration.
18074
18075 * src/files.c (strsuffix, stringappend): No longer static. These
18076 functions are used in the skeleton parser.
18077 (tab_extension): New.
18078 (compute_base_names): Use the computations done in this function
18079 to guess if the generated parsers should have '.tab' in their
18080 names.
18081 (short_base_name): No longer static.
18082
18083 * src/output.c (output_skeleton): New.
18084 (output): Disable call to output_master_parser, and give a try to
18085 a new skeleton handling system.
18086 (guards_output, actions_output): No longer static.
18087 (token_definitions_output, get_lines_number): No longer static.
18088
18089 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18090
18091 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
18092 parse-skel.y.
18093
18094 * src/parse-skel.y: New file.
18095 * src/scan-skel.l: New file.
18096
18097 2001-12-29 Akim Demaille <akim@epita.fr>
18098
18099 %name-prefix is broken.
18100
18101 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18102 Adjust all dependencies.
18103 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18104 %name-prefix.
18105
18106 Renaming yylval but not yylloc is not consistent. Now we do.
18107
18108 * src/bison.simple: Prefix yylloc if used.
18109 * doc/bison.texinfo (Decl Summary): Document that.
18110
18111 2001-12-29 Akim Demaille <akim@epita.fr>
18112
18113 * doc/bison.texinfo: Promote `%long-directive' over
18114 `%long_directive'.
18115 Remove all references to fixed-output-files, yacc is enough.
18116
18117 2001-12-29 Akim Demaille <akim@epita.fr>
18118
18119 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18120 user prologue. These are defaults.
18121 * tests/actions.at (Mid-rule actions): Make sure the user can
18122 define YYDEBUG and YYERROR_VERBOSE.
18123
18124 2001-12-29 Akim Demaille <akim@epita.fr>
18125
18126 * src/output.c (header_output): Don't forget to export YYLTYPE and
18127 yylloc.
18128 * tests/headers.at (export YYLTYPE): New, make sure it does.
18129 * tests/regression.at (%union and --defines, Invalid CPP headers):
18130 Move to...
18131 * tests/headers.at: here.
18132
18133 2001-12-29 Akim Demaille <akim@epita.fr>
18134
18135 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18136
18137 2001-12-29 Akim Demaille <akim@epita.fr>
18138
18139 * tests/actions.at (Mid-rule actions): Output on a single line
18140 instead of several.
18141
18142 2001-12-29 Akim Demaille <akim@epita.fr>
18143
18144 * doc/bison.texinfo: Formatting changes.
18145
18146 2001-12-29 Akim Demaille <akim@epita.fr>
18147
18148 Don't store the token defs in a muscle, just be ready to output it
18149 on command. Now possible via `symbols'. Fixes a memory leak.
18150
18151 * src/output.c (token_definitions_output): New.
18152 (output_parser, header_output): Use it.
18153 * src/reader.c (symbols_save): Remove.
18154
18155 2001-12-29 Akim Demaille <akim@epita.fr>
18156
18157 * src/bison.simple: Do not provide a default for YYSTYPE and
18158 YYLTYPE before the user's prologue. Otherwise it's hardly... a
18159 default.
18160
18161 2001-12-29 Akim Demaille <akim@epita.fr>
18162
18163 Mid-rule actions are simply... ignored!
18164
18165 * src/reader.c (readgram): Be sure to attach mid-rule actions to
18166 the empty-rule associated to the dummy symbol, not to the host
18167 rule.
18168 * tests/actions.at (Mid-rule actions): New.
18169
18170 2001-12-29 Akim Demaille <akim@epita.fr>
18171
18172 Memory leak.
18173
18174 * src/reader.c (reader): Free grammar.
18175
18176 2001-12-29 Akim Demaille <akim@epita.fr>
18177
18178 Memory leak.
18179
18180 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
18181 since it allocates it for each state, although only one is needed.
18182 (allocate_storage): Do it here.
18183
18184 2001-12-29 Akim Demaille <akim@epita.fr>
18185
18186 * src/options.h, src/options.c (create_long_option_table): Rename
18187 as...
18188 (long_option_table_new): this, with a clearer prototype.
18189 (percent_table): Remove, unused,
18190 * src/getargs.c (getargs): Adjust.
18191
18192 2001-12-29 Akim Demaille <akim@epita.fr>
18193
18194 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
18195 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
18196 as states.
18197
18198 2001-12-29 Akim Demaille <akim@epita.fr>
18199
18200 * src/lalr.c (build_relations): Rename `states' as `states1'.
18201 Sorry, I don't understand exactly what it is, no better name...
18202
18203 2001-12-29 Akim Demaille <akim@epita.fr>
18204
18205 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
18206 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
18207 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
18208 as rules.
18209
18210 2001-12-29 Akim Demaille <akim@epita.fr>
18211
18212 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18213 ago.
18214
18215 2001-12-29 Akim Demaille <akim@epita.fr>
18216
18217 * src/reader.c, src/reader.h (user_toknums): Remove.
18218 Adjust all users to use symbols[i]->user_token_number.
18219
18220 2001-12-29 Akim Demaille <akim@epita.fr>
18221
18222 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
18223 Adjust all users to use symbols[i]->prec or ->assoc.
18224
18225 2001-12-29 Akim Demaille <akim@epita.fr>
18226
18227 * src/reader.c, src/reader.h (tags): Remove.
18228 Adjust all users to use symbols[i]->tag.
18229
18230 2001-12-29 Akim Demaille <akim@epita.fr>
18231
18232 * src/gram.h, src/gram.c (symbols): New, similar to state_table
18233 and rule_table.
18234 * src/reader.c (packsymbols): Fill this table.
18235 Drop sprec.
18236 * src/conflicts.c (resolve_sr_conflict): Adjust.
18237 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
18238 single table.
18239 Use symbols[i]->tag instead of tags[i].
18240
18241 2001-12-29 Akim Demaille <akim@epita.fr>
18242
18243 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
18244 In addition, put a comment in there, to replace...
18245 * tests/regression.at (%union and C comments): Remove.
18246
18247 2001-12-29 Akim Demaille <akim@epita.fr>
18248
18249 * tests/regression.at (Web2c Actions): Blindly move the actual
18250 output as expected output. The contents *seem* right to me, but I
18251 can't pretend reading perfectly parser tables... Nonetheless, all
18252 the other tests pass correctly, the table look OK, even though the
18253 presence of `$axiom' is to be noted: AFAICS it is useless (but
18254 harmless).
18255
18256 2001-12-29 Akim Demaille <akim@epita.fr>
18257
18258 * src/reader.c (readgram): Don't add the rule 0 if there were no
18259 rules read. In other words, add it _after_ having performed
18260 grammar sanity checks.
18261 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
18262
18263 2001-12-29 Akim Demaille <akim@epita.fr>
18264
18265 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
18266 visible, and some states have now a different number.
18267
18268 2001-12-29 Akim Demaille <akim@epita.fr>
18269
18270 * src/reader.c (readgram): Bind the initial rule's lineno to that
18271 of the first rule.
18272 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
18273 (Solved SR Conflicts): Adjust rule 0's line number.
18274
18275 2001-12-29 Akim Demaille <akim@epita.fr>
18276
18277 Fix the `GAWK Grammar' failure.
18278
18279 * src/LR0.c (final_state): Initialize to -1 so that we do compute
18280 the reductions of the first state which was mistakenly confused
18281 with the final state because precisely final_state was initialized
18282 to 0.
18283 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
18284 now noticed by Bison.
18285 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
18286 have a reduction on $default.
18287
18288 2001-12-29 Akim Demaille <akim@epita.fr>
18289
18290 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
18291 rule line numbers.
18292 * src/closure.c (print_closure): Likewise.
18293 * src/derives.c (print_derives): Likewise.
18294 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
18295 now.
18296
18297 2001-12-29 Akim Demaille <akim@epita.fr>
18298
18299 * src/lalr.c (lookaheads_print): New.
18300 (lalr): Call it when --trace-flag.
18301 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
18302 are dumped.
18303
18304 2001-12-29 Akim Demaille <akim@epita.fr>
18305
18306 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
18307 when walking through ritem, even via rule->rhs.
18308 * src/reduce.c (dump_grammar, useful_production, reduce_output)
18309 (useful_production, useless_nonterminals): Likewise.
18310 (reduce_grammar_tables): Likewise, plus update nritems.
18311 * src/nullable.c (set_nullable): Likewise.
18312 * src/lalr.c (build_relations): Likewise.
18313 * tests/sets.at (Nullable): Adjust.
18314 Fortunately, now, the $axiom is no longer nullable.
18315
18316 2001-12-29 Akim Demaille <akim@epita.fr>
18317
18318 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
18319 the 0-sentinel.
18320 * src/gram.c (ritem_longest_rhs): Likewise.
18321 * src/reduce.c (nonterminals_reduce): Likewise.
18322 * src/print_graph.c (print_graph): Likewise.
18323 * src/output.c (output_rule_data): Likewise.
18324 * src/nullable.c (set_nullable): Likewise.
18325
18326 2001-12-29 Akim Demaille <akim@epita.fr>
18327
18328 * src/output.c: Comment changes.
18329
18330 2001-12-27 Paul Eggert <eggert@twinsun.com>
18331
18332 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
18333 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
18334 Sparc, as they were causing more porting problems than the
18335 (minor) performance improvement was worth.
18336
18337 Also, catch up with 1.31's YYSTD.
18338
18339 2001-12-27 Akim Demaille <akim@epita.fr>
18340
18341 * src/output.c (output_gram): Rely on nritems, not the
18342 0-sentinel. See below.
18343 Use -1 as separator, not 0.
18344 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
18345 Rely on -1 as separator in yyrhs, instead of 0.
18346 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
18347 twice `Now at end of input', therefore there are two lines less to
18348 expect.
18349
18350 2001-12-27 Akim Demaille <akim@epita.fr>
18351
18352 * tests/regression.at (Unresolved SR Conflicts):
18353 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
18354 below.
18355
18356 2001-12-27 Akim Demaille <akim@epita.fr>
18357
18358 * src/LR0.c (new_state): Recognize the final state by the fact it
18359 is reached by eoftoken.
18360 (insert_start_shifting_state, insert_eof_shifting_state)
18361 (insert_accepting_state, augment_automaton): Remove, since now
18362 these states are automatically computed from the initial state.
18363 (generate_states): Adjust.
18364 * src/print.c: When reporting a rule number to the user, substract
18365 1, so that the axiom rule is rule 0, and the first user rule is 1.
18366 * src/reduce.c: Likewise.
18367 * src/print_graph.c (print_core): For the time being, just as for
18368 the report, depend upon --trace-flags to dump the full set of
18369 items.
18370 * src/reader.c (readgram): Once the grammar read, insert the rule
18371 0: `$axiom: START-SYMBOL $'.
18372 * tests/set.at: Adjust: rule 0 is now displayed, and since the
18373 number of the states has changed (the final state is no longer
18374 necessarily the last), catch up.
18375
18376 2001-12-27 Akim Demaille <akim@epita.fr>
18377
18378 Try to make the use of the eoftoken valid. Given that its value
18379 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
18380 is used instead of > 0 where appropriate, (ii), depend upon nritems
18381 instead of the 0-sentinel.
18382
18383 * src/gram.h, src/gram.c (nritems): New.
18384 Expected to be duplication of nitems, but for the time being...
18385 * src/reader.c (packgram): Assert nritems and nitems are equal.
18386 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
18387 * src/closure.c (print_closure, print_fderives): Likewise.
18388 * src/gram.c (ritem_print): Likewise.
18389 * src/print.c (print_core, print_grammar): Likewise.
18390 * src/print_graph.c: Likewise.
18391
18392 2001-12-27 Akim Demaille <akim@epita.fr>
18393
18394 * src/main.c (main): If there are complains after grammar
18395 reductions, then output the report anyway if requested, then die.
18396 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
18397 * src/reader.c (eoftoken): New.
18398 (parse_token_decl): If the token being defined has value `0', it
18399 is the eoftoken.
18400 (packsymbols): No longer hack `tags' to insert `$' by hand.
18401 Be sure to preserve the value of the eoftoken.
18402 (reader): Make sure eoftoken is defined.
18403 Initialize nsyms to 0: now eoftoken is created just like the others.
18404 * src/print.c (print_grammar): Don't special case the eof token.
18405 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
18406 lie anyway, albeit pleasant.
18407 * tests/calc.at: Exercise error messages with eoftoken.
18408 Change the grammar so that empty input is invalid.
18409 Adjust expectations.
18410 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
18411
18412 2001-12-27 Akim Demaille <akim@epita.fr>
18413
18414 * configure.in: Check the protos of strchr ans strspn.
18415 Replace strchr if needed.
18416 * src/system.h: Provide the protos of strchr, strspn and memchr if
18417 missing.
18418 * lib/strchr.c: New.
18419 * src/reader.c (symbols_save): Use strchr.
18420
18421 2001-12-27 Akim Demaille <akim@epita.fr>
18422
18423 * src/print.c, src/print_graph.c (escape): New.
18424 Use it to quote the TAGS outputs.
18425 * src/print_graph.c (print_state): Now errors are in red, and
18426 reductions in green.
18427 Prefer high to wide: output the state number on a line of its own.
18428
18429 2001-12-27 Akim Demaille <akim@epita.fr>
18430
18431 * src/state.h, src/state.c (reductions_new): New.
18432 * src/LR0.c (set_state_table): Let all the states have a
18433 `reductions', even if reduced to 0.
18434 (save_reductions): Adjust.
18435 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
18436 * src/print.c (print_reductions, print_actions): Adjust.
18437 * src/output.c (action_row): Adjust.
18438
18439 2001-12-27 Akim Demaille <akim@epita.fr>
18440
18441 * src/state.h, src/state.c (errs_new, errs_dup): New.
18442 * src/LR0.c (set_state_table): Let all the states have an errs,
18443 even if reduced to 0.
18444 * src/print.c (print_errs, print_reductions): Adjust.
18445 * src/output.c (output_actions, action_row): Adjust.
18446 * src/conflicts.c (resolve_sr_conflict): Adjust.
18447
18448 2001-12-27 Akim Demaille <akim@epita.fr>
18449
18450 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
18451
18452 2001-12-27 Akim Demaille <akim@epita.fr>
18453
18454 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
18455 * src/print.c: here.
18456 (lookaheadset, shiftset): New, used as additional storage by
18457 print_reductions.
18458 (print_results): Adjust.
18459 (print_shifts, print_gotos, print_errs): New, extracted from...
18460 (print_actions): here.
18461 * src/print_graph.c (print_actions): Remove dead code.
18462
18463 2001-12-27 Akim Demaille <akim@epita.fr>
18464
18465 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
18466 `$n' and `@n'.
18467
18468 2001-12-27 Akim Demaille <akim@epita.fr>
18469
18470 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
18471 (build_relations): Adjust.
18472
18473 2001-12-27 Akim Demaille <akim@epita.fr>
18474
18475 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
18476 duplication.
18477
18478 2001-12-27 Akim Demaille <akim@epita.fr>
18479
18480 * src/reader.c (packgram): Catch nitems overflows.
18481
18482 2001-12-27 Akim Demaille <akim@epita.fr>
18483
18484 * src/files.c, src/files.h (guard_obstack): Remove.
18485 * src/output.c (output): Adjust.
18486 * src/reader.c (parse_braces): New, factoring...
18487 (copy_action, copy_guard): these two which are renamed as...
18488 (parse_action, parse_guard): these.
18489 As a voluntary consequence, using braces around guards is now
18490 mandatory.
18491
18492 2001-12-27 Akim Demaille <akim@epita.fr>
18493
18494 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
18495 * src/reader.c (symbol_list): `guard' and `guard_line' are new
18496 members.
18497 (symbol_list_new): Adjust.
18498 (copy_action): action_line is the first line, not the last.
18499 (copy_guard): Just as for actions, store the `action' only, not
18500 the switch/case/break flesh.
18501 Don't parse the user action that might follow the guard, let...
18502 (readgram): do it, i.e., now, there can be an action after a
18503 guard.
18504 In other words the guard is just explicitly optional.
18505 (packgram): Adjust.
18506 * src/output.c (guards_output): New.
18507 (output_parser): Call it when needed.
18508 (output): Also free the guard and attrs obstacks.
18509 * src/files.c, src/files.h (obstack_save): Remove.
18510 (output_files): Remove.
18511 As a result, if one needs the former `.act' file, using an
18512 appropriate skeleton which requires actions and guards is now
18513 required.
18514 * src/main.c (main): Adjust.
18515 * tests/semantic.at: New.
18516 * tests/regression.at: Use `input.y' as input file name.
18517 Avoid 8+3 problems by requiring input.c when the test needs the
18518 parser.
18519
18520 2001-12-27 Akim Demaille <akim@epita.fr>
18521
18522 * src/reader.c (symbol_list_new): Be sure to initialize all the
18523 fields.
18524
18525 2001-12-27 Akim Demaille <akim@epita.fr>
18526
18527 All the hacks using a final pseudo state are now useless.
18528
18529 * src/LR0.c (set_state_table): state_table holds exactly nstates.
18530 * src/lalr.c (nLA): New.
18531 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
18532 instead of lookaheadsp from the pseudo state (nstate + 1).
18533
18534 2001-12-27 Akim Demaille <akim@epita.fr>
18535
18536 * src/output.c (action_row, token_actions): Use a state_t instead
18537 of a integer, and nlookaheads instead of the following state's
18538 lookaheadsp.
18539
18540 2001-12-27 Akim Demaille <akim@epita.fr>
18541
18542 * src/conflicts.c (log_resolution, flush_shift)
18543 (resolve_sr_conflict, set_conflicts, solve_conflicts)
18544 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
18545 (conflicts_print, print_reductions): Use a state_t instead of an
18546 integer when referring to a state.
18547 As much as possible, depend upon nlookaheads, instead of the
18548 `lookaheadsp' member of the following state (since lookaheads of
18549 successive states are successive, the difference between state n + 1
18550 and n served as the number of lookaheads for state n).
18551 * src/lalr.c (add_lookback_edge): Likewise.
18552 * src/print.c (print_core, print_actions, print_state)
18553 (print_results): Likewise.
18554 * src/print_graph.c (print_core, print_actions, print_state)
18555 (print_graph): Likewise.
18556 * src/conflicts.h: Adjust.
18557
18558 2001-12-27 Akim Demaille <akim@epita.fr>
18559
18560 * src/bison.hairy: Formatting/comment changes.
18561 ANSIfy.
18562 Remove `register' indications.
18563 Add plenty of `static'.
18564
18565 2001-12-27 Akim Demaille <akim@epita.fr>
18566
18567 * src/output.c (prepare): Drop the muscle `ntbase' which
18568 duplicates ntokens.
18569 * src/bison.simple: Formatting/comment changes.
18570 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
18571 is an undocumented synonym.
18572
18573 2001-12-22 Akim Demaille <akim@epita.fr>
18574
18575 * src/output.c (output_table_data): Change the prototype to use
18576 `int' for array ranges: some invocations do pass an int, not a
18577 short.
18578 Reported by Wayne Green.
18579
18580 2001-12-22 Akim Demaille <akim@epita.fr>
18581
18582 Some actions of web2c.y are improperly triggered.
18583 Reported by Mike Castle.
18584
18585 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
18586 * tests/regression.at (Web2c): Rename as...
18587 (Web2c Report): this.
18588 (Web2c Actions): New.
18589
18590 2001-12-22 Akim Demaille <akim@epita.fr>
18591
18592 Reductions in web2c.y are improperly reported.
18593 Reported by Mike Castle.
18594
18595 * src/conflicts.c (print_reductions): Fix.
18596 * tests/regression.at (Web2c): New.
18597
18598 2001-12-18 Akim Demaille <akim@epita.fr>
18599
18600 Some host fail on `assert (!"foo")', which expands to
18601 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
18602 Reported by Nelson Beebee.
18603
18604 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
18605 `#define it_succeeded 0' and `assert (it_succeeded)'.
18606
18607 2001-12-17 Marc Autret <autret_m@epita.fr>
18608
18609 * src/bison.simple: Don't hard code the skeleton line and filename.
18610 * src/output.c (output_parser): Rename 'line' as 'output_line'.
18611 New line counter 'skeleton_line' (skeleton-line muscle).
18612
18613 2001-12-17 Paul Eggert <eggert@twinsun.com>
18614
18615 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
18616 YYDEBUG must be defined to a nonzero value.
18617
18618 * src/bison.simple (yytname): Do not assume that the user defines
18619 YYDEBUG to a properly parenthesized expression.
18620
18621 2001-12-17 Akim Demaille <akim@epita.fr>
18622
18623 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
18624 nlookaheads is a new member.
18625 Adjust all users.
18626 * src/lalr.h (nlookaheads): Remove this orphan declaration.
18627 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
18628 state.
18629
18630 2001-12-17 Akim Demaille <akim@epita.fr>
18631
18632 * src/files.h, src/files.c (open_files, close_files): Remove.
18633 * src/main.c (main): Don't open/close files, nor invoke lex_free,
18634 let...
18635 * src/reader.c (reader): Do it.
18636
18637 2001-12-17 Akim Demaille <akim@epita.fr>
18638
18639 * src/conflicts.c (print_reductions): Formatting changes.
18640
18641 2001-12-17 Akim Demaille <akim@epita.fr>
18642
18643 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
18644 (flush_reduce): New.
18645 (resolve_sr_conflict): Adjust.
18646
18647 2001-12-17 Akim Demaille <akim@epita.fr>
18648
18649 * src/output.c (output_obstack): Be static and rename as...
18650 (format_obstack): this, to avoid any confusion with files.c's
18651 output_obstack.
18652 * src/reader.h (muscle_obstack): Move to...
18653 * src/output.h: here, since it's defined in output.c.
18654
18655 2001-12-17 Akim Demaille <akim@epita.fr>
18656
18657 * src/output.c (action_row, save_column, default_goto)
18658 (sort_actions, matching_state, pack_vector): Better variable
18659 locality.
18660
18661 2001-12-17 Akim Demaille <akim@epita.fr>
18662
18663 * src/output.c: Various formatting changes.
18664
18665 2001-12-17 Akim Demaille <akim@epita.fr>
18666
18667 * src/files.c (output_files): Free the output_obstack.
18668 * src/main.c (main): Call print and print_graph conditionally.
18669 * src/print.c (print): Work unconditionally.
18670 * src/print_graph.c (print_graph): Work unconditionally.
18671 * src/conflicts.c (log_resolution): Output only if verbose_flag.
18672
18673 2001-12-16 Marc Autret <autret_m@epita.fr>
18674
18675 * src/output.c (actions_output): Fix. When we use %no-lines,
18676 there is one less line per action.
18677
18678 2001-12-16 Marc Autret <autret_m@epita.fr>
18679
18680 * src/bison.simple: Remove a useless #line directive.
18681 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
18682 * src/output.c (get_lines_number): New.
18683 (output_parser): Adjust, now takes care about the lines of a
18684 output muscles.
18685 Fix line numbering.
18686 (actions_output): Computes the number of lines taken by actions.
18687 (output_master_parser): Insert new skeleton which is the name of
18688 the output parser file name.
18689
18690 2001-12-15 Marc Autret <autret_m@epita.fr>
18691
18692 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
18693
18694 2001-12-15 Marc Autret <autret_m@epita.fr>
18695
18696 * src/output.c (output_gram): Keep track of the hairy one.
18697
18698 2001-12-15 Akim Demaille <akim@epita.fr>
18699
18700 Make `make distcheck' work.
18701
18702 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
18703 system.h which uses libgettext.h.
18704
18705 2001-12-15 Akim Demaille <akim@epita.fr>
18706
18707 * src/nullable.c (set_nullable): Useless rules must be skipped,
18708 otherwise, since we range over their symbols, we might look at a
18709 nonterminal which no longer ``exists'', i.e., it is not counted in
18710 `nvars', hence we overflow our arrays.
18711
18712 2001-12-15 Akim Demaille <akim@epita.fr>
18713
18714 The header can also be produced directly, without any obstack!
18715 Yahoo!
18716
18717 * src/files.c, src/files.h (defines_obstack): Remove.
18718 (compute_header_macro): Global.
18719 (defines_obstack_save): Remove.
18720 * src/reader.c (parse_union_decl): No longer output to
18721 defines_obstack: its content can be found in the `stype' muscle
18722 anyway.
18723 (output_token_translations): Merge into...
18724 (symbols_output): this.
18725 Rename as...
18726 (symbols_save): this.
18727 (reader): Adjust.
18728 * src/output.c (header_output): New.
18729 (output): Call it.
18730
18731 2001-12-15 Akim Demaille <akim@epita.fr>
18732
18733 * src/reader.c (parse_union_decl): Instead of handling two obstack
18734 simultaneously, use one to define the `stype' muscle, and use the
18735 value of the latter to fill defines_obstack.
18736 (copy_comment): Remove.
18737 (copy_comment2): Work for a single obstack.
18738 Rename as...
18739 (copy_comment): this.
18740
18741 2001-12-15 Akim Demaille <akim@epita.fr>
18742
18743 * src/lex.c, src/lex.h (xgetc): No longer static.
18744 * src/reader.c (parse_union_decl): Revamp.
18745
18746 2001-12-15 Akim Demaille <akim@epita.fr>
18747
18748 Still making progress in separating Bison into (i) input, (ii)
18749 process, (iii) output: now we can directly output the parser file
18750 without using table_obstack at all.
18751
18752 * src/files.c, src/files.h (table_obstack): Bye bye.
18753 (parser_file_name): New.
18754 * src/files.c (compute_output_file_names): Compute it.
18755 * src/output.c (actions_output, output_parser)
18756 (output_master_parser): To a file instead of an obstack.
18757
18758 2001-12-15 Akim Demaille <akim@epita.fr>
18759
18760 Attach actions to rules, instead of pre-outputting them to
18761 actions_obstack.
18762
18763 * src/gram.h (rule_t): action and action_line are new members.
18764 * src/reader.c (symbol_list): Likewise.
18765 (copy_action): Save the actions within the rule.
18766 (packgram): Save them in rule_table.
18767 * src/output.c (actions_output): New.
18768 (output_parser): Use it on `%%actions'.
18769 (output_rule_data): Don't free rule_table.
18770 (output): Do it.
18771 (prepare): Don't save the `action' muscle.
18772 * src/bison.simple: s/%%action/%%actions/.
18773
18774 2001-12-15 Akim Demaille <akim@epita.fr>
18775
18776 * src/reader.c (copy_action): When --yacc, don't append a `;'
18777 to the user action: let it fail if lacking.
18778 Suggested by Arnold Robbins and Tom Tromey.
18779
18780 2001-12-14 Akim Demaille <akim@epita.fr>
18781
18782 * src/lex.c (literalchar): Simply return the char you decoded, non
18783 longer mess around with obstacks and int pointers.
18784 Adjust all callers.
18785
18786 2001-12-14 Akim Demaille <akim@epita.fr>
18787
18788 * src/lex.c (literalchar): Don't escape the special characters,
18789 just decode them, and keep them as char (before, eol was output as
18790 the 2 char string `\n' etc.).
18791 * src/output.c (output_rule_data): Use quotearg to output the
18792 token strings.
18793
18794 2001-12-13 Paul Eggert <eggert@twinsun.com>
18795
18796 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
18797 Do not infringe on the global user namespace when using C++.
18798 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
18799 All uses of `fprintf' and `stderr' changed.
18800
18801 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
18802
18803 2001-12-13 Akim Demaille <akim@epita.fr>
18804
18805 The computation of nullable is broken: it doesn't handle empty
18806 RHS's properly.
18807
18808 * tests/torture.at (GNU AWK Grammar): New.
18809 * tests/sets.at (Nullable): New.
18810 * src/nullable.c (set_nullable): Instead of blindly looping over
18811 `ritems', loop over the rules, and then over their rhs's.
18812
18813 Work around Autotest bugs.
18814
18815 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
18816 frame, because Autotest understand lines starting with a `+' as
18817 traces from the shell. Then, they are not processed properly.
18818 Admittedly an Autotest bug, but we don't have time to wait for
18819 Autotest to catch up.
18820 * tests/regression.at (Broken Closure): Adjust to the new table
18821 frames.
18822 Move to...
18823 * tests/sets.at: here.
18824
18825 2001-12-13 Akim Demaille <akim@epita.fr>
18826
18827 * src/closure.c (closure): Use nrules instead of playing tricks
18828 with BITS_PER_WORD.
18829
18830 2001-12-13 Akim Demaille <akim@epita.fr>
18831
18832 * src/print.c (print_actions): Output the handling of `$' as the
18833 traces do: shifting the token EOF. Before EOF was treated as a
18834 nonterminal.
18835 * tests/regression.at: Adjust some tests.
18836 * src/print_graph.c (print_core): Complete the set of items via
18837 closure. The next-to-final and final states are still unsatisfying,
18838 but that's to be addressed elsewhere.
18839 No longer output the rule numbers, but do output the state number.
18840 A single loop for the shifts + gotos is enough, but picked a
18841 distinct color for each.
18842 (print_graph): Initialize and finalize closure.
18843
18844 2001-12-13 Akim Demaille <akim@epita.fr>
18845
18846 * src/reader.c (readgram): Remove dead code, an strip useless
18847 braces.
18848 (get_type): Remove, unused.
18849
18850 2001-12-12 Akim Demaille <akim@epita.fr>
18851
18852 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
18853 on that of lib/error.c.
18854
18855 2001-12-12 Akim Demaille <akim@epita.fr>
18856
18857 Some hosts don't like `/' in includes.
18858
18859 * src/system.h: Include libgettext.h without qualifying the path.
18860 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
18861 $(top_srcdir).
18862
18863 2001-12-11 Marc Autret <autret_m@epita.fr>
18864
18865 * src/output.c (output_parser): Remove useless muscle.
18866
18867 2001-12-11 Marc Autret <autret_m@epita.fr>
18868
18869 * src/bison.simple: Remove #line just before %%epilogue. It
18870 is now handled in ...
18871 * src/reader.c (read_additionnal_code): Add the output of a
18872 #line for the epilogue.
18873
18874 2001-12-10 Marc Autret <autret_m@epita.fr>
18875
18876 * src/reader.c (copy_definition): Re-use CPP-outed code which
18877 replace precedent remove.
18878 * src/bison.simple: Remove #line before %%prologue because
18879 %%input-line is wrong at this time.
18880
18881 2001-12-10 Marc Autret <autret_m@epita.fr>
18882
18883 * src/reader.c (symbols_output): Clean up.
18884 * src/output.c (output_gram, output): Clean up.
18885
18886 2001-12-10 Akim Demaille <akim@epita.fr>
18887
18888 * src/lalr.c (initialize_lookaheads): New. Extracted from...
18889 * src/LR0.c (set_state_table): here.
18890 * src/lalr.c (lalr): Call it.
18891
18892 2001-12-10 Akim Demaille <akim@epita.fr>
18893
18894 * src/state.h (shifts): Remove the `number' member: shifts are
18895 attached to state, hence no longer need to be labelled with a
18896 state number.
18897
18898 2001-12-10 Akim Demaille <akim@epita.fr>
18899
18900 Now that states have a complete set of members, the linked list of
18901 shifts is useless: just fill directly the state's shifts member.
18902
18903 * src/state.h (shifts): Remove the `next' member.
18904 * src/LR0.c (first_state, last_state): Remove.
18905 Adjust the callers.
18906 (augment_automaton): Don't look for the shifts that must be added
18907 a shift on EOF: it is those of the state we looked for! But now,
18908 since shifts are attached, it is no longer needed to looking
18909 merely by its id: its number.
18910
18911 2001-12-10 Akim Demaille <akim@epita.fr>
18912
18913 * src/LR0.c (augment_automaton): Better variable locality.
18914 Remove an impossible branch: if there is a state corresponding to
18915 the start symbol being shifted, then there is shift for the start
18916 symbol from the initial state.
18917
18918 2001-12-10 Akim Demaille <akim@epita.fr>
18919
18920 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
18921 only when appropriate: when insert_start_shifting_state' is not
18922 invoked.
18923 * tests/regression.at (Rule Line Numbers): Adjust.
18924
18925 2001-12-10 Akim Demaille <akim@epita.fr>
18926
18927 * src/LR0.c (augment_automaton): Now that all states have shifts,
18928 merge the two cases addition shifts to the initial state.
18929
18930 2001-12-10 Akim Demaille <akim@epita.fr>
18931
18932 * src/lalr.c (set_state_table): Move to...
18933 * src/LR0.c: here.
18934 * src/lalr.c (lalr): Don't call it...
18935 * src/LR0.c (generate_states): do it.
18936 * src/LR0.h (first_state): Remove, only the table is used.
18937
18938 2001-12-10 Akim Demaille <akim@epita.fr>
18939
18940 * src/LR0.h (first_shift, first_reduction): Remove.
18941 * src/lalr.c: Don't use first_shift: find shifts through the
18942 states.
18943
18944 2001-12-10 Akim Demaille <akim@epita.fr>
18945
18946 * src/LR0.c: Attach shifts to states as soon as they are
18947 computed.
18948 * src/lalr.c (set_state_table): Instead of assigning shifts to
18949 state, just assert that the mapping was properly done.
18950
18951 2001-12-10 Akim Demaille <akim@epita.fr>
18952
18953 * src/LR0.c (insert_start_shift): Rename as...
18954 (insert_start_shifting_state): this.
18955 (insert_eof_shifting_state, insert_accepting_state): New.
18956 (augment_automaton): Adjust.
18957 Better locality of the variables.
18958 When looking if the start_symbol is shifted from the initial
18959 state, using `while (... symbol != start_symbol ...)' sounds
18960 better than `while (... symbol < start_symbol ...)': If fail
18961 to see how the order between symbols could be relevant!
18962
18963 2001-12-10 Akim Demaille <akim@epita.fr>
18964
18965 * src/getargs.h: Don't declare `spec_name_prefix' and
18966 `spec_file_prefix', declared by src/files.h.
18967 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
18968 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
18969 * src/output.c (prepare): Adjust.
18970 * src/reader.c (symbols_output): Likewise.
18971 * src/vmsgetargs.c: Vaguely adjust, but who cares?
18972
18973 2001-12-10 Akim Demaille <akim@epita.fr>
18974
18975 * src/muscle_tab.c (muscle_init): NULL is a better default than
18976 `"0"'.
18977
18978 2001-12-10 Akim Demaille <akim@epita.fr>
18979
18980 * src/reader.c (reader): Calling symbols_output once is enough.
18981
18982 2001-12-10 Akim Demaille <akim@epita.fr>
18983
18984 Now that states have a complete set of members, the linked list of
18985 reductions is useless: just fill directly the state's reductions
18986 member.
18987
18988 * src/state.h (struct reductions): Remove member `number' and
18989 `next'.
18990 * src/LR0.c (first_reduction, last_reduction): Remove.
18991 (save_reductions): Don't link the new reductions, store them in
18992 this_state.
18993 * src/lalr.c (set_state_table): No need to attach reductions to
18994 states, it's already done.
18995 * src/output.c (output_actions): No longer free the shifts, then
18996 the reductions, then the states: free all the states and their
18997 members.
18998
18999 2001-12-10 Akim Demaille <akim@epita.fr>
19000
19001 * src/options.c (OPTN, DRTV, BOTH): New.
19002 (option_table): Use them.
19003
19004 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19005 the job of system.h.
19006 * src/options.c: Don't include stdio.h and xalloc.h for the same
19007 reasons.
19008
19009 2001-12-10 Akim Demaille <akim@epita.fr>
19010
19011 * src/output.c (output, prepare): Make sure the values of the
19012 muscles `action' and `prologue' are 0-terminated.
19013
19014 2001-12-10 Akim Demaille <akim@epita.fr>
19015
19016 Clean up GCC warnings.
19017
19018 * src/reader.c (copy_action): `buf' is not used.
19019 (parse_skel_decl): Be static.
19020 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19021 * src/options.h (create_long_option_table): Have a real prototype.
19022 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19023 (hash_delete_at): Return const void *.
19024 Adjust casts to preserve the const.
19025
19026 2001-12-10 Akim Demaille <akim@epita.fr>
19027
19028 * configure.in: Require 2.52g.
19029 M4 is not needed, but AUTOM4TE is.
19030 * m4/m4.m4: Remove.
19031 * tests/Makefile.am: Adjust.
19032
19033 2001-12-10 Akim Demaille <akim@epita.fr>
19034
19035 One structure for states is enough, even though theoretically
19036 there are LR(0) states and LALR(1) states.
19037
19038 * src/lalr.h (state_t): Remove.
19039 (state_table): Be state_t **, not state_t *.
19040 * src/state.h (core, CORE_ALLOC): Rename as...
19041 (state_t, STATE_ALLOC): this.
19042 Add the LALR(1) members: shifts, reductions, errs.
19043 * src/LR0.c (state_table): Rename as...
19044 (state_hash): this, to avoid name clashes with the global
19045 `state_table'.
19046 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19047 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19048
19049 2001-12-10 Akim Demaille <akim@epita.fr>
19050
19051 Bison dumps core on bash.y.
19052 Reported by Pascal Bart.
19053
19054 * src/warshall.c (bitmatrix_print): New.
19055 (TC): Use it.
19056 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
19057 j must be the outer loop.
19058 * tests/regression.at (Broken Closure): New.
19059
19060 2001-12-05 Akim Demaille <akim@epita.fr>
19061
19062 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19063 its argument.
19064 Reported by Peter Hamorsky.
19065
19066 2001-12-05 Akim Demaille <akim@epita.fr>
19067
19068 * src/conflicts.c (err_table): Remove.
19069 (resolve_sr_conflict): Adjust.
19070 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19071 Rename as...
19072 (state_t.reductions, state_t.shifts): this.
19073
19074 2001-12-05 Akim Demaille <akim@epita.fr>
19075
19076 * src/reduce.c (reduce_grammar_tables): No longer disable the
19077 removal of useless rules via CPP but via `if (0)', so that the
19078 compiler still check the code is valid.
19079 For instance, it should have noticed `rline' no longer exists: use
19080 the `line' member of rule_t.
19081 * src/gram.c (dummy, rline): Remove, unused.
19082
19083 2001-12-05 Akim Demaille <akim@epita.fr>
19084
19085 * src/output.c (pack_vector): Use assert, not berror.
19086 * src/main.c (berror): Remove, unused.
19087
19088 2001-12-05 Akim Demaille <akim@epita.fr>
19089
19090 New experimental feature: if --verbose --trace output all the
19091 items of a state, not only its kernel.
19092
19093 * src/print.c (print_core): If `trace_flag', then invoke closure
19094 before outputting the items of the state (print_core is no longer
19095 a correct name them).
19096 (print_results): Invoke new_closure/free_closure if needed.
19097
19098 2001-12-05 Akim Demaille <akim@epita.fr>
19099
19100 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19101 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19102 (nitemset): for consistency with the rest of the project.
19103
19104 2001-12-05 Akim Demaille <akim@epita.fr>
19105
19106 * src/closure.c (print_closure): Improve.
19107 (closure): Use it for printing input and output.
19108
19109 2001-12-05 Akim Demaille <akim@epita.fr>
19110
19111 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19112 indexed by nonterminals.
19113
19114 2001-12-05 Akim Demaille <akim@epita.fr>
19115
19116 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19117 what it was!).
19118 * src/warshall.h: Remove accidental duplication of the content.
19119
19120 2001-12-05 Akim Demaille <akim@epita.fr>
19121
19122 * src/closure.c (set_fderives): De-obfuscate.
19123
19124 2001-12-05 Akim Demaille <akim@epita.fr>
19125
19126 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19127
19128 2001-12-05 Akim Demaille <akim@epita.fr>
19129
19130 * src/closure.c (set_firsts): De-obfuscate.
19131
19132 2001-12-05 Akim Demaille <akim@epita.fr>
19133
19134 * src/output.c (action_row): De-obfuscate
19135 using the good o' techniques: arrays not pointers, variable
19136 locality, BITISSET, RESETBIT etc.
19137
19138 2001-12-05 Akim Demaille <akim@epita.fr>
19139
19140 Pessimize the code to simplify it: from now on, all the states
19141 have a valid SHIFTS, which NSHIFTS is possibly 0.
19142
19143 * src/LR0.c (shifts_new): Be global and move to..
19144 * src/state.c, src/state.h: here.
19145 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19146 * src/print_graph: Adjust.
19147
19148 2001-12-05 Akim Demaille <akim@epita.fr>
19149
19150 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
19151 * src/conflicts.c: Use it.
19152 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
19153 incorrectly ``simplified''.
19154
19155 2001-12-05 Akim Demaille <akim@epita.fr>
19156
19157 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
19158 using the good o' techniques: arrays not pointers, variable
19159 locality, BITISSET, RESETBIT etc.
19160
19161 2001-12-05 Akim Demaille <akim@epita.fr>
19162
19163 * src/state.h (SHIFT_SYMBOL): New.
19164 * src/conflicts.c: Use it to deobfuscate.
19165
19166 2001-12-05 Akim Demaille <akim@epita.fr>
19167
19168 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
19169 (print_reductions): De-obfuscate using the good o' techniques:
19170 arrays not pointers, variable locality, BITISSET.
19171
19172 2001-12-05 Akim Demaille <akim@epita.fr>
19173
19174 * src/conflicts.c (print_reductions): Arrays, not pointers.
19175 Use BITISSET.
19176
19177 2001-12-05 Akim Demaille <akim@epita.fr>
19178
19179 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19180
19181 2001-12-05 Akim Demaille <akim@epita.fr>
19182
19183 * src/conflicts.c (print_reductions): Improve variable locality.
19184
19185 2001-12-05 Akim Demaille <akim@epita.fr>
19186
19187 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19188
19189 2001-12-05 Akim Demaille <akim@epita.fr>
19190
19191 * src/conflicts.c (print_reductions): Improve variable locality.
19192
19193 2001-12-05 Akim Demaille <akim@epita.fr>
19194
19195 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
19196 * src/lalr.c: Use them.
19197
19198 2001-12-05 Akim Demaille <akim@epita.fr>
19199
19200 * src/LR0.c (augment_automaton): Formatting changes.
19201 Better variable locality.
19202
19203 2001-12-05 Akim Demaille <akim@epita.fr>
19204
19205 * src/lalr.c (matrix_print): New.
19206 (transpose): Use it.
19207 Use arrays instead of pointers.
19208
19209 2001-12-05 Akim Demaille <akim@epita.fr>
19210
19211 * src/lalr.c (maxrhs): Move to...
19212 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
19213 * src/lalr.c (build_relations): Adjust.
19214
19215 2001-12-05 Akim Demaille <akim@epita.fr>
19216
19217 * src/lalr.c (transpose): Free the memory allocated to the
19218 argument, as it is replaced by the results by the unique caller.
19219 (build_relations): Merely invoke transpose: it handles the memory
19220 deallocation.
19221 Improve variable locality.
19222 Avoid variables used as mere abbreviations.
19223 (compute_lookaheads): Use arrays instead of pointers.
19224
19225 2001-12-05 Akim Demaille <akim@epita.fr>
19226
19227 * src/lalr.c (initialize_F): Improve variable locality.
19228 Avoid variables used as mere abbreviations.
19229
19230 2001-12-05 Akim Demaille <akim@epita.fr>
19231
19232 * src/derives.c (print_derives): Display the ruleno.
19233 * src/lalr.c (initialize_F, transpose): Better variable locality
19234 to improve readability.
19235 Avoid variables used as mere abbreviations.
19236
19237 2001-12-05 Akim Demaille <akim@epita.fr>
19238
19239 * src/lalr.c (traverse): Use arrays instead of pointers.
19240
19241 2001-12-05 Akim Demaille <akim@epita.fr>
19242
19243 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
19244 the handling of squeue.
19245 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19246
19247 2001-12-05 Akim Demaille <akim@epita.fr>
19248
19249 Because useless nonterminals are now kept alive (instead of being
19250 `destroyed'), we now sometimes examine them, and store information
19251 related to them. Hence we need to know their number, and adjust
19252 memory allocations.
19253
19254 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
19255 static.
19256 * src/LR0.c (allocate_itemsets): The memory allocated to
19257 `symbol_count' was used for two different purpose: once to count
19258 the number of occurrences of each symbol, and later reassigned to
19259 `shift_symbol', containing the symbol that can be shifted from a
19260 given state.
19261 Deobfuscate, i.e., allocate, use and free `symbol_count' here
19262 only, and...
19263 (new_itemsets): Allocate `shift_symbol' here.
19264 (allocate_itemsets): symbol_count includes useless nonterminals.
19265 Make room for them.
19266 (free_storage): Use `free', not `XFREE', for pointers that cannot
19267 be null.
19268
19269 2001-12-05 Akim Demaille <akim@epita.fr>
19270
19271 * src/nullable.c (set_nullable): Deobfuscate the handling of
19272 ritem.
19273 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19274
19275 2001-12-05 Akim Demaille <akim@epita.fr>
19276
19277 * src/gram.c, src/gram.h (ritem_print): New.
19278 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
19279 (This useless function was defined only to work around VMS linkers
19280 that can't handle compilation units with variables only).
19281 * src/reduce.c (dump_grammar): Use it to trace the construction of
19282 ritem.
19283
19284 2001-12-04 Paul Eggert <eggert@twinsun.com>
19285
19286 * src/bison.simple (union yyalloc): Change member names
19287 to be the same as the stack names.
19288 (yyparse): yyptr is now union yyalloc *, not char *.
19289 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
19290 and may generate better code on some machines.
19291 (yystpcpy): Use prototype if __STDC__ is defined, not just
19292 if __cplusplus is defined.
19293
19294 2001-11-30 Akim Demaille <akim@epita.fr>
19295
19296 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
19297 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
19298 Gettext doesn't compile cleanly, and dies with -Werror.
19299 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
19300 Include WARNING_CFLAGS here.
19301 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
19302 before being defined.
19303
19304 2001-11-27 Paul Eggert <eggert@twinsun.com>
19305
19306 * lib/quotearg.h (quotearg_n, quotearg_n_style):
19307 First arg is int, not unsigned.
19308 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
19309 (SIZE_MAX, UINT_MAX): New macros.
19310 (quotearg_n_options): Abort if N is negative.
19311 Avoid overflow check on hosts where size_t is 64 bits and int
19312 is 32 bits, as overflow is impossible there.
19313 Fix off-by-one typo that caused unnecessary reallocation.
19314
19315 2001-11-29 Paul Eggert <eggert@twinsun.com>
19316
19317 Name space cleanup in generated parser.
19318
19319 * doc/bison.texinfo (Bison Parser): Discuss system headers
19320 and their effect on the user name space.
19321
19322 * src/bison.simple:
19323 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
19324 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
19325 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
19326
19327 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
19328 on user names when possible.
19329
19330 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
19331 Simplify test for whather <alloca.h> exists.
19332
19333 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
19334
19335 (<stdio.h>): Include if YYDEBUG.
19336
19337 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
19338 ! defined (yyoverflow) && ! defined (yymemcpy).
19339
19340 (yymemcpy, yyparse): Rename local variables as needed so that
19341 they all begin with 'yy'.
19342
19343 (yystrlen, yystpcpy): New functions.
19344
19345 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
19346 All uses changed.
19347
19348 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
19349 instead of relying on string.h functions. Use YYSTACK_ALLOC
19350 and YYSTACK_FREE instead of malloc and free.
19351
19352 2001-11-30 Akim Demaille <akim@epita.fr>
19353
19354 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
19355 before their first uses.
19356 (YYBISON, YYPURE): Move to the top of the output.
19357
19358 2001-11-30 Akim Demaille <akim@epita.fr>
19359
19360 * tests/reduce.at (Useless Nonterminals): Fix.
19361
19362 2001-11-30 Akim Demaille <akim@epita.fr>
19363
19364 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
19365 if body instead of `;' to pacify GCC's warnings.
19366
19367 2001-11-30 Akim Demaille <akim@epita.fr>
19368
19369 Instead of mapping the LHS of unused rules to -1, keep the LHS
19370 valid, but flag the rules as invalid.
19371
19372 * src/gram.h (rule_t): `useful' is a new member.
19373 * src/print.c (print_grammar): Adjust.
19374 * src/derives.c (set_derives): Likewise.
19375 * src/reader.c (packgram, reduce_output): Likewise.
19376 * src/reduce.c (reduce_grammar_tables): Likewise.
19377 * tests/reduce.at (Underivable Rules, Useless Rules): New.
19378
19379 2001-11-30 Akim Demaille <akim@epita.fr>
19380
19381 * src/reduce.c (reduce_output): Formatting changes.
19382 * src/print.c (print_results, print_grammar): Likewise.
19383 * tests/regression.at (Rule Line Numbers)
19384 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
19385
19386 2001-11-30 Akim Demaille <akim@epita.fr>
19387
19388 * src/reduce.c (nonterminals_reduce): Instead of throwing away
19389 useless nonterminals, move them at the end of the symbol arrays.
19390 (reduce_output): Adjust.
19391 * tests/reduce.at (Useless Nonterminals): Adjust.
19392
19393 2001-11-30 Akim Demaille <akim@epita.fr>
19394
19395 * src/reduce.c: Various comment/formatting changes.
19396 (nonterminals_reduce): New, extracted from...
19397 (reduce_grammar_tables): here.
19398 (reduce_grammar): Call nonterminals_reduce.
19399
19400 2001-11-29 Paul Eggert <eggert@twinsun.com>
19401
19402 * src/bison.simple (YYSTACK_REALLOC): Remove.
19403 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
19404 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
19405 New macros.
19406 (union yyalloc): New type.
19407 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
19408 an arbitrary restriction on hosts where size_t is wider than int.
19409
19410 (yyparse): Don't dump core if alloca or malloc fails; instead, report
19411 a parser stack overflow. Allocate just one block of memory for all
19412 three stacks, instead of allocating three blocks; this typically is
19413 faster and reduces fragmentation.
19414
19415 Do not limit the number of items in the stack to a value that fits
19416 in 'int', as this is an arbitrary limit on hosts with 64-bit
19417 size_t and 32-bit int.
19418
19419 2001-11-29 Marc Autret <autret_m@epita.fr>
19420
19421 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
19422 of defining YYERROR_VERBOSE.
19423 [AT_DATA]: $4 is now out of C declarations in the prologue.
19424
19425 2001-11-28 Marc Autret <autret_m@epita.fr>
19426
19427 * src/reader.c (parse_dquoted_param): New.
19428 (parse_skel_decl): Use it.
19429 * src/lex.h: Add its prototype.
19430 * src/lex.c (literalchar): Become not static.
19431
19432 2001-11-28 Marc Autret <autret_m@epita.fr>
19433
19434 * src/output.h: And put its extern declaration here.
19435 * src/output.c (error_verbose): Define here.
19436 (prepare): Echo name modification.
19437 * src/getargs.h: Clean its extern declaration.
19438 * src/getargs.c (error_verbose_flag): Remove.
19439 (getargs): Remove case 'e'.
19440 * src/options.c (option_table): 'error-verbose' is now seen as simple
19441 percent option.
19442 Include output.h.
19443
19444 * src/reader.c (read_declarations): Remove case tok_include.
19445 (parse_include_decl): Remove.
19446 * src/lex.h (token_t): Remove tok_include.
19447 * src/options.c (option_table): 'include' is now a simple command line
19448 option.
19449
19450 2001-11-28 Marc Autret <autret_m@epita.fr>
19451
19452 * src/bison.simple: Adjust muscle names.
19453 * src/muscle_tab.c (muscle_init): Also rename the muscles.
19454 * src/output.c (prepare): s/_/-/ for the muscles names.
19455 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
19456
19457 2001-11-28 Marc Autret <autret_m@epita.fr>
19458
19459 * src/bison.simple: Fix debug.
19460 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
19461
19462 2001-11-28 Akim Demaille <akim@epita.fr>
19463
19464 * src/LR0.c (shifts_new): New.
19465 (save_shifts, insert_start_shift, augment_automaton): Use it.
19466
19467 2001-11-28 Akim Demaille <akim@epita.fr>
19468
19469 * src/closure.c (closure): `b' and `ruleno' denote the same value:
19470 keep ruleno only.
19471
19472 2001-11-28 Akim Demaille <akim@epita.fr>
19473
19474 * src/closure.c (closure): Instead of looping over word in array
19475 then bits in words, loop over bits in array.
19476
19477 2001-11-28 Akim Demaille <akim@epita.fr>
19478
19479 * src/closure.c (closure): No longer optimize the special case
19480 where all the bits of `ruleset[r]' are set to 0, to make the code
19481 clearer.
19482
19483 2001-11-28 Akim Demaille <akim@epita.fr>
19484
19485 * src/closure.c (closure): `r' and `c' are new variables, used to
19486 de-obfuscate accesses to RULESET and CORE.
19487
19488 2001-11-28 Akim Demaille <akim@epita.fr>
19489
19490 * src/reduce.c (reduce_print): Use ngettext.
19491 (dump_grammar): Improve the trace accuracy.
19492
19493 2001-11-28 Akim Demaille <akim@epita.fr>
19494
19495 * src/reduce.c (dump_grammar): Don't translate trace messages.
19496
19497 2001-11-28 Akim Demaille <akim@epita.fr>
19498
19499 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
19500 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
19501 as all tags are free'ed afterwards.
19502 From Enrico Scholz.
19503
19504 2001-11-27 Paul Eggert <eggert@twinsun.com>
19505
19506 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
19507 use alloca when we didn't want to, and vice versa.
19508
19509 2001-11-27 Marc Autret <autret_m@epita.fr>
19510
19511 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
19512 initialization.
19513 * src/output.c (prepare): Remove its update.
19514
19515 2001-11-27 Marc Autret <autret_m@epita.fr>
19516
19517 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
19518 Use %error-verbose.
19519
19520 2001-11-27 Marc Autret <autret_m@epita.fr>
19521
19522 * src/bison.simple: Remove YYERROR_VERBOSE using.
19523 Use %%error_verbose.
19524 (yyparse): Likewise.
19525 * src/output.c (prepare): Give its final value.
19526 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
19527 * src/getargs.h: Add its extern declaration.
19528 * src/getargs.c (error_verbose_flag): New int.
19529 (getargs): Update to catch new case.
19530 * src/options.c (option_table): 'error-verbose' is a new option.
19531 (shortopts): Update.
19532
19533 2001-11-27 Akim Demaille <akim@epita.fr>
19534
19535 * src/system.h: Use intl/libgettext.h.
19536 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
19537
19538 2001-11-27 Akim Demaille <akim@epita.fr>
19539
19540 * tests/torture.at (Exploding the Stack Size with Malloc):
19541 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
19542
19543 2001-11-27 Akim Demaille <akim@epita.fr>
19544
19545 * src/files.c: Include error.h.
19546 Reported by Hans Aberg.
19547
19548 2001-11-26 Marc Autret <autret_m@epita.fr>
19549
19550 * src/reader.c (parse_include_decl): New, not yet implemented.
19551 (read_declarations): Add case tok_include.
19552 * src/getargs.h (include): Add its extern definition.
19553 * src/getargs.c (include): New const char *.
19554 (getargs): Add case '-I'.
19555 * src/options.c (option_table): Add include as command line and
19556 percent option.
19557 * src/lex.h (token_t): Add tok_include.
19558
19559 2001-11-26 Akim Demaille <akim@epita.fr>
19560
19561 * src/reader.c (readgram): Make sure rules for mid-rule actions
19562 have a lineno equal to that of their host rule.
19563 Reported by Hans Aberg.
19564 * tests/regression.at (Rule Line Numbers): New.
19565
19566 2001-11-26 Akim Demaille <akim@epita.fr>
19567
19568 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
19569 size_ts.
19570
19571 2001-11-26 Akim Demaille <akim@epita.fr>
19572
19573 * src/complain.c, src/complain.h (error): Remove, provided by
19574 lib/error.[ch].
19575
19576 2001-11-26 Akim Demaille <akim@epita.fr>
19577
19578 * src/reader.c (read_declarations): Don't abort on tok_illegal,
19579 issue an error message.
19580 * tests/regression.at (Invalid %directive): New.
19581 Reported by Hans Aberg.
19582
19583 2001-11-26 Akim Demaille <akim@epita.fr>
19584
19585 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
19586 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19587
19588 2001-11-26 Akim Demaille <akim@epita.fr>
19589
19590 * src/conflicts.c (conflicts_print): Don't complain at all when
19591 there are no reduce/reduce conflicts, and as many shift/reduce
19592 conflicts as expected.
19593 * tests/regression.at (%expect right): Adjust.
19594
19595 2001-11-23 Akim Demaille <akim@epita.fr>
19596
19597 * lib/alloca.c: Update, from fileutils.
19598
19599 2001-11-23 Akim Demaille <akim@epita.fr>
19600
19601 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
19602
19603 2001-11-23 Akim Demaille <akim@epita.fr>
19604
19605 * src/system.h: Include alloca.h.
19606 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
19607
19608 2001-11-23 Akim Demaille <akim@epita.fr>
19609
19610 * src/print_graph.c (print_actions): Remove `rule', unused.
19611 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
19612 pacify GCC's signed < unsigned warnings.
19613 * src/closure.c (itemsetsize): Likewise.
19614 * src/reader.c (symbol_list_new): Static.
19615
19616 2001-11-23 Akim Demaille <akim@epita.fr>
19617
19618 Attaching lineno to buckets is stupid, since only one copy of each
19619 symbol is kept, only the line of the first occurrence is kept too.
19620
19621 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
19622 * src/reader.c (rline_allocated): Remove, unused.
19623 (symbol_list): Have a `line' member.
19624 (symbol_list_new): New.
19625 (readgram): Use it.
19626 * src/print.c (print_grammar): Output the rule line numbers.
19627 * tests/regression.at (Solved SR Conflicts)
19628 (Unresolved SR Conflicts): Adjust.
19629 Reported by Hans Aberg.
19630
19631 2001-11-22 Marc Autret <autret_m@epita.fr>
19632
19633 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
19634
19635 2001-11-22 Marc Autret <autret_m@epita.fr>
19636
19637 * src/muscle_tab.c (muscle_init): Remove initialization of
19638 skeleton muscle.
19639 * src/output.c (output_master_parser): Do it here.
19640
19641 2001-11-20 Akim Demaille <akim@epita.fr>
19642
19643 * po/sv.po: New.
19644 * configure.in (ALL_LINGUAS): Adjust.
19645 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
19646 longer contains strings to translate.
19647
19648 2001-11-19 Akim Demaille <akim@epita.fr>
19649
19650 * src/conflicts.c (conflicts_print): Add a missing \n.
19651
19652 2001-11-19 Akim Demaille <akim@epita.fr>
19653
19654 * src/nullable.c (nullable_print): New.
19655 (set_nullable): Call it when tracing.
19656 Better locality of variables.
19657
19658 2001-11-19 Akim Demaille <akim@epita.fr>
19659
19660 * src/print.c (print_actions): Better locality of variables.
19661
19662 2001-11-19 Akim Demaille <akim@epita.fr>
19663
19664 * src/derives.c (print_derives): Fix and enrich.
19665 * src/closure.c (print_fderives): Likewise.
19666
19667 2001-11-19 Akim Demaille <akim@epita.fr>
19668
19669 * src/closure.c (itemsetend): Remove, replaced with...
19670 (itemsetsize): new.
19671
19672 2001-11-19 Akim Demaille <akim@epita.fr>
19673
19674 * src/LR0.c (kernel_end): Remove, replaced with...
19675 (kernel_size): new.
19676
19677 2001-11-19 Akim Demaille <akim@epita.fr>
19678
19679 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
19680 to clarify.
19681
19682 2001-11-19 Akim Demaille <akim@epita.fr>
19683
19684 * src/closure.c (closure): Use arrays instead of pointers to clarify.
19685
19686 2001-11-19 Akim Demaille <akim@epita.fr>
19687
19688 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
19689 trace messages.
19690 * src/LR0.c: Likewise.
19691 (allocate_itemsets): Use arrays instead of pointers to clarify.
19692
19693 2001-11-19 Akim Demaille <akim@epita.fr>
19694
19695 * src/getargs.c (statistics_flag): Replace with...
19696 (trace_flag): New.
19697 (longopts): Accept --trace instead of --statistics.
19698 * src/getargs.h, src/options.c: Adjust.
19699 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
19700 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
19701
19702 2001-11-19 Akim Demaille <akim@epita.fr>
19703
19704 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
19705 pointers to clarify the code.
19706 (save_reductions, save_shifts): Factor common parts of alternatives.
19707
19708 2001-11-19 Akim Demaille <akim@epita.fr>
19709
19710 * src/LR0.c (new_state, get_state): Complete TRACE code.
19711 * src/closure.c: Include `reader.h' to get `tags', needed by the
19712 trace code.
19713 Rename the conditional DEBUG as TRACE.
19714 Output consistently TRACEs to stderr, not stdout.
19715 * src/derives.c: Likewise.
19716 * src/reduce.c: (inaccessable_symbols): Using if is better style
19717 than goto.
19718 Use `#if TRACE' instead of `#if 0' for tracing code.
19719
19720 2001-11-19 Akim Demaille <akim@epita.fr>
19721
19722 * src/system.h (LIST_FREE, shortcpy): New.
19723 * src/LR0.c: Use them.
19724 * src/output.c (free_itemsets, free_reductions, free_shifts):
19725 Remove, replaced by LIST_FREE.
19726
19727 2001-11-19 Akim Demaille <akim@epita.fr>
19728
19729 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
19730 (REDUCTIONS_ALLOC): New.
19731 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
19732 allocation.
19733
19734 2001-11-19 Akim Demaille <akim@epita.fr>
19735
19736 * src/LR0.c (new_state): Complete trace code.
19737 * src/nullable.c (set_nullable): Don't translate traces.
19738
19739 2001-11-19 Akim Demaille <akim@epita.fr>
19740
19741 * src/print_graph.c (print_core): Better locality of variables.
19742 * src/print.c (print_core): Likewise.
19743
19744 2001-11-19 Akim Demaille <akim@epita.fr>
19745
19746 * src/vcg.c: You do the output, so you are responsible of the
19747 handling of VCG syntax, in particular: use quotearg.
19748 * src/print_graph.c: Don't.
19749 (print_actions): Don't output the actions as part of the nodes,
19750 since that's the job of the edges.
19751 (print_state): Don't output by hand: fill the node description,
19752 and ask for its output.
19753
19754 2001-11-19 Akim Demaille <akim@epita.fr>
19755
19756 * src/bison.simple (yyparse): When verbosely reporting an error,
19757 no longer put additional quotes around token names.
19758 * tests/calc.at: Adjust.
19759
19760 2001-11-19 Akim Demaille <akim@epita.fr>
19761
19762 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
19763 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
19764 * src/output.c: Adjust.
19765
19766 2001-11-19 Akim Demaille <akim@epita.fr>
19767
19768 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
19769 (rule_t): this.
19770 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
19771
19772 2001-11-19 Akim Demaille <akim@epita.fr>
19773
19774 * src/gram.h (rule_t): New.
19775 (rule_table): New.
19776 (rrhs, rlhs): Remove, part of state_t.
19777 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
19778 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
19779 * src/reader.c, src/reduce.c: Adjust.
19780
19781 2001-11-19 Akim Demaille <akim@epita.fr>
19782
19783 * src/reader.c (symbols_output): New, extracted from...
19784 (packsymbols): Here.
19785 (reader): Call it.
19786
19787 2001-11-19 Akim Demaille <akim@epita.fr>
19788
19789 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
19790 (maxrhs): this new function.
19791
19792 2001-11-19 Akim Demaille <akim@epita.fr>
19793
19794 * src/lalr.c (F): New macro to access the variable F.
19795 Adjust.
19796
19797 2001-11-19 Akim Demaille <akim@epita.fr>
19798
19799 * src/lalr.h (LA): New macro to access the variable LA.
19800 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19801 * src/lalr.c: Adjust.
19802
19803 2001-11-19 Akim Demaille <akim@epita.fr>
19804
19805 * src/lalr.c (initialize_LA): Only initialize LA. Let...
19806 (set_state_table): handle the `lookaheads' members.
19807
19808 2001-11-19 Akim Demaille <akim@epita.fr>
19809
19810 * src/lalr.h (lookaheads): Removed array, whose contents is now
19811 a member of...
19812 (state_t): this structure.
19813 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19814 Adjust.
19815
19816 2001-11-19 Akim Demaille <akim@epita.fr>
19817
19818 * src/lalr.h (consistent): Removed array, whose contents is now
19819 a member of...
19820 (state_t): this structure.
19821 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19822 Adjust.
19823
19824 2001-11-19 Akim Demaille <akim@epita.fr>
19825
19826 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
19827 contents are now members of...
19828 (state_t): this structure.
19829 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19830 Adjust.
19831
19832 2001-11-19 Akim Demaille <akim@epita.fr>
19833
19834 * src/lalr.h (state_t): New.
19835 (state_table): Be a state_t * instead of a core **.
19836 (accessing_symbol): Remove, part of state_t.
19837 * src/lalr.c: Adjust.
19838 (set_accessing_symbol): Merge into...
19839 (set_state_table): this.
19840 * src/print_graph.c, src/conflicts.c: Adjust.
19841
19842 2001-11-14 Akim Demaille <akim@epita.fr>
19843
19844 * tests/calc.at, tests/output.at, tests/regression.at,
19845 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
19846 now the tests are run in private dirs, therefore AC_CLEANUP and
19847 family can be simplified to 0-ary.
19848 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
19849 use abs. path to find config.h.
19850 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
19851 stderr, there can be way too much random noise.
19852 Instead pass -Werror to GCC and rely on the exit status.
19853 Reported by Wolfram Wagner.
19854
19855 2001-11-14 Akim Demaille <akim@epita.fr>
19856
19857 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
19858 defined only if yyoverflow is defined, to avoid `warning: unused
19859 variable `yyvs1''.
19860 Reported by The Test Suite.
19861
19862 2001-11-14 Akim Demaille <akim@epita.fr>
19863
19864 * src/print.c: Include reduce.h.
19865 Reported by Hans Aberg.
19866
19867 2001-11-14 Akim Demaille <akim@epita.fr>
19868
19869 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
19870 Revert a previous patch: these are really const.
19871 * src/conflicts.c (conflict_report): Additional useless pair of
19872 braces to pacify GCC's warnings for `if () if () {} else {}'.
19873 * src/lex.c (parse_percent_token): Replace equal_offset with
19874 arg_offset.
19875 arg is const.
19876 Be sure to strdup `arg' when used, since there is no reason for
19877 token_buffer not to change.
19878
19879 2001-11-14 Akim Demaille <akim@epita.fr>
19880
19881 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
19882 definition.
19883 * src/main.c (main): Use them.
19884 Suggested by Hans Aberg.
19885
19886 2001-11-12 Akim Demaille <akim@epita.fr>
19887
19888 * src/system.h (ngettext): Now that we use ngettext, be sure to
19889 provide a default definition when NLS are not used.
19890
19891 2001-11-12 Akim Demaille <akim@epita.fr>
19892
19893 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
19894 Use @kbd to denote user input.
19895 (Language and Grammar): ANSIfy the example.
19896 Adjust its layout for info/notinfo.
19897 (Location Tracking Calc): Output error messages to stderr.
19898 Output locations in a more GNUtically correct way.
19899 Fix a couple of Englishos.
19900 Adjust @group/@end group pairs.
19901
19902 2001-11-12 Akim Demaille <akim@epita.fr>
19903
19904 %expect was not functioning at all.
19905
19906 * src/conflicts.c (expected_conflicts): Set to -1.
19907 (conflict_report): Use ngettext.
19908 (conflicts_print): Check %expect and make its violation an error.
19909 * doc/bison.texinfo (Expect Decl): Adjust.
19910 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
19911 * tests/regression.at (%expect not enough, %expect right)
19912 (%expect too much): New.
19913
19914 2001-11-12 Akim Demaille <akim@epita.fr>
19915
19916 * tests/regression.at (Conflicts): Rename as...
19917 (Unresolved SR Conflicts): this.
19918 (Solved SR Conflicts): New.
19919
19920 2001-11-12 Akim Demaille <akim@epita.fr>
19921
19922 * src/reduce.c (print_results): Rename as...
19923 (reduce_output): This.
19924 Output to OUT, passed as argument, instead of output_obstack.
19925 (dump_grammar): Likewise.
19926 (reduce_free): New.
19927 Also free V1.
19928 (reduce_grammar): No longer call reduce_output, since...
19929 * src/print.c (print_results): do it.
19930 * src/main.c (main): Call reduce_free;
19931
19932 2001-11-12 Akim Demaille <akim@epita.fr>
19933
19934 * src/conflicts.c (print_reductions): Accept OUT as argument.
19935 Output to it, not to output_obstack.
19936 * src/print.c (print_actions): Adjust.
19937
19938 2001-11-12 Akim Demaille <akim@epita.fr>
19939
19940 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
19941 the result instead of using...
19942 (src_total, rrc_total, src_count, rrc_count): Remove.
19943 (any_conflicts): Remove.
19944 (print_conflicts): Split into...
19945 (conflicts_print, conflicts_output): New.
19946 * src/conflicts.h: Adjust.
19947 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
19948 * src/print.c (print_grammar): Issue `\n' between two rules.
19949 * tests/regression.at (Conflicts): New.
19950 Reported by Tom Lane.
19951
19952 2001-11-12 Akim Demaille <akim@epita.fr>
19953
19954 * tests/regression.at (Invalid input): Remove, duplicate with
19955 ``Invalid input: 1''.
19956
19957 2001-11-12 Akim Demaille <akim@epita.fr>
19958
19959 * tests/torture.at (AT_DATA_STACK_TORTURE)
19960 (Exploding the Stack Size with Alloca)
19961 (Exploding the Stack Size with Malloc): New.
19962
19963 2001-11-12 Akim Demaille <akim@epita.fr>
19964
19965 * src/bison.simple (YYSTACK_REALLOC): New.
19966 (yyparse) [!yyoverflow]: Use it and free the old stack.
19967 Reported by Per Allansson.
19968
19969 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
19970
19971 * src/bison.simple: Define type yystype instead of YYSTYPE, and
19972 define CPP macro, which substitute YYSTYPE by yystype.
19973 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
19974 with yyltype/YYLTYPE. This allows inclusion of the generated
19975 header within the parser if the compiler, such as GGC, accepts
19976 multiple equivalent #defines.
19977 From Akim.
19978
19979 2001-11-05 Akim Demaille <akim@epita.fr>
19980
19981 * src/reader.c (symbols_output): New, extracted from...
19982 (packsymbols): here.
19983 (reader): Adjust.
19984
19985 2001-11-05 Akim Demaille <akim@epita.fr>
19986
19987 * src/lex.c (parse_percent_token): s/quotearg/quote/.
19988
19989 2001-11-05 Akim Demaille <akim@epita.fr>
19990
19991 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
19992 pattern.
19993
19994 2001-11-05 Akim Demaille <akim@epita.fr>
19995
19996 * src/options.h (struct option_table_struct): set_flags is void*.
19997 * src/options.c (longopts): Support `--output' and `%output'.
19998 (usage): Adjust.
19999 * src/lex.h (tok_setopt): Remove, replaced with...
20000 (tok_intopt, tok_stropt): these new guys.
20001 * src/lex.c (getopt.h): Not needed.
20002 (token_buffer, unlexed_token_buffer): Not const.
20003 (percent_table): Promote `-' over `_' in directive names.
20004 Active `%name-prefix', `file-prefix', and `output'.
20005 (parse_percent_token): Accept possible arguments to directives.
20006 Promote `-' over `_' in directive names.
20007
20008 2001-11-04 Akim Demaille <akim@epita.fr>
20009
20010 * doc/bison.texinfo (Decl Summary): Split the list into
20011 `directives for grammars' and `directives for bison'.
20012 Sort'em.
20013 Add description of `%name-prefix', `file-prefix', and `output'.
20014 Promote `-' over `_' in directive names.
20015 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20016 Simplify the description of `--name-prefix'.
20017 Promote `-' over `_' in directive names.
20018 Promote `--output' over `--output-file'.
20019 Fix the description of `--defines'.
20020 * tests/output.at: Exercise %file-prefix and %output.
20021
20022 2001-11-02 Akim Demaille <akim@epita.fr>
20023
20024 * doc/refcard.tex: Update.
20025
20026 2001-11-02 Akim Demaille <akim@epita.fr>
20027
20028 * src/symtab.h (SUNDEF): New.
20029 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20030 stand for `uninitialized', instead of 0.
20031 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20032 * src/lex.c (lex): Adjust.
20033
20034 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20035 Number it 0.
20036 Let yylex return it instead of a plain 0.
20037 Reported by Dick Streefland.
20038
20039 2001-11-02 Akim Demaille <akim@epita.fr>
20040
20041 * tests/regression.at (Mixing %token styles): New test.
20042
20043 2001-11-02 Akim Demaille <akim@epita.fr>
20044
20045 * src/reader.c (parse_thong_decl): Formatting changes.
20046 (token_translations_init): New, extracted from...
20047 (packsymbols): Here.
20048 Adjust.
20049
20050 2001-11-01 Akim Demaille <akim@epita.fr>
20051
20052 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20053 Check that `9foo.y' produces correct cpp guards.
20054 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20055 guards.
20056 Reported by Wwp.
20057
20058 2001-11-01 Akim Demaille <akim@epita.fr>
20059
20060 * tests/regression.at (Invalid input: 2): New.
20061 * src/lex.c (unlexed_token_buffer): New.
20062 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20063 too.
20064 Reported by Wwp.
20065
20066 2001-11-01 Akim Demaille <akim@epita.fr>
20067
20068 * tests/calc.at: Catch up with 1.30.
20069 * configure.in: Bump to 1.49a.
20070 Adjust to newer Autotest.
20071
20072 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
20073
20074 * src/conflicts.c: Move global variables rrc_total and src_total ...
20075 (print_conflicts): here.
20076 * src/output.c (output): Free global variable user_toknums.
20077 * src/lex.c (token_obstack): Become static.
20078
20079 2001-10-18 Akim Demaille <akim@epita.fr>
20080
20081 * tests/atlocal.in (GCC): Add.
20082 * tests/calc.at: s/m4_match/m4_bmatch/.
20083 s/m4_patsubst/m4_bpatsubst/.
20084 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20085 * configure.in: AC_SUBST(GCC).
20086
20087 2001-10-14 Marc Autret <autret_m@epita.fr>
20088
20089 * src/options.c (create_long_option_table): Fix.
20090
20091 2001-10-10 Akim Demaille <akim@epita.fr>
20092
20093 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20094
20095 2001-10-04 Akim Demaille <akim@epita.fr>
20096
20097 * src/reader.c (parse_union_decl): Push the caracters in
20098 union_obstack, not attrs_obstack.
20099
20100 2001-10-04 Akim Demaille <akim@epita.fr>
20101
20102 Merge in the branch 1.29.
20103
20104 * src/reader.c (packsymbols): Use a temporary obstack for
20105 `%%tokendef', since output_stack is already used elsewhere.
20106
20107 2001-10-02 Akim Demaille <akim@epita.fr>
20108
20109 Bump 1.29d.
20110
20111 2001-10-02 Akim Demaille <akim@epita.fr>
20112
20113 Version 1.29c.
20114
20115 2001-10-02 Akim Demaille <akim@epita.fr>
20116
20117 * tests/regression.at (Invalid CPP headers): New.
20118 From Alexander Belopolsky.
20119 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20120
20121 2001-10-02 Akim Demaille <akim@epita.fr>
20122
20123 * tests/regression.at (Invalid input): New.
20124 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20125 Reported by Shura.
20126
20127 2001-10-02 Akim Demaille <akim@epita.fr>
20128
20129 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20130
20131 2001-10-02 Akim Demaille <akim@epita.fr>
20132
20133 * src/output.c (output_parser): Assert `skeleton'.
20134 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20135 systems.
20136 From Shura.
20137
20138 2001-10-01 Marc Autret <autret_m@epita.fr>
20139
20140 * src/lex.h: Echo modifications.
20141 * src/lex.c (unlex): Parameter is now token_t.
20142 From Hans Aberg.
20143
20144 2001-10-01 Marc Autret <autret_m@epita.fr>
20145
20146 * src/main.c: Include lex.h.
20147 From Hans Aberg.
20148
20149 2001-09-29 Akim Demaille <akim@epita.fr>
20150
20151 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
20152
20153 2001-09-28 Akim Demaille <akim@epita.fr>
20154
20155 * tests/testsuite.at: Update to newer Autotest.
20156 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
20157
20158 2001-09-27 Akim Demaille <akim@epita.fr>
20159
20160 Position independent wrapper.
20161
20162 * tests/bison: Remove.
20163 * tests/bison.in: New.
20164 * configure.in: Adjust.
20165
20166 2001-09-27 Paul Eggert <eggert@twinsun.com>
20167
20168 Port quotearg fixes from tar 1.13.24.
20169
20170 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
20171 tm to be declared.
20172 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
20173 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
20174
20175 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
20176 * m4/mbrtowc.m4: New file.
20177 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
20178 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
20179
20180 2001-09-27 Akim Demaille <akim@epita.fr>
20181
20182 Bump to 1.29c.
20183
20184 2001-09-27 Akim Demaille <akim@epita.fr>
20185
20186 Version 1.29b.
20187
20188 2001-09-25 Akim Demaille <akim@epita.fr>
20189
20190 * src/system.h: Include `xalloc.h'.
20191 Remove it from the C files.
20192 * src/files.c (output_files): Free the obstacks.
20193 * src/lex.c (init_lex): Rename as...
20194 (lex_init): this.
20195 (lex_free): New.
20196 * src/main.c (main): Use it.
20197
20198 2001-09-24 Marc Autret <autret_m@epita.fr>
20199
20200 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
20201 to output informations in fout (FILE*).
20202 (open_graph, close_graph): Likewise.
20203 (output_graph, output_edge, output_node): Likewise.
20204 * src/vcg.h: Update function prototypes.
20205 * src/print_graph.c (print_graph): Open output graph file.
20206 (print_actions): Adjust.
20207 * src/files.h: Remove extern declaration.
20208 * src/files.c: Remove graph_obstack declaration.
20209 (open_files): Remove graph_obstack initialization.
20210 (output_files): Remove graph_obstack saving.
20211
20212 2001-09-24 Marc Autret <autret_m@epita.fr>
20213
20214 * src/files.c (compute_output_file_names): Fix.
20215
20216 2001-09-24 Marc Autret <autret_m@epita.fr>,
20217 Akim Demaille <akim@epita.fr>
20218
20219 * src/reader.c (reader): Remove call to free_symtab ().
20220 * src/main.c (main): Call it here.
20221 Include symtab.h.
20222 * src/conflicts.c (initialize_conflicts): Rename as...
20223 (solve_conflicts): this.
20224 * src/print.c (print_core, print_actions, print_state)
20225 (print_grammar): Dump to a file instead a `output_obstack'.
20226 (print_results): Dump `output_obstack', and then proceed with the
20227 FILE *.
20228 * src/files.c (compute_output_file_names, close_files): New.
20229 (output_files): Adjust.
20230 * src/main.c (main): Adjust.
20231
20232 2001-09-23 Marc Autret <autret_m@epita.fr>
20233
20234 * src/files.c (compute_header_macro): Computes header macro name
20235 from spec_defines_file when given.
20236
20237 2001-09-23 Marc Autret <autret_m@epita.fr>
20238
20239 * src/files.c (output_files): Add default extensions.
20240
20241 2001-09-22 Akim Demaille <akim@epita.fr>
20242
20243 * src/conflicts.c (finalize_conflicts): Rename as...
20244 (free_conflicts): this.
20245
20246 2001-09-22 Akim Demaille <akim@epita.fr>
20247
20248 * src/gram.c (gram_free): Rename back as...
20249 (dummy): this.
20250 (output_token_translations): Free `token_translations'.
20251 * src/symtab.c (free_symtab): Free the tag field.
20252
20253 2001-09-22 Akim Demaille <akim@epita.fr>
20254
20255 Remove `translations' as it is always set to true.
20256
20257 * src/gram.h: Adjust.
20258 * src/reader.c (packsymbols, parse_token_decl): Adjust
20259 * src/print.c (print_grammar): Adjust.
20260 * src/output.c (output_token_translations): Adjust.
20261 * src/lex.c (lex): Adjust.
20262 * src/gram.c: Be sure the set pointers to NULL.
20263 (dummy): Rename as...
20264 (gram_free): this.
20265
20266 2001-09-22 Akim Demaille <akim@epita.fr>
20267
20268 * configure.in: Invoke AM_LIB_DMALLOC.
20269 * src/system.h: Use dmalloc.
20270 * src/LR0.c: Be sure to have pointers initialized to NULL.
20271 (allocate_itemsets): Allocate kernel_items only if needed.
20272
20273 2001-09-22 Akim Demaille <akim@epita.fr>
20274
20275 * configure.in: Bump to 1.29b.
20276 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
20277 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
20278 need xmalloc.c in calc.y.
20279 From Pascal Bart.
20280
20281 2001-09-21 Akim Demaille <akim@epita.fr>
20282
20283 Version 1.29a.
20284 * Makefile.maint, config/config.guess, config/config.sub,
20285 * config/missing: Update from masters.
20286 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
20287 upon package.m4.
20288 * configure.in (ALL_LINGUAS): Add `tr'.
20289
20290 2001-09-21 Akim Demaille <akim@epita.fr>
20291
20292 * tests/Makefile.am (package.m4): Move to...
20293 ($(srcdir)/$(TESTSUITE)): here.
20294
20295 2001-09-20 Akim Demaille <akim@epita.fr>
20296
20297 * src/complain.c: No longer try to be standalone: use system.h.
20298 Don't assume __STDC__ is defined to 1. Just test if it is defined.
20299 * src/complain.h: Likewise.
20300 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
20301 Remove the unused variable `n'.
20302 From Albert Chin-A-Young.
20303
20304 2001-09-18 Marc Autret <autret_m@epita.fr>
20305
20306 * doc/bison.1: Update.
20307 * doc/bison.texinfo (Bison Options): Update --defines and --graph
20308 descriptions.
20309 (Option Cross Key): Update.
20310 Add --graph.
20311
20312 2001-09-18 Marc Autret <autret_m@epita.fr>
20313
20314 * tests/regression.at: New test (comment in %union).
20315
20316 2001-09-18 Marc Autret <autret_m@epita.fr>
20317
20318 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
20319 do that.
20320 Reported by Keith Browne.
20321
20322 2001-09-18 Marc Autret <autret_m@epita.fr>
20323
20324 * tests/output.at: Add tests for --defines and --graph.
20325
20326 2001-09-18 Marc Autret <autret_m@epita.fr>
20327
20328 * tests/output.at: Removes tests of %{header,src}_extension features.
20329
20330 2001-09-18 Akim Demaille <akim@epita.fr>
20331
20332 * tests/Makefile.am (package.m4): New.
20333 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
20334 (_AT_CHECK_CALC_ERROR): Likewise.
20335 Factor the `, ' part of verbose error messages.
20336
20337 2001-09-18 Marc Autret <autret_m@epita.fr>
20338
20339 * src/getargs.c (longopts): Declare --defines and --graph as options
20340 with optional arguments.
20341 * src/files.h: Add extern declarations.
20342 * src/files.c (spec_graph_file, spec_defines_file): New.
20343 (output_files): Update.
20344 Remove CPP-outed code.
20345
20346 2001-09-18 Marc Autret <autret_m@epita.fr>
20347
20348 Turn off %{source,header}_extension feature.
20349
20350 * src/files.c (compute_exts_from_gf): Update.
20351 (compute_exts_from_src): Update.
20352 (output_files): CPP-out useless code.
20353 * src/files.h: Remove {header,source}_extension extern declarations.
20354 * src/reader.c (parse_dquoted_param): CPP-out.
20355 (parse_header_extension_decl): Remove.
20356 (parse_source_extension_decl): Remove.
20357 (read_declarations): Remove cases tok_{hdrext,srcext}.
20358 * src/lex.c (percent_table): Remove {header,source}_extension entries.
20359 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
20360
20361 2001-09-10 Akim Demaille <akim@epita.fr>
20362
20363 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
20364 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
20365 (AT_CHECK_OUTPUT): this.
20366 Merely check ls' exit status, its output is useless.
20367
20368 2001-09-10 Akim Demaille <akim@epita.fr>
20369
20370 * tests/calc.at: Use m4_match.
20371 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
20372
20373 2001-09-10 Marc Autret <autret_m@epita.fr>,
20374 Akim Demaille <akim@epita.fr>
20375
20376 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
20377 enum color_e.
20378 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
20379 to `normal'.
20380 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
20381 * src/lex.h: Adjust prototype.
20382 (token_t): Add `tok_undef'.
20383 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
20384 (parse_percent_token): Now returns token_t.
20385 Add default statement in switch.
20386 (lex): Separate `c' as an input variable, from the token_t result
20387 part.
20388 (unlexed): Is a token_t.
20389
20390 2001-09-10 Akim Demaille <akim@epita.fr>
20391
20392 * configure.in: Bump to 1.29a.
20393
20394 2001-09-07 Akim Demaille <akim@epita.fr>
20395
20396 Version 1.29.
20397
20398 2001-08-30 Akim Demaille <akim@epita.fr>
20399
20400 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
20401 * m4/atconfig.m4: Remove.
20402 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
20403 * tests/bison: New.
20404 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
20405 m4_if, m4_patsubst, and m4_regexp.
20406 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
20407 `input' file instead of echo.
20408
20409 2001-08-29 Akim Demaille <akim@epita.fr>
20410
20411 Bump to 1.28e.
20412
20413 2001-08-29 Akim Demaille <akim@epita.fr>
20414
20415 Version 1.28d.
20416
20417 2001-08-29 Paul Eggert <eggert@twinsun.com>
20418
20419 * src/bison.simple (yyparse): Don't take the address of an
20420 item before the start of an array, as that doesn't conform to
20421 the C Standard.
20422
20423 2001-08-29 Robert Anisko <anisko_r@epita.fr>
20424
20425 * doc/bison.texinfo (Location Tracking Calc): New node.
20426
20427 2001-08-29 Paul Eggert <eggert@twinsun.com>
20428
20429 * src/output.c (output): Do not define const, as this now
20430 causes more problems than it cures.
20431
20432 2001-08-29 Akim Demaille <akim@epita.fr>
20433
20434 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
20435 the nodes.
20436 Be sure to tag the `detailmenu'.
20437
20438 2001-08-29 Akim Demaille <akim@epita.fr>
20439
20440 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
20441 download in a tmp dir.
20442
20443 2001-08-28 Marc Autret <autret_m@epita.fr>
20444
20445 * config/depcomp: New file.
20446
20447 2001-08-28 Marc Autret <autret_m@epita.fr>
20448
20449 * doc/bison.1 (mandoc): Adjust.
20450 From Juan Manuel Guerrero.
20451
20452 2001-08-28 Marc Autret <autret_m@epita.fr>
20453
20454 * src/print_graph.c (print_state): Fix.
20455
20456 2001-08-27 Marc Autret <autret_m@epita.fr>
20457
20458 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
20459 char * members.
20460 Echo modifications to the functions prototypes.
20461 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
20462
20463 2001-08-27 Marc Autret <autret_m@epita.fr>
20464
20465 * src/vcg.c: Include `xalloc.h'.
20466 (add_colorentry): New.
20467 (add_classname): New.
20468 (add_infoname): New.
20469 * src/vcg.h: Add new prototypes.
20470
20471 2001-08-27 Akim Demaille <akim@epita.fr>
20472
20473 * Makefile.maint: Sync. again with CVS Autoconf.
20474
20475 2001-08-27 Akim Demaille <akim@epita.fr>
20476
20477 * Makefile.maint: Formatting changes.
20478 (po-update, cvs-update, update): New targets.
20479 (AMTAR): Remove.
20480
20481 2001-08-27 Akim Demaille <akim@epita.fr>
20482
20483 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20484 * Makefile.maint: Sync. with CVS Autoconf.
20485
20486 2001-08-27 Marc Autret <autret_m@epita.fr>
20487
20488 * src/vcg.h (struct infoname_s): New.
20489 (struct colorentry_s): New.
20490 (graph_s): New fields {vertical,horizontal}_order in structure.
20491 Add `infoname' field.
20492 Add `colorentry' field;
20493 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
20494 (G_HORIZONTAL_ORDER): New.
20495 (G_INFONAME): New.
20496 (G_COLORENTRY): New.
20497 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
20498 Add output of `infoname'.
20499 Add output of `colorentry'.
20500
20501 2001-08-27 Marc Autret <autret_m@epita.fr>
20502
20503 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
20504 This one shadowed a global parameter.
20505
20506 2001-08-24 Marc Autret <autret_m@epita.fr>
20507
20508 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
20509 instead of `unsigned'.
20510 (print_state): Do not call obstack_object_size () in obstack_grow ()
20511 to avoid macro variables shadowing.
20512
20513 2001-08-23 Marc Autret <autret_m@epita.fr>
20514
20515 * src/lex.c (percent_table): Typo: s/naem/name/.
20516 Add graph option.
20517 Normalize new options declarations.
20518
20519 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
20520
20521 * tests/suite.at: Exercise %header_extension and %source_extension.
20522
20523 2001-08-16 Marc Autret <autret_m@epita.fr>
20524
20525 * src/reader.c (parse_dquoted_param): New.
20526 (parse_header_extension_decl): Use it.
20527 (parse_source_extension_decl): Likewise.
20528
20529 2001-08-16 Marc Autret <autret_m@epita.fr>
20530
20531 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
20532 (get_xxxx_str): Use assert () instead of complain ().
20533 Remove return invokations in default cases.
20534 (get_decision_str): Modify default behaviour. Remove second argument.
20535 Echo modifications on calls.
20536 (output_graph): Fix.
20537
20538 2001-08-16 Marc Autret <autret_m@epita.fr>
20539
20540 * src/getargs.c (usage): Update with ``-g, --graph''.
20541
20542 2001-08-16 Marc Autret <autret_m@epita.fr>
20543
20544 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
20545 (Option Cross Key): Likewise.
20546 * doc/bison.1: Update.
20547
20548 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
20549
20550 * src/output.c (output_master_parser): Don't finish action_obstack.
20551 (output_parser): Don't care about the muscle action, here.
20552 (prepare): Copy the action_obstack in the action muscle.
20553 (output): Free action_obstack.
20554
20555 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20556
20557 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
20558 will contain `%union' declaration.
20559 (parse_union_decl): Delete #line directive output.
20560 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
20561 informations about %union.
20562 (parse_union_decl): Copy the union_obstack in the muscle stype.
20563 * src/bison.simple: Add new #line directive.
20564 Add typdef %%stype YYSTYPE.
20565
20566 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
20567
20568 * src/bison.simple: Add new `#line' directive.
20569
20570 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
20571
20572 * src/bison.simple: New `#line' directive.
20573 * src/output.c (output_parser): Support new dynamic muscle input_line.
20574
20575 2001-09-22 Marc Autret <autret_m@epita.fr>
20576
20577 * src/output.c (output_master_parser): New.
20578 (output_parser): Be more re-entrant.
20579
20580 2001-09-21 Marc Autret <autret_m@epita.fr>
20581
20582 * src/reader.c (copy_definition, parse_union_decl): Update and use
20583 `linef' muscle.
20584 (copy_action): Likewise.
20585 Use obstack_1grow ().
20586 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
20587
20588 2001-09-21 Marc Autret <autret_m@epita.fr>
20589
20590 * src/options.c (option_table): Adjust.
20591 * src/lex.c (parse_percent_token): Fix.
20592
20593 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20594
20595 * src/options.c (symtab.h): Include it, need by lex.h.
20596
20597 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
20598
20599 * src/lex.c (parse_percent_token): Change type of variable `tx', which
20600 is now an option_table_struct*.
20601 (option_strcmp): New function option_strcmp.
20602 (parse_percent_token): Call option_strcmp.
20603 * src/getargs.c (xalloc.h, options.h): Include it.
20604 (getargs): Call create_long_option_table.
20605 (getargs): Free longopts at the end of the function.
20606 (shortopts): Move in options.c.
20607 * src/options.c (create_long_option_table): New function. Convert
20608 information from option_table to option structure.
20609 * src/reader.c (options.h): Include it.
20610
20611 * src/Makefile.am: Adjust.
20612 * src/options.c (option_table): Create from longopts and percent_table.
20613 * src/getargs.c (longopts): Delete.
20614 * src/lex.c (struct percent_table_struct): Delete.
20615 (percent_table): Delete.
20616 (options.h): Include it.
20617 * src/options.c: Create.
20618 * src/options.h: Create.
20619 Declare enum opt_access_e.
20620 Define struct option_table_struct.
20621
20622 2001-09-20 Marc Autret <autret_m@epita.fr>
20623
20624 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
20625 sections of Bison.
20626
20627 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
20628
20629 * src/bison.simple: s/%%filename/%%skeleton.
20630 * src/muscle_tab.c (getargs.h): Include it.
20631 (muscle_init): Insert new muscle skeleton.
20632
20633 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
20634
20635 * src/output.c (output_parser): Delete unused variable actions_dumped.
20636
20637 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
20638
20639 * src/output.c (output): Delete call to reader_output_yylsp.
20640 * src/reader.c (reader): Likewise.
20641 * src/reader.h: Delete declaration of reader_output_yylsp.
20642
20643 2001-09-02 Marc Autret <autret_m@epita.fr>
20644
20645 * src/reader.c: Include muscle_tab.h.
20646 (parse_union_decl): Update.
20647 (parse_macro_decl): Rename parse_muscle_decl.
20648 Update to use renamed functions and variable.
20649 (read_declarations, copy_action, read_additionnal_code, : Updated
20650 with correct variables and functions names.
20651 (packsymbols, reader): Likewise.
20652
20653 * src/reader.h (muscle_obstack): Extern declaration update.
20654
20655 * src/output.c: Include muscle_tab.h
20656 In all functions using macro_insert, change by using muscle_insert ().
20657 (macro_obstack): Rename muscle_obstack.
20658 Echo modifications in the whole file.
20659 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
20660 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
20661 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
20662
20663 * src/muscle_tab.h: Update double inclusion macros.
20664 (macro_entry_s): Rename muscle_entry_s.
20665 Update prototypes.
20666
20667 * src/muscle_tab.c: Include muscle_tab.h.
20668 Rename macro_tabble to muscle_table.
20669 (mhash1, mhash2, mcmp): Use muscle_entry.
20670 (macro_init): Rename muscle_init. Update.
20671 (macro_insert): Rename muscle_insert. Update.
20672 (macro_find): Rename muscle_find. Update.
20673
20674 * src/main.c: Include muscle_tab.h.
20675 (main): Call muscle_init ().
20676 * src/Makefile.am (bison_SOURCES): Echo modifications.
20677
20678 2001-09-02 Marc Autret <autret_m@epita.fr>
20679
20680 Now the files macro_tab.[ch] are named muscle_tab.[ch].
20681
20682 * src/muscle_tab.c, src/muscle_tab.h: Add files.
20683
20684 2001-09-02 Marc Autret <autret_m@epita.fr>
20685
20686 * src/macrotab.c, src/macrotab.h: Remove.
20687
20688 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
20689
20690 * src/reader.c (copy_guard): Use muscle to specify the `#line'
20691 filename.
20692
20693 2001-09-01 Marc Autret <autret_m@epita.fr>
20694
20695 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
20696 to an explicit value to activate the feature. We do it here.
20697
20698 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20699
20700 * src/output.c (prepare): Delete the `filename' muscule insertion.
20701 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
20702 (parse_union_decl): Likewise.
20703 * src/macrotab.c (macro_init): Initialize filename by infile.
20704
20705 2001-08-31 Marc Autret <autret_m@epita.fr>
20706
20707 * src/bison.simple (YYLSP_NEEDED): New definition.
20708 * src/output.c (prepare): Add macro insertion of `locations_flag'
20709
20710 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20711
20712 * src/output.c (prepare): Delete insertion of previous muscles,
20713 and insert the `prefix' muscles.
20714 * src/macrotab.c (macro_init): Likewise.
20715 (macro_init): Initialization prefix directive by `yy'.
20716 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
20717 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
20718 yylval, yydebug, yyerror, yynerrs and yyparse.
20719 New directive `#define' to substitute yydebug, ... with option
20720 name_prefix.
20721
20722 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20723
20724 * src/main.c (main): Standardize.
20725 * src/output.c (output_table_data, output_parser): Likewise.
20726 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
20727
20728 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
20729
20730 * src/reader.c (read_additionnal_code): Rename %%user_code to
20731 %%epilogue.
20732 * src/output.c (output): Rename %%declarations to %%prologue.
20733 * src/bison.simple: Echo modifications.
20734
20735 2001-08-31 Marc Autret <autret_m@epita.fr>
20736
20737 * src/reader.c (readgram): CleanUp.
20738 (output_token_defines): Likewise.
20739 (packsymbols): Likewise.
20740 (reader): Likewise.
20741 * src/output.c (output): CPP-out useless code.
20742
20743 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
20744
20745 * src/reader.c (reader): Delete obsolete call to function
20746 output_trailers and output_headers.
20747 * src/output.h: Remove obsolete functions prototypes of output_headers
20748 and output_trailers.
20749
20750 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
20751
20752 * src/main.c: Include macrotab.h.
20753 * src/macrotab.h (macro_entry_s): Constify fields.
20754 Adjust functions prototypes.
20755 * src/macrotab.c (macro_insert): Constify key and value.
20756 (macro_find): Constify key.
20757 (macro_insert): Include 'xalloc.h'
20758 (macro_insert): Use XMALLOC.
20759 (macro_find): Constify return value.
20760 * src/output.c (output_table_data): Rename table to table_data.
20761 (output_parser): Constify macro_key, macro_value.
20762
20763 2001-08-30 Marc Autret <autret_m@epita.fr>
20764
20765 * src/reader.c (parse_skel_decl): New.
20766 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
20767 * src/lex.h (token_t): New token `tok_skel'.
20768 * src/lex.c (percent_table): Add skeleton option entry.
20769 Standardize.
20770
20771 2001-08-29 Marc Autret <autret_m@epita.fr>
20772
20773 * src/bison.simple: Add %%user_code directive at the end.
20774 * src/reader.c (read_additionnal_code): New.
20775 (reader): Use it.
20776 * src/output.c (output_program): Remove.
20777 (output): Update.
20778
20779 2001-08-28 Marc Autret <autret_m@epita.fr>
20780
20781 * src/output.c (output_actions): Clean up.
20782 (output_gram): CPP-out useless code.
20783 * src/reader.c (reader): Clean up, CPP-out useless code.
20784
20785 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
20786
20787 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
20788 directive.
20789 * src/bison.simple: Add `%%definitions'.
20790
20791 2001-08-28 Marc Autret <autret_m@epita.fr>
20792
20793 * config/depcomp: New file.
20794
20795 2001-08-27 Paul Eggert <eggert@twinsun.com>
20796
20797 * src/bison.simple (yyparse): Don't take the address of an
20798 item before the start of an array, as that doesn't conform to
20799 the C Standard.
20800
20801 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20802
20803 * src/output.c (output): Remove the initialization of the macro
20804 obstack. It was done too late here.
20805
20806 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
20807 completely wrong.
20808 (reader): Initialize the macro obstack here, since we need it to grow
20809 '%define' directives.
20810
20811 * src/reader.h: Declare the macro obstack as extern.
20812
20813 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
20814
20815 * src/output.c (output_parser): Fix. Store single '%' characters in
20816 the output obstack instead of throwing them away.
20817
20818 2001-08-27 Akim Demaille <akim@epita.fr>
20819
20820 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20821
20822 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20823
20824 * lib/Makefile.am: Adjust.
20825
20826 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20827
20828 * src/bison.simple: Update and add '%%' directives.
20829
20830 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20831
20832 * src/reader.c (reader): Remove calls to 'output_headers' and
20833 'output_trailers'. Remove some C output.
20834 (readgram): Disable a piece of code that was writing a default
20835 definition for 'YYSTYPE'.
20836 (reader_output_yylsp): Remove.
20837 (packsymbols): Output token defintions to a macro.
20838 (copy_definition): Disable C output.
20839
20840 * src/reader.c (parse_macro_decl): New function used to parse macro
20841 declarations.
20842 (copy_string2): Put the body of copy_string into this new function.
20843 Add a parameter to let the caller choose whether he wants to copy the
20844 string delimiters or not.
20845 (copy_string): Be a simple call to copy_string2 with the last argument
20846 bound to true.
20847 (read_declarations): Add case for macro definition.
20848 (copy_identifier): New.
20849 (parse_macro_decl): Read macro identifiers using copy_identifier
20850 rather than lex.
20851
20852 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20853
20854 * src/output.c (prepare): Add prefixed names.
20855 (output_parser): Output semantic actions.
20856 (output_parser): Fix bug on '%%line' directives.
20857
20858 * src/output.c (output_headers): Remove. The C code printed by this
20859 function should now be in the skeletons.
20860 (output_trailers): Remove.
20861 (output): Disable call to 'reader_output_yylsp'.
20862 (output_rule_data): Do not output tables to the table obstack.
20863
20864 * src/output.c: Remove some C dedicated output.
20865 Improve the use of macro and output obstacks.
20866 (output_defines): Remove.
20867
20868 * src/output.c (output_token_translations): Associate 'translate'
20869 table with a macro. No output to the table obstack.
20870 (output_gram): Same for 'rhs' and 'prhs'.
20871 (output_stos): Same for 'stos'.
20872 (output_rule_data): Same for 'r1' and 'r2'.
20873 (token_actions): Same for 'defact'.
20874 (goto_actions): Same for 'defgoto'.
20875 (output_base): Same for 'pact' and 'pgoto'.
20876 (output_table): Same for 'table'.
20877 (output_check): Same for 'check'.
20878
20879 * src/output.c (output_table_data): New function.
20880 (output_short_table): Remove.
20881 (output_short_or_char_table): Remove.
20882
20883 * src/output.c (output_parser): Replace most of the skeleton copy code
20884 with something new. Skeletons are now processed character by character
20885 rather than line by line, and Bison looks for '%%' macros. This is the
20886 first step in making Bison's output process (a lot) more flexible.
20887 (output_parser): Use the macro table.
20888
20889 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20890
20891 * src/main.c (main): Initialize the macro table.
20892
20893 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20894
20895 * src/lex.c (percent_table): Add tok_define.
20896 * src/lex.h: Add tok_define.
20897
20898 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20899
20900 * src/macrotab.c: New file.
20901 * src/macrotab.h: New file.
20902 * src/Makefile.am: Update.
20903
20904 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
20905
20906 * lib/hash.c: New file.
20907 * lib/hash.h: New file.
20908 * lib/Makefile.am: Update.
20909
20910 2001-08-15 Akim Demaille <akim@epita.fr>
20911
20912 Version 1.28c.
20913
20914 2001-08-15 Marc Autret <autret_m@epita.fr>
20915
20916 * src/reader.c (readgram): Indent output macro YYSTYPE.
20917 (packsymbols): Likewise.
20918 (output_token_defines): Likewise.
20919 * src/files.c: Standardize.
20920 (compute_header_macro): New.
20921 (defines_obstack_save): New. Use compute_header_macro.
20922 (output_files): Update. Use defines_obstack_save.
20923
20924 2001-08-15 Akim Demaille <akim@epita.fr>
20925
20926 * doc/bison.texinfo (Table of Symbols): Document
20927 YYSTACK_USE_ALLOCA.
20928
20929 2001-08-15 Akim Demaille <akim@epita.fr>
20930
20931 * missing: Update from CVS Automake.
20932 * config/config.guess, config/config.sub, config/texinfo.tex:
20933 Update from gnu.org.
20934
20935 2001-08-15 Akim Demaille <akim@epita.fr>
20936
20937 * Makefile.maint: Sync with CVS Autoconf.
20938
20939 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
20940
20941 * doc/bison.texinfo: Include GNU Free Documentation License from
20942 `fdl.texi'.
20943 * doc/fdl.texi: Add to package.
20944
20945 2001-08-14 Marc Autret <autret_m@epita.fr>
20946
20947 Turn on %{source,header}_extension features.
20948
20949 * src/lex.c (percent_table): Un-CPP out header_extension and
20950 source_extension.
20951 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
20952 (compute_exts_from_src): Remove conditions. It restores priorities
20953 between options.
20954
20955 2001-08-14 Marc Autret <autret_m@epita.fr>
20956
20957 * src/files.c (compute_base_names): Add extensions computing when
20958 `--file-prefix' used.
20959 Standardize function calls.
20960
20961 2001-08-13 Marc Autret <autret_m@epita.fr>
20962
20963 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
20964 defining it (defined but null disables alloca).
20965
20966 2001-08-13 Marc Autret <autret_m@epita.fr>
20967
20968 * src/bison.simple (_yy_memcpy): CPP reformat.
20969
20970 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
20971
20972 * tests/atconfig.in (CPPFLAGS): Fix.
20973
20974 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
20975
20976 * doc/bison.texinfo: Include GNU General Public License from
20977 `gpl.texi'.
20978 * doc/gpl.texi: Add to package.
20979
20980 2001-08-10 Marc Autret <autret_m@epita.fr>
20981
20982 * src/print_graph.h: Fix.
20983 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
20984
20985 2001-08-10 Akim Demaille <akim@epita.fr>
20986
20987 * src/system.h: Provide default declarations for stpcpy, strndup,
20988 and strnlen.
20989
20990 2001-08-10 Robert Anisko <anisko_r@epita.fr>
20991
20992 * doc/bison.texinfo (Locations): Update @$ stuff.
20993
20994 2001-08-09 Robert Anisko <anisko_r@epita.fr>
20995
20996 * src/bison.simple (YYLLOC_DEFAULT): Update.
20997 (yyparse): Adjust.
20998
20999 2001-08-08 Marc Autret <autret_m@epita.fr>
21000
21001 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
21002 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21003 Reported by Fabrice Bauzac.
21004
21005 2001-08-08 Marc Autret <autret_m@epita.fr>
21006
21007 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21008 * src/vcg.c (output_node): Fix.
21009 * src/vcg.h: Cleanup.
21010 * src/print_graph.c: Add comments.
21011 (node_output_size): New global variable. Simplify the formatting of
21012 the VCG graph output.
21013 (print_actions): Unused code is now used. It notifies the final state
21014 and no action states in the VCG graph. It also give the reduce actions.
21015 The `shift and goto' edges are red and the `go to state' edges are
21016 blue.
21017 Get the current node name and node_obstack by argument.
21018 (node_obstack): New variable.
21019 (print_state): Manage node_obstack.
21020 (print_core): Use node_obstack given by argument.
21021 A node is not only computed here but in print_actions also.
21022 (print_graph): CPP out useless code instead of commenting it.
21023
21024 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
21025
21026 * tests/atconfig.in (CPPFLAGS): Fix.
21027
21028 2001-08-07 Akim Demaille <akim@epita.fr>
21029
21030 * src/print_graph.c (quote): New.
21031 (print_core): Use it.
21032
21033 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
21034
21035 * src/vcg.c (complain.h): Include it.
21036 Unepitaize `return' invocations.
21037 [NDEBUG] (main): Remove.
21038 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
21039 * src/files.c (open_files): Initialize graph_obstack.
21040 * src/print_graph.c (print_actions): CPP out useless code.
21041 (print_core): Don't output the last `\n' in labels.
21042 Use `quote'.
21043 * src/files.c (output_files): Output the VCG file.
21044 * src/main.c (main): Invoke print_graph ();
21045
21046 2001-08-06 Marc Autret <autret_m@epita.fr>
21047
21048 Automaton VCG graph output.
21049 Using option ``-g'' or long option ``--graph'', you can generate
21050 a gram_filename.vcg file containing a VCG description of the LALR (1)
21051 automaton of your grammar.
21052
21053 * src/main.c: Call to print_graph() function.
21054 * src/getargs.h: Update.
21055 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21056 (graph_flag): New flag.
21057 (longopts): Update.
21058 (getargs): Add case `g'.
21059 * src/files.c (graph_obstack): New obstack struct.
21060 (open_files): Initialize new obstack.
21061 (output_files): Saves graph_obstack if required.
21062 * src/files.h (graph_obstack): New extern declaration.
21063 * src/Makefile.am: Add new source files.
21064
21065 2001-08-06 Marc Autret <autret_m@epita.fr>
21066
21067 * src/print_graph.c, src/print_graph.h (graph): New.
21068 * src/vcg.h: New file.
21069 * src/vcg.c: New file, VCG graph handling.
21070
21071 2001-08-06 Marc Autret <autret_m@epita.fr>
21072
21073 Add of %source_extension and %header_extension which specify
21074 the source or/and the header output file extension.
21075
21076 * src/files.c (compute_base_names): Remove initialisation of
21077 src_extension and header_extension.
21078 (compute_exts_from_gf): Update.
21079 (compute_exts_from_src): Update.
21080 (output_files): Update.
21081 * src/reader.c (parse_header_extension_decl): New.
21082 (parse_source_extension_decl): New.
21083 (read_declarations): New case statements for the new tokens.
21084 * src/lex.c (percent_table): Add entries for %source_extension
21085 and %header_extension.
21086 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21087
21088 2001-08-06 Marc Autret <autret_m@epita.fr>
21089
21090 * configure.in: Bump to 1.28c.
21091 * doc/bison.texinfo: Texinfo thingies.
21092
21093 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
21094
21095 * tests/atconfig.in (CPPFLAGS): Add.
21096 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21097
21098 2001-08-03 Akim Demaille <akim@epita.fr>
21099
21100 Version 1.28b.
21101
21102 2001-08-03 Akim Demaille <akim@epita.fr>
21103
21104 * tests/Makefile.am (check-local): Ship testsuite.
21105 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21106 Include `string.h'.
21107
21108 2001-08-03 Akim Demaille <akim@epita.fr>
21109
21110 * configure.in: Try using -Wformat when compiling.
21111
21112 2001-08-03 Akim Demaille <akim@epita.fr>
21113
21114 * configure.in: Bump to 1.28b.
21115
21116 2001-08-03 Akim Demaille <akim@epita.fr>
21117
21118 * src/complain.c: Adjust strerror_r portability issues.
21119
21120 2001-08-03 Akim Demaille <akim@epita.fr>
21121
21122 Version 1.28a.
21123
21124 2001-08-03 Akim Demaille <akim@epita.fr>
21125
21126 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21127 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21128 * src/getargs.c: Include complain.h.
21129 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21130 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21131
21132 2001-08-03 Akim Demaille <akim@epita.fr>
21133
21134 * src/reader.c (readgram): Display hidden chars in error messages.
21135
21136 2001-08-03 Akim Demaille <akim@epita.fr>
21137
21138 Update to gettext 0.10.39.
21139
21140 2001-08-03 Akim Demaille <akim@epita.fr>
21141
21142 * lib/strspn.c: New.
21143
21144 2001-08-01 Marc Autret <autret_m@epita.fr>
21145
21146 * doc/bison.texinfo: Update.
21147 * doc/bison.1 (mandoc): Update.
21148 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
21149 * src/files.c: Support output files extensions computing.
21150 (src_extension): New static variable.
21151 (header_extension): New static variable.
21152 (tr): New function.
21153 (get_extension_index): New function, gets the index of an extension
21154 filename in a string.
21155 (compute_exts_from_gf): New function, computes extensions from the
21156 grammar file extension.
21157 (compute_exts_from_src): New functions, computes extensions from the
21158 C source file extension, file given by ``-o'' option.
21159 (compute_base_names): Update.
21160 (output_files): Update.
21161
21162 2001-08-01 Robert Anisko <anisko_r@epita.fr>
21163
21164 * doc/bison.texi: Document @$.
21165 (Locations): New section.
21166
21167 2001-07-18 Akim Demaille <akim@epita.fr>
21168
21169 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
21170 * config/prev-version.txt, config/move-if-change: New.
21171 * Makefile.am: Adjust.
21172
21173 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
21174
21175 * src/bison.simple (yyparse): Suppress warning `comparaison
21176 between signed and unsigned'.
21177
21178 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
21179
21180 * src/getargs.h (raw_flag): Remove.
21181 * src/getargs.c: Die on `-r'/`--raw'.
21182 * src/lex.c (parse_percent_token): Die on `%raw'.
21183 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
21184 * tests/calc.at: Suppress test with option `--raw'.
21185
21186 2001-07-14 Akim Demaille <akim@epita.fr>
21187
21188 * config/: New.
21189 * configure.in: Require Autoconf 2.50.
21190 Update to gettext 0.10.38.
21191
21192 2001-03-16 Akim Demaille <akim@epita.fr>
21193
21194 * doc/bison.texinfo: ANSIfy the examples.
21195
21196 2001-03-16 Akim Demaille <akim@epita.fr>
21197
21198 * getargs.c (skeleton): New variable.
21199 (longopts): --skeleton is a new option.
21200 (shortopts, getargs): -S is a new option.
21201 * getargs.h: Declare skeleton.
21202 * output.c (output_parser): Use it.
21203
21204 2001-03-16 Akim Demaille <akim@epita.fr>
21205
21206 * m4/strerror_r.m4: New.
21207 * m4/error.m4: Run AC_FUNC_STRERROR_R.
21208 * lib/error.h, lib/error.c: Update.
21209
21210 2001-03-16 Akim Demaille <akim@epita.fr>
21211
21212 * src/getargs.c (longopts): Clean up.
21213
21214 2001-02-21 Akim Demaille <akim@epita.fr>
21215
21216 * src/reader.c (gensym): `gensym_count' is your own.
21217 Use a static buf to create the symbol name, as token_buffer is no
21218 longer a buffer.
21219
21220 2001-02-08 Akim Demaille <akim@epita.fr>
21221
21222 * src/conflicts.c (conflict_report): Be sure not to append to res
21223 between two calls, which could happen if both first sprintf were
21224 skipped, but not the first cp += strlen.
21225
21226 2001-02-08 Akim Demaille <akim@epita.fr>
21227
21228 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
21229 New, from fileutils 4.0.37.
21230 * configure.in: Require Autoconf 2.49c. I took some time before
21231 making this decision. This is the only way out for portability
21232 issues in Bison, it would mean way too much duplicate effort to
21233 import in Bison features implemented in 2.49c since 2.13.
21234 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
21235
21236 2001-02-02 Akim Demaille <akim@epita.fr>
21237
21238 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
21239 * lib/xalloc.h, lib/xmalloc.c: Update.
21240
21241 2001-01-19 Akim Demaille <akim@epita.fr>
21242
21243 Get rid of the ad hoc handling of token_buffer in the scanner: use
21244 the obstacks.
21245
21246 * src/lex.c (token_obstack): New.
21247 (init_lex): Initialize it. No longer call...
21248 (grow_token_buffer): this. Remove it.
21249 Adjust all the places which used it to use the obstack.
21250
21251 2001-01-19 Akim Demaille <akim@epita.fr>
21252
21253 * src/lex.h: Rename all the tokens:
21254 s/\bENDFILE\b/tok_eof/g;
21255 s/\bIDENTIFIER\b/tok_identifier/g;
21256 etc.
21257 Let them be enums, not #define, to ease debugging.
21258 Adjust all the code.
21259
21260 2001-01-18 Akim Demaille <akim@epita.fr>
21261
21262 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
21263 * src/lex.c (maxtoken, grow_token_buffer): Static.
21264
21265 2001-01-18 Akim Demaille <akim@epita.fr>
21266
21267 Since we now use obstacks, more % directives can be enabled.
21268
21269 * src/lex.c (percent_table): Also accept `%yacc',
21270 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
21271 `%debug'.
21272 Handle the actions for `%semantic_parser' and `%pure_parser' here,
21273 instead of returning a token.
21274 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
21275 * src/reader.c (read_declarations): Adjust.
21276 * src/files.c (open_files): Don't call `compute_base_names', don't
21277 compute `attrsfile' since they depend upon data which might be
21278 *in* the input file now.
21279 (output_files): Do it here.
21280 * src/output.c (output_headers): Document the fact that this patch
21281 introduces a guaranteed SEGV for semantic parsers.
21282 * doc/bison.texinfo: Document them.
21283 * tests/suite.at: Exercise these %options.
21284
21285 2000-12-20 Akim Demaille <akim@epita.fr>
21286
21287 Also handle the output file (--verbose) with obstacks.
21288
21289 * files.c (foutput): Remove.
21290 (output_obstack): New.
21291 Adjust all dependencies.
21292 * src/conflicts.c: Return a string.
21293 * src/system.h (obstack_grow_string): Rename as...
21294 (obstack_sgrow): this. Be ready to work with non literals.
21295 (obstack_fgrow4): New.
21296
21297 2000-12-20 Akim Demaille <akim@epita.fr>
21298
21299 * src/files.c (open_files): Fix the computation of short_base_name
21300 in the case of `-o foo.tab.c'.
21301
21302 2000-12-20 Akim Demaille <akim@epita.fr>
21303
21304 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
21305 (copy_dollar): Now that everything uses obstacks, get rid of the
21306 FILE * parameters.
21307
21308 2000-12-20 Akim Demaille <akim@epita.fr>
21309
21310 * src/files.c (open_files): Actually the `.output' file is based
21311 on the short_base_name, not base_name.
21312 * tests/suite.at (Checking output file names): Adjust.
21313
21314 2000-12-20 Akim Demaille <akim@epita.fr>
21315
21316 * src/bison.s1: Remove, we now use directly...
21317 * src/bison.simple: this.
21318 * src/Makefile.am: Use pkgdata instead of data.
21319
21320 2000-12-20 Akim Demaille <akim@epita.fr>
21321
21322 * src/files.c (guard_obstack): New.
21323 (open_files): Initialize it.
21324 (output_files): Dump it...
21325 * src/files.h: Export it.
21326 * src/reader.c (copy_guard): Use it.
21327
21328 2000-12-19 Akim Demaille <akim@epita.fr>
21329
21330 * src/files.c (outfile, defsfile, actfile): Removed as global
21331 vars.
21332 (open_files): Don't compute them.
21333 (output_files): Adjust.
21334 (base_name, short_base_name): Be global.
21335 Adjust dependencies.
21336
21337 2000-12-19 Akim Demaille <akim@epita.fr>
21338
21339 * src/files.c (strsuffix): New.
21340 (stringappend): Be just like strcat but allocate.
21341 (base_names): Eve out from open_files.
21342 Try to simplify the rather hairy computation of base_name and
21343 short_base_name.
21344 (open_files): Use it.
21345 * tests/suite.at (Checking output file names): New test.
21346
21347 2000-12-19 Akim Demaille <akim@epita.fr>
21348
21349 * src/system.h (obstack_grow_literal_string): Rename as...
21350 (obstack_grow_string): this.
21351 * src/output.c (output_parser): Recognize `%% actions' instead of
21352 `$'.
21353 * src/bison.s1: s/$/%% actions/.
21354 * src/bison.hairy: Likewise.
21355
21356 2000-12-19 Akim Demaille <akim@epita.fr>
21357
21358 * src/output.c (output_parser): Compute the `#line' lines when
21359 there are.
21360 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
21361 Suggested by Hans Aberg.
21362
21363 2000-12-19 Akim Demaille <akim@epita.fr>
21364
21365 Let the handling of the skeleton files be local to the procedures
21366 that use it.
21367
21368 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
21369 longer static.
21370 (fparser, open_extra_files): Remove.
21371 (open_files, output_files): Don't take care of fparser.
21372 * src/files.h: Adjust.
21373 * src/output.c (output_parser): Open and close the file to the
21374 skeleton.
21375 * src/reader.c (read_declarations): When %semantic_parser, open
21376 fguard.
21377
21378 2000-12-19 Akim Demaille <akim@epita.fr>
21379
21380 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
21381 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
21382
21383 2000-12-19 Akim Demaille <akim@epita.fr>
21384
21385 * src/files.c (open_files): Yipee! We no longer need all the code
21386 looking for `/tmp' since we have no tmp file.
21387
21388 2000-12-19 Akim Demaille <akim@epita.fr>
21389
21390 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
21391 New macros.
21392 * src/files.c (open_files): Less dependency on MSDOS etc.
21393
21394 2000-12-14 Akim Demaille <akim@epita.fr>
21395
21396 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
21397 Provide a default definition.
21398 Use it when executing the default @ action.
21399 * src/reader.c (reader_output_yylsp): No longer include
21400 `timestamp' and `text' in the default YYLTYPE.
21401
21402 2000-12-12 Akim Demaille <akim@epita.fr>
21403
21404 * src/reader.c (copy_definition, parse_union_decl, copy_action)
21405 (copy_guard): Quote the file names.
21406 Reported by Laurent Mascherpa.
21407
21408 2000-12-12 Akim Demaille <akim@epita.fr>
21409
21410 * src/output.c (output_headers, output_program, output): Be sure
21411 to escape special characters when outputting filenames.
21412 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
21413 (output_headers): Don't depend on them, Use ACTSTR.
21414
21415 2000-11-17 Akim Demaille <akim@epita.fr>
21416
21417 * lib/obstack.h: Formatting changes.
21418 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
21419 prevents type checking.
21420 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
21421 cast the value to (void *): assigning a `foo *' to a `void *'
21422 variable is valid.
21423 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
21424 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
21425 append characters.
21426
21427 2000-11-17 Akim Demaille <akim@epita.fr>
21428
21429 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
21430 as...
21431 (suite.m4, regression.m4, calc.m4): these.
21432 * tests/atgeneral.m4: Update from CVS Autoconf.
21433
21434 2000-11-17 Akim Demaille <akim@epita.fr>
21435
21436 * tests/regression.m4 (%union and --defines): New test,
21437 demonstrating a current bug in the obstack implementation.
21438
21439 2000-11-17 Akim Demaille <akim@epita.fr>
21440
21441 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
21442 macros.
21443 Use them to declare the variables which are global or local to
21444 `yyparse'.
21445
21446 2000-11-17 Akim Demaille <akim@epita.fr>
21447
21448 * acconfig.h: Remove, no longer used.
21449
21450 2000-11-07 Akim Demaille <akim@epita.fr>
21451
21452 * src: s/Copyright (C)/Copyright/g.
21453
21454 2000-11-07 Akim Demaille <akim@epita.fr>
21455
21456 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
21457 defining.
21458 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
21459
21460 2000-11-07 Akim Demaille <akim@epita.fr>
21461
21462 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
21463 Merge in a single CPP if/else.
21464
21465 2000-11-07 Akim Demaille <akim@epita.fr>
21466
21467 * src/output.c (output): Remove useless variables.
21468 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
21469 argument `data' for consistency with the prototypes.
21470 Qualify it `const'.
21471 (obstack_copy, obstack_copy0): Rename the second argument as
21472 `address' for consistency. Qualify it `const'.
21473 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
21474 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
21475 `const' their input argument (`data' or `address').
21476 Adjust the corresponding macros to include `const' in casts.
21477
21478 2000-11-03 Akim Demaille <akim@epita.fr>
21479
21480 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
21481 s/PFILE1/BISON_HAIRY/.
21482 Adjust dependencies.
21483
21484 2000-11-03 Akim Demaille <akim@epita.fr>
21485
21486 For some reason, this was not applied.
21487
21488 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21489 `unlink': it's no longer used.
21490
21491 2000-11-03 Akim Demaille <akim@epita.fr>
21492
21493 * src/files.c (skeleton_find): New function, eved out of...
21494 (open_files, open_extra_files): here.
21495
21496 2000-11-03 Akim Demaille <akim@epita.fr>
21497
21498 Don't use `atexit'.
21499
21500 * src/files.c (obstack_save): New function.
21501 (done): Rename as...
21502 (output_files): this.
21503 Use `obstack_save'.
21504 * src/main.c (main): Don't use `atexit' to register `done', since
21505 it no longer has to remove tmp files, just call `output_files'
21506 when there are no errors.
21507
21508 2000-11-02 Akim Demaille <akim@epita.fr>
21509
21510 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21511 `unlink': it's no longer used.
21512 * src/files.h: Formatting changes.
21513
21514 2000-11-02 Akim Demaille <akim@epita.fr>
21515
21516 Remove the last uses of mktemp and unlink/delete.
21517
21518 * src/files.c (fdefines, ftable): Removed.
21519 (defines_ostack, table_obstack): New.
21520 Adjust dependencies of the former into uses of the latter.
21521 * src/output.c (output_short_or_char_table, output_short_table):
21522 Convert to using obstacks.
21523 * src/reader.c (copy_comment2): Accept one FILE * and two
21524 obstacks.
21525 (output_token_defines, reader_output_yylsp): Use obstacks.
21526 * src/system.h (obstack_fgrow3): New.
21527 * po/POTFILES.in: Adjust.
21528
21529 2000-11-01 Akim Demaille <akim@epita.fr>
21530
21531 Change each use of `fattrs' into a use of `attrs_obstack'.
21532
21533 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
21534 * src/files.c (fattrs): Remove.
21535 (attrs_obstack): New.
21536 Adjust all dependencies.
21537 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
21538
21539 2000-11-01 Akim Demaille <akim@epita.fr>
21540
21541 Introduce obstacks.
21542 Change each use of `faction' into a use of `action_obstack'.
21543
21544 * lib/obstack.h, lib/obstack.c: New files.
21545 * src/files.c (faction): Remove.
21546 (action_obstack): New.
21547 Adjust all dependencies.
21548
21549 2000-10-20 Akim Demaille <akim@epita.fr>
21550
21551 * lib/quote.h (PARAMS): New macro. Use it.
21552
21553 2000-10-16 Akim Demaille <akim@epita.fr>
21554
21555 * src/output.c (output_short_or_char_table): New function.
21556 (output_short_table, output_token_translations): Use it.
21557 (goto_actions): Use output_short_table.
21558
21559 2000-10-16 Akim Demaille <akim@epita.fr>
21560
21561 * src/symtab.c (bucket_new): New function.
21562 (getsym): Use it.
21563
21564 * src/output.c (output_short_table): New argument to display the
21565 comment associated with the table.
21566 Adjust dependencies.
21567 (output_gram): Use it.
21568 (output_rule_data): Nicer output layout for YYTNAME.
21569
21570 2000-10-16 Akim Demaille <akim@epita.fr>
21571
21572 * src/lex.c (read_typename): New function.
21573 (lex): Use it.
21574 * src/reader.c (copy_dollar): Likewise.
21575
21576 2000-10-16 Akim Demaille <akim@epita.fr>
21577
21578 * src/reader.c (copy_comment2): Expect the input stream to be on
21579 the `/' which is suspected to open a comment, instead of being
21580 called after `//' or `/*' was read.
21581 (copy_comment, copy_definition, parse_union_decl, copy_action)
21582 (copy_guard): Adjust.
21583
21584 2000-10-16 Akim Demaille <akim@epita.fr>
21585
21586 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
21587 `read_signed_integer'.
21588
21589 2000-10-16 Akim Demaille <akim@epita.fr>
21590
21591 * src/reader.c (copy_dollar): New function.
21592 (copy_guard, copy_action): Use it.
21593
21594 2000-10-16 Akim Demaille <akim@epita.fr>
21595
21596 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
21597 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
21598 New files, from Fileutils 4.0.27.
21599 * src/main.c (printable_version): Remove.
21600 * src/lex.c, src/reader.c: Use `quote'.
21601
21602 2000-10-04 Akim Demaille <akim@epita.fr>
21603
21604 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
21605
21606 2000-10-04 Akim Demaille <akim@epita.fr>
21607
21608 * doc/bison.texinfo: Various typos spotted by Neil Booth.
21609
21610 2000-10-04 Akim Demaille <akim@epita.fr>
21611
21612 When a literal string is used to define two different tokens,
21613 `bison -v' segfaults.
21614 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
21615
21616 * tests/regression.m4: New file.
21617 Include the core of the sample provided by Piotr Gackiewicz.
21618 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
21619 properly.
21620
21621 2000-10-04 Akim Demaille <akim@epita.fr>
21622
21623 * src/reader.c (parse_expect_decl): Keep `count' within the size
21624 of `buffer'.
21625 From Neil Booth.
21626
21627 2000-10-02 Paul Eggert <eggert@twinsun.com>
21628
21629 * bison.s1 (yyparse): Assign the default value
21630 unconditionally, to avoid a GCC warning and make the parser a
21631 tad smaller.
21632
21633 2000-10-02 Akim Demaille <akim@epita.fr>
21634
21635 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
21636 options.
21637
21638 2000-10-02 Akim Demaille <akim@epita.fr>
21639
21640 * src/derives.c, src/print.c, src/reduce.c: To ease the
21641 translation, move some `\n' out of the translated strings.
21642
21643 2000-10-02 Akim Demaille <akim@epita.fr>
21644
21645 The location tracking mechanism is precious for parse error
21646 messages. Nevertheless, it is enabled only when `@n' is used in
21647 the grammar, which is a different issue (you can use it in error
21648 message, but not in the grammar per se). Therefore, there should
21649 be another means to enable it.
21650
21651 * src/getargs.c (getargs): Support `--locations'.
21652 (usage): Report it.
21653 * src/getargs.h (locationsflag): Export it.
21654 * src/lex.c (percent_table): Support `%locations'.
21655 * src/reader.c (yylsp_needed): Remove this variable, now replaced
21656 with `locationsflag'.
21657 * doc/bison.texinfo: Document `--locations' and `%locations'.
21658 Sort the options.
21659 * tests/calc.m4: Test it.
21660
21661 For regularity of the names, replace each
21662 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
21663 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
21664 In addition replace each `flag' with `_flag'.
21665
21666 2000-10-02 Akim Demaille <akim@epita.fr>
21667
21668 Also test parse error messages, including with YYERROR_VERBOSE.
21669
21670 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
21671 associative).
21672 Use it to check the computations.
21673 Use it to check `nonassoc' is honored.
21674 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
21675 `--yyerror-verbose'.
21676 (_AT_CHECK_CALC): Adjust to this option.
21677 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
21678
21679 2000-10-02 Akim Demaille <akim@epita.fr>
21680
21681 Test also `--verbose', `--defines' and `--name-prefix'. Testing
21682 the latter demonstrates a flaw in the handling of non debugging
21683 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
21684 was used in order to simplify:
21685
21686 #if YYDEBUG
21687 if (yydebug)
21688 {
21689 ...
21690 }
21691 #endif
21692
21693 into
21694
21695 if (yydebug)
21696 {
21697 ...
21698 }
21699
21700 unfortunately this leads to a CPP conflict when
21701 `--name-prefix=foo' is used since it produces `#define yydebug
21702 foodebug'.
21703
21704 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
21705 (YYDPRINTF): New macro.
21706 Spread its use.
21707 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
21708 the bison options.
21709 Also test `--verbose', `--defines' and `--name-prefix'.
21710
21711 2000-10-02 Akim Demaille <akim@epita.fr>
21712
21713 Improve the readability of the produced parsers.
21714
21715 * src/bison.s1: Formatting changes.
21716 Improve the comment related to the `$' mark.
21717 (yydefault): Don't fall through to `yyresume': `goto' there.
21718 * src/output.c (output_parser): When the `$' is met, skip the end
21719 of its line.
21720 New variable, `number_of_dollar_signs', to check there's exactly
21721 one `$' in the parser skeleton.
21722
21723 2000-10-02 Akim Demaille <akim@epita.fr>
21724
21725 * lib/xstrdup.c: New file, from the fileutils.
21726 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
21727 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
21728 instead of strlen + xmalloc + strcpy.
21729 * src/symtab.c (copys): Remove, use xstrdup instead.
21730
21731 2000-10-02 Akim Demaille <akim@epita.fr>
21732
21733 * src/gram.h (associativity): New enum type which replaces the
21734 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
21735 `right_assoc', `left_assoc' and `non_assoc'.
21736 Adjust all dependencies.
21737 * src/reader.c: Formatting changes.
21738 (LTYPESTR): Don't define it, use it as a literal in
21739 `reader_output_yylsp'.
21740 * src/symtab.h (symbol_class): New enum type which replaces the
21741 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
21742 `sunknown', `stoken and `snterm'.
21743
21744 2000-10-02 Akim Demaille <akim@epita.fr>
21745
21746 * src/getargs.c (fixed_outfiles): Rename as...
21747 (yaccflag): for consistency and accuracy.
21748 Adjust dependencies.
21749
21750 2000-10-02 Akim Demaille <akim@epita.fr>
21751
21752 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
21753 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
21754 difficult and introduced a lot of core dump. It turns out that
21755 Bison used an implementation of `xmalloc' based on `calloc', and
21756 at various places it does depend upon the initialization to 0. I
21757 have not tried to isolate the pertinent places, and all the former
21758 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
21759 someone should address this issue.
21760
21761 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
21762 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
21763 files.
21764 Adjust dependencies.
21765 * src/warshall.h: New file.
21766 Propagate.
21767
21768 2000-10-02 Akim Demaille <akim@epita.fr>
21769
21770 Various anti-`extern in *.c' changes.
21771
21772 * src/system.h: Include `assert.h'.
21773
21774 2000-10-02 Akim Demaille <akim@epita.fr>
21775
21776 * src/state.h (nstates, final_state, first_state, first_shift)
21777 (first_reduction): Move their exportation from here...
21778 * src/LR0.h: to here.
21779 Adjust dependencies.
21780 * src/getargs.c (statisticsflag): New variable.
21781 Add support for `--statistics'.
21782 Adjust dependencies.
21783
21784 Remove a lot of now useless `extern' statements in most files.
21785
21786 2000-10-02 Akim Demaille <akim@epita.fr>
21787
21788 * src/LR0.h: New file.
21789 Propagate its use.
21790
21791 2000-10-02 Akim Demaille <akim@epita.fr>
21792
21793 * src/print.h: New file.
21794 Propagate its use.
21795 * src/print.c: Formatting and ordering changes.
21796 (verbose, terse): Replace with...
21797 (print_results): this new function.
21798 Adjust dependencies.
21799
21800 2000-10-02 Akim Demaille <akim@epita.fr>
21801
21802 * src/conflicts.c (conflict_report): New function.
21803 (conflict_log, verbose_conflict_log): Replace with...
21804 (print_conflicts): this function.
21805 Adjust dependencies.
21806 * src/conflicts.h: New file.
21807 Propagate its inclusion.
21808
21809 2000-10-02 Akim Demaille <akim@epita.fr>
21810
21811 * src/nullable.h: New file.
21812 Propagate its inclusion.
21813 * src/nullable.c: Formatting changes.
21814
21815 2000-10-02 Akim Demaille <akim@epita.fr>
21816
21817 * src/reduce.h: New file.
21818 Propagate its inclusion.
21819 * src/reduce.c: Topological sort and other formatting changes.
21820 (bool, TRUE, FALSE): Move their definition to...
21821 * src/system.h: here.
21822
21823 2000-10-02 Akim Demaille <akim@epita.fr>
21824
21825 * src/files.c: Formatting changes.
21826 (tryopen, tryclose, openfiles): Rename as...
21827 (xfopen, xfclose, open_files): this.
21828 (stringappend): static.
21829 * src/files.h: Complete the list of exported symbols.
21830 Propagate its use.
21831
21832 2000-10-02 Akim Demaille <akim@epita.fr>
21833
21834 * src/reader.h: New file.
21835 Propagate its use instead of tedious list of `extern' and
21836 prototypes.
21837 * src/reader.c: Formatting changes, topological sort,
21838 s/register//.
21839
21840 2000-10-02 Akim Demaille <akim@epita.fr>
21841
21842 * src/lex.h: Prototype `lex.c' exported functions.
21843 * src/reader.c: Adjust.
21844 * src/lex.c: Formatting changes.
21845 (safegetc): Rename as...
21846 (xgetc): this.
21847
21848 2000-10-02 Akim Demaille <akim@epita.fr>
21849
21850 * src/lalr.h: New file.
21851 Propagate its inclusion instead of prototypes and `extern'.
21852 * src/lalr.c: Formatting changes, topological sorting etc.
21853
21854 2000-10-02 Akim Demaille <akim@epita.fr>
21855
21856 * src/output.c (token_actions): Introduce a temporary array,
21857 YYDEFACT, that makes it possible for this function to use
21858 output_short_table.
21859
21860 2000-10-02 Akim Demaille <akim@epita.fr>
21861
21862 `user_toknums' is output as a `short[]' in `output.c', while it is
21863 defined as a `int[]' in `reader.c'. For consistency with the
21864 other output tables, `user_toknums' is now defined as a table of
21865 shorts.
21866
21867 * src/reader.c (user_toknums): Be a short table instead of an int
21868 table.
21869 Adjust dependencies.
21870
21871 Factor the short table outputs.
21872
21873 * src/output.c (output_short_table): New function.
21874 * src/output.c (output_gram, output_stos, output_rule_data)
21875 (output_base, output_table, output_check): Use it.
21876
21877 2000-10-02 Akim Demaille <akim@epita.fr>
21878
21879 * src/output.c (output): Topological sort of the functions, in
21880 order to get rid of the `static' prototypes.
21881 No longer use `register'.
21882 * src/output.h: New file.
21883 Propagate its inclusion in files explicitly prototyping functions
21884 from output.c.
21885
21886 2000-09-21 Akim Demaille <akim@epita.fr>
21887
21888 * src/atgeneral.m4: Update from Autoconf.
21889
21890 2000-09-21 Akim Demaille <akim@epita.fr>
21891
21892 * src/closure.h: New file.
21893 * src/closure.c: Formatting changes, topological sort over the
21894 functions, use of closure.h.
21895 (initialize_closure, finalize_closure): Rename as...
21896 (new_closure, free_closure): these. Adjust dependencies.
21897 * src/LR0.c: Formatting changes, topological sort, use of
21898 cloture.h.
21899 (initialize_states): Rename as...
21900 (new_states): this.
21901 * src/Makefile.am (noinst_HEADERS): Adjust.
21902
21903 2000-09-20 Akim Demaille <akim@epita.fr>
21904
21905 * src/acconfig.h: Don't protect config.h against multiple
21906 inclusion.
21907 Don't define PARAMS.
21908 * src/system.h: Define PARAMS.
21909 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
21910 purpose of config.h. system.h must not try to fix wrong
21911 definitions in config.h.
21912
21913 2000-09-20 Akim Demaille <akim@epita.fr>
21914
21915 * src/derives.h: New file.
21916 * src/main.c, src/derives.h: Use it.
21917 Formatting changes.
21918 * src/Makefile.am (noinst_HEADERS): Adjust.
21919
21920 2000-09-20 Akim Demaille <akim@epita.fr>
21921
21922 * tests/atgeneral.m4: Update from Autoconf.
21923 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
21924 (AT_CHECK_CALC): New macros.
21925 Use these macros to test bison with options `', `--raw',
21926 `--debug', `--yacc', `--yacc --debug'.
21927
21928 2000-09-19 Akim Demaille <akim@epita.fr>
21929
21930 * src/output.c: Formatting changes.
21931 * src/machine.h: Remove, leaving its contents in...
21932 * src/system.h: here.
21933 Include stdio.h.
21934 Adjust all dependencies on stdio.h and machine.h.
21935 * src/getargs.h: New file.
21936 Let all `extern' declarations about getargs.c be replaced with
21937 inclusion of `getargs.h'.
21938 * src/Makefile.am (noinst_HEADERS): Adjust.
21939
21940 * tests/calc.m4 (yyin): Be initialized in main, not on the global
21941 scope.
21942 (yyerror): Returns void, not int.
21943 * doc/bison.texinfo: Formatting changes.
21944
21945 2000-09-19 Akim Demaille <akim@epita.fr>
21946
21947 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
21948 portable.
21949
21950 2000-09-18 Akim Demaille <akim@epita.fr>
21951
21952 * configure.in: Append WARNING_CFLAGS to CFLAGS.
21953 * src/Makefile.am (INCLUDES): Don't.
21954 Be ready to fetch headers in lib/.
21955
21956 2000-09-18 Akim Demaille <akim@epita.fr>
21957
21958 * doc/bison.texinfo: Update the copyright.
21959 ANSIfy and GNUify the examples.
21960 Remove the old menu.
21961
21962 2000-09-18 Akim Demaille <akim@epita.fr>
21963
21964 First set of tests: use the `calc' example from the documentation.
21965
21966 * src/bison.s1 (yyparse): Condition the code using `yytname' which
21967 is defined only when YYDEBUG is.
21968 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
21969 * src/files.c (tryopen, tryclose): Formatting changes.
21970 Move to the top and be static.
21971 * src/reader.c (read_signed_integer): Likewise.
21972 * tests/calc.m4: New file.
21973 * Makefile.am, suite.m4: Adjust.
21974 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
21975
21976 2000-09-18 Akim Demaille <akim@epita.fr>
21977
21978 Add support for an Autotest test suite for Bison.
21979
21980 * m4/m4.m4, m4/atconfig.m4: New files.
21981 * m4/Makefile.am (EXTRA_DIST): Adjust.
21982 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
21983 files.
21984 * src/getargs.c: Display a more standard --version message.
21985 * src/reader.c (reader): Formatting changes.
21986 No longer depend upon VERSION_STRING.
21987 * configure.in: No longer use `dnl'.
21988 Set up the test suite and the new directory `tests/.
21989 (VERSION_STRING): Remove.
21990
21991 2000-04-14 Akim Demaille <akim@epita.fr>
21992
21993 * src/reader.c (copy_comment2): New function, same as former
21994 `copy_comment', but outputs into two FILE *.
21995 (copy_comment): Use it.
21996 (parse_union_decl): Use it.
21997 (get_type, parse_start_decl): Use the same `invalid' message.
21998 (parse_start_decl, parse_union_decl): Use the same `multiple'
21999 message.
22000 (parse_union_decl, copy_guard, copy_action): Use the same
22001 `unmatched' message.
22002 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22003
22004 2000-03-31 Akim Demaille <akim@epita.fr>
22005
22006 * src/files.c (tryopen, tryclose): Move to the top.
22007 Be static.
22008
22009 2000-03-31 Akim Demaille <akim@epita.fr>
22010
22011 * src/main.c (main): Don't call `done', exit does it.
22012
22013 2000-03-31 Akim Demaille <akim@epita.fr>
22014
22015 * allocate.c: s/return (foo)/return foo/.
22016 * lalr.c: Likewise.
22017 * LR0.c: Likewise.
22018 * output.c: Likewise.
22019 * reader.c: Likewise.
22020 * symtab.c: Likewise.
22021 * vmsgetargs.c: Likewise.
22022
22023 2000-03-31 Akim Demaille <akim@epita.fr>
22024
22025 Clean up the error reporting functions.
22026
22027 * src/report.c: New file.
22028 * src/report.h: Likewise.
22029 * src/Makefile.am: Adjust.
22030 * m4/error.m4: New file.
22031 * m4/Makefile.am: Adjust.
22032 * configure.in (jm_PREREQ_ERROR): Call it.
22033 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22034 Remove.
22035 (fatal, fatals): Remove. All callers use complain.c::fatal.
22036 (warn, warni, warns, warnss, warnss): Remove. All callers use
22037 complain.c::complain.
22038 (toomany): Remove, use fatal instead.
22039 * src/files.c (done): No argument, use complain_message_count.
22040 * src/main.c (main): Register `done' to `atexit'.
22041
22042 * src/getargs.c (usage): More `fputs', less `fprintf'.
22043
22044 2000-03-28 Akim Demaille <akim@epita.fr>
22045
22046 * lib/: New directory.
22047 * Makefile.am (SUBDIRS): Adjust.
22048 * configure.in: Adjust.
22049 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22050 useless.
22051 * src/alloca.c: Moved to lib/.
22052 * src/getopt.c: Likewise.
22053 * src/getopt1.c: Likewise.
22054 * src/getopt.h: Likewise.
22055 * src/ansi2knr.c: Likewise.
22056 * src/ansi2knr.1: Likewise.
22057 * src/Makefile.am: Adjust.
22058 * lib/Makefile.am: New file.
22059
22060 2000-03-28 Akim Demaille <akim@epita.fr>
22061
22062 * src/getargs.c (usage): Refresh the help message.
22063
22064 2000-03-17 Akim Demaille <akim@epita.fr>
22065
22066 * src/getopt1.c: Updated from textutils 2.0e
22067 * src/getopt.c: Likewise.
22068 * src/getopt.h: Likewise.
22069
22070 2000-03-17 Akim Demaille <akim@epita.fr>
22071
22072 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22073 the file name, not the whole `#line LINE FILE'.
22074
22075 2000-03-17 Akim Demaille <akim@epita.fr>
22076
22077 On syntax errors, report the token on which we choked.
22078
22079 * src/bison.s1 (yyparse): In the label yyerrlab, when
22080 YYERROR_VERBOSE, add yychar in msg.
22081
22082 2000-03-17 Akim Demaille <akim@epita.fr>
22083
22084 * src/reader.c (copy_at): New function.
22085 (copy_guard): Use it.
22086 (copy_action): Use it.
22087
22088 2000-03-17 Akim Demaille <akim@epita.fr>
22089
22090 Be kind to translators, save some useless translations.
22091
22092 * src/main.c (banner): New function.
22093 (fatal_banner): Use it.
22094 (warn_banner): Use it.
22095
22096 2000-03-17 Akim Demaille <akim@epita.fr>
22097
22098 * src/reader.c (copy_definition): Use copy_string and
22099 copy_comment. Removed now unused `match', `ended',
22100 `cplus_comment'.
22101 (copy_comment, copy_string): Moved, to be visible from
22102 copy_definition.
22103
22104 2000-03-17 Akim Demaille <akim@epita.fr>
22105
22106 * src/reader.c (copy_string): Declare `static inline'. No
22107 problems with inline, since it is checked by configure.
22108 (copy_comment): Likewise.
22109
22110 2000-03-17 Akim Demaille <akim@epita.fr>
22111
22112 * src/reader.c (packsymbols): Formatting changes.
22113
22114 2000-03-17 Akim Demaille <akim@epita.fr>
22115
22116 * src/reader.c (copy_comment): New function, factored out from:
22117 (copy_action): Use it. Removed now unused `match', `ended',
22118 `cplus_comment'.
22119 (copy_guard): Likewise.
22120
22121 2000-03-17 Akim Demaille <akim@epita.fr>
22122
22123 * src/reader.c (copy_string): New function, factored out from:
22124 (copy_action): Use it.
22125 (copy_guard): Likewise.
22126
22127 2000-03-17 Akim Demaille <akim@epita.fr>
22128
22129 Change the handling of @s so that they behave exactly like $s.
22130 There is now a pseudo variable @$ (readble and writable), location
22131 of the lhs of the rule (by default ranging from the location of
22132 the first symbol of the rhs, to the location of the last symbol,
22133 or, if the rhs is empty, YYLLOC).
22134
22135 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22136 yyval.
22137 (yyparse): When providing a default semantic action, provide a
22138 default location action.
22139 (after the $): No longer change `*YYLSP', just stack YYLOC the
22140 same way you stack YYVAL.
22141 * src/reader.c (read_declarations): Use warns.
22142 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22143 (copy_action, case '@'): Likewise.
22144 Use a standard error message, to save useless work from
22145 translators.
22146
22147 2000-03-17 Akim Demaille <akim@epita.fr>
22148
22149 * src/bison.s1: Formatting and cosmetics changes.
22150 * src/reader.c: Likewise.
22151 Update the Copyright notice.
22152
22153 2000-03-17 Akim Demaille <akim@epita.fr>
22154
22155 * src/bison.s1 (#line): All set to `#line' only, since the
22156 Makefile now handles them.
22157
22158 2000-03-16 Akim Demaille <akim@epita.fr>
22159
22160 * src/output.c (output_rule_data): Output the documentation of
22161 some of the tables.
22162 (Copyright notice): Update.
22163 Formatting changes.
22164
22165 2000-03-16 Akim Demaille <akim@epita.fr>
22166
22167 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
22168 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
22169 One `#if YYDEBUG' remains, since it uses variables which are
22170 defined only if `YYDEBUG != 0'.
22171
22172 2000-03-16 Akim Demaille <akim@epita.fr>
22173
22174 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
22175 and related variables so that the similarities are highlighted.
22176
22177 2000-03-16 Akim Demaille <akim@epita.fr>
22178
22179 * src/bison.s1: Properly indent CPP directives.
22180
22181 2000-03-16 Akim Demaille <akim@epita.fr>
22182
22183 * src/bison.s1: Properly indent the `alloca' CPP section.
22184
22185 2000-03-16 Akim Demaille <akim@epita.fr>
22186
22187 Do not hard code values of directories in `configure.in'.
22188 Update the `configure' tool chain.
22189
22190 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
22191 src/makefile.am.
22192 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
22193 (AC_OUTPUT): Add m4/Makefile.
22194 Bump to bison 1.28a, 1.29 has never been released.
22195 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
22196 handled via src/Makefile.am.
22197 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
22198 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
22199 autoheader.
22200 * Makefile.am (SUBDIRS): Add m4.
22201 (ACLOCAL_AM_FLAGS): New variable.
22202 (AUTOMAKE_OPTIONS): Add check-news.
22203 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
22204 the proper line number and file name.
22205 (DEFS): Propagate the location of bison library files and of the
22206 locale files.
22207 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
22208 builddir.
22209 * acinclude.m4: Remove, replaced by the directory m4.
22210 * m4/Makefile.am (EXTRA_DIST): New variable.
22211 * m4/gettext.m4: New file, from the fileutils.
22212 * m4/lcmessage.m4: Likewise
22213 * m4/progtest.m4: Likewise.
22214 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
22215
22216 2000-03-10 Akim Demaille <akim@epita.fr>
22217
22218 * src/closure.c:
22219 Formatting changes of various comments.
22220 Respect the GNU coding standards at various places.
22221 Don't use `_()' when no translation is needed.
22222
22223 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22224
22225 * src/files.c:
22226 OS/2 honors TMPDIR environment variable.
22227
22228 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22229
22230 * doc/bison.texinfo: Tweaked spelling and grammar.
22231 Updated ISBN.
22232 Removed reference to price of printed copy.
22233 Mention BISON_SIMPLE and BISON_HAIRY.
22234
22235 1999-12-13 Jesse Thilo <jthilo@gnu.org>
22236
22237 * configure.in, NEWS:
22238 Bison 1.29 released.
22239
22240 1999-10-27 Jesse Thilo <jthilo@gnu.org>
22241
22242 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
22243 Added reference card.
22244
22245 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22246
22247 * po/ru.po: Added Russian translation.
22248
22249 1999-07-26 Jesse Thilo <jthilo@gnu.org>
22250
22251 * configure.in: Added Russian translation.
22252
22253 1999-07-06 Jesse Thilo <jthilo@gnu.org>
22254
22255 * configure.in, NEWS, README:
22256 Released version 1.28.
22257
22258 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22259
22260 * src/system.h:
22261 Squashed redefinition warning on some systems.
22262
22263 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
22264 Have configure build version string instead of relying on ANSI string
22265 concatentation.
22266
22267 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22268
22269 * po/POTFILES.in: Got rid of version.c.
22270
22271 1999-06-14 Jesse Thilo <jthilo@gnu.org>
22272
22273 * acconfig.h, configure.in:
22274 Have configure build version string instead of relying on ANSI string
22275 concatentation.
22276
22277 1999-06-08 Jesse Thilo <jthilo@gnu.org>
22278
22279 * doc/bison.1:
22280 Dropped mention of `+' for long-named options.
22281
22282 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22283
22284 * src/files.c: Added <unistd.h> for unlink().
22285
22286 * src/Makefile.am, src/system.h:
22287 I18n fixes.
22288
22289 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22290
22291 * README: Added a FAQ list.
22292
22293 * configure.in, acconfig.h:
22294 I18n fixes.
22295
22296 1999-05-30 Jesse Thilo <jthilo@gnu.org>
22297
22298 * doc/FAQ, doc/Makefile.am:
22299 Added a FAQ list.
22300
22301 1999-05-19 Jesse Thilo <jthilo@gnu.org>
22302
22303 * src/alloc.h, src/symtab.h, src/version.c:
22304 Protected inclusion of "config.h" with HAVE_CONFIG_H.
22305
22306 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22307
22308 * src/.cvsignore, src/Makefile.am:
22309 Reorganized: sources in `src', documentation in `doc'.
22310
22311 * src/lex.c (literalchar):
22312 fixed the code for escaping double quotes (thanks
22313 Jonathan Czisny.)
22314
22315 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22316
22317 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
22318 Adjusted paths to reflect directory reorganization.
22319
22320 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22321
22322 * doc/.cvsignore, doc/Makefile.am:
22323 Reorganized: sources in `src', documentation in `doc'.
22324
22325 1999-04-18 Jesse Thilo <jthilo@gnu.org>
22326
22327 * configure.in:
22328 Updated AC_INIT file to reflect directory reorganization.
22329
22330 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
22331 Reorganized: sources in `src', documentation in `doc'.
22332
22333 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22334
22335 * src/allocate.c:
22336 Don't declare calloc() and realloc() if not necessary.
22337
22338 1999-04-13 Jesse Thilo <jthilo@gnu.org>
22339
22340 * configure.in, acconfig.h, acinclude.m4:
22341 Don't declare calloc() and realloc() if not necessary.
22342
22343 1999-03-23 Jesse Thilo <jthilo@gnu.org>
22344
22345 * po/.cvsignore: Added i18n support.
22346
22347 1999-03-23 Jesse Thilo <jthilo@gnu.org>
22348
22349 * acconfig.h, configure.in, Makefile.am:
22350 Added i18n support.
22351
22352 1999-03-22 Jesse Thilo <jthilo@gnu.org>
22353
22354 * src/bison.s1: Fixed #line numbers.
22355
22356 1999-03-15 Jesse Thilo <jthilo@gnu.org>
22357
22358 * po/es.po, po/fr.po, po/nl.po, po/de.po:
22359 Added PO files from Translation Project.
22360
22361 1999-03-03 Jesse Thilo <jthilo@gnu.org>
22362
22363 * Makefile.am:
22364 Added support for non-ANSI compilers (ansi2knr).
22365
22366 1999-02-16 Jesse Thilo <jthilo@gnu.org>
22367
22368 * configure.in: Bumped version number to 1.27.
22369
22370 * Makefile.am:
22371 Added `bison.simple' to list of files removed by `make distclean'.
22372
22373 1999-02-12 Jesse Thilo <jthilo@gnu.org>
22374
22375 * src/files.c, src/files.h:
22376 Defined locations of parser files in config.h instead of Makefile.
22377
22378 1999-02-12 Jesse Thilo <jthilo@gnu.org>
22379
22380 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
22381 Defined locations of parser files in config.h instead of Makefile.
22382
22383 1999-02-09 Jesse Thilo <jthilo@gnu.org>
22384
22385 * Makefile.am:
22386 Removed inappropriate use of $< macro.
22387
22388 1999-02-05 Jesse Thilo <jthilo@gnu.org>
22389
22390 * po/Makefile.in.in, po/POTFILES.in:
22391 Add `po' directory skeleton.
22392
22393 1999-01-27 Jesse Thilo <jthilo@gnu.org>
22394
22395 * README: Document help-bison list.
22396
22397 * configure.in: Add check for mkstemp().
22398
22399 1999-01-20 Jesse Thilo <jthilo@gnu.org>
22400
22401 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
22402 Hush a few compiler warnings.
22403
22404 * src/files.c:
22405 Add tryclose(), which verifies that fclose was successful.
22406 Hush a couple of compiler warnings.
22407
22408 1999-01-20 Jesse Thilo <jthilo@gnu.org>
22409
22410 * Makefile.am, OChangeLog:
22411 ChangeLog is now automatically generated. Include the old version as
22412 OChangeLog.
22413
22414 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22415
22416 * 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:
22417 Update FSF address.
22418
22419 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22420
22421 * doc/bison.texinfo: Fix formatting glitch.
22422
22423 * doc/bison.texinfo: Update FSF address.
22424
22425 1999-01-14 Jesse Thilo <jthilo@gnu.org>
22426
22427 * acconfig.h: Update FSF address.
22428
22429 1999-01-08 Jesse Thilo <jthilo@gnu.org>
22430
22431 * src/system.h:
22432 Don't define PACKAGE here, since config.h defines it.
22433
22434 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22435
22436 * src/reader.c: Update copyright date.
22437
22438 * src/main.c:
22439 Ditch sprintf to statically-sized buffers in fatal/warn functions in
22440 favor of output directly to stderr (avoids buffer overruns).
22441
22442 * src/reader.c: Some checks for premature EOF.
22443
22444 * 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:
22445 Use prototypes if the compiler understands them.
22446
22447 * src/files.c: Honor TMPDIR on Unix hosts.
22448 Use prototypes if the compiler understands them.
22449
22450 * src/reader.c:
22451 Fix a couple of buffer overrun bugs.
22452 Use prototypes if the compiler understands them.
22453
22454 * src/system.h: Include unistd.h and ctype.h.
22455 Use #ifdef instead of #if for NLS symbols.
22456
22457 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22458
22459 * doc/bison.texinfo:
22460 Delete comment "consider using @set for edition number, etc..." since
22461 we now are doing so.
22462
22463 1998-12-30 Jesse Thilo <jthilo@gnu.org>
22464
22465 * configure.in:
22466 Use prototypes if the compiler understands them.
22467
22468 * NEWS: Document 1.26 highlights.
22469
22470 * Makefile.am: Require Automake 1.3 or later.
22471
22472 * acconfig.h:
22473 Use prototypes if the compiler understands them.
22474
22475 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22476
22477 * src/version.c:
22478 Use VERSION symbol from automake for version number.
22479
22480 1998-12-29 Jesse Thilo <jthilo@gnu.org>
22481
22482 * acconfig.h, configure.in, version.cin:
22483 Use VERSION symbol from automake for version number.
22484
22485 1998-11-28 Jesse Thilo <jthilo@gnu.org>
22486
22487 * Makefile.am:
22488 Distribute original version of simple parser (bison.s1), not built
22489 version (bison.simple).
22490
22491 1998-11-28 Jesse Thilo <jthilo@gnu.org>
22492
22493 * doc/bison.texinfo: Add info dir entry.
22494
22495 * doc/bison.texinfo:
22496 Let automake put version number into documentation.
22497
22498 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22499
22500 * src/bison.cld, src/build.com, src/vmshlp.mar:
22501 Add non-RCS files from /gd/gnu/bison.
22502
22503 1998-11-26 Jesse Thilo <jthilo@gnu.org>
22504
22505 * doc/bison.1:
22506 Document the BISON_HAIRY and BISON_SIMPLE variables.
22507
22508 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22509
22510 * src/version.c: Build version.c automatically.
22511
22512 * src/reader.c:
22513 Fix token numbering (used to start at 258, not 257).
22514
22515 * src/system.h: Include config.h.
22516
22517 * src/getargs.c: Update bug report address.
22518
22519 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
22520 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
22521
22522 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22523
22524 * Makefile.am:
22525 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22526
22527 * configure.in, version.cin:
22528 Build version.c automatically.
22529
22530 * AUTHORS: Add AUTHORS file.
22531
22532 * README: Update bug report address.
22533
22534 * bison.simple:
22535 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22536
22537 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
22538 Add automake stuff.
22539
22540 1998-11-25 Jesse Thilo <jthilo@gnu.org>
22541
22542 * doc/bison.texinfo: Clean up some formatting.
22543
22544 1998-05-05 Richard Stallman <rms@gnu.org>
22545
22546 * doc/bison.texinfo:
22547 Explain better why to make a pure parser.
22548
22549 1998-01-05 Richard Stallman <rms@gnu.org>
22550
22551 * src/files.c (openfiles):
22552 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
22553 find a temporary directory, if possible. Do not unlink files while
22554 they are open.
22555
22556 1997-08-25 Richard Stallman <rms@gnu.org>
22557
22558 * src/reader.c (stack_offset;):
22559 Change some warni to warns.
22560
22561 * src/lex.c (literalchar): Use warns, not warni.
22562
22563 1997-06-28 Richard Stallman <rms@gnu.org>
22564
22565 * src/bison.s1: Add a Bison version comment.
22566
22567 * src/main.c (fatal, warn, berror):
22568 Use program_name.
22569
22570 1997-06-28 Richard Stallman <rms@gnu.org>
22571
22572 * Makefile.in (bison_version): New variable.
22573 (dist): Use that variable.
22574 (bison.s1): Substitute the Bison version into bison.simple.
22575
22576 * bison.simple: Add a Bison version comment.
22577
22578 1997-06-18 Richard Stallman <rms@gnu.org>
22579
22580 * src/main.c (fatal, warn, berror):
22581 Make error messages standard.
22582 (toomany): Improve error message text.
22583
22584 * 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:
22585 new.h renamed to alloc.h.
22586
22587 1997-06-18 Richard Stallman <rms@gnu.org>
22588
22589 * Makefile.in: new.h renamed to alloc.h.
22590
22591 1997-05-24 Richard Stallman <rms@gnu.org>
22592
22593 * src/lex.c (literalchar):
22594 Fix the code for escaping \, " and '.
22595
22596 (lex): Avoid trouble when there are many chars
22597 to discard in a char literal with just several chars in it.
22598
22599 1997-05-17 Richard Stallman <rms@gnu.org>
22600
22601 * src/bison.s1:
22602 Use malloc, if using alloca is troublesome.
22603 (YYSTACK_USE_ALLOCA): New flag macro.
22604 Define it for some systems and compilers.
22605 (YYSTACK_ALLOC): New macro.
22606 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22607 If it was malloc'd, free it.
22608
22609 1997-05-17 Richard Stallman <rms@gnu.org>
22610
22611 * bison.simple:
22612 Use malloc, if using alloca is troublesome.
22613 (YYSTACK_USE_ALLOCA): New flag macro.
22614 Define it for some systems and compilers.
22615 (YYSTACK_ALLOC): New macro.
22616 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22617 If it was malloc'd, free it.
22618
22619 1997-04-23 Richard Stallman <rms@gnu.org>
22620
22621 * src/bison.s1:
22622 (alloca) [__hpux]: Always define as __builtin_alloca.
22623
22624 1997-04-23 Richard Stallman <rms@gnu.org>
22625
22626 * bison.simple:
22627 (alloca) [__hpux]: Always define as __builtin_alloca.
22628
22629 1997-04-22 Richard Stallman <rms@gnu.org>
22630
22631 * src/bison.s1:
22632 [__hpux]: Include alloca.h (right for HPUX 10)
22633 instead of declaring alloca (right for HPUX 9).
22634
22635 * src/bison.s1 (__yy_memcpy):
22636 Declare arg `count' as unsigned int.
22637 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22638
22639 1997-04-22 Richard Stallman <rms@gnu.org>
22640
22641 * bison.simple:
22642 [__hpux]: Include alloca.h (right for HPUX 10)
22643 instead of declaring alloca (right for HPUX 9).
22644
22645 * bison.simple (__yy_memcpy):
22646 Declare arg `count' as unsigned int.
22647 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22648
22649 1997-01-03 Richard Stallman <rms@gnu.org>
22650
22651 * src/allocate.c: [__STDC__ or _MSC_VER]:
22652 Declare calloc and realloc to return void *.
22653
22654 1997-01-02 Richard Stallman <rms@gnu.org>
22655
22656 * src/system.h:
22657 [_MSC_VER]: Include stdlib.h and process.h.
22658 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
22659
22660 * src/main.c (main): Return FAILURE as a value.
22661 (printable_version): Declare arg as int, not char.
22662
22663 1997-01-02 Richard Stallman <rms@gnu.org>
22664
22665 * Makefile.in (dist):
22666 Explicitly check for symlinks, and copy them.
22667
22668 1996-12-19 Richard Stallman <rms@gnu.org>
22669
22670 * src/files.c:
22671 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
22672
22673 1996-12-18 Paul Eggert <eggert@gnu.org>
22674
22675 * src/bison.s1 (yyparse):
22676 If __GNUC__ and YYPARSE_PARAM are both defined,
22677 declare yyparse to have a void * argument.
22678
22679 1996-12-18 Paul Eggert <eggert@gnu.org>
22680
22681 * bison.simple (yyparse):
22682 If __GNUC__ and YYPARSE_PARAM are both defined,
22683 declare yyparse to have a void * argument.
22684
22685 1996-12-17 Richard Stallman <rms@gnu.org>
22686
22687 * src/reduce.c (nbits): Add some casts.
22688
22689 1996-08-12 Richard Stallman <rms@gnu.org>
22690
22691 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
22692
22693 1996-08-12 Richard Stallman <rms@gnu.org>
22694
22695 * bison.simple: Test _MSDOS as well as _MSDOS_.
22696
22697 1996-07-31 Richard Stallman <rms@gnu.org>
22698
22699 * src/bison.s1:
22700 [__sun && __i386]: Include alloca.h.
22701
22702 1996-07-31 Richard Stallman <rms@gnu.org>
22703
22704 * bison.simple:
22705 [__sun && __i386]: Include alloca.h.
22706
22707 1996-07-30 Richard Stallman <rms@gnu.org>
22708
22709 * src/bison.s1: Comment change.
22710
22711 * src/bison.s1: Test _MSDOS_, not MSDOS.
22712
22713 1996-07-30 Richard Stallman <rms@gnu.org>
22714
22715 * bison.simple: Comment change.
22716
22717 * bison.simple: Test _MSDOS_, not MSDOS.
22718
22719 1996-06-01 Richard Stallman <rms@gnu.org>
22720
22721 * 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:
22722 Insert `_' macro around many string constants.
22723
22724 * src/main.c:
22725 Insert `_' macro around many string constants.
22726
22727 (main): Call setlocale, bindtextdomain and textdomain.
22728
22729 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
22730 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
22731 [ENABLE_NLS]: Include libintl.h.
22732 [ENABLE_NLS] (gettext): Define.
22733 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
22734 (N_, PACKAGE, LOCALEDIR): New macros.
22735
22736 1996-06-01 Richard Stallman <rms@gnu.org>
22737
22738 * POTFILES.in: New file.
22739
22740 * Makefile.in (allocate.o):
22741 Define target explicitly.
22742
22743 * Makefile.in (CFLAGS): Set to @CFLAGS@.
22744 (LDFLAGS): Set to @LDFLAGS@.
22745 (configure): Run autoconf only if preceding `cd' succeeds.
22746 (bison.s1): Redirect output to temporary file then move the
22747 temporary to the target, rather than redirecting directly to bison.s1.
22748 (clean): Remove config.status and config.log.
22749 (distclean): Don't remove config.status here.
22750
22751 1996-05-12 Richard Stallman <rms@gnu.org>
22752
22753 * src/bison.s1:
22754 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22755
22756 1996-05-12 Richard Stallman <rms@gnu.org>
22757
22758 * bison.simple:
22759 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22760
22761 1996-05-11 Richard Stallman <rms@gnu.org>
22762
22763 * src/bison.s1 (__yy_memcpy):
22764 Really reorder the args, as was supposedly done on Feb 14 1995.
22765 (yyparse): Calls changed accordingly.
22766
22767 1996-05-11 Richard Stallman <rms@gnu.org>
22768
22769 * Makefile.in (dist): Don't use $(srcdir).
22770
22771 * bison.simple (__yy_memcpy):
22772 Really reorder the args, as was supposedly done on Feb 14 1995.
22773 (yyparse): Calls changed accordingly.
22774
22775 1996-01-27 Richard Stallman <rms@gnu.org>
22776
22777 * src/output.c (output_rule_data):
22778 Test YYERROR_VERBOSE in the conditional
22779 around the definition of ttyname.
22780
22781 1995-12-29 Richard Stallman <rms@gnu.org>
22782
22783 * src/bison.s1:
22784 Fix line numbers in #line commands.
22785
22786 1995-12-29 Richard Stallman <rms@gnu.org>
22787
22788 * bison.simple:
22789 Fix line numbers in #line commands.
22790
22791 1995-12-27 Richard Stallman <rms@gnu.org>
22792
22793 * src/bison.s1 (YYPARSE_PARAM_DECL):
22794 In C++, make it always null.
22795 (YYPARSE_PARAM_ARG): New macro.
22796 (yyparse): Use YYPARSE_PARAM_ARG.
22797
22798 1995-12-27 Richard Stallman <rms@gnu.org>
22799
22800 * bison.simple (YYPARSE_PARAM_DECL):
22801 In C++, make it always null.
22802 (YYPARSE_PARAM_ARG): New macro.
22803 (yyparse): Use YYPARSE_PARAM_ARG.
22804
22805 1995-11-29 Richard Stallman <rms@gnu.org>
22806
22807 * doc/bison.texinfo:
22808 Describe literal string tokens, %raw, %no_lines, %token_table.
22809
22810 1995-11-29 Daniel Hagerty <hag@gnu.org>
22811
22812 * doc/bison.texinfo: Fixed update date
22813
22814 1995-10-16 Richard Stallman <rms@gnu.org>
22815
22816 * src/version.c: Version 1.25.
22817
22818 1995-10-16 Richard Stallman <rms@gnu.org>
22819
22820 * NEWS: *** empty log message ***
22821
22822 1995-10-16 Richard Stallman <rms@gnu.org>
22823
22824 * doc/bison.1, doc/bison.rnh:
22825 Add new options.
22826
22827 1995-10-15 Richard Stallman <rms@gnu.org>
22828
22829 * src/vmsgetargs.c, src/getargs.c:
22830 Added -n, -k, and -raw switches.
22831 (noparserflag, toknumflag, rawtoknumflag): New variables.
22832
22833 * src/symtab.h (SALIAS):
22834 New #define for adding aliases to %token.
22835 (struct bucket): Added `alias' field.
22836
22837 * src/reduce.c (reduce_grammar):
22838 Revise error message.
22839 (print_notices): Remove final `.' from error message.
22840
22841 * src/reader.c (reader_output_yylsp):
22842 New function.
22843 (readgram): Use `#if 0' around code that accepted %command
22844 inside grammar rules: The documentation doesn't allow it,
22845 and it will fail since the %command processors scan for the next %.
22846 (parse_token_decl): Extended the %token
22847 declaration to allow a multi-character symbol as an alias.
22848 (parse_thong_decl): New function.
22849 (read_declarations): Added %thong declarations.
22850 (read_declarations): Handle NOOP to deal with allowing
22851 % declarations as another means to specify the flags.
22852 (readgram): Allow %prec prior to semantics embedded in a rule.
22853 (skip_to_char, read_declarations, copy_definition)
22854 (parse_token_decl, parse_start_decl, parse_type_decl)
22855 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
22856 (get_type_name, copy_guard, copy_action, readgram)
22857 (get_type, packsymbols): Revised most error messages.
22858 Changed `fatal' to `warnxxx' to avoid aborting for error.
22859 Revised and use multiple warnxxx functions to avoid using VARARGS1.
22860 (read_declarations): Improve the error message for
22861 an invalid character. Do not abort.
22862 (read_declarations, copy_guard, copy_action): Use
22863 printable_version to avoid unprintable characters in printed output.
22864 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
22865 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
22866 Allow the type of a non-terminal can be given
22867 more than once, as long as all specifications give the same type.
22868
22869 * src/output.c:
22870 (output_headers, output_trailers, output, output_gram)
22871 (output_rule_data): Implement noparserflag variable.
22872 Implement toknumflag variable.
22873 (output): Call reader_output_yylsp to output LTYPESTR.
22874
22875 * src/main.c (main):
22876 If reader sees an error, don't process the grammar.
22877 (fatals): Updated to not use VARARGS1.
22878 (printable_version, int_to_string, warn, warni, warns, warnss)
22879 (warnsss): New error reporting functions. Avoid abort for error.
22880
22881 * src/lex.h:
22882 Added THONG and NOOP for alias processing.
22883 Added SETOPT for the new code that allows setting options with %flags.
22884
22885 * src/lex.c:
22886 Include getopt.h. Add some extern decls.
22887 (safegetc): New function to deal with EOF gracefully.
22888 (literalchar); new function to deal with reading \ escapes.
22889 (lex): Use literalchar.
22890 (lex): Implemented "..." tokens.
22891 (literalchar, lex, parse_percent_token): Made tokenbuffer
22892 always contain the token. This includes growing the token
22893 buffer while reading an integer.
22894 (parse_percent_token): Replaced if-else statement with percent_table.
22895 (parse_percent_token): Added % declarations as another
22896 way to specify the flags -n, -l, and -r. Also added hooks for
22897 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
22898 major changes to files.c.
22899 (lex) Retain in the incoming stream a character following
22900 an incorrect '/'.
22901 (skip_white_space, lex): Revised most error messages
22902 and changed fatal to warn to avoid aborting.
22903 (percent_table): Added %thong declarations.
22904
22905 * src/gram.h: Comment changes.
22906
22907 * src/files.c (openfiles, open_extra_files, done):
22908 Add faction flag
22909 and actfile file. Handle noparserflag. Both for -n switch.
22910
22911 * src/conflicts.c (resolve_sr_conflict):
22912 Remove use of alloca.
22913
22914 1995-06-01 Jim Meyering <meyering@gnu.org>
22915
22916 * doc/bison.texinfo: *** empty log message ***
22917
22918 1995-05-06 Richard Stallman <rms@gnu.org>
22919
22920 * src/bison.s1: Comment change.
22921
22922 1995-05-06 Richard Stallman <rms@gnu.org>
22923
22924 * bison.simple: Comment change.
22925
22926 1995-05-03 Richard Stallman <rms@gnu.org>
22927
22928 * src/version.c: Version now 1.24.
22929
22930 * src/bison.s1: Change distribution terms.
22931
22932 * src/version.c: Version now 1.23.
22933
22934 1995-05-03 Richard Stallman <rms@gnu.org>
22935
22936 * doc/bison.texinfo:
22937 Rewrite "Conditions for Using Bison".
22938 Update version to 1.24.
22939
22940 1995-05-03 Richard Stallman <rms@gnu.org>
22941
22942 * bison.simple: Change distribution terms.
22943
22944 1995-02-23 Richard Stallman <rms@gnu.org>
22945
22946 * src/files.c: Test __VMS_POSIX as well as VMS.
22947
22948 1995-02-14 Jim Meyering <meyering@gnu.org>
22949
22950 * src/bison.s1 (__yy_memcpy):
22951 Renamed from __yy_bcopy to avoid
22952 confusion. Reverse FROM and TO arguments to be consistent with
22953 those of memcpy.
22954
22955 1995-02-14 Jim Meyering <meyering@gnu.org>
22956
22957 * bison.simple (__yy_memcpy):
22958 Renamed from __yy_bcopy to avoid
22959 confusion. Reverse FROM and TO arguments to be consistent with
22960 those of memcpy.
22961
22962 1994-11-10 David J. MacKenzie <djm@gnu.org>
22963
22964 * NEWS: reformat
22965
22966 * NEWS: New file.
22967
22968 * Makefile.in (DISTFILES): Include NEWS.
22969
22970 * Makefile.in (DISTFILES):
22971 Include install-sh, not install.sh.
22972
22973 * configure.in: Update to Autoconf v2 macro names.
22974
22975 1994-10-05 David J. MacKenzie <djm@gnu.org>
22976
22977 * Makefile.in: fix typo
22978
22979 * Makefile.in (prefix, exec_prefix):
22980 Let configure set them.
22981
22982 1994-09-28 David J. MacKenzie <djm@gnu.org>
22983
22984 * Makefile.in: Set datadir to $(prefix)/share.
22985
22986 1994-09-15 Richard Stallman <rms@gnu.org>
22987
22988 * src/bison.s1:
22989 Update copyright notice and GPL version.
22990
22991 1994-09-15 Richard Stallman <rms@gnu.org>
22992
22993 * bison.simple:
22994 Update copyright notice and GPL version.
22995
22996 1994-07-12 Richard Stallman <rms@gnu.org>
22997
22998 * src/reduce.c, src/reader.c:
22999 entered into RCS
23000
23001 1994-05-05 David J. MacKenzie <djm@gnu.org>
23002
23003 * Makefile.in: entered into RCS
23004
23005 1994-03-26 Richard Stallman <rms@gnu.org>
23006
23007 * src/bison.s1: entered into RCS
23008
23009 1994-03-26 Richard Stallman <rms@gnu.org>
23010
23011 * bison.simple: entered into RCS
23012
23013 1994-03-25 Richard Stallman <rms@gnu.org>
23014
23015 * src/main.c: entered into RCS
23016
23017 1994-03-24 Richard Stallman <rms@gnu.org>
23018
23019 * src/conflicts.c: entered into RCS
23020
23021 1994-01-02 Richard Stallman <rms@gnu.org>
23022
23023 * Makefile.in: *** empty log message ***
23024
23025 1993-11-21 Richard Stallman <rms@gnu.org>
23026
23027 * src/bison.s1: *** empty log message ***
23028
23029 1993-11-21 Richard Stallman <rms@gnu.org>
23030
23031 * doc/bison.texinfo: entered into RCS
23032
23033 * doc/bison.texinfo: *** empty log message ***
23034
23035 1993-11-21 Richard Stallman <rms@gnu.org>
23036
23037 * bison.simple: *** empty log message ***
23038
23039 1993-10-25 David J. MacKenzie <djm@gnu.org>
23040
23041 * doc/bison.texinfo: *** empty log message ***
23042
23043 1993-10-19 Richard Stallman <rms@gnu.org>
23044
23045 * src/bison.s1: *** empty log message ***
23046
23047 1993-10-19 Richard Stallman <rms@gnu.org>
23048
23049 * bison.simple: *** empty log message ***
23050
23051 1993-10-14 Richard Stallman <rms@gnu.org>
23052
23053 * src/bison.s1: *** empty log message ***
23054
23055 1993-10-14 Richard Stallman <rms@gnu.org>
23056
23057 * bison.simple: *** empty log message ***
23058
23059 1993-09-14 David J. MacKenzie <djm@gnu.org>
23060
23061 * doc/bison.texinfo: *** empty log message ***
23062
23063 1993-09-13 Noah Friedman <friedman@gnu.org>
23064
23065 * Makefile.in: *** empty log message ***
23066
23067 1993-09-10 Richard Stallman <rms@gnu.org>
23068
23069 * src/conflicts.c: *** empty log message ***
23070
23071 * src/system.h: entered into RCS
23072
23073 1993-09-10 Richard Stallman <rms@gnu.org>
23074
23075 * doc/bison.1: entered into RCS
23076
23077 1993-09-06 Noah Friedman <friedman@gnu.org>
23078
23079 * src/version.c: entered into RCS
23080
23081 1993-09-06 Noah Friedman <friedman@gnu.org>
23082
23083 * Makefile.in: *** empty log message ***
23084
23085 1993-07-30 David J. MacKenzie <djm@gnu.org>
23086
23087 * Makefile.in: *** empty log message ***
23088
23089 1993-07-24 Richard Stallman <rms@gnu.org>
23090
23091 * src/bison.s1: *** empty log message ***
23092
23093 1993-07-24 Richard Stallman <rms@gnu.org>
23094
23095 * bison.simple: *** empty log message ***
23096
23097 1993-07-08 David J. MacKenzie <djm@gnu.org>
23098
23099 * Makefile.in: *** empty log message ***
23100
23101 1993-07-04 Richard Stallman <rms@gnu.org>
23102
23103 * src/bison.s1: *** empty log message ***
23104
23105 1993-07-04 Richard Stallman <rms@gnu.org>
23106
23107 * bison.simple: *** empty log message ***
23108
23109 1993-06-26 David J. MacKenzie <djm@gnu.org>
23110
23111 * src/getargs.c: entered into RCS
23112
23113 1993-06-26 David J. MacKenzie <djm@gnu.org>
23114
23115 * doc/bison.texinfo: *** empty log message ***
23116
23117 * doc/bison.1: New file.
23118
23119 1993-06-25 Richard Stallman <rms@gnu.org>
23120
23121 * src/getargs.c: New file.
23122
23123 1993-06-16 Richard Stallman <rms@gnu.org>
23124
23125 * src/bison.s1: *** empty log message ***
23126
23127 1993-06-16 Richard Stallman <rms@gnu.org>
23128
23129 * bison.simple: *** empty log message ***
23130
23131 1993-06-03 Richard Stallman <rms@gnu.org>
23132
23133 * src/bison.s1: New file.
23134
23135 1993-06-03 Richard Stallman <rms@gnu.org>
23136
23137 * doc/bison.texinfo: *** empty log message ***
23138
23139 1993-06-03 Richard Stallman <rms@gnu.org>
23140
23141 * bison.simple: New file.
23142
23143 1993-05-19 Richard Stallman <rms@gnu.org>
23144
23145 * doc/bison.texinfo: New file.
23146
23147 1993-05-07 Noah Friedman <friedman@gnu.org>
23148
23149 * Makefile.in: *** empty log message ***
23150
23151 1993-04-28 Noah Friedman <friedman@gnu.org>
23152
23153 * src/reader.c: *** empty log message ***
23154
23155 1993-04-23 Noah Friedman <friedman@gnu.org>
23156
23157 * src/alloc.h: entered into RCS
23158
23159 1993-04-20 David J. MacKenzie <djm@gnu.org>
23160
23161 * src/version.c: *** empty log message ***
23162
23163 * src/files.c, src/allocate.c:
23164 entered into RCS
23165
23166 * src/reader.c: *** empty log message ***
23167
23168 * src/lex.c: entered into RCS
23169
23170 * src/conflicts.c: New file.
23171
23172 * src/symtab.c: entered into RCS
23173
23174 * src/alloc.h: New file.
23175
23176 * src/LR0.c: entered into RCS
23177
23178 1993-04-18 Noah Friedman <friedman@gnu.org>
23179
23180 * src/reader.c: New file.
23181
23182 * src/version.c: *** empty log message ***
23183
23184 1993-04-18 Noah Friedman <friedman@gnu.org>
23185
23186 * Makefile.in: *** empty log message ***
23187
23188 1993-04-17 Noah Friedman <friedman@gnu.org>
23189
23190 * Makefile.in: *** empty log message ***
23191
23192 1993-04-15 Richard Stallman <rms@gnu.org>
23193
23194 * src/main.c, src/files.c:
23195 New file.
23196
23197 1993-04-15 Noah Friedman <friedman@gnu.org>
23198
23199 * configure.in: entered into RCS
23200
23201 * configure.in: *** empty log message ***
23202
23203 * configure.in: New file.
23204
23205 1993-04-14 Richard Stallman <rms@gnu.org>
23206
23207 * Makefile.in: New file.
23208
23209 1993-04-13 Richard Stallman <rms@gnu.org>
23210
23211 * src/version.c: New file.
23212
23213 1993-03-25 Richard Stallman <rms@gnu.org>
23214
23215 * src/output.c: entered into RCS
23216
23217 1992-09-25 Richard Stallman <rms@gnu.org>
23218
23219 * configure.bat: entered into RCS
23220
23221 1992-06-22 Richard Stallman <rms@gnu.org>
23222
23223 * src/vmsgetargs.c: entered into RCS
23224
23225 1992-06-22 Richard Stallman <rms@gnu.org>
23226
23227 * doc/bison.rnh: entered into RCS
23228
23229 1992-04-20 David J. MacKenzie <djm@gnu.org>
23230
23231 * README: entered into RCS
23232
23233 1992-01-22 Richard Stallman <rms@gnu.org>
23234
23235 * src/machine.h: entered into RCS
23236
23237 1991-12-21 Richard Stallman <rms@gnu.org>
23238
23239 * src/lalr.c, src/closure.c:
23240 entered into RCS
23241
23242 1991-12-20 Richard Stallman <rms@gnu.org>
23243
23244 * src/state.h: entered into RCS
23245
23246 1991-12-18 Richard Stallman <rms@gnu.org>
23247
23248 * src/print.c, src/nullable.c, src/derives.c:
23249 entered into RCS
23250
23251 1991-11-03 David J. MacKenzie <djm@gnu.org>
23252
23253 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
23254 entered into RCS
23255
23256 1988-09-09 Richard Stallman <rms@gnu.org>
23257
23258 * src/bison.hairy: entered into RCS
23259
23260 1987-12-16 Richard Stallman <rms@gnu.org>
23261
23262 * REFERENCES: entered into RCS
23263
23264
23265 -----
23266
23267 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
23268 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
23269 2008, 2009, 2010 Free Software Foundation, Inc.
23270
23271 Copying and distribution of this file, with or without
23272 modification, are permitted provided the copyright notice and this
23273 notice are preserved.