]> git.saurik.com Git - bison.git/blame - ChangeLog
c++: use YYRHSLOC.
[bison.git] / ChangeLog
CommitLineData
bb9191dd
AD
12010-05-10 Akim Demaille <demaille@gostai.com>
2
3 c++: use YYRHSLOC.
4 * data/lalr1.cc (YYRHSLOC): New.
5 (YYLLOC_DEFAULT): Use it.
6 * data/glr.cc: If location_type was user defined, do not include
7 location.hh, and do not produce location.hh and position.hh.
8 * tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC.
9 Check that glr.cc supports user defined location_type.
10 * NEWS: Document this.
11
8aec287e
AD
122010-05-07 Akim Demaille <demaille@gostai.com>
13
14 doc: fix typo.
15 * tests/synclines.at: here.
16
c826013f
AD
172010-05-04 Akim Demaille <demaille@gostai.com>
18
19 tests: enhance AT_SYNCLINES_COMPILE.
20 * tests/synclines.at (AT_SYNCLINES_COMPILE): More distcc patterns.
21 (AT_TEST_SYNCLINE): Remove GCC 4.5 protection which is already
22 taken care of in AT_SYNCLINES_COMPILE.
23
7789b6e3
AD
242010-05-04 Akim Demaille <demaille@gostai.com>
25
26 lalr1.cc: don't generate location.hh when location_type is defined
27 * data/bison.m4 (b4_percent_define_get): Accept a default value.
28 * data/c++.m4: Do not provide a default value for the %define
29 variable location_type, rather, use b4_percent_define_get with a
30 default argument where its value is needed.
31 * data/lalr1.cc: Do not load location.cc (which outputs both
32 location.hh and position.hh) if the user defined location_type.
33 Do not include location.hh either.
34
19ad326b
AD
352010-05-04 Akim Demaille <demaille@gostai.com>
36
37 lalr1.cc: minor refactoring.
38 * data/lalr1.cc: Don't issue empty namespaces.
39
f5da8149
AD
402010-05-04 Akim Demaille <demaille@gostai.com>
41
42 tests: fix %printer.
43 Currently, there is no check that %printer ... <foo> (nor
44 %destructor) is about an existing <foo> type. This C++ test had
45 it wrong (<::std::string> vs. <std::string>).
46
47 * tests/c++.at (AT_CHECK_VARIANTS): In list.yy, redefine the
48 pretty-printing of lists into something better for parser traces.
49 Update the expected output.
50 Fix correspondance between %type/%token and %printer.
51
49976d5c
AD
522010-05-04 Akim Demaille <demaille@gostai.com>
53
54 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
55 * tests/calc.at (Span): Instead of begin/end, as in the built-in
56 location class, use first and last.
57 Define YYLLOC_DEFAULT to adjust to these changes.
58 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
59 location_type changes.
60
bc81de36
JD
612010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
62
63 tests: fix maintainer-xml-check.
64 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
65 Update output to include comments now produced by --graph.
66 (xsl:template match="automaton"): As for --graph, name the
67 digraph after the grammar file.
68 * src/print-xml.c (escape_bufs): Enlarge array.
69 (print_xml): Add bug-report and url attributes to
70 bison-xml-report element.
71
b7666378
JD
722010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
73
74 In DOT output, convert from "/*" comments to "//" comments.
75 This handles the possibility that a "*/" might appear in
76 variable portions of those comments at some point in the future.
77 * src/graphviz.c (start_graph): Implement.
78
9b5049bd
JD
792010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
80
81 Document that undefined %prec identifier warnings will remain.
82 * NEWS (2.4.3): Here.
83 (2.4.2): Here.
84
02354690
JD
852010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
86
87 Revert 2009-12-30 change for undefined %prec token complaints.
88 That is, keep them as warnings because that should be sufficient
89 to satisfy POSIX without creating backward compatibility issues.
90 Suggested by Richard Stallman at
91 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
92 * NEWS (2.5): Remove mention of complaint.
56e92e0b
JD
93 * src/reader.c (grammar_rule_check): Convert complaint back to
94 warning.
02354690
JD
95 * tests/input.at (%prec's token must be defined): Update.
96
a7ddefd1
JD
972010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
98
99 build: don't require src/bison during bootstrap.
100 Suggested by Eric Blake at
101 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
102 * bootstrap.conf (bootstrap_epilogue): New function to make sure
103 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
104
c1bd4b2b
JD
1052010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
106
107 i18n: fix untranslatable string.
108 Reported by Goran Uddeborg at
109 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
110 * src/muscle-tab.c (muscle_percent_define_insert): Here.
111
67f1a2c2
AD
1122010-04-13 Akim Demaille <demaille@gostai.com>
113
114 tests: calc: minor refactoring.
115 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
116
4f756f88
AD
1172010-04-13 Akim Demaille <demaille@gostai.com>
118
119 tests: calc: simplify location management.
120 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
121 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
122 define the appropriate AT_LOC accessors.
123 * tests/calc.at: Use AT_LOC accessors.
124
24bb8c8c
AD
1252010-04-13 Akim Demaille <demaille@gostai.com>
126
127 test location_type.
128 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
129 Define AT_LOCATION_TYPE_IF.
130 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
131 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
132 used, provide a user location type and use it.
133 (Simple LALR1 C++ Calculator): Add a test case for location_type.
134
af129079
AD
1352010-04-13 Akim Demaille <demaille@gostai.com>
136
137 tests: check fclose's return value.
138 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
139
36dc3637
AD
1402010-04-13 Akim Demaille <demaille@gostai.com>
141
142 tests: don't depend on the actual location type.
143 * tests/calc.at: Use yy::parser::location_type rather than
144 yy::location, since the former is always right, and might point to
145 another type than the latter.
146
c499231d
AD
1472010-04-13 Akim Demaille <demaille@gostai.com>
148
149 formatting changes.
150 * tests/calc.at: Formatting changes.
151
7799ef15
AD
1522010-04-13 Akim Demaille <demaille@gostai.com>
153
154 lalr1.cc: remove useless forward declaration.
155 * data/lalr1.cc: Include location.hh before stack.hh.
156 Remove the useless forward declarations of position and location.
157 Reported by Chris Morley.
158 * data/glr.cc: Likewise.
159
06cb07d5
JD
1602010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
161
162 * NEWS (2.4.3): Mention fix for Sun Studio C++.
163
4586c8cd
JD
1642010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
165
166 tests: fix for newer Sun Studio C++.
167 Reported by Dagobert Michelsen at
168 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
169 * THANKS (Dagobert Michelsen): Add.
170 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
171 Autoconf macro for handling the restrict keyword.
172 * gnulib: Update to latest, which no longer overrides that macro
173 from Autoconf.
174
44c2b42d
JD
1752010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
176
177 portability: fix pointer arithmetic to conform to C standard.
178 Reported by Tys Lefering at
179 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
180 This fix is already implemented in glr.c and does not apply to
181 lalr1.java.
182 * data/lalr1.cc (yy::parser::parse): Increase size of
183 yyerror_range and adjust subscripting so you don't have to
184 subtract one from the beginning of the array.
185 * data/yacc.c (b4_declare_parser_state_variables,
186 yyparse, yypush_parse): Likewise.
187
218287f5
AD
1882010-04-05 Akim Demaille <demaille@gostai.com>
189
190 remove useless include.
191 * src/graphviz.h: Don't include stdbool.h.
192
8176ab33
AD
1932010-04-05 Akim Demaille <demaille@gostai.com>
194
195 graph: sign the output file.
196 * src/graphviz.c (start_graph): Issue comments about Bison.
197 Suggested by Tys Lefering.
198
4ad3921d
JD
1992010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
200
201 portability: fix test suite for GCC 4.5's new #error message.
202 Reported by Tys Lefering at
203 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
204 * NEWS (2.4.3): Mention.
205 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
206
10a697de
AD
2072010-03-30 Akim Demaille <demaille@gostai.com>
208
209 fix comments.
210 * src/graphviz.h: Add missing license notice.
211 Document.
212
d6b347e4
AD
2132010-03-25 Akim Demaille <demaille@gostai.com>
214
215 tests: fix 250: parse.error=verbose overflow.
216 * tests/regression.at (parse.error=verbose overflow): Avoid the
217 double inclusion of stdlib.h as it triggers hard errors.
218
b8675840
JD
2192010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
220
221 portability: fix for BSD make.
222 Reported by Johan van Selst at
223 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
224 * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in
225 this dependency list as in package.m4's target rule.
226
8b9e021f
JD
2272010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
228
229 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
230 Reported by Johan van Selst at
231 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
232 * NEWS (2.4.3): New.
233 * THANKS (Johan van Selst): Add.
234 * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
235 targets so that gnulib's new c++defs.h is matched.
236 * gnulib: Update to latest.
237
96a381c5
JD
2382010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
239
240 maint: update for changes to gnulib's announce-gen.
241 * HACKING (Announce): RELEASE_TYPE=major must now be written
242 RELEASE_TYPE=stable.
243
e19a049c
JD
2442010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
245
246 Version 2.4.2.
247 * NEWS (2.4.2): Set version and date. For the recent test suite
248 portability fixes, don't be so optimistic about their success
249 given the lack of feedback on the affected platforms.
250
890aeb28
JD
2512010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
252
253 tests: fix maintainer-xml-check for recent changes.
254 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
255 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
256 output file whose name conflicts with a previous output file
257 is now never generated.
258
f39ab286
JD
2592010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
260
261 portability: fix several issues with M4 subprocess.
262
263 M4's output pipe was not being drained upon fatal errors during
264 scan_skel. As a result, broken-pipe messages from M4 were seen
265 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
266 failure in the test suite. The problem was that, on platforms
267 where the default disposition for SIGPIPE is ignore instead of
268 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
269 then reported it. However, there's some sort of race condition,
270 because the new test group occasionally succeeded.
271 Reported by Albert Chin at
272 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
273
274 There were also problems with the test suite livelocking on
275 Tru64 5.1b. Reported by Didier Godefroy at
276 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
277 Switching to create_pipe_bidi suggested by Akim Demaille.
278
279 To attempt to solve both of these problems, switch to gnulib's
280 create_pipe_bidi and register M4 process as a slave. Along the
281 way, clean up file name conflict handling, which was affected by
282 the broken-pipe problem before the switch.
283 * NEWS (2.4.2): Document.
284 * THANKS (Didier Godefroy): Add.
285 * bootstrap.conf (gnulib_modules): Add pipe.
286 * gnulib: Update to latest to make sure we have all the latest
287 fixes.
288 * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and
289 subpipe.c.
290 * po/POTFILES.in (lib/subpipe.c): Remove.
291 * src/files.c (compute_output_file_names): Update invocations
292 of output_file_name_check.
293 (output_file_name_check): In the case that the grammar file
294 would be overwritten, use complain instead of fatal, but replace
295 the output file name with /dev/null. Use the /dev/null solution
296 for the case of two conflicting output files as well because it
297 seems safer in case Bison one day tries to open both files at
298 the same time.
299 * src/files.h (output_file_name_check): Update prototype.
300 * src/output.c (output_skeleton): Use create_pipe_bidi and
301 wait_subprocess. Assert that scan_skel completely drains the
302 pipe.
303 * src/scan-skel.l (at_directive_perform): Update
304 output_file_name_check invocation.
305 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
306 grammar file actually isn't overwritten.
307 (Conflicting output files: -o foo.y): Update expected output.
308 * tests/skeletons.at (Fatal errors but M4 continues producing
309 output): New test group.
310
e32050b0
JD
3112010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
312
313 Update POTFILES.
314 * HACKING (Release Procedure): Add reminder about keeping
315 POTFILES files up-to-date.
316 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
317
efc4ed4a
JD
3182010-02-01 Joel E. Denny <jdenny@clemson.edu>
319
320 Code cleanup.
321 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
322 which is already defined in atconfig.
323
95611b56
JD
3242010-01-22 Joel E. Denny <jdenny@clemson.edu>
325
326 tests: fix missing include caught by g++ 4.4.1.
327 Reported by Tys Lefering.
328 * HACKING (Release checks): Add note about trying a recent GCC.
329 * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include
330 cstdlib for abort.
331 (_AT_DATA_EXPECT2_Y): Likewise.
332
d6e40cba
JD
3332010-01-21 Joel E. Denny <jdenny@clemson.edu>
334
335 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
336
80b70223
JD
3372010-01-21 Joel E. Denny <jdenny@clemson.edu>
338
339 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
340 * HACKING (Release Procedure): Update notes on copyright years.
341 * Makefile.am (update-package-copyright-year): New target rule.
342 * build-aux/update-package-copyright-year: New file.
343 * cfg.mk (update-copyright): Add update-package-copyright-year
344 as a dependency.
345
3320a276
JD
3462010-01-19 Joel E. Denny <jdenny@clemson.edu>
347
348 * bootstrap: Import improvements from latest gnulib.
349
e30c0477
JD
3502010-01-19 Joel E. Denny <jdenny@clemson.edu>
351
352 build: require Automake 1.11.1 to avoid a security flaw.
353 * HACKING (Release Procedure): Don't document Automake security
354 flaw here.
355 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
356 why here.
357
a538eeb1
JD
3582010-01-19 Joel E. Denny <jdenny@clemson.edu>
359
360 gnulib: update to latest.
361
d6bdb90a
JD
3622010-01-19 Joel E. Denny <jdenny@clemson.edu>
363
364 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
365
326e5cf8
JD
3662010-01-15 Joel E. Denny <jdenny@clemson.edu>
367
368 Thank the developer of the initial push parser implementation.
369 This unfortunate oversight is several years old.
370 * THANKS (Odd Arild Olsen): Add.
371
fca9c5ef
JD
3722010-01-04 Joel E. Denny <jdenny@clemson.edu>
373
374 Fix some comments concerning LR(0) versus LALR(1).
375
376 Stop equating LR(0) with nondeterminism and LALR(1) with
377 determinism. That is, if all states are consistent, then LR(0)
378 tables are deterministic. On the other hand, LALR(1) tables
379 might be nondeterministic before conflict resolution, and GLR
380 permits LALR(1) tables to remain nondeterministic.
381 * src/LR0.c, src/LR0.h: Here.
382 * src/lalr.c, src/lalr.h: Here.
383 * src/main.c (main): Here.
384 * src/state.c, src/state.h: Here.
385
386 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
387 parser tables.
388
e141f4d4
JD
3892010-01-04 Joel E. Denny <jdenny@clemson.edu>
390
391 maint: run "make update-copyright"
392
882be728
JD
3932009-12-30 Joel E. Denny <jdenny@clemson.edu>
394
395 POSIX: complain if %prec's token was not defined.
396 * NEWS (2.5): Document.
397 * src/reader.c (grammar_rule_check): Convert warning to
398 complaint.
399 * tests/input.at (%prec's token must be defined): Update.
400
8bb3a2e7
JD
4012009-12-30 Joel E. Denny <jdenny@clemson.edu>
402
403 POSIX: warn if %prec's token was not defined.
404 Reported by Florian Krohm at
405 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
406 * NEWS (2.4.2): Document.
407 * src/reader.c (grammar_rule_check): Implement.
408 (grammar_current_rule_prec_set): Add comments explaining that we
409 here assume a %prec identifier is a token, but we still manage
410 to support POSIX.
411 * tests/input.at (%prec's token must be defined): New test
412 group.
413
505e1551
JD
4142009-12-31 Joel E. Denny <jdenny@clemson.edu>
415
416 * HACKING (Release Procedure): Recommend a secure automake.
417
b8d19cf8
JD
4182009-12-29 Joel E. Denny <jdenny@clemson.edu>
419
420 portability: `<' and `>' are not always defined on addresses.
421 Specifically, don't sort objects by their memory addresses when
422 they're not allocated in the same array or other object. Though
423 I haven't found a test case where that fails on my platform, C
424 says the behavior is undefined.
425 * src/AnnotationList.c (AnnotationList__insertInto): Remove
426 FIXME. Use new id field of InadequacyList nodes rather than
427 their memory addresses when sorting.
428 (AnnotationList__compute_from_inadequacies): Add
429 inadequacy_list_node_count argument to pass to
430 InadequacyList__new_conflict.
431 * src/AnnotationList.h
432 (AnnotationList__compute_from_inadequacies): Update prototype
433 and documentation for new argument.
434 * src/InadequacyList.c (InadequacyList__new_conflict): Add
435 node_count argument and use it to assign a unique ID.
436 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
437 (InadequacyList): Add id field.
438 (InadequacyList__new_conflict): Update prototype and
439 documentation for new argument.
440 * src/ielr.c (ielr_compute_annotation_lists): Update
441 AnnotationList__compute_from_inadequacies invocation.
442
df222dfa
JD
4432009-12-20 Joel E. Denny <jdenny@clemson.edu>
444
445 Fix handling of yychar manipulation in user semantic actions.
446 The problem was that yacc.c didn't always update the yychar
447 translation afterwards. However, other skeletons appear to be
448 fine. glr.c appears to already translate yychar before every
449 use. lalr1.cc does not define yychar and does not document its
450 replacement, yyla, for users. It does provide yyclearin, but
451 that does not manipulate yyla and thus requires no translation
452 update. In lalr1.java, yychar is out of scope during semantic
453 actions.
454 * NEWS (2.5): Document.
455 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
456 yytoken here.
457 (yyparse, yypush_parse): Instead, translate before every use of
458 yytoken, and add comments explaining this approach.
459 * tests/actions.at (Destroying lookahead assigned by semantic
460 action): New test group checking that translation happens before
461 lookahead destructor calls at parser return. Previously,
462 incorrect destructors were called.
463 * tests/conflicts.at (parse.error=verbose and consistent
464 errors): New test group checking that translation happens at
465 syntax error detection before the associated verbose error
466 message and the associated lookahead destructor calls. While
467 the destructor call is fixed by this patch, the verbose error
468 message is currently incorrect due to another bug (see
469 comments in test group), so this is an expected failure for now.
470
4395a9ff
JD
4712009-12-21 Joel E. Denny <jdenny@clemson.edu>
472
473 YYFAIL: warn about uses and remove from lalr1.java.
474 * NEWS (2.5): Document.
475 * data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
476 and make it private. Update all uses.
477 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
478
1625df5b
JD
4792009-12-21 Joel E. Denny <jdenny@clemson.edu>
480
481 YYFAIL: deprecate.
482 * NEWS (2.4.2): Document deprecation and the phase-out plan.
483 * data/lalr1.java (parser::YYStack::YYFAIL): Add comment about
484 deprecation.
485 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
486 YYFAIL from GCC cpp's -Wunused-macros.
487 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
488 documentation.
489 (LocalWords): Remove YYFAIL.
490
5335b65a
JD
4912009-12-20 Joel E. Denny <jdenny@clemson.edu>
492
493 tests: cleanup.
494 * tests/c++.at (Syntax error discarding no lookahead): Don't
495 ignore stderr. Instead, eliminate remaining warnings.
496
d59beda0
JD
4972009-12-18 Joel E. Denny <jdenny@clemson.edu>
498
499 lalr1.cc: don't discard non-existent lookahead on syntax error.
500 * data/lalr1.cc (parser::parse): Check yyempty first.
501 * tests/c++.at (Syntax error discarding no lookahead): New test
502 group.
503
387b4d50
JD
5042009-12-17 Joel E. Denny <jdenny@clemson.edu>
505
506 Code cleanup.
507 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
508 function, which is no longer used.
509
a603c6e0
JD
5102009-12-16 Joel E. Denny <jdenny@clemson.edu>
511
512 Add gcc's -Wundef to test suite and fix another warning from it.
513 * NEWS (2.4.2): Update description of -Wundef fix.
514 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
515 (WARN_CFLAGS_TEST): New substitution.
516 * data/glr.c: Avoid warning about __STRICT_ANSI__.
517 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
518 WARN_CFLAGS.
519 (NO_WERROR_CFLAGS): Likewise.
520 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
521
19750d31
JD
5222009-12-16 Joel E. Denny <jdenny@clemson.edu>
523
524 * data/yacc.c: Reformat m4 a little.
525
c938d650
JD
5262009-12-16 Joel E. Denny <jdenny@clemson.edu>
527
528 Document gcc -Wundef fix.
529 * NEWS (2.4.2): Here.
530 * THANKS (Jonathan Nieder): Add.
531
fcd32abd
JN
5322009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
533
534 Simplify y.tab.c when location tracking is disabled.
535 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
536 tracking is not enabled. Instead, unconditionally define
537 YY_LOCATION_PRINT as a no-op for backward compatibility.
538
ae93128c
JN
5392009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
540
541 Avoid warnings from gcc -Wundef y.tab.c.
542 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
543 defined before using them.
544 * data/lalr1.cc: Likewise.
545 * data/yacc.c: Likewise.
546
c843aaab
JD
5472009-12-15 Joel E. Denny <jdenny@clemson.edu>
548
549 autoconf: update to latest for fix of M4 detection.
550 Reported by Eric Blake.
551 * submodules/autoconf: Update.
552
5c99151a
JD
5532009-12-15 Joel E. Denny <jdenny@clemson.edu>
554
555 portability: use -DGNULIB_POSIXCHECK.
556 Reported by Eric Blake. See discussions at
557 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
558 and
559 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
560 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
561 * bootstrap.conf (gnulib_modules): Add all the printf modules
562 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
563 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
564 (excluded_files): Remove m4/printf-posix.m4.
565 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
566 lib/libbison.a so gnulib libraries can be linked.
567
75f94c6d
JD
5682009-12-15 Joel E. Denny <jdenny@clemson.edu>
569
570 gnulib: update for fix of fprintf-posix, which we'll use soon.
571 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
572 targets so that gnulib's new arg-nonnull.h and link-warning.h
573 are matched.
574 * gnulib: Update.
575
ca01f454
JD
5762009-12-14 Joel E. Denny <jdenny@clemson.edu>
577
578 Enable assertion output and --disable-assert for configure.
579 * bootstrap.conf (gnulib_modules): Add assert module.
580 * src/system.h (aver): Define as assert, and summarize the
581 discussion on this issue.
582
9dc3ee6d
JD
5832009-12-14 Joel E. Denny <jdenny@clemson.edu>
584
585 Expand GLR acronym in summary of Bison.
586 Based on discussion with Akim Demaille starting at
587 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
588 * doc/bison.texinfo (Introduction): Here.
589 * src/getargs.c (usage): Here.
590
d013372c
AR
5912009-10-03 Alex Rozenman <rozenman@gmail.com>
592
593 Document named references.
594 * doc/bison.texinfo (Actions): Add new example and xref to
595 Using Named References node.
596 (Using Named References): New node.
597
5297ebb3
JD
5982009-10-16 Joel E. Denny <jdenny@clemson.edu>
599
600 cleanup.
601 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
602 of char*.
603 (Sbitset__isEmpty): Use Sbitset instead of char*.
604 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
605 instead of char. This helps to avoid casting errors.
606 (Sbitset__or): Use Sbitset instead of char*.
607
175620d3
JD
6082009-10-16 Joel E. Denny <jdenny@clemson.edu>
609
610 portability: don't assume 8-bit bytes.
611 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
612 * src/Sbitset.h (Sbitset__nbytes): Here.
613 (Sbitset__byteAddress): Here.
614 (Sbitset__bit_mask): Here.
615 (Sbitset__last_byte_mask): Here.
616 (Sbitset__ones): Here.
617 (SBITSET__FOR_EACH): Here.
618
786578e3
JD
6192009-10-11 Joel E. Denny <jdenny@clemson.edu>
620
621 portability: use va_start and va_end in the same function.
622 * src/complain.c (error_message): Move va_end from here...
623 (ERROR_MESSAGE): ... to here.
624
416a9da6
JD
6252009-10-08 Joel E. Denny <jdenny@clemson.edu>
626
627 * data/bison.m4: Update comments for rename to muscle-tab.h.
628
10659d0e
JD
6292009-10-07 Joel E. Denny <jdenny@clemson.edu>
630
631 Minor code cleanup.
632 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
633 replace all uses with UNIQSTR_CONCAT.
634 * src/uniqstr.c (uniqstr_vsprintf): New function.
635 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
636 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
637 macros.
638
3c5362b8
JD
6392009-10-06 Joel E. Denny <jdenny@clemson.edu>
640
641 * TODO (Complaint submessage indentation): New.
642
b143f404
JD
6432009-10-04 Joel E. Denny <jdenny@clemson.edu>
644
645 Minor code cleanup.
646 * src/parse-gram.y: Clean up sorting of declarations.
647 Use types to simplify %printer declarations where possible.
648 Provide %printer for BRACKETED_ID and symbol.prec.
649 * src/symtab.c: Whitespace change.
650
7439c5c0
JD
6512009-10-04 Joel E. Denny <jdenny@clemson.edu>
652
653 tests: skip tests of file names that platform does not support.
654 Reported by Michael Raskin at
655 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
656 * THANKS (Michael Raskin): Add.
657 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
658 to fail at least for file names containing ":" or "\".
659
45319f13
JD
6602009-09-23 Joel E. Denny <jdenny@clemson.edu>
661
662 yysyntax_error: avoid duplicate lookahead collection.
663 Except when memory reallocation is required, this change
664 eliminates the need to invoke yysyntax_error twice and thus to
665 repeat the collection of lookaheads. It also prepares for
666 future extensions that will make those repetitions more
667 expensive and that will require additional memory management in
668 yysyntax_error. Finally, it fixes an obscure bug already
669 exercised in the test suite.
670 * data/yacc.c (yysyntax_error): Add arguments for message
671 buffer variables stored in the parser. Instead of size, return
672 status similar to yyparse status but indicating success of
673 message creation. Other than the actual reallocation of the
674 message buffer, import and clean up memory management code
675 from...
676 (yyparse, yypush_parse): ... here.
677 * tests/regression.at (parse.error=verbose overflow): No longer
678 an expected failure.
679
52cea04a
JD
6802009-09-23 Joel E. Denny <jdenny@clemson.edu>
681
682 yysyntax_error: test memory management more.
683 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
684 * tests/regression.at (parse.error=verbose and
685 YYSTACK_USE_ALLOCA): New test group.
686 (parse.error=verbose overflow): New test group that reveals an
687 obscure bug. Expected fail for now.
688
37318e2f
JD
6892009-10-04 Joel E. Denny <jdenny@clemson.edu>
690
691 benchmarks: use %debug consistently among grammars.
692 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
693 %debug by default. It can affect the timings even if yydebug=0.
694 (generate_grammar_calc): For consistency with other grammars,
695 use YYDEBUG environment variable to set yydebug.
696
f74d6d25
JD
6972009-10-03 Joel E. Denny <jdenny@clemson.edu>
698
699 Remove dead code.
700 * src/symtab.c (symbol_pack): Here because every symbol's number
701 is always defined by this time.
702
5b1ff423
AR
7032009-10-03 Alex Rozenman <rozenman@gmail.com>
704
705 Add additional space after periods in NEWS.
706 * NEWS (2.5): here.
707
47eced30
JD
7082009-09-29 Joel E. Denny <jdenny@clemson.edu>
709
710 Use the correct conversion specifier for size_t.
711 Reported by Jim Meyering.
712 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
713 because Sbitset__Index is size_t.
714 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
715
d8f68fc2
JD
7162009-09-27 Joel E. Denny <jdenny@clemson.edu>
717
718 tests: don't abuse AT_BISON_CHECK.
719 * tests/regression.at (parse-gram.y: LALR = IELR): Move
720 additional shell commands outside of AT_BISON_CHECK.
721
43aabb70
JD
7222009-09-26 Joel E. Denny <jdenny@clemson.edu>
723
724 tests: check that parse-gram.y's IELR and LALR are identical.
725 * tests/atlocal.in (abs_top_srcdir): New shell variable.
726 * tests/regression.at (parse-gram.y: LALR = IELR): New test
727 group.
728
66381412
AR
7292009-09-19 Alex Rozenman <rozenman@gmail.com>
730
731 Keep sub-messages aligned. Fix strings for translation.
5b1ff423
AR
732 * src/location.h (location_print): Add return value.
733 * src/location.c (location_print): Return number of printed
66381412 734 characters.
5b1ff423
AR
735 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
736 new functions.
737 * src/complain.cpp (indent_ptr): New static variable.
738 (error_message, complain_at_indent, warn_at_indent): Implement
739 the alignment mechanism.
740 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
741 for translations. Use new alignment mechanism.
742 * tests/named-ref.at: Adjust test-cases.
66381412
AR
743 * NEWS (2.5): Add an announcement about named references.
744
a6ca4ce2
AD
7452009-09-17 Akim Demaille <demaille@gostai.com>
746
747 doc: fixes.
748 * doc/bison.texinfo: here.
749 Reported by Alex Rozenman.
750
3cdc21cf
AD
7512009-09-16 Akim Demaille <demaille@gostai.com>
752
753 doc: lalr1.cc and variants.
754 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
755 "variant" %define variables.
756 (C++ Semantic Values): Split into...
757 (C++ Unions, C++ Variants): these.
758 The latter is new.
759 (C++ Parser Interface): Fix type names.
760 Document parser::syntax_error.
761 Document the fact that locations are not mandatory.
762 (C++ Scanner Interface): Split into...
763 (Split Symbols, Complete Symbols): these.
764 The later is new.
765 (Calc++ Parsing Driver): Use variants.
766 Add more comments.
767 Adjust style.
768 (Calc++ Parser): Declare all the tokens, no
769 longer accept raw characters.
770 Remove %union.
771 Adjust types and printers.
772 Remove destructors.
773 (Calc++ Scanner): Use make_<SYMBOL> functions.
774 Use strerror in error message.
775
f50bfcd6
AD
7762009-09-16 Akim Demaille <demaille@gostai.com>
777
778 doc: spell checking.
779 * doc/bison.texinfo: here.
780
6b5a0de9
AD
7812009-09-16 Akim Demaille <demaille@gostai.com>
782
783 doc: comment changes.
784 * doc/bison.texinfo: Comment changes.
785
2b08bceb
AD
7862009-09-16 Akim Demaille <demaille@gostai.com>
787
788 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
789 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
790 constructor to take a token_type instead of the (internal) symbol
791 number.
792 Call yytranslate_.
793 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
794 don't call yytranslate_ here.
795
c981ce9b
AD
7962009-09-16 Akim Demaille <demaille@gostai.com>
797
798 TODO: statistics.
799 * TODO (Figures): New.
800
00d80a9c
JD
8012009-09-13 Joel E. Denny <jdenny@clemson.edu>
802
803 tests: clean up push.at test group titles.
804 * tests/push.at: Remove "Push Parsing: " from test group titles
805 because these are already under the banner "Push Parsing Tests".
806
f64e406b
AR
8072009-09-12 Alex Rozenman <rozenman@gmail.com>
808
809 Provide an additional sub-message for clarity.
810 Add "symbol not found in production" error message when
811 an "invalid reference" is detected in named references
812 resolution.
813 * src/scan-code.l: Update "invalid reference" case.
814 * tests/named-ref.at: Adjust test-cases.
815
bb31eb56
JD
8162009-09-10 Joel E. Denny <jdenny@clemson.edu>
817
818 Clean up yacc.c a little.
819 * data/yacc.c: Clean up M4 for readability, and make output
820 whitespace more consistent. For the main parse function
821 comment, instead of saying "yyparse or yypush_parse", say either
822 "yyparse" or "yypush_parse" depending on which it actually is.
823
2d399888
JD
8242009-09-10 Joel E. Denny <jdenny@clemson.edu>
825
826 Fix --enable-gcc-warnings.
827 * src/parse-gram.y (%printer <param>): Handle param_none.
828
ff601366
AD
8292009-09-09 Akim Demaille <demaille@gostai.com>
830
831 lalr1.cc: syntax_error as exceptions.
832 It is common to use sort of factories in the user actions. These
833 factories may check some "syntactic" constraints that are not
834 enforced by the grammar itself. This is possible using YYERROR
835 within the action itself. Provide the user with a means to throw
836 a syntax_error exception.
837
838 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
839 Declare and define yy::parser::syntax_error.
840 * data/lalr1.cc: Include stdexcept.
841 (yy::parser::parse): Wrap the user action within a try/catch.
842 * data/glr.cc: Include stdexcept.
843
29660062
AD
8442009-09-09 Akim Demaille <demaille@gostai.com>
845
846 lalr1.cc: add missing "inline".
847 * data/c++.m4 (b4_public_types_define): Add missing inline to
848 implementations provided in headers.
849
2055a44e
AD
8502009-09-09 Akim Demaille <demaille@gostai.com>
851
852 %param: documentation.
853 * NEWS (2.6): Document %param, %lex-param, and %parse-param
854 changes.
855 * doc/bison.texinfo: Document that %lex-param and %parse-param
856 are n-ary.
857 Changes some examples to demonstrate it.
858 (Calc++ Parser): Use %param.
859
dd875058
AD
8602009-09-09 Akim Demaille <demaille@gostai.com>
861
862 Regen.
863
f71db70b
AD
8642009-09-09 Akim Demaille <demaille@gostai.com>
865
866 style changes.
867 * src/parse-gram.y (add_param): Scope changes.
868
eaca4c11
AD
8692009-09-09 Akim Demaille <demaille@gostai.com>
870
871 %parse: support several arguments.
872 * src/parse-gram.y (current_param): New.
873 (param_type): Add param_none.
874 (params): New nonterminal.
875 Use it.
876
b18cdd91
AD
8772009-09-09 Akim Demaille <demaille@gostai.com>
878
879 Regen.
880
a7706735
AD
8812009-09-09 Akim Demaille <demaille@gostai.com>
882
883 %param.
884 Provide a means to factor lex-param and parse-param common
885 declarations.
886
887 * src/parse-gram.y (param_type): New.
888 Define a %printer for it.
889 (add_param): Use it.
890 (%parse-param, %lex-param): Merge into...
891 (%parse): this new token.
892 Adjust the grammar to use it.
893 * src/scan-gram.l (RETURN_VALUE): New.
894 (RETURN_PERCENT_FLAG): Use it.
895 (RETURN_PERCENT_PARAM): New.
896 Use it to support %parse-param, %lex-param and %param.
897
9789acf0
JD
8982009-09-03 Joel E. Denny <jdenny@clemson.edu>
899
900 Use aver not assert.
901 * src/output.c: Don't include assert.h.
902 (output_skeleton): Use aver not assert.
903 * src/system.h (aver): In documentation of why, add links to
904 Paul Eggert's explanations in the mailing lists.
905
61bc57e5
AR
9062009-09-05 Alex Rozenman <rozenman@gmail.com>
907
908 Use "Unresolved reference" error message when no symbols were found
909 in a symbolic reference resolution. Remove .expr and -expr from
910 the shown reference when the reference is unresolved.
911 * src/scan-code.l: Change the error message, adjust location columns,
912 rename variable "exact_mode" to "explicit_bracketing".
913 * tests/named-ref.at: Adjust existing tests and add a new one.
914
f4c75eaf
AD
9152009-09-04 Akim Demaille <demaille@gostai.com>
916
917 Adjust synclines in src/parse-gram.[ch].
918 * tests/bison.in: Do some magic (including working around issues
919 with ylwrap) when this wrapper is used to compile
920 src/parse-gram.y.
921
c6abeab1
JD
9222009-09-03 Joel E. Denny <jdenny@clemson.edu>
923
924 Complain about unused %define variables and %code qualifiers.
925 * NEWS (2.5): Document.
926 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
927 * doc/bison.texinfo (Decl Summary): Document complaint, and
928 improve %define documentation a little otherwise.
929 * tests/input.at (Reject unused %code qualifiers): Update.
930 (%define errors): Update.
931 (%define, --define, --force-define): Update.
932 (%define backward compatibility): Update.
933 (Unused %define api.pure): Update.
934 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
935
82db7cdb
JD
9362009-09-03 Joel E. Denny <jdenny@clemson.edu>
937
938 Don't suppress warnings about unused parse.error.
939 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
940 %define variable parse.error unless b4_error_verbose_flag is
941 actually expanded in a skeleton.
942
2755de8f
AD
9432009-09-03 Akim Demaille <demaille@gostai.com>
944
945 * NEWS (2.4.2): Add "Internationalization" item.
946
1deef26d
AD
9472009-09-03 Akim Demaille <demaille@gostai.com>
948
949 bootstrap: fix/improve find_tool.
950 * bootstrap (find_tool): Improve error messages.
951 Fix typo about find_tool_names.
952
2646cd54
JD
9532009-08-29 Joel E. Denny <jdenny@clemson.edu>
954
955 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
956 See
957 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
958 * src/scan-code.h (code_props_rule_action_init): Rename
959 named_ref arg to name so it doesn't shadow named_ref type. This
960 makes it consistent with the function definition in scan-code.l
961 anyway.
962
cf499cff
JD
9632009-08-28 Joel E. Denny <jdenny@clemson.edu>
964
965 %define: accept unquoted values.
966 * NEWS (2.5): Group all %define changes together, and document
967 this one. Remove quotes in IELR and canonical LR entry.
968 * doc/bison.texinfo: Remove quotes in most examples throughout.
969 (Decl Summary): Update %define documentation.
970 (Table of Symbols): Likewise.
971 * src/ielr.c (LrType): Update documentation.
972 * src/parse-gram.y (content.opt): Add production for ID.
973 * tests/actions.at: Remove quotes in most tests.
974 * tests/calc.at: Likewise.
975 * tests/existing.at: Likewise.
976 * tests/input.at: Likewise.
977 * tests/local.at: Likewise.
978 * tests/push.at: Likewise.
979 * tests/reduce.at: Likewise.
980 * tests/torture.at: Likewise.
981
6ba96404
JD
9822009-08-28 Joel E. Denny <jdenny@clemson.edu>
983
984 %define lr.type: make values lowercase IDs.
985 That is, "LALR" => "lalr", "IELR" => "ielr", and
986 "canonical LR" => "canonical-lr".
987 * NEWS (2.5): Update documentation.
988 * doc/bison.texinfo (Decl Summary): Likewise.
989 * src/ielr.c (ielr): Use new values.
990 * src/ielr.h (ielr): Update documentation.
991 * src/reader.c (prepare_percent_define_front_end_variables): Use
992 and validate new values.
993 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
994 grammars.
995 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
996
4413bbd3
EB
9972009-08-27 Eric Blake <ebb9@byu.net>
998
999 scan-gram: avoid portability trap with ctype usage.
1000 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
1001 Avoid compiler warning.
1002
b70c7fb4
JD
10032009-08-27 Joel E. Denny <jdenny@clemson.edu>
1004
1005 tests: use perl for printing special sequences to files.
1006 And skip tests if perl is not available. This is better than
1007 playing tricks with shell portability. Suggested by Akim
1008 Demaille.
1009 * tests/input.at (Bad character literals): Use it here for
1010 omitting final newlines.
1011 (Bad escapes in literals): Use it here for special characters.
1012
d1cc31c5
JD
10132009-08-26 Joel E. Denny <jdenny@clemson.edu>
1014
1015 tests: show a use of %define lr.default-reductions "consistent"
1016 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
1017 prevents the omission of expected tokens for %error-verbose.
1018
3bed3a75
AD
10192009-08-26 Akim Demaille <demaille@gostai.com>
1020
1021 tests: portability fix.
1022 * tests/input.at (Bad escapes in literals): Don't expect "echo
1023 '\0'" to output \ then 0.
1024
aa0cb40d
JD
10252009-08-26 Joel E. Denny <jdenny@clemson.edu>
1026
1027 Actually handle the yytable zero value correctly this time.
1028 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
1029 zero values in the YYTABLE comments.
1030 * data/glr.c (yytable_value_is_error): Don't check for zero
1031 value.
1032 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
1033 * data/yacc.c (yytable_value_is_error): Likewise.
1034 * data/lalr1.java (yy_table_value_is_error_): Likewise.
1035 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
1036 * src/tables.h: In header comments, explain why it's useless to
1037 check for a zero value in yytable.
1038
f2b30bdf
JD
10392009-08-25 Joel E. Denny <jdenny@clemson.edu>
1040
1041 More fixes related to last two patches.
1042 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
1043 comments: zero indicates syntax error not default action.
1044 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
1045 defined.
1046 * data/glr.c (yyis_pact_ninf): Rename to...
1047 (yypact_value_is_default): ... this.
1048 (yyisDefaultedState): Update for rename.
1049 (yyis_table_ninf): Rename to...
1050 (yytable_value_is_error): ... this, and check for value zero
1051 besides just YYTABLE_NINF.
1052 (yygetLRActions): Check for default value from yypact. It
1053 appears that this check is always performed before this function
1054 is invoked, and so adding the check here is probably redundant.
1055 However, the code may evolve after this subtlety is forgotten.
1056 Also, update for rename to yytable_value_is_error. Because that
1057 macro now checks for zero, a different but equivalent branch of
1058 the if-then-else here is evaluated.
1059 (yyreportSyntaxError): Update for rename to
1060 yytable_value_is_error. The zero condition was mishandled
1061 before.
1062 (yyrecoverSyntaxError): Update for renames. No behavioral
1063 changes.
1064 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1065 New function.
1066 (yy_table_value_is_error_): New function.
1067 (parse): Use new functions where possible. No behavioral
1068 changes.
1069 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1070 The zero condition was mishandled before.
1071 * data/yacc.c (yyis_pact_ninf): Rename to...
1072 (yypact_value_is_default): ... this.
1073 (yyis_table_ninf): Rename to...
1074 (yytable_value_is_error): ... this, and check for value zero
1075 besides just YYTABLE_NINF.
1076 (yysyntax_error): Update for rename to yytable_value_is_error.
1077 The zero condition was mishandled before.
1078 (yyparse): Update for renames. No behavioral changes.
1079 * src/tables.h: Improve comments about yypact, yytable, etc.
1080 more. Most importantly, say yytable value of zero means syntax
1081 error not default action.
1082
53f036ce
JD
10832009-08-25 Joel E. Denny <jdenny@clemson.edu>
1084
1085 Fix %error-verbose for conflicts resolved by %nonassoc.
1086 * NEWS (2.5): Document.
1087 * data/glr.c (yyreportSyntaxError): Fix this by checking
1088 yyis_table_ninf.
1089 * data/yacc.c (yysyntax_error): Likewise.
1090 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1091 yytable_ninf_.
1092 * data/lalr1.java (yysyntax_error): Likewise.
1093 * tests/conflicts.at (%nonassoc and eof): Update expected output
1094 and remove FIXME.
1095
87412882
JD
10962009-08-25 Joel E. Denny <jdenny@clemson.edu>
1097
1098 Some code and documentation improvements.
1099 * data/c.m4 (b4_table_value_equals): New macro to capture
1100 some repeated code.
1101 * data/glr.c (yyis_pact_ninf): Use it here.
1102 (yyis_table_ninf): Likewise.
1103 (yyreportSyntaxError): Improve internal comments.
1104 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1105 Use it everywhere possible.
1106 (yyis_table_ninf): Likewise.
1107 (yysyntax_error): Improve internal comments.
1108 * data/lalr1.cc (yysyntax_error_): Likewise.
1109 * data/lalr1.java (yysyntax_error): Likewise.
1110 * src/tables.h: Improve comments about yypact, yytable, etc.
1111
e6c849d8
JD
11122009-08-21 Joel E. Denny <jdenny@clemson.edu>
1113
1114 Use locale when quoting.
1115 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1116 quote rather than implementing quoting here.
1117
d8911864
EB
11182009-08-20 Eric Blake <ebb9@byu.net>
1119
b0778bdd
EB
1120 Make previous patch more robust.
1121 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1122 argmatch.h.
1123 (output_skeleton): Use it.
1124 Suggested by Akim Demaille.
1125
d8911864
EB
1126 Import latest m4/m4.m4.
1127 * submodules/autoconf: Update to autoconf 2.64.
1128 * configure.ac (M4_GNU_OPTION): New define.
1129 * src/output.c (output_skeleton): Use it to resolve FIXME.
1130 * NEWS: Mention this.
1131
c2724603
JD
11322009-08-19 Joel E. Denny <jdenny@clemson.edu>
1133
1134 Fix complaints about escape sequences.
1135 Discussed starting at
1136 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1137 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1138 For a \0 and similar escape sequences meaning the null
1139 character, report an invalid escape sequence instead of an
1140 invalid null character because the latter does not actually
1141 appear in the user's input.
1142 In all escape sequence complaints, don't escape the initial
1143 backslash, and don't quote when the sequence appears at the end
1144 of the complaint line unless there's whitespace that quotearg
1145 won't escape.
1146 Consistently say "invalid" not "unrecognized".
1147 Consistently prefer "empty character literal" over "extra
1148 characters in character literal" warning for invalid escape
1149 sequences; that is, consistently discard those sequences.
1150 * tests/input.at (Bad escapes in literals): New.
1151
17aed602
AD
11522009-08-19 Akim Demaille <demaille@gostai.com>
1153
1154 doc: fixes.
1155 * doc/bison.texinfo: Fix minor Texinfo errors.
1156
9142239a
AD
11572009-08-19 Akim Demaille <demaille@gostai.com>
1158
1159 tests: distcc compliance.
1160 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
1161 error messages from the output.
1162
171ad99d
AD
11632009-08-19 Akim Demaille <demaille@gostai.com>
1164
1165 variables: simplify the upgrade of namespace into api.namespace.
1166
1167 This patch simplifies "variables: rename namespace as
1168 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
1169 Suggested by Joel E. Denny in
1170 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
1171
1172 * src/muscle-tab.c (muscle_percent_variable_update): New.
1173 (muscle_percent_define_insert): Use it in replacement of the
1174 previous tr invocation.
1175 Remove variable_tr, no longer needed.
1176 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1177 Remove.
1178 * data/c++.m4: No longer handle namespace -> api.namespace.
1179 * tests/input.at (%define backward compatibility): Check that
1180 namespace is treated as api.namespace.
1181
d59e456d
AD
11822009-08-19 Akim Demaille <demaille@gostai.com>
1183
1184 doc: %initial-action to initialize yylloc.
1185 Reported by Bill Allombert.
1186 * doc/bison.texinfo: Set fill-column to 76.
1187 (Location Type): Document the use of %initial-action to initialize
1188 yylloc.
1189
ceb8b8e6
AD
11902009-08-19 Akim Demaille <demaille@gostai.com>
1191
1192 lalr1.cc: use state_type.
1193 * data/lalr1.cc (yysyntax_error_): Use state_type.
1194 Move argument names into yy*.
1195
7580c379
AD
11962009-08-19 Akim Demaille <demaille@gostai.com>
1197
1198 lalr1.cc: get rid of yyparse's yystate.
1199 yystate and yystack_[0].state are equal, keep only the latter.
1200 The former was also used as a temporary variable to compute the
1201 post-reduction state. Move this computation into an auxiliary
1202 function.
1203
1204 * data/glr.c (yyLRgotoState): Fuse variable definition and first
1205 assignment.
1206 * data/lalr1.cc (yy_lr_goto_state_): New.
1207 (yyparse): Use it.
1208 Replace remaining uses of yystate by yystate_[0].state.
1209 Remove the former.
1210
c4dc4c46
AD
12112009-08-19 Akim Demaille <demaille@gostai.com>
1212
1213 lalr1.cc: destroy $$ when YYERROR is called.
1214 * data/lalr1.cc (yyreduce): Compute the resulting state before
1215 running the user action so that yylhs is a valid symbol.
1216 (yyerrorlab): Since yylhs is complete (it knows its type), we can
1217 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
1218 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
1219
c67e466f
JD
12202009-08-18 Joel E. Denny <jdenny@clemson.edu>
1221
1222 maint: update for gnulib's recent update-copyright changes
1223 * gnulib: Update.
1224 * .x-update-copyright (COPYING): Add as it's no longer implied
1225 when .x-update-copyright is present.
1226 * cfg.mk (update-copyright-local): Remove, now ignored.
1227 (update-copyright): Declare update-b4-copyright as a dependency.
1228
af6d2358
AD
12292009-08-17 Akim Demaille <demaille@gostai.com>
1230
1231 build: require gettext 0.17.
1232
1233 Suggested by Bruno Haible.
1234 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1235 * configure.ac: require gettext 0.17 to ensure compatibility with
1236 gnulib.
1237
91a2b9b1
AD
12382009-08-17 Akim Demaille <demaille@gostai.com>
1239
1240 build: lower gettext requirements.
1241
1242 Bison was uselessly requiring the formatstring macros from
1243 gettext, which resulted in mo files not being installed on systems
1244 that perfectly supported Bison mo files. Lower the requirement.
1245 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1246
b0778bdd
EB
1247 * configure.ac: Require need-ngettext instead of
1248 need-formatstring-macros.
1249 Reported by Martin Jabocs.
1250 Suggested by Bruno Haible.
1251 * INSTALL: Restructure.
1252 (Internationalization): New.
91a2b9b1 1253
585935e8
JD
12542009-08-14 Joel E. Denny <jdenny@clemson.edu>
1255
1256 maint: fix use of copyright year intervals.
1257 * gnulib: Update.
1258 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1259 as now recommended in gnulib/NEWS.
1260 * build-aux/update-b4-copyright: Fix.
1261 * cfg.mk (update-copyright-env): Configure update-copyright.
1262
83b60c97
JD
12632009-08-13 Joel E. Denny <jdenny@clemson.edu>
1264
1265 Make it easier to write deterministic tests.
1266 Continues Akim's work from his 2009-06-10 commits.
1267 * src/reader.c (check_and_convert_grammar): Don't add any
1268 symbols after the first symbols_do invocation.
1269 * src/symtab.c (symbols_sorted): New static global.
1270 (user_token_number_redeclaration): Update comments.
1271 (symbol_from_uniqstr): If a new symbol is being created, assert
1272 that symbols_sorted hasn't been allocated yet.
1273 (symbols_free): Free symbols_sorted.
1274 (symbols_cmp, symbols_cmp_qsort): New functions.
1275 (symbols_do): Sort symbol_table into symbols_sorted on first
1276 invocation.
1277 * tests/input.at (Numbered tokens): Recombine tests now that the
1278 output should be deterministic across multiple numbers.
1279
28169bab
AD
12802009-08-12 Akim Demaille <demaille@gostai.com>
1281
1282 tests: GCC 4.5 compliance.
1283 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
1284 messages about #error.
1285
9f14e187
AD
12862009-08-12 Akim Demaille <demaille@gostai.com>
1287
1288 build: fix the generation of the documentation.
1289 Some of our targets use "bison --help", but they can't depend on
1290 "bison" itself (to avoid additional requirements on the user), so
1291 they used to call "make src/bison" in the commands. Then
1292 concurrent builds may fail: one make might be aiming one of its
1293 jobs at compiling src/bison, and another job at generating the man
1294 page. If the latter is faster than the former, then we have two
1295 makes that concurrently try to compile src/bison.
1296
1297 This might also be a more convincing explanation for the failure
1298 described in the patch "build: fix paths".
1299
1300 * Makefile.am (SUFFIXES): Initialize.
1301 * build-aux/move-if-change: New, symlink to gnulib's.
1302 * build-aux/local.mk: Ship it.
1303 * doc/common.x: Remove, merged into...
1304 * doc/bison.x: here.
1305 * doc/local.mk (doc/bison.help): New.
1306 ($(CROSS_OPTIONS_TEXI)): Depend on it.
1307 Use src/bison.
1308 (.x.1): Replace with...
1309 (doc/bison.1): this explicit, simpler, target.
1310 (common_dep): Remove, inlined where appropriate.
1311 (SUFFIXES, PREPATH): Remove, unused.
1312
d1b55e81
AD
13132009-08-12 Akim Demaille <demaille@gostai.com>
1314
1315 gnulib: improve prefixing.
1316 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
1317 change the value of...
1318 (gl_LIBOBJS): this.
1319 Adjust more variables.
1320 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
1321 gl_LIBOBJS.
1322 (prefix): Also transform rules whose targets have slashes.
1323 Use $prefix liberally.
1324 Map @MKDIR_P@ to $(MKDIR_P).
1325 Prefix directories that are mkdir'd.
1326
838205d5
AD
13272009-08-12 Akim Demaille <demaille@gostai.com>
1328
1329 build: fix paths.
1330 When using $(top_builddir) inconsistently, Make (including GNU
1331 Make) is sometimes confused. As a result it may want to build
1332 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
1333 file, different names) concurrently, which, amusingly enough,
1334 might end with:
1335
1336 ranlib lib/libbison.a
1337 ranlib lib/libbison.a
1338 make[2]: *** [lib/libbison.a] Segmentation fault
1339
1340 on OS X.
1341
1342 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
1343 needed.
1344
67af7198
AD
13452009-08-12 Akim Demaille <demaille@gostai.com>
1346
1347 distcheck: fix.
1348
b0778bdd 1349 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
67af7198 1350
c467dc42
JD
13512009-08-10 Joel E. Denny <jdenny@clemson.edu>
1352
1353 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
1354
dfaa4860
JD
13552009-08-10 Joel E. Denny <jdenny@clemson.edu>
1356
1357 Miscellaneous code readability improvements.
1358
1359 * src/reader.c (reader): Move %define front-end variable
1360 defaults and checking into...
1361 (prepare_percent_define_front_end_variables): ... this new
1362 function.
1363
1364 * src/scan-gram.l (INITIAL): For consistency with string
1365 literals, don't store open quote on character literal. It's
1366 discarded before returning anyway.
1367 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1368 Make length test more readable, and make the character stored
1369 for an empty literal more obvious while consistent with the
1370 previous behavior.
1371
1372 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1373 USER_NUMBER_HAS_STRING_ALIAS throughout.
1374 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1375 that is repeated in symtab.h. Improve argument names to make it
1376 clear which side of the symbol-string alias pair is which.
1377 (symbol_check_alias_consistency): Improve local variable names
1378 for the same purpose.
1379 * src/symtab.h (struct symbol): Make comments about aliases
1380 clearer.
1381 (symbol_make_alias): Improve comments and argument name.
1382 * src/output.c (token_definitions_output): Update for rename to
1383 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1384
ce268795
AR
13852009-08-08 Alex Rozenman <rozenman@gmail.com>
1386
1387 Convert "misleading reference" messages to warnings.
1388 * src/scan-code.l: New function 'show_sub_messages', more
1389 factoring.
1390 * tests/named-ref.at: Adjust tests.
1391
401b73af
JD
13922009-08-06 Joel E. Denny <jdenny@clemson.edu>
1393
1394 maint: run "make update-copyright"
1395
a1a9422d
JD
13962009-08-06 Joel E. Denny <jdenny@clemson.edu>
1397
1398 maint: make update-b4-copyright easier to use
1399 * build-aux/update-b4-copyright: In warnings, report line
1400 numbers rather than character positions.
1401 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1402 that update-copyright runs it.
1403 * gnulib: Update.
1404
0b61a8ec
JD
14052009-08-05 Joel E. Denny <jdenny@clemson.edu>
1406
1407 maint: clean up update-b4-copyright code
1408 * build-aux/update-b4-copyright: Do not accept 2-digit
1409 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1410 Don't accept a `[' in a b4_copyright argument.
1411 Format code more consistently.
1412 Don't assume b4*copyright never occurs.
1413
269e222e
JD
14142009-08-04 Joel E. Denny <jdenny@clemson.edu>
1415
1416 maint: automate b4_copyright updates.
1417 * Makefile.am (update-b4-copyright): New target rule.
1418 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
1419 * build-aux/update-b4-copyright: New.
1420 * data/yacc.c: Remove stray characters around b4_copyright
1421 invocations.
1422
35905f2b
JD
14232009-08-04 Joel E. Denny <jdenny@clemson.edu>
1424
1425 maint: automate annual package-wide copyright-year update.
1426 * .x-update-copyright: New.
1427 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1428 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1429 update-copyright. Remove gnumakefile, which is implied by
1430 maintainer-makefile.
1431 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1432 * gnulib: Update.
1433 * maint.mk: Remove, now copied from gnulib.
1434 * examples/extexi: Add missing "(C)" in copyright statement so
1435 update-copyright can recognize it.
1436 * src/LR0.h: Likewise.
1437 * src/print.h: Likewise.
1438 * src/print_graph.h: Likewise.
1439 * src/gram.c: Add missing comma in copyright statement.
1440 * src/gram.h: Likewise.
1441
b30e18dc
JD
14422009-08-04 Joel E. Denny <jdenny@clemson.edu>
1443
1444 Fix "make distcheck".
1445 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1446 of just calc.stamp.
1447
8d90395d
JD
14482009-08-01 Joel E. Denny <jdenny@clemson.edu>
1449
1450 Pacify "gcc -Wunused" for the input function from Flex.
1451 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1452 and later.
1453 * src/scan-code.l: Add "%option noinput", which I cannot find in
1454 the Flex manual, but which Flex has supported since at least as
1455 far back as 2.5.4. However, if any of our developers still use
1456 Flex 2.5.4, they'll need to stop configuring with
1457 --enable-gcc-warnings because "%option noinput" didn't work
1458 correctly until Flex 2.5.6.
1459 * src/scan-gram.l: Likewise.
1460 * src/scan-skel.l: Likewise.
1461
ba4184ec
AR
14622009-07-31 Alex Rozenman <rozenman@gmail.com>
1463
1464 Fix --enable-gcc-warnings problems.
1465 * src/reader.c: Adjust variable names.
1466 * src/scan-code.l: Fix prototypes and adjust names.
1467 * src/named-ref.c: Remove redundant "if".
1468
91a2af97
JD
14692009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1470
1471 Fix a --enable-gcc-warnings problem.
1472 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1473 variable.
1474
3208e3f4
JD
14752009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1476
1477 Warn about character literals not of length one.
1478 * NEWS (2.5): Document.
1479 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1480 the length.
1481 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1482 * tests/input.at (Bad character literals): New test group.
1483
5add20ab 14842009-07-24 Alex Rozenman <rozenman@gmail.com>
13cdf208
AR
1485
1486 Fix some memory leaks.
1487 * src/named-ref.c: Add a pointer check (named_ref_free).
1488 * src/scan-code.l: New function (variant_table_free). Called in
1489 code_scanner_free.
1490 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1491
e459fb0e
JD
14922009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1493
1494 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1495
c4be5517
JD
14962009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1497
1498 Some M4 cleanup in the testsuite.
1499 Suggested by Eric Blake at
1500 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1501 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1502 complicate the code by distinguishing between a missing value
1503 and an empty string value for an optional argument. This fix is
1504 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1505 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1506 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1507 arguments are not needed because of the following changes.
1508 Fix stale comments.
1509 Bison developers should use GNU M4 and should not use
1510 POSIXLY_CORRECT when building the test suite, so do not
1511 complicate the code by avoiding $10 and above.
1512 Do not quote an empty string value for an optional argument, and
1513 do not distinguish between a missing value and an empty string
1514 value.
1515
feeb56cd
JD
15162009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1517
1518 Revert unnecessary column realignment in --help output.
1519 Reported by Akim Demaille at
1520 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1521 * src/getargs.c (usage): Here.
1522
5add20ab 15232009-07-04 Alex Rozenman <rozenman@gmail.com>
629e4def
AR
1524
1525 Alphabetical order in src/local.mk.
1526 * src/local.mk: Adjust.
1527
5add20ab 15282009-07-04 Alex Rozenman <rozenman@gmail.com>
872b52bc
AR
1529
1530 Style changes and factoring.
1531 * src/named-ref.h: Add comments.
1532 * src/parse-gram.y: Readability and style changes.
1533 * src/reader.c: Factoring: assign_named_ref function.
1534 * src/scan-code.l: Factoring and style changes. Rename
1535 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1536 Use "unsigned" type for variant index. Improve readablity.
1537 * src/scan-gram.l: Change error messages and add comments.
1538 * src/symlist.h: symbol_list_null: New function decl.
1539 * src/symlist.c: symbol_list_null: Implement here.
1540 * tests/named-refs.at: Adjust for new error messages.
1541
83ea2423
EB
15422009-06-29 Eric Blake <ebb9@byu.net>
1543
1544 scan-code: avoid compiler warnings
1545 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1546
5ece73ea
AD
15472009-06-29 Akim Demaille <demaille@gostai.com>
1548
1549 build: avoid concurrent extraction of calc++.
1550 * examples/calc++/Makefile.am (calc.stamp): New.
1551 Depend on it to create the sources of calc++ so that concurrent
1552 builds don't launch several "extexi" in parallel.
1553 Not only this is inefficient, this also builds incorrect sources
1554 with several extractions mixed together.
1555
ad597a78
AD
15562009-06-29 Akim Demaille <demaille@gostai.com>
1557
1558 parse.error: fix.
1559 * data/bison.m4: Move code related to specific variables after the
1560 definition of the variable-maintaining macros so that we don't
1561 "invoke" b4_percent_define_check_values before it is defined.
1562
31b850d2
AD
15632009-06-29 Akim Demaille <demaille@gostai.com>
1564
1565 variables: parse.error
1566
1567 Implement, document, and test the replacement of %error-verbose
1568 by %define parse.error "verbose".
1569 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
1570 values of the parse.error variable.
1571 Make "simple" its default value.
1572 Check the valid values.
1573 * src/parse-gram.y: Use %define parse.error.
1574 (PERCENT_ERROR_VERBOSE): New token.
1575 Support it.
1576 * src/scan-gram.l: Support %error-verbose.
1577
1578 * doc/bison.texinfo (Decl Summary): Replace the documentation of
1579 %define error-verbose by that of %define parse.error.
1580 * NEWS: Document it.
1581
1582 * tests/actions.at, tests/calc.at: Use parse.error instead of
1583 %error-verbose.
1584
b9f1d9a4
AR
15852009-06-27 Alex Rozenman <rozenman@gmail.com>
1586
1587 Implement support for named symbol references.
1588 * src/parse-gram.y: Add new syntax (named_ref.opt).
1589 * src/reader.c: Store named refs in symbol lists.
1590 * src/reader.h: New argument for symbol_append and
1591 action_append functions.
1592 * src/scan-code.h: Add new field (named_ref) into
1593 code_props data structure. Keeps named ref of midrule
1594 actions.
1595 * src/scan-code.l: Support for named refs in semantic
1596 action code. New function 'parse_named_ref'.
1597 * src/scan-gram.l: Support bracketed id.
1598 * src/symlist.c: Store named refs in symbol lists.
1599 * src/symlist.h: New field in symbol list: named_ref.
1600 * src/named-ref.h: New file, a struct for named_ref.
1601 * src/named-ref.cp: New file, named_ref_new function.
1602 * src/local.mk: Add two new files.
1603 * tests/testsuite.at: Include new test group:
1604 * tests/named-refs.at: this new file.
1605
b5c212b6
AD
16062009-06-25 Akim Demaille <demaille@gostai.com>
1607
1608 hash: check insertion for memory exhaustion.
1609 * src/uniqstr.c (uniqstr_new): New.
1610
67501061
AD
16112009-06-24 Akim Demaille <demaille@gostai.com>
1612
1613 variables: rename namespace as api.namespace.
1614 Discussed in
1615 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
1616
1617 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1618 New.
1619 (b4_percent_define_use): New.
1620 Use it where applicable.
1621 * data/c++.m4: Replace uses of the variable "namespace" by
1622 "api.namespace".
1623 Default the latter to the former.
1624 * doc/bison.texinfo (Decl Summary): Document "namespace" as
1625 obsolete.
1626 Document api.namespace.
1627 Use @samp to document %define uses, keep @code for identifiers.
1628 * NEWS: Likewise.
1629 * tests/c++.at, tests/input.at: Test api.namespace instead of
1630 namespace. (The tests passed with namespace.)
1631
41976786
AD
16322009-06-11 Akim Demaille <demaille@gostai.com>
1633
1634 style changes.
1635 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1636 * src/print-xml.c: Style changes.
1637 * tests/conflicts.at: Comment changes.
1638
44bb9084
AD
16392009-06-11 Akim Demaille <demaille@gostai.com>
1640
1641 xml: beware of user strings used to give a %prec to rules.
1642 * tests/conflicts.at (%prec with user strings): New.
1643 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1644 XML output.
1645
04d1e39d
AD
16462009-06-11 Akim Demaille <demaille@gostai.com>
1647
1648 hash: check insertion for memory exhaustion.
1649 * src/muscle-tab.c (muscle_insert, muscle_grow)
1650 * src/state.c (state_hash_insert): Check the return value of
1651 hash_insert.
1652
a8873669
AD
16532009-06-11 Akim Demaille <demaille@gostai.com>
1654
1655 tests: honor TESTSUITEFLAGS in every check target.
1656 * tests/local.mk (RUN_TESTSUITE): New.
1657 (check-local, installcheck-local, maintainer-check-g++)
1658 (maintainer-check-posix, maintainer-check-valgrind): Use it.
1659
8893145a
AD
16602009-06-10 Akim Demaille <demaille@gostai.com>
1661
1662 deterministic test suite.
1663 Some consistency checks on symbols are performed after all the
1664 symbols were read, by an iteration over the symbol table. This
1665 traversal is nondeterministic, which can be a problem for test
1666 cases.
1667 Avoid this.
1668 Addresses another form of nondeterminism reported by Joel E. Denny.
1669 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1670
1671 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1672 test in two.
1673 Use different file names for the three tests to make the
1674 maintenance easier.
1675
92d7a23a
AD
16762009-06-10 Akim Demaille <demaille@gostai.com>
1677
1678 gnulib: update.
b0778bdd
EB
1679 * gnulib: Update to latest.
1680 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1681 * m4/.gitignore: Regen.
1682 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1683 Call xalloc_die on hash_insert failures.
1684 Requested by the new __warn_unused_result__ attribute of
1685 hash_insert.
92d7a23a 1686
12cf133f
AD
16872009-06-10 Akim Demaille <demaille@gostai.com>
1688
1689 deterministic user-token-number redeclaration errors.
1690 Address nondeterminism reported by Joel E. Denny.
1691 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1692
1693 * src/uniqstr.h: Comment changes.
1694 * src/location.h (boundary_cmp, location_cmp): New.
1695 * src/symtab.c (user_token_number_redeclaration): New.
1696 (symbol_translation): Use it.
1697 * tests/input.at (Numbered tokens): Adjust the expected output.
1698
796a2b0a
AD
16992009-05-25 Akim Demaille <demaille@gostai.com>
1700
1701 build: avoid ignored errors.
1702 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
1703 errors, they pollute the output.
1704
0b6d43c5
JD
17052009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1706
1707 Convert multiple variable definition warnings to complaints.
1708 * NEWS (2.5): Add a new entry for that change.
1709 * doc/bison.texinfo (Decl Summary): Update %define entry.
1710 (Bison Options): Update -D/--define/-F/--force-define entry.
1711 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
1712 * src/muscle-tab.h (muscle_percent_define_insert): Update
1713 comments.
1714 * tests/input.at (`%define errors'): Update.
1715 (`%define, --define, --force-define'): Update.
1716
de5ab940
JD
17172009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1718
1719 -F/--force-define and relative %define/-D/--define priorities.
1720 * NEWS (2.5): Add documentation to -D/--define entry.
1721 * build-aux/cross-options.pl: Hard-code association of
1722 --force-define with %define.
1723 * doc/bison.texinfo (Decl Summary): In %define entry,
1724 cross-reference command-line options.
1725 (Bison Options): Add documentation to -D/--define entry.
1726 (Option Cross Key): Widen column for --force-define row.
1727 * src/getargs.c (usage): Document -F/--force-define. Realign
1728 options in output.
1729 (short_options, long_options, getargs): Parse -F/--force-define,
1730 and update muscle_percent_define_insert invocations.
1731 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
1732 (muscle_percent_define_insert): Add argument with that type.
1733 * src/muscle-tab.c (muscle_percent_define_insert): Implement
1734 -F/--force-define behavior and priorities.
1735 (muscle_percent_define_ensure): Update
1736 muscle_percent_define_insert invocation.
1737 * src/parse-gram.y (prologue_declaration): Update
1738 muscle_percent_define_insert invocations.
1739 * tests/input.at (`%define, --define'): Rename to...
1740 (`%define, --define, --force-define'): ... this and extend.
1741
f8e7258f
JD
17422009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1743
1744 Update some comments to make sense for -D.
1745 * data/bison.m4 (b4_check_user_names): In header comments, say
1746 "user occurrence" instead of "grammar occurrence".
1747 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
1748 (muscle_percent_code_grow): Likewise just for consistency.
1749
b987342b
JD
17502009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1751
1752 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1753
4977e0a7
JD
17542009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1755
1756 Handle a trailing `:' in a user-supplied C++ namespace better.
1757 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1758 among the closing braces here. This fix might make the
1759 generated code easier to debug, but otherwise it should be
1760 insignificant because a trailing `:' is a C++ error already.
1761
9b04dad7
AD
17622009-05-19 Akim Demaille <demaille@gostai.com>
1763
1764 remove useless variable.
1765 * src/getargs.c (skeleton_arg): Remove now useless variable.
1766 Should help the compiler see that this printf-like call is sane.
1767
4c6622c2
AD
17682009-05-15 Akim Demaille <demaille@gostai.com>
1769
1770 Rename token.prefix as api.tokens.prefix.
1771 Discussed here.
1772 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
1773
1774 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
1775 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
1776 (token.prefix): Rename as...
1777 (api.tokens.prefix): this.
1778
3c248d70
AD
17792009-05-11 Akim Demaille <demaille@gostai.com>
1780
1781 doc: use C++ headers.
1782 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1783 headers.
1784
99c08fb6
AD
17852009-05-11 Akim Demaille <demaille@gostai.com>
1786
1787 doc: token.prefix
1788 * doc/bison.simple (Decl Summary): Document token.prefix.
1789 (Calc++ Parser): Various fixes.
1790 Formatting changes.
1791 Use token.prefix.
1792 Introduce a macro TOKEN to shorten the code and make it more
1793 readable.
1794 (Calc++ Scanner): Adjust.
1795 * NEWS (Variable token.prefix): New.
1796
84a1cb5a
AD
17972009-05-04 Akim Demaille <demaille@gostai.com>
1798
1799 bison: catch bad symbol names.
1800 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1801 * tests/input.at: Adjust.
1802
cdf3f113
AD
18032009-05-04 Akim Demaille <demaille@gostai.com>
1804
1805 identifiers: dashes are letters.
1806 Dashes can now start identifiers (symbols and directives).
84a1cb5a 1807
cdf3f113
AD
1808 * src/scan-gram.l ({letter}): Add dash.
1809 ({id}): Remove it.
1810 * tests/input.at (Symbols): Adjust.
1811 Remove stray comment.
1812 * tests/regression.at (Invalid inputs): Adjust error message.
1813 * doc/bison.texinfo (Symbols): Update.
1814
98a345a2
JD
18152009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1816
1817 Declare %code to be a permanent feature.
1818 * NEWS (2.4.2): Here.
1819 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
1820 experimental.
1821 (Decl Summary): Likewise.
1822
67212941
JD
18232009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1824
1825 Convert underscores to dashes in some %define variable names.
1826 For now, just api.push-pull and lr.keep-unreachable-states.
1827 Maintain old names for backward compatibility.
1828 * NEWS (2.5): Document.
1829 * data/c.m4 (b4_identification): Update comment.
1830 * data/yacc.c: Update access.
1831 * doc/bison.texinfo: Update.
1832 * etc/bench.pl.in (bench_push_parser): Update use.
1833 * src/files.c (tr): Move to...
1834 * src/getargs.c, src/getargs.h (tr): ... here because I can't
1835 think of a better place to expose it. My logic is that, for all
1836 uses of tr so far, command-line arguments can be involved, and
1837 getargs.h is already included.
1838 * src/main.c (main): Update access.
1839 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
1840 variable names to new variable names before assigning value.
1841 * src/reader.c (reader): Update setting default.
1842 * tests/calc.at: Update uses.
1843 * tests/conflicts.at (Unreachable States After Conflict
1844 Resolution): Update use.
1845 * tests/input.at (%define enum variables): Update use.
1846 (%define backward compatibility): New test group.
1847 * tests/push.at: Update uses.
1848 * tests/reduce.at: Update uses.
1849 * tests/torture.at: Update uses.
1850
ba5c6d94
JD
18512009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1852
1853 Set all front-end %define defaults in one place.
1854 * src/main.c (main): Move lr.keep_unreachable_states default...
1855 * src/reader.c (reader): ... to here.
1856
5bab9d08
JD
18572009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1858
1859 Rename lr.default_reductions to lr.default-reductions.
1860 * NEWS (2.5): Here.
1861 * doc/bison.texinfo: Here.
1862 * src/lalr.c (initialize_LA): Here.
1863 * src/print.c (print_reductions): Here.
1864 * src/reader.c (reader): Here.
1865 * src/tables.c (action_row): Here.
1866 * tests/input.at (%define enum variables): Here.
1867 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1868
d521ee19
JD
18692009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1870
1871 Pacify ./configure --enable-gcc-warnings.
1872 * tests/input.at (Symbols): Prototype yyerror and yylex.
1873
18742009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
1875
1876 Document how `%define "var" "value"' is not M4-friendly.
1877 * src/parse-gram.y (variable): In comments here.
1878
8f0d265e
JD
18792009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1880
1881 Clean up recent patches a little.
1882 Reported by Akim Demaille.
1883 * doc/bison.texinfo (Understanding): Fix typos.
1884 * src/print.c (print_reductions): Don't use negated variable.
1885
f4909773
JD
18862009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1887
1888 List accepted values for a %define enum variable with an invalid value.
1889 Suggested by Akim Demaille at
1890 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1891 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1892 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
1893 * tests/input.at (%define lr.default_reductions invalid values): Merge
1894 into...
1895 (%define enum variables): ... here, and update output.
1896
110ef36a
JD
18972009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1898
1899 Rename "default rule" to "default reduction".
1900 This includes changing variable names in code, changing
1901 comments, and renaming %define lr.default_rules to %define
1902 lr.default_reductions.
1903 * NEWS (2.5): Update IELR documentation.
1904 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
1905 documentation.
1906 * data/glr.c, data/lalr1.java: Sync copyright dates.
1907 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1908 and lr.type documentation. Make some other wording
1909 improvements.
1910 (Glossary): Adjust cross-references and Default Reduction
1911 definition.
1912 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1913 Remove a confusing comment pointed out by Akim Demaille.
1914 (initialize_LA): Adjust code.
1915 * src/print-xml.c (print_reductions): Adjust code.
1916 * src/print.c (print_reductions): Adjust code.
1917 * src/reader.c (reader): Adjust code.
1918 * src/tables.c (action_row): Adjust code.
1919 (token_actions): Adjust code.
1920 * src/tables.h: Adjust YYDEFACT documentation.
1921 * tests/input.at (%define lr.default_rules invalid values):
1922 Rename test group to...
1923 (%define lr.default_reductions invalid values): ... this, and
1924 update grammar file and expected output.
1925 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1926 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1927
746ee38c
AD
19282009-04-21 Akim Demaille <demaille@gostai.com>
1929
1930 tests: check the use of dashes and periods in symbols.
1931 * tests/input.at (Symbol): New test group.
1932
eb45ef3b
JD
19332009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1934
1935 Document %define lr.type and lr.default_rules.
1936 * NEWS (2.5): Add an entry.
1937 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1938 besides just LALR(1) and GLR(1).
1939 * doc/bison.texinfo (Introduction): Likewise.
1940 (Language and Grammar): Bison is no longer limited to LALR(1)
1941 restrictions.
1942 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1943 when trying to distinguish from GLR. Talk about LR(1) grammars
1944 rather than LALR(1) grammars.
1945 (Decl Summary): In %define api.push_pull entry, say it applies
1946 to deterministic parsers in C rather than LALR(1) parsers in C.
1947 Add lr.default_rules entry.
1948 Add lr.type entry.
1949 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1950 restrictions.
1951 (Generalized LR Parsing): Same changes as for the previous GLR
1952 section.
1953 (Memory Management): Say deterministic rather than LALR(1).
1954 (Understanding): Correct some bison output.
1955 Index discussion of "accepting state".
1956 Say deterministic rather than LALR(1).
1957 (Bison Options): In --yacc entry, say deterministic rather than
1958 LALR(1).
1959 In --report, --graph, and --xml entries, just don't mention
1960 LALR(1).
1961 (C++ Parsers): Say deterministic rather than LALR(1).
1962 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1963 (Glossary): Add Accepting State, Consistent State, Default Rule,
1964 and IELR(1) definitions.
1965 In Generalized LR (GLR) definition, make same changes as in
1966 previous GLR sections.
1967 In LALR(1) definition, say Bison uses LALR(1) by default rather
1968 than implying Bison is limited to LALR(1).
1969 (LocalWords): Add IELR.
1970
db34f798
JD
19712009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1972
1973 Finish implementing %define lr.type.
1974 Its value can be "LALR", "IELR", or "canonical LR".
1975 * lib/timevar.def (TV_IELR_PHASE1): New var.
1976 (TV_IELR_PHASE2): New var.
1977 (TV_IELR_PHASE3): New var.
1978 (TV_IELR_PHASE4): New var.
1979 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1980 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1981 Sbitset.h, ielr.h, and ielr.c.
1982 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1983 trace_types): Add trace_ielr.
1984 * src/lalr.h, src/lalr.c (ngotos): Export it.
1985 (F): Rename to...
1986 (goto_follows): ... this, update all uses, and export it.
1987 (set_goto_map): Export it.
1988 (map_goto): Export it.
1989 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1990 handled in ielr.
1991 (initialize_LA): Export it. Move lookback allocation to...
1992 (lalr): ... here because, for canonical LR, initialize_LA must
1993 be invoked but lookback and much of the rest of LALR isn't
1994 needed.
1995 * main.c (main): Instead of lalr, invoke ielr, which invokes
1996 lalr.
1997 * src/reader.c (reader): Default lr.type to "LALR".
1998 Default lr.default_rules to "accepting" if lr.type is "canonical
1999 LR". Leave the default as "all" otherwise.
2000 Check for a valid lr.type value.
2001 * src/state.h, src/state.c (struct state_list): Add state_list
2002 member.
2003 (state_new): Initialize state_list member to NULL.
2004 (state_new_isocore): New function, exported.
2005 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
2006 exercises all values of lr.type.
2007 (GNU AWK Grammar): Rename test group to...
2008 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
2009 AT_TEST_EXISTING_GRAMMAR.
2010 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
2011 (GNU pic Grammar): Rename test group to...
2012 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
2013 AT_TEST_EXISTING_GRAMMAR.
2014 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
2015 all values of lr.type.
2016 (Single State Split): New test groups using AT_TEST_LR_TYPE.
2017 (Lane Split): Likewise.
2018 (Complex Lane Split): Likewise.
2019 (Split During Added Lookahead Propagation): Likewise.
2020
7fe11bb5
JD
20212009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2022
2023 Add new files for IELR and canonical LR implementation.
2024 * src/AnnotationList.c: New.
2025 * src/AnnotationList.h: New.
2026 * src/InadequacyList.c: New.
2027 * src/InadequacyList.h: New.
2028 * src/Sbitset.c: New.
2029 * src/Sbitset.h: New.
2030 * src/ielr.c: New.
2031 * src/ielr.h: New.
2032
7254f6a8
JD
20332009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2034
2035 Implement %define lr.default_rules.
2036 Its value describes the states that are permitted to contain
2037 default rules: "all", "consistent", or "accepting".
2038 * src/reader.c (reader): Default lr.default_rules to "all".
2039 Check for a valid lr.default_rules value.
2040 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
2041 is "accepting", then only mark the accepting state as
2042 consistent.
2043 (initialize_LA): Tell state_lookahead_tokens_count whether
2044 lr.default_rules is "accepting".
2045 * src/tables.c (action_row): If lr.default_rules is not "all",
2046 then disable default rules in inconsistent states.
2047 * src/print.c (print_reductions): Use this opportunity to
2048 perform some assertions about whether lr.default_rules was
2049 obeyed correctly.
2050 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
2051 helps with checking the parser tables for a grammar.
2052 * tests/input.at (%define lr.default_rules invalid values): New
2053 test group.
2054 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
2055 AT_TEST_TABLES_AND_PARSE.
2056 (`no %define lr.default_rules'): New test group generated by
2057 AT_TEST_LR_DEFAULT_RULES.
2058 (`%define lr.default_rules "all"'): Likewise.
2059 (`%define lr.default_rules "consistent"'): Likewise.
2060 (`%define lr.default_rules "accepting"'): Likewise.
2061
72e727f2
AD
20622009-04-20 Akim Demaille <demaille@gostai.com>
2063
2064 Formatting change.
2065
90462b8d
AD
20662009-04-20 Akim Demaille <demaille@gostai.com>
2067
2068 bison: factoring.
2069 * src/output.c (token_definitions_output): Use symbol_id_get
2070 instead of duplicating its logic.
2071 * TODO (YYERRCODE): Extend.
2072
4f646c37
AD
20732009-04-20 Akim Demaille <demaille@gostai.com>
2074
71b00ed8
AD
2075 variables: prefer error-verbose to error_verbose.
2076 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
2077 instead of error_verbose.
2078 * src/scan-gram.l (%error-verbose): Map to the error-verbose
2079 variable.
2080 * doc/bison.texinfo: Promote %define error-verbose instead of
2081 %error-verbose.
2082 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
2083
20842009-04-15 Akim Demaille <demaille@gostai.com>
2085
4f646c37
AD
2086 variables: accept dashes.
2087 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
2088 underscores.
2089 * src/scan-gram.l ({id}): Also accept dashes after the initial
2090 letter.
2091 ({directive}): Use {id}.
2092 * src/parse-gram.y: Comment and formatting changes.
2093 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
2094 symbols.
2095 * src/complain.h, src/complain.c (yacc_at): New.
2096 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
2097 symbol names.
2098 * src/output.c (token_definitions_output): Do not #define token
2099 names with dashes.
2100
184e3179
AD
21012009-04-20 Akim Demaille <demaille@gostai.com>
2102
2103 Consistently refer to Yacc, not YACC.
2104 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2105
41253c3a
JD
21062009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
2107
2108 Pacify make maintainer-check-posix.
2109 * tests/input.at (%define, --define): Move bison command-line
2110 options before grammar file name.
2111
197b82ba
JD
21122009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2113
2114 Document semicolon warnings.
2115 * NEWS (2.5): Here.
2116
0c90a1f5
AD
21172009-04-14 Akim Demaille <demaille@gostai.com>
2118
2119 variables: use `parse.assert' instead of `assert'.
2120 * TODO (assert): Remove.
2121 * data/bison.m4 (b4_assert_if): Replace with...
2122 (b4_parse_assert_if): this.
2123 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
2124 * doc/bison.texinfo (Decl Summary): Document parse.assert.
2125
fa819509
AD
21262009-04-14 Akim Demaille <demaille@gostai.com>
2127
16dc0d90 2128 variables: use `parse.trace' instead of `debug'.
fa819509
AD
2129 * src/getargs.c (getargs): Map -t to %define trace.parse.
2130 * src/scan-gram.l (%debug): Map to %define trace.parse.
2131 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
2132 names to `_' in macro names.
2133 (b4_debug_if): Replace with...
2134 (b4_parse_trace_if): this.
2135 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2136 * data/yacc.c: Adjust.
2137 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
2138 Use @code to label the variable list.
2139 Document the variable parse.trace.
2140 (Tracing): Promote the parse.trace variable.
2141 * TODO: %printer is not documented.
2142
f7dae1ea
AD
21432009-04-14 Akim Demaille <demaille@gostai.com>
2144
2145 doc: minor fixes.
2146 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2147 (Table of Symbols): Remove duplicate entry for %debug.
2148
3535c071
EB
21492009-04-10 Eric Blake <ebb9@byu.net>
2150
2151 submodules: update to latest
2152 * submodules/autoconf: Use latest upstream Autoconf.
2153
cf48f675
EB
21542009-04-06 Eric Blake <ebb9@byu.net>
2155
2156 Work around autoconf 2.63b bug in testsuite.
2157 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2158 autoconf bug related to # in test.
2159
50cca368
JD
21602009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2161
2162 * NEWS (2.5): New section. Describe new -D/--define feature.
2163
3583d96b
AD
21642009-04-06 Akim Demaille <demaille@gostai.com>
2165
2166 Regen.
2167 * src/parse-gram.h, src/parse-gram.c: Regen.
2168
00f5d575
AD
21692009-04-06 Akim Demaille <demaille@gostai.com>
2170
2171 rename muscle_tab.* as muscle-tab.* for consistency.
2172 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
2173 * src/muscle-tab.h, src/muscle-tab.c: these.
2174 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
2175 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
2176
76bf5102
AD
21772009-04-06 Akim Demaille <demaille@gostai.com>
2178
2179 Makefile: introduce $(BISON).
2180 * src/local.mk (BISON): New.
2181 (YACC): Use it.
2182
bc0f5737
AD
21832009-04-06 Akim Demaille <demaille@gostai.com>
2184
2185 parser: handle %locations as %define locations.
2186 * src/getargs.h, src/getargs.c (locations_flag): Remove.
2187 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
2188 to set "locations" to true.
2189 * src/output.c (prepare): Don't output "locations".
2190 * src/scan-gram.l (%locations): Handle it as a %<flag>.
2191 * src/parse-gram.y: It's no longer a token.
2192 Don't handle it.
2193 * data/bison.m4 (b4_locations_if): Define it with
2194 b4_percent_define_if_define.
2195 * data/c.m4, data/glr.cc: Adjust.
2196
697c912f
AD
21972009-04-06 Akim Demaille <demaille@gostai.com>
2198
2199 Regen.
2200 * src/parse-gram.c: Regen.
2201
4920ae8b
AD
22022009-04-06 Akim Demaille <demaille@gostai.com>
2203
2204 muscle: factor the handling of obsolete of obsolete directives.
2205 Suggested by Joel E. Denny.
50cca368 2206
4920ae8b
AD
2207 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
2208 New, extracted from...
2209 * src/parse-gram.y (prologue_declaration: pure-parser): here.
2210 Remove it.
2211 (prologue_declaration: "%<flag>"): Use
2212 muscle_percent_define_ensure.
2213 (%error-verbose, %pure-parser): No longer tokens.
2214 * src/scan-gram.l (pure-parser): Return as a %<flag>.
2215
1d5b3c08
JD
22162009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2217
2218 Fix options documentation.
2219 * build-aux/cross-options.pl: As in --help output, write optional
2220 arguments as [=ARG] not =[ARG].
2221 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2222
62c99cf4
JD
22232009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2224
2225 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2226 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2227 requirements for a correct m4 are stricter.
2228 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
2229 * configure.ac: Update to use AC_PROG_GNU_M4.
2230 Reported by Eric Blake.
2231
1c93f35b
JD
22322009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2233
2234 Help with updating web manual.
2235 * HACKING: Incorporate instructions from gnulib/doc/README.
2236 * bootstrap.conf (gnulib_modules): Add gendocs.
2237
86cfae0a
AD
22382009-04-03 Akim Demaille <demaille@gostai.com>
2239
2240 Regen.
2241 * src/parse-gram.h, src/parse-gram.c: Regen.
2242
ba061fa6
AD
22432009-04-03 Akim Demaille <demaille@gostai.com>
2244
2245 Factor %FLAG at scan level.
2246 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
2247 definitions and associated rules, replaced by....
2248 (PERCENT_FLAG): this new token type, and rule.
2249 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
2250 Use it for %debug and %error-verbose.
2251
b19ebeb3
AD
22522009-04-03 Akim Demaille <demaille@gostai.com>
2253
2254 Regen.
2255 * src/parse-gram.h, src/parse-gram.c: Regen.
2256
001a16a9
AD
22572009-04-03 Akim Demaille <demaille@gostai.com>
2258
2259 Treat %debug as %define debug.
2260 * data/bison.m4 (b4_debug_if): New.
2261 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
2262 * data/lalr1.java: Use it instead of b4_debug_flag.
2263 * src/getargs.h, src/getargs.c (debug_flag): Remove.
2264 * src/output.c (prepare): Don't output it.
2265 * src/parse-gram.y: Treat %debug as %define debug.
2266
22672009-04-03 Akim Demaille <demaille@gostai.com>
2268
2269 Treat %error-verbose as %define error_verbose.
2270 This allows to pass -Derror_verbose on the command line. Better
2271 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
2272 ERROR_VERBOSE being defined as false or true.
2273 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
2274 on b4_percent_define_ifdef, for does not check the defined value,
2275 but only whether the symbol is defined, rely on
2276 b4_percent_define_flag_if, so that a value of "false" is processed
2277 as a false.
2278 If not defined, define the flag to "false".
2279 (b4_error_verbose_if): New.
2280 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
2281 b4_error_verbose_flag.
2282 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
2283 * src/output.c (prepare): Don't output it.
2284 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
2285
92822aff
JD
22862009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2287
2288 Fix strange %define locations for default values.
2289 Reported by Akim Demaille at
2290 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2291 and discussed again starting at
2292 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2293 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2294 because location information is bogus.
2295 Use angle brackets to delimit fake file name because square brackets
2296 look like underexpanded m4. Choose a better fake file name.
2297 Use negative line numbers.
2298 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2299 * src/location.c (location_print): If line for a boundary is negative,
2300 only print that boundary's file name.
2301 * src/location.h: Document that.
2302 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2303 defaults): Update output.
2304
e021191b
JD
23052009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2306
2307 Pacify ./configure --enable-gcc-warnings.
2308 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
2309 in lib won't compile with it.
2310 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
2311
78f65418
AD
23122009-03-31 Akim Demaille <demaille@gostai.com>
2313
2314 bootstrap: --help to stdout.
2315 * bootstrap (usage): Don't send --help to stderr.
2316 Use a here doc instead of a long string.
2317
f7e241f4
AD
23182009-03-31 Akim Demaille <demaille@gostai.com>
2319
2320 bootstrap: README-hacking no longer exists
2321 * bootstrap (checkout_only_file): Set to HACKING.
2322
31d3e510
AD
23232009-03-26 Akim Demaille <demaille@gostai.com>
2324
2325 doc: merge HACKING and README-hacking.
2326 Two files is confusing.
2327 Reported by Alexandre Duret-Lutz.
1f9d8248 2328
31d3e510
AD
2329 * README-hacking: Merge into...
2330 * HACKING (Working from the repository): here.
2331
81535bfa
AD
23322009-03-26 Akim Demaille <demaille@gostai.com>
2333
2334 doc: update README-hacking.
2335 * README-hacking: We now use git and git submodules.
2336 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2337
56f772e9
AD
23382009-03-26 Akim Demaille <demaille@gostai.com>
2339
2340 lalr1.cc: avoid GCC 4.3 warnings.
2341 GCC 4.3 now warns about "a || b && c" and asks for explicit
2342 parentheses.
2343 Reported by Alexandre Duret-Lutz.
2344 * data/location.cc: Update copyright years.
2345 (Position::operator==): Use parens to make precedence explicit.
2346 Compare lines and columns first, as they are more likely to be
2347 different, and they are faster to compare.
2348
11c073b7
AD
23492009-03-26 Akim Demaille <demaille@gostai.com>
2350
2351 gnulib: update.
2352 * gnulib: Update to latest.
2353 * src/local.mk (AM_CFLAGS): Move to...
2354 * Makefile.am: here.
2355 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
2356 AM_CFLAGS.
2357
91be6b28
AD
23582009-03-02 Akim Demaille <demaille@gostai.com>
2359
2360 Comment changes.
2361
cbf25ce7
AD
23622009-03-02 Akim Demaille <demaille@gostai.com>
2363
2364 Share b4_yytranslate_define.
2365 * data/lalr1.cc (b4_yytranslate_define): Move to...
2366 * data/c++.m4: here.
2367
882f02ed
AD
23682009-03-02 Akim Demaille <demaille@gostai.com>
2369
2370 Use locations in the variant example.
1f9d8248
AD
2371 Yes, this obfuscates the point of this example, variants only.
2372 But glr.cc cannot work (yet?) without locations. This change
2373 makes it easier to use this example with glr.cc.
11c073b7 2374
882f02ed
AD
2375 * examples/variant.yy (assert): %define it.
2376 (locations): Request them.
2377 (yylex): Bind the location to the stage.
2378
0623bacc
AD
23792009-03-02 Akim Demaille <demaille@gostai.com>
2380
2381 Dub make_TOKEN as a public type interface.
2382 * data/c++.m4 (b4_symbol_constructor_declare)
2383 (b4_symbol_constructor_define): New empty stubs.
2384 (b4_public_types_declare, b4_public_types_define): Use them.
2385 * data/lalr1.cc (b4_symbol_constructor_declare)
2386 (b4_symbol_constructor_declare_)
2387 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
2388 Move to...
2389 * data/variant.hh: here.
2390 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
2391 needed.
2392 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
2393 b4_symbol_constructor_declare, as it is now done by
2394 b4_public_types_define and b4_public_types_declare.
2395
5f5a90df
AD
23962009-03-02 Akim Demaille <demaille@gostai.com>
2397
2398 Coding style changes.
2399 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2400 (b4_symbol_constructor_declarations)
2401 (b4_symbol_constructor_definition_)
2402 (b4_symbol_constructor_definitions)
2403 (b4_yytranslate_definition): Rename as...
2404 (b4_symbol_constructor_declare_)
2405 (b4_symbol_constructor_declare)
2406 (b4_symbol_constructor_define_)
2407 (b4_symbol_constructor_define)
2408 (b4_yytranslate_define): these.
2409 * data/variant.hh (b4_variant_definition): Rename as...
2410 (b4_variant_define): this.
2411
b47b6ff7
AD
24122009-03-02 Akim Demaille <demaille@gostai.com>
2413
2414 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
2415 * data/bison.m4 (b4_percent_define_if_define): New.
2416 * data/c++.m4 (b4_variant_if): Move to...
2417 * data/bison.m4: Here, using b4_percent_define_if_define.
2418 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
2419 * data/bison.m4: Here, using b4_percent_define_if_define.
2420
1d6b689b
AD
24212009-03-02 Akim Demaille <demaille@gostai.com>
2422
2423 Dub symbol_type_base as a public type.
2424 * data/c++.m4 (b4_public_types_declare): Now define
2425 symbol_type_base and symbol_type.
2426 (b4_public_types_define): New.
2427 In both cases, the definitions are taken verbatim from lalr1.cc.
2428 * data/lalr1.cc: Adjust.
2429
4f84717d
AD
24302009-03-02 Akim Demaille <demaille@gostai.com>
2431
2432 b4_public_types_declare.
2433 * data/c++.m4 (b4_public_types_declare): New.
2434 * data/glr.cc, data/lalr1.cc: Use it.
2435
b9e4eb5b
AD
24362009-03-02 Akim Demaille <demaille@gostai.com>
2437
2438 b4_semantic_type_declare.
2439 * data/c++.m4 (b4_semantic_type_declare): New.
2440 Factors and generalizes what was in glr.cc and lalr1.cc.
2441 * data/variant.hh (b4_semantic_type_declare): Redefine it for
2442 variants.
2443 * data/lalr1.cc, data/glr.cc: Use it.
2444
6a6e7f0c
AD
24452009-02-26 Akim Demaille <demaille@gostai.com>
2446
2447 Upgrade gnulib.
2448 * gnulib: Upgrade from master.
2449 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
2450 Regen.
2451
e9e61b00
AD
24522009-02-25 Akim Demaille <demaille@gostai.com>
2453
2454 Remove useless arguments.
2455 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
2456 relevant.
2457
3eead995
AD
24582009-02-25 Akim Demaille <demaille@gostai.com>
2459
2460 Comment changes.
2461 * data/lalr1.cc: here.
2462
87f28efe
AD
24632009-02-25 Akim Demaille <demaille@gostai.com>
2464
2465 Fix glr.cc's debug level handling.
2466 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
2467 glr.c which is used.
2468 (debug_level, set_debug_level): Adjust.
2469
9be2a009
AD
24702009-02-25 Akim Demaille <demaille@gostai.com>
2471
2472 Copyright years.
2473 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2474
07a6e87d
AD
24752009-02-25 Akim Demaille <demaille@gostai.com>
2476
2477 Style changes.
2478 * etc/bench.pl.in (generate_grammar_list): Consitently use
2479 location_type, not yy::location.
2480
33c78bd2
AD
24812009-02-25 Akim Demaille <demaille@gostai.com>
2482
2483 Comment change.
2484 * data/lalr1.cc: here.
2485
49572920
AD
24862009-02-19 Akim Demaille <demaille@gostai.com>
2487
2488 Make yyparser::error public.
2489 * data/lalr1.cc: here.
2490 There is no good reason to keep it private (and it is convenient
2491 to use it from the scanner for instance). It is already public in
2492 glr.cc.
2493
88654b47
AD
24942009-02-19 Akim Demaille <demaille@gostai.com>
2495
2496 Comment changes.
2497 * data/glr.cc: here.
2498
4524c55b
AD
24992009-02-19 Akim Demaille <demaille@gostai.com>
2500
2501 Remove trailing blanks.
6a6e7f0c
AD
2502 The epilogue has its own ending \n, no need to add another.
2503
4524c55b
AD
2504 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
2505 epilogue.
2506 * data/glr.cc: dnl when extending the epilogue.
2507 Remove stray "private:".
2508
6ceccee8
AD
25092009-02-19 Akim Demaille <demaille@gostai.com>
2510
2511 Use b4_c_modern.
2512 * data/c.m4 (b4_c_function_decl): Here.
2513
9c6a8966
AD
25142009-02-19 Akim Demaille <demaille@gostai.com>
2515
2516 Comment changes.
2517 * data/lalr1.cc: here.
2518
507aa0e2
AD
25192009-02-19 Akim Demaille <demaille@gostai.com>
2520
2521 Extract variant.hh
2522 * data/variant.hh: New, extracted from...
2523 * data/lalr1.cc: here.
2524 Adjust.
2525 * data/local.mk: Adjust.
2526
51bacae6
AD
25272009-02-19 Akim Demaille <demaille@gostai.com>
2528
2529 Extract stack.hh from lalr1.cc.
2530 * data/stack.hh: New.
2531 * data/lalr1.cc: Extract from here.
2532 * data/local.mk: Adjust.
2533
06c3084f
JD
25342009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2535
2536 Add reminder about uploading public key to keys.gnupg.net.
2537 * HACKING (Release Procedure): Here.
2538
0ea583d2
AD
25392009-01-28 Akim Demaille <demaille@gostai.com>
2540
2541 * NEWS: Update information about 2.4.1 and 2.4.2.
2542
402b123d
AD
25432008-11-04 Akim Demaille <demaille@gostai.com>
2544
2545 Reformat NEWS.
2546 * NEWS: Use more outline-mode markup.
2547 Suggested by Jim Meyering.
2548
74553c98
AD
25492009-01-08 Akim Demaille <demaille@gostai.com>
2550
2551 Fix grep portability issues.
2552 Grep on Solaris does not support -q.
2553 Reported by Summum Bonum.
2554
2555 * NEWS: Add a stub for 2.4.2.
2556 * THANKS: Add Summum Bonum.
2557 * tests/atlocal.in (EGREP): New.
2558 (CC, CXX, XSLTPROC): Make it possible to override them via
2559 envvars.
2560 * tests/java.at: Use $EGREP instead of egrep.
2561 Use AT_CHECK's ignore instead of grep's -q.
2562
84eedf86
AD
25632008-12-11 Akim Demaille <demaille@gostai.com>
2564
2565 Pass the token type to yysyntax_error.
2566 * data/yacc.c (yysyntax_error): Take the transated token instead
2567 of the raw number.
2568 Adjust callers.
2569 * TODO: Update.
2570
5860cc8c
AD
25712008-12-11 Akim Demaille <demaille@gostai.com>
2572
2573 Formatting changes.
2574 * data/glr.c: Formatting changes.
2575
2b008529
AD
25762008-12-11 Akim Demaille <demaille@gostai.com>
2577
2578 Propagate i18n changes into glr.c.
2579 * TODO: Update.
2580 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
2581 building the error message format dynamically.
2582 * data/lalr1.java: Formatting changes.
2583
2cd1af95
AD
25842008-12-11 Akim Demaille <demaille@gostai.com>
2585
2586 Use testsuite -C.
2587 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
2588 Solves problems when top_srcdir is an absolute path.
2589 Suggested by Eric Blake.
2590 * configure.ac: Require Autoconf 2.62.
2591
eeb29422
AD
25922008-12-11 Akim Demaille <demaille@gostai.com>
2593
2594 Simplify the i18n of the error messages.
2595 * data/lalr1.cc: Comment changes.
2596 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
2597 lalr1.cc instead of building dynamically the format string.
2598
6617622c
AD
25992008-12-08 Akim Demaille <demaille@gostai.com>
2600
2601 Fix portability issue in the test suite.
2602 * tests/local.at (AT_MATCHES_CHECK): New.
2603 Based on Perl instead of Sed. Sed has too many portability
2604 pitfalls, not ever Sed is GNU Sed.
2605 * tests/actions.at (Fix user actions without a trailing semicolon):
2606 Use it.
2607
2ca1136c
AD
26082008-12-08 Akim Demaille <demaille@gostai.com>
2609
2610 Update data/README.
2611 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2612
6c63b895
AD
26132008-12-08 Akim Demaille <demaille@gostai.com>
2614
2615 Install autoconf as a submodule to get m4sugar.
2616 * .gitmodules: Add submodules/autoconf.
2617 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2618 submodules/autoconf.
2619
417e31d2
AD
26202008-12-08 Akim Demaille <demaille@gostai.com>
2621
2622 Test token.prefix in all the skeletons.
2623 * data/java.m4 (b4_token_enum): Use the token.prefix.
2624 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
2625 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
2626 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
2627 * tests/java.at: Comment changes.
2628 (AT_CHECK_JAVA_MINIMAL): Define the END token.
2629 (Java parser class and package names): Add token.prefix check.
2630
97abf544
AD
26312008-12-08 Akim Demaille <demaille@gostai.com>
2632
2633 Fix regeneration of atconfig.
2634 * tests/local.mk (tests/atconfig): The rule was incorrect, but
2635 remove it: now that there is no tests/Makefile.am, the top-level
2636 Makefile properly updates atconfig when needed.
2637
e8cd1ad6
DJ
26382008-12-07 Di-an Jan <dianj@freeshell.org>
2639
2640 Implement the FIXME that ends an user action with a semicolon
2641 if it seems necessary.
2642 * src/scan-code.l (flex rules section): Flag cpp directive from
2643 any `#' to the first unescaped end-of-line. Semicolon is not
2644 needed after `;', `{', '}', or cpp directives and is needed after
2645 any other token (whitespaces and comments have no effect).
2646 * tests/actions.at (Fix user actions without a trailing semicolon):
2647 New test.
2648 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2649 to make user actions complete statements.
2650 Adjust column numbers in error messages.
2651 * tests/regression.at (Fix user actions without a trailing semicolon):
2652 Remove. Covered by new test.
2653
ce9447fc
AD
26542008-12-07 Akim Demaille <demaille@gostai.com>
2655
2656 Update gnulib.
2657 * gnulib: Update from master.
2658
d333175f
EB
26592008-12-05 Eric Blake <ebb9@byu.net>
2660
2661 Avoid compiler warning.
2662 * src/output.c (muscle_insert_item_number_table): Delete unused
2663 function.
2664
215b40ac
EB
26652008-12-02 Eric Blake <ebb9@byu.net>
2666
2667 Build testsuite with newer autoconf.
2668 * tests/output.at (m4_expand): Don't override in newer autoconf,
2669 where the underlying implementation changed.
2670 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2671 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2672 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2673 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2674 since some of them contain unbalanced ')'.
2675
3bb21113
AD
26762008-12-01 Akim Demaille <demaille@gostai.com>
2677
2678 Use b4_symbol for printers and destructors everywhere.
2679 * data/bison.m4 (b4_symbol_action_location): New.
2680 * data/c.m4 (b4_symbol_actions): Remove.
2681 Adjust all callers to use by b4_symbol_foreach and the corresponding
2682 b4_symbol_printer/destructor macro.
2683 * data/glr.cc: Adjust.
2684 * data/lalr1.java: Adjust the %destructor sanity check.
2685 * src/output.c (symbol_code_props_output): Remove, we no longer
2686 need the b4_symbol_printers/destructors tables.
2687
fb7c5b1f
AD
26882008-12-01 Akim Demaille <demaille@gostai.com>
2689
2690 Use b4_symbol_case_.
2691 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
2692 b4_symbol_case_.
2693
cf6fb222
AD
26942008-12-01 Akim Demaille <demaille@gostai.com>
2695
2696 Move b4_symbol based macro to bison.m4.
2697 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
2698 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
2699 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
2700 (b4_type_foreach): Move to...
2701 * data/bison.m4: Here.
2702 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
2703 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 2704
e3c52a63
AD
27052008-12-01 Akim Demaille <demaille@gostai.com>
2706
2707 b4_symbol/type_foreach.
2708 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
2709 Use them.
2710
2bde9113
AD
27112008-12-01 Akim Demaille <demaille@gostai.com>
2712
2713 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
2714 Instead of defining complex list of tuples to define various
2715 properties of the symbols, we now prefer to define symbols as
2716 "structs" in m4: using the symbol key (its number), and the
2717 property name, b4_symbol gives it value. Use this to handle
2718 destructors and printers.
2719
2bde9113
AD
2720 * src/output.c (CODE_PROP): New.
2721 (prepare_symbol_definitions): Use it to define the printer and
2722 destructor related attributes of the symbols.
2723 * data/lalr1.cc (b4_symbol_actions): Rename as...
2724 (b4_symbol_action): this.
2725 Use b4_symbol instead of 6 arguments.
2726 (b4_symbol_printer, b4_symbol_destructor): New.
2727 Use them instead of b4_symbol_actions.
2728
44494bf6
AD
27292008-12-01 Akim Demaille <demaille@gostai.com>
2730
2731 Avoid capturing variables too easily.
2732 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
2733 v__ and p__ instead of v and p.
2734
fad814bd
AD
27352008-12-01 Akim Demaille <demaille@gostai.com>
2736
2737 Remove spurious empty line before syncline.
2738 * data/bison.m4 (b4_syncline): Don't output an empty line before
2739 the output.
2740
feda5527
AD
27412008-11-26 Akim Demaille <demaille@gostai.com>
2742
2743 Convert lib/Makefile.am into lib/local.mk.
2744 The real problem is rather gnulib.mk, which itself is extracted
2745 from a Makefile.am that gnulib expects to the "recursive". The
2746 tool prefix-gnulib-mk converts such a gnulib.mk to be
2747 non-recursive. Also, some AC_SUBST variables need to be adjusted.
2748
2749 * etc/prefix-gnulib-mk: New.
2750 * bootstrap (slurp): Use it to convert further gnulib.mk.
2751 No longer try to avoid re-creation of lib/gnulib.mk as the changes
2752 are deeper.
2753 * lib/Makefile.am: Rename as...
2754 * lib/local.mk: this.
2755 Adjust to be prefixed.
2756 * Makefile.am, configure.ac: Adjust.
2757 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
2758
56ddee7f
AD
27592008-11-26 Akim Demaille <demaille@gostai.com>
2760
2761 s/_FLAGS/FLAGS/.
2762 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
2763 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
2764 Reported by Eric Blake.
2765
728e89a0
AD
27662008-11-26 Akim Demaille <demaille@gostai.com>
2767
2768 Use b4_parser_tables_define in glr.cc.
2769 * data/glr.c: Use b4_parser_tables_define instead of defining the
2770 (deterministic integral) tables by hand.
2771
2c1bf9bd
AD
27722008-11-26 Akim Demaille <demaille@gostai.com>
2773
2774 Use b4_parser_tables_define in Java.
2775 * data/java.m4 (b4_typed_parser_table): Rename as...
2776 (b4_typed_parser_table_define): this, for consistency.
2777 Accept a comment as $4.
2778 Move $2 into yy*_.
2779 (b4_integral_parser_table): Rename as...
2780 (b4_integral_parser_table_define): this.
2781 * data/lalr1.java: Adjust all uses.
2782 Use b4_parser_tables_define instead of generation by hand.
2783
ba206cf4
AD
27842008-11-26 Akim Demaille <demaille@gostai.com>
2785
2786 Prepare the convergence bw C style and Java table generation.
2787 * data/bison.m4 (b4_tables_map, b4_tables_declare)
2788 (b4_tables_define): Rename as...
2789 (b4_integral_parser_tables_map, b4_parser_tables_declare)
2790 (b4_parser_tables_define): these.
2791 * data/c.m4 (b4_table_define): Rename as...
2792 (b4_integral_parser_table_define): this.
2793 * data/lalr1.cc: Adjust.
2794 (b4_table_define, b4_table_declare): Rename as...
2795 (b4_integral_parser_table_define)
2796 (b4_integral_parser_table_declare): these.
2797 (yyrline_): Move the comment where it is actually used.
2798 * data/yacc.c: Adjust.
2799 (yyrline): Use b4_integral_parser_table_define.
2800
d12f8e49
AD
28012008-11-26 Akim Demaille <demaille@gostai.com>
2802
2803 Regen.
2804 * src/parse-gram.h, src/parse-gram.c: Regen.
2805
0991e29b
AD
28062008-11-26 Akim Demaille <demaille@gostai.com>
2807
2808 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
2809 * data/lalr1.cc (b4_tables_map): Move to...
2810 * data/bison.m4: here.
2811 Update the comment for yytable during the flight.
2812 (b4_tables_declare, b4_tables_define): New.
2813 * data/lalr1.cc: Use them.
2814 * data/c.m4 (b4_table_define): New.
2815 * data/yacc.c: Use b4_tables_define instead of output the tables
2816 by hand.
2817 * tests/regression.at (Web2c Actions): Adjust the expected output,
2818 the order of the tables changed.
2819
3d3bc1fe
AD
28202008-11-26 Akim Demaille <demaille@gostai.com>
2821
2822 Get rid of (yy)rhs and (yy)prhs.
2823 These tables are no longer needed in the parsers, and they don't seem to
2824 be useful. They are not documented either.
feda5527 2825
3d3bc1fe
AD
2826 * src/output.c (prepare_rules): Get rid of rhs and prhs.
2827 Adjust the computation of (yy)r2.
2828
08c81469
AD
28292008-11-26 Akim Demaille <demaille@gostai.com>
2830
2831 Rule length is unsigned.
2832 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
2833
932b0c96
AD
28342008-11-26 Akim Demaille <demaille@gostai.com>
2835
2836 Get rid of lalr1-split.cc.
2837 It was no longer maintainer.
feda5527 2838
932b0c96
AD
2839 * data/lalr1-split.cc: Remove.
2840 * etc/bench.pl.in (bench_fusion_parser): Remove.
2841 Adjust.
2842
8452c667
AD
28432008-11-26 Akim Demaille <demaille@gostai.com>
2844
2845 Use yy* consistently.
2846 * data/glr.c: Now that yyrhs no longer exists as a global
2847 variable, rename local "rhs" variables into "yyrhs" for
2848 consistency.
2849
783aa653
AD
28502008-11-25 Akim Demaille <demaille@gostai.com>
2851
2852 Get rid of yyrhs and yyprhs in glr.c.
2853 * data/glr.c (yyrhs, yyprhs): Remove.
2854 Instead, use the state stack and yystos.
2855
6130b755
AD
28562008-11-25 Akim Demaille <demaille@gostai.com>
2857
2858 Flag glr tests.
2859 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
2860 as an Autotest keyword.
2861
95a7b1c9
AD
28622008-11-25 Akim Demaille <demaille@gostai.com>
2863
2864 Prefer TESTSUITE_FLAGS.
2865 TESTSUITEFLAGS is barely readable.
feda5527 2866
95a7b1c9
AD
2867 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
2868 for backward compatibility.
2869 Use the former instead of the latter.
2870
b4f18401
AD
28712008-11-25 Akim Demaille <demaille@gostai.com>
2872
2873 Get rid of yyrhs and yyprhs in larl1.java.
2874 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
2875 (yy_reduce_print): Rather, use yystos_ and the state stack.
2876
c265fd6b
AD
28772008-11-25 Akim Demaille <demaille@gostai.com>
2878
2879 Formatting changes.
2880
68dbdee8
AD
28812008-11-25 Akim Demaille <demaille@gostai.com>
2882
2883 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
2884 They were used to get the symbol types, given a rule number, when
2885 displaying the top of the stack before a reduction. But the
2886 symbol type is available from the state stack. This has two be
2887 benefits: two tables less in the parser (making it smaller), and a
2888 more consistent use of the three stacks which will help to fuse
2889 them.
feda5527 2890
68dbdee8
AD
2891 * data/yacc.c (yyprhs, yyrhs): Remove.
2892 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
2893 (yy_reduce_print): Take yyssp as argument.
2894 Use it, together with yystos, to get the symbol type.
2895 * tests/regression.at (Web2c Report): Remove these tables from the
2896 expected output.
2897
6ab1adbe
AD
28982008-11-25 Akim Demaille <demaille@gostai.com>
2899
2900 b4_tables_map.
2901 The point is to factor the generation of the tables across skeletons.
2902 This is language dependant.
feda5527 2903
6ab1adbe
AD
2904 * data/c.m4 (b4_comment_): New.
2905 Should be usable to define how to generate tables independently of
2906 the language.
2907 (b4_c_comment): New.
2908 (b4_comment): Bounce to b4_c_comment.
2909 Now support $2 = [PREFIX] for indentation.
2910 * data/lalr1.cc (b4_table_declare): Don't output a comment if
2911 there is no comment.
2912 Indent it properly when there is one.
2913 Output the ending semicolon.
2914 (b4_table_define): Space changes.
2915 Output the ending semicolon.
2916 (b4_tables_map): New.
2917 Use it twice instead of declaring and defining the (integral)
2918 tables by hand.
2919
0fddb3d5
AD
29202008-11-25 Akim Demaille <demaille@gostai.com>
2921
2922 b4_table_declare.
2923 * data/lalr1.cc (b4_table_declare): New.
2924 Use it to declare the tables defined with b4_table_define.
2925 (b4_table_define): Declare a third arg to match b4_table_declare
2926 signature.
2927 Move all the comments around invocations of b4_table_define into
2928 the invocations itselves.
2929 Move things around to have the order for declarations and
2930 definitions.
2931
c4ddc0fb
AD
29322008-11-25 Akim Demaille <demaille@gostai.com>
2933
2934 Formatting changes.
2935 * data/lalr1.java: here.
2936
e0c653e7
AD
29372008-11-25 Akim Demaille <demaille@gostai.com>
2938
2939 b4_args is more general than only C++.
2940 * data/lalr1.cc (b4_args, _b4_args): Move to...
2941 * data/bison.m4: here.
2942
4182a0a1
DJ
29432008-11-21 Di-an Jan <dianj@freeshell.org>
2944
2945 Implement no-XXX arguments for --warnings, --report, --trace.
2946 * src/getargs.c (flags_argmatch): Handles no-XXX.
2947 Fix typo in doxygen comment.
2948
01466c3e
AD
29492008-11-21 Akim Demaille <demaille@gostai.com>
2950
2951 Display the changes in cross-options.texi.
2952 * build-aux/cross-options.pl ($sep): New, to separate items.
2953 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
2954 changes.
2955
a7c09cba
DJ
29562008-11-20 Di-an Jan <dianj@freeshell.org>
2957
2958 Improves options in the manual.
2959 * doc/bison.texinfo (-g, -x): Add space before argument.
2960 (Option Cross Key): Implement FIXME: listing directives also.
2961 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2962 (Short Option): Special case -d. Put arguments inside @option.
feda5527 2963 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
2964 src/scan-gram.l (actual name passed as the first argument)
2965 with special case for %define.
2966 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
2967 to build-aux/cross-options.pl.
2968 * src/getargs.c (usage): Document limitations of cross-options.pl.
2969 * src/scan-gram.l: Likewise.
2970
6c88b51e
JD
29712008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2972
2973 Fix unexpanded macros in GLR defines file.
2974 Reported by Csaba Raduly at
2975 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2976 * THANKS (Csaba Raduly): Add.
2977 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2978 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2979 lexer in a separate module that includes the defines file.
2980 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
2981 source.
2982 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2983 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2984 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2985 (AT_DATA_SOURCE_PROLOGUE): New.
2986 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2987 (AT_DATA_SOURCE): New.
2988 (AT_FULL_COMPILE): Extend to support an additional source file.
2989
1e034807
AD
29902008-11-18 Akim Demaille <demaille@gostai.com>
2991
2992 More TODO.
2993 * TODO: More short term issues.
2994
e3dda35c
AD
29952008-11-18 Akim Demaille <demaille@gostai.com>
2996
2997 Regen.
2998 * src/parse-gram.h, src/parse-gram.c: Regen.
2999
bd187d7b
AD
30002008-11-18 Akim Demaille <demaille@gostai.com>
3001
3002 Use b4_subtract where possible.
3003 * data/lalr1.cc (b4_subtract): Move to...
3004 * data/bison.m4: here.
3005 * data/glr.c (b4_rhs_data): Use it.
3006 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
3007
6085ab0d
AD
30082008-11-18 Akim Demaille <demaille@gostai.com>
3009
3010 Remove incorrect mode specification.
3011 * data/glr.cc: Don't pretend it's C code.
3012
9ce405ce
JD
30132008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3014
3015 Simplify last patch slightly.
3016 * src/getargs.c (getargs): Here.
3017
a8beef7e
JD
30182008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3019
3020 Fix last warning from --enable-gcc-warnings.
3021 * src/getargs.c (getargs): Don't assign const address to non-const
3022 pointer.
3023
d50eea6d
JD
30242008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3025
3026 Don't let maintainer-*-check targets force a version update.
3027 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
3028 handled.
3029
f5f419de
DJ
30302008-11-17 Di-an Jan <dianj@freeshell.org>
3031
3032 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
3033 Align menus. Adjust word wrapping. Use node names for menu names.
3034 (Examples): Don't abbreviate node names.
3035 (LocalWords): Remove abbreviations.
3036 (Copying): Make description a sentence.
d50eea6d 3037 (Java Action Features): Remove period to match the rest of menu.
f5f419de 3038
d73e55e0
DJ
30392008-11-17 Di-an Jan <dianj@freeshell.org>
3040
3041 Handles several --enable-gcc-warnings.
3042 * src/getargs.c (command_line_location): Set parameters to void.
3043 * src/output.c (symbol_type_name_cmp): Make static.
3044 (symbols_by_type_name): Set parameters to void.
3045 (symbol_definitions_output): Remove unused parameter. Rename as...
3046 (prepare_symbol_definitions): this.
3047 (muscles_output): Move symbol_definitions_output to...
3048 (output): here as prepare_symbol_definitions.
3049 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 3050 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 3051
68c989de
DJ
30522008-11-17 Di-an Jan <dianj@freeshell.org>
3053
3054 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
3055 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
3056
23ce6f4c
AD
30572008-11-16 Akim Demaille <demaille@gostai.com>
3058
3059 Add missing $(EXEEXT).
3060 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
3061 "src/bison$(EXEEXT)".
3062 Reported by Di-an Jan.
3063
dd704c35
AD
30642008-11-15 Akim Demaille <demaille@gostai.com>
3065
3066 * TODO: Update.
3067
dab244d5
AD
30682008-11-15 Akim Demaille <demaille@gostai.com>
3069
3070 Formatting changes.
3071 * tests/input.at: here.
3072
4b4da9fb
AD
30732008-11-15 Akim Demaille <demaille@gostai.com>
3074
3075 Remove duplicate header inclusion.
3076 * src/LR0.c: here.
3077
4ea3f53d
AD
30782008-11-15 Akim Demaille <demaille@gostai.com>
3079
3080 * src/parse-gram.h, src/parse-gram.c: Regen.
3081
cb823b6f
AD
30822008-11-15 Akim Demaille <demaille@gostai.com>
3083
3084 Support parametric types.
b06df3c2
AD
3085
3086 There are two issues to handle: first scanning nested angle
3087 bracket pairs to support types such as std::pair< std::string,
3088 std::list<std::string> > >.
3089
3090 Another issue is to address idiosyncracies of C++: do not glue two
3091 closing angle brackets together (otherwise it's operator>>), and
3092 avoid sticking blindly a TYPE to the opening <, as it can result
3093 in '<:' which is a digraph for '['.
3094
cb823b6f
AD
3095 * src/scan-gram.l (brace_level): Rename as...
3096 (nesting): this.
3097 (SC_TAG): New.
3098 Implement support for complex tags.
b06df3c2 3099 (tag): Accept
cb823b6f
AD
3100 , but not <.
3101 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
3102 (b4_symbol_variant): Leave space around types as parameters.
3103 * examples/variant.yy: Use nested template types and leading ::.
3104 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
3105 Rename as...
3106 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
3107 * tests/c++.at: Test parametric types.
3108
7b6e6753
AD
31092008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3110
3111 Test token.prefix.
3112 This is not sufficient, but we test at least that the make_SYMBOL
3113 interface is not affected by token.prefix. A more general test
3114 will be implemented when the support of token.prefix is generalized
3115 to more skeletons.
b06df3c2 3116
7b6e6753
AD
3117 * tests/c++.at: One more variant test, using token.prefix.
3118
dddec537
AD
31192008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3120
3121 Test the make_TOKEN interface.
3122 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
3123 Factor the common code in yylex.
3124 Use it to test "%define lex_symbol".
3125
7d3e21ba
AD
31262008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3127
3128 Formatting change.
3129
4fc55348
AD
31302008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3131
3132 Simplify code for variants bench marks.
3133 * etc/bench.pl.in (&generate_grammar_list): Define and use
3134 location_type.
3135 Factor the common code in yylex.
3136
070e6509
AD
31372008-11-15 Akim Demaille <demaille@gostai.com>
3138
3139 Better error message.
3140 * bootstrap (find_tool): Fix the error message.
3141
0078681b
AD
31422008-11-15 Akim Demaille <demaille@gostai.com>
3143
3144 Update variant.yy to newest interface.
3145 * examples/variant.yy: Define lex_symbol.
3146 Adjust.
3147
ff084799
AD
31482008-11-15 Akim Demaille <demaille@gostai.com>
3149
3150 Don't use locations in variant.yy.
3151 * examples/variant.yy: Adjust to not using locations.
3152
b0d79ec6
AD
31532008-11-15 Akim Demaille <demaille@gostai.com>
3154
3155 Comment changes.
3156 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
3157 comments for the license.
3158
d4977ce3
AD
31592008-11-15 Akim Demaille <demaille@gostai.com>
3160
3161 Remove tests/Makefile.am.
3162 * tests/Makefile.am: Rename as...
3163 * tests/local.mk: this.
3164 * Makefile.am, configure.ac: Adjust.
3165 * Makefile.am (DISTCLEANFILES): Define.
3166 (maintainer-check, maintainer-xml-check, maintainer-push-check):
3167 Remove, we no longer need to bounce to the real targets.
3168
87f1149a
AD
31692008-11-15 Akim Demaille <demaille@gostai.com>
3170
3171 Comment changes.
3172
36415906
AD
31732008-11-15 Akim Demaille <demaille@gostai.com>
3174
3175 djgpp/local.mk.
3176 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
3177 * djgpp/local.mk: this new file.
3178
e2c2f696
AD
31792008-11-15 Akim Demaille <demaille@gostai.com>
3180
3181 Remove doc/Makefile.am.
3182 * doc/Makefile.am: Rename as...
3183 * doc/local.mk: this.
3184 Adjust paths
3185 * Makefile.am, configure.ac: Adjust.
3186 * Makefile.am (MOSTLYCLEANFILES): New.
3187 * src/local.mk: Adjust.
3188
2ead32e6
AD
31892008-11-15 Akim Demaille <demaille@gostai.com>
3190
3191 Move sc_tight_scope into maint.mk.
b06df3c2
AD
3192 It does not work, and I don't know how it was supposed to work: it
3193 seems to be looking for sources in the build tree. I just moved
3194 it at a better place, fixing it is still required.
3195
2ead32e6
AD
3196 * src/local.mk (echo): Remove.
3197 (sc_tight_scope): Move to...
3198 * maint.mk: here.
3199
2df9ec37
AD
32002008-11-15 Akim Demaille <demaille@gostai.com>
3201
3202 Regen.
3203 * src/parse-gram.h, src/parse-gram.h: Regen.
3204
0305d25e
AD
32052008-11-15 Akim Demaille <demaille@gostai.com>
3206
3207 Remove src/Makefile.am.
3208 * src/Makefile.am: Rename as...
3209 * src/local.mk: this.
3210 Prefix all the paths with src/.
3211 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
3212 (AM_CPPFLAGS): Find find in builddir/src.
3213 (YACC): Move the flags into...
3214 (AM_YFLAGS): here.
3215 * maint.mk (sc_tight_scope): Disable.
3216 It used to bounce to the version in src/Makefile.am which is now
3217 part of this very Makefile.
3218 * Makefile.am, configure.ac: Adjust.
3219 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
3220 include "..." to find files "here": we are no longer in src/, so
3221 qualify the includes with src/.
3222 * doc/Makefile.am (PREPATH): No longer include the top_builddir
3223 prefix.
3224 (.x.1): Adjust to be able to create src/foo from the top level
3225 Makefile, instead of going bounce to src/Makefile the creation of
3226 foo.
3227
5277c0a3
AD
32282008-11-15 Akim Demaille <demaille@gostai.com>
3229
3230 Remove useless variable.
3231 * doc/Makefile.am (srcsrcdir): Remove.
3232
6a5aa0cd
AD
32332008-11-15 Akim Demaille <demaille@gostai.com>
3234
3235 Remove data/Makefile.am.
3236 * data/Makefile.am: Rename as...
3237 * data/local.mk: this.
3238 Adjust paths.
3239 * Makefile.am, configure.ac: Adjust.
3240
7cb794dc
AD
32412008-11-15 Akim Demaille <demaille@gostai.com>
3242
3243 Remove etc/Makefile.am.
3244 * etc/Makefile.am: Rename as...
3245 * etc/local.mk: this.
3246 Adjust.
3247 * Makefile.am, configure.ac: Adjust.
3248
cd409e3b
AD
32492008-11-15 Akim Demaille <demaille@gostai.com>
3250
3251 Remove examples/local.mk.
3252 examples/calc++/Makefile.am might be interesting to keep as is, since
3253 it is an example in itself.
2df9ec37 3254
cd409e3b
AD
3255 * examples/Makefile.am: Rename as...
3256 * examples/local.mk: this.
3257 Adjust.
3258 * Makefile.am, configure.ac: Adjust.
3259
9a1e4214
AD
32602008-11-15 Akim Demaille <demaille@gostai.com>
3261
3262 Remove build-aux/Makefile.am.
3263 Recursive Makefiles are really way too slow, let's get rid of some of
3264 them.
2df9ec37 3265
9a1e4214
AD
3266 * build-aux/Makefile.am: Rename as...
3267 * build-aux/local.mk: this.
3268 Adjust paths.
3269 * Makefile.am, configure.ac: Adjust.
3270
0634493c
AD
32712008-11-15 Akim Demaille <demaille@gostai.com>
3272
3273 Provide convenience constructors for locations and positions.
3274 * data/location.cc (position::position): Accept file, line and
3275 column as arguments with default values.
3276 Always qualify initial line and column literals as unsigned.
3277 (location::location): Provide convenience constructors.
3278
fe1b448a
AD
32792008-11-15 Akim Demaille <demaille@gostai.com>
3280
b06df3c2
AD
3281 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
3282 token type.
fe1b448a
AD
3283 Using template buys us nothing, and makes it uselessly complex to
3284 construct a symbol. Besides, it could not be generalized to other
3285 languages, while make_FOO would work in C/Java etc.
2df9ec37 3286
fe1b448a
AD
3287 * data/lalr1.cc (b4_symbol_): New.
3288 (b4_symbol): Use it.
3289 (b4_symbol_constructor_declaration_)
3290 (b4_symbol_constructor_definition_): Instead of generating
3291 specializations of an overloaded template function, just generate
3292 several functions whose names are forged from the token names
3293 without the token.prefix.
3294 (b4_symbol_constructor_declarations): Generate them for all the
3295 symbols, not just by class of symbol type, now that instead of
3296 specializing a function template by the token, we generate a
3297 function named after the token.
3298 (b4_symbol_constructor_specialization_)
3299 (b4_symbol_constructor_specializations): Remove.
3300 * etc/bench.pl.in: Adjust to this new API.
3301
5679f311
AD
33022008-11-13 Akim Demaille <demaille@gostai.com>
3303
3304 %define token.prefix.
b06df3c2
AD
3305 Provide a means to add a prefix to the name of the tokens as
3306 output in the generated files. Because of name clashes, it is
3307 good to have such a prefix such as TOK_ that protects from names
3308 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 3309
5679f311
AD
3310 * data/bison.m4 (token.prefix): Empty by default.
3311 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
3312 * data/lalr1.cc (b4_symbol): Ditto.
3313
3204049e
AD
33142008-11-13 Akim Demaille <demaille@gostai.com>
3315
3316 Compute at M4 time some of the subtractions.
90290ce5 3317 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
3318 (b4_rhs_data): Use it.
3319
202598d3
AD
33202008-11-13 Akim Demaille <demaille@gostai.com>
3321
3322 symbol::token.
b06df3c2 3323 This allows the user to get the type of a token returned by yylex.
2df9ec37 3324
202598d3
AD
3325 * data/lalr1.cc (symbol::token): New.
3326 (yytoknum_): Define when %define lex_symbol, independently of
3327 %debug.
3328 (yytoken_number_): Move into...
3329 (symbol::token): here, since that's the only use.
3330 The other one is YYPRINT which was not officially supported
3331 by lalr1.cc, and anyway it did not work since YYPRINT uses this
3332 array under a different name (yytoknum).
3333
fc2476c7
AD
33342008-11-13 Akim Demaille <demaille@gostai.com>
3335
3336 YYERRCODE.
3337 * TODO (YYERRCODE): Mention the case of $undef.
3338
865f1e9f
AD
33392008-11-13 Akim Demaille <demaille@gostai.com>
3340
3341 TODO: YYPRINT.
3342 * TODO (YYPRINT): New.
3343
cb0b136a
AD
33442008-11-13 Akim Demaille <demaille@gostai.com>
3345
3346 Comment changes.
3347 * data/lalr1.cc, data/yacc.c: Fix the description of the
3348 yytranslate and yytoknum tables.
3349
2c086d29
AD
33502008-11-13 Akim Demaille <demaille@gostai.com>
3351
3352 Define make_symbol in the header.
b06df3c2
AD
3353 To reach good performances these functions should be inlined (yet
3354 this is to measure precisely). To this end they must be available
3355 to the caller.
2df9ec37 3356
2c086d29
AD
3357 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
3358 location_type with the class name.
3359 Since will now be output in the header, declare "inline".
3360 No longer use b4_symbol_constructor_specializations, but
3361 b4_symbol_constructor_definitions in the header.
3362 Don't call it in the *.cc file.
3363
1c4af381
AD
33642008-11-13 Akim Demaille <demaille@gostai.com>
3365
3366 Define yytranslate in the header for lex_symbol.
3367 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
3368 into the header file when using %define lex_symbol.
3369 (yytranslate_): Declare inline.
3370
e51b0a82
AD
33712008-11-13 Akim Demaille <demaille@gostai.com>
3372
b06df3c2
AD
3373 Define the constructors of symbol_type in
3374 b4_symbol_constructor_definitions.
e51b0a82 3375 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
3376 forthcoming patch will move elsewhere. Hence the interest of
3377 putting them together.
2df9ec37 3378
b06df3c2
AD
3379 The stack_symbol_type does not need to be moved, it is used only
3380 by the parser.
2df9ec37 3381
e51b0a82
AD
3382 * data/lalr1.cc: Move symbol_type and symbol_base_type
3383 constructors into...
3384 (b4_symbol_constructor_definitions): here.
3385 Adjust.
3386
78835571
AD
33872008-11-13 Akim Demaille <demaille@gostai.com>
3388
3389 Make it easier to move the definition of yytranslate_.
3390 Forthcoming changes will make it possible to use yytranslate_
3391 from outside the parser implementation file.
2df9ec37 3392
78835571
AD
3393 * data/lalr1.cc (b4_yytranslate_definition): New.
3394 Use it.
3395
c1e6c88c
AD
33962008-11-13 Akim Demaille <demaille@gostai.com>
3397
3398 Remove useless class specification.
3399 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
3400 to refer to the class name to use a type defined by the class for
3401 arguments of member functions.
3402
4654b0c0
AD
34032008-11-13 Akim Demaille <demaille@gostai.com>
3404
3405 Finer input type for yytranslate.
3406 This patch is debatable: the tradition expects yylex to return an int
3407 which happens to correspond to token_number (which is an enum). This
3408 allows for instance to return characters (such as '*' etc.). But this
3409 goes against the stronger typing I am trying to have with the new
3410 lex interface which return a symbol_type. So in this case, feed
3411 yytranslate_ with a token_type.
2df9ec37 3412
4654b0c0
AD
3413 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
3414 expect a token_type.
3415
dd735e4e
AD
34162008-11-13 Akim Demaille <demaille@gostai.com>
3417
3418 Honor lex-params in %define lex_symbol mode.
3419 * data/lalr1.cc: Use b4_lex_param.
3420
6659366c
AD
34212008-11-13 Akim Demaille <demaille@gostai.com>
3422
3423 Simplify names.
3424 * src/output.c (symbol_definitions_output): Rename symbol
3425 attributes type_name and has_type_name as type and has_type.
3426 * data/lalr1.cc: Adjust uses.
3427
e9805e57
AD
34282008-11-13 Akim Demaille <demaille@gostai.com>
3429
3430 Use b4_type_names for the union type.
b06df3c2
AD
3431 The union used to compute the size of the variant used to iterate
3432 over the type of all the symbols, with a lot of redundancy. Now
3433 iterate over the lists of symbols having the same type-name.
2df9ec37 3434
e9805e57
AD
3435 * data/lalr1.cc (b4_char_sizeof_): New.
3436 (b4_char_sizeof): Use it.
3437 Adjust to be called with a list of numbers instead of a single
3438 number.
3439 Adjust its caller for new-line issues.
3440
aea10ef4
AD
34412008-11-13 Akim Demaille <demaille@gostai.com>
3442
3443 Define the "identifier" of a symbol.
b06df3c2
AD
3444 Symbols may have several string representations, for instance if
3445 they have an alias. What I call its "id" is a string that can be
3446 used as an identifier. May not exist.
2df9ec37 3447
b06df3c2
AD
3448 Currently the symbols which have the "tag_is_id" flag set are
3449 those that don't have an alias. Look harder for the id.
2df9ec37 3450
aea10ef4
AD
3451 * src/output.c (is_identifier): Move to...
3452 * src/symtab.c (is_identifier): here.
3453 * src/symtab.h, src/symtab.c (symbol_id_get): New.
3454 * src/output.c (symbol_definitions_output): Use it to define "id"
3455 and "has_id".
3456 Remove the definition of "tag_is_id".
3457 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
3458 "tag_is_id" were used to produce code.
3459 We still use "tag" for documentation.
3460
2ea7730c
AD
34612008-11-11 Akim Demaille <demaille@gostai.com>
3462
3463 Locations are no longer required by lalr1.cc.
3464 * data/lalr1.cc (_b4_args, b4_args): New.
3465 Adjust all uses of locations to make them optional.
3466 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
3467 (AT_CHECK_NAMESPACE): Check the use of locations.
3468 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
3469 without locations with lalr1.cc.
3470 Test these cases.
3471 * tests/output.at: Check lalr1.cc with and without location
3472 support.
3473 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
3474 Don't use locations.
3475
7ca2266a
AD
34762008-11-11 Akim Demaille <demaille@gostai.com>
3477
3478 AT_FULL_COMPILE.
3479 * tests/local.at (AT_FULL_COMPILE): New.
3480 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
3481
1a7a65f9
AD
34822008-11-11 Akim Demaille <demaille@gostai.com>
3483
3484 Support parens in calc++.
3485 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
3486 * examples/calc++/test (run): Check the expected output.
3487 Adjust callers.
3488 Check parens too.
3489
c944f7f2
AD
34902008-11-11 Akim Demaille <demaille@gostai.com>
3491
3492 Simplify lalr1.cc since %defines is mandatory.
3493 * data/lalr1.cc: Remove useless calls to b4_defines_if.
3494
dada3cd1
AD
34952008-11-11 Akim Demaille <demaille@gostai.com>
3496
3497 TODO: yyfmt.
3498 * TODO (yysyntax_error): New item.
3499
422c18f4
AD
35002008-11-11 Akim Demaille <demaille@gostai.com>
3501
3502 Prefer M4 to CPP.
3503 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
3504 YYERROR_VERBOSE.
3505
a0ffc175
AD
35062008-11-11 Akim Demaille <demaille@gostai.com>
3507
3508 Support i18n of the parse error messages.
3509 * TODO (lalr1.cc/I18n): Remove.
3510 * data/lalr1.cc (yysyntax_error_): Support the translation of the
3511 error messages, as done in yacc.c.
3512 Stay within the yy* pseudo namespace.
3513
00a8a083
AD
35142008-11-11 Akim Demaille <demaille@gostai.com>
3515
3516 More TODO.
3517 * TODO (single stack, yysyntax_error): New.
3518
09277875
AD
35192008-11-11 Akim Demaille <demaille@gostai.com>
3520
3521 Make it possible to return a symbol_type from yylex.
3522 * data/lalr1.cc (b4_lex_symbol_if): New.
3523 (parse): When lex_symbol is defined, expected yylex to return the
3524 complete lookahead.
3525 * etc/bench.pl.in (generate_grammar_list): Extend to support this
3526 yylex interface.
3527 (bench_variant_parser): Exercise it.
3528
64c1b92a
AD
35292008-11-11 Akim Demaille <demaille@gostai.com>
3530
3531 Remove useless bench case.
3532 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
3533 no longer used.
3534
2722aa42
AD
35352008-11-11 Akim Demaille <demaille@gostai.com>
3536
3537 Improve display of directives.
3538 * etc/bench.pl.in (parse_term): Don't add useless eol.
3539
918eb7c5
AD
35402008-11-11 Akim Demaille <demaille@gostai.com>
3541
3542 Use string_cast in the bench.
3543 * etc/bench.pl.in (generate_grammar_list): Define and use
3544 string_cast.
3545
39be9022
AD
35462008-11-11 Akim Demaille <demaille@gostai.com>
3547
3548 Replace yychar with a Boolean.
3549 * data/lalr1.cc (parse::yychar): Replace by...
3550 (parse::yyempty): this.
3551
a2e3fa77
AD
35522008-11-11 Akim Demaille <demaille@gostai.com>
3553
3554 Factor the tables.
3555 * TODO: New item.
3556
aba12ad1
AD
35572008-11-11 Akim Demaille <demaille@gostai.com>
3558
3559 Let yytranslate handle the eof case.
3560 * data/lalr1.cc (yytranslate_): Handle the EOF case.
3561 Adjust callers.
3562 No longer expect yychar to be equal to yyeof_, rather, test the
3563 lookahead's (translated) kind.
3564
27cb5b59
AD
35652008-11-11 Akim Demaille <demaille@gostai.com>
3566
3567 yychar cannot be empty in yyerrlab.
3568 * TODO (yychar == yyempty_): New.
3569 * data/lalr1.cc: Remove the handling of this case.
3570 This eases forthcoming changes related to yychar and yytranslate.
3571
fce629c0
AD
35722008-11-11 Akim Demaille <demaille@gostai.com>
3573
3574 Bench: syntactic sugar for %define/#define.
3575 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
3576 (&bench_push_parser, bench_variant_parser): Use this feature.
3577 (&eat): New.
3578 Use it.
3579
ce671960
AD
35802008-11-11 Akim Demaille <demaille@gostai.com>
3581
3582 Less memory pressure on the "list" bench.
3583 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
3584 the values, to limit memory pressure.
3585
2873fdf8
AD
35862008-11-11 Akim Demaille <demaille@gostai.com>
3587
3588 Introduce make_symbol.
b06df3c2
AD
3589 make_symbol provides a means to construct a full symbol (kind,
3590 value, location) in a single shot. It is meant to be a Symbol
3591 constructor, parameterized by the symbol kind so that overloading
3592 would prevent incorrect kind/value pairs. Unfortunately
3593 parameterized constructors do not work well in C++ (unless the
3594 parameter also appears as an argument, which is not acceptable),
3595 hence the use of a function instead of a constructor.
2df9ec37 3596
2873fdf8
AD
3597 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3598 (b4_symbol_constructor_declarations)
3599 (b4_symbol_constructor_specialization_)
3600 (b4_symbol_constructor_specializations)
3601 (b4_symbol_constructor_definition_)
3602 (b4_symbol_constructor_definitions): New.
3603 Use them where appropriate to generate declaration, declaration of
3604 the specializations, and implementations of the templated
3605 overloaded function "make_symbol".
3606 (variant::variant): Always define a default ctor.
3607 Also provide a copy ctor.
3608 (symbol_base_type, symbol_type): New ctor overloads for value-less
3609 symbols.
3610 (symbol_type): Now public, so that functions such as yylex can use
3611 it.
3612
8be046d7
AD
36132008-11-11 Akim Demaille <demaille@gostai.com>
3614
3615 Inform m4 whether a tag is a valid id.
3616 * src/output.c (is_identifier): New.
3617 (symbol_definitions_output): Use it to define tag_is_id.
3618 But maybe this should be done at m4 level?
3619
de62edee
AD
36202008-11-11 Akim Demaille <demaille@gostai.com>
3621
3622 Test 214 was failing: it greps with a pattern containing [ ]*
3623 which obviously meant to catch spaces and tabs, but contained only
3624 spaces. Tabulations in sources are a nuisance, so to simplify the
3625 matter, get rid of all the tabulations in the Java sources. The
3626 other skeletons will be treated equally later.
3627
3628 * data/java.m4, data/lalr1.java: Untabify.
3629 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
3630 tabulations are no longer generated.
3631
905f0697
PB
36322008-11-11 Paolo Bonzini <bonzini@gnu.org>
3633
3634 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3635 * configure.ac: Adjust usage.
3636 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3637 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3638 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3639
09ccae9b
DJ
36402008-11-10 Di-an Jan <dianj@freeshell.org>
3641
3642 Workaround Java's ``code too large'' problem for parser tables
3643 in most cases, by using one function per initialization.
3644 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
3645 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
3646 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
3647 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
3648 (yytname_): Use b4_typed_parser_table.
3649 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
3650 ``code too large'' error.
3651
1979121c
DJ
36522008-11-10 Di-an Jan <dianj@freeshell.org>
3653
3654 * NEWS: Document them.
de62edee 3655
1979121c
DJ
3656 General Java skeleton improvements.
3657 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
3658 using gcj < 4.3 in the testsuite, according to comments in
3659 gnulib/m4/javacomp.m4.
3660 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
3661 location_type, position_type): Remove extraneous brackets from
3662 b4_percent_define_default.
3663 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
3664 m4_define and m4_define_default.
3665 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
3666 which marks the end of user code with appropriate syncline, like all
3667 the other skeletons.
3668 (b4_user_post_prologue): Add. Don't silently drop.
3669 (yylex): Remove.
3670 (parse): Inline yylex.
3671 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
3672 (%{...%}): Fix typo of %code imports.
3673 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
3674
3675 Support annotations on parser class with %define annotations.
3676 * data/lalr1.java (annotations): Add to parser class modifier.
3677 * doc/bison.texinfo (Java Parser Interface): Document
3678 %define annotations.
3679 (Java Declarations Summary): Document %define annotations.
3680 * tests/java.at (Java parser class modifiers): Test annotations.
3681
3682 Do not generate code for %error-verbose unless requested.
3683 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
3684 Make private. Make conditional on %error-verbose.
3685 (getErrorVerbose, setErrorVerbose): New.
3686 (yytnamerr_): Make conditional on %error-verbose.
3687 (yysyntax_error): Make some code conditional on %error-verbose.
3688 * doc/bison.texinfo (Java Bison Interface): Remove the parts
3689 about %error-verbose having no effect.
3690 (getErrorVerbose, setErrorVerbose): Document.
3691
3692 Move constants for token names to Lexer interface.
3693 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
3694 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
3695 (parse): Qualify EOF to Lexer.EOF.
3696 * doc/bison.texinfo (Java Parser Interface): Move documentation of
3697 EOF and token names to Java Lexer Interface.
3698 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
3699
3700 Make yyerror public.
3701 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
3702 (yyerror): Change to public. Add Javadoc comments. Use longer
3703 parameter names. Make the body rather than the declarator
3704 conditional on %locations.
3705 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
3706
3707 Allow user to add code to the constructor with %code init.
3708 * data/java.m4 (b4_init_throws): New, for %define init_throws.
3709 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
3710 Add %code init to the front of the constructor body.
3711 * doc/bison.texinfo (YYParser.YYParser): Document %code init
3712 and %define init_throws.
3713 (Java Declarations Summary): Document %code init and
3714 %define init_throws.
3715 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
3716 (Java constructor init and init_throws): Add tests.
de62edee 3717
42f832d6
AD
37182008-11-10 Akim Demaille <demaille@gostai.com>
3719
3720 Update TODO.
3721 * TODO (-D): is implemented.
3722 (associativity): Same precedence must have the same associativity.
3723 For instance, how can a * b / c be parsed if * is %left and / is
3724 %right?
3725 (YYERRORCODE, YYFAIL, YYBACKUP): New.
3726
247efe34
AD
37272008-11-10 Akim Demaille <demaille@gostai.com>
3728
3729 Formatting changes.
3730
5d731440
AD
37312008-11-10 Akim Demaille <demaille@gostai.com>
3732
3733 More information about the symbols.
3734 * src/output.c (type_names_output): Document all the symbols,
3735 including those that don't have a type-name.
3736 (symbol_definitions_output): Define "is_token" and
3737 "has_type_name".
3738 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
3739 type-name, now that they are defined too in b4_type_names.
3740
21db118b
AD
37412008-11-10 Akim Demaille <demaille@gostai.com>
3742
3743 Regen.
3744
6ed15cde
AD
37452008-11-10 Akim Demaille <demaille@gostai.com>
3746
3747 Make parser::yytranslate static.
b06df3c2
AD
3748 Small speedup (1%) on the list grammar. And makes yytranslate_
3749 available in non member functions.
de62edee 3750
6ed15cde
AD
3751 * data/lalr1.cc (yytranslate_): Does not need to be a instance
3752 function.
3753
30bb2edc
AD
37542008-11-10 Akim Demaille <demaille@gostai.com>
3755
3756 Avoid trailing spaces.
3757 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
3758 * data/lalr1.cc: Don't indent before rule and symbol actions, as
3759 they can be empty, and anyway this incorrectly indents the first
3760 action.
3761
b3a28fd4
AD
37622008-11-10 Akim Demaille <demaille@gostai.com>
3763
3764 Comment changes.
3765
914202bd
AD
37662008-11-10 Akim Demaille <demaille@gostai.com>
3767
3768 Use "enum" for integral constants.
3769 This is just nicer to read, I observed no speedup.
de62edee 3770
914202bd
AD
3771 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
3772 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
3773 (yyuser_token_number_max_, yyundef_token_): Move into...
3774 (yytranslate_): here.
3775
c17f9a4a
AD
37762008-11-10 Akim Demaille <demaille@gostai.com>
3777
3778 Shortcuts in bench directives.
3779 * etc/bench.pl.in (parse_dirs): New.
3780 Use it.
3781 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
3782 Create the benches in "benches/".
3783
b9855ea5
AD
37842008-11-10 Akim Demaille <demaille@gostai.com>
3785
3786 Formatting changes.
3787 * data/lalr1.cc: here.
3788
6e097787
AD
37892008-11-10 Akim Demaille <demaille@gostai.com>
3790
3791 Adjust verbose message to using emacs.
3792 * etc/bench.pl.in: Inform compilation-mode when we change the
3793 directory.
3794 (generate_grammar_list): Recognize %define "variant" in addition
3795 to %define variant.
3796
4c3cc7da
AD
37972008-11-10 Akim Demaille <demaille@gostai.com>
3798
3799 Classify symbols by type-name.
3800 * src/uniqstr.h (UNIQSTR_CMP): New.
3801 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
3802 (type_names_output): New.
3803 (muscles_output): Use it.
3804 * data/lalr1.cc (b4_symbol_action_): Remove.
3805 (b4_symbol_case_, b4_type_action_): New.
3806 Adjust uses of b4_symbol_action_ to use b4_type_action_.
3807
d69c9694
AD
38082008-11-10 Akim Demaille <demaille@gostai.com>
3809
3810 Change the handling of the symbols in the skeletons.
3811 Before we were using tables which lines were the symbols and which
3812 columns were things like number, tag, type-name etc. It is was
3813 difficult to extend: each time a column was added, all the numbers had
3814 to be updated (you asked for colon $2, not for "tag"). Also, it was
3815 hard to filter these tables when only a subset of the symbols (say the
3816 tokens, or the nterms, or the tokens that have and external number
3817 *and* a type-name) was of interest.
de62edee 3818
d69c9694
AD
3819 Now instead of monolithic tables, we define one macro per cell. For
3820 instance "b4_symbol(0, tag)" is a macro name which contents is
3821 self-decriptive. The macro "b4_symbol" provides easier access to
3822 these cells.
de62edee 3823
d69c9694
AD
3824 * src/output.c (type_names_output): Remove.
3825 (symbol_numbers_output, symbol_definitions_output): New.
3826 (muscles_output): Call them.
3827 (prepare_symbols): Define b4_symbols_number.
3828
5263bea9
AD
38292008-11-10 Akim Demaille <demaille@gostai.com>
3830
3831 --trace=muscles
3832 * src/getargs.h, src/getargs.c (trace_muscle): New.
3833 (trace_types, trace_args): Support it.
3834 * src/output.c (output_skeleton): Use it.
3835
4175f6bb
AD
38362008-11-10 Akim Demaille <demaille@gostai.com>
3837
3838 muscles_output.
3839 * src/output.c (muscles_output): New, extracted from...
3840 (output_skeleton): here.
3841 Adjust.
3842
1de69d6a
AD
38432008-11-10 Akim Demaille <demaille@gostai.com>
3844
3845 Formatting changes.
3846
36db78a7
AD
38472008-11-10 Akim Demaille <demaille@gostai.com>
3848
3849 Update the variant example.
3850 * examples/variant.yy: Formatting changes.
3851 One stage build.
3852
e5eb92e7
AD
38532008-11-10 Akim Demaille <demaille@gostai.com>
3854
3855 Support constructor with an argument.
3856 This improves the "list" bench by 2%.
de62edee 3857
e5eb92e7
AD
3858 * data/lalr1.cc (variant::build): Add an overloaded version with
3859 an argument.
3860 * tests/c++.at (AT_CHECK_VARIANT): Check it.
3861
76307410
AD
38622008-11-10 Akim Demaille <demaille@gostai.com>
3863
3864 Test variants.
3865 * tests/c++.at (AT_CHECK_VARIANTS): New.
3866 Use it with and without %define assert.
3867
d78f0ac9
AD
38682008-11-10 Akim Demaille <demaille@gostai.com>
3869
3870 Add %precedence support.
3871 Unfortunately it is not possible to reuse the %prec directive. This
3872 is because to please POSIX, we do not require to end the rules with a
3873 semicolon. As a result,
de62edee 3874
d78f0ac9 3875 foo: bar %prec baz
de62edee 3876
d78f0ac9
AD
3877 is ambiguous: either a rule which precedence is that of baz, or a rule,
3878 and then a declaration of the precedence of the token baz.
de62edee 3879
d78f0ac9
AD
3880 * doc/bison.texinfo: Document %precedence.
3881 (Precedence Only): New.
3882 * src/assoc.h, src/assoc.c (precedence_assoc): New.
3883 * src/conflicts.c (resolve_sr_conflict): Support it.
3884 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
3885 Parse it.
3886 * tests/calc.at: Use %precedence for NEG.
3887 * tests/conflicts.at (%precedence does not suffice)
3888 (%precedence suffices): New tests.
3889
c85be41a
AD
38902008-11-09 Akim Demaille <demaille@gostai.com>
3891
3892 Make benches in a sub dirs.
3893 * etc/bench.pl.in ($dir): New.
3894 Use it.
3895 Check the use of constructors with an argument.
3896 (bench_variant_parser): Fix.
3897
db65ca1f
AD
38982008-11-09 Akim Demaille <demaille@gostai.com>
3899
3900 fix eof condition
3901
9b0efa5b
AD
39022008-11-09 Akim Demaille <demaille@gostai.com>
3903
3904 Fix --help.
3905
432ac57a
AD
39062008-11-09 Akim Demaille <demaille@gostai.com>
3907
3908 Require the generation of parse-gram.output.
3909 * src/Makefile.am (YACC): Pass --report=all.
3910
deef2a0a
AD
39112008-11-09 Akim Demaille <demaille@gostai.com>
3912
3913 Formatting changes.
3914
df72984a
AD
39152008-11-09 Akim Demaille <demaille@gostai.com>
3916
3917 Update TODO.
3918 * TODO: Remove obsolete items.
3919 Update others.
3920
f10e19fd
AD
39212008-11-09 Akim Demaille <demaille@gostai.com>
3922
3923 Enhance bench.pl.
3924 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
3925 (@token, $grammar, $bench): New.
3926 (generate_grammar_variant): Rename as...
3927 (generate_grammar_list): this.
3928 (generate_grammar): Adjust.
3929 (bench_grammar): Rename as...
3930 (bench): this.
3931 Use it in the various bench-marking routines.
3932 (-b, -g): New options.
3933
5de9c593
AD
39342008-11-09 Akim Demaille <demaille@gostai.com>
3935
3936 Use a static hierarchy for symbols in the C++ parser.
3937 * data/lalr1.cc (symbol_base_type, symbol_type)
3938 (stack_symbol_type): Make it a static hierarchy.
3939 Adjust dependencies.
3940
757f8f98
AD
39412008-11-09 Akim Demaille <demaille@gostai.com>
3942
3943 bench.pl -d, --directive.
3944 * etc/bench.pl.in (@directive): New.
3945 (&bench_grammar): Use it.
3946 (&bench_list_grammar): New, to provide access to the "variant"
3947 grammar.
3948 Use it.
3949 (getopts): Support -d, --directive.
3950
d3be4f6d
AD
39512008-11-09 Akim Demaille <demaille@gostai.com>
3952
3953 Use inline for small operations.
3954 * data/lalr1.cc (symbol_base_type, symbol_type)
3955 (stack_symbol_type): Declare constructor and other operations as
3956 inline.
3957 (yy_destroy_): Inline.
3958
1f7d007b
AD
39592008-11-09 Akim Demaille <demaille@gostai.com>
3960
3961 Introduce a hierarchy for symbols.
3962 * data/lalr1.cc (symbol_base_type, symbol_type): New.
3963 (data_type): Rename as...
3964 (stack_symbol_type): this.
3965 Derive from symbol_base_type.
3966 (yy_symbol_value_print_): Merge into...
3967 (yy_symbol_print_): this.
3968 Rename as...
3969 (yy_print_): this.
3970 (yydestruct_): Rename as...
3971 (yy_destroy_): this.
3972 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
3973 (parser::parse): yyla is now of symbol_type.
3974 Use its type member instead of yytoken.
3975
bc0b0477
AD
39762008-11-09 Akim Demaille <demaille@gostai.com>
3977
3978 Rename data_type and stack_symbol_type.
3979 * data/lalr1.cc (data_type): Rename as...
3980 (stack_symbol_type): this.
3981
57295d14
AD
39822008-11-09 Akim Demaille <demaille@gostai.com>
3983
3984 Handle semantic value and location together.
3985 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
3986 yydata.value and yydata.location.
3987 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
3988 (YY_SYMBOL_PRINT): Now take semantic value and location as a
3989 single arg.
3990 Adjust all callers.
3991 (yydestruct_): New overload for a stack symbol.
3992
e9b0834e
AD
39932008-11-09 Akim Demaille <demaille@gostai.com>
3994
3995 Push a complete symbol, not connected parts.
3996 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
3997 state, value and location.
3998 Adjust callers.
3999
6082531a
AD
40002008-11-09 Akim Demaille <demaille@gostai.com>
4001
4002 Agregate yylval and yylloc.
4003 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
4004 (parser::yyla): this.
4005
33c195cc
AD
40062008-11-09 Akim Demaille <demaille@gostai.com>
4007
4008 Rely on the state stack to display reduction traces.
b06df3c2
AD
4009 To display rhs symbols before a reduction, we used information
4010 about the rule reduced, which required the tables yyrhs and
4011 yyprhs. Now use rely only on the state stack to get the same
4012 information.
de62edee 4013
33c195cc
AD
4014 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
4015 Use them.
4016 (parser::yyrhs_, parser::yyprhs_): Remove.
4017 (parser::yy_reduce_print_): Use the state stack.
4018
e1f93869
AD
40192008-11-09 Akim Demaille <demaille@gostai.com>
4020
4021 Fuse yyval and yyloc into yylhs.
4022 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
4023 yylhs.
4024 (parse): Replace yyval and yyloc with yylhs.value and
4025 yylhs.location.
4026 After a user action, compute yylhs.state earlier.
4027 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
4028 fresh error_token.
4029
2935744b
DJ
40302008-11-09 Di-an Jan <dianj@freeshell.org>
4031
4032 Remove unused variable.
4033 * src/output.c (type_names_output): Remove unused variable sep.
4034
bbf9ca37
PB
40352008-11-09 Paolo Bonzini <bonzini@gnu.org>
4036
4037 Change tests/output.at quoting.
4038 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
4039 expanding arguments.
4040
d9a9b96b
JD
40412008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4042
4043 Don't add a semicolon to actions for %skeleton or %language.
4044 It breaks Java test cases as reported by Akim Demaille.
4045 * src/scan-code.l: Implement.
4046
51365192
JD
40472008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4048
4049 Clean up %skeleton and %language priority implementation.
4050 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
4051 remove static qualifier because others will soon need to see it.
4052 (language_prio): Likewise.
4053 (getargs): Use command_line_prio rather than 0.
4054 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
4055 enum fields.
4056 (skeleton_prio): Extern it.
4057 (language_prio): Extern it.
4058 * src/parse-gram.y: Use grammar_prio rather than 1.
4059
9380cfd0
AD
40602008-11-07 Akim Demaille <demaille@gostai.com>
4061
4062 Moving push traces into yypush_.
4063 * data/lalr1.cc (yypush_): Now takes a optional trace message.
4064 Adjust all uses.
4065
8901f32e
AD
40662008-11-07 Akim Demaille <demaille@gostai.com>
4067
4068 The single-stack C++ parser is now the standard one.
4069 * data/lalr1.cc: Rename as...
4070 * data/lalr1-split.cc: this.
4071 * data/lalr1-fusion.cc: Rename as...
4072 * data/lalr1.cc: this.
4073 * etc/bench.pl.in: Adjust.
4074
8cdabf02
AD
40752008-11-07 Akim Demaille <demaille@gostai.com>
4076
4077 Avoid empty-if warnings.
4078 Reported by Quentin Hocquet.
de62edee 4079
8cdabf02
AD
4080 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
4081 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
4082
5a893c2b
AD
40832008-11-07 Akim Demaille <demaille@gostai.com>
4084
4085 Pass command line location to skeleton_arg and language_argmatch.
4086 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
4087 The location argument is now mandatory.
4088 Adjust all dependencies.
4089 (getargs): Use command_line_location.
4090
58697c6d
AD
40912008-11-07 Akim Demaille <demaille@gostai.com>
4092
4093 -D, --define.
4094 * src/getargs.c (usage): Document -D.
4095 Fix help string for --locations.
4096 (command_line_location): New.
4097 (short_options, long_options, getargs): Support -D, --define.
4098 (getargs): Move -d support at the right place.
4099 * doc/bison.texinfo (Bison Options): Update.
4100 * tests/input.at (%define, --define): New.
4101
9fe5a457
AD
41022008-11-07 Akim Demaille <demaille@gostai.com>
4103
4104 Initialize the muscle table before parsing the command line.
4105 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
4106 (getargs): Define file_name.
4107 * src/main.c (main): Initialize muscle_tab before calling
4108 getargs.
4109 * src/muscle_tab.c (muscle_init): No longer define file_name, as
4110 its value is not available yet.
4111
56c5eca9
AD
41122008-11-07 Akim Demaille <demaille@gostai.com>
4113
4114 Locations without columns for command line arguments.
4115 * src/location.c (location_print): Don't display negative columns.
4116 * src/location.h: Document this.
4117
9b9e0a7d
AD
41182008-11-07 Akim Demaille <demaille@gostai.com>
4119
4120 Fix --help.
4121 * src/getargs.c (usage): Fix help string for -W.
4122
74eae918
AD
41232008-11-07 Akim Demaille <demaille@gostai.com>
4124
4125 Handle more general types of option arguments.
4126 * build-aux/cross-options.pl: The argument ends at the first
4127 space, not the first non-symbol character.
4128 Use @var for each word appearing the argument description.
4129
a3d4c6fb
AD
41302008-11-07 Akim Demaille <demaille@gostai.com>
4131
4132 Destroy the variants that remain on the stack in case of error.
4133 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
4134 destructor.
4135 Display the value only if yymsg is nonnull.
4136 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
4137
2d32fc9f
AD
41382008-11-07 Akim Demaille <demaille@gostai.com>
4139
4140 Add "%define assert" to variants.
4141 This is used to help the user catch cases where some value gets
4142 ovewritten by a new one. This should not happen, as this will
4143 probably leak.
de62edee 4144
2d32fc9f
AD
4145 Unfortunately this uncovered a bug in the C++ parser itself: the
4146 lookahead value was not destroyed between two calls to yylex. For
4147 instance if the previous lookahead was a std::string, and then an int,
4148 then the value of the std::string was correctly taken (i.e., the
4149 lookahead was now an empty string), but std::string structure itself
4150 was not reclaimed.
de62edee 4151
2d32fc9f
AD
4152 This is now done in variant::build(other&) (which is used to take the
4153 value of the lookahead): other is not only stolen from its value, it
4154 is also destroyed. This incurs a new performance penalty of a few
4155 percent, and union becomes faster again.
de62edee 4156
2d32fc9f
AD
4157 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
4158 (b4_variant_if): New.
4159 (variant::built): New.
4160 Use it whereever the status of the variant changes.
4161 * etc/bench.pl.in: Check the penalty of %define assert.
4162
f6038cb8
AD
41632008-11-07 Akim Demaille <demaille@gostai.com>
4164
4165 Use "%define variant" in bench.pl.
4166 * etc/bench.pl.in: No longer use the pseudo directive %variants,
4167 just use %define variants.
4168
ccde1f98
AD
41692008-11-07 Akim Demaille <demaille@gostai.com>
4170
4171 Regen.
4172 * src/parse-gram.h, src/parse-gram.c: Regen.
4173
58bd33b7
JD
41742008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
4175
4176 Fix user actions without a trailing semicolon.
4177 Reported by Sergei Steshenko at
4178 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
4179 * THANKS (Sergei Steshenko): Add.
4180 * src/scan-code.l (SC_RULE_ACTION): Fix it.
4181 * tests/regression.at (Fix user actions without a trailing semicolon):
4182 New test case.
4183
639867b5
AD
41842008-11-04 Akim Demaille <demaille@gostai.com>
4185
4186 Use b4_copyright_years.
4187 * data/yacc.c (b4_copyright_years): New.
4188 Fix its value according to the comments in the file.
4189 Use it and undefine it.
4190
3c262606
AD
41912008-11-04 Akim Demaille <demaille@gostai.com>
4192
4193 Formatting changes.
4194 * data/lalr1-fusion.cc, src/parse-gram.y: here.
4195
a2b93d52
AD
41962008-11-04 Akim Demaille <demaille@gostai.com>
4197
4198 Formatting changes.
4199 * data/lalr1-fusion.cc: here.
4200
3a2803df
AD
42012008-11-04 Akim Demaille <demaille@gostai.com>
4202
4203 Use strict on bench.pl.
4204 * etc/bench.pl.in (&run, &generate_grammar): New.
4205 Rename the grammar generating functions for consistency.
4206 Change the interface so that the list of benches to run is passed
4207 as (optionless) arguments.
4208 (&compile): Use &run.
4209
a0d4650a
AD
42102008-11-04 Akim Demaille <demaille@gostai.com>
4211
4212 Remove spurious initial empty lines.
4213 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
4214 * data/yacc.c: End the @output lines with an @.
4215
cac9e09b
AD
42162008-11-04 Akim Demaille <demaille@gostai.com>
4217
4218 Improve the display of sizes.
4219 * etc/bench.p.in: Higher precision.
4220 Sort by decreasing size.
4221
4af4348a
AD
42222008-11-04 Akim Demaille <demaille@gostai.com>
4223
4224 Don't memcpy C++ structures.
4225 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
4226 arguments.
4227 (variant::build): New overload for
4228 copy-construction-that-destroys.
4229 (variant::swap): New.
4230 (parser::yypush_): Use it in variant mode.
4231
ef05c4d6
AD
42322008-11-04 Akim Demaille <demaille@gostai.com>
4233
4234 Better defaults for bench.pl.
4235 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
4236 default values.
4237 Adjust &verbose uses.
4238 (-q, --quiet): New.
4239
9718cfa9
AD
42402008-11-04 Akim Demaille <demaille@gostai.com>
4241
4242 Make variant.yy more complex.
4243 std::list cannot be copied via memcpy, they are more demanding than
4244 std::string. Use one std::list to strengthen the test.
de62edee 4245
9718cfa9
AD
4246 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
4247 Adjust.
4248 Create a list of strings, instead of a single large string.
4249
a6df593d
AD
42502008-11-04 Akim Demaille <demaille@gostai.com>
4251
4252 bench.pl --bench.
4253 * etc/bench.pl.in (--bench, $bench): New.
4254
006a0303
AD
42552008-11-04 Akim Demaille <demaille@gostai.com>
4256
4257 Sort methods.
4258 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
4259 Define it after as().
4260
faef3466
AD
42612008-11-04 Akim Demaille <demaille@gostai.com>
4262
4263 Useless parens.
4264 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
4265
2141aded
AD
42662008-11-04 Akim Demaille <demaille@gostai.com>
4267
4268 Issue missing synclines after user actions.
4269 * data/c.m4 (b4_case): Issue synclines on the output file.
4270
e426d17b
AD
42712008-11-04 Akim Demaille <demaille@gostai.com>
4272
4273 Remove trailing empty line.
4274 * data/lalr1-fusion.cc: Don't add an empty line after the user's
4275 epilogue.
4276
a9ce3f54
AD
42772008-11-04 Akim Demaille <demaille@gostai.com>
4278
4279 Fix output of copyright years.
4280 * data/bison.m4 (b4_copyright): Fix the indentation of the
4281 copyright year paragraph.
4282 Use b4_copyright_years when no years are given.
4283 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
4284 (b4_copyright_years): New.
4285 Use it.
4286
59c544c2
AD
42872008-11-04 Akim Demaille <demaille@gostai.com>
4288
4289 Avoid the spurious initial empty line.
4290 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
4291 the end of @output request to suppress the empty line that
4292 results.
4293
96b15448
AD
42942008-11-04 Akim Demaille <demaille@gostai.com>
4295
4296 Remove parser::rhs_number_type.
4297 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
4298 (yyrhs_): Use b4_table_define.
4299
f0633174
AD
43002008-11-04 Akim Demaille <demaille@gostai.com>
4301
4302 Fix iteration type.
4303 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
4304
417b8004
AD
43052008-11-04 Akim Demaille <demaille@gostai.com>
4306
4307 Factor the declaration of the integer tables.
4308 * data/lalr1-fusion.cc (b4_table_define): New.
4309 Use it.
4310
1a5246c6
AD
43112008-11-03 Akim Demaille <demaille@gostai.com>
4312
4313 Fix indentation of tables in lalr1.cc
4314 * data/lalr1-fusion.cc: Fix the indentation.
4315
f8a95c9c
AD
43162008-11-03 Akim Demaille <demaille@gostai.com>
4317
4318 Destroy the lhs symbols after reduction.
4319 * data/lalr1-fusion.cc (parse): After the user action, when in
4320 variant mode, destroy the lhs symbols.
4321
d7f4d823
AD
43222008-11-03 Akim Demaille <demaille@gostai.com>
4323
4324 Simplify yysyntax_error_ use.
4325 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
4326 type, but make it unnamed in the declaration when it is not used.
4327
8b9c89fb
AD
43282008-11-03 Akim Demaille <demaille@gostai.com>
4329
4330 Let yy::variant::build return an lvalue.
4331 * data/lalr1-fusion.cc (variant::build): Return a reference to the
4332 object.
4333
83243c24
AD
43342008-11-03 Akim Demaille <demaille@gostai.com>
4335
4336 Define yy::variant only when needed.
4337 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
4338 used.
4339
429b4848
AD
43402008-11-03 Akim Demaille <demaille@gostai.com>
4341
4342 Bench the three-stack lalr1.cc.
4343 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
4344 one-stack one.
4345
414c76a4
AD
43462008-11-03 Akim Demaille <demaille@gostai.com>
4347
4348 Fail on parse error in calc++.
4349 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
4350 status.
4351 * examples/calc++/test ($me, $number, $exit, run): New.
4352 Use them to propagate errors to the exit status.
4353
8a5783fd
AD
43542008-11-03 Akim Demaille <demaille@gostai.com>
4355
4356 Don't specify the skeleton twice in the example.
4357 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
4358 file does what is needed.
4359
0cc5bead
AD
43602008-11-03 Akim Demaille <demaille@gostai.com>
4361
4362 bench: Improve output.
4363 * etc/bench.pl.in (bench_grammar): Tune the printf format.
4364
5b421a4e
AD
43652008-11-03 Akim Demaille <demaille@gostai.com>
4366
4367 bench: check impact of %debug on variants.
4368 * etc/bench.pl.in (variant_grammar): Fix the computation of
4369 $variant.
4370 Generate a grammar file that can work with or without %debug.
4371 Do use the @directive.
4372 (bench_variant_parser): Check impact of %debug.
4373 (@directives): Rename all the occurrences to...
4374 (@directive): this, for consistency.
4375
d11ee647
AD
43762008-11-03 Akim Demaille <demaille@gostai.com>
4377
4378 bench: report the size too.
4379 * etc/bench.pl.in ($iterations): Defaults to -3.
4380 (&bench_grammar): Require hireswallclock.
4381 Compute and display the size of the result.
4382 More comments.
4383
e1b74b92
AD
43842008-11-03 Akim Demaille <demaille@gostai.com>
4385
4386 bench: More use of the verbosity level.
4387 * etc/bench.pl.in ($verbose, &verbose): New.
4388 Use them.
4389 More POD documentation.
4390
7e5f9c54
AD
43912008-11-03 Akim Demaille <demaille@gostai.com>
4392
4393 bench.pl: a command line interface
4394 * etc/bench.pl.in: More doc.
4395 Some fixes in the documentation.
4396 ($cflags, $iterations, &help, &getopt): New.
4397 Use them.
4398 (&variant_grammar): Let the number of stages be 10 times what is
4399 specified.
4400
7109a18d
AD
44012008-11-03 Akim Demaille <demaille@gostai.com>
4402
4403 Bench the use of Boost.Variants.
4404 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
4405 New.
4406 (&compile): Be ready to compile C++ parsers.
4407 (&bench_push_parser): Move debug information to the outermost
4408 level.
4409 * THANKS: Add Michiel De Wilde.
4410
922730fe
AD
44112008-11-03 Akim Demaille <demaille@gostai.com>
4412
4413 bench.pl: Pass directives as a list instead of as a string.
4414 * etc/bench.pl.in (&directives): New.
4415 (&triangular_grammar, &calc_grammar): Use it to format the Bison
4416 directives.
4417 (&triangular_grammar): Do use the directives (were ignored).
4418 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
4419 directives.
4420
7484f1d4
AD
44212008-11-03 Akim Demaille <demaille@gostai.com>
4422
4423 Improve genericity of bench.pl.
4424 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
4425 argument.
4426 (&bench_push_parser): New.
4427 Call it.
4428
15129f25
AD
44292008-11-03 Akim Demaille <demaille@gostai.com>
4430
4431 Add documentation to bench.pl.
4432 * etc/bench.pl.in: Comment changes.
4433
0e0ed236
AD
44342008-11-03 Akim Demaille <demaille@gostai.com>
4435
4436 Fuse the three stacks into a single one.
de62edee 4437
b06df3c2
AD
4438 In order to make it easy to perform benchmarks to ensure that
4439 there are no performance loss, lalr1.cc is forked into
4440 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
4441 lalr1.cc.
4442
4443 Meanwhile, to make sure that lalr1-fusion.cc is correctly
4444 exercized by the test suite, the user must install a symbolic link
4445 from lalr1.cc to it.
de62edee 4446
b06df3c2
AD
4447 Instead of having three stacks (state, value, location), use a
4448 stack of triples. This considerably simplifies the code (and it
4449 will be easier not to require locations as currently does the C++
4450 parser), and also gives a 10% speedup according to
4451 etc/bench (probably mainly since memory allocation is done once
4452 instead of three times).
de62edee 4453
0e0ed236
AD
4454 Another motivation is to make it easier to destruct properly
4455 semantic values: now that they are bound to their state (hence
4456 symbol type) it will be easier to call the appropriate destructor.
de62edee 4457
0e0ed236 4458 These changes should probably benefit the C parser too.
de62edee 4459
b06df3c2
AD
4460 * data/lalr1.cc: Copy as...
4461 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
4462 (b4_rhs_value, b4_rhs_location): New definitions overriding those
4463 from c++.m4.
4464 (state_stack_type, semantic_stack_type, location_stack_type)
4465 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
4466 (data_type, stack_type, yystack_): New.
4467 (YYLLOC_DEFAULT, yypush_): Adjust.
4468 (yyerror_range): Now based on data_type, not location_type.
4469
7dedf26e
AD
44702008-11-03 Akim Demaille <demaille@gostai.com>
4471
4472 Push the state, value, and location at the same time.
4473 This is needed to prepare a forthcoming patch that fuses the three
4474 stacks into one.
de62edee 4475
7dedf26e
AD
4476 * data/lalr1.cc (parser::yypush_): New.
4477 (parser::yynewstate): Change the semantics: instead of arriving to
4478 this label when value and location have been pushed, but yystate
4479 is to be pushed on the state stack, now the three of them must
4480 have been pushed before. yystate still must be the new state.
4481 This allows to use yypush_ everywhere instead of individual
4482 handling of the stacks.
4483
c4585f1e
AD
44842008-11-03 Akim Demaille <demaille@gostai.com>
4485
4486 Prefer references to pointers.
4487 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
4488 definition to use references instead of pointers.
4489 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
4490 Take the value and location as references.
4491 Adjust callers.
4492
56017c17
AD
44932008-11-03 Akim Demaille <demaille@gostai.com>
4494
4495 stack::size instead of stack::height.
4496 * data/lalr1.cc (stack::height): Rename as...
4497 (stack::size): this.
4498 Fix the output type.
4499 Comment changes.
4500
5ab8c47b
AD
45012008-11-03 Akim Demaille <demaille@gostai.com>
4502
4503 Use variants to support objects as semantic values.
b06df3c2
AD
4504 This patch was inspired by work by Michiel De Wilde. But he used
4505 Boost variants which (i) requires Boost on the user side, (ii) is
4506 slow, and (iii) has useless overhead (the parser knows the type of
4507 the semantic value there is no reason to duplicate this
4508 information as Boost.Variants do).
4509
4510 This implementation reserves a buffer large enough to store the
4511 largest objects. yy::variant implements this buffer. It was
4512 implemented with Quentin Hocquet.
de62edee 4513
5ab8c47b
AD
4514 * src/output.c (type_names_output): New.
4515 (output_skeleton): Invoke it.
4516 * data/c++.m4 (b4_variant_if): New.
4517 (b4_symbol_value): If needed, provide a definition for variants.
4518 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
4519 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
4520 (b4_char_sizeof, yy::variant): New.
4521 (parser::parse): If variants are requested, define
4522 parser::union_type, parser::variant, change the definition of
4523 semantic_type, construct $$ before running the user action instead
4524 of performing a default $$ = $1.
4525 * examples/variant.yy: New.
4526 Based on an example by Michiel De Wilde.
4527
1fa5d8bb
AD
45282008-11-03 Akim Demaille <demaille@gostai.com>
4529
4530 Parameterize the extraction of semantic values.
4531 To make future changes easier, no longer rely on ".TYPE" being the
4532 way to get a semantic value.
de62edee 4533
1fa5d8bb
AD
4534 * data/c.m4 (b4_symbol_value): New.
4535 Use it.
4536 * data/c++.m4, data/yacc.c: Use it.
4537 * data/glr.c: Use b4_symbol_value.
4538 (b4_rhs_data): New.
4539 Use it.
4540
91ba8a55
AD
45412008-11-03 Akim Demaille <demaille@gostai.com>
4542
4543 Prepare easier M4 changes.
4544 * data/lalr1.cc: Use escaped [] instead of literals to prepare
4545 future changes.
4546
c9ba9e59
JD
45472008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4548
4549 Initiate further development.
4550 * NEWS: Create an empty section for new entries.
4551 * gnulib: Update submodule to HEAD.
4552
bfb40910
JD
45532008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4554
4555 * NEWS: Version 2.4.
4556
241fda7a
JD
45572008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4558
4559 Prepare for next release.
4560 * NEWS: Briefly mention changes since 2.3b.
4561 * README: Say GNU m4 1.4.6, which we've been requiring in release
4562 announcements already, not 1.4.3, which breaks the build.
4563
ed4d67dc
JD
45642008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4565
4566 Say %language is experimental.
4567 We're thinking of extending it's effect on output file naming. See the
4568 thread at
4569 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
4570 * NEWS: Say it's experimental.
4571 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
4572 recommend it over %skeleton for now.
4573 (Bison Options): Likewise.
4574 (C++ Bison Interface): Use %skeleton not %language.
4575 (Calc++ Parser): Use %skeleton not %language.
4576 * src/getargs.c (usage): Say it's experimental.
4577
e254a580
DJ
45782008-11-01 Di-an Jan <dianj@freeshell.org>
4579 Paolo Bonzini <bonzini@gnu.org>
4580
4581 Support all Java parser class modifiers.
4582 * data/java.m4 (b4_percent_define_get3): New.
4583 (b4_final_if, b4_strictfp_if): New.
4584 * data/lalr1.java (final, strictfp, extends, implements): Support.
4585 * doc/bison.texinfo (final, strictfp, extends, implements): Add
4586 documentation.
4587 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
4588 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
4589 (AT_CHECK_JAVA_GREP): New.
4590 (Java parser class modifiers): New test.
4591 (Java parser class extends and implements): New test.
4592
4593 Model exception propagation better with throws and lex_throws.
4594 * data/java.m4 (b4_list2): New.
4595 (throws): Change default.
4596 * data/lalr1.java (yyaction): Add throws.
4597 (parse): Add lex_throws in addition to throws.
4598 * doc/bison.texinfo (throws, lex_throws): Add documentation.
4599 * tests/java.at (Java throws specifications): New test.
4600
4601 Improve documentation for Java parsers.
4602 * doc/bison.texinfo (Java Parsers): Add subsections.
4603 Don't quote first argument of %define.
4604 (Java Bison Interface): Document output files. Move documentation
4605 of parser class and merge into Java Parser Interface. Document
4606 features that error out. Document directives with no effect.
4607 Move note about Javadoc higher.
4608 (Java Semantic Values): Explicitly mention stype.
4609 Document that generic types cannot be used.
4610 (Java Location Values): Use @deftypeivar. Document constructors.
4611 Correct return value for toString.
4612 (Java Parser Interface): List undocumented constants/fields.
4613 Move documentation of fields added by %parse-param closer to list
4614 of members. Document that token names are added as fields.
4615 Document constructors accurately. Remove error method.
4616 (Java Scanner Interface): Move note on %pure-parser to Java Bison
4617 Interface. Describe %code lexer and yylex accutately.
4618 Remove documentation that does not match the code.
4619 (Java Action Features): New.
4620 (Java Differences): Add reference. Add item on semantic values.
4621 Add note about @{ ... @}. Clarify %% epilogue placement.
4622 (Java Declarations Summary): New.
4623
4624 Fix Java skeleton.
4625 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
4626 (b4_remove_comma): Quote test argument.
4627 (b4_identification): Remove "bison" field.
4628 * tests/java.at (Java parser class and package names): New test.
4629 (Java %parse-param and %lex-param): New test.
4630 (Java stype, position_class and location_class): New test.
4631
f259e4e6
PB
46322008-10-31 Di-an Jan <dianj@freeshell.org>
4633
4634 * data/lalr1.jave: Update copyright years.
4635 (YYParser): Correct name of "generated from" file in Javadoc:
4636 use b4_file_name instead of @ofile@.
4637 (Location constructor): Correct Javadoc parameter name.
4638 (yylloc): Add missing opening m4 quote after b4_location_if.
4639 This removes a stray [ in the Javadoc of Lexer.getStartPos.
4640 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
4641 (YYParser constructor): Correct Javadoc parameter name.
4642
cae5057f
JD
46432008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
4644
4645 Always put auxiliary code files in the same dir as other output files.
4646 * src/files.c (compute_file_name_parts): When the user specifies
4647 --output but not --file-prefix, extract the directory prefix from the
4648 file prefix not from the grammar file name. This affects the location
4649 of files like location.hh generated by the C++ skeleton. The includes
4650 in the other output files require this fix.
4651 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
4652 for expected output files.
4653 (Output files): Add a test for the above.
4654
4af432ba
JD
46552008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
4656
4657 * gnulib: Update submodule to HEAD.
4658
e26d4e43
JD
46592008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4660
4661 Update copyright year.
4662 * src/files.c: Here.
4663
c0ee9e21
DJ
46642008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
4665
4666 Don't overwrite the input file.
4667 * src/files.c (output_file_name_check): Fatal error if using input file
4668 for output.
4669 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
4670 argument.
4671 (Conflicting output files): Add test.
4672
482dc52f
AD
46732008-10-28 Akim Demaille <demaille@gostai.com>
4674
4675 Space changes.
4676 * data/lalr1.cc: Formatting changes.
4677
52cbbe84
AD
46782008-10-28 Akim Demaille <demaille@gostai.com>
4679
4680 Don't define debugging functions when !YYDEBUG.
4681 * data/lalr1.cc (debug_stream, set_debug_stream)
4682 (debug_level_type, debug_level, set_debug_level): Don't
4683 declare them when YYDEBUG is not defined.
4684 The implementation are already YYDEBUG-aware.
4685
0925d5bf
AD
46862008-10-28 Akim Demaille <demaille@gostai.com>
4687
4688 Prefer "continue" for empty loop bodies.
4689 * etc/bench.pl.in: Use "continue" instead of {}.
4690
cf98343c
AD
46912008-10-28 Akim Demaille <demaille@gostai.com>
4692
4693 Space and comments changes.
4694 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
4695 * data/c.m4, data/lalr1.cc: Space changes.
4696
9f467b7d
AD
46972008-10-28 Akim Demaille <demaille@gostai.com>
4698
4699 Make gnulib a submodule.
4700 * gnulib: New.
4701 * .gitmodules (gnulib): New.
4702
0f0e1ace
JD
47032008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4704
4705 Fix yyerror_range for user-defined location type in C++. Reported by
4706 Georg Sauthoff at
4707 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
4708 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
4709 * THANKS (Georg Sauthoff): Add.
4710
548e2104
JD
47112008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4712
4713 Update several administrative files mainly to facilitate releasing.
4714 * HACKING (Administrivia): Make the git-merge-changelog notes more
4715 helpful.
4716 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
4717 (Release Procedure): Update for git and add numerous details that were
4718 previously missing.
4719 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
4720 * maint.mk (announcement): Don't list bison as a bootstrap tool so
4721 that announcements don't claim we bootstrapped with whatever bison
4722 happened to be in PATH. Add flex as a bootstrap tool.
4723 * Makefile.maint: Remove, previously replaced by maint.mk.
4724 * Makefile.cfg: Remove, and migrate settings to...
4725 * cfg.mk: ... here for the sake of `make announcement'.
4726 * bootstrap.conf (gnulib_modules): Add announce-gen.
4727 * README: Say GNU Bison instead of just Bison. Suggested by Karl
4728 Berry.
4729
ddf17a6e
PB
47302008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
4731
4732 Small but important bugfixes for the Java skeleton.
4733 * data/lalr1.java (yyerror): Change Location to b4_location_type.
4734 (yy_symbol_print): Call toString on yyvaluep.
4735
e1145ad8
AD
47362008-08-29 Akim Demaille <demaille@gostai.com>
4737
4738 Clarify UPDATED use.
215b40ac 4739 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 4740 not to the release date of Bison.
215b40ac 4741 Reported by Joel E. Denny.
e1145ad8 4742
0df72d78
AD
47432008-08-29 Akim Demaille <demaille@gostai.com>
4744
4745 * README: Update FAQ pointer.
4746 Reported by Joel E. Denny.
4747
9a90b6bb
EB
47482008-08-27 Eric Blake <ebb9@byu.net>
4749
4750 Resync m4sugar from autoconf.
4751 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
4752 (m4_init): Adjust to latest m4.git changes.
4753 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
4754 effects.
4755 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
4756 (_m4_list_cmp): Reduce side effects.
4757
65015668
AD
47582008-08-27 Akim Demaille <demaille@gostai.com>
4759
4760 Check yyerrok in calc.at.
215b40ac
EB
4761 * tests/calc.at (calc.y): Use yyerrok on "( error )".
4762 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
4763 expected.
65015668 4764
98e26a92
AD
47652008-08-27 Akim Demaille <demaille@gostai.com>
4766
4767 Support yyerrok in lalr1.cc.
4768 YYBACKUP is still to import back into lalr1.cc.
215b40ac 4769 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 4770
86c0e784
JD
47712008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4772
4773 For maintainer-check*, don't recompile for a $(VERSION) update.
4774 * cfg.mk: New file.
4775 (_is-dist-target): Override the one in GNUmakefile.
4776 * Makefile.am (EXTRA_DIST): Add cfg.mk.
4777
88511166
JD
47782008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4779
4780 Update for recent change to gnulib.
4781 * src/parse-gram.y: Don't include strverscmp.h. It comes from
4782 string.h now.
4783
6bbb2ed5
EB
47842008-08-15 Eric Blake <ebb9@byu.net>
4785
d67c52e8
EB
4786 Remaining m4sugar merge from autoconf.
4787 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
4788 * data/m4sugar/foreach.m4: New file, copied from autoconf.
4789 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
4790 * src/output.c (output_skeleton): Tell m4 how to find it.
4791
6bbb2ed5
EB
4792 Partial m4sugar merge from autoconf: m4_map.
4793 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
4794 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
4795 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
4796 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
4797 for empty list.
4798 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
4799 Likewise.
4800 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
4801 declares it.
4802
8dce3875
JD
48032008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
4804
4805 Keep .version and PACKAGE_VERSION in sync.
4806 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
4807 dependency, and add comments justifying this in more detail. Discussed
4808 starting at
4809 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
4810
882a1fbf
EB
48112008-08-06 Eric Blake <ebb9@byu.net>
4812
a3764451
EB
4813 Partial m4sugar merge from autoconf: m4_shiftn.
4814 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
4815 (m4_shift2, m4_shift3): New macros.
4816 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
4817 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
4818 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
4819 * data/java.m4 (b4_remove_comma): Likewise.
4820
882a1fbf
EB
4821 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
4822 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
4823 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
4824 (m4_init): Consolidate wrapped text into single m4_wrap.
4825 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
4826 in wrapped text.
4827
a30e920d
EB
48282008-08-05 Eric Blake <ebb9@byu.net>
4829
dfcc5959
EB
4830 Partial m4sugar merge from autoconf: builtins, version.m4.
4831 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
4832 (m4_prepend): Remove, as it is unused and inherently quadratic,
4833 whereas m4_append is linear in newer m4.
4834 (m4_mkstemp): New builtin.
4835 (m4_symbols): Make rename conditional.
4836 (m4_version_prereq): Ensure fatal error if used in bison, which
4837 intentionally lacks version.m4.
4838
a30e920d
EB
4839 Fix comments in m4sugar.
4840 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
4841
445b7470
JD
48422008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4843
4844 Update for recent .gitignore fix in Gnulib.
4845 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
4846 anchored .gitignore entries.
4847
a1e50014
JD
48482008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4849
4850 Set gnu or gnits strictness.
4851 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
4852 development and gnits strictness for releases. Based on Eric Blake's
4853 suggestion at
4854 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
4855
d43f77e7
PB
48562008-07-31 Paolo Bonzini <bonzini@gnu.org>
4857
4858 * NEWS: Clarify documentation of %language.
4859
fee2ed87
PB
48602008-07-31 Paolo Bonzini <bonzini@gnu.org>
4861
4862 Support usage of git-merge-changelog.
4863 * .gitattributes: New.
4864 * HACKING: Document usage of git-merge-changelog.
4865 * bootstrap: Install git-merge-changelog entries in .git/config
4866 if appropriate.
4867
78029cd5
JD
48682008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4869
4870 Remove remaining dependence on CVS Id keyword.
4871 * ChangeLog: For the sake of people still using CVS, don't use dollars
4872 when mentioning Id.
4873 * data/xslt/bison.xsl: Remove Id from header comments, where it was
4874 unusual anyway.
4875 * data/xslt/xml2dot.xsl: Likewise.
4876 * data/xslt/xml2text.xsl: Likewise.
4877 * data/xslt/xml2xhtml.xsl: Likewise.
4878 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
4879 * doc/Makefile.am (neutralize): Remove, no longer needed.
4880 (.x.1): Don't use neutralize.
4881 (edit): Don't substitute for ID.
4882 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
4883
c53d18b1
JD
48842008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4885
4886 Fix dependence on computed configure variables.
4887 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
4888 $(top_srcdir)/configure.ac so that changes to computed variables, such
4889 as PACKAGE_VERSION, are seen.
4890 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
4891
5523ac79
JD
48922008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
4893
4894 Update copyright dates for recent changes.
4895 * Makefile.am: Here.
4896 * src/Makefile.am: Here.
4897 * src/reduce.c: Here.
4898 * tests/reduce.at: Here.
4899
8fa36911
JD
49002008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
4901
4902 Use git-version-gen for version names between releases.
4903 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
4904 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
4905 * .prev-version: New.
4906 * .version.in: Remove.
78029cd5 4907 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
4908 revision.
4909 * GNUmakefile: Remove, now copied from Gnulib.
4910 * Makefile.am: Add code suggested by comments in
4911 build-aux/git-version-gen.
4912 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
4913 .prev-version, and .version.
4914 * NEWS (2.3b+): Rename to...
4915 (?.?): ... this because we're dropping the "+" version naming scheme,
4916 but, in general, we still can't be sure of our next release name.
4917 * bootstrap: Add a quick hack to remove from .gitignore the
4918 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
4919 entry. This should really be fixed in gnulib instead.
4920 * bootstrap.conf (gnulib_modules): Add gnumakefile.
4921 * configure.ac (AC_INIT): Set version name by invoking
4922 build-aux/git-version-gen.
4923 (AC_CONFIG_FILES): Remove .version, now generated by
4924 build-aux/git-version-gen.
4925 * maint.mk: New, copied from coreutils.
4926 * doc/.cvsignore (bison.1): Add.
4927 * doc/.gitignore (/bison.1): Add.
4928 * doc/bison.1: Remove, generated.
4929 * src/.cvsignore (revision.c): Remove.
4930 * src/.gitignore (/revision.c): Remove.
4931 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
4932 (BUILT_SOURCES): Remove revision.c.
4933 (revision.c): Remove.
4934 * src/getargs.c (version): Don't print revision after the VERSION.
4935 * src/revision.h: Remove.
4936
bcf07cb7
JD
49372008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4938
4939 Fix untranslatable composition of sentences. Reported by Goran
4940 Uddeborg at
4941 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
4942 * THANKS (Goran Uddeborg): Add.
4943 * src/reduce.c (reduce_print): Report the number of nonterminals and
4944 rules useless in the grammar in separate sentences.
4945 * tests/reduce.at (Useless Rules): Update output.
4946 (Reduced Automaton): Likewise.
4947 (Underivable Rules): Likewise.
4948 (Empty Language): Likewise.
4949
9aacab9a
JD
49502008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4951
4952 Fix some .gitignore and .cvsignore problems.
4953 * bootstrap (insert_sorted_if_absent): Replace all uses with...
4954 (insert_vc_ignore): ... this new function, which prepends `/' to all
4955 .gitignore entries before passing them to insert_sorted_if_absent.
4956 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
4957 .cvsignore files are maintained even though Bison developers run
4958 bootstrap while using Git.
4959 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
4960 unneeded by Bison.
4961 (gnulib): Add.
4962 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
4963 unneeded. Reported by Eric Blake.
4964 * lib/.gitignore (/*~): Add.
4965 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
4966 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
4967 Blake.
4968 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
4969
a9fc7990
JD
49702008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4971
4972 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
4973 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
4974 * bootstrap.conf (gnulib_modules): Add unsetenv.
4975 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
4976 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
4977 (/setenv.m4): Add.
4978 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
4979 the first argument because it may become position-dependent, and unset
4980 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
4981 Add comments explaining these issues in more detail.
4982
0f1d6f10
JD
49832008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
4984
4985 Add .gitignore everywhere based on .cvsignore.
4986 * .gitignore: New.
4987 * build-aux/.gitignore: New.
4988 * data/.gitignore: New.
4989 * doc/.gitignore: New.
4990 * etc/.gitignore: New.
4991 * examples/.gitignore: New.
4992 * examples/calc++/.gitignore: New.
4993 * lib/.gitignore: New.
4994 * m4/.gitignore: New.
4995 * po/.gitignore: New.
4996 * runtime-po/.gitignore: New.
4997 * src/.gitignore: New.
4998 * tests/.gitignore: New.
4999
7bd1665a
JD
50002008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5001
5002 * NEWS (2.3b+): New section, empty for now.
5003 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
5004
72c5b982
JD
50052008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5006
5007 * NEWS (2.3b): Update release date since there has been a delay in
5008 getting the announcements and tarballs out.
5009
bd02cd5d
JD
50102008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5011
5012 * NEWS: Version 2.3b.
5013 * configure.ac (AC_INIT): Likewise.
5014 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
5015
9126263e
JD
50162008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5017
5018 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
5019 been doing it for years.
5020 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
5021 (Release Procedure): Add FIXME about make alpha being unmaintained.
5022
fa6aa7b3
JD
50232008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
5024
5025 * data/yacc.c: Reformat m4 a little for readability.
5026 * src/lalr.c (build_relations): Correct comment.
5027
d30b312d
JMG
50282008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5029
5030 DJGPP specific issue.
5031 * djgpp/config.sed: Fixes required to run configure scripts generated
5032 by autoconf 2.62.
5033
138d4cd9
JD
50342008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5035
5036 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
5037 coordinator@translationproject.org.
5038
8f7e2e1f
JD
50392008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5040
5041 * THANKS: Add Eric Blake.
5042
f55efa38
JD
50432008-04-23 Eric Blake <ebb9@byu.net>
5044
5045 Revert prior patch, by working around autoconf regression.
5046 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
5047 ("Output file name: ("): Uncomment test.
5048 ("Output file name: )"): Likewise.
5049 Based on an idea from Noah Misch.
5050
096c9f9d
JD
50512008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5052
5053 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
5054 2.61. Reported by Juan Manuel Guerrero at
5055 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
5056 * tests/output.at ("Output file name: ("): Comment out test case for
5057 now.
5058 ("Output file name: )"): Likewise.
5059
0f664b89
JD
50602008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5061
5062 * GNUmakefile: Update git-version-gen invocation so make dist
5063 succeeds.
5064
1cfe6375
JD
50652008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5066
5067 Update to the current gnulib CVS repository, and fix trigraph handling
5068 in Bison.
5069 * bootstrap: Update gnulib CVS repository URL.
5070 (symlink_to_dir): Encapsulate the code that guarantees the destination
5071 directory exists into...
5072 (check_dst_dir): ... this new function, and...
5073 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
5074 fail when copying files into lib/uniwidth/.
5075 * src/output.c (prepare_symbols): When writing yytname muscles, where
5076 symbol names will be encoded in C-string literals, tell quotearg to
5077 escape trigraphs. This used to be the default in gnulib.
5078 * tests/regression.at (Token definitions): Because of the change in
5079 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
5080 escapes trigraphs in symbol names. Thus, yytname no longer has
5081 trigraphs unnecessarily doubly escaped. Update test case output.
5082 Extend test case to be sure Bison's own error messages will no longer
5083 have trigraphs in symbol names unnecessarily escaped once.
5084
74c52fc8
JD
50852008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
5086
5087 Fix make dist infinite loop reported by Juan Manuel Guerrero at
5088 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
5089 * .cvsignore: Add .version.
5090 * .version.in: New.
5091 * bootstrap.conf (gnulib_modules): Add git-version-gen.
5092 * configure.ac (AC_CONFIG_FILES): Add .version.
5093 * build-aux/.cvsignore: Add git-version-gen.
5094
8e55b3aa
JD
50952008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5096
5097 * NEWS (2.3a+): Mention that -g now takes an argument.
5098 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
5099 consistency. Update the -g and -x entries now that they take
5100 arguments. Use brackets to indicate optional arguments.
5101 * src/getargs.c (usage): Explain the relationship between arguments of
5102 long and short options more completely. Document --defines and -d
5103 separately since the former takes an argument but, for POSIX Yacc, the
5104 latter does not.
5105 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 5106 (getargs): Sort cases.
8e55b3aa 5107
59c5ac72
AD
51082008-02-28 Akim Demaille <demaille@gostai.com>
5109
5110 * doc/bison.texinfo: Fix a few typos.
5111
118d4978
AD
51122008-02-28 Akim Demaille <akim@epita.fr>
5113
5114 * doc/bison.texinfo (Bison Options): Document -W.
5115 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
5116
7020f1e9
AD
51172008-02-28 Akim Demaille <akim@epita.fr>
5118
5119 * src/getargs.c (short_options): Split and sort for readability.
5120 -g and -x take optional arguments, just like their long options.
5121 * build-aux/cross-options.pl: Use /x to make the regexp easier to
5122 understand.
5123 Fix the handling of $opt which resulted in all the argument to be
5124 considered as optional.
5125
59da312b
JD
51262008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
5127
5128 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
5129 say its interface is experimental.
5130 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5131 Java.
5132 (Bison Options): In the -L and --language entry, mention Java.
5133 (Java Bison Interface): Say the interface is experimental.
5134 * src/getargs.c (usage): Mention -L and --language.
5135
5136 * NEWS (2.3a+): Say the push parsing interface is experimental.
5137 * doc/bison.texinfo (Push Decl): Likewise.
5138 (Decl Summary): Likewise in the "%define api.push_pull" entry.
5139 (Push Parser Function): Likewise.
5140 (Pull Parser Function): Likewise.
5141 (Parser Create Function): Likewise.
5142 (Parser Delete Function): Likewise.
5143 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
5144 yypull_parse, and yypush_parse entries.
5145
5146 * NEWS (2.3a+): Mention XML support, and say the schema is
5147 experimental.
5148 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
5149 * src/getargs.c (usage): Say the XML schema is experimental.
5150
5151 * NEWS (2.3a+): Say option instead of flag.
5152
2bb3ebec
WP
51532008-02-21 Wojciech Polak <polak@gnu.org>
5154
5155 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
5156 text.
5157
333e670c
JD
51582008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
5159
5160 Fix impure push parser compile error reported by Bob Rossi at
5161 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
5162 * data/yacc.c: Clean up whitespace in the output a little.
5163 (yypstate_allocated): Define for impure push parsers regardless of
5164 whether the pull interface is also requested.
5165 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
5166 check impure push parsers without the pull interface.
5167
5168 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
5169 yyerror takes arguments specified by %parse-param while yypstate_new
5170 does not.
5171 * doc/bison.texinfo (Parser Create Function): Document that
5172 yypstate_new returns 0 for multiple impure parser instances.
5173 * tests/push.at (Push Parsing: Multiple impure instances): Update
5174 expected stderr output.
5175
798096e1
JD
51762008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5177
5178 * runtime-po/POTFILES.in (push.c): Remove.
5179
9ca7f077
JD
51802008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5181
5182 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
5183 * data/push.c: Rename to...
5184 * data/yacc.c: ... this, overwriting it.
5185 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
5186 `%push-pull-parser' -> `%define api.push_pull "both"'.
5187 Remove old yacc.c tests, and update push.c tests to yacc.c.
5188
42ee26bb
JD
51892008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5190
5191 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
5192 `"%code top" blocks' instead of `%code "top" blocks'.
5193 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
5194 Clean up whitespace in the output a little.
5195
b1cc23c4
JD
51962008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5197
5198 Fix documentation problems reported by Tim Josling at
5199 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
5200 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
5201 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
5202 integers. Explain the effect of literal string aliases on error
5203 messages. Copy token 0 documentation from the C++ skeleton
5204 documentation.
5205
ab7f29f8
JD
52062008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5207
5208 Accept a token number in a %left, %right, or %nonassoc for POSIX
5209 conformance. Reported by Tim Josling at
5210 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
5211 * NEWS (2.3a+): Mention.
5212 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
5213 and code numbers are treated by precedence declarations.
5214 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
5215 of symbols.1.
5216 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
5217 of symbol.
5218 (symbol.prec): New, just like symbol but allows INT.
5219 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
5220 longer holds.
5221 * tests/regression.at (Token number in precedence declaration): New
5222 test case.
5223
a924ef36
JMG
52242008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5225
5226 DJGPP specific issues.
5227 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
5228 be changed. Copyright timestamp adjusted.
5229 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
5230 be changed. Copyright timestamp adjusted.
5231 * djgpp/config.site: Copyright timestamp adjusted.
5232 * djgpp/config_h.sed: Copyright timestamp adjusted.
5233 * djgpp/djunpack.bat: Copyright timestamp adjusted.
5234 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
5235 filename translation list.
5236 * djgpp/subpipe.c (init_subpipe): Check the environment variables
5237 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
5238 files shall be created. Before trying to use the temp dir where the
5239 environment variable points to check that the dir really exists. If
5240 not default to the cwd as temp dir. Copyright timestamp adjusted.
5241 * djgpp/subpipe.h: Copyright timestamp adjusted.
5242 * djgpp/testsuite.sed: Copyright timestamp adjusted.
5243
389c8cfd
PE
52442008-01-30 Paul Eggert <eggert@cs.ucla.edu>
5245
5246 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
5247
5d1cfef4
PE
52482008-01-09 Paul Eggert <eggert@cs.ucla.edu>
5249
5250 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
5251 Problem reported by Claudio Saavedra in
5252 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
5253
e2dcf996
WP
52542008-01-05 Wojciech Polak <polak@gnu.org>
5255
5256 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
5257 document's title with the input grammar file name.
5258
da730230
JD
52592007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
5260
5261 Automate regression testing of the XML/XSLT implementation. Discussed
5262 starting at
5263 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
5264 * configure.ac (XSLTPROC): New substitution.
5265 * Makefile.am (maintainer-xml-check): New phony target invoking...
5266 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
5267 invoking make maintainer-check with BISON_TEST_XML=1.
5268 * tests/atlocal.in (XSLTPROC): New.
5269 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
5270 not to report reachable memory when Bison is expected to have a
5271 non-zero exit status and (2) to compare XML/XSLT output with --graph
5272 and --report=all output for every working grammar when
5273 BISON_TEST_XML=1.
5274 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
5275 (AT_BISON_CHECK_XML): New.
5276 (AT_QUELL_VALGRIND): New.
5277 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
5278 (AT_CHECK): ... don't redefine this since this was the old way to
5279 quell Valgrind.
5280 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
5281 AT_BISON_CHECK invocations.
5282 * tests/c++.at: Likewise.
5283 * tests/calc.at: Likewise.
5284 * tests/conflicts.at: Likewise.
5285 * tests/cxx-type.at: Likewise.
5286 * tests/existing.at: Likewise.
5287 * tests/glr-regression.at: Likewise.
5288 * tests/headers.at: Likewise.
5289 * tests/input.at: Likewise.
5290 * tests/java.at: Likewise.
5291 * tests/output.at: Likewise.
5292 * tests/push.at: Likewise.
5293 * tests/reduce.at: Likewise.
5294 * tests/regression.at: Likewise.
5295 * tests/sets.at: Likewise.
5296 * tests/skeletons.at: Likewise.
5297 * tests/synclines.at: Likewise.
5298 * tests/torture.at: Likewise.
5299 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
5300 tends to hang xsltproc.
5301 (Big horizontal): Likewise.
5302
408476bc
JD
53032007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5304
5305 In XML output, remove redundant class attribute on symbol element.
5306 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
5307 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
5308 look up a symbol to determine whether it's a nonterminal or terminal.
5309 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
5310 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
5311
5312 Add prec/assoc information to XML output.
5313 * src/gram.c (grammar_rules_print_xml): For each rule that has a
5314 %prec, add a percent_prec attribute.
5315 * src/print-xml.c (print_grammar): For each terminal that has a
5316 precedence or associativity, add a prec or assoc attribute.
5317 (xml_indent): New.
5318 (xml_puts): Use xml_indent.
5319 (xml_printf): Use xml_indent.
5320 * src/print-xml.h (xml_indent): Prototype.
5321
5322 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
5323 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5324
d4a26c48
JD
53252007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5326
5327 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
5328 (bison:ruleByNumber): ... this for clarity.
5329 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
5330 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
5331 (xsl:template match="reduction"): Update.
5332 (xsl:template match="item"): Update.
5333 (xsl:template match="reduction"): Update.
5334
5335 In the XML output, don't print the list of rules where symbols appear.
5336 Compute it in XSLT instead. Discussed at
5337 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
5338 * data/xslt/bison.xsl (bison:ruleByLhs): New.
5339 (bison:ruleByRhs): New.
5340 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
5341 bison:ruleByRhs.
5342 (xsl:template match="terminal/rule"): Remove.
5343 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5344 bison:ruleByRhs.
5345 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5346 Remove.
5347 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
5348 bison:ruleByRhs and mode="number-link" for rule template.
5349 (xsl:template match="terminal/rule"): Remove.
5350 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5351 bison:ruleByRhs and mode="number-link" for rule template.
5352 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5353 Rewrite as...
5354 (xsl:template match="rule" mode="number-link"): ... this.
5355 * src/print-xml.c (print_grammar): Don't print the list of rules.
5356
ef1b4273
JD
53572007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5358
5359 Don't let --report affect XML output; always print all information.
5360 Discussed at
5361 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
5362 * src/conflicts.c (log_resolution): Implement.
5363 * src/print-xml.c (print_core): Implement.
5364 (print_state): Implement.
5365 (print_xml): Implement.
5366
5367 * NEWS (2.3a+): Fix quotes.
5368 * src/parse-gram.y (prologue_declaration): For consistency with -v,
5369 don't let %verbose clear the list specified by --report.
5370
0f6cd9e3
AD
53712007-11-26 Akim Demaille <akim@epita.fr>
5372
5373 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
5374
d80fb37a
JD
53752007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
5376
5377 In the XML output, list useless and unused symbols and rules with the
5378 useful ones and add a "usefulness" attribute. Discussed starting at
5379 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
5380 * src/gram.c (grammar_rules_partial_print_xml): Remove.
5381 (grammar_rules_print_xml): Print all rules instead of just those
5382 useful in the grammar, and add a "usefulness" attribute.
5383 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
5384 * src/print-xml.c (print_rules_useless_in_parser): Remove.
5385 (print_grammar): Print all nonterminals instead of just useful ones,
5386 and add a "usefulness" attribute to nonterminals and terminals.
5387 (print_xml): Don't print a separate "reductions" or
5388 "rules-useless-in-parser" element.
5389 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
5390 (reduce_xml): Remove.
5391 (reduce_token_unused_in_grammar): New.
5392 (reduce_nonterminal_useless_in_grammar): New.
5393 * src/reduce.h (reduce_xml): Remove prototype.
5394 (reduce_token_unused_in_grammar): Add prototype.
5395 (reduce_nonterminal_useless_in_grammar): Add prototype.
5396 * data/xslt/xml2text.xsl: Update for XML changes.
5397 * data/xslt/xml2xhtml.xsl: Update for XML changes.
5398 * tests/reduce.at (Useless Terminals): Update output.
5399 (Useless Rules): Update output.
5400 (Reduced Automaton): Update output.
5401
5402 Say "Terminals unused in grammar" instead of "Unused terminals".
5403 * NEWS (2.3a+): Update.
5404 * doc/bison.texinfo (Understanding): Update example output.
5405 * src/reduce.c (reduce_output): Implement.
5406 * data/xslt/xml2text.xsl: Implement.
5407 * data/xslt/xml2xhtml.xsl: Implement.
5408
1bb2bd75
JD
54092007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
5410
5411 Accept --report-file=FILE to override the default `.output' filename.
5412 * NEWS (2.3a+): Mention.
5413 * doc/bison.texinfo (Bison Options): Add an entry.
5414 * src/files.c (compute_output_file_names): Don't override
5415 spec_verbose_file if already set.
5416 * src/getargs.c (usage): Document --report-file.
5417 (REPORT_FILE_OPTION): New anonymous enum member.
5418 (long_options): Add entry for it.
5419 (getargs): Add case for it setting spec_verbose_file.
5420
5421 * build-aux/cross-options.pl: Don't record a short option just because
5422 there's an arg.
5423 * doc/.cvsignore: Add yacc.1.
5424
a005a9c4
AD
54252007-11-14 Akim Demaille <akim@epita.fr>
5426
5427 * doc/yacc.1.in: New.
5428 * configure.ac, doc/Makefile.am: Adjust.
5429 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
5430 config.h symbol.
5431 Use AC_SUBST for assignments too.
5432 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
5433
cff03fb2
JD
54342007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5435
5436 * src/gram.c: Remove comments that duplicate comments in gram.h.
5437
5438 When reporting useless rules and nonterminals, say "useless in grammar"
5439 instead of "useless", and say "useless in parser" instead of "never
5440 reduced". Discussed starting at
5441 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
5442 * NEWS (2.3a+): Mention this change.
5443 * data/xslt/xml2text.xsl: Update output text and expected input XML
5444 element names to match changes below.
5445 * data/xslt/xml2xhtml.xsl: Likewise.
5446 (xsl:template match="bison-xml-report"): Add missing entry in Table of
5447 Contents: "Rules useless in parser due to conflicts".
5448 * doc/bison.texinfo (Decl Summary): Reword a little.
5449 (Understanding): Update example output for changes below.
5450 * src/gram.c: (rule_useful_p): Rename to...
5451 (rule_useful_in_grammar_p): ... this.
5452 (rule_useless_p): Rename to...
5453 (rule_useless_in_grammar_p): ... this.
5454 (rule_never_reduced_p): Rename to...
5455 (rule_useless_in_parser_p): ... this.
5456 (grammar_rules_print): Update for renames.
5457 (grammar_rules_print_xml): Update for renames.
5458 (grammar_rules_never_reduced_report): Rename to...
5459 (grammar_rules_useless_report): ... this since it is used for either
5460 kind of useless rule.
5461 * src/gram.h: Reword comments and update function names in prototypes.
5462 * src/main.c (main): Say "rule useless in parser due to conflicts".
5463 * src/print-xml.c (print_rules_never_reduced): Rename to...
5464 (print_rules_useless_in_parser): ... this, and rename output XML
5465 element "rules-never-reduced" to "rules-useless-in-parser".
5466 (print_xml): Update for rename.
5467 * src/print.c (print_results): Say "Rules useless in parser due to
5468 conflicts".
5469 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
5470 (nonterminals_reduce): Say "nonterminal useless in grammar".
5471 (reduce_output): Say "Nonterminals useless in grammar".
5472 Say "Rules useless in grammar".
5473 (reduce_xml): Rename output XML element "useless" to
5474 "useless-in-grammar".
5475 (reduce_print): Don't report the count of grammatically useless rules
5476 as "rules never reduced" just because %yacc is specified.
5477 In the correct report of this count, say nonterminal(s) and rule(s)
5478 "useless in grammar".
5479 * tests/conflicts.at (S/R in initial): Update expected output.
5480 (Defaulted Conflicted Reduction): Likewise.
5481 (Unreachable States After Conflict Resolution): Likewise.
5482 * tests/existing.at (GNU pic Grammar): Likewise.
5483 * tests/reduce.at (Useless Nonterminals): Likewise.
5484 (Useless Rules): Likewise.
5485 (Reduced Automaton): Likewise.
5486 (Underivable Rules): Likewise.
5487 (Empty Language): Likewise.
5488
66f0441d
JD
54892007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5490
5491 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
5492 here document and before the EOF so that BSD's implementation of Bourne
5493 shell doesn't parse the delimiter as part of the here document.
5494 * doc/.cvsignore: Add cross-options.texi.
5495 * src/getargs.c (usage): Add a blank line after the warning categories.
5496
d0ee4105
PB
54972007-11-08 Paolo Bonzini <bonzini@gnu.org>
5498
5499 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
5500
e8b1fb9b
AD
55012007-11-05 Akim Demaille <akim@epita.fr>
5502
5503 Remove Id: from bison.1.
5504 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
5505 (perl -0777 -pi -e 's/\.PP\nId): New.
5506 (.x.1): Use it to ignore the version control revision.
5507
2f7a96b5
AD
55082007-11-05 Akim Demaille <demaille@gostai.com>
5509
5510 * build-aux/Makefile.am: Ship cross-options.pl.
5511 * doc/Makefile.am: Always refer to cross-options.texi with
5512 $(srcdir).
5513 (MAINTAINERCLEANFILES): Add it.
5514
f4101aa6
AD
55152007-11-04 Akim Demaille <demaille@gostai.com>
5516
5517 Generate the long/short option cross-table.
5518 * build-aux/cross-options.pl: New.
5519 * doc/Makefile.am (cross-options.texi): New.
5520 * doc/bison.texinfo: Use it.
5521
727a1401
AD
55222007-11-04 Akim Demaille <demaille@gostai.com>
5523
5524 Generate bison.1 using help2man.
5525 * doc/common.x, doc/bison.x: New.
5526 * doc/Makefile.am (bison.1, .x.1): New.
5527 The code is taken from autoconf-2.61/man/Makefile.am.
5528 * configure.ac: Look for help2man.
5529
6aeb9c57
AD
55302007-11-04 Akim Demaille <demaille@gostai.com>
5531
5532 Complete --help.
5533 * src/getargs.c (usage): Document -W, make it clear that -d,
5534 -g and -x have optional arguments.
5535
d7be4085
AD
55362007-11-04 Akim Demaille <demaille@gostai.com>
5537
5538 Find sha1sum when named gsha1sum.
5539 * bootstrap (find_tool): New.
5540 ($SHA1SUM): New.
5541
d9df47b6
JD
55422007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5543
5544 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
5545 at
5546 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
5547 * NEWS (2.3a+): Mention.
5548 * data/bison.m4 (b4_pure_if): Don't define it here.
5549 * data/c.m4 (b4_identification): Depend on individual skeletons to
5550 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
5551 values of the %define variables api.pure or api.push_pull. Define
5552 YYPURE, YYPUSH, and YYPULL accordingly.
5553 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
5554 glr.cc has already defined b4_pure_flag.
5555 * data/push.c: Define b4_pure_if based on `%define api.pure'.
5556 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 5557 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
5558 * doc/bison.texinfo (Pure Decl): Update.
5559 (Push Decl): Update.
5560 (Decl Summary): Add api.pure to %define entry.
5561 In %pure-parser entry, say it's deprecated and reference %define.
5562 (Pure Calling): Update.
5563 (Error Reporting): Update.
5564 (C++ Scanner Interface): Update.
5565 (How Can I Reset the Parser): Update.
5566 (Table of Symbols): In %pure-parser entry, say it's deprecated and
5567 reference %define.
5568 * src/getargs.c (pure_parser): Remove global variable.
5569 * src/getargs.h (pure_parser): Remove extern.
5570 * src/output.c (prepare): Don't define pure_flag muscle.
5571 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
5572 wrapper around `%define api.pure'.
5573 * tests/calc.at (Simple LALR Calculator): Update.
5574 (Simple GLR Calculator): Update.
5575 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
5576 Update.
5577 (GLR: Resolve ambiguity, pure, locations): Update.
5578 (GLR: Merge conflicting parses, pure, no locations): Update.
5579 (GLR: Merge conflicting parses, pure, locations): Update.
5580 * tests/glr-regression.at (Uninitialized location when reporting
5581 ambiguity): Update
5582 * tests/input.at (Unused %define api.pure): New test case.
5583 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
5584 AT_PURE_IF and AT_PURE_AND_LOC_IF.
5585 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5586
c373bf8b
JD
55872007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5588
5589 %define push_pull -> %define api.push_pull. Discussed starting at
5590 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
5591 * data/push.c: Expect the new name.
5592 * data/yacc.c: Likewise.
5593 * doc/bison.texinfo (Push Decl): Update.
5594 (Decl Summary): Update %define entry.
5595 (Push Parser Function): Update.
5596 (Pull Parser Function): Update.
5597 (Parser Create Function): Update.
5598 (Parser Delete Function): Update.
5599 * tests/calc.at (Simple LALR Calculator): Update.
5600 * tests/input.at (%define enum variables): Update.
5601 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5602 (Push Parsing: Multiple impure instances): Update.
5603 (Push Parsing: Unsupported Skeletons): Update.
5604 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
5605 (Exploding the Stack Size with Malloc): Update.
5606
5607 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
5608 other entries some.
5609
32f19b6b
JD
56102007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
5611
5612 For the XML output's terminal element, rename @number to @token-number,
5613 and add @symbol-number. In the nonterminal element, rename @number to
5614 @symbol-number. Discussed starting at
5615 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
5616 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
5617 renames.
5618 (xsl:template match="nonterminal"): Likewise.
5619 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
5620 (xsl:template match="nonterminal"): Likewise.
5621 * src/print-xml.c (print_grammar): Implement.
5622
255a6b90
JD
56232007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5624
5625 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
5626 2007-10-11 change, the child elements here are items not rules.
408476bc 5627 (xsl:template match="item"): New.
255a6b90
JD
5628 (xsl:template match="rule"): Update for new reduced itemset.
5629 (xsl:template match="point"): Remove.
5630 (xsl:template match="empty"): For consistency with --graph, don't
5631 output "/* empty */".
5632 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
5633 line-wrap, don't pass a negative value as first-line-length since this
5634 won't work with the following changes.
5635 (xsl:template name="line-wrap"): Simplify slightly.
5636 (xsl:template name="ws-search"): Eliminate recursion.
5637 * src/print_graph.c (print_core): Don't print a reduction's lookahead
5638 set next to an item whose dot is not at the end of the RHS even if it
5639 happens to be associated with the same rule.
5640
88c78747
JD
56412007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5642
31984206
JD
5643 Add %define lr.keep_unreachable_states.
5644 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
5645 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
5646 * src/main.c (main): Implement it.
5647 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5648 Extend to test it, and fix a typo.
5649
56502007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5651
5652 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
5653 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
5654 the example .output text.
5655 * tests/regression.at (Extra lookahead sets in report): Improve wording
5656 of comments.
5657
b7a70162
WP
56582007-10-17 Wojciech Polak <polak@gnu.org>
5659
5660 * src/print-xml.c (print_grammar): Renamed
5661 <terminal> and <nonterminal> attributes:
5662 "type" to "number" and "symbol" to "name".
5663 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
5664 Use new attribute names.
5665 (xsl:template match="nonterminal"): Likewise.
5666 * data/xslt/xml2xhtml.xsl: Likewise.
5667
a0de5091
JD
56682007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
5669
5670 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
5671 (Option Cross Key): Likewise.
5672
5673 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
5674 next to an item whose dot is not at the end of the RHS even if it
5675 happens to be associated with the same rule.
5676 * src/print.c (print_core): Likewise.
5677 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
5678 (Resolved SR Conflicts): Update output.
5679 * tests/regression.at (Extra lookahead sets in report): New test case.
5680
4c20d18d
WP
56812007-10-11 Wojciech Polak <polak@gnu.org>
5682
5683 * src/print-xml.c (print_core): Remove item set
5684 redundancy.
5685 * data/xslt/bison.xsl (bison:ruleNumber): New key.
5686 Improve processing time. Suggested by Joel E. Denny.
5687 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
5688 Write xsl:param "required" attribute as comment.
5689 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
5690 (xsl:template match="rule"): Support new reduced itemset.
5691 (xsl:template match="point"): Remove.
5692 * data/xslt/xml2xhtml.xsl: Likewise.
5693
f506ad1c
JD
56942007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5695
5696 * src/getargs.c (version): Update copyright year.
5697
21f1b063
JD
56982007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5699
5700 Make xml2dot.xsl and --graph produce the same output.
5701 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
5702 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
5703 escaped later.
5704 (xsl:template name="output-node"): Use the new escape template instead
5705 of the string-replace template directly.
5706 (xsl:template name="output-edge"): Likewise.
5707 (xsl:template name="escape"): New, escapes backslashes and newlines in
5708 addition to quotation marks.
5709 * src/graphviz.c (start_graph, output_node, output_edge): Add
5710 whitespace to output for legibility.
5711
5712 Make xml2text.xsl and --report produce the same output, and remove the
5713 XML "conflicts" element since a conflict summary is easily extracted
5714 from the automaton.
5715 * data/xslt/bison.xsl: New.
5716 (xsl:template match="state" mode="bison:count-conflicts): New.
5717 * data/xslt/xml2text.xsl: Import bison.xsl.
5718 (xsl:template match="bison-xml-report"): Instead of styling the
5719 "conflicts" element, style the "automaton" element with mode
5720 "conflicts". Unlike the former, the latter lists S/R and R/R
5721 conflicts for a state on the same line.
5722 (xsl:template match="conflicts"): Remove.
5723 (xsl:template match="conflict"): Remove.
5724 (xsl:template match="terminal"): Line-wrap the list of rules in which
5725 the terminal is used.
5726 (xsl:template match="nonterminal"): Likewise for nonterminals.
5727 (xsl:template match="automaton" mode="conflicts"): New.
5728 (xsl:template match="state" mode="conflicts"): New.
5729 (xsl:template name="line-wrap"): New.
5730 (xsl:template name="ws-search"): New.
5731 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
5732 (xsl:template match="bison-xml-report"): Instead of styling the
5733 "conflicts" element, style the "automaton" element with mode
5734 "conflicts."
5735 (xsl:template match="conflicts"): Remove.
5736 (xsl:template match="conflict"): Remove.
5737 (xsl:template match="automaton" mode="conflicts"): New.
5738 (xsl:template match="state" mode="conflicts): New.
5739 * src/conflicts.c (conflicts_output_xml): Remove.
5740 * src/conflicts.h (conflicts_output_xml): Remove prototype.
5741 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
5742 * src/print.c (print_grammar): Consistently wrap at the 66th column so
5743 the corresponding XSLT is easier. Also, never wrap between a word and
5744 the comma that follows it.
5745
793fbca5
JD
57462007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5747
5748 Improve C++ namespace support. Discussed starting at
5749 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
5750 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
5751 b4_namespace_close): New macros that interpret the %define variable
5752 "namespace" so its value can contain "::" to indicate nested
5753 namespaces.
5754 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
5755 the above macros.
5756 * data/lalr1.cc (b4_namespace): Likewise.
5757 * data/location.cc (b4_namespace): Likewise.
5758 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
5759 inside a new table in the general %define entry. Document `%define
5760 namespace' there as well. Point the %name-prefix entry to it since it
5761 explains it more completely in the case of C++.
5762 (C++ Bison Interface): Mention `%define namespace' instead of
5763 %name-prefix.
5764 (Table of Symbols): Remove the `%define push_pull' entry. The %define
5765 entry suffices.
5766 * tests/c++.at (Relative namespace references): New test case.
5767 (Absolute namespace references): New test case.
5768 (Syntactically invalid namespace references): New test case.
5769 * tests/input.at (C++ namespace reference errors): New test case.
5770
35b8730d
JD
57712007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5772
5773 Add syncline support and location accessor to internal %define
5774 interfaces.
5775 * data/bison.m4 (b4_percent_define_get_loc): New.
5776 (b4_percent_define_get_syncline): New.
5777 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
5778 (b4_percent_define_default): Record defining location as line 1 rather
5779 than 0 for the sake of synchronizing #line's, and define
5780 b4_percent_define_syncline(VARIABLE).
5781 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
5782 * src/muscle_tab.c (muscle_syncline_grow): New.
5783 (muscle_code_grow): Use muscle_syncline_grow.
5784 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
5785 define b4_percent_define_syncline(VARIABLE).
5786 (muscle_percent_define_get_loc): New.
5787 (muscle_percent_define_get_syncline): New.
5788 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
5789 remove some unused variables.
5790 (muscle_percent_define_default): Record defining location as line 1
5791 rather than 0 for the sake of synchronizing #line's, and define
5792 b4_percent_define_syncline(VARIABLE).
5793 (muscle_percent_define_check_values): Use
5794 muscle_percent_define_get_loc.
5795 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
5796 (muscle_percent_define_get_syncline): Prototype.
5797 * tests/skeletons.at (%define Boolean variables: invalid skeleton
5798 defaults): Update output for location change.
5799 (Complaining during macro argument expansion): Extend to test
5800 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
5801
7dc4a694
JD
58022007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
5803
5804 Fix some error-reporting macro bugs.
5805 * data/bison.m4 (b4_cat): New.
5806 (b4_error, b4_error_at): Use b4_cat to send error directives directly
5807 to stdout so they don't become arguments to other macros. Update
5808 comments and add examples.
5809 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
5810 add examples.
5811 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
5812 after printing the error directive so that M4 doesn't report subsequent
5813 problems that are induced by this problem.
5814 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
5815 instead of just in them. Recognize @\n in both places. Both expand to
5816 the empty string. Needed by b4_cat.
5817 * tests/skeletons.at (Complaining during macro argument expansion):
5818 New test case.
5819 (Fatal errors make M4 exit immediately): New test case.
5820
d4bd2295
JD
58212007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
5822
5823 Implement --print-datadir.
5824 * src/getargs.c (usage): Mention.
5825 (PRINT_DATADIR_OPTION): New anonymous enum member.
5826 (long_options): Add entry for it.
5827 (getargs): Add case for it calling compute_pkgdatadir.
5828 * src/output.c (output_skeleton): Encapsulate data directory
5829 computation from here...
5830 (prepare): ... and from here...
5831 (compute_pkgdatadir): ... into this new function.
5832 * src/output.h (compute_pkgdatadir): Prototype.
5833
34cdeddf
JD
58342007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
5835
5836 * src/print-xml.c (escape_bufs): New static global variable
5837 replacing...
5838 (xml_escape_n): ... the static local variable buf here.
5839 (print_xml): Free memory for escape_bufs.
5840 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
5841
d782395d
JD
58422007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
5843
5844 Replace `%push-parser' and `%push-pull-parser' with
5845 `%define push_pull "push"' and `%define push_pull "both"'.
5846 `%define push_pull "pull"' is the default.
5847 * doc/bison.texinfo (Push Decl, Push Parser Function,
5848 Pull Parser Function, Parser Create Function, Parser Delete Function):
5849 Update declarations.
5850 (Decl Summary, Table of Symbols): Replace %push-parser and
5851 %push-pull-parser entries with a %define push_pull entry.
5852 * data/bison.m4 (b4_percent_define_check_values): New macro.
5853 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
5854 definitions...
5855 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
5856 definitions...
5857 * data/push.c: ... to here and compute them from the value of the
5858 %define variable push_pull.
5859 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
5860 parsing requests here...
5861 * data/yacc.c: ... hack this to switch to push.c any time
5862 b4_use_push_pull_flag or the %define variable push_pull is set. This
5863 will go away when we mv push.c yacc.c.
5864 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
5865 push parsing is not supported since unused %define variables are
5866 reported anyway.
5867 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
5868 * src/muscle_tab.h (muscle_percent_define_check_values): Update
5869 comments for consistency with b4_percent_define_check_values.
5870 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
5871 muscles.
5872 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
5873 Remove.
5874 (prologue_declaration): Remove %push-parser and %push-pull-parser
5875 rules.
5876 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
5877 * tests/calc.at: Update declarations.
5878 * tests/input.at (%define enum variables): New test case.
5879 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
5880 declaration.
5881 (Push Parsing: Multiple impure instances): Update declaration.
5882 (Push Parsing: Unsupported Skeletons): New test case.
5883 * tests/torture.at (Exploding the Stack Size with Alloca): Update
5884 declaration.
5885 (Exploding the Stack Size with Malloc): Update declaration.
5886
3f999f78
WP
58872007-09-24 Wojciech Polak <polak@gnu.org>
5888
5889 Add XSLT transformations.
5890
5891 * data/xslt/xml2dot.xsl: Transform XML into DOT.
5892 * data/xslt/xml2text.xsl: Transform XML into plain text.
5893 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
5894 * data/Makefile.am (xsltdir): New variable.
5895 (dist_xslt_DATA): Add xslt/*.xsl files.
5896
a4f75309
PE
58972007-09-23 Paul Eggert <eggert@cs.ucla.edu>
5898
5899 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
5900 Problem reported by Wojciech Polak.
5901 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
5902 (xml_printf): Undo change I made on 21 September; that is,
5903 indent 2 spaces, not 1.
5904
ad5feac4
JD
59052007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
5906
5907 Pacify ./configure --enable-gcc-warnings.
5908 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
5909 `char const *' instead of `char *'.
5910 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
5911 local variable `sep'.
5912
41d7a5f2
PE
59132007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5914
5915 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
5916 elsewhere.
5917 * src/print-xml.c: Prefer "const" after types; that's more consistent.
5918 (xml_printf): Indent just 1 space for level.
5919 (e_char, xlate_char): Remove.
5920 (xml_escape_string): Rewrite to avoid undefined behavior (used
5921 storage that was freed from the stack).
5922 (xml_escape_n): Don't bother checking for subscript error.
5923
3f999f78
WP
59242007-09-21 Wojciech Polak <polak@gnu.org>
5925
5926 Add Bison XML Automaton Report.
41d7a5f2
PE
5927
5928 Add support for an -x option to generate an XML report.
5929 It is not documented yet.
5930 * src/print-xml.c: New file.
5931 * src/print-xml.h: Likewise.
5932 * lib/timevar.def (TV_XML): New var.
5933 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
5934 * src/conflicts.c: Include print-xml.h.
5935 (solved_conflicts_xml_obstack): New var.
5936 (log_resolution, conflicts_solve, conflicts_free):
5937 Add support for XML report.
5938 (conflicts_output_val): New function.
5939 * src/conflicts.h (conflicts_output_val): New decl.
5940 * src/files.c (spec_xml_file): New var.
5941 (compute_output_file_names, output_file_names_free): Add XML support.
5942 * src/files.h (spec_xml_file): New decl.
5943 * src/getargs.c (xml_flag): New var.
5944 (usage, short_options, long_options, getargs): Add XML support.
5945 * src/getargs.h (xml_flag): New decl.
5946 * src/gram.c: Include print-xml.h.
5947 (rule_lhs_print_xml, rule_rhs_print_xml):
5948 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
5949 New functions.
5950 * src/gram.h: Declare external ones.
5951 * src/main.c: Include print-xml.h.
5952 (main): Add XML support.
5953 * src/reduce.c: Include print-xml.h.
5954 (reduce_xml): New function.
5955 * src/reduce.h: Declare it.
5956 * src/state.c: Include print-xml.h.
5957 (state_new): Add XML support.
5958 (state_rule_lookahead_tokens_print_xml): New function.
5959 * src/state.h: Declare it.
5960 (struct state): New member solved_conflicts_xml.
5961 * src/symtab.c (symbol_class_get_string): New function.
5962 * src/symtab.h: Declare it.
5963
6d8e724d
PE
59642007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5965
5966 * GNUmakefile: Switch to coreutils's version.
5967 * bootstrap: Likewise.
5968 * Makefile.cfg: Adjust to new GNUmakefile.
5969 * README-hacking: Likewise.
5970
5971 Import from gnulib:
5972
5973 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
5974 Bruno Haible <bruno@clisp.org>
5975
5976 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
5977 and is a script that invokes bison. Tighten the code. Add comments.
5978
922bdd7f
JD
59792007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
5980
5981 Spell "boolean" as "Boolean". Reported by Akim Demaille.
5982 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
5983 * doc/bison.texinfo (Decl Summary): Fix.
5984 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
5985 * tests/input.at (Boolean %define variables): Update output.
5986 * tests/skeletons.at (%define boolean variables: invalid skeleton
5987 defaults): Rename to...
5988 (%define Boolean variables: invalid skeleton defaults): ... this and
5989 update output.
5990
1b17b01d
JD
59912007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
5992
5993 In impure push mode, don't allow more than one yypstate to be allocated
5994 since multiple impure parsers would corrupt yynerrs.
5995 * data/push.c (yypstate_allocated): New static global variable
5996 initialized to 0.
5997 (yypull_parse): If yypstate_new returns 0, don't report it as memory
5998 exhaustion if yypstate_allocated is 1, but still return 2.
5999 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
6000 already 1. Otherwise, set it to 1.
6001 (yypstate_delete): Set it to 0.
6002 * tests/push.at (Push Parsing: Multiple impure instances): New test
6003 case.
6004
9987d1b3
JD
60052007-08-17 Bob Rossi <bob@brasko.net>
6006
6007 * doc/bison.texinfo (Push Decl): Document the push parser.
6008 (Table of Symbols): Ditto.
6009 (Pure Decl): Ditto.
6010 (Decl Summary): Ditto.
6011 (Multiple Parsers, Push Parser Function, Pull Parser Function,
6012 Parser Create Function, Parser Delete Function):
6013 Add new push parser symbols.
6014 (Table of Symbols): Document push-parser, push-pull-parser,
6015 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
6016
f16b0819
PE
60172007-08-15 Paul Eggert <eggert@cs.ucla.edu>
6018
6019 Update to GPLv3.
6020 * doc/gpl-3.0.texi: New file.
6021 * doc/gpl.texi: Remove.
6022 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
6023 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
6024 * README-hacking, TODO, bootstrap, bootstrap.conf:
6025 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
6026 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
6027 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
6028 * data/lalr1.cc, data/lalr1.java, data/location.cc:
6029 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
6030 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
6031 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
6032 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
6033 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
6034 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
6035 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
6036 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
6037 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
6038 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
6039 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
6040 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
6041 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
6042 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
6043 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
6044 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
6045 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
6046 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
6047 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
6048 * src/complain.c, src/complain.h, src/conflicts.c:
6049 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
6050 * src/files.h, src/flex-scanner.h, src/getargs.c:
6051 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
6052 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
6053 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
6054 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
6055 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
6056 * src/print.c, src/print.h, src/print_graph.c:
6057 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
6058 * src/reduce.h, src/relation.c, src/relation.h:
6059 * src/revision.h, src/scan-code.h, src/scan-code.l:
6060 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
6061 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
6062 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
6063 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
6064 * tests/Makefile.am, tests/actions.at, tests/c++.at:
6065 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
6066 * tests/existing.at, tests/glr-regression.at:
6067 * tests/headers.at, tests/input.at, tests/java.at:
6068 * tests/local.at, tests/output.at, tests/push.at:
6069 * tests/reduce.at, tests/regression.at, tests/sets.at:
6070 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
6071 * tests/torture.at:
6072 Update to GPLv3.
6073
728c4be2
JD
60742007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6075
6076 Get rid of broken %no-parser, -n, and --no-parser implementation and
6077 documentation.
6078 * TODO: Don't mention them.
6079 * doc/bison.1: Likewise.
6080 * doc/bison.texinfo (Decl Summary): Likewise.
6081 (Bison Options): Likewise.
6082 (Option Cross Key): Likewise.
6083 * src/getargs.c (no_parser_flag): Remove global variable.
6084 (usage): Don't print description of -n and --no-parser.
6085 (long_options): Remove --no-parser entry here.
6086 (getargs): Remove -n case in the switch here.
6087 * src/getargs.h (no_parser_flag): Remove extern.
6088 * tests/regression.at (Web2c Actions): Remove comment that mentions
6089 --no-parser.
6090
5d31a216
JD
60912007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6092
6093 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
6094 name user variables starting with `yy'. Just pass NULL instead of a
6095 dummy local &yylval to yypush_parse.
6096 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
6097 starting with `yy'.
6098
a2ea208d
JD
60992007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
6100
6101 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
6102 true since it's then always used regardless of whether yyoverflow is
6103 defined. Reported by Christian Burger at
6104 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
6105 * THANKS: Add Christian Burger.
6106
91661ebb
JD
6107 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6108 node names: say "Decl Summary" not "Bison Declaration Summary".
6109
cbd50549
JD
61102007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
6111
6112 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
6113 determine whether this function has already complained about an invalid
6114 value for a %define boolean variable, don't check whether Bison has
6115 ever examined the value. As written, the check was a tautology.
6116 Instead, record and check for this complaint using a separate muscle.
6117
eb1b0740
JD
61182007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
6119
6120 Fix push parsing memory leak reported by Brandon Lucia at
6121 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
6122 * THANKS: Add Brandon Lucia.
6123 * data/push.c (yypstate_delete): Free the stack if it was reallocated
6124 but the parse never completed and thus freed it.
6125 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
6126 * tests/testsuite.at: Include push.at.
6127 * test/push.at: New.
6128 (Push Parsing: Memory Leak for Early Deletion): New test case.
6129
9d774aff
JD
61302007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
6131
6132 Improve handling of multiple S/R conflicts in the same state and of S/R
6133 conflicts involving multiple reductions.
6134 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
6135 set for a state here or Bison will abort if it is reassigned on a
6136 later conflicted reduction in the same state.
6137 Similarly, don't finalize and assign the solved conflicts report here
6138 or it will be lost if it is reassigned on a later conflicted reduction
6139 in the same state.
6140 (set_conflicts): Instead, assign them both here after all S/R conflicts
6141 in the state have been fully examined.
6142 * src/print.c (shift_set): Rename to...
6143 (no_reduce_set): ... this.
6144 (print_reductions): Update for rename, and add %nonassoc error action
6145 tokens to no_reduce_set so that, when printing the first remaining
6146 reduction on an error action token, the reduction is enclosed in
6147 brackets.
6148 (print_results): Update for rename.
6149 * tests/conflicts.at (Solved conflicts report for multiple reductions
6150 in a state): New test case.
6151 (%nonassoc error actions for multiple reductions in a state): New test
6152 case.
6153
6154 * src/main.c (main): Don't depend on C99 features.
6155
10159d2a
JD
61562007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
6157
6158 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
6159 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
6160 uniwidth.
10159d2a 6161
953b3935
JD
61622007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
6163
6164 * bootstrap (slurp): Create target directories that don't exist.
6165 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
6166
6ce2d93a
JD
61672007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6168
6169 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
6170 than item number.
6171 * closure.c (closure): Likewise.
6172 * state.h (reductions): Comment sorting of rules.
6173 (state): Comment sorting of items.
6174
ce3448d5
JD
61752007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
6176
6177 Fix C++ test cases after recent Gnulib changes. Discussed starting at
6178 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
6179 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
6180 definition in order to avoid Gnulib headers since we don't use config.h
6181 here.
6182 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
6183 rather than AT_DATA so that config.h is included.
6184
8a86eef0
JD
61852007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
6186
6187 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
6188 instead of fprintf. Guard these functions with #if YYDEBUG instead of
6189 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
6190 and so that YYFPRINTF is guaranteed to be defined here.
6191
b1a81613
JD
61922007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6193
6194 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
6195 with...
6196 (muscle_percent_define_check_values): ... this more helpful function.
6197 Again, it's not used yet, but it will be.
6198 * src/muscle_tab.h: Likewise.
6199
71b61d4d
JD
6200 Improve some comments in parser table construction.
6201 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
6202 (generate_states): Don't mention ruleset, which is internal to closure.
6203 * src/closure.c (closure): Explain sorting of core and itemset, which
6204 is required for this function to behave correctly.
6205 * src/closure.h (closure): Mention sorting.
6206
2a6b783d
JD
62072007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
6208
6209 * src/lalr.c (state_lookahead_tokens_count): For code readability,
6210 move the check for disabled transitions to an aver since conflict
6211 resolution hasn't happened yet.
6212
6213 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
6214 labels a state as inconsistent just because it has error transitions.
6215 The original form of this check appeared in revision 1.1 of lalr.c,
6216 which was committed on 1991-12-21. Now (at least), changing the
6217 consistency label on such a state appears to have no useful effect in
6218 any of the places it is examined, which I enumerate below. The key
6219 point to understanding each item in this enumeration is that a state
6220 with an error transition is labelled consistent in the first place only
6221 if it has no rules, so the check cannot matter for states that have
6222 rules. (1) Labelling a state as inconsistent will cause set_conflicts
6223 to try to identify its conflicts, and a state must have *rules* to have
6224 conflicts. (2) Labelling a state as inconsistent will affect how
6225 action_row sets the default *rule* for the state. (3) Labelling a
6226 state as inconsistent will cause build_relations to add lookback edges
6227 to *rules* in that state.
6228 * src/state.h (struct state): Word the comment for member consistent
6229 more carefully.
6230
14462c2b
JD
62312007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
6232
6233 Don't depend on C99 features.
6234 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
6235 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
6236 * src/reader.c (check_and_convert_grammar): Fix for-loop.
6237 * src/state.c (state_mark_reachable_states): Fix for-loop.
6238 (state_remove_unreachable_states): Fix for-loop.
6239
6240 Don't widen struct state with member reachable just to temporarily
6241 record reachability. Instead, use a local bitset.
6242 * src/state.h (struct state): Remove member.
6243 * src/state.c (state_new): Don't initialize it.
6244 (state_mark_reachable_states): Rename to...
6245 (state_record_reachable_states): ... this, and use bitset.
6246 (state_remove_unreachable_states): Use bitset.
6247
5a43d418
JD
62482007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
6249
6250 * src/Makefile.am (yacc): Quote target action commands properly so
6251 that the yacc script isn't corrupt. Reported by Hans Aberg at
6252 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
6253
0c650a20
JD
6254 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
6255 the case of pure parsers. Reported by Frans Englich at
6256 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
6257 * THANKS: Add Frans Englich.
6258
61fee93e
JD
6259 * NEWS (2.3a+): In the %code entry, reference section `Bison
6260 Declaration Summary' from the manual now since the %code summary has
6261 moved there.
6262 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
6263 in the rules section must be terminated by semicolons.
6264
f124d423
JD
62652007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
6266
6267 Extend the front-end API for %define variables to more completely
6268 mirror the back-end. This will be useful in the future.
6269 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
6270 Update comments to mention the new front-end counterparts of these
6271 macros.
6272 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
6273 for muscle_string_decode and muscle_location_decode.
6274 (muscle_string_decode): New static function.
6275 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
6276 (muscle_percent_define_get, muscle_percent_define_ifdef): New
6277 functions.
6278 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
6279 muscle_percent_define_get to mimic the b4_percent_define_flag_if
6280 implementation more closely.
6281 (muscle_percent_define_invalid_value): New function.
6282 * src/muscle_tab.h (muscle_percent_define_get,
6283 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
6284 Prototype.
6285
75ad86ee
JD
62862007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
6287
6288 * NEWS (2.3a+): Mention yesterday's state-removal change.
6289 (2.3a): Remove the %language entry, which was added after 2.3a.
6290 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
6291 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
6292 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
6293 tests/existing.at: Update copyright date.
6294
5967f0cf
JD
62952007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6296
6297 If conflict resolution makes states unreachable, remove those states,
6298 report rules that are then unused, and don't report conflicts in those
6299 states.
6300 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
6301 New global function.
6302 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
6303 function.
6304 * src/main.c (main): After conflict resolution, remove the unreachable
6305 states and update all data structures that reference states by number.
6306 * src/state.c (state_new): Initialize each state's reachable member to
6307 false.
6308 (state_mark_reachable_states): New static function.
6309 (state_remove_unreachable_states): New global function.
6310 * src/state.h (struct state): Add member bool reachable.
6311 (state_remove_unreachable_states): Prototype.
6312 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6313 New test case.
6314 * tests/existing.at (GNU pic Grammar): Update test case output now that
6315 an unused rule is discovered.
6316
b09f4f48
JD
63172007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6318
6319 Minor code cleanup in parser table construction.
6320 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
6321 (new_itemsets, save_reductions): Update for rename to nitemset.
6322 * src/closure.c (nritemset): Rename to...
6323 (nitemset): ... this since the "r" appears to meaningless and isn't
6324 used in the comments.
6325 (closure): Update for rename.
6326 * src/closure.h (nritemset): Update extern to...
6327 (nitemset): ... this.
6328 * src/lalr.c (LA): Fix a typo in comments.
6329 * src/print.c (print_core): Update for rename to nitemset.
6330 * src/print_graph.c (print_graph): Likewise.
6331 * src/state.h: Fix some typos in header comments.
6332
bbb44d83
PE
63332007-04-04 Paul Eggert <eggert@cs.ucla.edu>
6334
9b33de72
PE
6335 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
6336 still sticks to ASCII. Sorry!
6337
bbb44d83
PE
6338 * README-hacking: New file, taken mostly from coreutils, with changes
6339 for Bison. Contains much of the contents of:
6340 * README-cvs: Remove.
6341 * bootstrap: Sync from gnulib.
6342 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
6343 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
6344
29553547
JD
63452007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
6346
6347 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
6348 Setzer.
6349 (Java Differences): Fix some typos.
6350 * THANKS: Add Sebastian Setzer.
6351
01b477c6
PB
63522007-03-07 Paolo Bonzini <bonzini@gnu.org>
6353
730739e4
AD
6354 * data/java.m4 (b4_single_class_if): Remove.
6355 (b4_abstract_if): Look at "%define abstract".
6356 (b4_lexer_if): New.
6357 (b4_union_name): Rename...
6358 (b4_yystype): ... to this. Map to "%define stype".
6359 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
6360 b4_maybe_throws): Fix quoting.
6361 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
6362 * data/lalr1.java (Lexer interface): Always define.
6363 (Lexer interface within parser class): Remove.
6364 (YYLexer class): New, used when "%code lexer" is present.
6365 (constructor): When "%code lexer" is used, pass %lex-param
6366 to the lexer constructor.
6367 (yylex, yyparse): Remove %lex-param from method invocations
6368 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
6369
6370 * doc/bison.texinfo (Java Bison Interface): Mention "%define
6371 abstract". Rename "%define union_name" to "%define stype".
6372 Rename method names according to previous patch.
6373 (Java Scanner Interface): Describe "%code lexer" instead of
6374 "%pure-parser" and "%define single_class".
6375 (Java Differences): Mention "%code lexer".
6376
6377 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
6378 Include scanner here, using macros from tests/local.at.
6379 (AT_DATA_CALC_Y): Remove final argument.
6380 (_AT_CHECK_JAVA_CALC): Likewise.
6381 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
6382 of %locations and %error-verbose.
6383 (main): Test with and without %lex-param.
6384 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
6385 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 6386
122bea3a
JMG
63872007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6388
6389 DJGPP spefic issue. Inhibit the use of disallowed characters for
6390 file name genertion on Win98, WinXP, etc. These are |<>":?*\
6391 and concern testsuite case 46.
6392 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
6393 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
6394 * djgpp/config.bat: Inhibit the use of disallowed characters.
6395
9611cfa2
JD
63962007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6397
6398 Miscellaneous %define and %code cleanup.
6399 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
6400 values are interpreted.
6401 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
6402 documentation a little more.
6403 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
6404 muscle_percent_define_insert, muscle_percent_code_grow): New
6405 functions/macros.
6406 * src/muscle_tab.h (muscle_percent_define_insert,
6407 muscle_percent_code_grow): Prototype.
6408 * src/parse-gram.y (prologue_declaration): Use
6409 muscle_percent_define_insert and muscle_percent_code_grow when parsing
6410 %define and %code directives.
6411
6412 Make it easy to share %define boolean variables between the front-end
6413 and back-end. Though not used yet, this will be useful in the future.
6414 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
6415 Bison uses of names rather than just skeleton uses of names.
6416 (b4_percent_define_get, b4_percent_define_ifdef): Rename
6417 b4_percent_define_skeleton_variables(VARIABLE) to
6418 b4_percent_define_bison_variables(VARIABLE).
6419 (b4_percent_code_get, b4_percent_code_ifdef): Rename
6420 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
6421 b4_percent_code_bison_qualifiers(QUALIFIER).
6422 (b4_check_user_names_wrap): Update for renames.
6423 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
6424 muscle_percent_define_default): New functions mimicking
6425 b4_percent_define_flag_if and b4_percent_define_default.
6426
6427 For %define variables, report locations for invalid values and
bbb44d83 6428 redefinitions.
9611cfa2
JD
6429 * data/bison.m4 (b4_percent_define_flag_if): Read
6430 b4_percent_define_loc(VARIABLE) to report the location of an invalid
6431 value for VARIABLE.
6432 (b4_percent_define_default): Save a special location in
6433 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
6434 must later be reported as invalid.
6435 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
6436 functions.
6437 (muscle_percent_define_insert): Record the location of VARIABLE in
6438 muscle percent_define_loc(VARIABLE), and use it to report the previous
6439 location for a redefinition.
6440 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
6441 (muscle_percent_define_default): Update like b4_percent_define_default.
6442 (muscle_grow_user_name_list): Rename to...
6443 (muscle_user_name_list_grow): ... this for consistency and use
6444 muscle_location_grow.
6445 * src/muscle_tab.h (muscle_location_grow): Prototype.
6446 * tests/input.at (%define errors): Update expected output.
6447 * tests/skeletons.at (%define boolean variables: invalid skeleton
6448 defaults): New test case.
6449
0bf92491
JD
64502007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
6451
6452 * src/print.c (lookahead_set, state_default_rule): Remove.
6453 (print_reductions): Replace state_default_rule invocation with
6454 equivalent use of yydefact, which was computed in token_actions in
6455 tables.c.
6456 (print_results): Don't allocate lookahead_set.
6457
d3b12988
PB
64582007-02-27 Paolo Bonzini <bonzini@gnu.org>
6459
6460 * data/lalr1.java: Prefix all private members with yy.
6461
f57a7536
JD
64622007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
6463
6464 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 6465 Sebastien Fricker at
f57a7536 6466 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 6467 * THANKS: Add Sebastien Fricker.
f57a7536
JD
6468 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
6469 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
6470 accept a variable number of arguments.
6471
6404a5bf
JD
64722007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
6473
6474 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
6475
e4e09639
JMG
64762007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6477
6478 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
6479 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
6480 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
6481
d7e0a1a7
PE
64822007-02-11 Paul Eggert <eggert@cs.ucla.edu>
6483
6484 Undo my 2007-02-07 change, switching back to the c-strcase module
6485 introduced in the 2007-02-03 change. Bruno Haible reported that
6486 the 2007-02-07 change would be dangerous in Turkish if we add a
6487 language whose name contains "i", since "i" is not lowercase "I"
6488 in Turkish.
6489 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
6490 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
6491 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
6492 * m4/.cvsignore: Remove strcase.m4.
6493 * src/getargs.c: Revert 2007-02-07 change, as follows.
6494 Include c-strcase.h.
6495 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
6496
deee93a1
JD
64972007-02-11 Bruno Haible <bruno@clisp.org>
6498
6499 Enable the Java related testsuite tests when the only Java compiler
6500 found is a gcj < 4.3. Discussed at
6501 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
6502 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
6503
574add85
JD
65042007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
6505
6506 * data/Makefile.am: Update copyright date.
6507 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
6508 yypstate_new returns NULL.
6509 (yypstate_new): Return NULL if malloc does.
6510 * src/reader.c (packgram): Move translation of rule actions from the
6511 beginning of packgram to...
6512 (check_and_convert_grammar): ... here right before packgram is invoked
6513 so it's easier to write more complete comments, and remove redundant
6514 code.
6515
e785ccf7
JD
65162007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
6517
6518 As in semantic actions, make @$ in %initial-action, %destructor, and
6519 %printer imply %locations.
6520 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
6521 scanning @$.
6522 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
6523 (@$ in %initial-action implies %locations,
6524 @$ in %destructor implies %locations,
6525 @$ in %printer implies %locations): ... these new test cases.
6526
1cfe1ed7
PE
65272007-02-07 Paul Eggert <eggert@cs.ucla.edu>
6528
6529 Undo most of the 2007-02-03 change, switching to the strcase module
6530 now that gnulib strcase has been fixed.
6531 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
6532 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
6533 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
6534 * m4/.cvsignore: Add strcase.m4.
6535 * src/getargs.c: Revert 2007-02-03 change, as follows.
6536 Don't include c-strcase.h.
6537 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
6538 strcasecmp has "unspecified behavior" outside the POSIX locale,
6539 but it works fine in practice if at least one argument is ASCII,
6540 as is the case in Bison.
6541
0049ec86
PB
65422007-02-07 Paolo Bonzini <bonzini@gnu.org>
6543
6544 * tests/java.at: Skip tests if only one of javac/java is present.
6545 Reported by Joel E. Denny.
6546 * tests/atlocal.in: Adjust copyright years.
6547
65482007-02-05 Paolo Bonzini <bonzini@gnu.org>
6549
6550 * data/lalr1.java (Stack): Work around old verifiers that disallow
6551 access to the private fields of an inner class, from the outer class.
6552 We can make Stack's fields public because user code doesn't have access
6553 to the instance of Stack used by parse(). Reported by Paul Eggert.
6554
2c2b7220
PE
65552007-02-03 Paul Eggert <eggert@cs.ucla.edu>
6556
6557 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
6558 the right spot for these files?
6559 * bootstrap.conf (gnulib_modules): Add c-strcase.
6560 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
6561 c-strncasecmp.c.
6562 * src/getargs.c: Include c-strcase.h.
6563 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
6564 to avoid unspecified behavior.
6565
b2b81dae
JD
65662007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
6567
6568 * doc/bison.texinfo (Decl Summary): Correct typo.
6569
c1d19e10
PB
65702007-01-30 Paolo Bonzini <bonzini@gnu.org>
6571
6572 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
6573 Complain if the value does not match empty, "true" or "false".
6574 * data/c++.m4: Adjust default definitions of %define variables.
6575 * data/java.m4: Adjust default definitions of %define variables.
6576 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
6577 to above behavior.
6578 * tests/input.at (Boolean %define variables): Test new behavior.
6579
8405b70c
PB
65802007-01-29 Paolo Bonzini <bonzini@gnu.org>
6581
6582 * NEWS: Mention java.
6583 * TODO: Remove things that are done.
6584 * bootstrap.conf: Add javacomp-script and javaexec-script.
6585 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
6586
6587 * data/Makefile.am: Add new files.
6588 * data/java-skel.m4: New.
6589 * data/java.m4: New.
6590 * data/lalr1.java: New.
6591
6592 * doc/bison.texinfo: Put "A Complete C++ Example" under
6593 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
6594 under Other Languages.
6595
6596 * src/getargs.c (valid_languages): Add Java.
6597 * src/getargs.h (struct bison_language): Update size of string fields.
6598
6599 * tests/Makefile.am: Add java.at.
6600 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
6601 * tests/java.at: New.
6602 * tests/testsuite.at: Include it.
6603
3eb82471
JD
66042007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
6605
6606 Clean up.
6607 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
6608 at_directive_argv arguments so these no longer have to be global
6609 variables. Also, update the implementation for the following changes.
6610 (fail_for_at_directive_too_many_args,
6611 fail_for_at_directive_too_few_args): Add at_directive_name argument.
6612 (at_directive_name): Remove as at_directive_argv[0] will be used for
6613 this now.
6614 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
6615 for the directive name.
6616 (at_directive_argc, at_directive_argv): Make these local within
6617 skel_lex instead of global.
6618 (INITIAL): Update directive start action for above changes.
6619 (SC_AT_DIRECTIVE_ARG): Rename to...
6620 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
6621 (SC_AT_DIRECTIVE_SKIP_WS): Update.
6622 (scan_skel): Move yylex_destroy to...
6623 (skel_scanner_free): ... here.
6624 * tests/skeletons.at (installed skeleton file name): Rename to...
6625 (installed skeleton file names): ... this.
6626
148d66d8
JD
66272007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
6628
6629 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6630 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
6631 Summary" not "Directives".
6632 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
6633 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
6634 since the former is now the more complete one.
6635 (Prologue Alternatives): Likewise and do the same for %defines.
6636 (Table of Symbols): Add summary of %code, add summary of %define, and
6637 move full %code documentation to...
6638 (Decl Summary): ... here for consistency with other entries in these
6639 sections.
6640 Move %define entry in order to keep this list alphabetized.
6641 Reword %define entry a little to put less emphasis on the skeleton
6642 concept, which most users shouldn't have to think about.
6643
665f0c24
PE
66442007-01-26 Paul Eggert <eggert@cs.ucla.edu>
6645
6646 Adjust to recent gnulib changes.
6647 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
6648 Add string.h, string_.h, unistd_.h, wchar_.h.
6649 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
6650 * src/system.h: Don't include <stpcpy.h>; this is now done by
6651 <string.h>.
6652
592d0b1e
PB
66532007-01-23 Paolo Bonzini <bonzini@gnu.org>
6654
6655 Simplify implementation of unqualified %code, implement macros for
6656 uniform treatment of boolean %define flags. Document %define.
6657 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
6658 b4_percent_code_ifdef): New.
6659 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
6660 * data/c++.m4: Define default value for global_tokens_and_yystype.
6661 * data/glr.cc: Likewise.
6662 * data/location.cc: Use b4_percent_define_flag_if.
6663
148d66d8 6664 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
6665
6666 * src/parse-gram.y (Unqualified %code): Change muscle name to
6667 b4_percent_code().
6668 (content.opt): Default to empty.
6669
a7867f53
JD
66702007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6671
6672 Implement support for relative and absolute skeleton file names.
6673 Discussed starting at
6674 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
6675 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
6676 (Bison Options): Document in --skeleton entry.
6677 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
6678 full_skeleton can't necessarily hold all of pkgdatadir.
6679 If the specified skeleton file name contains a `/', don't prepend
6680 pkgdatadir.
6681 * src/parse-gram.y (prologue_declaration): If the specified skeleton
6682 file name contains a `/', prepend the grammar file directory.
6683 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
6684 * skeletons.at: New file.
6685 (relative skeleton file names): New test case.
6686 (installed skeleton file names): New test case.
6687 * tests/testsuite.at: Include skeletons.at.
6688
6689 * bootstrap: Update copyright to 2007.
6690
830c9b18
PB
66912007-01-17 Paolo Bonzini <bonzini@gnu.org>
6692
6693 * bootstrap: Remove occurrences of .#bootmp from the files.
6694
a8c2e813
AD
66952007-01-17 Akim Demaille <akim@epita.fr>
6696
6697 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
6698 nonterminals.
6699 Use per-type %printer.
6700
279cabb6
JD
67012007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6702
6703 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
6704 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6705 djgpp/config.site, src/files.c, src/files.h, src/main.c,
6706 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
6707 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
6708 tests/glr-regression.at, tests/input.at, tests/local.at,
6709 tests/output.at, tests/torture.at: Update copyright to 2007.
6710
bb32f4f2
AD
67112007-01-16 Akim Demaille <akim@epita.fr>
6712
6713 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
6714 error code.
6715 (Calc++ Scanner): Exit with failure if we can't open the input
6716 file.
6717 Accept "-" standing for stdin.
6718 (Calc++ Top Level): Print the result only if the parsing was
6719 successful.
6720
7cff04b5
AD
67212007-01-16 Akim Demaille <akim@epita.fr>
6722
6723 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
6724
a4e25e1d
JD
67252007-01-15 Paolo Bonzini <bonzini@gnu.org>
6726 and Joel E. Denny <jdenny@ces.clemson.edu>
6727
6728 Clean up %define and %code implementation in M4 some. Most
6729 importantly, rename all related macros to be in the b4_percent_define
6730 and b4_percent_code namespaces. Also, complete support for `.' in
6731 %define variable names and %code qualifiers.
6732 * data/bison.m4 (b4_check_user_names): Check for special
6733 "SKELETON-NAMESPACE(name)" macros instead of using two nested
6734 m4_foreach loops.
6735 (b4_get_percent_define, b4_get_percent_code): Rename to...
6736 (b4_percent_define_get, b4_percent_code_get): ... these.
6737 Extend documentation with examples.
6738 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
6739 b4_percent_define_skeleton_variables and
6740 b4_percent_code_skeleton_qualifiers.
6741 Expect any value for the %define variable `foo' to be stored in the
6742 macro named `b4_percent_define(foo)'; expect any %code blocks for the
6743 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
6744 expect any unqualified %code blocks to be stored in a macro named
6745 `b4_percent_code_unqualified'.
6746 Use m4_indir so that %define variable names and %code qualifiers can
6747 contain `.', which is allowed by the grammar parser.
6748 (b4_percent_define_default): New macro to set a default value for a
6749 %define variable.
6750 (m4_wrap): Update wrapped code, and fix some underquoting.
6751 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
6752 Expect grammar uses of %define variables and %code qualifiers to be
6753 defined in b4_percent_define_user_variables and
6754 b4_percent_code_user_qualifiers.
6755 * data/c++.m4: Use b4_percent_define_default rather than
6756 m4_define_default. Fix some underquoting. Skeleton usage of %define
6757 variable define_location_comparison now implies skeleton usage of
6758 %define variable filename_type.
6759 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6760 data/push.c, data/yacc.c: Update macro names.
6761 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
6762 muscle names.
6763
e37c665c
JMG
67642007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6765
6766 DJGPP specific issues.
6767
6768 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
6769 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
6770
7d2d521f
JD
67712007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6772
6773 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
6774 run parsers in all tests so that Valgrind is invoked during
6775 maintainer-check-valgrind.
6776 (Duplicate representation of merged trees): Free all semantic values.
6777 (Duplicated user destructor for lookahead): Likewise.
6778
e0ac9b4b
JD
67792007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6780
6781 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
6782 command-line prefix.
6783 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
6784 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
6785 miss Valgrind messages.
6786 (Exploding the Stack Size with Malloc): Likewise.
6787
78143faa
JD
67882007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6789
6790 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
6791 locals. Reported by Juan Manuel Guerrero at
6792 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
6793 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
6794 Fix some indentation also.
6795 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
6796 explaining this issue.
6797
7ecec4dd
JD
67982007-01-09 Paolo Bonzini <bonzini@gnu.org>
6799 and Joel E. Denny <jdenny@ces.clemson.edu>
6800
6801 Simplify union and prologue handling, and escape union and lex/parse
6802 params with digraphs.
6803 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
6804 values to the empty string since these are no longer guaranteed
6805 initialized by the front-end.
6806 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
6807 braces around b4_user_stype since this is no longer done by the
6808 front-end.
6809 * src/files.c, src/files.h (pre_prologue_obstack,
6810 post_prologue_obstack): Remove.
6811 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
6812 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
6813 with digraphs. This fixes lex params and parse params.
6814 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
6815 * src/output.c (prepare): Remove muscle insertion of the prologues.
6816 (output): Remove freeing of pre_prologue_obstack and
6817 post_prologue_obstack.
6818 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
6819 than prologue_augment for prologue parsing so you don't need prologue
6820 obstacks.
5c80250c
JD
6821 (grammar_declaration): For %union RHS, use `braceless' instead of
6822 "{...}" so that braces are already stripped and code is escaped with
6823 digraphs.
7ecec4dd
JD
6824 * src/reader.c (prologue_augment): Remove.
6825 (reader): Remove initialization of pre_prologue_obstack and
6826 post_prologue_obstack.
6827 * src/reader.h (prologue_augment): Remove.
6828
6829 * data/c.m4: Remove stray parenthesis.
6830
16dc6a9e
JD
68312007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6832
6833 Remove quotes from variables names in %define directives and from
6834 qualifiers in %code directives, and restrict the characters that are
6835 allowed in them to M4-friendly ones. For %define, continue to support
6836 the quoted form as a deprecated feature. Discussed starting at
6837 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
6838 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
6839 %code.
6840 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
6841 (Decl Summary): In %defines entry, update mention of `%code requires'
6842 and `%code provides'.
16dc6a9e
JD
6843 (C++ Location Values): Update %define uses.
6844 (Calc++ Parser Interface): Likewise.
6845 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 6846 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
6847 * src/parse-gram.y (prologue_declaration): For %define variables, use
6848 `variable' instead of `STRING'.
6849 (grammar_declaration): For %code qualifiers, use `ID' instead of
6850 `STRING'.
6851 (variable): New nonterminal that takes an `ID' or a `STRING'.
6852 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
6853 and %define uses.
6854 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
6855 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
6856 (%define errors): Update %define uses.
6857
e9813cd4
JD
68582007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6859
6860 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
6861 instead of muscle_insert for %define values so that M4-special
6862 characters are replaced with digraphs.
6863 * tests/input.at (%define errors): Extend to check weird values.
6864
6afc30cc
JD
68652007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6866
6867 Instead of having skeletons declare all valid %define variables and
6868 %code qualifiers, provide macros that retrieve the associated values
6869 and build these lists automatically. Thus Bison will now warn when a
6870 variable or qualifier is not used by the skeleton in the current
6871 invocation regardless of whether it might sometimes be used by that
6872 skeleton in other invocations. Also, move all %define value macros to
6873 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
6874 form, which is replaced by %code.
6875 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
6876 (b4_check_user_names): ... this, and change the series of valid name
6877 arguments to a single list argument for names used in the skeleton
6878 similar to the existing list argument for names used in the grammar.
6879 Warn instead of complaining.
6880 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
6881 values and %code code, to format %code code properly, and to build
6882 lists of all %define variables and %code qualifiers used in the
6883 skeleton: b4_skeleton_percent_define_variables and
6884 b4_skeleton_percent_code_qualifiers.
6885 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
6886 Remove, and...
6887 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
6888 the skeleton names lists can finish building first. In place of
6889 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
6890 expect the lists b4_user_percent_define_variables and
6891 b4_user_percent_code_qualifiers.
6892 * data/c++.m4: Where setting default values for b4_parser_class_name,
6893 b4_location_type, b4_filename_type, b4_namespace, and
6894 b4_define_location_comparison, update their names to the
6895 b4_percent_define_ namespace.
6896 * data/glr.c: Don't use b4_check_percent_define_variables and
6897 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6898 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
6899 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 6900 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
6901 * data/location.cc: Use b4_get_percent_define.
6902 * data/push.c: Don't use b4_check_percent_define_variables and
6903 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6904 * data/yacc.c: Likewise, and don't call m4_exit in
6905 b4_use_push_for_pull_if or m4_wrap code will never execute.
6906 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
6907 Rename to...
6908 (muscle_grow_user_name_list): ... this for consistency with the
6909 terminology used in bison.m4.
6910 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
6911 %define variable names, and rename muscle used_percent_define_variables
6912 to user_percent_define_variables.
6913 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
6914 user_percent_code_qualifiers.
6915 (content): Remove.
6916 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
6917 {CODE} form is no longer accepted.
6918 * tests/input.at (Reject bad %code qualifiers): Rename to...
6919 (Reject unused %code qualifiers): ... this, and update test output.
6920 (%define error): Update test output.
6921
7eb8a0bc
JD
69222007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
6923
6924 Check for unrecognized %define variables similar to checking for
6925 unrecognized %code qualifiers. Check for redefined %define variables.
6926 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
6927 generalizes...
6928 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
6929 (b4_check_percent_define_variables): New, also wraps it.
6930 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
6931 variables using b4_check_percent_define_variables.
6932 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
6933 all those exercised in the test suite and all those listed in the
6934 `Default values' section of c++.m4. Are there others?
6935 * data/push.c, data/yacc.c: Declare no valid %define variables.
6936 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
6937 similar to muscle_find, but it works even when the muscle stores a
6938 const value.
6939 (muscle_grow_used_name_list): New function for constructing the used
6940 name list muscles that b4_check_for_unrecognized_names requires.
6941 * src/parse-gram.y (prologue_declaration): Warn if a variable is
6942 %define'd more than once. Define the b4_used_percent_define_variables
6943 muscle with muscle_grow_used_name_list.
6944 (grammar_declaration): Abbreviate %code code with
6945 muscle_grow_used_name_list.
6946 * tests/input.at (%define errors): New.
6947
3fc65ead
JD
69482007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6949
6950 Provide warn_at, complain_at, and fatal_at function callbacks to the
6951 skeletons, and use this for %code qualifier complaints.
6952 * data/bison.m4 (b4_error_at): New, invoked by...
6953 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
6954 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
6955 @fatal_at(...@) directives.
6956 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
6957 qualifiers in b4_used_percent_code_qualifiers and to use
6958 b4_complain_at.
6959 * src/location.c, src/location.h (boundary_set_from_string): New global
6960 function.
6961 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
6962 function.
6963 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
6964 to b4_used_percent_code_qualifiers.
6965 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
6966 function.
6967 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
6968 (lineno): Rename to...
6969 (out_lineno): ... this so I don't misunderstand it again.
6970 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
6971 here; these newlines are in the input but not the output file.
6972 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
6973 (at_directive_perform): ... this new static function, and add handling
6974 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
6975 directives.
6976 * tests/input.at (Reject bad %code qualifiers): Update test output with
6977 locations and extend.
6978
6979 * tests/output.at (Output file name: [, Output file name: ]): Remove
6980 bogus comment about these tests failing.
6981
1c7b7e1d
JD
69822007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6983
6984 Clean up b4_check_percent_code_qualifiers a little.
6985 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
6986 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
6987 documentation and add examples.
6988 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
6989 qualifiers here.
6990
08af01c2
JD
69912007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6992
6993 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
6994 unreliable -- especially when they're hidden inside another macro.
6995 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
6996 data/c.m4: Remove m4_divert(-1).
6997 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6998 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
6999 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 7000 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
7001 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
7002 pushed and popped by m4sugar, should be first on the stack.
7003
7004 Provide warn, complain, and fatal function callbacks to the skeletons.
7005 This provides more flexibility than m4_fatal, improves the error
7006 message format, and captures messages for translation. Discussed
7007 starting at
7008 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
7009 * data/bison.m4 (b4_error): New, invoked by...
7010 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
7011 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
7012 directives. Because these M4 macros might be called when the current
7013 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
7014 the previous removal of uses of m4_divert, which caused trouble.
7015 (b4_check_percent_code_qualifiers): Use b4_complain instead of
7016 m4_fatal to report unrecognized %code qualifiers.
7017 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
7018 push parser requests.
7019 * data/glr.c: Use b4_complain instead of m4_fatal to report
7020 non-deterministic push parser requests.
7021 Update @output usage to @output(...@) form.
7022 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
7023 report missing %defines. Update @output usage to @output(...@) form.
7024 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
7025 @output(...@) form.
7026 * src/main.c (main): Invoke skel_scanner_free.
7027 * src/scan-skel.h (skel_scanner_free): Prototype new function.
7028 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
7029 obstack_for_string from flex-scanner.h.
7030 (YY_DECL): Use to declare skel_lex static.
7031 (decode_at_digraphs): Remove; now handled in the new
7032 SC_AT_DIRECTIVE_ARG start condition.
7033 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
7034 functions.
7035 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
7036 at_directive_argv): New static globals.
7037 (INITIAL): Use fail_for_invalid_at.
7038 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
7039 recognize the start of a generalized `@directive(...@)' form and
7040 start...
7041 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
7042 directive args (using the new obstack_for_string), to decode the
7043 contained @ diagraphs, and to perform the directive. It recognizes
7044 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
7045 @output(...@).
7046 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
7047 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
7048 `@,'.
7049 (scan_skel): Initialize obstack_for_string on the first call.
7050 (skel_scanner_free): New function to free obstack_for_string.
7051 * tests/input.at (Reject bad %code qualifiers): Update test output.
7052
8e0a5e9e
JD
70532007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
7054
7055 Consolidate the 4 prologue alternative directives (%code, %requires,
7056 %provides, and %code-top) into a single %code directive with an
7057 optional qualifier field. Discussed at
7058 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
7059 * NEWS (2.3a+): Rewrite the existing entry for the prologue
7060 alternatives.
7061 * doc/bison.texinfo (Prologue Alternatives): Update.
7062 (Decl Summary): Update to %code "requires" and %code "provides".
7063 (Calc++ Parser): Update to %code "requires".
148d66d8 7064 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
7065 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
7066 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
7067 are replaced by b4_percent_code_provides and b4_percent_code_requires,
7068 which are skeleton-specific.
7069 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
7070 declare what %code qualifiers it supports and to complain if any other
7071 qualifiers were used in the grammar.
7072 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
7073 and b4_user_code([b4_percent_code_provides]) in place of
7074 b4_user_requires and b4_user_provides.
7075 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
7076 Add b4_user_code([b4_percent_code_top]) and
7077 b4_user_code([b4_percent_code]).
7078 Invoke b4_check_percent_code_qualifiers.
7079 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7080 PERCENT_REQUIRES): Remove.
7081 (grammar_declaration): Remove RHS's for %code-top, %provides, and
7082 %requires. Rewrite the %code RHS as the unqualified form defining the
7083 muscle b4_percent_code. Add another RHS for the qualified %code form,
7084 which defines muscles of the form b4_percent_code_QUALIFIER and the
7085 b4_used_percent_code_qualifiers muscle.
7086 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7087 PERCENT_REQUIRES): Remove.
7088 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
7089 %code "requires" and %code "provides".
7090 * tests/input.at (Reject bad %code qualifiers): New.
7091
95021767
JD
70922007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7093
7094 Use the new code_props interface for destructors and printers.
7095 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
7096 printer_location members, and change the type of the destructor and
7097 printer members to code_props.
7098 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
7099 symbol_printer_get, semantic_type_destructor_set,
7100 semantic_type_printer_set, default_tagged_destructor_set,
7101 default_tagless_destructor_set, default_tagged_printer_set,
7102 default_tagless_printer_set): Use code_props in arguments and return
7103 types in place of char const * and location.
7104 (symbol_destructor_location_get, symbol_printer_location_get): Remove
7105 since the locations are now contained in the return of
7106 symbol_destructor_get and symbol_printer_get.
7107 * src/output.c (symbol_destructors_output, symbol_printers_output):
7108 Replace with...
7109 (symbol_code_props_output): ... this to eliminate duplicate code.
7110 (output_skeleton): Update to use symbol_code_props_output.
7111 * src/reader.c (symbol_should_be_used): Update use of
7112 symbol_destructor_get.
7113 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7114 Update uses of the various _destructor_set and _printer_set functions.
7115 * src/symtab.c: (default_tagged_destructor_location,
7116 default_tagless_destructor_location, default_tagged_printer_location,
7117 default_tagless_printer_location): Remove since we...
7118 (default_tagged_destructor, default_tagless_destructor,
7119 default_tagged_printer, default_tagless_printer): ... change the type
7120 of these to code_props.
7121 (symbol_new, semantic_type_new, symbol_destructor_set,
7122 semantic_type_destructor_set, symbol_destructor_get,
7123 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
7124 symbol_check_alias_consistency, default_tagged_destructor_set,
7125 default_tagless_destructor_set, default_tagged_printer_set,
7126 default_tagless_printer_set): Update.
7127 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
7128 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
7129 code_props members.
7130 (symbol_print): Use SYMBOL_CODE_PRINT.
7131
f6857bbf
JD
71322007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7133
7134 Use the new code_props interface for rule actions.
7135 * src/symlist.h (symbol_list): Replace action, action_location, and
7136 used members with a code_props action_props member.
7137 * src/reader.c (symbol_should_be_used, grammar_rule_check,
7138 grammar_midrule_action, grammar_current_rule_merge_set,
7139 grammar_current_rule_symbol_append, packgram): Update.
7140 * src/scan-code.h (translate_rule_action): Remove, no longer used.
7141 * src/scan-code.l (handle_action_dollar): Update.
7142 (translate_rule_action): Remove, no longer used.
7143 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
7144
7c0c6181
JD
71452007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7146
7147 Use the new code_props interface in parse-gram.y.
7148 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
7149 Update all uses of translate_* functions to use the new code_props
7150 interface and to use gram_scanner_last_string_free and
7151 code_scanner_last_string_free where possible.
7152 (grammar_declaration): symbol_list_destructor_set and
7153 symbol_list_printer_set now perform the translation, so don't do it
7154 here. Use gram_scanner_last_string_free where possible.
7155 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
7156 translate_code): Remove, no longer used.
7157 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
7158 symbol_list_printer_set): Perform code translation here rather than
7159 depending on the caller to do so.
7160
7161 * src/symlist.h (struct symbol_list): Correct some documentation typos.
7162 * src/scan-gram.h (gram_last_string): Remove declaration.
7163 * src/scan-gram.l (last_string): Declare it static.
7164
28e52c0d
JD
71652007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7166
7167 Encapsulate code properties and related functionality for the various
7168 destructors, printers, and actions into a code_props structure and
7169 interface. This patch merely implements code_props in scan-code.h and
7170 scan-code.l. Future patches will rewrite other modules to use it.
7171 Discussed starting at
7172 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
7173 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
7174 consistently initialize const structs that have an empty location
7175 field.
7176 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
7177 to ensure consistency.
7178 * src/scan-code.h (code_props): New structure.
7179 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
7180 function, macro, and const global variable for initializing a
7181 code_props with no code.
7182 (code_props_plain_init, code_props_symbol_action_init,
7183 code_props_rule_action_init, code_props_translate_code): The rest of
7184 the new code_props functional interface. Among other things, the init
7185 functions set the code_props kind field so that
7186 code_props_translate_code will know whether to behave like
7187 translate_symbol_action, translate_rule_action, or translate_code.
7188 These old translate functions must remain until all other modules are
7189 updated to use the new code_props interface.
7190 (code_scanner_last_string_free): New function similar to
7191 gram_scanner_last_string_free.
7192 (code_scanner_free): Add documentation.
7193 * src/scan-code.l: Implement the new interface.
7194 (code_lex): Make it static, add a code_props* argument, and remove the
7195 rule argument.
7196 (last_string): New static global similar to the one in scan-gram.l.
7197 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
7198 instead of rule.
7199 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
7200 code_props since Bison may one day use this information for destructors
7201 and printers.
7202 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
7203 (handle_action_dollar): Use symbol_list_n_get and set used flag
7204 directly since symbol_list_n_used_set is removed.
7205 (translate_action): Add a code_props* argument and remove the rule,
7206 action, and location arguments. Pass the code_props* on to code_lex.
7207 (translate_rule_action, translate_symbol_action, translate_code):
7208 Rewrite as wrappers around the new code_props interface.
7209 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
7210 it would eventually need to break the encapsulation of code_props.
7211
96034983
JD
72122007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7213
7214 * etc/.cvsignore: New.
7215
945e396c
JD
72162007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7217
7218 Add maintainer-push-check to run maintainer-check using push parsing in
7219 place of pull parsing where available.
7220 * Makefile.am (maintainer-push-check): New.
7221 * data/bison.m4 (b4_use_push_for_pull_if): New.
7222 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
7223 appropriately based on their existing values.
7224 (yypush_parse): Don't print push-parser-specific diagnostics if push
7225 parsing is being used in place of pull parsing.
7226 * data/yacc.c: If push parsing should replace pull parsing, redirect to
7227 push.c.
7228 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
7229 variable, and insert b4_use_push_for_pull_flag into muscles.
7230 * tests/Makefile.am (maintainer-push-check): New.
7231
7d596384
JD
72322006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7233
7234 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
7235 (whether successful or failed) so that yypush_parse can be invoked
7236 again to start a new parse using the same yypstate.
7237 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
7238 check multiple yypull_parse invocations on the same yypstate. For pull
7239 mode, extend to check multiple yyparse invocations.
7240 (Exploding the Stack Size with Alloca): Extend to try with
7241 %push-pull-parser.
7242 (Exploding the Stack Size with Malloc): Likewise.
7243
7244 * tests/calc.at (Simple LALR Calculator): Don't specify
7245 %skeleton "push.c" since %push-pull-parser implies that now.
7246 * tests/headers.at (export YYLTYPE): Don't check for the push
7247 declarations. Otherwise, this test case can't be used to see if push
7248 mode can truly emulate pull mode.
7249 * tests/input.at (Torturing the Scanner): Likewise.
7250 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
7251 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
7252 AT_YACC_IF, which now includes the case of push mode since %skeleton
7253 need not be used for push mode. This will be more intuitive once
7254 push.c is renamed to yacc.c.
7255
7172e23e
JD
72562006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7257
7258 For push mode, convert yyparse from a macro to a function, invoke yylex
7259 instead of passing a yylexp argument to yypull_parse, and don't
7260 generate yypull_parse or yyparse unless %push-pull-parser is declared.
7261 Discussed starting at
7262 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
7263 * data/bison.m4 (b4_pull_if): New.
7264 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
7265 * data/push.c: Improve M4 quoting a little.
7266 (b4_generate_macro_args, b4_parenthesize): Remove.
7267 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
7268 any time a pull parser is requested.
7269 Don't #define this as a wrapper around yypull_parse. Instead, when
7270 both push and pull are requested, make it a function that does that
7271 same thing.
7272 (yypull_parse): If there's a b4_prefix, #define this to
7273 b4_prefix[pull_parse] when both push and pull are requested.
7274 Don't define this as a function unless both push and pull are
7275 requested.
7276 Remove the yylexp argument and hard-code yylex invocation instead.
7277 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
7278 %push-parser.
7279 * src/getargs.c (pull_parser): New global initialized to true.
7280 * getargs.h (pull_parser): extern it.
7281 * src/output.c (prepare): Insert pull_flag muscle.
7282 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
7283 (prologue_declaration): Set both push_parser and pull_parser = true for
7284 %push-pull-parser. Set push_parser = true and pull_parser = false for
7285 %push-parser.
7286 * src/scan-gram.l: Don't accept %push_parser as an alternative to
7287 %push-parser since there's no backward-compatibility concern here.
7288 Scan %push-pull-parser.
7289 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
7290 instead of %push-parser.
7291 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
7292 prototype it in the module that calls yyparse.
7293 * tests/input.at (Torturing the Scanner): Likewise.
7294 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
7295
2e7944cb
JD
72962006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
7297
7298 Update etc/bench.pl. Optimize push mode a little (the yyn change
7299 deserves most of the credit).
7300 * Makefile.am (SUBDIRS): Add etc subdirectory.
7301 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
7302 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
7303 yytoken, yyval, and yyloc declarations to...
7304 (yyparse or yypush_parse): ... here to improve performance. For
7305 yypush_parse invocations after the first, be sure to assign yyn its old
7306 value again.
7307 (yypstate_new): Don't bother initializing the yyresult field since the
7308 initial value isn't used.
7309 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
7310 remove the #define that, in push mode, set it to yyps->NAME.
7311 * etc/Makefile.am: New.
7312 * etc/bench.pl: Remove and build it instead from...
7313 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
7314 "tests/bison" from the build directory by default rather than just
7315 invoking "bison" from $PATH.
7316 (calc_grammar): Update push parser code: don't declare yylval globally,
7317 don't define yyparse_wrapper, and don't #define yyparse.
7318 (bench_grammar): Update to check all working combinations of yacc.c,
7319 push.c, impure, pure, pull, and push.
7320
c3d50342
JD
73212006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7322
7323 For push mode, add pull wrappers around yypush_parse.
7324 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
7325 (yypull_parse): New function wrapping yypush_parse.
7326 (yyparse): New #define wrapping yypull_parse.
7327 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
7328 is declared.
7329 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
7330 prototype yylex in the module that calls yyparse, and don't prototype
7331 yyparse there. Otherwise, the yyparse expansion won't compile.
7332 * tests/input.at (Torturing the Scanner): Likewise.
7333
94ebeba5
JD
73342006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7335
7336 Enable push parsers to operate in impure mode. Thus, %push-parser no
7337 longer implies %pure-parser. The point of this change is to move
7338 towards being able to test the push parser code by running the entire
7339 test suite as if %push-parser had been declared.
7340 * data/push.c (yypush_parse): For impure mode, remove the
7341 yypushed_char, yypushed_val, and yypushed_loc arguments.
7342 Instead, declare these as local variables initialized to the global
7343 yychar, yylval, and yylloc.
7344 For the first yypush_parse invocation only, restore the initial values
7345 of these global variables when it's time to read a token since they
7346 have been overwritten.
7347 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
7348 %push-parser.
7349 * tests/calc.at (Simple LALR(1) Calculator): Always declare
7350 %pure-parser along with %push-parser since this test case was designed
7351 for pure push parsers.
7352 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
7353 (AT_YACC_OR_PUSH_IF): New.
7354 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
7355 add a note that it's still wrong for some cases (as it has been for a
7356 while).
7357 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
7358 %push-parser no longer implies %pure-parser.
7359
a0633178
JD
73602006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7361
7362 Remove some unnecessary differences between the pull parser code and
7363 the push parser code. This patch enables yynerrs in push mode.
7364 * data/push.c: Reformat M4 a little.
7365 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
7366 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
7367 because push mode is on. Instead, if pure mode is on, move yynerrs
7368 to...
7369 (b4_declare_parser_state_variables): ... here.
7370 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
7371 to yyps->NAME so it can be used in yypush_parse.
7372 (yypush_parse): Don't omit uses of yynerrs in push mode.
7373
8646b6a3
JD
73742006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7375
7376 Fix bug such that the first pushed token's value and location are
7377 sometimes overwritten (sometimes by %initial-action) before being used.
7378 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
7379 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
7380 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
7381 more closely mimic the pull parser logic.
7382 Don't copy the pushed token to yychar, yylval, and yylloc until it's
7383 time to read a token, which is after any initialization of yylval and
7384 yylloc.
7385 (gottoken): Rename label to...
7386 (yyread_pushed_token): ... for clarity and to avoid infringing on the
7387 user namespace.
7388
9baf4d74
JD
73892006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7390
7391 Rearrange initialization of the parser state variables so that the
7392 skeleton doesn't have to have a copy for pull mode and another for push
7393 mode. This patch also fixes at least a bug such that yylloc was not
7394 initialized (with b4_location_initial_line and
7395 b4_location_initial_column) upon calling yypush_parse. However, that
7396 initialization now overwrites the first token's location;
7397 %initial-action assigning @$ already did the same thing, and both bugs
7398 will be fixed in a later patch.
7399 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
7400 (b4_declare_parser_state_variables): Remove initialization of yytoken,
7401 yyss, yyvs, yyls, and yystacksize.
7402 (yypstate_new): Remove initialization of some yypstate fields: yystate,
7403 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
7404 yylsp.
7405 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
7406 yyps->NAME so it can be used in yypush_parse.
7407 (yyparse or yypush_parse): For yypush_parse, don't print the
7408 "Starting parse" diagnostic for invocations after the first.
7409 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
7410 yypush_parse, only do it for the first invocation.
7411 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
7412 initialization to occur in yypush_parse but only on the first
7413 invocation.
7414
23522164
JD
74152006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7416
7417 * data/push.c: Add CPP guards around push parser declarations in both
7418 the header and the code file.
7419 In the code file, move the push parser declarations to the same place
7420 they appear in the header file.
7421 Clean up the M4 some, especially the inconsistent underquoting in
7422 some b4_c_function_def and b4_c_function_decl uses.
7423
bb010fe5
JD
74242006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7425
7426 Encapsulate the push parser state variables into an M4 macro so the
7427 push skeleton doesn't have to list them again for pull mode's yyparse.
7428 For push mode, remove yypush_parse's local equivalents of these
7429 variables to eliminate unnecessary copying between the two sets at
7430 run-time. This patch also fixes at least a bug related to multiple
7431 %initial-action invocations in push mode.
7432 * data/push.c (b4_declare_parser_variables): Rename to...
7433 (b4_declare_scanner_communication_variables): ... this for clarity and
7434 update both uses.
7435 (b4_declare_yyparse_variables): Remove and move its contents to the one
7436 spot where it was invoked.
7437 (b4_declare_parser_state_variables): New macro containing the parser
7438 state variables required by push mode.
7439 (struct yypstate): Replace all fields but yynew with
7440 b4_declare_parser_state_variables.
7441 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
7442 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
7443 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
7444 (yyparse or yypush_parse): For yyparse in pull mode, replace local
7445 parser state variable declarations with
7446 b4_declare_parser_state_variables.
7447 Don't initialize parser state variables when calling yypush_parse since
7448 yypstate_new already does that.
7449 Invoke the user's initial action only upon the first yypush_parse
7450 invocation.
7451 Remove all code that copies between the local parser state variables
7452 and the yypstate.
7453
2d212f8c
JD
74542006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7455
7456 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
7457 prevent a name collision in a future patch where these names will
7458 sometimes be #define'd.
7459 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
7460 since it no longer has the same name as the existing argument.
7461 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
7462
e6e704dc
JD
74632006-12-19 Paolo Bonzini <bonzini@gnu.org>
7464 and Joel E. Denny <jdenny@ces.clemson.edu>
7465
7466 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
7467 that the argument is case-insensitive, and there's no `=' here.
7468 For the %skeleton entry, mention that %language is better.
7469 (Bison Options): Likewise for --language and --skeleton. Move the
7470 --skeleton entry so that the `Tuning the parser' section is sorted
7471 alphabetically on long options.
7472 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
7473 %language directive in detail here; cross-reference the %language
7474 documentation instead.
7475 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
7476 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 7477 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
7478 * examples/extexi (normalize): Instead of replacing every %require
7479 argument with the current Bison version, just substitute for
7480 `@value{VERSION}'. This guarantees that we're testing what actually
7481 appears in the documentation.
7482 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
7483 rather than `@VERSION@'.
7484
0e021770
PE
74852006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7486
fd575f05
PE
7487 * NEWS: Reword the %language news a bit, and put it earlier.
7488
0e021770
PE
7489 * src/getargs.c (skeleton_arg): Last arg is now location const *.
7490 Rewrite to simplify the logic.
7491 (language_argmatch): Likewise.
fd575f05
PE
7492 (program_name): We now own this var.
7493 * src/getargs.h (struct bison_language): Use char[] rather than
7494 const char *.
0e021770
PE
7495
7496 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
7497 Java is supported.
7498 * src/complain.c (program_name): Remove decl; no longer needed.
7499 * src/main.c (program_name): Remove; now belongs to getargs.
7500
75012006-12-18 Paolo Bonzini <bonzini@gnu.org>
7502
7503 * NEWS: Document %language.
7504
7505 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
7506
7507 * data/c-skel.m4, data/c++-skel.m4: New files.
7508 * data/glr.c: Complain on push parsers.
7509
7510 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
7511 over %skeleton.
148d66d8 7512 (Decl Summary): Document %language and %skeleton.
0e021770
PE
7513 (Command line): Document -L.
7514
7515 * examples/extexi: Rewrite %require directive.
7516 * examples/calc++/Makefile.am: Pass VERSION to extexi.
7517
7518 * src/files.c (compute_exts_from_gc): Look in language structure
7519 for .y extension.
7520 (compute_file_name_parts): Check whether .tab should be added.
7521 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
7522 (language, skeleton_arg, language_argmatch): New.
7523 (long_options): Add --language.
7524 (getargs): Use skeleton_arg, add -L/--language.
7525 * src/getargs.h: Include location.h.
7526 (struct bison_language, language, skeleton_arg, language_argmatch): New.
7527 * src/output.c (prepare): Pick default skeleton from struct language.
7528 Don't dispatch C skeletons here.
7529 * src/parse-gram.y (PERCENT_LANGUAGE): New.
7530 (prologue_declaration): Add "%language" rule, use skeleton_arg.
7531 * src/scan-gram.l ("%language"): New rule.
7532
7533 * tests/calc.at: Test %skeleton and %language.
7534 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
7535 (AT_GLR_IF): Look for %skeleton "glr.cc".
7536 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
7537 (AT_YACC_IF): Reject %language.
7538
5691bf57
PE
75392006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7540
db06f0ce
PE
7541 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
7542 since it wasn't used; only the typedef name 'semantic_type' is needed.
7543 Also, omit trailing white space.
7544
5691bf57
PE
7545 * bootstrap: Sync from coreutils.
7546 (gnulib_extra_files): Add build-aux/announce.gen.
7547 (slurp): Adjust .gitignore files like .cvsignore files.
7548 * build-aux/announce-gen: Remove from CVS, since bootstrap
7549 now creates this.
7550
791934e4
JD
75512006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
7552
7553 Make %push-parser imply %pure-parser. This fixes several bugs; see
7554 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
7555 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
7556 pure_parser = true.
7557 * data/push.c: Don't bother testing b4_push_if when deciding whether
7558 to expand b4_declare_parser_variables globally.
7559 (yypush_parse): Likewise in here.
7560
7561 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
7562 (yy_reduce_print): Reformat M4 for readability.
7563
ee5abb37
JD
75642006-12-15 Bob Rossi <bob@brasko.net>
7565 and Joel Denny <jdenny@ces.clemson.edu>
7566
7567 * data/push.c (yypstate): Add typedef, and update all uses of
7568 struct yypstate to just yypstate.
7569 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
7570
16ca01f9
JD
75712006-12-14 Bob Rossi <bob@brasko.net>
7572
7573 * data/push.c (yypush_parse): Declare prototype regardless of
7574 %locations option.
7575
ab8e7e1a
JD
75762006-12-14 Bob Rossi <bob@brasko.net>
7577
7578 * data/push.c (yyparse): Remove the prototype and the #define when in
7579 push-parser mode.
7580
9bf32be3
JD
75812006-12-13 Bob Rossi <bob@brasko.net>
7582
7583 * data/push.c (yypstate_init): Rename to...
7584 (yypstate_new): ... this and use b4_c_function_def.
7585 (yypstate_delete): New.
7586 (yypush_parse): Change parameters yynval and yynlloc to be const.
7587 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
7588 yypstate_delete functions.
7589
f02e2948
JD
75902006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
7591
7592 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
7593 strange test case titles. Reported by Bob Rossi.
7594
38eb7751
PE
75952006-12-13 Paul Eggert <eggert@cs.ucla.edu>
7596
7597 * TODO: Add pointer to Sylvain Schmitz's work on static detection
7598 of potential ambiguities in GLR grammers.
7599
bd9d212b
JD
76002006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
7601
7602 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
7603 `bison ', use m4_index instead of m4_substr since chopping up a string
7604 containing M4-special characters causes problems here.
7605
7606 Fix a couple of bugs related to special characters in user-specified
7607 file names, and make it easier for skeletons to compute output file
7608 names with the same file name prefix as Bison-computed output file
7609 names.
7610 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
7611 b4_parser_file_name and b4_spec_defines_file instead of
7612 @output_parser_name@ and @output_header_name@, which are now redundant.
7613 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
7614 b4_parser_file_name, b4_spec_defines_file, and the new
7615 @basename(FILENAME@) instead of @output_parser_name@ and
7616 @output_header_name@, which inappropriately escaped the file names as
7617 C string literals.
7618 * src/files.c (all_but_ext): Remove static qualifier.
7619 (compute_output_file_names): Move `free (all_but_ext)' to...
7620 (output_file_names_free): ... here since all_but_ext is needed later.
7621 * src/files.h (all_but_ext): Extern.
7622 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
7623 exactly what MUSCLE_INSERT_STRING used to do.
7624 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
7625 characters are escaped properly.
7626 * src/output.c (prepare): Define muscle file_name_all_but_ext as
7627 all_but_ext.
7628 For pkgdatadir muscle, maintain previous functionality by using
7629 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
7630 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
7631 digraphs would never be expanded. Hopefully no one has M4-special
7632 characters in his Bison installation path.
7633 * src/scan-skel.l: Don't parse @output_header_name@ and
7634 @output_parser_name@ anymore since they're now redundant.
7635 In @output, use decode_at_digraphs.
7636 Parse a new @basename command that invokes last_component.
7637 (decode_at_digraphs): New.
7638 (BASE_QPUTS): Remove unused.
7639 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
7640 (Output file name): New tests.
7641
3f7ca628
JD
76422006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
7643
7644 Warn about output files that are generated by the skeletons and that
7645 conflict with other output files.
7646 * data/glr.c: Don't generate the header file here when glr.cc does.
7647 * src/files.c (file_names, file_names_count): New static globals.
7648 (compute_output_file_names): Invoke output_file_name_check for files
7649 not generated by the skeletons and remove existing checks.
7650 (output_file_name_check): New function that warns about conflicting
7651 output file names.
7652 (output_file_names_free): Free file_names.
7653 * src/files.h (output_file_name_check): Declare.
7654 * src/scan-skel.l: Invoke output_file_name_check for files generated by
7655 the skeletons.
7656 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
7657 (Conflicting output files): New tests.
7658
178e123e
PE
76592006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7660
7661 * doc/bison.texinfo: Fix a couple of typos.
7662
76632006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
7664
7665 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
7666 Rename to...
7667 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
7668 update all uses.
7669 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
7670 (yypush_parse): Rename yypvars argument to yyps and remove redundant
7671 local pv.
7672 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
7673 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
7674
ea17f233
JD
76752006-12-07 Bob Rossi <bob@brasko.net>
7676 and Joel Denny <jdenny@ces.clemson.edu>
7677
7678 * data/push.c (yypvarsinit): Change return type from void* to struct
7679 yypvars*. No longer cast to void* on return.
7680 (struct yypvars): Remove yylen since it need not be remembered between
7681 yypushparse invocations.
7682 (yypushparse): Don't copy between yylen and pv->yylen.
7683
55a30bda
JD
76842006-12-05 Bob Rossi <bob@brasko.net>
7685
7686 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
7687 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
7688 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
7689 (struct yypvars): Remove b4_declare_parser_variables.
7690 (yypvarsinit): Remove init code for removed variables.
7691 (global scope): Do not declare b4_declare_parser_variables if
7692 push or pure mode.
7693 (yypushparse): Add b4_declare_parser_variables.
7694 Init new local variables, and remove init code for removed
7695 yypvars variables.
7696 (yyparse): Delete.
7697 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
7698 and yyparse for other modes.
7699 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
7700 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
7701 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
7702 (AT_PURE_LEX_IF): True if pure or push parser.
7703
85894313
JD
77042006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
7705
7706 Document Yacc prologue alternatives and default %destructor's and
7707 %printer's as experimental. Don't mention Java yet. Discussed at
7708 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
7709 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
7710 (2.3a): Annotate this entry to say the old forms of these features were
7711 also experimental.
7712 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 7713 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
7714 of Java (we'll want this back eventually).
7715
02975b9a
JD
77162006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
7717
7718 Support a file name argument to %defines. Deprecate `=' in
7719 %file-prefix, %name-prefix, and %output. Discussed at
7720 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
7721 * NEWS (2.3a+): Mention.
148d66d8 7722 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
7723 form of %defines, and remove `=' from entries for %file-prefix,
7724 %name-prefix, and %output.
7725 * src/parse-gram.y (prologue_declaration): Implement.
7726 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
7727 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
7728 all but one occurrence of %name-prefix.
7729 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
7730 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
7731 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
7732 occurrence of each of %file-prefix and %output. Add check for %defines
7733 with argument.
7734 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
7735 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
7736 Remove the `=' from %output.
7737
287b314e
JD
77382006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
7739
7740 Don't escape $ in test case titles since Autoconf 2.61 now does that
7741 correctly.
7742 * tests/actions.at (Default %printer and %destructor are not for error
7743 or $undefined): Here.
7744 (Default %printer and %destructor are not for $accept): Here.
7745 * tests/input.at (Invalid $n and @n): Here.
7746
3ebecc24
JD
77472006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
7748
7749 Rename <!> to <>. Discussed starting at
7750 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
7751 * NEWS (2.3a+): Update.
148d66d8 7752 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
7753 Update.
7754 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
7755 * src/scan-gram.l (INITIAL): Implement.
7756 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
7757 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
7758 comment.
7759 * tests/actions.at (Default tagless %printer and %destructor,
7760 Default tagged and per-type %printer and %destructor,
7761 Default %printer and %destructor are not for error or $undefined,
7762 Default %printer and %destructor are not for $accept,
7763 Default %printer and %destructor for mid-rule values): Update.
7764 * tests/input.at (Default %printer and %destructor redeclared,
7765 Unused values with default %destructor): Update.
7766
26b8a438
JD
77672006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
7768
7769 Don't let %prec take a nonterminal.
7770 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
7771 token.
7772 * tests/input.at (%prec takes a token): New test checking that %prec
7773 won't take a nonterminal.
7774
07c39ae9
JD
77752006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7776
405d53b7
JD
7777 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
7778 it was double-quoted.
07c39ae9
JD
7779 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
7780 grammar is maintained with Bison's highest standards.
7781 * src/getargs.c: Fix some typos in Doxygen comments.
7782
580b8926
JD
77832006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7784
7785 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
7786 later. Reported by Paul Eggert in
7787 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
7788 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
7789 * src/scan-code.l (translate_action): Don't bother invoking
7790 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
7791 (code_scanner_free): Instead of invoking
7792 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
7793 which frees more.
7794 * src/scan-gram.l (gram_scanner_free): Likewise.
7795 * src/scan-skel.l (scan_skel): Likewise.
7796
4502eadc
JD
77972006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
7798
7799 * src/files.c (tr): Change return type to void.
7800 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
7801 has been called previously for the same key.
7802 (muscle_find): Return storage instead of value so that
7803 --enable-gcc-warnings doesn't produce warnings that the return discards
7804 const. aver that the value and storage are the same since storage
7805 could potentially be NULL when value is not.
7806 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
7807 same as 0.
7808
7746c8f6
PE
78092006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7810
7811 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
7812 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
7813 us a slightly cleaner distribution, and also works.
7814 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
7815 gnulib changes.
7816
eb095650
PE
78172006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
7818 and Paul Eggert <eggert@cs.ucla.edu>
7819
7820 Don't let Bison leak memory except when it complains.
7821 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
7822 (spec_defines_file, dir_prefix): Now char *, not const char *,
7823 since they are freed.
7824 * src/files.c: Likewise.
7825 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
7826 Likewise.
7827 (tr): Now operates in-place. All uses changed.
7828 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
7829 values.
7830 (compute_file_name_parts, compute_output_file_names): Don't store
7831 read-only data in variables that will be freed.
7832 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
7833 src_extension, and header_extension.
7834 (output_file_names_free): New public function to free
7835 spec_verbose_file, spec_graph_file, spec_defines_file,
7836 parser_file_name, and dir_prefix.
7837 * src/getargs.c (getargs): Don't store read-only data in variables that
7838 will be freed.
7839 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
7840 (which previously existed but was unused), and quotearg_free.
7841 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
7842 * src/muscle_tab.c: Likewise.
7843 (muscle_entry): Make the value char const *,
7844 and add a new storage member that is char * and can be freed.
7845 (muscle_entry_free): New private function.
7846 (muscle_init): Use it instead of free.
7847 (muscle_insert, muscle_grow): Update and use new storage member.
7848 (muscle_code_grow): Free the string passed to muscle_grow
7849 since it's not needed anymore.
7850 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
7851 add a new `char *code' member.
7852 ("{...}"): Declare semantic type as code.
7853 * src/scan-code.h (translate_rule_action):
7854 (translate_symbol_action, translate_code, translate_action): Return
7855 `char const *' rather than `char *' since external code should not free
7856 these strings.
7857 * src/scan-code.l: Likewise.
7858 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
7859 which is "{...}" in the parser.
7860 * tests/Makefile.am (maintainer-check-valgrind): Set
7861 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
7862 Valgrind.
7863 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
7864 complain.
7865 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
7866 expecting a non-zero exit status sets --leak-check=summary and
7867 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
7868 this case, and we don't want to hear about it.
7869
ac564be4
PE
78702006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7871
7872 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
7873 instead of from the template, to simplify configuration a bit.
7874 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
7875 and m4/wint_t.m4, as they are needed with the latest gnulib.
7876
17bd8a73
JD
78772006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7878
7879 Disable unset/unused mid-rule value warnings by default, and recognize
7880 --warnings=midrule-values to enable them. Discussed starting at
7881 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
7882 * NEWS (2.3a+): Mention.
7883 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
7884 warnings): Add entry for midrule-values subargument.
7885 * src/reader.c (symbol_should_be_used): Don't return true just because
7886 the value is a set/used mid-rule value unless
7887 --warnings=midrule-values was specified.
7888 * tests/input.at (Unused values, Unused values before symbol
7889 declarations): Run tests with and without --warnings=midrule-values.
7890
7891 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
7892 than LIST_FREE directly.
7893
89eb3c76
JD
78942006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7895
7896 Finish implementing --warnings=error, which should not be implied by
7897 --warnings=all (or by its synonyms -W and --warnings without
7898 subarguments).
7899 * src/complain.c (set_warning_issued): New function to report that
7900 warnings are being treated as errors and to record an error if so.
7901 Invoke...
7902 (warn_at, warn): ... here.
7903 * src/getargs.c (warnings_args, warnings_types): Reorder so that
7904 "error - warnings are errors" does not appear above "all - all of the
7905 above".
7906 (getargs): For -W and --warnings without subarguments, don't let
7907 FLAGS_ARGMATCH set warnings_error in warnings_flag.
7908 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
7909
ba7560e2
JD
79102006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7911
7912 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
7913 empty subargument list. For example: `bison --warnings= parser.y'.
7914
31283fc3
JD
79152006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7916
7917 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
7918 the parser header file so that gcc doesn't warn.
7919
12e35840
JD
79202006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7921
7922 Split the default %destructor/%printer into two kinds: <*> and <!>.
7923 Discussed starting at
7924 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
7925 * NEWS (2.3a+): Mention.
7926 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
7927 previous change today related to mid-rules.
148d66d8 7928 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 7929 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
7930 (TYPE_TAG_ANY): Add as <*>.
7931 (TYPE_TAG_NONE): Add as <!>.
7932 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
7933 for <*> and <!>.
7934 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
7935 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
7936 * src/symlist.c (symbol_list_default_new): Split into tagged and
7937 tagless versions.
7938 (symbol_list_destructor_set, symbol_list_printer_set): Split
7939 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
7940 SYMLIST_DEFAULT_TAGLESS.
7941 * src/symlist.h: Update symbol_list_default*_new prototypes.
7942 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
7943 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
7944 * src/symtab.c (default_destructor, default_destructor_location,
7945 default_printer, default_printer_location): Split each into tagged and
7946 tagless versions.
7947 (symbol_destructor_get, symbol_destructor_location_get,
7948 symbol_printer_get, symbol_printer_location_get): Implement tagged
7949 default and tagless default cases.
7950 (default_destructor_set, default_printer_set): Split each into tagged
7951 and tagless versions.
7952 * src/symtab.h: Update prototypes.
7953 * tests/actions.at (Default %printer and %destructor): Rename to...
7954 (Default tagless %printer and %destructor): ... this, and extend.
7955 (Per-type %printer and %destructor): Rename to...
7956 (Default tagged and per-type %printer and %destructor): ... this, and
7957 extend.
7958 (Default %printer and %destructor for user-defined end token): Extend.
7959 (Default %printer and %destructor are not for error or $undefined):
7960 Update.
7961 (Default %printer and %destructor are not for $accept): Update.
7962 (Default %printer and %destructor for mid-rule values): Extend.
7963 * tests/input.at (Default %printer and %destructor redeclared): Extend.
7964 (Unused values with default %destructor): Extend.
7965
f91b1629
JD
79662006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7967
7968 Don't apply the default %destructor/%printer to an unreferenced midrule
7969 value. Mentioned at
7970 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
7971 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
7972 like $@n instead of just @n so that the default %destructor/%printer
7973 logic doesn't see them as user-defined symbols.
7974 (symbol_is_dummy): Check for both forms of the name.
7975 * src/reader.c (packgram): Remove the `$' from each midrule symbol
7976 name for which the midrule value is referenced in any action.
7977 * tests/actions.at (Default %printer and %destructor for mid-rule
7978 values): New test.
7979 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
7980 for change to dummy symbol names.
7981
519d0004
JD
79822006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7983
7984 Warn about unset midrule $$ if the corresponding $n is used.
7985 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
7986 $n usage.
7987 (packgram): Before invoking grammar_rule_check on any rule, make sure
7988 all actions have already been scanned in order to set `used' flags.
7989 Otherwise, checking that a midrule's $$ is set will not always work
7990 properly because the midrule check must forward-reference the midrule's
7991 parent rule.
7992 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
7993 warning.
7994
a501eca9
JD
79952006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7996
7997 More improvements to the documentation of the prologue alternatives:
7998 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
7999 Bison manual.
8000 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
8001 some text to clarify the relative importance of the new directives and
8002 to show how these directives may be viewed as code labels.
8003
2cbe6b7f
JD
80042006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
8005
8006 Similar to the recently removed %before-header, add %code-top as the
8007 alternative to the pre-prologue. Mentioned at
8008 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
8009 Also, let the prologue alternatives appear in the grammar section.
8010 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
8011 (prologue_declaration): Move the existing prologue alternatives to...
8012 (grammar_declaration): ... here and add %code-top.
8013 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
8014
8015 Clean up and extend documentation for the prologue alternatives.
8016 * NEWS (2.3a+): Describe prologue alternatives.
8017 * doc/bison.texinfo (Prologue): Move discussion of prologue
8018 alternatives to...
8019 (Prologue Alternatives): ... this new section, and extend it to discuss
8020 all 4 directives in detail.
148d66d8
JD
8021 (Table of Symbols): Clean up discussion of prologue alternatives and
8022 add %code-top.
2cbe6b7f 8023
e557d3ea
JMG
80242006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8025
8026 DJGPP specific issues.
8027
8028 * djgpp/config.bat: config.hin has been moved to lib. Adjust
8029 config.bat accordingly.
8030 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
8031 * djgpp/config.site: Likewise.
8032
136a0f76
PB
80332006-10-16 Paolo Bonzini <bonzini@gnu.org>
8034
27bd5d67
PB
8035 Replace %*-header with %provides, %requires, %code. See discussion at
8036 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
8037
136a0f76
PB
8038 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
8039 (b4_user_start_header): Remove.
8040 * data/glr.c: Use new macros instead of b4_*start_header
8041 and b4_*end_header.
8042 * data/glr.cc: Likewise.
8043 * data/lalr1.cc: Likewise.
8044 * data/push.c: Likewise.
8045 * data/yacc.c: Likewise.
8046
8047 * doc/bison.texinfo: Remove %before-header, rename
8048 %{start,end,after}-header to %requires, %provides, %code.
8049
8050 * src/parse-gram.y: Likewise (also rename token names accordingly).
8051 * src/scan-gram.l: Likewise.
8052 * tests/actions.at: Likewise.
8053
10f429ef
PE
80542006-10-14 Paul Eggert <eggert@cs.ucla.edu>
8055
8056 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
8057 Problem reported by Joel E. Denny.
8058
80592006-10-14 Jim Meyering <jim@meyering.net>
8060
8061 (Sync from coreutils.)
8062 Work also when the working directory (with e.g. coreutils sources)
8063 is version controlled with git, rather than CVS.
8064 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
8065 rather than CVS.
8066 In messages and comments, say e.g., "checked-out sources",
8067 rather than "CVS sources".
8068 (version_controlled_file): New function. Work for git as well as
8069 for CVS. Don't use grep's -q option.
8070 (slurp): Call it here, in place of CVS-specific code.
8071
c4bd5bf7
JD
80722006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
8073
8074 Fix testsuite for ./configure --enable-gcc-warnings:
8075 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
8076 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
8077 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
8078 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
8079 * test/regression.at (Diagnostic that expects two alternatives):
8080 Likewise.
8081
46356ea4
PE
80822006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8083
231ed89a
PE
8084 * bootstrap.conf (gnulib_modules): Add config-h.
8085 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
8086 worry about HAVE_CONFIG_H.
8087 * lib/abitset.c: Likewise.
8088 * lib/bitset.c: Likewise.
8089 * lib/bitset_stats.c: Likewise.
8090 * lib/bitsetv-print.c: Likewise.
8091 * lib/bitsetv.c: Likewise.
8092 * lib/ebitset.c: Likewise.
8093 * lib/get-errno.c: Likewise.
8094 * lib/lbitset.c: Likewise.
8095 * lib/subpipe.c: Likewise.
8096 * lib/timevar.c: Likewise.
8097 * lib/vbitset.c: Likewise.
8098 * lib/bitset.c: Include "bitset.h" first, to test interface.
8099 * lib/bitset_stats.c: Include "bitset_stats.h" first.
8100 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
8101 * lib/bitsetv.c: Include "bitsetv.h" first.
8102 * lib/get-errno.c: Include "get-errno.h" first.
8103 * m4/.cvsignore: Add config-h.m4.
8104 * tests/actions.at (Default %printer and %destructor for ...):
8105 Adjust expected line numbers in output to reflect removal of #if
8106 HAVE_CONFIG_H lines.
8107 * tests/glr-regression.at (Missed %merge type warnings when ...):
8108 Likewise.
8109 * tests/regression.at (Braced code in declaration in rules section):
8110 Likewise.
8111 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
8112 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
8113 Include <config.h> unconditionally.
8114
46356ea4
PE
8115 * bootstrap: Sync from coreutils, as follows:
8116
8117 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8118
8119 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
8120 variable was sometimes used without being initialized. This
8121 messed up the installation of the INSTALL file in some cases.
8122
8123 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8124
8125 * bootstrap (usage, main program, symlink_to_gnulib): Add option
8126 --copy. Inspired by a suggestion from Bruno Haible.
8127
8128 2006-10-03 Jim Meyering <jim@meyering.net>
8129
8130 * bootstrap: Undo last change to this file, since now gnulib-tool
8131 sticks with the automake default in generating dependencies.
8132
dd4bf078
PE
81332006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8134
cf2a5f7c
PE
8135 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
8136 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
8137
8138 * doc/bison.1: Add copyright notice.
8139
8140 * data/glr.c: Don't include <stdarg.h>; not used.
8141
35fe0834
PE
8142 * NEWS: The -g and --graph options now output graphs in Graphviz
8143 DOT format, not VCG format.
8144 * doc/bison.1: Likewise.
8145 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
8146 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
8147 of this change in
8148 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
8149 * TODO: Remove Graphviz entry.
8150 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
8151 remove vcg.c, vcg.h, vcg_defaults.h.
8152 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
8153 * src/graphviz.c, src/graphviz.h: New files.
8154 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
8155 * src/files.h: Make comment more generic.
8156 * src/main.c (main): Likewise.
8157 * src/print_graph.h: Likewise.
8158 * src/getargs.c (usage): Make usage description more generic.
8159 * src/print_graph.c: Include graphviz.h rather than vcg.h.
8160 (static_graph, fgraph): Remove. All uses changed to pass
8161 arguments instead of sharing a static var.
8162 (print_core, print_actions, print_state, print_graph):
8163 Output graphviz format rather than VCG format.
8164 * tests/.cvsignore: Remove *.vcg; add *.dot.
8165 * tests/output.at: Expect *.dot files, not *.vcg files.
8166
dd4bf078
PE
8167 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
8168 accommodates the 2006-10-08 change.
8169
efdd7421
PE
81702006-10-11 Bob Rossi <bob@brasko.net>
8171
8172 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
8173 (b4_yyssa, b4_yyerror_range): New macros.
8174 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
8175 (yypvarsinit): Remove init of removed fields.
8176 (yypushparse): Remove use of removed fields; use new macros instead.
8177
96a1981a
PE
81782006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8179
8180 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
8181 in a push parser. Reindent slightly to match yacc.c better.
8182
81832006-10-11 Bob Rossi <bob@brasko.net>
8184
46356ea4
PE
8185 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
8186 yymsg_alloc fields.
8187 (yypvarsinit, yypushparse): Remove init of removed fields.
8188 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 8189
c1630a8b
PE
81902006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8191
8192 * THANKS: Add Paolo Bonzini and Bob Rossi.
8193
90b9908d
PB
81942006-10-08 Paolo Bonzini <bonzini@gnu.org>
8195
8196 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
8197 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
8198 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
8199 b4_define_user_cde and uses): Remove.
8200 (b4_comment, b4_prefix, b4_sync_start): New.
8201 * data/bison.m4: New file, with most of the content removed from c.m4.
8202 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
8203 * src/output.c (output_skeleton): Pass bison.m4.
8204 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
8205 only if specified.
8206
cf806753
PE
82072006-10-05 Paul Eggert <eggert@cs.ucla.edu>
8208
8209 Fix test failure reported by Tom Lane in
8210 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
8211 and try to make such failures easier to catch in the future.
8212 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
8213 that's now the caller's responsibility.
8214 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
8215 Set yychar = YYEOF if it's negative.
8216 * tests/actions.at (yylex): Abort if asked to read past EOF.
8217 * tests/conflicts.at (yylex): Likewise.
8218 * tests/cxx-type.at (yylex): Likewise.
8219 * tests/glr-regression.at (yylex): Likewise.
8220 * tests/input.at (yylex): Likewise.
8221 * tests/regression.at (yylex): Likewise.
8222 * tests/torture.at (yylex): Likewise.
8223
0e2f006a
PE
82242006-10-01 Paul Eggert <eggert@cs.ucla.edu>
8225
8226 Fix problems with translating English-language diagnostics.
8227 * bootstrap: Fix bug introduced in recent bootstrap changes, with
8228 respect to bison-runtime pot generation. The YY_ stuff
8229 wasn't being captured.
8230 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
8231 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
8232 * runtime-po/POTFILES.in: Add data/push.c.
8233
e3ddc1e3
PE
82342006-09-29 Paul Eggert <eggert@cs.ucla.edu>
8235
8236 Merge bootstrap changes from coreutils.
8237
8238 2006-09-28 Jim Meyering <jim@meyering.net>
8239
8240 Automatically generated dependencies are important even
8241 when all of the sources in a directory come from gnulib.
8242 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
8243 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
8244
8245 2006-09-23 Jim Meyering <jim@meyering.net>
8246
8247 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
8248
8249 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8250
8251 * bootstrap: Add support for --force.
8252 (usage): New function. Describe usage less tersely.
8253 (CVS_only_file): New var.
8254
01e972b3
PE
82552006-09-21 Paul Eggert <eggert@cs.ucla.edu>
8256
8257 * data/push.c (YYPUSH_MORE): Make it an enum instead.
8258 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
8259 Adjust white space and comments to match GNU style better.
8260
c63d3e90
PE
82612006-09-20 Bob Rossi <bob@brasko.net>
8262
8263 * data/push.c (yyresult_get): Remove function.
8264 (YYPUSH_MORE): Add #define.
8265 (yypushparse): Modify return value.
8266
e70f46d1
PE
82672006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8268
8269 * stamp-h.in: Remove; no longer needed.
8270 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
8271 Remove config.h, config.hin, intl (no longer created).
8272 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
8273 stamp-h1.
8274
8275 Sync bootstrap from coreutils, as follows:
8276
8277 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
8278
8279 * bootstrap (symlink_to_gnulib): New function.
8280 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
8281 to copies-of-gnulib.
8282 (cp_mark_as_generated, slurp, gnulib_files):
8283 Avoid making a copy if it's the same as the old version.
8284 (gnulib_files): Add support for this variable (used by Bison).
8285
a92be413
PE
82862006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8287
8288 * src/getargs.c (usage): Rework to use conventions similar to
8289 coreutils, to make translation a bit easier and the code a bit
8290 smaller. Problem reported by Tim Van Holder.
8291
4f82b42a
PE
82922006-09-15 Paul Eggert <eggert@cs.ucla.edu>
8293
3b2942e6
PE
8294 Use some of gnulib's new modules, taken from coreutils.
8295
8296 * bootstrap: Sync from coreutils, except add support for gnulib_files.
8297 * bootstrap.conf: New file.
8298 (gnulib_modules): Add configmake, inttypes, unistd.
8299 (XGETTEXT_OPTIONS): Add complain, complain_at,
8300 fatal, fatal_at, warn, warn_at, unexpected_end.
8301 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
8302 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
8303 (gl_EARLY): Add.
8304 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
8305 (gl_INIT): Add
8306 (GNULIB_AUTOCONF_SNIPPET): Remove.
8307 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
8308 the pickiest.
8309 * lib/.cvsignore: Add inttypes_.h.
8310 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
8311 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
8312 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
8313 no-longer-necessary initializations.
8314 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
8315 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
8316 use the unistd module.
8317 * src/system.h: Likewise.
8318 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
8319 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
8320 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
8321 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
8322 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
8323 * src/system.h: Include inttypes.h unconditionally, now that we
8324 use the inttypes module. Don't bother to include stdint.h, since
8325 inttypes.h now does that for us.
8326 (LOCALEDIR): Remove, now that we use the configmake module.
8327 * src/getargs.c: Include configmake.h.
8328 * src/main.c: Likewise.
8329 * src/output.c: Likewise.
8330 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
8331 not from $abs_top_builddir, since config.h moved.
8332
8333
4f82b42a
PE
8334 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
8335 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
8336
8337 * src/parse-gram.y (symbol_declaration): Don't put statements
8338 before declarations; it's not portable to C89.
8339 * src/scan-code.l (handle_action_at): Likewise.
8340
8341 * src/scan-code.l: Always initialize braces_level; the old code
8342 left it uninitialized and therefore had undefined behavior.
8343
8344 Don't attempt to redefine 'assert', since it runs afoul of
8345 systems where standard headers (mistakenly) include <assert.h>.
8346 Instead, define and use our own alternative, called 'aver'.
8347 * src/reader.c: Don't include assert.h, since we no longer
8348 use assert.
8349 * src/scan-code.l: Likewise.
8350 * src/system.h (assert): Remove, replacing with....
8351 (aver): New function, taking a bool arg. All uses changed.
8352 * src/tables.c (pack_vector): Ensure that aver arg is bool,
8353 not merely an integer.
8354
31c10e38
PE
83552006-09-15 Bob Rossi <bob@brasko.net>
8356
d6bdb90a
JD
8357 Add support for push parsing. Based on the original work of
8358 Odd Arild Olsen <oao@fibula.no>.
31c10e38
PE
8359 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
8360 * data/c.m4 (YYPUSH): New.
8361 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
d6bdb90a 8362 * data/push.c: New file.
31c10e38
PE
8363 * src/getargs.c (push_parser): New var.
8364 * src/getargs.h (push_parser): New declaration.
8365 * src/output.c (prepare): Add macro insertion of `push_flag'.
8366 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
8367 (prologue_declaration): Parse %push-parser.
8368 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
8369 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
8370 list of removed lines from the traces observed.
8371 (AT_CHECK_CALC_LALR): Added push parser tests.
8372
fa7b79c0
PE
83732006-09-13 Paul Eggert <eggert@cs.ucla.edu>
8374
21fe08ca
PE
8375 * NEWS: Version 2.3a.
8376 * configure.ac (AC_INIT): Likewise.
8377
e8ec4d9b
PE
8378 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
8379 "#define YYSTYPE int" that caused "make maintainer-check" to fail
8380 due to header ordering dependencies. I don't know why the #define
8381 was there.
8382
fa7b79c0
PE
8383 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
8384 runtime cost when YYDEBUG is not defined, and so that some tests
8385 that used to fail now work. Problem and initial suggestion by
8386 Paolo Bonzini.
8387 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
8388 * data/glr.cc (b4_parser_class_name):
8389 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
8390 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
8391 (yydebug_) [YYDEBUG]: New member.
8392 (yycdebug_): Now defined only if YYDEBUG.
8393 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
8394 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
8395 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
8396 if YYYDEBUG.
8397 (debug_stream, set_debug_stream, debug_level, set_debug_level):
8398 Define only if YYDEBUG.
8399 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
8400 set_debug_level.
8401 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
8402 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
8403 AT_CHECK_CALC_GLR_CC that are working now.
8404
4ec13d60
PE
84052006-09-12 Paul Eggert <eggert@cs.ucla.edu>
8406
8407 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
8408 We don't need them in glr.cc, and glr.c defines them.
8409 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
8410 assumes that defining it to anything is the same as defining
8411 it to 1. Problem reported by Paolo Bonzini.
8412
8e1687ae
PE
84132006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
8414
8415 * data/c.m4 (b4_null, b4_case): Define.
8416 * src/output.c (prepare_symbols): Use b4_null.
8417 (user_actions_output): Use b4_case.
8418
3dc5e96b
PE
84192006-09-11 Paul Eggert <eggert@cs.ucla.edu>
8420
aef3da86
PE
8421 * data/glr.c (b4_shared_declarations): Put start-header first,
8422 before any #includes that we generate, so that feature-test
8423 macros work. Problem reported by Michael Deutschmann in
8424 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
8425 * data/lalr1.cc: Likewise.
8426 * doc/bison.texinfo (Prologue): Document that feature-test macros
8427 should be defined before any Bison declarations.
8428 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
8429 that depend on location.hh after, not before, Bison decls, since
8430 we now include location.hh after the first user prologue.
8431
3dc5e96b
PE
8432 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
8433 Sander Brandenburg in
8434 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
8435 Also, fix minor white space and comment issues.
aef3da86
PE
8436 (Prologue): Mention that it's better to define feature-test macros
8437 before Bison declarations. Problem reported by Michael Deutschmann.
8438
8439 * README-cvs: Fix typo: "&" should be "&&". Problem reported
8440 by Jim Meyering.
8441 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
8442 This adjusts to recent gnulib changes.
3dc5e96b 8443
b2a0b7ca
JD
84442006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8445
8446 Finish implementation of per-type %destructor/%printer. Discussed
8447 starting at
8448 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
8449 and
8450 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
8451 * NEWS (2.3+): Add a description of this feature to the default
8452 %destructor/%printer description.
8453 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
8454 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
8455 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
8456 list node contains a semantic type.
8457 * src/symtab.c, src/symtab.h: Extend with a table that associates
8458 semantic types with their %destructor's and %printer's.
8459 (semantic_type_from_uniqstr, semantic_type_get,
8460 semantic_type_destructor_set, semantic_type_printer_set): New functions
8461 composing the public interface of that table.
8462 (symbol_destructor_get, symbol_destructor_location_get,
8463 symbol_printer_get, symbol_printer_location_get): If there's no
8464 per-symbol %destructor/%printer, look up the per-type before trying
8465 the default.
8466 * tests/actions.at (Per-type %printer and %destructor): New test case.
8467 * tests/input.at (Default %printer and %destructor redeclared):
8468 Extend to check that multiple occurrences of %symbol-default in a
8469 single %destructor/%printer declaration is an error.
8470 (Per-type %printer and %destructor redeclared, Unused values with
8471 per-type %destructor): New test cases.
8472
3be03b13
JD
84732006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8474
8475 Require default %destructor/%printer to be declared using
8476 %symbol-default instead of an empty symbol list, and start working on
8477 new per-type %destructor/%printer. Discussed at
8478 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
8479 * NEWS (2.3+): Add %symbol-default to example.
8480 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 8481 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
8482 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
8483 (generic_symlist, generic_symlist_item): New nonterminals for creating
8484 a list in which each item is a symbol, semantic type, or
8485 %symbol-default.
8486 (grammar_declaration): Use generic_symlist in %destructor and %printer
8487 declarations instead of symbols.1 or an empty list.
8488 (symbol_declaration, precedence_declaration, symbols.1): Update actions
8489 for changes to symbol_list.
8490 * src/reader.c: Update for changes to symbol_list.
8491 * src/scan-code.l: Likewise.
8492 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
8493 * src/symlist.c, src/symlist.h: Extend such that a list node may
8494 represent a semantic type or a %symbol-default in addition to just an
8495 ordinary symbol. Add switched functions for setting %destructor's and
8496 %printer's.
8497 * tests/actions.at, tests/input.at: Add %symbol-default to all default
8498 %destructor/%printer declarations.
8499
3508ce36
JD
85002006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
8501
8502 Whether the default %destructor/%printer applies to a particular symbol
8503 isn't a question of whether the user *declares* that symbol (in %token,
8504 for example). It's a question of whether the user by any means
8505 *defines* the symbol at all (by simply using a char token, for
8506 example). $end is defined by Bison whereas any other token with token
8507 number 0 is defined by the user. The error token is always defined by
8508 Bison regardless of whether the user declares it with %token, but we
8509 may one day let the user define error as a nonterminal instead.
8510 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
8511 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
8512 the meaning of "user-defined".
8513 * tests/actions.at (Default %printer and %destructor for user-declared
8514 end token): Rename to...
8515 (Default %printer and %destructor for user-defined end token): ...
8516 this.
8517
8518 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
8519 computation of whether to apply the default, don't maintain a list of
8520 every Bison-defined symbol. Instead, just check for a first character
8521 of '$', which a user symbol cannot have, and check for the error token.
8522
9350499c
JD
85232006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
8524
8525 Don't apply the default %destructor or %printer to the error token,
8526 $undefined, or $accept. This change fits the general rule that the
8527 default %destructor and %printer are only for user-declared symbols,
8528 and it solves several difficulties that are described in the new test
8529 cases listed below.
8530 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
8531 * tests/actions.at (Default %printer and %destructor are not for error
8532 or $undefined, Default %printer and %destructor are not for $accept):
8533 New test cases.
8534
4d7370cb
JD
85352006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
8536
8537 Allow %start after the first rule.
8538 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
8539 when parsing the first rule.
8540 (check_and_convert_grammar): Search for it here after all grammar
8541 declarations have been parsed. Skip midrules, which have dummy LHS
8542 nonterminals.
8543 * src/symtab.c (symbol_is_dummy): New function.
8544 * src/symtab.h (symbol_is_dummy): Declare it.
8545 * tests/input.at (%start after first rule): New test.
8546
6d0ef4ec
JD
85472006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8548
8549 Redo some of the previous commit: add back the ability to use
8550 non-aliased/undeclared string literals since it might be useful to
8551 those declaring %token-table.
8552 * src/reader.c (check_and_convert_grammar): Undo changes in previous
8553 commit: don't worry about complaints from symbols_pack.
8554 * src/symtab.c (symbol_new, symbol_class_set,
8555 symbol_check_alias_consistency): Undo changes in previous commit: count
8556 each string literal as a new symbol and token, assign it a symbol
8557 number, and don't complain about non-aliased string literals.
8558 (symbols_pack): Since symbol_make_alias still does not decrement symbol
8559 and token counts but does still set aliased tokens to the same number,
8560 symbol_pack_processor now leaves empty slots in the symbols array.
8561 Remove those slots.
8562 * tests/regression.at (Undeclared string literal): Remove test case
8563 added in previous commit since non-aliased string literals are allowed
8564 again.
8565 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
8566 remove unnecessary string literal declarations.
8567 * tests/sets.at (Firsts): Likewise.
8568
965537bc
JD
85692006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8570
8571 Don't allow an undeclared string literal, but allow a string literal to
8572 be used before its declaration.
8573 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
8574 symbols_pack complained.
8575 * src/symtab.c (symbol_new): Don't count a string literal as a new
8576 symbol.
8577 (symbol_class_set): Don't count a string literal as a new token, and
8578 don't assign it a symbol number since symbol_make_alias does that.
8579 (symbol_make_alias): It's not necessary to decrement the symbol and
8580 token counts anymore. Don't assume that an alias declaration occurs
8581 before any uses of the identifier or string, and thus don't assert that
8582 one of them has the highest symbol number so far.
8583 (symbol_check_alias_consistency): Complain if there's a string literal
8584 that wasn't declared as an alias.
8585 (symbols_pack): Bail if symbol_check_alias_consistency failed since
8586 symbol_pack asserts that every token has been assigned a symbol number
8587 although undeclared string literals have not.
8588 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 8589 string literal): New test cases.
965537bc
JD
8590 (Characters Escapes, Web2c Actions): Declare string literals as
8591 aliases.
8592 * tests/sets.at (Firsts): Likewise.
8593
47aee066
JD
85942006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
8595
8596 In the grammar scanner, STRING_FINISH unclosed constructs and return
8597 them to the parser in order to improve error messages.
8598 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
8599 SC_BRACED_CODE, SC_PROLOGUE): Implement.
8600 * tests/input.at (Unclosed constructs): New test case.
8601 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
8602 seen.
8603
8604 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
8605 unused global.
8606
1f6b3679
JD
86072006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
8608
8609 Handle string aliases for character tokens correctly.
8610 * src/symtab.c (symbol_user_token_number_set): If the token has an
8611 alias, check and set its alias's user token number instead of its own,
8612 which is set to indicate the alias. Previously, every occurrence of
8613 the character token in the grammar overwrote that alias indicator with
8614 the character code.
8615 * tests/input.at (String aliases for character tokens): New test.
8616
219741d8
JD
86172006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
8618
8619 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
8620
11daa4e7
PE
86212006-08-11 Paul Eggert <eggert@cs.ucla.edu>
8622
8623 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
8624 to prevent failures when building on older platforms.
8625 Check for autopoint failure.
8626 Set XGETTEXT_OPTIONS to values that check for C format strings,
8627 so that translators are warned about them (this also helps
8628 prevent core dumps).
8629
8630 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
8631 function, since it simplifies our code a bit.
8632
8633 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
8634 rather than -W, so we don't get bogus warnings about sign comparisons.
8635 Add -Wpointer-arith, since that warning is useful (it reports code
8636 that does not conform to C89 and that some compilers reject).
8637 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
8638 since it's no longer needed.
8639
f9bfc42a
JD
86402006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
8641
8642 Clean up scanners a bit.
8643 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
8644 definitions so gcc won't warn when obstack_for_string is unused.
8645 * src/scan-code.l: config.h and system.h are already #include'd by
8646 scan-code-c.c, so get rid of them here.
8647 * src/scan-gram.l: Likewise.
8648 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
8649 definitions rather than duplicating the rest of it.
8650 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
8651
06e8700a
JD
86522006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
8653
8654 Suppress signed/unsigned comparison warnings for yycheck.
8655 * data/c.m4 (b4_safest_int_type): New macro.
8656 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
8657 a signed int type, cast it to b4_safest_int_type first.
8658 * data/yacc.c: Likewise.
8659 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
8660 also overwritten.
8661
9c437126
PE
86622006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
8663
8664 * doc/bison.texinfo: Fix some typos.
8665
284d8a13
PE
86662006-08-02 Paul Eggert <eggert@cs.ucla.edu>
8667
8668 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
8669 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
8670
8671 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
8672 the latest gnulib does this a different way.
8673 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
8674 translation was patched, so stop omitting it.
8675
ec5479ce
JD
86762006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8677
8678 Enable declaration of default %printer/%destructor. Make the parser
8679 use these for all user-declared grammar symbols for which the user does
8680 not declare a specific %printer/%destructor. Thus, the parser uses it
8681 for token 0 if the user declares it but not if Bison generates it as
8682 $end. Discussed starting at
8683 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
8684 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
8685 and
8686 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
8687 * NEWS (2.3+): Mention.
8688 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
8689 declare a %destructor for a mid-rule's semantic value. It's just
8690 impossible to declare one specific to it.
8691 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
8692 code. Describe default %destructor form.
8693 * src/parse-gram.y (grammar_declaration): Parse default
8694 %printer/%destructor declarations.
8695 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
8696 and symbol_destructor_location_get rather than accessing the destructor
8697 and destructor_location members of struct symbol.
8698 (symbol_printers_output): Likewise but for %printer's.
8699 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
8700 again.
8701 * src/symtab.c (default_destructor, default_destructor_location,
8702 default_printer, default_printer_location): New static global
8703 variables to record the default %destructor and %printer.
8704 (symbol_destructor_get, symbol_destructor_location_get,
8705 symbol_printer_get, symbol_printer_location_get): New functions to
8706 compute the appropriate %destructor and %printer for a symbol.
8707 (default_destructor_set, default_printer_set): New functions to set the
8708 default %destructor and %printer.
8709 * src/symtab.h: Prototype all those new functions.
8710 * tests/actions.at (Default %printer and %destructor): New test to
8711 check that the right %printer and %destructor are called, that they're
8712 not called for $end, and that $$ and @$ work correctly.
8713 (Default %printer and %destructor for user-declared end token): New
8714 test to check that the default %printer and %destructor are called for
8715 a user-declared end token.
8716 * tests/input.at (Default %printer and %destructor redeclared, Unused
8717 values with default %destructor): New tests to check related grammar
8718 warnings and errors.
8719
868d2d96
JD
87202006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8721
8722 Clean up handling of %destructor for the end token (token 0).
8723 Discussed starting at
8724 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
8725 and
8726 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
8727
8728 Make the skeletons consistent in how they pop the end token and invoke
8729 its %destructor.
8730 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
8731 state, which has token number 0, since this would invoke the
8732 %destructor for the end token.
8733 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
8734 until after shifting the end token, or else it won't be popped.
8735 * data/yacc.c (yyparse): Likewise.
8736
8737 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
8738 it's the end token. Upon termination, destroy an unshifted lookahead
8739 even when it's the end token.
8740 * data/lalr1.cc (yy::parser::parse): Likewise.
8741 * data/yacc.c (yyparse): Likewise.
8742
8743 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
8744 value warnings for the end token when the user gives the end token a
8745 %destructor.
8746
8747 * tests/actions.at (Printers and Destructors): Test all the above.
8748
62a9592d
PE
87492006-07-24 Paul Eggert <eggert@cs.ucla.edu>
8750
8751 Update to latest gnulib and gettext versions.
8752 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
8753 Add fopen-safer.
8754 (gnulib_files): Add m4/warning.m4. Don't worry about files
8755 overwritten by autopoint.
8756 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
8757 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
8758 rejects them.
8759 Don't use autoreconf; instead, invoke autopoint etc. by hand,
8760 so that we can remove the intl files at a better time.
8761 (intl_files_to_remove): Remove aclocal.m4, since it gets
8762 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
8763 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
8764 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
8765 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
8766 Remove datarootdir hack; no longer needed.
8767 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
8768 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
8769 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
8770 strdup.h.
8771 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
8772 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
8773
10d6970f
PE
87742006-07-20 Paul Eggert <eggert@cs.ucla.edu>
8775
8776 * bootstrap: Adjust to today's change to gnulib-tool by invoking
8777 it with --assume-autoconf='latest-stable'.
8778
50a33993
JD
87792006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
8780
8781 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
8782 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
8783 YYSTYPE' and `{'.
8784 * src/muscle_tab.h (muscle_grow): Replace the header comments with
8785 those from muscle_tab.c since the old ones are misleading.
8786
2ce4ed68
AD
87872006-07-13 Akim Demaille <akim@epita.fr>
8788
8789 Support %define "KEY" {VALUE}.
8790 * src/scan-code.h, src/scan-code.l (translate_action)
8791 (translate_rule_action, translate_symbol_action, translate_code):
8792 Return char *, not const char *.
8793 * src/parse-gram.y (declaration): Rename as...
8794 (prologue_declaration): this.
8795 (string_content): Remove this nonterminal, use STRING.
8796 (braceless, content, content.opt): New nonterminal.
8797 Use them.
8798 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
8799 as value.
8800 * src/scan-gram.l (getargs.h): Don't include it.
8801
db7e5eb5
PE
88022006-07-12 Paul Eggert <eggert@cs.ucla.edu>
8803
8804 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
8805 rather than a for-loop that declares a local bool variable. This
8806 should work around a compatibility problem with a Cray x1e C++
8807 compiler reported by Hung Nguyen in
8808 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
8809 The for-loop was introduced in the 2004-11-17 change but I don't
8810 know why it was needed.
8811
a5d80ba5
AD
88122006-07-12 Akim Demaille <akim@epita.fr>
8813
8814 * data/c.m4: Comment changes.
8815
23eb2a69
AD
88162006-07-10 Akim Demaille <akim@lrde.epita.fr>
8817
8818 * src/complain.c (error_message, ERROR_MESSAGE): New.
8819 To factor...
8820 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
8821 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
8822
ddc8ede1
PE
88232006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8824
8825 * NEWS: Instead of %union, you can define and use your own union type
8826 YYSTYPE if your grammar contains at least one <type> tag.
8827 Your YYSTYPE need not be a macro; it can be a typedef.
8828 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
8829 (Union Decl, Decl Summary): Document this.
8830 * data/glr.c (YYSTYPE): Implement this.
8831 * data/glr.cc (YYSTYPE): Likewise.
8832 * data/lalr1.cc (YYSTYPE): Likewise.
8833 * data/yacc.c (YYSTYPE): Likewise.
8834 * src/output.c (prepare): Output tag_seen_flag.
8835 * src/parse-gram.y (declaration, grammar_declaration):
8836 Use 'union_seen' rather than 'typed' to determine whether
8837 %union has been seen, since grammars can now be typed without
8838 %union.
8839 (symbol_declaration, type.opt, symbol_def):
8840 Keep track of whether a tag has been seen.
8841 * src/reader.c (union_seen, tag_seen): New vars.
8842 (typed): remove.
8843 * src/reader.h (union_seen, tag_seen, typed): Likewise.
8844 * src/scan-code.l (untyped_var_seen): New variable.
8845 (handle_action_dollar): Adjust to above changes.
8846 (handle_action_dollar, handle_action_at):
8847 Improve overflow checking for outlandish numbers.
8848 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
8849 avoid new diagnostics generated by above changes.
8850 * tests/regression.at (YYSTYPE typedef): Add test to check
8851 for type tags without %union.
8852
8853 * src/symlist.c (symbol_list_length): Return int, not unsigned
8854 int, since callers expect int. This may need to get revisited
8855 once we have proper integer overflow checking.
8856
8857 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
8858 object is now static.
8859
8860 * src/getargs.c (flags_argmatch): Return void, not int,
8861 to pacify ./configure --enable-gcc-warnings.
8862
8863 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
8864 since last_string is already defined to FLEX_PREFIX (last_string).
8865
7b42569e
AD
88662006-07-09 Akim Demaille <akim@lrde.epita.fr>
8867
8868 Implement --warnings/-W.
8869 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
8870 replaced by...
8871 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
8872 Adjust callers.
8873 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
8874 (warnings_args, warnings_types): New.
8875 (getargs, short_options, long_options): Accept -W/--warnings.
8876 Sort the options by alphabetical order, upper case letter right
8877 before its lower case.
8878
3b452f4e
JD
88792006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
8880
8881 Change %merge result type clash warnings to errors. Discussed at
8882 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
8883 * src/reader.c (record_merge_function_type): Use complain_at.
8884 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8885 declared later): Update test case results.
8886
b8a41559
AD
88872006-07-09 Akim Demaille <akim@lrde.epita.fr>
8888
8889 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
8890 to be in alphabetical order.
8891 (trace_args): Spelling fixes.
8892
cd9e1ba2
PE
88932006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8894
8895 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
8896 so they don't collide with user-defined macros.
8897 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
8898 this was never guaranteed, and now that we're using gnulib stdint,
8899 which defines int_fast16_t to long int, the problem is exposed.
8900
cb48f191
PE
89012006-07-08 Paul Eggert <eggert@cs.ucla.edu>
8902
b8445a15
PE
8903 * data/c.m4 (b4_basename): Simplify a bit, since we don't
8904 need the full POSIX semantics (and weren't implementing them
8905 anyway).
8906
cb48f191
PE
8907 Adjust to Autoconf 2.60 and today's gnulib.
8908 * bootstrap (gnulib_modules): Add stdint.
8909 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
8910 no longer copies it.
8911 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
8912 since stdint needs the former and wcwidth (which is now required
8913 by mbswidth) needs the latter.
8914 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
8915 work around a compatibility glitch between gettext 0.14.6 and
8916 Autoconf 2.60.
8917 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
8918 Do not check for uintptr_t, since new stdint module does the right
8919 thing.
8920 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
8921 Add stdint.h, stdint_.h, wcwidth.h.
8922 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
8923 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
8924 stdint.m4, wchar_t.m4, wcwidth.m4.
8925 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
8926 usual order for ../lib/*.h files.
8927 (file_name_split): Use last_component, not base_name, to adjust
8928 to gnulib changes.
8929 * src/parse-gram.h: Include <strverscmp.h> in the usual order
8930 for ../lib/*.h files.
8931 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
8932 Define unconditionally, since we now assume the stdint module.
8933 * src/scan-skel.l: Include <dirname.h>.
8934 (BASE_QPUTS): Use last_component, not base_name.
8935 * src/system.h: Include <unlocked-io.h> in the usual order
8936 for ../lib/*.h files. Include <stdint.h> unconditionally,
8937 since we now use the stdint module.
8938 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
8939 HAVE_UINTPTR_T, since we now use the stdint module.
8940 (base_name): Remove decl, since files now include <dirname.h>
8941 to get the decl.
8942
cd48d21d
AD
89432006-07-08 Akim Demaille <akim@lrde.epita.fr>
8944
8945 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
8946 New, default to 1.
8947 * data/yacc.c, data/glr.c, data/location.cc: Use them.
8948 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
8949 default.
8950 * tests/calc.at: Adjust.
8951
8ec0a172
AD
89522006-07-08 Akim Demaille <akim@lrde.epita.fr>
8953
b8445a15 8954 * data/c.m4 (b4_basename): New.
8ec0a172
AD
8955 (b4_syncline): Also output the location of its invocation (from
8956 the skeleton).
8957 (b4_user_action, b4_define_user_action, b4_user_actions)
8958 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
8959 (b4_user_stype): New.
8960 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
8961
4a678af8
JD
89622006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8963
8964 In the grammar file, the first column is 1 not 0 on the first line as
8965 on every other line.
8966 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
8967 * tests/input.at (Torturing the Scanner): Update output.
8968
8969 * src/scan-gram.l (scanner_cursor): Declare it static.
8970
dd60572a
JD
89712006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8972
8973 In warnings, say "previous declaration" rather than "first
8974 declaration".
8975 * src/symtab.c (redeclaration): Do that here.
8976 * src/reader.c (record_merge_function_type): In the case of a result
8977 type clash, report the previous declaration rather than the very first
8978 one in the grammar file.
8979 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8980 declared later): Add a third declaration to check this behavior.
8981 * tests/input.at (Incompatible Aliases): Update output.
8982
2073e1b6
AD
89832006-06-27 Akim Demaille <akim@epita.fr>
8984
8985 * doc/Doxyfile.in: New.
8986 * doc/Makefile.am: Use it.
8987 * src/lalr.h, src/symtab.h: Initial doxygenation.
8988
8ee5b538
JD
89892006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8990
8991 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
8992 declared after the %merge. This continues the effort of the previous
8993 patch.
8ee5b538
JD
8994 * src/reader.c (get_merge_function): Don't set the merger type yet.
8995 (record_merge_function_type): New function for setting the merger type
8996 and checking for clashes.
8997 (grammar_current_rule_merge_set): Set the location of the %merge for
8998 the current rule.
8999 (packgram): Invoke record_merge_function_type for each rule now that
9000 all symbol type declarations have been parsed.
9001 * src/reader.h (merger_list.type_declaration_location): New member
9002 storing the location of the first %merge from which the type for this
9003 merging function was derived.
9004 * src/symlist.h (symbol_list.merger_declaration_location): New member
9005 storing the location of a rule's %merge, if any.
9006 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9007 declared later): New test to catch the error fixed by the above patch.
9008
ffa4ba3a
JD
90092006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9010
9011 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
9012 declarations appear after the rules. Discussed at
9013 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
9014 and
9015 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
9016 Don't mistake the type of $$ in a midrule to be that of its parent
9017 rule's $$.
ffa4ba3a
JD
9018 * src/reader.c (grammar_current_rule_end): Don't invoke
9019 grammar_rule_check yet since not all symbol declarations may have been
9020 parsed yet.
9021 (grammar_midrule_action): Likewise.
9022 Don't record whether the midrule's $$ has been used yet since actions
9023 haven't been translated yet.
9024 Record the midrule's parent rule and its RHS index within the parent
9025 rule.
9026 (grammar_current_rule_action_append): Don't translate the action yet
9027 since not all symbol declarations may have been parsed yet and, thus,
9028 warnings about types for $$, $n, @$, and @n can't be reported yet.
9029 (packgram): Translate the action and invoke grammar_rule_check now that
9030 all symbol declarations have been parsed.
9031 * src/scan-code.l (handle_action_dollar): Now that this is invoked
9032 after parsing the entire grammar file, the symbol list here in the case
9033 of a midrule is actually the midrule's empty RHS, so reference its
9034 parent rule's RHS where necessary.
9035 On the other hand, now that you can already know it's a midrule, you
9036 aren't forced to think $$ has the same type as its parent rule's $$.
9037 (handle_action_at): In the case of a midrule, reference the parent rule
9038 where necessary.
9039 * src/symlist.c (symbol_list_new): Initialize new midrule-related
9040 members.
9041 (symbol_list_length): Now that this is invoked after all rules have
9042 been parsed, a NULL symbol (rather than a NULL symbol list node)
9043 terminates a rule. symbol_list_print already does this correctly.
9044 * src/symlist.h (symbol_list.midrule_parent_rule,
9045 symbol_list.midrule_parent_rhs_index): New members so that midrules can
9046 remember their relationships with their parents.
9047 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
9048 fixed by the above patch.
9049 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
9050 implementing...
9051 (Unused values): ... this old test case and...
9052 (Unused values before symbol declarations): ... this new test case.
9053 This one is the same as `Unused values' except that all symbol
9054 declarations appear after the rules in order to catch the rest of the
9055 errors fixed by the above patch.
9056
e256e17f
JD
90572006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9058
300a1930
JD
9059 More cleanup.
9060 * src/reader.c (current_rule): Declare it static since it's no longer
9061 used outside this file.
9062 (grammar_current_rule_action_append): Remove redundant arguments from
9063 translate_rule_action invocation.
9064 * src/reader.h (current_rule): Remove this unused extern.
9065 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
9066 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 9067
381ecb06
JD
90682006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
9069
9070 Clean up yesterday's patch.
9071 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
9072 to...
9073 * src/reader.c (grammar_current_rule_action_append): ... here for
9074 consistency with grammar_current_rule_symbol_append.
9075 * tests/regression.at (Braced code in declaration in rules section):
9076 Make yyerror and yylex static as usual.
9077
4210cd0b
JD
90782006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
9079
9080 Fix bug that mistakes braced code in a declaration in the rules section
9081 to be a rule action. Mentioned at
9082 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
9083 * src/scan-gram.l: Move midrule action detection from the start of the
9084 scanning of any braced code to...
9085 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
9086 action. For readability, use $2 and @2 rather than the equivalent
9087 global variables.
9088 * tests/regression.at (Braced code in declaration in rules section):
9089 New test to catch the error fixed by the above patch.
9090
9091 Work on code readability some.
9092 * src/scan-code.l (current_rule): Get rid of this misleading and
9093 redundant declaration: it's actually extern'ed in reader.h.
9094 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
9095 translate_action): Add a rule argument and use it instead of the global
9096 current_rule.
9097 (translate_rule_action): This already receives current_rule through an
9098 argument, so pass it on to translate_action instead of assigning
9099 current_rule to current_rule.
9100 (translate_symbol_action, translate_code): Pass rule = NULL to
9101 translate_action.
9102
34f98f46
JD
91032006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
9104
9105 Rename %before-definitions to %start-header and %after-definitions to
9106 %end-header. Don't use these declarations to separate pre-prologue
9107 blocks from post-prologue blocks. Add new order-independent
9108 declarations %before-header and %after-header as alternatives to the
9109 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
9110 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
9111 * NEWS (2.3+): Update for these changes.
9112 * data/glr.c (b4_before_definitions): Update to...
9113 (b4_start_header): ... this.
9114 (b4_after_definitions): Update to...
9115 (b4_end_header): ... this.
9116 * data/glr.cc: Likewise.
9117 * data/lalr1.cc: Likewise.
9118 * data/yacc.c: Likewise.
9119 * doc/bison.texinfo (The prologue): Update names, and replace remaining
9120 prologue blocks with %*-header declarations.
9121 (Calc++ Parser): Likewise.
91661ebb 9122 (Decl Summary): Update names.
148d66d8 9123 (Table of Symbols): Update description.
34f98f46
JD
9124 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
9125 (PERCENT_END_HEADER): ... this.
9126 (PERCENT_BEFORE_DEFINITIONS): Update to...
9127 (PERCENT_START_HEADER): ... this.
9128 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9129 (declaration): Update token names and m4 macro names.
9130 When parsing %end-header and %start-header, invoke translate_code
9131 before muscle_code_grow, and no longer set global booleans to remember
9132 whether these declarations have been seen.
9133 Parse new %after-header and %before-header.
9134 * src/reader.c (before_definitions, after_definitions): Remove.
9135 (prologue_augment): Accept a new bool argument to specify whether to
9136 augment the pre-prologue or post-prologue.
9137 * src/reader.h (before_definitions, after_definitions): Remove these
9138 extern's.
9139 (prologue_augment): Add new bool argument.
9140 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
9141 (PERCENT_END_HEADER): ... this.
9142 (PERCENT_BEFORE_DEFINITIONS): Update to...
9143 (PERCENT_START_HEADER): ... this.
9144 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9145 * tests/actions.at (Printers and Destructors): Update names.
9146
31b2b07e
JD
91472006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
9148
9149 Add comparison operators for C++ location classes. Discussed at
9150 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
9151 * data/c++.m4 (b4_define_location_comparison): New boolean %define
9152 declaration indicating whether filename_type has an operator==. If
9153 filename_type is `std::string', it defaults to `1', `0' otherwise.
9154 * data/location.cc: Iff b4_define_location_comparison is `1', add
9155 operator== and operator!= for class position and for class location.
9156
9157 Some minor fixes.
9158 * src/scan-action.l: Remove unused file.
9159 * src/symtab.c (symbol_printer_set): Use printer_location not
9160 destructor_location.
9161 * src/symtab.h (struct symbol): Replace incorrect source comment for
9162 printer members.
9163 * tests/input.at (Incompatible Aliases): Update output with correct
9164 printer location.
9165
9bc0dd67
JD
91662006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
9167
9168 Don't put the pre-prologue in the header file. For the yacc.c code
9169 file and the glr.c header and code files, move the pre-prologue before
9170 the token definitions. Add new %before-definitions and
9171 %after-definitions to declare code that will go in both the header file
9172 and code file. Discussed at
9173 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
9174 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
9175 and
9176 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
9177 * NEWS (2.3+): Describe these changes.
9178 * data/glr.c (b4_pre_prologue): Move from within to before...
9179 (b4_shared_declarations): ... this.
9180 Add new b4_before_definitions before b4_token_enums.
9181 Add new b4_after_definitions at the end.
9182 * data/glr.cc (b4_pre_prologue): Replace with...
9183 (b4_before_definitions): ... this in the header file.
9184 (b4_after_definitions): New near the end of the header file.
9185 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
9186 code file right before including the header file.
9187 (b4_before_definitions): New in the previous position of
9188 b4_pre_prologue in the header file.
9189 (b4_after_definitions): New near the end of the header file.
9190 * data/yacc.c: Clean up some m4 quoting especially in the header file.
9191 (b4_token_enums_defines): In the code file, move to right before
9192 YYSTYPE for consistency with the header file.
9193 (b4_before_definitions): New right before b4_token_enums_defines in
9194 both the header and code file.
9195 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
9196 header and code file.
9197 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
9198 of prologues for %union dependencies.
91661ebb
JD
9199 (Decl Summary): In %defines description, mention the effect of
9200 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
9201 (Calc++ Parser): Forward declare driver in a %before-definitions rather
9202 than in the pre-prologue so that make check succeeds.
148d66d8 9203 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
9204 %after-definitions.
9205 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
9206 %before-definitions.
9207 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
9208 (declaration): Parse those declarations and append to
9209 b4_before_definitions and b4_after_definitions, respectively.
9210 * src/reader.c (before_definitions, after_definitions): New bools to
9211 track whether those declarations have been seen.
9212 (prologue_augment): Add to the post-prologue if %union,
9213 %before-definitions, or %after-definitions has been seen.
9214 * src/reader.h (before_definitions, after_definitions): New extern's.
9215 * src/scan-gram.l: Scan the new declarations.
9216 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
9217 prologue block in a %before-definitions or a %after-definitions based
9218 on whether the %union is declared.
9219 * tests/regression.at (Early token definitions with --yacc, Early token
9220 definitions without --yacc): Move tests for token definitions into the
9221 post-prologue since token names are no longer defined in the
9222 pre-prologue.
9223
203b9274
AD
92242006-06-20 Akim Demaille <akim@epita.fr>
9225
9226 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
9227 (symbol_get): Use it.
9228 * src/parse-gram.y: Use it.
9229
a7ee59cf
JD
92302006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
9231
9232 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
9233 build succeeds when configured with --enable-gcc-warnings.
9234
5a2baae7
PE
92352006-06-19 Paul Eggert <eggert@cs.ucla.edu>
9236
33ad1a9c
PE
9237 * src/parse-gram.y (char_name): New function.
9238 (CHAR, STRING, string_content): For %printer, properly escape.
9239 (ID): Prefer fputs to fprintf.
9240 (id): Reindent to be consistent with other rules.
9241 Properly quote char.
9242
5a2baae7
PE
9243 The Translation Project changed its way of publishing translations
9244 to maintainers. I haven't received any responses to my request
9245 for supporting the old way, or for documenting the new way. I
9246 have modified 'bootstrap' to use screen scraping
9247 (in this case, HTML scraping). This is unreliable and inelegant,
9248 but I don't see any better way. Yuck.
9249 * bootstrap (TP_URL, WGET_COMMAND): New vars.
9250 (get_translations): New function, which uses HTML scraping to
9251 deduce locations of latest translations.
9252 Use this function to grab both bison and bison-runtime .po files.
9253 Don't bother priming the pump for the runtime-po domain any more,
9254 as it's now translated better than bison is.
9255
58d7a1a1
AD
92562006-06-19 Akim Demaille <akim@epita.fr>
9257
9258 * src/scan-gram.l: No longer "parse" things after `%union' until
9259 `{'. Rather, return a single "%union" token.
9260 No longer make symbols: return strings, and leave the conversion
9261 to symbols to the parser.
9262 (SC_PRE_CODE, token_type): Remove.
9263 * src/parse-gram.y (%union): New field `character'.
9264 Sort tokens.
9265 (CHAR): New token.
9266 (ID, ID_COLON): Now that the scanner no longer makes them
9267 identifiers, adjust all uses to invoke symbol_get.
9268 (id_colon): New, wraps the conversion from string to symbol.
9269 (%union): Accept a possible union_name.
9270 (symbol): Now can be a char.
9271 * data/c.m4 (b4_union_name): Leave a default value.
9272 * data/glr.c, data/yacc.c: Use it.
9273
b931235e
JD
92742006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
9275
9276 For associating token numbers with token names for "yacc.c", don't use
9277 #define statements unless `--yacc' is specified; always use enum
9278 yytokentype. Most important discussions start at:
9279 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
9280 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
9281 and
9282 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
9283 * NEWS (2.3+): Mention.
9284 * data/c.m4 (b4_yacc_if): New.
9285 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
9286 token #define's.
9287 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
9288 on token name definitions.
9289 * src/getargs.c (usage): Capitalize `Yacc' in English.
9290 * src/output.c (prepare): Define b4_yacc_flag.
9291 * tests/regression.at (Early token definitions): Test that tokens names
9292 are defined before the pre-prologue not just before the post-prologue.
9293 Remove this test case and copy to...
9294 (Early token definitions with --yacc): ... this to test #define's.
9295 (Early token definitions without --yacc): ... and this to test enums.
9296
9e6e7ed2
PE
92972006-06-11 Paul Eggert <eggert@cs.ucla.edu>
9298
9299 * NEWS: Reword the post-2.3 change to not be so optimistic about
9300 removing the old "look-ahead" spelling.
9301 Update previous look-ahead/lookahead change reports.
9302 * REFERENCES: look-ahead -> lookahead (since that's
9303 what he actually wrote).
9304 * doc/refcard.tex: look ahead -> lookahead,
9305 look-ahead -> lookahead
9306
742e4900
JD
93072006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
9308
9309 For consistency, use `lookahead' instead of `look-ahead' or
9310 `look_ahead'. Discussed starting at
9311 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
9312 and then at
9313 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
9314 * NEWS: For the next release, note the change to `--report'.
9315 * TODO, doc/bison.1: Update English.
9316 * doc/bison.texinfo: Update English.
9317 (Understanding Your Parser, Bison Options): Document as
9318 `--report=lookahead' rather than `--report=look-ahead'.
9319 * src/conflicts.c: Update English in comments.
9320 (lookahead_set): Rename from look_ahead_set.
9321 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
9322 (resolve_sr_conflict): Rename local look_ahead_tokens to
9323 lookahead_tokens, and update other uses.
9324 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
9325 count_rr_conflicts, conflicts_free): Update uses.
9326 * src/getargs.c (report_args): Move "lookahead" before alternate
9327 spellings.
9328 (report_types): Update uses.
9329 (usage): For `--report' usage description, state `lookahead' spelling
9330 rather than `look-ahead'.
9331 * src/getargs.h (report.report_lookahead_tokens): Rename from
9332 report_look_ahead_tokens.
9333 * src/lalr.c: Update English in comments.
9334 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
9335 (state_lookahead_tokens_count): Rename from
9336 state_look_ahead_tokens_count.
9337 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9338 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
9339 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9340 Update other uses.
9341 Update English in output.
9342 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
9343 * src/print.c: Update English in comments.
9344 (lookahead_set): Rename from look_ahead_set.
9345 (print_reduction): Rename argument lookahead_token from
9346 look_ahead_token.
9347 (print_core, state_default_rule, print_reductions, print_results):
9348 Update uses.
9349 * src/print_graph.c: Update English in comments.
9350 (print_core): Update uses.
9351 * src/state.c: Update English in comments.
9352 (reductions_new): Update uses.
9353 (state_rule_lookahead_tokens_print): Rename from
9354 state_rule_look_ahead_tokens_print, and update other uses.
9355 * src/state.h: Update English in comments.
9356 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
9357 (state_rule_lookahead_tokens_print): Rename from
9358 state_rule_look_ahead_tokens_print.
9359 * src/tables.c: Update English in comments.
9360 (conflict_row, action_row): Update uses.
9361 * tests/glr-regression.at
9362 (Incorrect lookahead during deterministic GLR,
9363 Incorrect lookahead during nondeterministic GLR): Rename
9364 print_look_ahead to print_lookahead.
9365 * tests/torture.at: Update English in comments.
9366 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
9367 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
9368 (Many lookahead tokens): Update uses.
9369 * data/glr.c: Update English in comments.
9370 * lalr1.cc: Likewise.
9371 * yacc.c: Likewise.
9372 * src/conflicts.h: Likewise.
9373 * src/lalr.h: Likewise.
9374 * src/main.c: Likewise.
9375 * src/output.c: Likewise.
9376 * src/parse-gram.c: Likewise.
9377 * src/tables.h: Likewise.
9378 * tests/calc.at: Likewise.
9379
3c40d0b5
JD
93802006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
9381
9382 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
9383
5d278082
PE
93842006-06-07 Paul Eggert <eggert@cs.ucla.edu>
9385
9386 * TODO: Add request from Nelson H. F. Beebe to be able to install
9387 Bison without installing the yacc script.
9388
9e668899
JD
93892006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9390
9391 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
9392 and yytext if they're already #define'd.
9393 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
9394 * src/scan-code-c.c: ... here.
9395 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
9396 <config.h>.
9397
0c8e079f
JD
93982006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9399
9400 Get Bison to build again when configured with --enable-gcc-warnings.
9401 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
9402 missing #include's.
9403 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
9404 loc argument as it shadows a global.
9405 * src/scan-gram.l: Remove stray comma that prevents boundary_set
9406 invocation.
9407
9408 * src/.cvsignore: Add scan-code.c.
9409
2346344a
AD
94102006-06-07 Akim Demaille <akim@epita.fr>
9411
9412 * src/scan-gram.l: Move the "add a trailing ; to actions" code
9413 to...
9414 * src/scan-code.l: here.
9415 * tests/input.at (Torturing the Scanner): Fix another location
9416 error.
9417
4862bdfd
AD
94182006-06-07 Akim Demaille <akim@epita.fr>
9419
9420 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
9421
e9071366
AD
94222006-06-06 Akim Demaille <akim@epita.fr>
9423
9424 Extract the parsing of user actions from the grammar scanner.
9425 As a consequence, the relation between the grammar scanner and
9426 parser is much simpler. We can also split "composite tokens" back
9427 into simple tokens.
9428 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
9429 * src/scan-gram.l (add_column_width, adjust_location): Move to and
9430 rename as...
9431 * src/location.h, src/location.c (add_column_width)
9432 (location_compute): these.
9433 Fix the column count: the initial column is 0.
9434 (location_print): Be robust to ending column being 0.
9435 * src/location.h (boundary_set): New.
9436 * src/main.c: Adjust to scanner_free being renamed as
9437 gram_scanner_free.
9438 * src/output.c: Include scan-code.h.
9439 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
9440 Use boundary_set.
9441 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
9442 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
9443 which is now, again, a separate token.
9444 Adjust all dependencies.
9445 Whereever actions with $ and @ are used, use translate_code.
9446 (action): Remove this nonterminal which is now useless.
9447 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
9448 (grammar_current_rule_action_append): Use translate_code.
9449 (packgram): Bound check ruleno, itemno, and rule_length.
9450 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
9451 (last_string, last_braced_code_loc, max_left_semantic_context)
9452 (scanner_initialize, scanner_free, scanner_last_string_free)
9453 (gram_out, gram_lineno, YY_DECL_): Move to...
9454 * src/scan-gram.h: this new file.
9455 (YY_DECL): Rename as...
9456 (GRAM_DECL): this.
9457 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
9458 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9459 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9460 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9461 Move these declarations, and...
9462 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
9463 these to...
9464 * src/flex-scanner.h: this new file.
9465 * src/scan-gram.l (rule_length, rule_length_overflow)
9466 (increment_rule_length): Remove.
9467 (last_braced_code_loc): Rename as...
9468 (gram_last_braced_code_loc): this.
9469 Adjust to the changes of the parser.
9470 Move all the handling of $ and @ into...
9471 * src/scan-code.l: here.
9472 * src/scan-gram.l (handle_dollar, handle_at): Remove.
9473 (handle_action_dollar, handle_action_at): Move to...
9474 * src/scan-code.l: here.
9475 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
9476 scan-code.h, scan-code-c.c, scan-gram.h.
9477 (EXTRA_bison_SOURCES): Add scan-code.l.
9478 (BUILT_SOURCES): Add scan-code.c.
9479 (yacc): Be robust to white spaces.
9480
9481 * tests/conflicts.at, tests/input.at, tests/reduce.at,
9482 * tests/regression.at: Adjust the column numbers.
9483 * tests/regression.at: Adjust the error message.
7891a7c4 9484
184e42f0
JD
94852006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9486
9487 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9488 Use Akim's wording from
9489 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
9490
7891a7c4
JD
94912006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9492
9493 Between Bison releases, manually append `+' to the previous Bison
9494 release number, and use that as a signal to automatically print the
9495 ChangeLog's CVS Id keyword from --version. Discussed starting at
9496 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
9497 * ChangeLog: Add Id header.
9498 * configure.ac (AC_INIT): Append `+' to `2.3'.
9499 * src/.cvsignore: Add revision.c.
9500 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
9501 (BUILT_SOURCES): Add revision.c.
9502 (revision.c): New target rule. This file defines a new global variable
9503 named revision. It initializes it with either the Id from ChangeLog
9504 or, if VERSION doesn't contain `+', with the empty string.
9505 * src/getargs.c (version): Print the value of revision.
9506 * src/revision.h: Extern revision.
9507
4ad3ed84
PE
95082006-06-05 Paul Eggert <eggert@cs.ucla.edu>
9509
9510 * NEWS: Version 2.3.
9511 * configure.ac (AC_INIT): Likewise.
9512
02103984
PE
95132006-05-30 Paul Eggert <eggert@cs.ucla.edu>
9514
9515 * data/glr.c (YYRECOVERING): Define to be a function-like macro
9516 with no arguments, not as an object-like macro. This is for
9517 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
9518 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
9519 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
9520 Document this.
9521
2c08afa5
JD
95222006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
9523
9524 * src/getargs.c (usage): Back out yesterday's modification of the
9525 --help output so that we don't have to wait for translation before
9526 releasing 2.3.
9527
6077da58
PE
95282006-05-29 Paul Eggert <eggert@cs.ucla.edu>
9529
9530 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
9531 Problem reported by Akim Demaille.
9532
2a26b6c2
JD
95332006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
9534
9535 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9536
aefef0d6
PE
95372006-05-26 Paul Eggert <eggert@cs.ucla.edu>
9538
9539 * data/yacc.c (yy_reduce_print): Omit trailing white space in
9540 generated source code. Problem reported by Frans Englich in
9541 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
9542
fcd8e201
PE
95432006-05-22 Paul Eggert <eggert@cs.ucla.edu>
9544
9545 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
9546 shell, not within 'make', so that 'make' by an ordinary builder
9547 (using GNU make) does not worry about configuring gzip. This also
9548 works around a bug reported independently by Keith Thompson and by
9549 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
9550 stderr rather than stdout, messing up the build logs.
9551
7b5cdcbd
JD
95522006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9553
9554 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
9555 to make sure that YYID will never be unused. This fixes a 'make
9556 maintainer-check' failure caused by the recent changes to the 'Trivial
9557 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
9558 not used.
9559 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
9560
5ad0a449
JD
95612006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9562
9563 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
9564 state before an empty RHS is always resolved here. Only the location
9565 of that state is guaranteed to be resolved, and that's enough. This
9566 fixes the remaining bug reported by Derek M. Jones in
9567 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9568 * tests/glr-regression.at (Uninitialized location when reporting
9569 ambiguity): Test the above case.
9570 Also, the embedded comments in this test case claim it checks the case
9571 of an empty RHS that has inherited the initial location. However, the
9572 corresponding LHS was already resolved, so yyresolveLocations didn't
9573 actually have reason to modify it. Fix this by forcing
9574 nondeterministic operation at the beginning of the parse.
9575
50cce58e
PE
95762006-05-20 Paul Eggert <eggert@cs.ucla.edu>
9577
9578 * data/c.m4 (b4_yy_symbol_print_generate):
9579 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
9580 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
9581 of the bugs reported today by Derek M Jones in
9582 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9583 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
9584 defined to be a type name without parens or brackets.
9585 (Location Type): Similarly for YYLTYPE.
9586 * tests/regression.at (Trivial grammars): Put in a test for this
9587 bug that will be caught by 'make maintainer-check' (though not,
9588 alas, by 'make check' unless your compiler is picky).
9589
ab8d9dc5
PE
95902006-05-19 Paul Eggert <eggert@cs.ucla.edu>
9591
0d2c8934 9592 * NEWS: Version 2.2.
ab8d9dc5
PE
9593 * configure.ac (AC_INIT): Likewise.
9594
9138c575
JD
95952006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
9596
9597 * data/glr.c (yyreportTree): Make room in yystates for the state
9598 preceding the RHS. This fixes the segmentation fault reported by Derek
9599 M. Jones in
9600 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
9601 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
9602 to the user. Reported for yyreportTree by Derek M. Jones later in the
9603 same thread.
9604 * THANKS: Add Derek M. Jones.
9605 Update my email address.
9606 Fix typo in Steve Murphy's name.
9607
276f48df
PE
96082006-05-14 Paul Eggert <eggert@cs.ucla.edu>
9609
d6645148
PE
9610 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
9611 checking against YYLAST that caused the parser to miss a potential
9612 alternative in its diagnostic.
9613 Problem reported by Maria Jose Moron Fernandez in
9614 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
9615 * data/lalr1.cc (yysyntax_error_): Likewise.
9616 * data/yacc.c (yysyntax_error): Likewise.
9617 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
9618 tokens, in case we run into an older C compiler.
9619 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
9620 Use them to check for the off-by-one error fixed above.
9621
276f48df
PE
9622 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
9623 YYSIZE_T, not size_t.
9624 * tests/regression.at (Trivial grammars): New test, to catch
9625 the error fixed by the above patch.
9626
cd8b5791
AD
96272006-05-14 Akim Demaille <akim@lrde.epita.fr>
9628
9629 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
9630 scheme.
9631 Reported by Steve Murphy.
9632
34376418
AD
96332006-05-14 Akim Demaille <akim@lrde.epita.fr>
9634
9635 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
9636 * data/glr.cc: b4_location_flag is now b4_locations_flag.
9637
327afc7c
AD
96382006-05-14 Akim Demaille <akim@lrde.epita.fr>
9639
9640 Implement --trace=m4.
9641 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
9642 * src/output.c (output_skeleton): When set, pass -dV to m4.
9643
9644 Factor the handling of flags in m4.
9645 * src/output.c (prepare): Rename the muscle names debug, defines,
9646 error_verbose to debug_flag, defines_flag, error_verbose_flag.
9647 * data/c.m4: Adjust.
9648 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
9649 Use b4_define_flag_if to define other b4_FLAG_if macros.
9650 (b4_location_if): As a consequence, rename as...
9651 (b4_locations_if): this, for consistency.
9652 Adjust all the skeletons.
9653
ba9ecd19
AD
96542006-05-14 Akim Demaille <akim@lrde.epita.fr>
9655
9656 * etc/bench.pm: Shorten bench names.
9657
4e83ea15
AD
96582006-05-14 Akim Demaille <akim@lrde.epita.fr>
9659
9660 * src/output.h, src/output.c (error_verbose): Move to...
9661 * src/getargs.h, src/getargs.c: here.
9662 Sort the flags.
9663 Adjust dependencies.
9664
6e93d810
PE
96652006-05-13 Paul Eggert <eggert@cs.ucla.edu>
9666
9667 * data/c.m4 (b4_copyright): Put the special exception for Bison
9668 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
9669 uses changed. Suggested by Akim Demaille. Also, wrap the
9670 copyright notice, in case it is longer than 80 columns. Replace
9671 comma by newline after title.
6e93d810 9672
eaea13f5
PE
96732006-05-11 Paul Eggert <eggert@cs.ucla.edu>
9674
9675 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
9676 incompatibility, not a bug. Mention that it wasn't fixed as of
9677 flex 2.5.33.
9678
3cf084ec
AD
96792006-05-11 Akim Demaille <akim@lrde.epita.fr>
9680
9681 * examples/extexi: Enforce the precedence of concatenation over
9682 >>.
0a9f1c7d 9683 Reported by Tommy Nordgren.
3cf084ec 9684
32c96bd7
AD
96852006-05-11 Akim Demaille <akim@lrde.epita.fr>
9686
9687 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
9688 with the member "token".
f94705b2 9689 Reported by Martin Nylin.
32c96bd7 9690
eaea13f5
PE
96912006-05-08 Paul Eggert <eggert@cs.ucla.edu>
9692
9693 * data/glr.c: Switch to Bison 2.2 special-exception language in
9694 the copyright notice. Use more-regular format for titles and
9695 copyright notices.
9696 * data/glr.cc: Likewise.
9697 * data/location.cc: Likewise.
9698 * data/yacc.cc: Likewise.
9699 * doc/bison.texinfo (Conditions): Document this.
9700 * NEWS: likewise. Upgrade version to 2.2.
9701
6e2d1146
AD
97022006-04-27 Akim Demaille <akim@lrde.epita.fr>
9703
9704 * data/glr.cc: Remove dead code.
9705
47671055
PE
97062006-04-25 Paul Eggert <eggert@cs.ucla.edu>
9707
9708 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
9709 that variable and the line breaks the bootstrap. Problem reported
9710 by Juan M. Guerrero.
9711
ed2e6384
AD
97122006-04-24 Akim Demaille <akim@lrde.epita.fr>
9713
9714 * doc/bison.texinfo (Multiple start-symbols): New.
9715
3cedc2dc
AD
97162006-04-24 Akim Demaille <akim@lrde.epita.fr>
9717
9718 * etc/README, etc/bench.pl: New.
9719
b2ddc3f3
AD
97202006-04-03 Akim Demaille <akim@lrde.epita.fr>
9721
9722 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
9723 rule.
9724 Reported by Mickael Labau.
9725 * tests/input.at (Torturing the Scanner): Test it.
9726
91e3ac9a
PE
97272006-03-16 Paul Eggert <eggert@cs.ucla.edu>
9728
9729 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
9730 Problem reported by Bob Rossi.
9731
97322006-03-13 Paul Eggert <eggert@cs.ucla.edu>
9733
9734 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
9735 and didn't really work.
9736 For the index, use @ifnotinfo, not @iftex.
9737 Minor cleanups of spacing and terminology.
9738
5cf61e93
AD
97392006-03-12 Akim Demaille <akim@lrde.epita.fr>
9740
9741 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
9742 of AT_NAME_PREFIX when %name-prefix is not used.
9743
aa08666d
AD
97442006-03-12 Akim Demaille <akim@lrde.epita.fr>
9745
9746 Apply --prefix to C++ skeletons too: they change the namespace.
9747 The test suite already exercize these cases.
9748 * data/c++.m4 (b4_namespace): New.
9749 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
9750 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
9751 * data/yacc.c, data/glr.c: Remove a useless `[]'.
9752 * doc/bison.texinfo: Document it.
9753 (Option Cross Key): Use @multitable in all formats. It looks
9754 nicer, even in TeX outputs.
9755 (Rules): Use the same code whatever the output type is.
9756 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
9757 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
9758 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 9759
45567173
AD
97602006-03-10 Akim Demaille <akim@lrde.epita.fr>
9761
9762 * TODO: Remove dead items.
9763
e9d8f881 97642006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
9765
9766 * doc/FAQ: Remove, merged into...
9767 * doc/bison.texinfo (FAQ): this.
9768 * doc/Makefile.am (EXTRA_DIST): Adjust.
9769
c095d689
AD
97702006-03-10 Akim Demaille <akim@lrde.epita.fr>
9771
9772 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
9773 even if empty.
9774 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
9775 * doc/bison.texinfo (Calc++ Scanner): Use it.
9776
6e0f8287
PE
97772006-03-09 Paul Eggert <eggert@cs.ucla.edu>
9778
9779 Fix two nits reported by twlevo, plus one more that I discovered.
9780
9781 * src/assoc.h (assoc_to_string): Give a name to the arg, as
9782 this is the usual Bison style.
9783 * src/location.h (location_print): Likewise.
9784
9785 * src/reader.h (token_name): Likewise.
9786
d6b771c3
PE
97872006-03-08 Paul Eggert <eggert@cs.ucla.edu>
9788
9789 Fix some nits reported by twlevo.
9790 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
9791 and "POSIX". Use more-modern syntax for URLs. Mention C++
9792 and ask for Java. Don't hardwire OS version numbers. Add
9793 copyright notice.
9794 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
9795 * src/conflicts.c (solved_conflicts_obstack): Now static.
9796
1e137b71
JD
97972006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
9798
9799 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
9800 page. Say "you can use it" not "you may use it" as on the web page;
9801 we're describing capabilities not granting permission.
9802
73f2e47e
PE
98032006-03-06 Paul Eggert <eggert@cs.ucla.edu>
9804
6d05403d
PE
9805 * data/glr.c (yyresolveLocations): Rename local variables to avoid
9806 shadowing warnings. Use usual patter for iterating through RHS.
9807 * tests/glr-regression.at
9808 (Uninitialized location when reporting ambiguity):
9809 Modify yylex so that it uses its argument, rather than trying
9810 to rely on ARGSUSED (which doesn't work for gcc with warnings).
9811 const char -> char const.
9812
73f2e47e
PE
9813 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
9814 Don't use tabs inside commands; it messes up 'ps'.
9815 Problem reported by twlevo.
9816
8710fc41
JD
98172006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
9818
9819 * tests/glr-regression.at (Uninitialized location when reporting
9820 ambiguity): New test case.
9821 * data/glr.c (yyresolveLocations): New function, which uses
9822 YYLLOC_DEFAULT.
9823 (yyresolveValue): Invoke yyresolveLocations before reporting an
9824 ambiguity.
9825 * doc/bison.texinfo (Default Action for Locations): Note
9826 YYLLOC_DEFAULT's usage for ambiguity locations.
9827 (GLR Semantic Actions): Cross-reference those notes.
9828
ae952af2
JD
98292006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
9830
9831 * tests/glr-regression.at (Leaked semantic values when reporting
9832 ambiguity): Remove unnecessary union and type declarations.
9833 (Leaked lookahead after nondeterministic parse syntax error): New test
9834 case.
9835 * data/glr.c (yyparse): Check for zero stacks remaining before
9836 attempting to shift the lookahead so that you don't lose it.
9837
35ee866a
JD
98382006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9839
9840 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
9841 * tests/glr-regression.at (Leaked semantic values when reporting
9842 ambiguity): New test case.
9843 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
9844 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
9845 now unnecessary yystackp parameter.
9846 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
9847 destructors can be called.
9848
9849 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
9850 in existing testcases.
9851
520181ab
JD
98522006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9853
9854 Don't leak semantic values for parent RHS when a user action cuts the
9855 parser, and clean up related code a bit.
9856 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
9857 cuts parse): Rename to...
9858 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
9859 for leaked parent RHS values.
9860 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
9861 between an unresolved state (non-empty chain of semantic options) and
9862 an incomplete one (signaled by an empty chain).
ae952af2 9863 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
9864 successfully or unsuccessfully resolved yyGLRState to...
9865 (yyresolveValue): ... here so that yyresolveValue always leaves a
9866 yyGLRState with consistent data and thus is easier to understand.
9867 Remove the yyvalp and yylocp parameters since they are always just
9868 taken from the yys parameter. When reporting a discarded merged value
9869 in debugging output, note that it is incompletely merged. Document the
9870 interface.
9871 (yyresolveAction): If resolving any of the RHS states fails, destroy
9872 them all rather than leaking them. Thus, as long as user actions are
9873 written to clean up the RHS correctly, yyresolveAction always cleans up
9874 the RHS of a semantic option. Document the interface.
9875
18d9185c
PE
98762006-02-27 Paul Eggert <eggert@cs.ucla.edu>
9877
9878 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
9879 led to a segmentation fault in GNU Pascal. Problem reported
9880 by Waldek Hebisch.
9881
841a7737
JD
98822006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
9883
9884 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
9885 mid-rule action inside a nonterminal symbol in order to declare a
9886 destructor for its semantic value.
9887
fc3f467f
PE
98882006-02-16 Paul Eggert <eggert@cs.ucla.edu>
9889
9890 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
9891 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
9892 __cplusplus && ! defined _STDLIB_H && !
9893 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
9894 defined free))]: Include <stdlib.h> rather than rolling our own
9895 declarations of malloc and free, to avoid problems with
9896 incompatible declarations (using 'throw') C++'s stdlib.h. This
9897 should fix Debian bug 340012
9898 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
9899 reported by Guillaume Melquiond.
9900
a3af26dd
PE
99012006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9902
4d7bc38c
PE
9903 * NEWS: Clarify symbols versus types in unused-value warnings.
9904
a3af26dd
PE
9905 * configure.ac (AC_INIT): Bump version number.
9906
4e26c69e
PE
99072006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9908
9909 * NEWS: Version 2.1a.
9910 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
9911 since C99 requires this.
9912
498e897c
PE
99132006-02-11 Paul Eggert <eggert@cs.ucla.edu>
9914
9915 * m4/c-working.m4: New file.
9916 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
9917
57bb17ca
PE
99182006-02-10 Paul Eggert <eggert@cs.ucla.edu>
9919
9920 * Makefile.maint: Merge from coreutils.
9921
0be105dc
PE
99222006-02-09 Paul Eggert <eggert@cs.ucla.edu>
9923
9924 More portability fixes for problems summarized by Nelson H. F. Beebe.
9925
9926 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
9927 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
9928 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
9929 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
9930 messes up because C++ code is compiled in 32-bit mode but linked
9931 in 64-bit mode.
9932
6fc0c024
PE
99332006-02-08 Paul Eggert <eggert@cs.ucla.edu>
9934
9935 More portability fixes for problems summarized by Nelson H. F. Beebe.
9936
7870f699
PE
9937 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
9938 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
9939
6fc0c024
PE
9940 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
9941 nodist_PROGRAMS, since we don't need to actually compile the
9942 example if we're just doing a plain 'make'. This avoids bothering
9943 the installer unnecessarily about problems due to weird C++
9944 compilers.
9945
fe6c2fde
PE
99462006-02-06 Paul Eggert <eggert@cs.ucla.edu>
9947
9948 More portability fixes for problems summarized by Nelson H. F. Beebe.
9949
9950 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
9951 than #include "...", and compile with -I'.'. The old method was
9952 not portable, according to Posix and the C standard, and it does
9953 not work with Sun C 5.7, where previous #line directives affect
9954 the working directory used in later #include "..." directives.
9955
927b425b
JMG
99562006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9957
9958 Various DJGGP specific issues in /djgpp
9959
d9735e9e
PE
99602006-02-02 Paul Eggert <eggert@cs.ucla.edu>
9961
9962 More portability fixes for problems summarized by Nelson H. F. Beebe.
9963
9964 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
9965 '#include <map>' works and that you can apply ++ to iterators.
9966
5a6755af
PE
99672006-02-01 Paul Eggert <eggert@cs.ucla.edu>
9968
67a0dc4f
PE
9969 Work around portability problems summarized by Nelson H. F. Beebe in
9970 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
9971
8c86f0ef
PE
9972 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9973 that '#include <string>' works.
9974
de35dd59
PE
9975 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
9976 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
9977 "warning: sorry: semantics of inline function static data `const
9978 unsigned char translate_table[262]' are wrong (you'll wind up with
9979 multiple copies)".
9980
67a0dc4f
PE
9981 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
9982 or, xor to not_, and_, or_, and xor_, respectively. This works
9983 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
9984 random system header somewhere that includes the equivalent of
9985 <iso646.h>.
9986
5a6755af
PE
9987 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
9988 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 9989 Suite Version 2.0.
5a6755af 9990
3f001415
JD
99912006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
9992
9993 During deterministic GLR operation, user actions should be able to
9994 influence the parse by changing yychar. To make this easier to fix and
9995 to make glr.c easier to evolve in general, don't maintain yytoken in
9996 parallel with yychar; just compute yytoken when needed.
9997 * tests/glr-regression.at (Incorrect lookahead during deterministic
9998 GLR): Check that setting yychar in a user action has the intended
9999 effect.
10000 * data/glr.c (yyGLRStack): Remove yytokenp member.
10001 (yyclearin): Don't set *yytokenp.
10002 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
10003 yychar rather than *yytokenp to determine the current lookahead.
10004 Compute yytoken locally when needed.
10005 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
10006 point to.
10007
10008 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
10009 after `--report' documentation.
10010
e2a8c0f5
PE
100112006-01-30 Paul Eggert <eggert@cs.ucla.edu>
10012
10013 * src/parse-gram.y (grammar_declaration): Location of printer
10014 symbol is @1, not list->location. Bug reported by twlevo.
10015 * tests/input.at (Incompatible Aliases): Adjust to above change.
10016
6b702268
PE
100172006-01-29 Paul Eggert <eggert@cs.ucla.edu>
10018
27622431
PE
10019 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
10020 all the test at once. This makes the output easier to read in the
10021 normal case.
10022
6b702268
PE
10023 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
10024 got from <http://bro-ids.org/download.html>. The bug is that
10025 when two actions appeared in succession, the second one was
10026 scanned before the first one was added to the grammar rule
10027 as a midrule action. Bison then output the incorrect warning
10028 "parse.y:905.17-906.36: warning: unused value: $3".
10029 * src/parse-gram.y (BRACED_CODE, action): These are no longer
10030 associated with a value.
10031 (rhs): Don't invoke grammar_current_rule_action_append.
10032 (action): Invoke it here instead.
10033 * src/reader.c (grammar_midrule_action): Now extern.
10034 (grammar_current_rule_action_append): Don't invoke
10035 grammar_midrule_action; that is now the scanner's job.
10036 * src/reader.h (last_string, last_braced_code_loc):
10037 (grammar_midrule_action): New decls.
10038 * src/scan-gram.l (last_string): Now extern, sigh.
10039 (last_braced_code_loc): New extern variable.
10040 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
10041 rule already has an action.
10042 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
10043 * tests/input.at (AT_CHECK_UNUSED_VALUES):
10044 Add some tests to check that the above changes fixed the bug.
10045
d40ba6c2
PE
100462006-01-27 Paul Eggert <eggert@cs.ucla.edu>
10047
10048 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
10049 All used changed. Check whether the symbol has a destructor,
10050 not whether it is typed.
10051 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
10052 that the values are still reported as unused. All line numbers
10053 adjusted.
10054
401aace6
PE
100552006-01-23 Paul Eggert <eggert@cs.ucla.edu>
10056
10057 Work around a bug in bro 0.8, which underparenthesizes its
10058 definition of YYLLOC_DEFAULT.
10059 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
10060 their arguments.
10061 * data/lalr1.cc: Likewise.
10062 * data/yacc.cc: Likewise.
10063
06f01bc4
PE
100642006-01-22 Paul Eggert <eggert@cs.ucla.edu>
10065
401aace6
PE
10066 Work around a bug in Pike 7.0, and give the Pike folks a
10067 better way to override the usual int widths.
10068 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
10069 user can override the types.
10070 (short): #undef, to work around a bug in Pike 7.0.
10071 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
10072 (union yyalloc.yyss): Use yytype_int16 rather than short.
10073 All uses changed.
10074 (yysigned_char): Remove.
10075 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
10076 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
10077 * tests/regression.at (Web2c Actions): Adjust to above changes.
10078
10079 * src/reader.c (check_and_convert_grammar): New function.
10080 (reader): Close the input file even if something went wrong during
10081 parsing. Minor file descriptor leak reported by twlevo.
10082
06f01bc4
PE
10083 * src/assoc.c (assoc_to_string): Use a default: abort (); case
10084 to pacify gcc -Wswitch-default.
10085 * src/scan-gram.l (adjust_location): Use a default: break; case
10086 to pacify gcc -Wswitch-default.
10087 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
10088 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10089 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10090 Move these decls to scan-skel.l, since they don't need to be
10091 visible elsewhere.
10092 * src/scan-skel.l: Accept the above decls.
10093 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
10094 is used.
10095
02650b7f
PE
100962006-01-21 Paul Eggert <eggert@cs.ucla.edu>
10097
10098 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
10099 since we don't want to insist on a version number at the start
10100 of the changelog every time.
10101 * Makefile.maint: Sync from coreutils a bit better.
10102 (sc_trailing_blank): Renamed from sc_trailing_space.
10103 All uses changed.
10104 (sc_no_if_have_config_h, sc_require_config_h):
10105 (sc_prohibit_assert_without_use): New rules.
10106 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
10107 (sc_dd_max_sym_length): Fix leading spaces in rule.
10108 (sc_system_h_headers): Prefix with @.
10109 (sc_useless_cpp_parens, m4-check): Output line numbers.
10110 (changelog-check): Allow version only in head.
10111 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
10112 satisfy new Makefile.maint rule.
10113 * data/glr.c: Likewise.
10114 * data/glr.cc: Likewise.
10115 * data/lalr1.cc: Likewise.
10116 * data/yacc.c: Likewise.
10117 * lib/ebitsetv.c: Likewise.
10118 * lib/lbitset.c: Likewise.
10119 * lib/subpipe.c: Likewise.
10120 * lib/timevar.c: Likewise.
10121 * src/system.h: Likewise.
10122 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
10123 * djgpp/Makefile.maint: Add copyright notice.
10124 * djgpp/README.in: Likewise.
10125 * djgpp/config.bat: Likewise.
10126 * djgpp/config.site: Likewise.
10127 * djgpp/config_h.sed: Likewise.
10128 * djgpp/djunpack.bat: Likewise.
10129 * djgpp/config.sed: Fix copyright notice to match standard format.
10130 * djgpp/subpipe.h: Likewise.
10131 * lib/bitsetv-print.c: Likewise.
10132 * lib/bitsetv.c: Likewise.
10133 * lib/subpipe.h: Likewise.
10134 * lib/timevar.c: Likewise.
10135 * lib/timevar.h: Likewise.
10136 * djgpp/subpipe.c: Use standard recipe for config.h.
10137 * lib/abitset.c: Likewise.
10138 * lib/bitset.c: Likewise.
10139 * lib/bitset_stats.c: Likewise.
10140 * lib/bitsetv-print.c: Likewise.
10141 * lib/bitsetv.c: Likewise.
10142 * lib/ebitsetv.c: Likewise.
10143 * lib/get-errno.c: Likewise.
10144 * lib/lbitset.c: Likewise.
10145 * lib/subpipe.c: Likewise.
10146 * lib/timevar.c: Likewise.
10147 * lib/vbitset.c: Likewise.
10148 * tests/local.at: Likewise.
10149 * src/scan-gram.l: Don't include verify.h, since system.h does
10150 that for us.
10151 * .x-sc_require_config_h: New file.
10152 * .x-sc_unmarked_diagnostics: New file.
10153
287c78f6
PE
101542006-01-20 Paul Eggert <eggert@cs.ucla.edu>
10155
287c78f6
PE
10156 Be a bit more systematic about using 'abort'.
10157 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
10158 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
10159 Put 'default: abort ();' before some other case, to satisfy older
10160 pedantic compilers.
10161 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10162 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
10163 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
10164 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
10165 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
10166 (get_decision_str, get_orientation_str, get_node_alignment_str):
10167 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
10168 (get_linestyle_str, get_arrowstyle_str): Likewise.
10169 * src/conflicts.c (resolve_sr_conflict):
10170 Use a default case rather than one for the one remaining enum
10171 value, to catch invalid enum values as well.
10172 * src/lalr.c (set_goto_map, map_goto):
10173 Prefer "assert (FOO);" to "if (!FOO) abort ();".
10174 * src/nullable.c (nullable_compute, token_definitions_output):
10175 Likewise.
10176 * src/reader.c (packgram, reader): Likewise.
10177 * src/state.c (transitions_to, state_new, state_reduction_find):
10178 Likewise.
10179 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
10180 (symbol_pack): Likewise.
10181 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
10182 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
10183 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
10184 * src/system.h: Don't include <assert.h>.
10185 (assert): New macro.
10186
10187 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
10188 (Destructor Decl, Parser Function, Pure Calling):
10189 Describe rules for braces inside C code more carefully.
287c78f6 10190
c66dfadd
PE
101912006-01-19 Paul Eggert <eggert@cs.ucla.edu>
10192
c21493b8
PE
10193 Fix some porting glitches found by Nelson H. F. Beebe.
10194 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
10195 compilers that don't understand that abort () does not return.
10196 * src/state.c (transitions_to): Likewise.
10197 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10198 that '#include <cstdlib>' works.
10199 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
10200 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
10201 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
10202 for the benefit of some pre-C99 compilers.
10203
b6e3facf
PE
10204 * bootstrap: Undo changes to gnulib files that autoreconf made.
10205
c66dfadd
PE
10206 Minor fixups to get 'make maintainer-check' to work.
10207 * configure.ac: Don't use -Wnested-externs, as it's incompatible
10208 with the new verify.h implementation.
10209 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
10210 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
10211 * data/yacc.c (YYUSE): Likewise.
10212 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
10213 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
10214 * src/parse-gram.y (declaration): Don't pass a string constant
10215 to a function that expects char *, since GCC might complain
10216 about the constant value.
10217 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
10218 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
10219 before #defining them.
10220 * tests/glr-regression.at
10221 (Incorrectly initialized location for empty right-hand side in GLR):
10222 In yyerror, use the msg arg.
10223 (Corrupted semantic options if user action cuts parse):
10224 (Incorrect lookahead during deterministic GLR):
10225 (Incorrect lookahead during nondeterministic GLR):
10226 Don't name a local var 'index'; it shadows string.h's 'index'.
10227
ed94ef2a
AD
102282006-01-19 Akim Demaille <akim@epita.fr>
10229
10230 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
10231 location, not just parts of it.
10232
e9ad4aec
PE
102332006-01-18 Paul Eggert <eggert@cs.ucla.edu>
10234
d6ca7905
PE
10235 * NEWS: Document the fact that multiple %unions are now allowed.
10236 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
10237 * TODO: This feature is now implemented, so remove it from
10238 the wishlist.
d6ca7905 10239
ef1b70e0
PE
10240 * Makefile.maint: Merge with coreutils Makefile.maint.
10241 (CVS_LIST): Use build-aux version if available.
10242 (VERSION_REGEXP): New macro.
10243 (syntax-check-rules): Add sc_no_if_have_config_h,
10244 sc_prohibit_assert_without_use, sc_require_config_h,
10245 sc_useless_cpp_parens.
10246 (sc_obsolete_symbols): Check for O_NDELAY.
10247 (sc_dd_max_sym_length): Track coreutils.
10248 (sc_unmarked_diagnostics): Look in all files, not just *.c.
10249 (sc_useless_cpp_parens): New rule.
10250 (news-date-check): Look for version or today's date.
10251 (changelog-check): Don't require version number near head.
10252 (copyright-check): Use current year instead of hardwiring 2005.
10253 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
10254 (announcement): Add --gpg-key-ID.
10255
10256 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
10257 with "file system".
10258
2073ce56 10259 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
10260 array. Problem reported by twlevo.
10261 * src/reader.c (packgram): Prepend a new sentinel before ritem.
10262 * src/lalr.c (build_relations): Rely on new sentinel.
10263 * src/gram.c (gram_free): Adjust to new sentinel.
10264
b7691f15
JD
102652006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
10266
10267 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
10268 yylookaheadNeeds. All uses updated.
10269 (yysplitStack): Rename local yynewLookaheadStatuses to
10270 yynewLookaheadNeeds.
10271 * data/glr-regression.at (Incorrect lookahead during nondeterministic
10272 GLR): In comments, change `lookahead status' to `lookahead need'.
10273
ddee1b06
PH
102742006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10275
10276 * data/glr.c (yysplitStack): A little stylistic rewrite.
10277
12f4614d
PH
102782006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10279
10280 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
10281
32c29292
JD
102822006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
10283
10284 * doc/bison.texinfo: Fix some typos.
10285 (GLR Semantic Actions): New subsection discussing special
10286 considerations because GLR semantic actions might be deferred.
10287 (Actions): Mention look-ahead usage of yylval.
10288 (Actions and Locations): Mention look-ahead usage of yylloc.
10289 (Special Features for Use in Actions): Add YYEOF entry and mention it
10290 in the yychar entry.
10291 In the yychar entry, remove mention of the local yychar case (pure
10292 parser) since this is irrelevant information when writing semantic
148d66d8 10293 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
10294 yychar is otherwise described as an external variable.
10295 In the yychar entry, don't call it the `current' look-ahead since it
10296 isn't when semantic actions are deferred.
10297 In the yychar and yyclearin entries, add note about deferred semantic
10298 actions.
10299 Add yylloc and yylval entries discussing look-ahead usage.
10300 (Look-Ahead Tokens): When discussing yychar, don't call it the
10301 `current' look-ahead, and do mention yylval and yylloc.
10302 (Error Recovery): Cross-reference `Action Features' when mentioning
10303 yyclearin.
148d66d8 10304 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
10305 look-ahead.
10306 In the yylloc and yylval entries, mention look-ahead usage.
10307
de366a2f 103082006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
10309
10310 * tests/glr-regression.at: Update copyright year to 2006.
10311
bf70fa87
JD
103122006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10313
10314 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
10315 use during nondeterministic operation to track which stacks have
10316 actually needed the current lookahead.
10317 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
10318 Allocate, deallocate, resize, and otherwise shuffle space for
10319 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
10320 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
10321 appropriately during nondeterministic operation.
10322 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
10323 members to store the current lookahead to be used by the deferred
10324 user action.
10325 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
10326 from which the RHS is taken. Set the lookahead members of the new
10327 yySemanticOption according to the lookahead status for stack yyk.
10328 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
10329 yyaddDeferredAction.
10330 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
10331 members of yySemanticOption before invoking yyuserAction, and then set
10332 them back to their current values afterward.
10333 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
10334 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
10335 * tests/glr-regression.at: Remove `.' from the ends of recent test case
10336 titles for consistency.
10337 (Leaked merged semantic value if user action cuts parse): In order to
10338 suppress lint warnings, use arguments in merge function, and assign
10339 char value < 128 in main.
10340 (Incorrect lookahead during deterministic GLR): New test case.
10341 (Incorrect lookahead during nondeterministic GLR): New test case.
10342
05449a2c
JD
103432006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10344
de366a2f 10345 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
10346 !yyvaluep as signal that no semantic value is available to print.
10347 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
10348 to print a semantic value.
10349
4158e0a1 103502006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 10351
4158e0a1
JD
10352 * tests/glr-regression.at: For consistency with my newer test cases,
10353 don't thank myself.
10354
d659304d
JD
103552006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
10356
10357 * data/glr.c (yyresolveValue): When merging semantic options, if at
10358 least one user action succeeds but a later one cuts the parse, then
10359 destroy the semantic value before returning rather than leaking it.
10360 (yyresolveStates): If a user action cuts the parse and thus
10361 yyresolveValue fails, ignore the (unset) semantic value rather than
10362 corrupting the yyGLRState, and empty the semantic options list since
10363 the user actions should have called all necessary destructors.
10364 Simplify code with YYCHK.
10365 * tests/glr-regression.at (Corrupted semantic options if user action
10366 cuts parse): New test case.
10367 (Undesirable destructors if user action cuts parse): New test case.
10368 Before applying any of this patch, this test case never actually failed
10369 for me... but only because the corrupted semantic options usually
10370 masked this bug.
10371 (Leaked merged semantic value if user action cuts parse): New test
10372 case.
10373
6ec2c0f2
AD
103742006-01-05 Akim Demaille <akim@epita.fr>
10375
10376 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
10377
1b9c21fb
PE
103782006-01-04 Paul Eggert <eggert@cs.ucla.edu>
10379
10380 * data/c.m4 (b4_c_modern): New macro, with a new provision for
10381 _MSC_VER. Problem reported by Cenzato Marco.
10382 (b4_c_function_def): Use it.
10383 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
10384 b4_c_modern.
10385 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
10386 than rolling our own.
10387
84866159
AD
103882006-01-04 Akim Demaille <akim@epita.fr>
10389
10390 Also warn about non-used mid-rule values.
10391 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
10392 member.
10393 (symbol_list_new): Adjust.
10394 * src/reader.c (symbol_typed_p): New.
10395 (grammar_rule_check): Use it.
10396 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
10397 Check its rule.
10398 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
10399 Use it.
10400 * tests/actions.at (Exotic Dollars): Adjust.
10401
378f4bd8
AD
104022006-01-04 Akim Demaille <akim@epita.fr>
10403
10404 * src/reader.c (grammar_midrule_action): If $$ is set in a
10405 mid-rule, move the `used' bit to its lhs.
10406 * tests/input.at (Unused values): New.
10407 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
10408
e2a21b6f
PE
104092006-01-03 Paul Eggert <eggert@cs.ucla.edu>
10410
54662697
PE
10411 * doc/bison.texinfo (Bison Options): Say more accurately what
10412 --yacc does.
10413 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
10414 about declarations in the grammar when in Yacc mode, as POSIX does
10415 not require a diagnostic when the grammar uses extensions.
10416
10417 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
10418
073f9288
PE
10419 Warn about dubious constructions like "%token T T".
10420 Reported by twlevo.
10421 * src/symtab.h (struct symbol.declared): New member.
10422 * src/symtab.c (symbol_new): Initialize it to false.
10423 (symbol_class_set): New arg DECLARING, specifying whether
10424 this is a declaration that we want to warn about, if there
10425 is more than one of them. All uses changed.
10426
1221b78a
PE
10427 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
10428 Allow multiple %union directives, whose contents concatenate.
10429 * src/parse-gram.y (grammar_declaration): Likewise.
10430 Use muscle_code_grow, so that we don't need stype_line any more.
10431 All uses changed.
10432
10433 * src/muscle_tab.c (muscle_grow): Fix comment.
10434
e2a21b6f
PE
10435 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
10436 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
10437 Update copyright year to 2006.
10438
8f7e3cf9
AD
104392006-01-03 Akim Demaille <akim@epita.fr>
10440
10441 Have glr.cc pass (some of) the calc.at tests.
10442 * data/glr.cc (b4_parse_param_orig): New.
10443 (b4_parse_param): Improve its definition, and bound it more
10444 clearly in the skeleton.
10445 (b4_epilogue): Append, instead of prepending, in order to keep
10446 #line consistency.
10447 Simplify the generation of auxiliary functions: locations and
10448 purity are mandated.
10449 (b4_global_tokens_and_yystype): Honor it.
10450 * data/location.cc (c++.m4): Don't include it.
10451 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
10452 and AT_SKEL_CC_IF.
10453 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
10454 AT_LALR1_CC_IF.
10455 Be sure to initialize the first position's filename.
10456 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
10457 mandated anyway.
10458 (AT_CHECK_CALC_GLR_CC): New.
10459 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
10460
3953ed88
AD
104612006-01-02 Akim Demaille <akim@epita.fr>
10462
10463 * src/output.c (output_skeleton): Don't hard wire the inclusion of
10464 c.m4.
0a96ba81 10465 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
10466 * data/glr.cc: Do not include stack.hh.
10467
9ecafbbf
AD
104682006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
10469
10470 * data/glr.c: Reformat whitespace with tabs.
10471 (b4_lpure_formals): Remove this unused m4 macro.
10472 * tests/cxx-type.at: Reformat whitespace with tabs.
10473 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
10474 since it's a member. Rename type to isNterm for clarity.
10475
c4d497a0
AD
104762005-12-29 Akim <akim@sulaco.local>
10477
10478 Let glr.cc catch up with symbol_value_print.
10479 * data/glr.cc (b4_yysymprint_generate): Replace by...
10480 (b4_yy_symbol_print_generate): this.
10481 (yy_symbol_print, yy_symbol_value_print): Declare them.
10482
4517da37
PE
104832005-12-28 Paul Eggert <eggert@cs.ucla.edu>
10484
10485 * src/location.h (boundary): Note that a line or column equal
10486 to INT_MAX indicates an overflow.
10487 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
10488 (rule_length_overflow, increment_rule_length, add_column_width):
10489 New functions.
10490 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
10491 (<SC_BRACED_CODE>"}"):
10492 Use increment_rule_length rather than incrementing it by hand.
10493 (adjust_location, handle_syncline): Diagnose overflow.
10494 (handle_action_dollar, handle_action_at):
10495 Fix bug with monstrosities like $-2147483648.
10496 Remove now-unnecessary checks.
10497 (scan_integer): Verify assumptions and remove now-unnecessary checks.
10498 (convert_ucn_to_byte): Verify assumptions.
10499 (handle_syncline): New arg LOC. All callers changed.
10500 Don't store through a value derived from char const * pointer.
10501
10502 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
10503 GCC warnings.
10504
e3233bf6
PE
105052005-12-27 Paul Eggert <eggert@cs.ucla.edu>
10506
10507 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
10508 Remove unnecessary forward static decls.
10509
8f3596a6
AD
105102005-12-27 Akim Demaille <akim@epita.fr>
10511
10512 * src/reader.c (grammar_current_rule_check): Also check that $$
10513 is used.
10514 Take the rule to check as argument, hence rename as...
10515 (grammar_rule_check): this.
10516 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
10517 Rename as...
10518 (grammar_rule_begin, grammar_rule_end): these, for consistency.
10519 (grammar_midrule_action, grammar_symbol_append): Now static.
10520 * tests/torture.at (input): Don't rely on the default action
10521 being always performed.
10522 * tests/calc.at: "Set" $$ even when the action is "cut" with
10523 YYERROR or other.
10524 * tests/actions.at (Exotic Dollars): Instead of using unused
10525 values, check that the warning is issued.
10526
721be13c
PE
105272005-12-22 Paul Eggert <eggert@cs.ucla.edu>
10528
10529 * NEWS: Improve wording for unused-value warnings.
10530
a0af42fc
AD
105312005-12-22 Akim Demaille <akim@epita.fr>
10532
10533 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
10534 (b4_yysymprint_generate): Rename as...
10535 (b4_yy_symbol_print_generate): this.
10536 Generate yy_symbol_print instead of yysymprint.
10537 Generate also yy_symbol_value_print, and use it.
10538
affac613
AD
105392005-12-22 Akim Demaille <akim@epita.fr>
10540
721be13c 10541 * NEWS: Warn about unused values.
affac613
AD
10542 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
10543 a `used' member.
10544 (symbol_list_n_get, symbol_list_n_used_set): New.
10545 (symbol_list_n_type_name_get): Use symbol_list_n_get.
10546 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
10547 * src/reader.c (grammar_current_rule_check): Check that values are
10548 used.
10549 * src/symtab.c (symbol_print): Accept 0.
10550 * tests/existing.at: Remove the type information.
10551 Empty the actions.
10552 Remove useless actions (beware of mid-rule actions: perl -000
10553 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
10554 * tests/actions.at (Exotic Dollars): Use unused values.
10555 * tests/calc.at: Likewise.
10556 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10557 Likewise.
10558
10559 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
10560 rule_useful_p.
10561
9d9b8b70
PE
105622005-12-21 Paul Eggert <eggert@cs.ucla.edu>
10563
8bb4c753
PE
10564 Undo 2005-12-01 tentative license wording change. The wording is
10565 still being reviewed by the lawyers, and we don't want to wait for
10566 them before publishing a test release. For now, revert to the
10567 previous wording.
10568 * NEWS: Undo 2005-12-01 change.
10569 * data/glr.c: Revert to previous license wording.
10570 * data/glr.cc: Likewise.
10571 * data/lalr1.cc: Likewise.
10572 * data/location.cc: Likewise.
10573 * data/yacc.c: Likewise.
10574
9d9b8b70
PE
10575 * NEWS: Reword %destructor vs YYABORT etc.
10576 * data/glr.c: Use American spacing, for consistency.
10577 * data/glr.cc: Likewise.
10578 * data/lalr1.cc: Likewise.
10579 * data/yacc.c: Likewise.
10580 * data/yacc.c: Reformat comments slightly.
10581 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
10582 for consistency. Fix some spelling errors and reword recently-included
10583 text slightly.
10584 * tests/cxx-type.at: Cast results of malloc, for C++.
10585
2c3b392a
AD
105862005-12-21 Joel E. Denny <address@hidden>
10587
10588 * tests/cxx-type.at: Construct a tree, count the parents of shared
10589 nodes, and free each node once and only once. Previously, the memory
10590 for semantic values was leaked instead.
10591
d6cff4dc
AD
105922005-12-21 Joel E. Denny <address@hidden>
10593
10594 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
10595 (yylval, yylloc): If pure, #define to yystackp->yyval and
10596 yystackp->yyloc similar to yychar and yynerrs.
10597 (yyparse): If pure, remove local yylval and yylloc. Add local
10598 yystackp to accommodate pure definitions of yylval and yylloc.
10599 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
10600 yylvalp and yyllocp to &yylval and &yylloc.
10601 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
10602 namespace. Previously, nerrs and char were missing, but lval and lloc
10603 weren't necessary.
10604 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
10605 yylvalp and yyllocp parameters since, if pure, these are now always
10606 accessible through yystackp. If not pure, they are still accessible
10607 globally.
10608 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
10609 `if (YYID (N))' to pacify lint.
10610
a85284cf
AD
106112005-12-21 Akim Demaille <akim@epita.fr>
10612
10613 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
10614 destroy the RHS symbols of a rule.
10615 * data/yacc.c (yylen): Initialize to 0.
10616 Keep its value to the number of items to possibly shift.
10617 In particular, a regular successful parse that ends on YYFINAL by
10618 a (internal) YYACCEPT must not have yylen != 0.
10619 (yyerrorlab, yyreturn): Pop the RHS.
10620 Reorder a bit to emphasize the `shifting' bits of code.
10621 (YYPOPSTACK): Now accept a number of items to pop.
10622 * data/lalr1.cc: Likewise.
10623 * data/glr.c: Formatting changes.
10624 Use goto instead of fall through.
10625 * doc/bison.texinfo (Destructor Decl): Complete.
10626
d508c281
JMG
106272005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10628
10629 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10630 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
10631 * djgpp/config.bat: Replace every occurence of the file name
10632 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10633 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10634 * djgpp/config.sed: Replace every occurence of the file name
10635 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10636 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10637 * djgpp/djunpack.bat: DJGPP specific file.
10638 * djgpp/fnchange.lst: DJGPP specific file.
10639 * djgpp/README.in: Add new information about how to unpack the bison
10640 source on MSDOS and other systems which have 8.3 file name restrictions
10641 using djunpack.bat and fnchange.lst.
10642
3e7a2cd9
PE
106432005-12-12 Paul Eggert <eggert@cs.ucla.edu>
10644
10645 * bootstrap (build_cvs_prefix): Remove; unused.
10646 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
10647 when getting gnulib.
10648
106492005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
10650
10651 * data/glr.c: Reorder typedef declarations for structs to match order
10652 of struct declarations.
10653 Rename yystack everywhere to yystackp except in yyparse where it's not
10654 a pointer.
10655 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
10656 consistency.
10657 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
10658 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
10659 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
10660 lint.
10661
877519f8
PE
106622005-12-09 Paul Eggert <eggert@cs.ucla.edu>
10663
0eca5a39
PE
10664 * tests/sets.at (Accept): Fix typos in regular expression used to
10665 sed out the final state number.
10666
2cec9080
PE
10667 Work around portability problem on Solaris 10: flex-generated
10668 files include <stdio.h> before <config.h>, which messes up
10669 because the latter defines __EXTENSIONS__. Address the problem
10670 by creating two new little files that include <config.h> first,
10671 then include the flex-generated files. Rewrite everyone else
10672 to include <config.h> first, as well.
10673 * lib/timevar.c: Always include "config.h".
10674 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
10675 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
10676 (EXTRA_bison_SOURCES): New macro.
10677 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
10678 * src/system.h: Don't include config.h.
10679 * src/LR0.c: Include <config.h> first.
10680 * src/assoc.c: Likewise.
10681 * src/closure.c: Likewise.
10682 * src/complain.c: Likewise.
10683 * src/conflicts.c: Likewise.
10684 * src/derives.c: Likewise.
10685 * src/files.c: Likewise.
10686 * src/getargs.c: Likewise.
10687 * src/gram.c: Likewise.
10688 * src/lalr.c: Likewise.
10689 * src/location.c: Likewise.
10690 * src/main.c: Likewise.
10691 * src/muscle_tab.c: Likewise.
10692 * src/nullable.c: Likewise.
10693 * src/output.c: Likewise.
10694 * src/parse-gram.y: Likewise.
10695 * src/print.c: Likewise.
10696 * src/print_graph.c: Likewise.
10697 * src/reader.c: Likewise.
10698 * src/reduce.c: Likewise.
10699 * src/relation.c: Likewise.
10700 * src/state.c: Likewise.
10701 * src/symlist.c: Likewise.
10702 * src/symtab.c: Likewise.
10703 * src/tables.c: Likewise.
10704 * src/uniqstr.c: Likewise.
10705 * src/vcg.c: Likewise.
10706
877519f8
PE
10707 * src/parse-gram.y: Fix minor problems uncovered by lint.
10708 (current_lhs, current_lhs_location): Now static.
10709 (current_assoc): Remove unused variable.
10710
10711 Cleanups so that Bison-generated parsers have less lint.
10712 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
10713 Prepend /*ARGSUSED*/, for lint's sake.
10714 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
10715 definition if 'lint' is defined.
10716 (YYID): New macro (or function, if lint).
10717 All uses of /*CONSTCOND*/0 replaced by YYID(0).
10718 * data/yacc.c: Likewise.
10719 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
10720 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
10721 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
10722 is C++ only.
10723 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
10724 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
10725 Use YYID(0) rather than 0, for lint.
10726 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
10727 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
10728
f5228370
PE
107292005-12-07 Paul Eggert <eggert@cs.ucla.edu>
10730
10731 * tests/glr-regression.at
10732 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10733 Close memory leak reported by twlevo.
10734
69ce078b
PE
107352005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
10736
6ff99711
PE
10737 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
10738 all stacks.
10739 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
10740 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10741 New test case.
10742 (Duplicated user destructor for lookahead): This test now is expected
10743 to succeed.
10744
af3412cd
PE
107452005-12-01 Paul Eggert <eggert@cs.ucla.edu>
10746
32b5b719 10747 * NEWS: Document the following change.
af3412cd
PE
10748 * data/yacc.c: Say "parser skeleton" rather than "file", since
10749 it's no longer just a file.
10750 * data/glr.c: Grant a special exception for C GLR parsers, that
10751 reads like the already-existing exception for C LALR(1) parsers.
10752 * data/glr.cc: Likewise.
10753 * data/lalr1.cc: Likewise.
10754 * data/location.cc: Likewise.
10755 * data/yacc.c: Reword the "written by" statement to clarify that
10756 it was the parser skeleton, not the entire output file.
10757 * data/glr.c: Written by Paul Hilfinger.
10758 * data/glr.cc: Written by Akim Demaille.
10759 * data/lalr1.cc: Likewise.
10760
035aa4a0
PE
107612005-11-18 Paul Eggert <eggert@cs.ucla.edu>
10762
d9963c85
PE
10763 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
10764 Fix typos in previous change that broke 'make check'.
10765 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
10766 supported in C.
10767 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
10768 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
10769 We can revert this once things settle down.
10770
035aa4a0
PE
10771 * src/conflicts.c (conflicts_print): Don't print file name twice
10772 when %expect fails because there were no conflicts.
10773 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
10774 change.
10775 * tests/conflicts.at (%expect not enough, %expect too much):
10776 (%expect with reduce conflicts): Adjust to new behavior.
10777
107782005-11-18 Akim Demaille <akim@epita.fr>
10779
10780 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
10781 errors.
10782 * NEWS: Document this.
10783 * doc/bison.texinfo (Expect Decl): Likewise.
10784
d1ff7a7c
AD
107852005-11-16 Akim Demaille <akim@epita.fr>
10786
10787 Generalize the display of semantic values and locations in traces.
10788 * data/glr.c (yy_reduce_print): Fix indices (again).
10789 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
10790 literal integers.
10791 * data/lalr1.cc (yyreduce_print): Rename as...
10792 (yy_reduce_print): this.
10793 Display values and locations.
10794 * data/yacc.c (yy_reduce_print): Likewise.
10795 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
10796 (yysymprint): Move higher to be visible from yy_reduce_print).
10797 (yyparse): Adjust.
10798 * tests/calc.at: Adjust the expected length of the traces.
10799
6de5398d
AD
108002005-11-14 Akim Demaille <akim@epita.fr>
10801
10802 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
10803 from 1 to N, while values and location start at 0.
10804 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
10805
a1373f55
AD
108062005-11-14 Akim Demaille <akim@epita.fr>
10807
10808 * data/glr.c (yy_reduce_print): Fix the $ number.
10809
613d8952
AD
108102005-11-14 Akim Demaille <akim@epita.fr>
10811
10812 "Use" parse parameters.
10813 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
10814 * data/glr.c, data/glr.cc: Use them.
10815 * data/glr.c (YYUSE): Have a C++ definition that supports
10816 non-pointer types.
10817
b2741627
AD
108182005-11-14 Akim Demaille <akim@epita.fr>
10819
10820 * data/glr.c (yyexpandGLRStack): Declare only if defined.
10821
5059b5c8
AD
108222005-11-14 Akim Demaille <akim@epita.fr>
10823
42249483
AD
10824 * data/glr.cc: New.
10825 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 10826
4626a15d
AD
108272005-11-12 Akim Demaille <akim@epita.fr>
10828
10829 Let position and location be PODs.
10830 * data/location.cc (position::initialize, location::initialize): New.
10831 (position::position, location::location): Define only if
10832 b4_location_constructors is defined.
10833 * data/lalr1.cc (b4_location_constructors): Define it for backward
10834 compatibility.
10835 * doc/bison.texinfo (Initial Action Decl): Use initialize.
10836
108372005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
10838
10839 * data/lalr1.cc: Move the body of the ctor and dtor into the
10840 parser file (instead of the header).
10841 Wrap the implementations in a "namespace yy".
10842
108432005-11-12 Akim Demaille <akim@epita.fr>
10844
10845 Have glr.c include its header file when created.
10846 * data/glr.c (b4_shared_declarations): New.
10847 Output them verbatim in the parser if !%defines, otherwise
10848 output then in the header file, and include it instead.
10849
1989d947
AD
108502005-11-11 Akim Demaille <akim@epita.fr>
10851
10852 * data/glr.c: Comment changes.
10853
108542005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
10855
10856 When yydebug, report semantic and location values for reductions.
10857 * data/glr.c (yy_reduce_print): Report the semantic values and the
10858 locations.
10859 (YY_REDUCE_PRINT): Adjust.
10860 (yyglrReduce): Use them.
10861 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
10862 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
10863 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
10864 traces.
10865
02998094
AD
108662005-11-10 Akim Demaille <akim@epita.fr>
10867
10868 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
10869 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
10870 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
10871
5210672f
PE
108722005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
10873
10874 * m4/cxx.m4, examples/Makefile.am: Don't build
10875 examples/calc++ if no C++ compiler is available. (trivial change)
10876
a8991a1d
AD
108772005-11-09 Akim Demaille <akim@epita.fr>
10878
10879 * src/scan-skel.l: Use a couple of asserts.
10880
36b5e963
AD
108812005-11-03 Akim Demaille <akim@epita.fr>
10882
10883 In some (weird) cases, the final state number is incorrect.
10884 Reported by Alexandre Duret-Lutz.
10885 * src/LR0.c (state_list_append): Remove the computation of
10886 final_state.
10887 (save_reductions): Do it here.
10888 (get_state): Alpha conversion.
10889 (generate_states): Use a for loop.
10890 * src/gram.h (item_number_is_rule_number)
10891 (item_number_is_symbol_number): New.
10892 * src/state.c: Use assert.
10893 * src/system.h: Include assert.h.
10894 * tests/sets.at (Accept): New.
10895
44e7ead1
PH
108962005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10897
10898 * data/glr.c (yyfill): Adjust comment.
36b5e963 10899 (yyresolveAction): Initialize default location properly
44e7ead1
PH
10900 for empty right-hand sides.
10901 (yydoAction): Ditto.
10902 Add comment explaining apparently dead code.
36b5e963
AD
10903 * tests/glr-regression.at
10904 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 10905 New test.
36b5e963 10906
e10a80ee
PE
109072005-10-30 Paul Eggert <eggert@cs.ucla.edu>
10908
10909 * bootstrap (cleanup_gnulib): New function. Use it to clean up
10910 gnulib when interrupted. This fixes some race conditions and
10911 works around some portability problems (one noted by Paul
10912 Hilfinger).
10913
067b32ee
AD
109142005-10-22 Akim <akim@epita.fr>
10915
10916 * Makefile.cfg: Adjust to config -> build-aux.
10917 Reported by twledo.
10918
4b367315
AD
109192005-10-21 Akim Demaille <akim@epita.fr>
10920
10921 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
10922 the %parse-params.
10923 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
10924 * data/yacc.c (b4_Pure_if): Rename as...
10925 (b4_yacc_pure_if): this.
10926 (YY_SYMBOL_PRINT, yyparse): Adjust.
10927 * doc/bison.texinfo: Formatting changes.
10928
24cc23d9
AD
109292005-10-21 Akim Demaille <akim@epita.fr>
10930
10931 Finish the transition config -> build-aux.
10932 * configure.ac, Makefile.am: Use build-aux.
10933 * config/prev-version, config/announce-gen, config/Makefile.am:
10934 Move to...
10935 * build-aux/prev-version, build-aux/announce-gen,
10936 * build-aux/Makefile.am: here.
10937
d4476375
AD
109382005-10-14 Akim Demaille <akim@epita.fr>
10939
10940 * examples/calc++/test: Use set -x only when VERBOSE.
10941
302c0aee
PE
109422005-10-13 Paul Eggert <eggert@cs.ucla.edu>
10943
10944 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
10945 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
10946
7625ec2c
AD
109472005-10-13 Akim Demaille <akim@epita.fr>
10948
10949 * src/scan-skel.l: Output the base name parts of the parser and
10950 header file names.
302c0aee 10951 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
10952 additional checks.
10953 Use this to exercise C++ outputs in subdirs.
10954 Reported by Oleg Smolsky.
10955
ba0fe3c7
PE
109562005-10-12 Paul Eggert <eggert@cs.ucla.edu>
10957
10958 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
10959 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
10960 Problem reported by John P. Hartmann.
10961 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
10962 already defined it.
10963
9b8a5ce0
AD
109642005-10-12 Akim Demaille <akim@epita.fr>
10965
10966 * src/parse-gram.y (version_check): Exit 63 to please missing
10967 (stands for "version mismatch).
10968 * tests/input.at, doc/bison.texinfo: Adjust.
10969
4f6e011e
PE
109702005-10-10 Paul Eggert <eggert@cs.ucla.edu>
10971
10972 Work around portability problems with Visual Age C compiler
10973 (xlc and xlC_r) reported by John P. Hartmann.
10974 * data/location.cc (initial_column, initial_line): Remove.
10975 All uses replaced by 0 and 1.
10976 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
10977 that xlc complains about.
10978 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 10979 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 10980 as __STDC__.
4d7aa45e
PE
10981 * data/yacc.c (YYMODERN_C): New macro, which also looks at
10982 __STDC_VERSION__. Use it everywhere instead of looking at
10983 __STDC__ and __cplusplus.
4f6e011e 10984
a1b3bf8c
AD
109852005-10-10 Akim Demaille <akim@epita.fr>
10986
10987 * examples/calc++/test: Be quiet unless VERBOSE.
10988
412e44aa
PE
109892005-10-05 Paul Eggert <eggert@cs.ucla.edu>
10990
2a4647a3
PE
10991 * data/c.m4 (yydestruct, yysymprint):
10992 Use YYUSE instead of casting to void.
10993 * data/glr.c (YYUSE): New macro.
10994 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10995 Use it instead of rolling our own.
10996 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10997 (YYCHK1):
10998 Use /*CONSTCOND*/ to suppress lint warnings.
10999 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11000 (YY_STACK_PRINT): Use 'false' not '0'.
11001 (YYUSE): New macro.
11002 (yysymprint_, yydestruct_): Use it instead of rolling our own.
11003 * data/yacc.c (YYUSE): New macro.
11004 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
11005 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
11006 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
11007
11008
412e44aa
PE
11009 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
11010 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
11011
88c6637f
PE
110122005-10-04 Paul Eggert <eggert@cs.ucla.edu>
11013
2f4f028d
PE
11014 Undo the parts of the unlocked-I/O change that substituted
11015 putc or puts for printf. This might hurt performance a bit,
11016 but some people prefer the printf style.
11017 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
11018 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
11019 All uses replaced by YYFPRINTF and YYDPRINTF.
11020 * data/yacc.c: Likewise.
11021 * lib/bitset.c (bitset_print): Likewise.
11022 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
11023 putc and puts.
11024 * lib/lbitset.c (debug_lbitset): Likewise.
11025 * src/closure.c (print_firsts, print_fderives): Likewise.
11026 * src/gram.c (grammar_dump): Likewise.
11027 * src/lalr.c (look_ahead_tokens_print): Likewise.
11028 * src/output.c (escaped_output): Likewise.
11029 (user_actions_output): Break apart two printfs.
11030 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
11031 * src/reduce.c (reduce_print): Likewise.
11032 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
11033 * src/system.h: Include unlocked-io.h rathe than stdio.h.
11034
88c6637f
PE
11035 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11036 Use assignments rather than casts-to-void to suppress
11037 unused-variable warnings. This pacifies 'lint'.
11038 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
11039 unused-variable warnings.
11040
fb32e373
JMG
110412005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11042
11043 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11044
edb8f44f
PE
110452005-10-02 Paul Eggert <eggert@cs.ucla.edu>
11046
fb9c0b33
PE
11047 Use unlocked I/O for a minor performance improvement on hosts like
11048 GNU/Linux and Solaris that support unlocked I/O. The basic idea
11049 is to use the gnlib unlocked-io module, and to prefer putc and
11050 puts to printf when either will work (since the latter doesn't
11051 come in an unlocked flavor).
11052 * bootstrap (gnulib_modules): Add unlocked-io.
11053 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
11054 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
11055 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
11056 and similarly for puts and putc and printf.
11057 * data/yacc.c: Likewise.
11058 * lib/bitset.c (bitset_print): Likewise.
11059 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
11060 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
11061 to printf.
11062 * lib/lbitset.c (debug_lbitset): Likewise.
11063 * src/closure.c (print_firsts, print_fderives): Likewise.
11064 * src/gram.c (grammar_dump): Likewise.
11065 * src/lalr.c (look_ahead_tokens_print): Likewise.
11066 * src/output.c (escaped_output): Likewise.
11067 (user_actions_output): Coalesce two printfs.
2f4f028d 11068 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
11069 * src/reduce.c (reduce_print): Likewise.
11070 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 11071 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 11072
edb8f44f
PE
11073 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
11074 this confuses xgettext.
11075
b50d2359
AD
110762005-10-02 Akim Demaille <akim@epita.fr>
11077
11078 * bootstrap (gnulib_modules): Add strverscmp.
11079 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
11080 * m4/.cvsignore: Add strverscmp.m4.
11081 * src/parse-gram.y (%require): New token, new rule.
11082 (version_check): New.
11083 * src/scan-gram.l (%require): Adjust.
11084 * tests/input.at (AT_REQUIRE): New.
11085 Use it.
11086 * doc/bison.texinfo (Require Decl): New.
11087 (Calc++ Parser): Use %require.
11088
21667f64
AD
110892005-10-02 Akim Demaille <akim@epita.fr>
11090
11091 * data/location.cc: New.
11092
2b81e969
AD
110932005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
11094 Akim Demaille <akim@epita.fr>
11095
11096 Make sure -odir/foo.cc creates dir/location.hh etc.
11097 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
11098 (spec_file_prefix, spec_verbose_file, spec_graph_file)
11099 (spec_defines_file): Now const.
11100 (dir_prefix): New.
11101 (short_base_name): Remove.
11102 * src/files.c: Adjust.
11103 (dirname.h): Include.
11104 (base_name): Don't prototype it.
11105 (finput): Remove, duplicates gram_in.
11106 (full_base_name, short_base_name): Replace by...
11107 (all_but_ext, all_but_tab_ext): these.
11108 (compute_base_names): Rename as...
11109 (compute_file_name_parts): this.
11110 Update to compute the new variables, including dir_prefix.
11111 Adjust dependencies.
11112 * src/output.c (prepare): Output them.
11113 * src/reader.c: Adjust to use gram_in, not finput.
11114 * src/scan-skel.l (@dir_prefix@): New.
11115
ad6a9b97
JMG
111162005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11117
11118 * lib/subpipe.c: New function end_of_output_subpipe() added
11119 to allow support for non-posix systems. This is a no-op function
11120 for posix systems.
11121
11122 * lib/subpipe.h: New function end_of_output_subpipe() added
11123 to allow support for non-posix systems. This is a no-op function
11124 for posix systems.
11125
11126 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
11127 handle the lack of pipe/fork functionality on non-posix systems.
11128
11129 * djgpp/Makefile.maint: DJGPP specific file.
11130
11131 * djgpp/README.in: DJGPP specific file.
11132
11133 * djgpp/config.bat: DJGPP specific configuration file.
11134
11135 * djgpp/config.sed: DJGPP specific configuration file.
11136
11137 * djgpp/config.site: DJGPP specific configuration file.
11138
11139 * djgpp/config_h.sed: DJGPP specific configuration file.
11140
11141 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
11142
11143 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
11144
fc695704
AD
111452005-10-02 Akim Demaille <akim@epita.fr>
11146
11147 * data/location.cc: New, extract from...
11148 * data/lalr1.cc: here.
11149 (location.hh): Include it after the user prologue, in case the
11150 filename type is defined by the user.
11151 Forward declation location and position before the pre-prologue.
11152 (yyresult_): Rename as...
11153 (yyresult): this, it's a local variable, not an attribute.
11154 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
11155
111562005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
11157
11158 * examples/extexi: Restore the #line generation.
11159
fb9712a9
AD
111602005-09-30 Akim Demaille <akim@epita.fr>,
11161 Alexandre Duret-Lutz <adl@gnu.org>
11162
11163 Move the token type and YYSTYPE in the parser class.
11164 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
11165 (parser::token): New, from the moved free definition of tokens.
11166 (parser::semantic_value): Now a full definition instead of an
11167 indirection to YYSTYPE.
11168 (b4_post_prologue): No longer included in the header file, but
11169 in the implementation file.
11170 * doc/bison.texi (C+ Language Interface): Update.
11171 * src/parse-gram.y: Support unary %define.
11172 * tests/actions.at: Define global_tokens_and_yystype for backward
11173 compatibility until we update the tests.
11174 * tests/calc.at: Idem.
11175 (first_line, first_column, last_line, last_column): Define for lalr1.cc
11176 to simplify the code.
11177
55f0c7b1
PE
111782005-09-29 Paul Eggert <eggert@cs.ucla.edu>
11179
11180 Port to SunOS 4.1.4, which lacks strtoul and strerror.
11181 Ah, the good old days! Problem reported by Peter Klein.
11182 * bootstrap (gnulib_modules): Add strerror, strtoul.
11183 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
11184 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
11185
fb9712a9 111862005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
11187
11188 * data/c.m4 (b4_error_verbose_if): New.
11189 * data/lalr1.cc: Use it.
11190 (YYERROR_VERBOSE_IF): Remove.
11191 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
11192 parser members, replaced by...
11193 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
11194 local variables.
11195 (yysyntax_error_): Takes the state number as argument.
11196 (yyreduce_print_): Use the argument yyrule, not the former
11197 attribute yyn_.
11198
8a6f72f3
PE
111992005-09-26 Paul Eggert <eggert@cs.ucla.edu>
11200
11201 * bootstrap (gnulib_modules): Add verify.
11202 * lib/.cvsignore: Add verify.h.
11203 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
11204 * src/system.h (verify): Remove.
11205 Include verify.h instead.
11206 * src/tables.c (tables_generate): Use new API for 'verify'.
11207
0d50976f
PE
112082005-09-21 Paul Eggert <eggert@cs.ucla.edu>
11209
ebc3737e
PE
11210 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
11211 local variables whose names begin with 'yy'.
11212 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11213 Trivial changes from Joel E. Denny.
11214
0d50976f
PE
11215 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
11216 it itself.
11217 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
11218 don't use alloca any more.
11219
11220 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
11221 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 11222 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
11223 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
11224 to match yacc.c, to test more hosts.
11225
a05b79df
PE
112262005-09-20 Paul Eggert <eggert@cs.ucla.edu>
11227
55289366
PE
11228 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
11229 doesn't affect behavior.
11230 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
11231 Solaris, AIX, MSC.
11232 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
11233 This works a bit better with glibc, if user code has already included
11234 stdlib.h.
11235 * doc/bison.texinfo (Bison Parser): Document that users can't
11236 arbitrarily use malloc and free for other purposes. Document
11237 that <alloca.h> and <malloc.h> might be included.
11238 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
11239 user must declare alloca.
11240
a05b79df
PE
11241 * HACKING (release): Forwarn the Translation Project about
11242 stable releses.
11243
3ab2ca22
AD
112442005-09-20 Akim Demaille <akim@epita.fr>
11245
11246 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
11247
a9739e7c
PE
112482005-09-19 Paul Eggert <eggert@cs.ucla.edu>
11249
a702593e
PE
11250 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
11251 (YYSTACK_ALLOC_MAXIMUM): Use it.
11252 (yysyntax_error): New function.
11253 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
11254 multiple syntax errors are reported, and alloca is being used.
11255 Instead, reallocate buffers twice as big each time, so that
11256 we waste at most half the allocated memory. Start with a small
11257 (128-byte) buffer that will suffice in most cases anyway.
11258 Use yysyntax_error to do most of the work.
11259
11260 * doc/bison.texinfo (Error Reporting, Table of Symbols):
11261 yynerrs is the number of errors reported, not the number of
11262 errors encountered.
11263
a9739e7c
PE
11264 * tests/glr-regression.at (Duplicated user destructor for lookahead):
11265 Mark it as expected to fail.
11266 Cast result of malloc; problem reported by twlevo@xs4all.nl.
11267 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
11268 Don't start user-code symbols with "yy", to avoid name space problems.
11269
f479c6c6
AD
112702005-09-19 Akim Demaille <akim@epita.fr>
11271
11272 Remove the traits, failed experiment.
11273 It never proved useful, and anyway because of the current
11274 definition, it was not possible to have several specialization of
11275 this traits, making it useless.
11276 * data/lalr1.cc (yy:traits): Remove.
11277 Inline its definitions in the parser class.
11278
e2586f82
AD
112792005-09-19 Akim Demaille <akim@epita.fr>
11280
11281 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
11282 least Mac OSX with a /usr/local install of gettext.
11283
2e8cf949
AD
112842005-09-19 Akim Demaille <akim@epita.fr>
11285
11286 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
11287 and yytoken for similarity with the other skeletons.
11288
c7fb0b90
AD
112892005-09-19 Akim Demaille <akim@epita.fr>
11290
4e26c69e 11291 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 11292
1bd0deda
PE
112932005-09-16 Paul Eggert <eggert@cs.ucla.edu>
11294
11295 * NEWS: Version 2.1.
11296
11297 * NEWS: Remove notice of yytname change, since it was never in an
11298 official release.
11299 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
11300 diagnostic.
11301 * src/output.c (prepare): Likewise.
11302 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
11303 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
11304 is not defined. This is an awful hack, but it's enough for now.
11305 All callers changed.
11306 * tests/glr-regression-at (make_value): Args are const pointers now,
11307 to avoid GCC warning.
11308 (Duplicated user destructor for lookahead): New test. Currently
11309 skipped. It fails on my host but I'm not sure it'll always fail.
11310
113112005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
11312
11313 * src/symtab.h (struct symbol): Declare the printer and destructor
11314 as const, to avoid accidental calls to free.
11315 (symbol_destructor_set, symbol_printer_set): Adjust.
11316 * src/symtab.c: Adjust.
11317
1bd0deda 113182005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
11319
11320 * data/c.m4 (b4_token_enums): New.
11321 (b4_token_defines): Rename as...
11322 (b4_token_enums_defines): this.
11323 (b4_token_defines): New, output only the #defines.
11324 * data/yacc.c, data/glr.c: Adjust.
11325 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
11326 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
11327 as default values.
11328
dbcdae2d
AD
113292005-09-16 Akim Demaille <akim@epita.fr>
11330
11331 * data/lalr1.cc (yylex_): Remove, inline its code.
11332 (yyreport_syntax_error_): Remove, replaced by...
11333 (yysyntax_error_): this which returns a string and leaves to the
11334 caller the call to the users' error function.
11335 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
11336 Move from members of the parser object...
11337 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
11338 to local variables of the parse function.
11339
70d8f291
AD
113402005-09-16 Akim Demaille <akim@epita.fr>
11341
11342 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
11343 since it's in Bison's name space.
11344
b47dbebe
PE
113452005-09-15 Paul Eggert <eggert@cs.ucla.edu>
11346
ae199bf1
PE
11347 * data/glr.c (yyresolveValue): Add default case to pacify
11348 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
11349
b47dbebe
PE
11350 * NEWS: Document when yyparse started to return 2.
11351 * doc/bison.texinfo (Parser Function): Document when yyparse
11352 returns 2.
11353
11354 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
11355 (b4_filename_type): Renamed back from b4_file_name_type. All uses
11356 changed.
11357 (class position): file_name -> filename (reverting). All uses changed.
11358
113592005-09-14 Paul Eggert <eggert@cs.ucla.edu>
11360
11361 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
11362 do anything if $@ exists. This reverts part of the 2005-07-07
11363 patch.
11364
00292f66
PE
113652005-09-11 Paul Eggert <eggert@cs.ucla.edu>
11366
11367 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
11368 contains obsolete information and isn't worth distributing as a
11369 separate file anyway.
11370 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
11371 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
11372 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
11373 (yyparse): Abort if user code uses longjmp to throw an unexpected
11374 value.
11375
a420f962
PE
113762005-09-09 Paul Eggert <eggert@cs.ucla.edu>
11377
00292f66
PE
11378 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
11379 Suggested by twlevo@xs4all.nl.
11380
127287e9
PE
11381 * data/glr.c (YYCHK1): Do not assume YYE is in range.
11382 This avoids a diagnostic from gcc -Wswitch-enum.
11383 Problem reported by twlevo@xs4all.nl.
11384
a420f962
PE
11385 * doc/bison.texinfo: Don't use "filename", as per GNU coding
11386 standards. Use "file name" or "file" or "name", depending on
11387 the context.
11388 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
11389 not to hack/foo.tab.c.
11390 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
11391 * data/glr.c: b4_filename -> b4_file_name.
11392 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
11393 All uses changed.
11394 (class position): filename -> file_name. All uses changed.
11395 * data/yacc.c: b4_filename -> b4_file_name.
11396 * lib/bitset.h: filename -> file_name in local vars.
11397 * lib/bitset_stats.c: Likewise.
11398 * src/files.c: Likewise.
11399 * src/scan-skel.l ("@output ".*\n): Likewise.
11400 * src/files.c (file_name_split): Renamed from filename_split.
11401 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
11402
114032005-09-08 Paul Eggert <eggert@cs.ucla.edu>
11404
11405 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
11406 to accommodate latest gnulib.
11407
11408 * tests/glr-regression.at (Duplicate representation of merged trees):
11409 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
11410
11411 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
11412 needed.
11413
42a6501d
PE
114142005-08-26 Paul Eggert <eggert@cs.ucla.edu>
11415
11416 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
11417 All uses changed. Invoke user destructor after an error during a
11418 split parse (trivial change from Joel E. Denny).
11419
11420 * tests/glr-regression.at
11421 (User destructor after an error during a split parse): New test case.
11422 Problem reported by Joel E. Denny in:
11423 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
11424
ef9a1faf
PE
114252005-08-25 Paul Eggert <eggert@cs.ucla.edu>
11426
5b4aaf78
PE
11427 * README-cvs: Give URLs for recommended tools.
11428 Mention Gzip version problem, and bootstrapping issues.
11429 Remove troubleshooting section, as it's somewhat obsolete.
11430
b5240ba5
PE
11431 * bootstrap (no_cache): New var, to accommodate different wget
11432 variants. Use it instead of '-C off'. Problem reported by
11433 twlevo@xs4all.nl.
11434
ef9a1faf
PE
11435 * data/glr.c (yydestroyStackItem): New function.
11436 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
11437 debugging information. Problem reported by Joel E. Denny.
11438
e6efa9da
AD
114392005-08-25 Akim Demaille <akim@epita.fr>
11440
11441 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
11442
adc90f13
PE
114432005-08-24 Paul Eggert <eggert@cs.ucla.edu>
11444
11445 * data/glr.c (yyrecoverSyntaxError, yyreturn):
11446 Don't invoke destructor on unresolved entries.
11447 * tests/glr-regression.at
11448 (User destructor for unresolved GLR semantic value): New test case.
11449 Problem reported by Joel E. Denny in:
11450 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
11451
f9315de5
PE
114522005-08-21 Paul Eggert <eggert@cs.ucla.edu>
11453
15d29c1f
PE
11454 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
11455 Add strnlen.c.
11456 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
11457 lib-prefix.m4, po.m4.
11458
dd5f2af2
PE
11459 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
11460 in yydestruct diagnostic, since it might not be an error.
11461 Problem reported by Joel Denny near end of
11462 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 11463 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
11464 * data/yacc.c (yyreturn): Likewise.
11465 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
11466
11467 * src/files.c: Remove obsolete FIXME comment.
11468
11469 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
11470 with the other templates, and to fix bogus run-on messages such
11471 as the one reported at the end of
11472 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11473 All callers changed to avoid the newline.
11474 (yyprocessOneStack): Output two lines rather than one, to accommodate
11475 the above change. This changes the debug output format slightly.
11476
f9315de5
PE
11477 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
11478 reported by Joel E. Denny in
11479 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
11480 (trivial change).
11481 * tests/glr-regression.at (Duplicate representation of merged trees):
11482 New test, from Joel E. Denny in:
11483 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
11484 * THANKS: Add Joel E. Denny.
11485
11486 * configure.ac (AC_INIT): Bump to 2.0c.
11487
04098407
PE
114882005-07-24 Paul Eggert <eggert@cs.ucla.edu>
11489
11490 * NEWS: Version 2.0b.
11491
ca5d2013
PE
11492 * Makefile.am (SUBDIRS): Put examples before tests, so that
11493 "make check" doesn't finish with "All 1 tests passed".
11494
3d54b576
PE
11495 * tests/regression.at (Token definitions): Don't rely on
11496 AT_PARSER_CHECK for data that contains backslashes. It currently
11497 uses 'echo', and 'echo' isn't portable if its argument contains
11498 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
11499 that the byte '\0xff' is not printable in the C locale; it is,
11500 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
11501 not printable, so use '\0x81' to test.
11502
d53ae497
PE
11503 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
11504 version of GCC, since the macro is used with non-GCC compilers.
11505
fc01665e
PE
11506 Fix core dump reported by Pablo De Napoli in
11507 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
11508 * tests/regression.at (Invalid inputs with {}): New test.
11509 * src/parse-gram.y (token_name): Translate type before using
11510 it as an index.
11511
04098407
PE
11512 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
11513 the user's name space. All uses changed to __attribute__
11514 ((__unused__)).
11515 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
11516 Add __attribute__ ((__noreturn__)).
11517
11518 * etc/clcommit: Remove. We weren't using it, and it failed
11519 "make maintainer-distcheck".
11520 * Makefile.maint: Merge from coreutils.
11521 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
11522 (syntax-check-rules): Change list of rules as described below.
11523 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
11524 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
11525 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
11526 (sc_trailing_space): New rules.
11527 (sc_xalloc_h_in_src): Remove.
11528 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
11529 (sc_space_tab, sc_error_exit_success, sc_changelog):
11530 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
11531 (makefile-check, po-check, author_mark_check):
11532 (makefile_path_separator_check, copyright-check):
11533 Use grep -n, to make it easier to find violations.
11534 Use CVS_LIST and CVS_LIST_EXCEPT.
11535 (header_regexp, h_re): Remove.
11536 (dd_c): New macro.
11537 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
11538 (my-distcheck): Use more-modern GCC flags.
11539 (signatures, %.asc): Remove.
11540 (rel-files, announcement): Remove signatures.
11541 Restore old updating code, even though we don't use it, so
11542 that we're the same as coreutils.
11543 (alpha, beta, major): Depend on news-date-check.
11544 Make the upload commands.
11545
11546 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
11547 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
11548 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
11549 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
11550 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
11551 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
11552 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
11553 * tests/sets.at: Likewise.
11554
11555 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
11556 we comment out the Autoconf version number.
11557 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
11558 it's error-prone and "make maintainer-distcheck" rejects it.
11559
11560 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
11561 Indent calls to "error" to pacify "make maintainer-distcheck",
11562 when the calls are not intended to be translated.
11563 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
11564
11565 * src/Makefile.am (DEFS): Use +=, to pacify
11566 "make maintainer-distcheck".
11567 (bison_SOURCES): Add scan-skel.h.
11568 (sc_tight_scope): New rule, from coreutils.
11569
11570 * src/files.c (src_extension, header_extension):
11571 Now static, not extern.
11572 * src/getargs.c (short_options): Likewise.
11573 * src/muscle_tab.c (muscle_table): Likewise.
11574 * src/parse-gram.y (current_class, current_type, current_prec):
11575 Likewise.
11576 * src/reader.c (grammar_end, previous_rule_end): Likewise.
11577 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
11578 * src/main.c (main): Cast bindtextdomain and textdomain calls to
11579 void, to avoid warning when NLS is disabled.
11580 * src/output.c: Include scan-skel.h.
11581 (scan_skel): Remove decl, since scan-skel.h does this.
11582 (output_skeleton):
11583 Indent calls to "error" to pacify "make maintainer-distcheck".
11584 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
11585 * src/reader.h (gram_end, gram_lineno): New decls to pacify
11586 "make maintainer-distcheck".
11587 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
11588 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
11589 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
11590 (skel_lex_destroy, scan_skel): Move these decls to...
11591 * src/scan-skel.h: New file.
11592 * src/uniqstr.c (uniqstr_assert):
11593 Indent calls to "error" to pacify "make maintainer-distcheck".
11594
11595 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
11596 not @VAR@.
11597
11598 * tests/torture.at: Revamp to avoid misuse of atoi that
11599 "make maintainer-distcheck" complained about.
11600
11601 * examples/extexi (message): Don't print a message more than once,
11602 and omit line-number decoration that makes Emacs compile think
11603 that informative messages are worth worrying about.
11604
116052005-07-22 Paul Eggert <eggert@cs.ucla.edu>
11606
11607 * configure.ac: Update version number.
11608
11609 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
11610 accidentally.
11611 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
11612 autogenerated by the maintainer.
11613 * examples/calc++/.cvsignore: Add *.yy.
11614
11615 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
11616 * lib/bitset_stats.c (bitset_stats_init): Likewise.
11617 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11618
11619 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
11620
11621 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
11622 from maintainer-distcheck about casting the argument of 'free'.
11623
11624 * NEWS: Mention recent yytname changes.
11625 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
11626
11627 * bootstrap: For translations that have not yet been upgraded to
11628 the new runtime-po domain, prime the pump by extracting the
11629 relevant strings from the obsolete translations. This code can be
11630 removed once the bison-runtime domain has been translated by each
11631 team.
11632
11633 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
11634 now that token names are already quoted.
11635
11636 Fix problem reported by Anthony Heading.
11637 * data/glr.c (YYTOKEN_TABLE): New macro.
11638 (yytname): Define if YYTOKEN_TABLE.
11639 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
11640 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
11641 (YYERROR_VERBOSE): Define the same way the other skeletons do.
11642 * src/output.c (prepare_symbols): Output token_table_flag.
11643
0ffda363
PE
116442005-07-21 Paul Eggert <eggert@cs.ucla.edu>
11645
11646 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
11647 again if the first call fails.
11648
11649 * data/glr.c (yytnamerr): New function.
11650 (yyreportSyntaxError): Use it to dequote most string literals.
11651 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
11652 with other skeletons. All uses changed.
11653 (yytnameerr_): New function.
11654 (yyreport_syntax_error): Use it to dequote most string literals.
11655 * data/yacc.c (yytnamerr): New function.
11656 (yyerrlab): Use it to decode most string literals.
11657 * doc/bison.texinfo (Decl Summary, Calling Convention):
11658 Clarify quoting convention of yytname.
11659 * src/output.c (prepare_symbols): Quote all names. This undoes
11660 the 2005-04-17 change, which is now accomplished (mostly) via
11661 changes in the parsers as described above.
11662 * tests/regression.at (Token definitions, Web2c Actions):
11663 Undo most 2005-04-17 change here, too.
11664
116652005-07-20 Paul Eggert <eggert@cs.ucla.edu>
11666
11667 Fix more problems reported by twlevo@xs4all.nl.
11668 * tests/cxx-type.at: Don't pipe output of ./types through sed to
11669 remove trailing spaces. This loses the exit status of ./types,
11670 and isn't needed since ./types shouldn't be emitting trailing
11671 spaces.
11672 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
11673 as the stack isn't valid in that case.
11674
11675 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
11676 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
11677 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
11678 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
11679 is used.
11680 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
11681 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
11682 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
11683 Likewise.
11684
11685 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
11686 overly-picky compilers that reject 'char *foo = "bar";'.
11687
11688 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
11689 to FILE * parameter, not to stderr. This fixes a typo introduced
11690 in the 2005-07-12 change.
11691
11692 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
11693 warnings from GCC 4.
11694
11695 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
11696 (yyglrShiftDefer, yysplitStack):
11697 Remove unused parameters b4_pure_formals. All uses changed.
11698 (yyglrShift): Remove unused parameters b4_user_formals.
11699 All uses changed.
11700 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
11701
6100a9aa
PE
117022005-07-18 Paul Eggert <eggert@cs.ucla.edu>
11703
258b75ca
PE
11704 Destructor cleanups and regularization among the three skeletons.
11705 * NEWS: Document the behavior changes.
11706 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
11707 stack before failing, as the cleanup code will do it for us now.
11708 * data/lalr1.cc (yyerrlab): Likewise.
11709 * data/glr.c (yyparse): Pop everything off the stack before
11710 freeing it, so that destructors get called properly.
11711 * data/lalr1.cc (yyreturn): Likewise.
11712 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
11713 This is more consistent.
11714 * doc/bison.texinfo (Destructor Decl): Mention more reasons
11715 why destructors might be called. 1.875 -> 2.1.
11716 (Destructor Decl, Decl Summary, Table of Symbols):
11717 Some English-language cleanups for %destructor.
11718 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11719 Add output line for destructor of start symbol.
11720 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
11721 because of that same extra output line.
11722
1a059451
PE
11723 * NEWS: Document minor wording changes in diagnostics of
11724 Bison-generated parsers.
11725 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
11726 Remove unused formals. All uses changed.
11727 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
11728 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
11729 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
11730 Rename yyoverflowab to yyexhaustedlab.
11731 When memory exhaustion occurs during syntax-error reporting,
11732 report it separately rather than in a single diagnostic; this
11733 eases translation.
11734 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
11735 (Memory Exhausted): Renamed from Parser Stack Overflow.
11736 Revamp wording slightly to prefer "memory exhaustion".
11737 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
11738
97460c78
PE
11739 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
11740
30757c8c
PE
11741 Add i18n support to the GLR skeleton. Partially fix the C++
11742 skeleton; a C++ expert needs to finish this. Remove debugging
11743 msgids; there's little point to having them translated, since they
11744 can be understood only by someone who can read the
11745 (English-language) source code.
11746
11747 Generate runtime-po/bison-runtime.pot automatically, so that we
11748 don't have to worry about garbage getting in that file. We'll
11749 make sure after the next official release that old msgids don't
11750 get lost. See
11751 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
11752
11753 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
11754 Now auto-generated.
11755 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
11756 Fix typos in explanations of the runtime file.
11757 * bootstrap: Change gettext keyword from YYI18N to YY_.
11758 Use standard Makefile.in.in in runtime-po, since we'll arrange
11759 for backward-compatible bison-runtime.po files in a different way.
11760 * data/glr.c (YY_): New macro, from yacc.c.
11761 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
11762 Translate messages intended for users.
11763 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
11764 the wording in the other skeletons. We don't know that the memory
11765 is virtual.
11766 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
11767 Use same method that yacc.c uses.
11768 Don't translate debugging messages.
11769 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
11770 it doesn't work (yet), and requires C++ expertise to fix.
11771 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
11772 Move defn to a more logical place, to be consistent with other
11773 skeletons.
11774 Don't translate debugging messages.
11775 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
11776 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
11777 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
11778 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
11779
ac8c5689
PE
11780 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
11781 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
11782 void, not int.
11783 * tests/glr-regression.at (Badly Collapsed GLR States):
11784 Likewise.
11785 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11786 yylex should return 0 at EOF rather than aborting.
11787
6100a9aa
PE
11788 Improve tests for stack overflow in GLR parser.
11789 Problem reported by twlevo@xs4all.nl.
11790 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
11791 All uses removed.
11792 (yyStackOverflow): Just longjmp, but with value 2 so that caller
11793 can handle the problem.
11794 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
11795 (yyparse): New local variable yyresult to record the result.
11796 Use result of setjmp to set it, rather than storing itinto
11797 struct.
11798 (yyDone): Remove label.
11799 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
11800 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
11801 if YYABORT is used).
11802 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
11803 yyparse status; put status > 1 into diagnostic.
11804 Check that status==2 works.
11805 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
11806 Use exit status 3 for failure to open (which shouldn't happen).
11807
15f40952
PE
118082005-07-17 Paul Eggert <eggert@cs.ucla.edu>
11809
67fd79c4
PE
11810 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
11811 1 on syntax error; just let yyparse do its thing.
11812 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
11813 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
11814 (Exploding the Stack Size with Alloca):
11815 (Exploding the Stack Size with Malloc):
11816 Expect exit status 2, not 1, since the parser is supposed to blow
11817 its stack. Problem reported by twlevo@xs4all.nl.
11818
15f40952
PE
11819 * data/glr.c (yyparse): Don't assume that the initial calls
11820 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
11821 Print a stack-overflow message and fail instead.
11822 Initialize the line-number information before creating the stack,
11823 so that the stack-overflow message can report line zero safely.
11824
f32c66b5
PE
118252005-07-14 Paul Eggert <eggert@cs.ucla.edu>
11826
a22ff96f 11827 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
11828 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
11829 (yyuserMerge): Provide a default case if b4_mergers is empty.
11830 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
11831 * tests/glr-regression.at
11832 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 11833 Add casts to pacify C++ compilers.
1beb0b24
PE
11834 * tests/glr-regression.at (Improper merging of GLR delayed action
11835 sets): Declare yylex before using it.
f32c66b5 11836 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
11837 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
11838 test for valgrind; valgrind is independent of g++.
11839 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
11840 for compatibility with POSIX 1003.1-2001 (if running coreutils).
11841 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
11842 Use a destructor, so that we can expand the stack. Change
11843 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 11844
d741bd1b
PE
118452005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11846
11847 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
11848 a valgrind failure. Problem reported by twlevo@xs4all.nl.
11849
0410a6e0
PE
118502005-07-13 Paul Eggert <eggert@cs.ucla.edu>
11851
11852 * PACKAGING: New file, suggested by Bruno Haible and taken from
11853 similar wording in gettext's PACKAGING file.
11854 * NEWS: Mention PACKAGING.
11855 * Makefile.am (EXTRA_DIST): Add PACKAGING.
11856
f7ab6a50
PE
118572005-07-12 Paul Eggert <eggert@cs.ucla.edu>
11858
baf785db 11859 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
11860 * bootstrap: Get runtime translations into runtime-po.
11861 Create runtime-po files automatically, if possible.
11862 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
11863 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
11864 does not infringe on the user's name space.
11865 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
11866 * doc/bison.texinfo (Internationalization): Revamp the English
11867 and Texinfo syntax a bit, to try to make it clearer.
11868 (Bison Options, Option Cross Key): Mention --print-localedir.
11869 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
11870 YYENABLE_NLS. Quote a bit more.
11871 * runtime-po/.cvsignore: New file.
11872 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
11873 * runtime-po/Rules-quot: Remove; now created by bootstrap.
11874 * runtime-po/quot.sed: Likewise.
11875 * runtime-po/boldquot.sed: Likewise.
11876 * runtime-po/en@quot.header: Likewise.
11877 * runtime-po/en@boldquot.header: Likewise.
11878 * runtime-po/insert-header.sin: Likewise.
11879 * runtime-po/remove-potcdate.sin: Likewise.
11880 * runtime-po/Makevars: Likewise.
11881 * runtime-po/LINGUAS: Likewise.
11882 * runtime-po/de.po: Likewise; we will rely on the translation project
11883 to maintain this, so "bootstrap" should get it.
0410a6e0 11884 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
11885 its value.
11886 * src/main.c (main): Bind the bison-runtime domain, too.
11887
118882005-07-12 Bruno Haible <bruno@clisp.org>
11889
11890 * data/yacc.c: Include <libintl.h> when NLS is enabled.
11891 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
11892 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
11893 * runtime-po: New directory.
11894 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
11895 $(DOMAIN).pot-update rule, so that old messages are never dropped.
11896 * runtime-po/Rules-quot: New file, copied from po/.
11897 * runtime-po/quot.sed: Likewise.
11898 * runtime-po/boldquot.sed: Likewise.
11899 * runtime-po/en@quot.header: Likewise.
11900 * runtime-po/en@boldquot.header: Likewise.
11901 * runtime-po/insert-header.sin: Likewise.
11902 * runtime-po/remove-potcdate.sin: Likewise.
11903 * runtime-po/Makevars: New file.
11904 * runtime-po/POTFILES.in: New file.
11905 * runtime-po/LINGUAS: New file.
11906 * runtime-po/bison-runtime.pot: New file.
11907 * runtime-po/de.po: New file.
11908 * m4/bison.m4: New file.
11909 * Makefile.am (SUBDIRS): Add runtime-po.
11910 (aclocaldir, aclocal_DATA): New variables.
11911 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
11912 Define aclocaldir.
11913 * src/getargs.c (usage): Document --print-localedir option.
11914 (PRINT_LOCALEDIR_OPTION): New enum item.
11915 (long_options): Add --print-localedir option.
11916 (getargs): Handle --print-localedir option.
11917 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
11918 (Internationalization): New section.
11919
22dda0f0
AD
119202005-07-12 Akim Demaille <akim@epita.fr>
11921
11922 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
11923 for consistency with the rest of the code.
11924 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
11925 Add separators.
11926
82b248ad
AD
119272005-07-12 Akim Demaille <akim@epita.fr>
11928
11929 * src/parse-gram.y: Use %printer instead of YYPRINT.
11930
fa0e9314
AD
119312005-07-12 Akim Demaille <akim@epita.fr>
11932
867a3e00
AD
11933 * src/symtab.h, src/symtab.c (symbol_print): New.
11934 * src/symlist.h, src/symlist.c (symbol_list_print): New.
11935 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
11936
119372005-07-12 Akim Demaille <akim@epita.fr>
11938
11939 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
11940 b4_at_dollar and b4_dollar_dollar.
11941
e054b190
PE
119422005-07-11 Paul Eggert <eggert@cs.ucla.edu>
11943
11944 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
11945 and Pennello's paper.
11946
34160ec4
PE
119472005-07-09 Paul Eggert <eggert@cs.ucla.edu>
11948
407d4a75
PE
11949 * data/yacc.c (yyparse): Undo previous patch. Instead,
11950 set yylsp[0] and yyvsp[0] only if the initial action
11951 sets yylloc and yylval, respectively.
11952
34160ec4
PE
11953 * data/yacc.c (yyparse): In the initial action, set
11954 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
11955 This avoids the use of undefined variables if the initial
11956 action does not set yylloc and/or yylval.
11957
c3d5a4a7
PE
119582005-07-07 Paul Eggert <eggert@cs.ucla.edu>
11959
b34d96c1
PE
11960 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
11961 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
11962 Remove from CVS. These files are automatically generated.
11963 * examples/extexi: Clarify that this file is now part of Bison,
11964 not GNU M4, and that it works with any POSIX-compatible Awk.
11965 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
11966 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
11967 so that we also get calc++-parser.yy. Geneate it.
11968 Use $(AWK), not gawk, since any conforming Awk will do.
11969 Put comment before action, since older 'make' can't handle comment
11970 in action.
11971 $(BUILT_SOURCES): List all built sources, not just some of them.
11972 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
11973 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
11974 $($(calc_sources_generated)): Remove unnecessary test for existence
11975 of target. (This had a shell syntax error anyway; a stray "x".)
11976 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
11977 calc++-parser.yy.
11978 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
11979
c3d5a4a7
PE
11980 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
11981 implied by the other modules.
11982
828c373b
AD
119832005-07-06 Akim Demaille <akim@epita.fr>
11984
11985 Bind examples/calc++ to the package.
11986 * examples/calc++/Makefile: Remove, replaced by...
11987 * examples/calc++/Makefile.am: ... this new file.
11988 * examples/calc++/test: Remove input.
11989 * examples/calc++/compile: Remove.
11990 * examples/Makefile.am: New.
11991 * configure.ac, Makefile.am: Adjust.
11992 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
11993
63cb01d6
PE
119942005-07-05 Paul Eggert <eggert@cs.ucla.edu>
11995
fd2df2ed
PE
11996 * data/glr.c (yyFail): Drastically simplify; since the format argument
11997 never had any % directives, we can simply pass it to yyerror.
11998 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
11999 be modified later, as that is the usual style in glr.c.
12000 Problems reported by Paul Hilfinger.
12001
63cb01d6
PE
12002 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
12003 and size overflow errors.
12004 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
12005 in case the user prolog sets feature-test macros like _GNU_SOURCE.
12006 (YYSIZEMAX): New macro.
12007 (yystpcpy): New function, taken from yacc.c.
12008 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
12009 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
12010 so that we don't have to maintain their signatures.
12011 (yyFail): Check for buffer overflow, by using vsnprintf rather
12012 than vsprintf. Allocate a bigger buffer if possible.
12013 Report an error if buffer allocation fails.
12014 (yyStackOverflow): New function.
12015 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
12016 the initialization was successful. It might fail if storage was
12017 exhausted.
12018 (yyexpandGLRStack): Add more checks for storage allocation failure.
12019 Use yyStackOverflow to report failures.
12020 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
12021 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
12022 Don't assume stack number fits in int.
12023 (yysplitStack): Check for storage allocation failure.
12024 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
12025 can print diagnostics on storage allocation failure. All callers
12026 changed.
12027 (yyresolveValue): Use yybool for boolean.
12028 (yyreportSyntaxError): Check for size-calculation overflow.
12029 This code is taken from yacc.c.
12030 (yyparse): Check for storage allocation errors when allocating
12031 the initial stack.
12032
1c59e0a1
AD
120332005-07-05 Akim Demaille <akim@epita.fr>
12034
12035 Extract calc++ from the documentation.
12036 * doc/bison.texinfo (Calc++): Add the extraction marks.
12037 * examples/extexi: New, from the aborted GNU Programming 2E.
12038 Separate the different paragraph of a file with empty lines.
12039 * examples/Makefile: Use it to extract the whole calc++ example.
12040
8a0adb01
AD
120412005-06-24 Akim Demaille <akim@epita.fr>
12042
12043 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
12044 class typedefs.
12045
12545799
AD
120462005-06-22 Akim Demaille <akim@epita.fr>
12047
12048 * doc/bison.texinfo (C++ Language Interface): First stab.
12049 (C++ Parsers): Remove.
12050
99be0235
AD
120512005-06-22 Akim Demaille <akim@epita.fr>
12052
12053 * data/lalr1.cc (yylex_): Honor %lex-param.
12054
0ffd4fd1
AD
120552005-06-22 Akim Demaille <akim@epita.fr>
12056
12057 Start a set of simple examples.
12058 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
12059 * examples/calc++/calc++-driver.hh,
12060 * examples/calc++/calc++-parser.yy,
12061 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
12062 * examples/calc++/compile, examples/calc++/test: New.
12063
0925ebb4
PE
120642005-06-09 Paul Eggert <eggert@cs.ucla.edu>
12065
12066 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
12067 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
12068 which stems from the 2005-05-27 patch.
12069
43d3b664
PH
120702005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12071
12072 * data/glr.c: Modify treatment of unused parameters to permit use
12073 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
12074
3062864d
PE
120752005-05-30 Paul Eggert <eggert@cs.ucla.edu>
12076
12077 Fix infringement on user name space reported by Janos Zoltan Szabo.
12078 * data/yacc.c (yyparse): strlen -> yystrlen.
12079
989b5b8e
AD
120802005-05-30 Akim Demaille <akim@epita.fr>
12081
12082 * data/lalr1.cc (_): New.
12083 Translate the various messages.
12084
bedf57f5
PE
120852005-05-27 Paul Eggert <eggert@cs.ucla.edu>
12086
12087 Fix infringement on user name space reported by Bruno Haible.
12088 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
12089 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
12090 the user's name space.
12091 (alloca): Include <stdlib.h> to get it, if it's not built in.
12092 (YYMALLOC, YYFREE): Define only if needed.
12093 (malloc, free): Declare, but only if needed, as this infringes on
12094 the user name space.
12095
4d1801f1
PE
120962005-05-25 Paul Eggert <eggert@cs.ucla.edu>
12097
12098 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
12099 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
12100 with %d format.
12101 * lib/ebitset.c (min, max): Undef before defining.
12102 * lib/vbitset.c (min, max): Likewise.
12103 * lib/subpipe.c (create_subpipe): Save local variables in case
12104 vfork clobbers them.
12105
121062005-05-24 Bruno Haible <bruno@clisp.org>
12107
12108 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
12109 error message syntax used by gcc-4.0.
12110
b94a9e1e
PE
121112005-05-23 Paul Eggert <eggert@cs.ucla.edu>
12112
85ac3861
PE
12113 * README: Mention m4 1.4.3. Remove obsolete advice about
12114 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
12115
b94a9e1e
PE
12116 * bootstrap: Remove workaround for problem I encountered with
12117 gettext 0.14.1; it seems to be fixed now.
12118
51c30d21
PE
121192005-05-22 Paul Eggert <eggert@cs.ucla.edu>
12120
009ce67d
PE
12121 * NEWS: Version 2.0a.
12122
f2a97c62
PE
12123 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
12124 the previous change.
12125
c8775f93
PE
12126 Various maintainer cleanups.
12127 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
12128 conftest*, for benefit of CVS commands run at the same time as
12129 "configure". Add build-aux, since "bootstrap" now creates it and
12130 its subfiles.
12131 * Makefile.cfg (move_if_change): Remove.
12132 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
12133 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
12134 (po_repo, do-po-update, po-update, wget_files, get-targets):
12135 (config.guess-url_prefix, config.sub-url_prefix):
12136 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
12137 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
12138 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
12139 Remove.
12140 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
12141 this is now the recommended name.
12142 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
12143 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
12144 ylwrap. These files now go into build-aux.
12145 * config/move-if-change: Remove.
12146 * config/prev-version.txt: Bump from 1.75 to 2.0.
12147
3ea5f0ec
PE
12148 * bootstrap: Add stdio-safer, unistd-safer modules.
12149 Remove m4/glibc2.m4 (introduced by latest gnulib, but
12150 we don't need it).
12151 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
12152 fopen-safer.c, stdio-safer.h, unistd-safer.h.
12153 * lib/subpipe.c: Include "unistd-safer.h".
12154 (create_subpipe): Make sure all the newly-created
12155 file descriptors are > 2, so that diagnostics don't
12156 get sent down them (which might cause Bison to hang, in theory).
12157 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
12158 * src/files.c (xfopen): Use fopen_safer, not fopen.
12159
51c30d21
PE
12160 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
12161 yesterday's yacc.c fix.
12162
cea1469d
PE
121632005-05-21 Paul Eggert <eggert@cs.ucla.edu>
12164
3ea5f0ec
PE
12165 * data/glr.c, data/lalr1.cc: Update copyright date.
12166
cea1469d
PE
12167 Fix a destructor bug reported by Wolfgang Spraul in
12168 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
12169 * data/yacc.c (yyabortlab): Don't call destructor, and
12170 don't set yychar to EMPTY.
12171 (yyoverflowlab): Don't call destructor.
12172 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
12173 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
12174 since we no longer output the message "discarding lookahead token
12175 end of input ()".
12176
5e6f62f2
PH
121772005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12178
12179 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
12180 fix a small glitch in debugging output.
12181 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
12182 after YY_SYMBOL_PRINT where needed.
12183
12184 (struct yyGLRState): Add some comments.
12185 (struct yySemanticOption): Add some comments.
12186 (union yyGLRStackItem): Add comment.
12187
12188 (yymergeOptionSets): Correct this to properly perform the union,
12189 avoiding infinite reported by Michael Rosien.
12190 Update comment.
12191
12192 * tests/glr-regression.at: Add test for GLR merging error reported
12193 by M. Rosien.
cea1469d 12194
0fb669f9
PE
121952005-05-13 Paul Eggert <eggert@cs.ucla.edu>
12196
12197 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
12198 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
12199 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
12200 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
12201 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
12202 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
12203 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
12204 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
12205 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
12206 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
12207 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
12208 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
12209 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
12210 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
12211 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
12212 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
12213 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
12214 src/derives.h, src/files.c, src/files.h, src/getargs.c,
12215 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
12216 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
12217 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
12218 src/output.h, src/parse-gram.c, src/parse-gram.h,
12219 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
12220 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
12221 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
12222 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
12223 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
12224 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
12225 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
12226 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
12227 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
12228 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
12229 tests/reduce.at, tests/regression.at, tests/sets.at,
12230 tests/synclines.at, tests/testsuite.at, tests/torture.at:
12231 Update FSF postal mail address.
12232
51f4735e
PE
122332005-05-11 Paul Eggert <eggert@cs.ucla.edu>
12234
12235 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
12236 Problem reported by Ralf Menzel.
12237
80ce3401
PE
122382005-05-01 Paul Eggert <eggert@cs.ucla.edu>
12239
12240 * tests/actions.at: Test that stack overflow invokes destructors.
12241 From Marcus Holland-Moritz.
12242 * data/yacc.c (yyerrlab): Move the code that destroys the stack
12243 from here....
12244 (yyreturn): to here. That way, destructors are called properly
12245 even if the stack overflows, or the user calls YYACCEPT or
12246 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
12247 (yyoverflowlab): Destroy the lookahead.
12248
122492005-04-24 Paul Eggert <eggert@cs.ucla.edu>
12250
12251 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
12252
72f000b0
PE
122532005-04-17 Paul Eggert <eggert@cs.ucla.edu>
12254
12255 * NEWS: Bison-generated C parsers no longer quote literal strings
12256 associated with tokens.
12257 * src/output.c (prepare_symbols): Don't escape strings,
12258 since users don't want to see C escapes.
12259 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
12260 in diagnostics.
c19683bb 12261 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
12262 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
12263
1094323f
PE
122642005-04-16 Paul Eggert <eggert@cs.ucla.edu>
12265
12266 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
12267 the data size is known to be too small and we can't increase it.
12268 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
12269
ca407bdf
PE
122702005-04-15 Paul Eggert <eggert@cs.ucla.edu>
12271
12272 * src/parse-gram.y: Include quotearg.h.
12273 (string_as_id): Quote $1 before using it as a key, since the
12274 lexer no longer quotes it for us.
12275 (string_content): Don't strip quotes, since lexer no longer
12276 quotes it for us.
12277 * src/scan-gram.l: Include quotearg.h.
12278 ("\""): Omit quote.
12279 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
12280 a key, since the rest of the lexer doesn't quote it.
12281 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
12282 * tests/regression.at (Token definitions): Check for backslashes
12283 in token strings.
12284
12285 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
12286 (YYSIZE_T): Define to unsigned long int when using an older compiler.
12287 (yyparse): Revamp code to generate long syntax error message, to
12288 make it easier to translate, and to avoid problems with arithmetic
12289 overflow. Change "virtual memory" to "memory" in diagnostic, since
12290 we don't know whether the memory is virtual.
12291
1ce59070
PE
122922005-04-13 Paul Eggert <eggert@cs.ucla.edu>
12293
12294 * NEWS: Bison-generated C parsers now use the _ macro to
12295 translate strings.
12296 * data/yacc.c (_) [!defined _]: New macro.
12297 All English strings wrapped inside this macro.
12298 * doc/bison.texinfo (Bison Parser): Document _.
12299 * po/POTFILES.in: Include src/parse-gram.c, since it now
12300 includes translateable strings that parse-gram.y doesn't.
12301
a749a695
PE
123022005-04-12 Paul Eggert <eggert@cs.ucla.edu>
12303
12304 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
12305 reverting the 2004-10-11 change to this function.
12306 (symbol_check_alias_consistency): Don't call symbol_type_set
12307 if the type name is already correct.
12308 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
12309
8fb1053b
PE
123102005-03-25 Paul Eggert <eggert@cs.ucla.edu>
12311
12312 * tests/regression.at (Token definitions): Don't use a token named
12313 c, as that generates a "#define c ..." that runs afoul of buggy
12314 stdlib.h that uses the identifier c as a member of struct
12315 drand48_data. Problem reported by Horst Wente.
12316
ff498c4a
PE
123172005-03-21 Paul Eggert <eggert@cs.ucla.edu>
12318
12319 * bootstrap: Change translation URL from
12320 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
12321 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
12322 redirection glitches. Problem reported by twlevo@xs4all.nl.
12323
65211d70
PE
123242005-03-20 Paul Eggert <eggert@cs.ucla.edu>
12325
12326 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
12327 after operands; POSIX says this isn't portable for the c99 command.
12328
9577fb1f
PE
123292005-03-18 Paul Eggert <eggert@cs.ucla.edu>
12330
12331 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
12332 immediately if a data overrun has occurred; this may help us track
12333 down what may be a spurious failure on MacOS.
12334
78b178f7
PE
123352005-03-17 Paul Eggert <eggert@cs.ucla.edu>
12336
a2599d0f
PE
12337 Respond to problems reported by twlevo@xs4all.nl.
12338
12339 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
12340
78b178f7
PE
12341 * src/vcg.h: Comment fix.
12342 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
12343 (G_CMAX): Change to -1 instead of INT_MAX.
12344
12345 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 12346
7296e729
PE
123472005-03-15 Paul Eggert <eggert@cs.ucla.edu>
12348
12349 * src/tables.c (state_number_to_vector_number): Put it inside an
12350 "#if 0", since it's not currently used. Problem reported by
12351 Roland McGrath.
12352
05ac60f3
PE
123532005-03-06 Paul Eggert <eggert@cs.ucla.edu>
12354
12355 * src/output.c (escaped_output): Renamed from
12356 escaped_file_name_output, since we now use it for symbol tags as
12357 well. All uses changed.
12358 (symbol_destructors_output, symbol_printers_output):
12359 Escape symbol tags too.
12360 Problem reported by Matyas Forstner in
12361 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
12362
12363 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
12364 not needed.
12365 * src/output.c (user_actions_output, token_definitions_output,
12366 symbol_destructors_output, symbol_printers_output): Likewise.
12367 * src/reader.c (prologue_augment): Likewise.
12368 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
12369
12370 * src/vcg.c (output_edge): Don't quote linestyle arg.
12371 Problem reported by twlevo@xs4all.nl.
12372
7eb453ac
PE
123732005-02-28 Paul Eggert <eggert@cs.ucla.edu>
12374
12375 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
12376 example, reported by Derek M Jones. Also, make the example even
12377 more outrageous, to better illustrate how bad the problem is.
12378
4c04c52a
PE
123792005-02-24 Paul Eggert <eggert@cs.ucla.edu>
12380
12381 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
12382 putsym. Typo reported by Sebastian Piping.
12383
a61e1620
PE
123842005-02-23 Paul Eggert <eggert@cs.ucla.edu>
12385
12386 * doc/bison.texinfo (Language and Grammar): some -> same
12387 (Epilogue): int he -> in the
12388 Typos reported by Sebastian Piping via Justin Pence.
12389
9ec93868
PE
123902005-02-07 Paul Eggert <eggert@cs.ucla.edu>
12391
12392 * tests/glr-regression.at (Improper handling of embedded actions
12393 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
12394 embedded actions and $-N in GLR parsers", work around an Autoconf bug
12395 with dollar signs in test names.
12396 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
12397 for a similar reason.
12398
73ce7e7e
PE
123992005-01-28 Paul Eggert <eggert@cs.ucla.edu>
12400
12401 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
12402 wants to redefine G_VIEW.
12403
2e72b98e
PE
124042005-01-27 Paul Eggert <eggert@cs.ucla.edu>
12405
12406 * src/vcg.c (get_view_str): Remove case for normal_view.
12407 Problem reported by twlevo@xs4all.nl.
12408
e0d634e5
PE
124092005-01-24 Paul Eggert <eggert@cs.ucla.edu>
12410
ccf830a4
PE
12411 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
12412 Problem reported by twlevo@xs4all.nl.
12413
e0d634e5
PE
12414 * doc/bison.texinfo: Change @dircategory from "GNU programming
12415 tools" to "Software development". Requested by Richard Stallman
12416 via Karl Berry.
12417
7bbc8cb0
PE
124182005-01-23 Paul Eggert <eggert@cs.ucla.edu>
12419
12420 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
12421 Problem reported by twlevo@xs4all.nl.
12422
08b770bc
PE
124232005-01-21 Paul Eggert <eggert@cs.ucla.edu>
12424
12425 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
12426 keyword; it's not needed with modern compilers, and it doesn't
12427 affect correctness with older compilers. Suggested by
12428 twlevo@xs4all.nl.
12429
95f22ad2
PE
124302005-01-17 Paul Eggert <eggert@cs.ucla.edu>
12431
12432 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
12433 gcc -Wswitch-default.
12434 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12435 * data/yacc.c (yyparse): Likewise.
12436
d229d15c
PE
124372005-01-12 Paul Eggert <eggert@cs.ucla.edu>
12438
12439 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
12440 already. Let config.h define any nonstandard values.
12441
ecadd90f
PE
124422005-01-10 Paul Eggert <eggert@cs.ucla.edu>
12443
12444 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
12445 for the benefit of slower hosts. Problem reported by
12446 Nelson H. F. Beebe.
12447
213744b5
PE
124482005-01-07 Paul Eggert <eggert@cs.ucla.edu>
12449
12450 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
12451 being defined and not used.
12452 * data/lalr1.cc (yyparse): Likewise.
12453 Use "if (false)" rather than "if (0)".
12454
249d3236
PE
124552005-01-05 Paul Eggert <eggert@cs.ucla.edu>
12456
12457 * TODO: Mention that we should allow NUL bytes in tokens.
12458
987cc1fb
PE
124592005-01-02 Paul Eggert <eggert@cs.ucla.edu>
12460
12461 * src/scan-skel.l (<<EOF>>): Don't close standard output.
12462 Problem reported by Hans Aberg.
12463
08fe02d9
PE
124642005-01-01 Paul Eggert <eggert@cs.ucla.edu>
12465
12466 * src/getargs.c (version): Happy new year; update overall
12467 program copyright date from 2004 to 2005.
12468
12469 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
12470 Problem reported by Hans Aberg.
12471 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
12472 (Output file names.): Add a test for the case when standard output
12473 is closed.
12474
010c0266
PE
124752004-12-26 Paul Eggert <eggert@cs.ucla.edu>
12476
12477 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
12478 to fix an oversight in the Bison 2.0 manual.
12479
da12206a
PE
124802004-12-25 Paul Eggert <eggert@cs.ucla.edu>
12481
12482 * NEWS: Version 2.0. Reformat the existing news items since
12483 1.875, so that related items are grouped together.
3a4734aa 12484 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
12485 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
12486
c935d934
PE
12487 * tests/torture.at (Exploding the Stack Size with Alloca): Set
12488 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
12489 otherwise, we're not testing alloca. Unfortunately there's no
12490 simple way to consult HAVE_ALLOCA here.
12491
da12206a
PE
12492 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
12493 for yymsg, too.
12494
12495 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
12496 hand. This avoids a warning about comparing int to size_t when
12497 GCC warnings are enabled.
12498
0a2c5137
PE
124992004-12-22 Paul Eggert <eggert@cs.ucla.edu>
12500
d7e14fc0
PE
12501 * NEWS: Bison-generated parsers no longer default to using the
12502 alloca function (when available) to extend the parser stack, due
12503 to widespread problems in unchecked stack-overflow detection.
12504 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
12505 responsibility to set it to a positive value. This lets the user
12506 specify a value that is not a preprocessor constant.
12507 * data/yacc.c (YYMAXDEPTH): Likewise.
12508 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
12509 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
12510 to be a compile-time constant. However, explain the constraints on it.
12511 Also, explain the constraints on YYINITDEPTH.
12512 (Table of Symbols): Explain that alloca is no longer the default.
12513 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
12514 to 1.
12515
0a2c5137
PE
12516 * doc/bison.texinfo (Location Default Action): Mention that n must
12517 be zero when k is zero. Suggested by Frank Heckenbach.
12518
e019c247
AD
125192004-12-22 Akim Demaille <akim@epita.fr>
12520
12521 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
12522 (parser::state_type, parser::semantic_type, parser::location_type):
12523 Private, not public.
12524 (parser::parse): Return ints, not bool.
12525 Returning a bool introduces a problem: 0 corresponds to false, and
12526 it seems weird to return false on success. Returning true changes
12527 the conventions for yyparse.
12528 Alternatively we could return void and send an exception.
12529 There is no clear consensus (yet?).
12530 (state_stack, semantic_stack, location_stack): Rename as...
12531 (state_stack_type, semantic_stack_type, location_stack_type): these.
12532 Private, not public.
12533 * tests/c++.at: New.
12534 * tests/testsuite.at, tests/Makefile.am: Adjust.
12535
72731bb7
AD
125362004-12-21 Akim Demaille <akim@epita.fr>
12537
12538 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
12539
9a0d8bec
AD
125402004-12-21 Akim Demaille <akim@epita.fr>
12541
12542 Don't impose std::string for filenames.
12543
12544 * data/lalr1.cc (b4_filename_type): New.
12545 (position::filename): Use it.
12546 (parser.hh): Move the inclusion of stack.hh and location.hh below
12547 the user code, so that needed headers for the filename type can be
12548 included first.
72731bb7
AD
12549 Forward declare them before the user code.
12550 * tests/Makefile.am (check-local, installcheck-local): Pass
12551 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 12552
99880de5
AD
125532004-12-20 Akim Demaille <akim@epita.fr>
12554
12555 Use more STL like names: my_class instead of MyClass.
12556
12557 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
12558 (SemanticStack, SemanticType, StateStack, StateType)
12559 (TokenNumberType, Stack, Slice, Traits, Parser::location)
12560 (Parser::value): Rename as...
12561 (location_stack, location_type, rhs_number_type, semantic_stack)
12562 (semantic_type, state_stack, state_type, token_number_type, stack)
12563 (slice, traits, parser::yylloc, parser::yylval): these.
12564
12565 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
12566
9bec482e
PE
125672004-12-19 Paul Eggert <eggert@cs.ucla.edu>
12568
12569 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
12570 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12571
f6fbd3da
PE
125722004-12-17 Paul Eggert <eggert@cs.ucla.edu>
12573
12574 Remove uses of 'short int' and 'unsigned short int'. This raises
12575 some arbitrary limits. It uses more memory but nowadays that's
12576 not much of an issue.
12577
12578 This change does not affect the generated parsers; that's a different
12579 task, as some users will want to conserve memory there.
12580
12581 Ideally we should use size_t to represent all object counts, and
12582 something like ptrdiff_t to represent signed differences of object
12583 counts; but that will require more code-cleanup than I have the
12584 time to do right now.
12585
12586 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
12587 Use size_t, not int or short int, to count objects.
12588 * src/closure.c (nritemset, closure): Likewise.
12589 * src/closure.h (nritemset, closure): Likewise.
12590 * src/nullable.c (nullable_compute): Likewise.
12591 * src/print.c (print_core): Likewise.
12592 * src/print_graph.c (print_core): Likewise.
12593 * src/state.c (state_compare, state_hash): Likewise.
12594 * src/state.h (struct state): Likewise.
12595 * src/tables.c (default_goto, goto_actions): Likewise.
12596
12597 * src/gram.h (rule_number, rule): Use int, not short int.
12598 * src/output.c (prepare_rules): Likewise.
12599 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
12600 errs, reductions): Likewise.
12601 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
12602 Likewise.
12603 * src/tables.c (vector_number, tally, action_number,
12604 ACTION_NUMBER_MINIMUM): Likewise.
12605 * src/output.c (muscle_insert_short_int_table): Remove.
12606
efeed023
AD
126072004-12-17 Akim Demaille <akim@epita.fr>
12608
12609 * data/lalr1.cc: Extensive Doxygenation.
12610 (error_): Rename as...
12611 (error): this, since it is visible to the user.
12612 Adjust callers.
12613 (Parser::message): Now an automatic variable from...
12614 (Parser::yyreport_syntax_error_): here.
12615 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
12616 Parser::error.
12617 * tests/input.at: Escape $.
12618
bc82c5a5
PE
126192004-12-16 Paul Eggert <eggert@cs.ucla.edu>
12620
12621 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
12622 Parenthesize rhs to avoid obscure problems with mistakes like
12623 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
12624 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12625 b4_rhs_location): Likewise.
12626 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12627 b4_rhs_location): Likewise.
12628
fd19f271
AD
126292004-12-16 Akim Demaille <akim@epita.fr>
12630
12631 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
12632 yacc.c: be sure to stay within yycheck_.
12633 * tests/actions.at: Re-enable C++ tests.
12634
10454ea4
AD
126352004-12-16 Akim Demaille <akim@epita.fr>
12636
12637 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
12638 real.
12639
c5b95ccf
AD
126402004-12-16 Akim Demaille <akim@epita.fr>
12641
12642 Use #define to handle the %name-prefix.
12643
12644 * data/glr.c, data/yacc.c: Comment changes.
12645 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
12646 so that one can refer to yylex in the parser file, and have it
12647 renamed, as is the case with other skeletons.
12648
617a8f12
AD
126492004-12-16 Akim Demaille <akim@epita.fr>
12650
12651 Move lalr1.cc internals into yy*.
12652
12653 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
12654 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
12655 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
12656 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
12657 (empty_, final_, terror_, errcode_, ntokens_)
12658 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
12659 (looka_, ilooka_, error_range_, nerrs_):
12660 Rename as...
12661 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
12662 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
12663 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
12664 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
12665 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
12666 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
12667 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
12668 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
12669 these.
12670
1e547e6e
PE
126712004-12-15 Paul Eggert <eggert@cs.ucla.edu>
12672
12673 Fix some problems reported by twlevo at xs4all.
12674 * src/symtab.c (symbol_new): Report an error if the input grammar
12675 contains too many symbols. This is better than calling abort() later.
12676 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
12677 (struct node, struct graph):
12678 Rename member expand to stretch. All uses changed.
12679 (struct graph): Remove member layoutalgorithm. All uses removed.
12680 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
12681 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
12682 All uses changed.
12683 (N_STRETCH): Rename from N_EXPAND. All uses changed.
12684
735d6bd4
AD
126852004-12-15 Akim Demaille <akim@epita.fr>
12686
12687 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
12688 Add more Doxygen comments.
12689 (symprint_, stack_print_, reduce_print_, destruct_, pop)
12690 (report_syntax_error_, translate_): Rename as...
12691 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
12692 (yypop_, yyreport_syntax_error_, yytranslate_): this.
12693
2e1f5829
AD
126942004-12-15 Akim Demaille <akim@epita.fr>
12695
12696 * data/lalr1.cc (lex_): Rename as...
12697 (yylex_): this.
12698 Move the trace here.
12699 Take the %name-prefix into account.
12700 Reported by Alexandre Duret-Lutz.
12701
a3cb6248
AD
127022004-12-15 Akim Demaille <akim@epita.fr>
12703
12704 Simplify the C++ parser constructor.
12705
12706 * data/lalr1.cc (debug_): Rename as...
12707 (yydebug_): so that the parser's internals are always in the yy*
12708 pseudo namespace.
12709 Adjust uses.
12710 (b4_parse_param_decl): Remove the leading comma as it is now only
12711 called as unique argument list.
12712 (Parser::Parser): Remove the constructor accepting a location and
12713 an initial debugging level.
12714 Remove from the other ctor the argument for the debugging level.
12715 (debug_level_type, debug_level, set_debug_level): New.
12716
12717 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
12718 constructor calls.
12719
07fed891
AD
127202004-12-15 Akim Demaille <akim@epita.fr>
12721
12722 Remove b4_root related material: failure experiment
a3cb6248 12723 (which goal was to allow to derive from a class).
07fed891
AD
12724
12725 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
12726 definitions and uses.
12727
e603eaa5
PE
127282004-12-14 Paul Eggert <eggert@cs.ucla.edu>
12729
12730 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
12731 not 2, since it's not portable to subtract 1 from the start of an
12732 array. The new item 0 is never set or used. All uses changed.
12733
12734 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
12735 the default definition of YYLLOC_DEFAULT. Problem reported
12736 by Frank Heckenbach.
12737
fafb007d
PE
127382004-12-12 Paul Eggert <eggert@cs.ucla.edu>
12739
12740 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
12741 the normal case and one for the error case. Just use the
12742 first one uniformly. Problem reported by Frank Heckenbach.
12743 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
12744 use exactly the same macro in both places.
12745 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
12746 so that the normal-case YYRHSLOC works for the error case too.
12747 All uses changed.
12748 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
12749 (YYLLOC_DEFAULT): Use the same macro as glr.c.
12750 * doc/bison.texinfo (Location Default Action): Don't claim that
12751 we have an array of locations. Use the same macro for both glr
12752 and lalr parsers. Mention YYRHSLOC. Mention what happens when
12753 the index is 0.
12754
48814dcd
PE
127552004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12756
a4e1a53b
PE
12757 * HACKING: Update email addresses to send announcements to.
12758
48814dcd
PE
12759 * configure.ac (AC_INIT): Bump version to 1.875f.
12760
337116ba
PE
127612004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12762
12763 * NEWS: Version 1.875e.
12764 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
12765
12766 * src/scan-skel.l: Include "complain.h", for "fatal".
12767
12768 * src/relation.h (relation_print, relation_digraph):
12769 Relation sizes are of type relation_node, not size_t (this is
12770 merely a doc fix, since the two types are equivalent).
12771 (relation_transpose): Relation sizes are of type relation_node,
12772 not int.
12773 * src/relation.c: Likewise.
12774 (top, infinity): Now of type relation_node, not int.
12775 (traverse, relation_transpose): Use relation_node, not int.
12776
12777 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
12778 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
12779 (yyparse): Remove unused local introduced in 2004-10-25 patch.
12780
12781 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 12782 specifying whether the test should be skipped. Use it tp
337116ba 12783 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 12784 fail on some hosts, and should be skipped.
337116ba 12785
da2a7671
PE
127862004-12-08 Paul Eggert <eggert@cs.ucla.edu>
12787
12788 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
12789 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
12790 unless otherwise specified below.
12791
12792 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
12793 to allocate kernel_base, kernel_items, kernel_size, since
12794 they needn't be initialized to 0.
12795 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
12796 * src/closure.c (new_closure): Likewise, for itemset.
12797 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
12798 * src/lalr.c (set_goto_map): Likewise, for temp_map.
12799 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
12800 (build_relations): Likewise for edge, states1, includes.
12801 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
12802 * src/reader.c (packgram): Likewise, for ritem, rules.
12803 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
12804 * src/relation.c (relation_digraph): Likewise for VERTICES.
12805 (relation_transpose): Likewise for new_R, end_R.
12806 * src/symtab.c (symbols_token_translations_init): Likewise for
12807 token_translations.
12808 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
12809 (token_actions): Likewise for yydefact, actrow, conflrow,
12810 conflict_list.
12811 (save_column): Likewise for froms[symno], tos[symno].
12812 (goto_actions): Likewise for state_count.
12813 (pack_table): Likewise for base, pos, check.
12814 (tables_generate): Likewise for width.
12815
12816 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
12817 for initial core. Just have a separate core, so we needn't worry
12818 about whether kernel_size and kernel_base are initialized.
12819
12820 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
12821 kernel_size, kernel_items): Remove unnecessary initialization.
12822 * src/conflicts.c (conflicts): Likewise.
12823 * src/derives.c (derives): Likewise.
12824 * src/muscle_tablc (muscle_insert): Likewise.
12825 * src/relation.c (relation_digraph): Likewise.
12826 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
12827 conflrow, conflict_table, conflict_list, table, check):
12828 Likewise.
12829
12830 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
12831 This is because all callers pass unsigned int.
12832 * src/closure.h (new_closure): Likewise.
12833
12834 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
12835 (build_relations): Initialize includes[i] in all cases.
12836 * src/reader.c (packgram): Always initialize rules[ruleno].prec
12837 and rules[ruleno].precsym. Initialize members in order.
12838 * src/relation.c (relation_transpose): Always initialize new_R[i]
12839 and end_R[i].
12840 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
12841
12842 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
12843 conflict_list[0] was always 0, but now it isn't initialized.
12844
12845 * src/table.c (table_grow): When conflict_table grew, the grown
12846 area wasn't cleared. Fix this.
12847
12848 * lib/.cvsignore: Add strdup.c, strdup.h.
12849 * m4/.cvsignore: Add strdup.m4.
12850
00baeeac
PE
128512004-12-07 Paul Eggert <eggert@cs.ucla.edu>
12852
12853 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
12854 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
12855 GOTO_NUMBER_MAXIMUM, since we occasionally compute
12856 ngotos + 1 without checking for overflow.
12857 (build_relations): Use END_NODE, not -1, to denote end of edges.
12858 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
12859 build_relations): Use goto_number, not int, for goto numbers.
12860 * src/tables.c (save_column, default_goto): Likewise.
12861
be3d9d42
AD
128622004-11-23 Akim Demaille <akim@epita.fr>
12863
12864 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
12865 of #defining from yystype.
12866 Don't typedef yystype, C++ does not need it.
12867 This lets it possible to forward declare it as union.
12868
78e526d5
PE
128692004-11-23 Paul Eggert <eggert@cs.ucla.edu>
12870
12871 * bootstrap (gnulib_modules): Add extensions.
12872 Problem reported by Jim Meyering.
12873
afbb696d
PE
128742004-11-22 Paul Eggert <eggert@cs.ucla.edu>
12875
12876 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
12877 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
12878 src/system.h, src/tables.c: XFREE -> free, to accommodate
12879 recent change to gnulib xalloc.h.
78e526d5 12880 Problem reported by Jim Meyering.
afbb696d 12881
c1f8f16a
AD
128822004-11-17 Akim Demaille <akim@epita.fr>
12883
12884 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
12885
db7e5eb5 128862004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
12887 Alexandre Duret-Lutz <adl@gnu.org>
12888
12889 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
12890 changes.
12891 (YYCDEBUG): Adjust.
12892 Use it instead of cdebug_.
12893 (Parser::debug_stream, Parser::set_debug_stream): New.
12894 (Parser::symprint_): Define cdebug_ for temporary backward
12895 compatibility.
12896 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
12897 debug_stream ().
12898
68e11668
AD
128992004-11-17 Akim Demaille <akim@epita.fr>
12900
12901 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
12902 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
12903 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
12904 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12905
97cbc73e
PE
129062004-10-27 Paul Eggert <eggert@cs.ucla.edu>
12907
12908 * data/glr.c (yyloc_default): Remove; not used.
12909 Problem reported by Frank Heckenbach.
12910
e342c3be
AD
129112004-10-25 Akim Demaille <akim@epita.fr>
12912
12913 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
12914 Introduce another definition to address simple location arrays.
12915 (yyGLRStack): New member: yyerror_range.
12916 (yyrecoverSyntaxError, yyparse): Update it.
12917 (yyrecoverSyntaxError): Use it when shifting the error token to
12918 have an accurate range, equivalent to the one computed by both
12919 yacc.c and lalr1.cc.
12920 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
12921 that column numbers start at column 0, as per GNU Coding
12922 Standards, the others tests, and the doc.
12923 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
12924 Adjust to the above change (first column is 0).
12925 And adjust the location of the "<error>", now covering the whole
12926 line.
12927
93602feb 129282004-10-22 Akim Demaille <akim@epita.fr>
04098407 12929 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
12930
12931 Remove some arbitrary limits on goto numbers and relations.
12932 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
12933 initial values, since they're never used.
12934 (set_goto_map): ngotos is now unsigned, so test for overflow
12935 by seeing whether it wraps around to zero.
12936 * src/lalr.h (goto_number): Now size_t, not short int.
12937 (GOTO_NUMBER_MAXIMUM): Remove.
12938 * src/relation.c (relation_print, traverse, relation_transpose):
12939 Check for END_NODE rather than looking at sign.
12940 * src/relation.h (END_NODE): New macro.
12941 (relation_node): Now size_t, not short int.
12942
dba08b04
PE
129432004-10-22 Paul Eggert <eggert@cs.ucla.edu>
12944
12945 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
12946 keyword, not an identifier. Problem reported by Baron Schwartz in
12947 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
12948
df09ef2e
AD
129492004-10-11 Akim Demaille <akim@epita.fr>
12950
12951 * src/symtab.c (symbol_check_alias_consistency): Also check
12952 type names, destructors, and printers.
12953 Reported by Alexandre Duret-Lutz.
12954 Recode the handling of associativity and precedence in terms
12955 of symbol_precedence_set.
12956 Accept no redeclaration at all, not even equal to the previous
12957 value.
12958 (redeclaration): New.
12959 Use it to factor redeclaration complaints.
12960 (symbol_make_alias): Don't set the type of the alias, let
12961 symbol_check_alias_consistency do it as for other features.
12962 * src/symtab.h (symbol): Add new member prec_location, and
12963 type_location.
12964 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
12965 * tests/input.at (Incompatible Aliases): New.
12966
146bc99d
PE
129672004-10-09 Paul Eggert <eggert@cs.ucla.edu>
12968
12969 .cvsignore fixes to accommodate gnulib changes,
12970 and the practice of naming build directories "_build".
12971 * .cvsignore: Add "_*". Sort.
12972 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
12973 * m4/.cvsignore: Add "*_gl.m4".
12974
e503aa60
AD
129752004-10-06 Akim Demaille <akim@epita.fr>
12976
12977 * src/parse-gram.y (add_param): Fix the truncation of trailing
12978 spaces.
12979
b4a20338
AD
129802004-10-05 Akim Demaille <akim@epita.fr>
12981
12982 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
12983 whether the reducion was empty or not. This leaves room to
12984 improve the use of YYLLOC_DEFAULT in such a case.
12985 lalr1.cc is still experimental, so changing this is acceptable.
12986 And finally, there are probably not many users who changed the
12987 handling of locations in GLR, so changing is admissible too.
12988
12989 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
12990 empty reduction, set @$ to an empty location ending the previously
12991 stacked symbol.
12992 Adjust uses to make sure the code is triggered on empty
12993 reductions.
12994 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
12995 expected output: empty reductions have empty locations.
12996
f85a5e6f
AD
129972004-09-29 Akim Demaille <akim@epita.fr>
12998
12999 * data/lalr1.cc: Move towards a more standard C++ coding style
13000 for templates: Class < T > -> Class<T>.
13001
b203fc2c
AD
130022004-09-29 Akim Demaille <akim@epita.fr>
13003
13004 * data/lalr1.cc: Reinstall the former ctor, for sake of
13005 compatibility, but warn it will be removed.
13006 Move towards a more standard C++ coding style (i.e., type *var ->
13007 type* var).
13008
5b7e1e73
PE
130092004-09-27 Paul Eggert <eggert@cs.ucla.edu>
13010
3fee967f
PE
13011 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
13012 since it's less likely to work if NULs are involved in the future.
5b7e1e73 13013
0dcca5c2
AD
130142004-09-27 Akim Demaille <akim@epita.fr>
13015
13016 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
13017
6dde1c82
AD
130182004-09-27 Akim Demaille <akim@epita.fr>
13019
13020 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 13021 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
13022 and argument names.
13023 (b4_cc_constructor_call): Likewise.
13024
b233d555
AD
130252004-09-24 Akim Demaille <akim@epita.fr>
13026
13027 * src/parse-gram.y (add_param): Strip the leading and trailing
13028 blanks from a formal argument declaration.
13029 (YY_LOCATION_PRINT): New.
13030
619404e3
AD
130312004-09-24 Akim Demaille <akim@epita.fr>
13032
13033 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
13034 after the location.
13035
dd8d9022
AD
130362004-09-24 Akim Demaille <akim@epita.fr>
13037
13038 * doc/bison.texinfo (Table of Symbols): Sort.
13039
0092f063
AD
130402004-09-21 Akim Demaille <akim@epita.fr>
13041
13042 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
13043 the useless parentheses.
13044 Suggested by Paul Eggert.
13045
451364ed
AD
130462004-09-20 Akim Demaille <akim@epita.fr>
13047
13048 Let the initial-action act on the look-ahead, and use it for the
13049 "initial push" (corresponding to an hypothetical beginning-of-file).
13050 And let lalr1.cc honor %initial-action.
13051
13052 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
13053 example.
13054 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
13055 (Parser::Parser): Remove the ctor that used to initialize it.
13056 (Parser::parse): Like in the other skeletons, issue the "starting
13057 parse" message before any action.
13058 Honor %initial-action.
13059 Initialize the stacks with the lookahead.
13060 * data/yacc.c: Let $$ and @$ in %initial-action designate the
13061 look-ahead.
13062 Push them in the stacks.
13063 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
13064
18d192f0
AD
130652004-09-20 Akim Demaille <akim@epita.fr>
13066
13067 * doc/bison.texinfo (Initial Action Decl): New.
13068
b8458aa5
AD
130692004-09-20 Akim Demaille <akim@epita.fr>
13070
13071 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
13072 clearer criterion to define it.
13073 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
13074 When reducing on an empty RHS, use the latest stacked location as
13075 location.
13076 yylloc is not always available.
13077 * data/glr.c: Likewise.
13078 Also, honor initial-actions.
13079
3fc16193
AD
130802004-09-20 Akim Demaille <akim@epita.fr>
13081
13082 * data/yacc.c (YY_LOCATION_PRINT): New.
13083 Define when we know YYLTYPE's structure, i.e., when the default
13084 YYLLOC_DEFAULT is used.
13085 * data/c.m4 (b4_yysymprint_generate): Use it.
13086 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
13087 value of the result.
13088 (error_start_): Replace with...
13089 (error_range_): this location array.
13090 This allows to replace code relying on the implementation of
13091 locations by portable code.
13092 * data/yacc.c (yylerrsp): Replace with...
13093 (yyerror_range): this.
13094 Every time a token is popped, update yyerror_range[0], to have an
13095 accurate location for the error token.
13096 * data/glr.c (YY_LOCATION_PRINT): New.
13097 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
13098 deference a pointer.
13099 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
13100 report the location in %printers.
13101
13102 * src/scan-skel.l: Instead of abort, report error messages to ease
13103 understanding skeleton scanning failures.
13104
ecfe33e7
AD
131052004-09-16 Akim Demaille <akim@epita.fr>
13106
13107 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
13108 (iterator, const_iterator): these, to be more in the C++ spirit.
13109 Also, return reverse iterators so that when displaying the stack
13110 we display its bottom first.
13111 (Parser::stack_print_, Parser::reduce_print_): Match the messages
13112 from yacc.c.
13113 We should probably use vector here though.
13114
1576d44d
AD
131152004-09-16 Akim Demaille <akim@epita.fr>
13116
13117 Have more complete shift traces.
13118
13119 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
13120 to report Shifts instead of ad hoc YYDPRINTF invocations,
13121 including for the error token.
13122 * data/lalr1.cc (symprint_): Output the location.
13123 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
13124 output the location within the %printer.
13125 Activate GLR tests, at least to make sure they compile properly.
13126 They still don't pass though.
13127 * tests/calc.at: Adjust expect verbose output, since now "Entering
13128 state..." is on a different line than the "Shifting" message.
13129
9c66f418
AD
131302004-09-08 Akim Demaille <akim@epita.fr>
13131
13132 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
13133 Bison directive from the Bison file to the invocation of this
13134 macro, so that these directives are passed to
13135 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
13136 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
13137 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
13138 the extra Bison directives instead of the whole series.
13139 Change the grammar so that there are recoverable errors, and
13140 unrecoverable errors. Now we can have the parser give up before
13141 consuming the whole input. As a result we now can observe that
13142 the lookahead is freed when needed.
13143 Change the parser source to parse argv[1] instead of a hard coded
13144 string.
13145 Simplify yylex, and give a value and location to EOF.
13146 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
13147 passed directives already coded in the file.
13148 Add some tests to check the location of "error".
13149 For some tests, the C++ parser is correct, and not yacc.c.
13150 For other tests, they provide different, but unsatisfying, values,
13151 so keep the C++ value so that at least one parser is "correct"
13152 according to the test suite.
13153 (Actions after errors): Remove, this is subsumed by the
13154 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
13155
52d5733f
AD
131562004-09-06 Akim Demaille <akim@epita.fr>
13157
13158 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 13159 (Parser::pop): New.
52d5733f
AD
13160 Use it.
13161
a0e68930
AD
131622004-09-06 Akim Demaille <akim@epita.fr>
13163
13164 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
13165 argument, an informative message.
13166 Call YY_SYMBOL_PRINT.
13167 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
13168 * data/lalr1.cc (destruct_): Likewise.
13169 In addition, no longer depend on b4_yysymprint_generate and
13170 b4_yydestruct_generate to generate these functions, do it "by
13171 hand".
13172
e757bb10
AD
131732004-09-03 Akim Demaille <akim@epita.fr>
13174
13175 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
13176 invoked, yydestruct the lookahead.
13177 * tests/calc.at (Calculator $1): Update the expected lengths of
13178 traces: there is an added line for the discarded lookahead.
13179 * doc/bison.texinfo (Destructor Decl): Some rewording.
13180 Define "discarded" symbols.
13181
0fe1f06d
AD
131822004-09-02 Akim Demaille <akim@epita.fr>
13183
13184 * data/lalr1.cc (translate_, destruct_): No reason to be static.
13185
284acc8b
AD
131862004-09-02 Akim Demaille <akim@epita.fr>
13187
13188 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
13189 (YYDSYMPRINTF): Rename as...
13190 (YY_SYMBOL_PRINT): this.
13191 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
13192 two.
13193 Use it instead of direct symprint_ calls.
13194 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
13195 one.
13196
a5eb1ed2
AD
131972004-09-02 Akim Demaille <akim@epita.fr>
13198
b7c72fe1
AD
13199 * data/lalr1.cc (b4_yysymprint_generate): New.
13200 (symprint_): New member function, defined when YYDEBUG.
13201 Use it consistently instead of token/nterm debugging output by
13202 hand.
a5eb1ed2
AD
13203 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
13204 %printer calls to use cdebug_ when using lalr1.cc.
13205
417141dd
AD
132062004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
13207
13208 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
13209 with #ifdef YYDEBUG.
13210
2fa09258
AD
132112004-08-26 Akim Demaille <akim@epita.fr>
13212
13213 * doc/bison.texinfo (Implementing Loops): Rename as...
13214 (Implementing Gotos/Loops): this.
13215
9378b508
PE
132162004-08-13 Paul Eggert <eggert@cs.ucla.edu>
13217
13218 Adjust to latest gnulib.
13219 * bootstrap (gnulib_modules): Add xalloc-die.
13220 Set LC_ALL=C so that file names sort consistently.
13221 Prefer the gnulib copies of gettext.m4, glibc21.m4,
13222 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
13223 uintmax_t.m4, ulonglong.m4.
13224 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
13225 po.m4 since we are now using _gl.m4 instead.
13226
87a8ad5c
PE
132272004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
13228
13229 * src/scan-action.l: Remove. Scanning of semantic actions is
13230 handled in scan-gram.l.
13231
dca81a78
PE
132322004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
13233
13234 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
13235
13236 * src/location.h (struct): The file member is a uniqstr.
13237 (equal_boundaries): Use UNIQSTR_EQ for comparison.
13238
c9cbf7c5
PE
132392004-07-22 Paul Eggert <eggert@cs.ucla.edu>
13240
13241 Fix bug with non-%union parsers that have printers or destructors,
13242 which led to a Bison core dump. Reported by Peter Fales in
13243 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 13244
c9cbf7c5
PE
13245 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
13246 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
13247 not to our own type.
13248 * src/output.c (symbol_destructors_output, symbol_printers_output):
13249 Don't assume %union.
13250 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
13251 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
13252 UNION-FLAG. All callers changed.
13253 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
13254 Use type char, not unsigned int, when declaring an array of char;
13255 this lets us remove a cast.
13256 (Printers and Destructors): Add non-%union test cases.
13257
fa7e68c3
PE
132582004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13259
13260 * doc/bison.texinfo: Minor editorial changes, mostly to the new
13261 GLR writeups. E.g., avoid frenchspacing and the future tense,
13262 change "lookahead" to "look-ahead", and change "wrt" to "with
13263 respect to".
2fa09258 13264
fa7e68c3
PE
132652004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13266
13267 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
13268 New sections, split off from the GLR Parsers section. Put the new
13269 Simple GLR Parser near the start of the GLR section, for clarity.
13270 Rewrite connective text.
13271
99a9344e
PE
132722004-06-21 Frank Heckenbach <frank@g-n-u.de>
13273
13274 * doc/bison.texinfo (Simple GLR Parsers): New section.
13275
8dd162d3
PE
132762004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13277
13278 * NEWS, TODO, doc/bison.texinfo:
13279 Use "look-ahead" instead of "lookahead", to be consistent.
13280 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
13281 while we're fixing "look-ahead".
13282 * src/conflicts.c (shift_set): Renamed from shiftset.
13283 (look_ahead_set): Renamed from lookaheadset.
13284 * src/print.c: Likewise.
13285 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
13286 name for "lookahead".
13287 (report_types, usage): Likewise.
13288 * src/getargs.h (report_look_ahead_tokens): Renamed from
13289 report_lookaheads.
13290 * src/lalr.c (compute_look_ahead_tokens): Renamed from
13291 compute_lookaheads.
13292 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
13293 (look_ahead_tokens_print): Renamed from lookaheads_print.
13294 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
13295 state_rule_lookaheads_print.
13296 * src/state.h: Likewise.
13297 (reductions.look_ahead_tokens): Renamed from lookaheads.
13298 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
13299 AT_DATA_LOOKAHEADS_GRAMMAR.
13300
57a90331
PE
133012004-06-03 Paul Eggert <eggert@cs.ucla.edu>
13302
13303 * README: Update location of patched M4 distribution.
13304
8ed3234a
PE
133052004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
13306
13307 Don't assume the C++ compiler takes the same arguments as the C compiler
13308 (trivial change).
13309 * configure.ac (O0CXXFLAGS): New var.
13310 * tests/atlocal.in (CXXFLAGS): Use it.
13311
07971983
PE
133122004-05-29 Paul Eggert <eggert@cs.ucla.edu>
13313
13314 Fix some "make check" problems with C++ reported by
13315 Albert Chin-A-Young for Tru64 C++ in this thread:
13316 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
13317
13318 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
13319 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13320 Output to a .cc file for C++, not to a .c file.
13321 * tests/calc.at (AT_CHECK_CALC): Likewise.
13322 * tests/regression.at (AT_CHECK_DANCER): Likewise.
13323 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
13324
29058652
PE
133252004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
13326
13327 * tests/calc.at, tests/actions.at: Workaround for SGI
13328 C++ compiler. (trivial change)
13329
62cb8a99
PE
133302004-05-27 Paul Eggert <eggert@cs.ucla.edu>
13331
fd418816
PE
13332 Spent a few hours checking out which prerequisite versions the
13333 current sources actually require. I went all the way back to
13334 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
13335 a seemingly endless set of combinations of versions more recent
13336 than that. The bottom line is that the current sources require
13337 fairly recent versions of the build tools, and it'll be some work
13338 to change this.
13339 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
13340 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
13341 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
13342 Add comments explaining why those particular versions are
13343 currently needed.
2fa09258 13344
62cb8a99
PE
13345 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
13346 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 13347 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
13348
13349 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
13350 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
13351
caa52c10
PE
133522004-05-26 Paul Eggert <eggert@cs.ucla.edu>
13353
13354 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
13355 0.11.5. Suggested by Bruno Haible.
13356 * bootstrap: Remove gettext version checking.
13357
13358 * doc/bison.texinfo (Decl Summary): Also mention that %union
13359 can depend on prerequisite types. Problem reported by Tim
13360 Van Holder.
13361
4bfd5e4e
PE
133622004-05-25 Paul Eggert <eggert@cs.ucla.edu>
13363
2cef3017
PE
13364 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
13365 * README-alpha: Don't tell people not to package this.
13366
b9c85d5c
PE
13367 * bootstrap: Don't assume $(...) works; use `...` instead.
13368 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
13369 gettext better.
13370
4bfd5e4e
PE
13371 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
13372 put into the -d output file, and mention what to do if YYSTYPE is
13373 defined as a macro.
13374
6a36ff94
PE
133752004-05-24 Paul Eggert <eggert@cs.ucla.edu>
13376
6712933e
PE
13377 Undo change made earlier today: it caused autopoint to not bring
13378 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
13379 autopoint's.
13380
13381 * bootstrap: Check that gettext version matches what's in
13382 configure.ac. Warn users to ignore robots.txt ERROR 404.
13383 * bootstrap: Undo today's earlier change (logged below).
13384 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 13385
6a36ff94
PE
13386 The gettext version checking is causing more trouble than it's
13387 curing; remove it. Problem reported by Paul Hilfinger.
13388
13389 * bootstrap: Issue a warning that one can expect a message
13390 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
13391 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
13392
209ea708
PE
133932004-05-23 Paul Eggert <eggert@cs.ucla.edu>
13394
13395 Ensure that the C++ compiler used for testing actually works on a
13396 simple test program; if not, skip the C++-related tests. Problem
13397 reported by Vin Shelton in:
161a71f3 13398 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
13399
13400 * m4/cxx.m4: New file.
13401 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
13402 * tests/atlocal.in (BISON_CXX_WORKS): Add.
13403 * tests/local.at (AT_COMPILE_CXX): Use it.
13404
41ca2549
PE
134052004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13406
383e69dc
PE
13407 * data/glr.c (yylloc): Output this macro even if locations are not
13408 being generated, as the GLR parser needs it even in that case.
13409 Problem reported by Troy A. Johnson
13410 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
13411
41ca2549
PE
13412 * configure.ac (AC_INIT): Update to 1.875e.
13413
e476c87d
PE
134142004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13415
13416 * NEWS: Version 1.875d.
13417 * configure.ac (AC_INIT): Likewise.
13418 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
13419
13420 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
13421 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
13422 lalr1.cc runs afoul of the first, and the last two are no longer
13423 supported by GCC 3.4.0.
13424 * README: Mention GNU m4 1.4 or later; mention m4 patches.
13425 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
13426
233a88ad
PE
134272004-05-06 Paul Eggert <eggert@cs.ucla.edu>
13428
13429 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
13430 unsigned int, for compatibility with latest gnulib hash module.
13431 * src/state.c (state_hash, state_hasher): Likewise.
13432 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
13433 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 13434
12ffdd28
PE
134352004-05-03 Paul Eggert <eggert@cs.ucla.edu>
13436
13437 * NEWS: Unescaped newlines are no longer allowed in char & strings.
13438
13439 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
13440 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
13441 character and string literals.
13442 (unexpected_end): New function.
13443 (unexpected_eof): Use it.
13444 (unexpected_newline): New function.
13445 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
13446 actions.
e476c87d 13447
12ffdd28
PE
13448 * NEWS: Document %expect-rr.
13449
13450 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
13451 Fix typo by replacing $1 with $option.
13452 Remove more 'intl'-related files.
9668e2be 13453 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
13454
13455 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
13456 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
13457 strtoul.c.
13458 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
13459 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
13460 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
13461 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
13462 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
13463 * src/.cvsignore: Add *.output.
13464
13465 * src/parse-gram.y: Put copyright notice inside %{ %} so it
13466 gets copied to the output file.
e476c87d 13467
1f65350a
PE
134682004-04-28 Paul Eggert <eggert@twinsun.com>
13469
13470 Get files from the gnulib and po repositories, instead of relying
13471 on them being in our CVS. Upgrade to latest versions of gnulib
13472 and Automake.
13473
13474 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
13475 * bootstrap: Bootstrap from gnulib and po repositories.
13476 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
13477 * README-cvs: Document these changes. Remove version numbers from
13478 mentions of build tools, since they change so often. Mention Flex.
13479
13480 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
13481 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
13482 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
13483 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 13484 does this for us.
12ffdd28
PE
13485 (AC_ISC_POSIX): Remove; we no longer support this
13486 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
13487 (AC_HEADER_STDC): Remove: we now assume C89 or better.
13488 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
13489 Do not check for C89 headers, except for locale.h which is used
13490 by the Yacc library and must port to K&R hosts.
13491 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
13492 Do not check for C89 functions, except for setlocale which is
13493 used by the Yacc library.
13494 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
13495 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
13496 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
13497 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
13498 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
13499 AM_GNU_GETTEXT): Remove; now done by:
13500 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
13501 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
13502 for us.
13503
13504 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
13505 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
13506 Define to empty, as gnulib.mk will do the rest for us.
13507 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
13508 for us.
13509 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
13510 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
13511
13512 * src/files.c: Include gnulib's xstrndup.h.
13513
13514 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
13515 (REALLOC): Use xnrealloc, for likewise.
13516 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
13517 (strnlen, memrchr): Remove decls; functions no longer used.
13518 Include <stpcpy.h>.
13519
13520 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
13521 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13522 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
13523 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
13524 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
13525 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
13526 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
13527 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
13528 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
13529 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
13530 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
13531 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13532 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
13533 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
13534 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
13535 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
13536 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
13537 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
13538 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
13539 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
13540 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
13541 Remove, as these files are now generated automatically
13542 by bootstrap or automake.
13543
13544 * po/ChangeLog: Remove: all but one entry was a duplicate
13545 of this file, and I moved that 2000-11-02 entry here.
13546
13547 * config/.cvsignore: Add Makefile, depcomp, install-sh.
13548 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
13549 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
13550 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
13551 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
13552 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
13553 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
13554 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
13555 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
13556 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
13557 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
13558 xstrndup.h.
13559 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
13560 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
13561 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
13562 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
13563 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
13564 * src/.cvsignore: Remove *_.c.
13565
13566
13567 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
13568 support it. (The latest stable gzip doesn't.)
13569
135702004-04-27 Paul Eggert <eggert@twinsun.com>
13571
13572 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
13573 case, as stos_ is now used by destructors due to the 2004-02-09
13574 change.
13575
13576 Remove more K&R C support.
13577 * lib/libiberty.y (PARAMS): Remove. All uses removed.
13578 * lib/subpipe.c (errno): Remove decl.
13579 Include <stdlib.h> unconditionally.
13580 (EXIT_FAILURE): Remove macro.
13581 * src/complain.c (vfprintf, strerror): Remove.
13582 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
13583 unconditionally.
13584 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
13585 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
13586 (strchr, strspn, memchr): Remove decls.
13587 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
13588 unconditionally. Do not declare perror.
13589 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
13590 unconditionally.
13591
13592 * src/complain.c (_): Remove useless defn, as system.h defines this.
13593
13594 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
13595 with latest obstack.h.
13596 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
13597 to procedure types, as obstack.h now does that for us.
13598 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
13599
13600 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
13601 so that this include file can stand alone.
13602 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
13603 does this now. Include subpipe.h first after config.h, to
13604 test whether it can stand alone.
13605
13606 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
13607 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
13608 unused declaration.
13609
13610 * tests/synclines.at (%union synch line): Put a dummy member in
13611 the union, because empty unions aren't allowed in C. Caught
13612 by GCC 3.4.0.
13613
4f16766c
PE
136142004-04-13 Jim Meyering <jim@meyering.net>
13615
13616 * src/conflicts.c (conflicts_print): Correct format string typo:
13617 use `%%' to produce literal `%'. (trivial change)
13618
779e7ceb
PE
136192004-03-30 Paul Eggert <eggert@twinsun.com>
13620
13621 * src/getargs.c (version): Update copyright year to 2004.
13622
13623 * data/c.m4 (b4_int_type): Use 'short int' rather than
13624 'short', and similarly for 'long', 'unsigned', etc.
13625 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13626 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
13627 yy_yypstack, yydumpstack): Likewise.
13628 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
13629 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
13630 Likewise.
13631 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
13632 yy_stack_print, yyparse): Likewise.
13633 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
13634 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
13635 * lib/bitset.c (bitset_print): Likewise.
13636 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
13637 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13638 * lib/bitsetv.c (bitsetv_dump): Likewise.
13639 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
13640 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
13641 Likewise.
13642 * src/LR0.c (allocate_itemsets): Likewise.
13643 * src/gram.h (rule_number, rule): Likewise.
13644 * src/lalr.h (goto_number): Likewise.
13645 * src/nullable.c (nullable_compute): Likewise.
13646 * src/output.c (prepare_rules): Likewise.
13647 * src/relation.c (relation_print, relation_digraph): Likewise.
13648 * src/relation.h (relation_node): Likewise.
13649 * src/state.h (state_number, transitions, errs, reductions,
13650 struct state): Likewise.
13651 * src/symtab.h (symbol_number, struct symbol): Likewise.
13652 * src/tables.c (vector_number, tally, action_number,
13653 default_goto, goto_actions): Likewise.
13654 * tests/existing.at (GNU Cim Grammar): Likewise.
13655 * tests/regression.at (Web2c Actions): Likewise.
13656
13657 * src/output.c (muscle_insert_short_int_table): Renamed from
13658 muscle_insert_short_table. All uses changed.
13659
d6328241
PH
136602004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
13661
13662 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
13663 (declaration): Replace expected_conflicts with expected_sr_conflicts.
13664 Add %expect-rr rule.
4f16766c 13665
d6328241
PH
13666 * src/scan-gram.l: Recognize %expect-rr.
13667
4f16766c 13668 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 13669 expected_conflicts.
4f16766c 13670 (expected_rr_conflicts): Declare.
d6328241
PH
13671
13672 * src/conflicts.c (expected_sr_conflicts): Rename from
13673 expected_conflicts.
13674 (expected_rr_conflicts): Define.
13675 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
13676 for GLR parsers.
13677 Use expected_sr_conflicts in place of expected_conflicts.
13678 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 13679
d6328241 13680 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 13681
1452af69
PE
136822004-03-08 Paul Eggert <eggert@gnu.org>
13683
13684 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 13685 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
13686
13687 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
13688 in lalr1.cc.
13689 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
13690 * src/scan-gram.l (scan_integer): New function.
13691 ({int}): Use it.
13692 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
13693 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
13694 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
13695 Say "long int", not "long", for uniformity with GNU style.
13696
006d217d
PE
136972004-02-25 Paul Eggert <eggert@twinsun.com>
13698
13699 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
13700 compilers. This fixes a problem with Intel's C++ compiler being
13701 chatty, reported by Guido Trentalancia in
161a71f3 13702 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 13703
c2729758
ADL
137042004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
13705
13706 Support %destructor and merge error locations in lalr1.cc.
13707
13708 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
13709 (Parser::stos_): Define unconditionally.
13710 (Parser::destruct_): New method. Generate its body with
13711 b4_yydestruct_generate.
13712 (Parser::error_start_): New attribute.
13713 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
13714 token which are discarded.
13715 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
13716 error_start_ when erroneous token are discarded.
13717 (Parser::parse) <yyerrlab1>: Compute the location of the error
13718 token so that it covers all the discarded tokens.
13719 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
13720 it can be called with `%skeleton "lalr1.cc"', and do that.
13721
dd0e0635
PE
137222004-02-02 Paul Eggert <eggert@twinsun.com>
13723
13724 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
13725 $(top_srcdir)/lib and ../lib. This fixes a bug reported
13726 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
13727 There's no need to mention top_builddir since Automake does that
13728 for us.
13729 (INCLUDES): Remove, as Automake says it's obsolescent.
13730 Contents migrated into AM_CPPFLAGS as described above.
13731 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
13732
137332004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13734
13735 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
13736 (yyreportSyntaxError): Handle case where lookahead token is
13737 YYEMPTY.
13738
be16239b
PH
137392004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13740
13741 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
13742 resulting parsers are compilable with C++.
13743
5fa90832
PE
137442003-12-23 Paul Eggert <eggert@twinsun.com>
13745
13746 * config/depcomp, config/install-sh: Sync with Automake 1.8.
13747 * src/output.c (output_skeleton): Rename local var.
13748 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
13749 Bison tokens, as this runs afoul of the 2003-10-07 change that
13750 disallowed NUL bytes in character constants or string literals.
13751
13752 * tests/local.at: Require Autoconf 2.59's Autotest.
13753 * tests/testsuite.at: Don't include local.at, since we now assume
13754 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
13755 including it.
13756 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
13757 multiple inclusion warnings.
dd0e0635 13758
b165c324
AD
137592003-12-02 Akim Demaille <akim@epita.fr>
13760
13761 * doc/bison.texinfo (How Can I Reset the Parser): More about start
13762 conditions.
13763 From Bruno Haible.
13764
26e06a21
ADL
137652003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
13766
13767 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
13768
92ac3705
PE
137692003-10-07 Paul Eggert <eggert@twinsun.com>
13770
6a5ecb38
PE
13771 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
13772 if testsuite doesn't exist.
13773
92ac3705
PE
13774 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
13775 literals, unfortunately.
13776 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
13777 Complain about NUL bytes in character constants or string literals.
13778
91d2c560
PE
137792003-10-05 Paul Eggert <eggert@twinsun.com>
13780
13781 * NEWS: Don't document %no-default-prec, as it's still
13782 too experimental.
13783 * doc/bison.texinfo: Document %no-default-prec only if
13784 the defaultprec flag is set. Normally it's not.
13785
0cc3da3a
PE
137862003-10-04 Paul Eggert <eggert@twinsun.com>
13787
13788 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
13789 non-modifiable lvalue, instead of a modifiable one.
13790 * doc/bison.texinfo (Actions): Document that $$ can
13791 be assigned to. Do not claim that $$ and $N are
13792 array element references: user code should not rely on this.
13793
22fccf95
PE
137942003-10-01 Paul Eggert <eggert@twinsun.com>
13795
13796 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
13797 (grammar_declaration): Use it.
13798 * src/scan-gram.l: New token %no-default-prec.
13799 * tests/conflicts.at: Revamp tests to use %no-default-prec.
13800 * NEWS, doc/bison.texinfo: Document the above.
13801
fc8f2965
AD
138022003-10-01 Akim Demaille <akim@epita.fr>
13803
13804 VCG no longer supports long_straight_phase.
13805
13806 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
13807 * src/print_graph.c (print_graph): Adjust.
13808
39a06c25
PE
138092003-09-30 Frank Heckenbach <frank@g-n-u.de>
13810 and Paul Eggert <eggert@twinsun.com>
13811
13812 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
13813 Table of Symbols): Document %default-prec.
13814 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
13815 (grammar_declaration): Set default_prec on %default-prec.
13816 * src/scan-gram.l (%default-prec): New token.
13817 * src/reader.h (default_prec): New flag.
13818 * src/reader.c: Likewise.
13819 (packgram): Handle it.
13820 * tests/conflicts.at (%default-prec without %prec,
13821 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 13822
39a06c25
PE
138232003-09-30 Paul Eggert <eggert@twinsun.com>
13824
13825 * tests/testsuite.at: Include local.at, not input.at, fixing
13826 a typo in the 2003-08-25 patch.
13827
62b6aef9
AD
138282003-08-27 Akim Demaille <akim@epita.fr>
13829
13830 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
13831 GCC warnings.
13832
89e1cc61
AD
138332003-08-26 Akim Demaille <akim@epita.fr>
13834
13835 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
13836 "<\#" to avoid magic from Gnus when posting parts of this script.
13837
a08460b0
AD
138382003-08-26 Akim Demaille <akim@epita.fr>
13839
13840 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
13841 (Parser::parse): here.
13842 Adjust: nerrs and errstatus is now replaced by...
13843 (Parser::nerrs_, Parser::errstatus_): New.
13844
603f1cfd
AD
138452003-08-25 Akim Demaille <akim@epita.fr>
13846
13847 * config/announce-gen, Makefile.cfg: New.
13848 * Makefile.am: Adjust.
13849 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
13850 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
13851
cd3684cf
AD
138522003-08-25 Akim Demaille <akim@epita.fr>
13853
13854 When reducing initial empty rules, Bison parser read an initial
13855 location that is not defined. This results in garbage, and that
13856 affects Bison's own parser. Therefore we need (i) to extend Bison
13857 to support a means to initialize this location, and (ii) to use
13858 this CVS Bison to fix CVS Bison's parser.
13859
13860 * src/reader.h, reader.c (epilogue_augment): Remove, replace
13861 with...
13862 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
13863 * src/parse-gram.y: Adjust.
13864 (%initial-action): New.
13865 (%error-verbose): Since we require CVS Bison, there is no reason
13866 not to use it.
13867 * src/scan-gram.l: Adjust.
13868 * src/Makefile.am (YACC): New, to make sure we use our own parser.
13869 * data/yacc.c (yyparse): Use b4_initial_action.
13870
4e03e201
AD
138712003-08-25 Akim Demaille <akim@epita.fr>
13872
13873 * doc/bison.texinfo: Don't promote stdout for error messages.
13874
8c182d05
AD
138752003-08-25 Akim Demaille <akim@epita.fr>
13876
13877 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
13878 From Alexandre Duret-Lutz.
13879
6a60c4cf
PE
138802003-08-25 Akim Demaille <akim@epita.fr>
13881
13882 Version 1.875c.
13883
25f66e1a
AD
138842003-08-25 Akim Demaille <akim@epita.fr>
13885
13886 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
13887 Use them.
13888
5348bfbe
AD
138892003-08-25 Akim Demaille <akim@epita.fr>
13890
13891 * data/lalr1.cc (Parser::reduce_print_): New.
13892 Use it.
13893
47301314
AD
138942003-08-25 Akim Demaille <akim@epita.fr>
13895
13896 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
13897 error recovery loops. This patch is based on
161a71f3 13898 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
13899 Also, augment the similarity between lalr1.cc and yacc.c.
13900 Note: the locations of error recovery rules are not correct yet.
13901
13902 * data/lalr1.cc: Comment changes to augment the similarity between
13903 lalr1.cc and yacc.c.
13904 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
13905 (yyerrlab1): Remove, but where it used to be (now the bottom part of
13906 yyerrlab), when hitting EOF, pop the whole stack here instead of
13907 merely falling thru the default error handling mechanism.
13908 (yyerrorlab): New label, with the old contents of YYERROR,
13909 plus the following change: pop the stack of rhs corresponding
13910 to the production that invoked YYERROR. That is how Yacc
13911 behaves (required by POSIX).
13912 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
13913 fail.
13914
1f7a61ff
AD
139152003-08-25 Akim Demaille <akim@epita.fr>
13916
13917 Tune local.at so that people can "autom4te -l autotest calc.at -o
13918 calc" for instance, to extract a sub test suite.
13919
13920 * tests/testsuite.at: Move the initialization, Autotest version
13921 requirement, and AT_TESTED invocation into...
13922 * tests/local.at: here.
13923 * tests/testsuite.at: Include it for compatibility with Autoconf
13924 2.57.
13925 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
13926 be ignore.
13927
327b5b56
PE
139282003-08-04 Paul Eggert <eggert@twinsun.com>
13929
13930 Rework code slightly to avoid gcc -Wtraditional warnings.
13931 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
13932 The returned value is now stored in *YY0. All callers changed.
13933 * src/output.c (merge_output): Adjust to the above change.
13934
0051e3ed
PE
139352003-07-26 Paul Eggert <eggert@twinsun.com>
13936
13937 * data/glr.c (YYASSERT): New macro.
13938 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
13939 yyresolveStates, yyprocessOneStack):
13940 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
13941 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 13942
137437c6
PE
139432003-07-25 Paul Eggert <eggert@twinsun.com>
13944
5b620e06
PE
13945 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
13946 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 13947 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
13948 by Frank Heckenbach, though I have omitted the structure-initialization
13949 part of his glr-knr.diff patch since I recall that the Portable
13950 C Compiler didn't require that change.
13951
137437c6
PE
13952 Let the user specify how to allocate and free memory.
13953 Derived from a suggestion by Frank Heckenbach in
161a71f3 13954 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
13955 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
13956 All uses of free, malloc, realloc changed to use these macros,
13957 and unnecessary casts removed.
13958 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
13959
ddb85ca5
PE
139602003-07-06 Matthias Mann <MatthiasMann@gmx.de>
13961
13962 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
13963 use s.empty() rather than s == "" to test for empty string; see
161a71f3 13964 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
13965 (trivial change)
13966
39910e09
AD
139672003-06-25 Akim Demaille <akim@epita.fr>
13968
13969 * config/depcomp, config/install-sh: Update from masters.
13970
0ae99356
PE
139712003-06-20 Paul Eggert <eggert@twinsun.com>
13972
13973 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
13974 and return properly parenthesized result.
13975 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
13976 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13977 Remove unnecessary parentheses from uses.
13978 * doc/bison.texinfo (Location Default Action): Describe the
13979 conventions for parentheses.
13980
cd05d13c
PE
139812003-06-19 Paul Eggert <eggert@twinsun.com>
13982
81fd08ca
PE
13983 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
13984 yyreportTree): Do not assume that size_t is the same width as int,
13985 when printing sizes. Print sizes using an unsigned format.
13986 Problem reported by Frank Heckenbach in
161a71f3 13987 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 13988
cd05d13c
PE
13989 Port to Forte Developer 7 C compiler.
13990 * data/glr.c (struct YYLTYPE): If locations are not being used,
13991 declare a single dummy member, as empty structs do not conform
13992 to the C standard.
13993 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
13994 the Forte Developer 7 C compiler complains that end-of-loop
13995 code is not reached.
13996
4dcf140b
PE
139972003-06-17 Paul Eggert <eggert@twinsun.com>
13998
13999 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
14000 avoid warnings from picky compilers about redefinition of PARAMS.
14001
8dd76bee
PE
140022003-06-17 Paul Eggert <eggert@twinsun.com>
14003
14004 Version 1.875b.
14005
14006 * NEWS: Document 1.875b.
14007
14008 * lib/bbitset.h: Do not include config.h; that's the includer's job.
14009 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
14010 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
14011 Don't use 'index' in comments, as it's a builtin fn on some hosts.
14012 * lib/bitset_stats.c: Include gettext.h unconditionally, as
14013 per recent gettext manual's suggestion.
14014 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
14015 Use prototypes, not old-style definitions.
14016 * lib/lbitset.c (lbitset_unused_clear): Likewise.
14017 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
14018 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
14019 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
14020 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
14021 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
14022 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
14023 vbitset_or_and_cmp, vbitset_copy): Likewise.
14024
14025 * lib/libiberty.h: Do not include config.h; that's the includer's job.
14026 Do not include <stdlib.h>.
14027 (PARAMS): Define unconditionally for C89.
14028 (ATTRIBUTE_NORETURN): Remove.
14029 (ATTRIBUTE_UNUSED): Define unconditionally.
14030
14031 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 14032 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
14033 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
14034 * lib/vbitset.c, lib/vbitset.h: New files.
14035 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14036 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
14037 from libbitset.
14038
14039 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
14040 `How Can I Reset @code{yyparse}', since texinfo does not allow
14041 arbitrary @ in node names.
14042
14043 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
14044 shouldn't be needed according to the gettext 0.12.1 documentation
14045 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 14046 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 14047 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 14048 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 14049
8dd76bee
PE
14050 * lib/.cvsignore: Add stdbool.h.
14051 * m4/.cvsignore: Add nls.m4, po.m4.
14052
14053 Upgrade to CVS gnulib.
14054 * stdbool_.h: File renamed from stdbool.h.in.
14055 * configure.ac (AM_STDBOOL_H): Invoke this instead of
14056 AC_HEADER_STDBOOL.
14057 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
14058 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
14059 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
14060 (MOSTLYCLEANFILES): New var.
14061 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
14062 (stdbool.h): New rule.
14063 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
14064 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
14065 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
14066 m4/quote.m4: Upgrade to today's gnulib.
14067
14068 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
14069 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
14070 the tests right now.
14071 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
14072 yyerror are declared before use; C99 requires this.
14073
25005f6a
PH
140742003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14075
14076 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
14077 first.
14078 (yyrecoverSyntaxError): Correct the logic for setting and testing
14079 yyerrState.
14080 Correct comment on handling EOF.
14081 Allow states with only a default reduction, rather than failing
8dd76bee 14082 (I can't quite reconstruct why these were not allowed before).
25005f6a 14083
137437c6 14084 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 14085 buffer overruns, corrupting state.
8dd76bee
PE
14086
14087 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
14088 definition.
14089 * src/reader.h (max_left_semantic_context): New variable declaration.
14090 * src/scan-gram.l (max_left_semantic_context): Define.
14091 (handle_action_dollar): Update max_left_semantic_context.
14092 * data/glr.c (YYMAXLEFT): New definition.
14093 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
14094 (yyresolveAction): Ditto.
14095
14096 Fixes to problems with location handling in GLR parsers reported by
14097 Frank Heckenbach (2003/06/05).
14098
14099 * data/glr.c (YYLTYPE): Make trivial if locations not used.
14100 (YYRHSLOC): Add parentheses, and define only if locations used.
14101 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
14102 locations not used.
14103 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
14104 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 14105
25005f6a
PH
14106 * tests/cxx-type.at: Exercise location information; update tests
14107 to differentiate output with and without locations.
8dd76bee 14108 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
14109 because default YYLTYPE not yet defined.
14110 Change semantic actions to compute strings, rather than printing
14111 them directly (to test proper passing of semantics values). Change
14112 output to prefix notation and update test data and expected results.
14113 (yylex): Track locations.
14114 (stmtMerge): Return value rather than printing, and include arguments
14115 in value.
8dd76bee 14116
711f40b7
PE
141172003-06-03 Paul Eggert <eggert@twinsun.com>
14118
14119 Avoid warnings generated by GCC 2.95.4 when Bison is
14120 configured with --enable-gcc-warnings.
14121 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
14122 yy::]b4_parser_class_name[::translate_,
14123 yy::Stack::operator[] (unsigned),
14124 yy::Stack::operator[] (unsigned) const,
14125 yy::Slice::operator[] (unsigned),
14126 yy::Slice::operator[] (unsigned) const):
14127 Rename local vars to avoid warnings.
14128 * tests/glr-regression.at (Improper handling of embedded actions
14129 and $-N in GLR parsers): Remove unused local variable from yylex.
14130 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
14131 (void) as arg when not pure, since we now assume C89 when building
14132 Bison. Pacify GCC by using parameter.
14133
ac695f7d
PE
141342003-06-02 Paul Eggert <eggert@twinsun.com>
14135
14136 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
14137 yy::Location::lines, yy::Location::columns): Rename arguments
14138 to avoid shadowing; this removes a warning generated by GCC 3.3.
14139
26ec81e0
PE
141402003-06-01 Paul Eggert <eggert@twinsun.com>
14141
14142 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
14143 to g++, as GCC 3.3 complains if you do it.
14144 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
14145 everything that WARNING_CFLAGS has, except omit warnings
14146 not suitable for C++.
14147 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
14148 * tests/atlocal.in (CXXFLAGS): New var.
14149 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
14150
14151 Fix a GLR parser bug I reported in February; see
161a71f3 14152 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
14153 The problem was that GLR parsers did not conform to the C standard,
14154 because actions like { $1 = $2 + $3; } expanded to expressions
14155 that invoked YYFILL in separate subexpressions, and YYFILL assigned
14156 to a local variable. The C standard says that expressions
14157 like (var = f ()) + (var = f ()) have undefined behavior.
14158 Another problem was that GCC sometimes issues warnings that
14159 yyfill and its parameters are unused.
14160
14161 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
14162 as possibly unused.
14163 (yyfill): New function.
14164 (YYFILL): Use it.
14165 (yyuserAction): Change type of yynormal to bool, so that it matches
14166 the new yyfill signature. Mark it as possibly unused.
14167
14168
14169 Follow up on a bug I reported in February, where a Bison-generated
14170 parser can loop. Provide a test case and a fix for yacc.c. I
14171 don't have a fix for lalr1.cc or for glr.c, unfortunately.
14172 The original bug report is in:
161a71f3 14173 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
14174
14175 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
14176 macro's size was becoming unwieldy.
14177 (yyerrlab): Do not discard an empty lookahead symbol, as this
14178 might destroy garbage.
14179 (yyerrorlab): New label, with the old contents of YYERROR,
14180 plus the following change: pop the stack of rhs corresponding
14181 to the production that invoked YYERROR. That is how Yacc
14182 behaves, and POSIX requires this behavior.
14183 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
14184 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
14185 Define 'alarm' to do nothing if unistd.h is not available.
14186 Add a new rule "exp: '-' error;" to test the above change to
14187 data/yacc.c. Use 'alarm' to abort any test taking longer than
14188 10 seconds, as it's probably looping.
14189 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
14190 Also, the new yacc.c generates two fewer diagnostics for an
14191 existing test.
14192
d0829076
PE
141932003-05-24 Paul Eggert <eggert@twinsun.com>
14194
c6ae27df
PE
14195 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
14196 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
14197 This fixes a problem reported by John Bowman when the Compaq/HP
14198 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
14199 -ansi -Wall -gall).
14200 * data/yacc.c (union yyalloc): Likewise.
14201 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 14202
d0829076
PE
14203 Switch from 'int' to 'bool' where that makes sense.
14204
14205 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
14206 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
14207 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
14208 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
14209 Return or accept bool, not int. All callers changed.
14210 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
14211 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
14212 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
14213 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
14214 bitset_or_and_cmp_): Likewise.
14215 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
14216 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
14217 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
14218 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
14219 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
14220 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
14221 bitset_stats_or_and_cmp): Likewise.
14222 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
14223 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
14224 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
14225 ebitset_xor_cmp): Likewise.
14226 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
14227 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
14228 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
14229 lbitset_xor_cmp): Likewise.
14230 * lib/bbitset.h: Include <stdbool.h>.
14231 (struct bitset_vtable): The following members now return bool, not
14232 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
14233 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
14234 or_and_cmp).
14235 * src/conflicts.c (count_rr_conflicts): Likewise.
14236 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
14237 All uses changed.
14238 * lib/ebitset.c (ebitset_obstack_init): Likewise.
14239 * lib/lbitset.c (lbitset_obstack_init): Likewise.
14240 * src/getargs.c (debug_flag, defines_flag, locations_flag,
14241 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14242 graph_flag): Likewise.
14243 * src/getargs.h (debug_flag, defines_flag, locations_flag,
14244 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14245 graph_flag): Likewise.
14246 * src/output.c (error_verbose): Likewise.
14247 * src/output.h (error_verbose): Likewise.
14248 * src/reader.c (start_flag, typed): Likewise.
14249 * src/reader.h (typed): Likewise.
14250 * src/getargs.c (LOCATIONS_OPTION): New constant.
14251 (long_options, getargs): Use it.
14252 * src/lalr.c (build_relations): Use bool, not int.
14253 * src/nullable.c (nullable_compute): Likewise.
14254 * src/print.c (print_reductions): Likewise.
14255 * src/tables.c (action_row, pack_vector): Likewise.
14256 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
14257 * src/output.c (prepare): Use it.
14258 * src/output.c (token_definitions_output,
14259 symbol_destructors_output, symbol_destructors_output): Use string,
14260 not boolean integer, to keep track of whether to output separator.
14261 * src/print_graph.c (print_core): Likewise.
14262 * src/state.c (state_rule_lookaheads_print): Likewise.
14263
14264 * config/install-sh: Sync from automake 1.7.5.
14265
6b2584b7
PE
142662003-05-14 Paul Eggert <eggert@twinsun.com>
14267
14268 * src/parse-gram.y (rules_or_grammar_declaration): Require a
14269 semicolon after a grammar declaration, in the interest of possible
14270 future changes to the Bison input language.
14271 Do not allow a stray semicolon at the start of the grammar.
14272 (rhses.1): Allow one or more semicolons after any rule, including
14273 just before "|" as required by POSIX.
14274 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
14275 grammar.
14276
caf37a36
ADL
142772003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
14278
14279 %parse-param support for lalr1.cc.
14280
14281 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
14282 b4_cc_constructor_calls, b4_cc_constructor_call,
14283 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
14284 definitions.
14285 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
14286 parse-param arguments.
14287 (yy::b4_parser_class_name): Declare instance variables to
14288 hold parse-param arguments.
14289 * tests/calc.at: s/value/semantic_value/ because value clashes
14290 with a member of yy::b4_parser_class_name. Adjust C++ code
14291 to handle %parse-param. Enable %parse-param test in C++.
14292
3ab37077
PE
142932003-05-12 Paul Eggert <eggert@twinsun.com>
14294
14295 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
14296 English a bit. Fix fclose typo. Change "const char" to "char
14297 const", and use ANSI C rather than K&R for "main". Suggest
14298 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
14299 and suggest yy_switch_to_buffer.
14300
143012003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
14302
14303 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
14304 C89. This avoids a diagnostic on compilers that define __STDC__
14305 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 14306 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 14307
e743727f
PE
143082003-05-03 Paul Eggert <eggert@twinsun.com>
14309
14310 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
14311 Do not overrun array bounds.
14312 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 14313 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 14314
916708d5
AD
143152003-04-29 Akim Demaille <akim@epita.fr>
14316
14317 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
14318 * src/getargs.c, src/getargs.h: here, as bool, not int.
14319 (nondeterministic_parser): New.
14320 * src/parse-gram.y, src/scan-gram.l: Support
14321 %nondeterministic-parser.
14322 * src/output.c (prepare): Use nondeterministic_parser instead
14323 of glr_parser where appropriate.
14324 * src/tables.c (conflict_row, action_row, save_row)
14325 (token_actions, token_actions, pack_vector): Ditto.
14326
a06ea4aa
AD
143272003-04-29 Akim Demaille <akim@epita.fr>
14328
14329 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
14330
211074ca
AD
143312003-04-29 Akim Demaille <akim@epita.fr>
14332
14333 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
14334 with %pure-parser and %locations to exercise the patch from Yakov
14335 Markovitch below.
14336
6175ffe3
PE
143372003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
14338
14339 * data/yacc.c: (b4_lex_param): Corrected for the case where
14340 %lex-param is provided and %pure-parser isn't.
14341
b1e95857
PE
143422003-04-27 Paul Eggert <eggert@twinsun.com>
14343
14344 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 14345 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
14346 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
14347 if it is not defined.
14348 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
14349
acda9df6
PE
143502003-04-26 Paul Eggert <eggert@twinsun.com>
14351
3470c57b
PE
14352 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
14353 Declare to be of type suitable for the ninf value itself, not of
14354 type suitable for the corresponding table, since the latter might
14355 be unsigned but the ninf value might be negative. This fixes a
14356 bug reported by Alexandre Duret-Lutz in
161a71f3 14357 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 14358
acda9df6
PE
14359 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
14360 invokes it. We shouldn't invoke it twice because it will attempt
14361 to put error.o in the archive twice. This fixes a glitch reported
14362 by Martin Mokrejs in
161a71f3 14363 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 14364
b5250f26
PE
143652003-04-21 Paul Eggert <eggert@twinsun.com>
14366
14367 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
14368 to gnulib.
14369
089ac0f1
PE
143702003-04-21 Yakov Markovitch <Markovitch@iso.ru>
14371
14372 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
14373 Fix obvious typo that results in uncompilable GLR parsers
14374 when both %pure-parser and %locations are used. (trivial change)
14375
5ededac6
PE
143762003-04-17 Paul Eggert <eggert@twinsun.com>
14377
1b8f2fff
PE
14378 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
14379 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
14380 Do not insert the expected token via unput, as this runs afoul
14381 of a POSIX-compatibility bug in flex 2.5.31.
14382 All uses changed to BEGIN the parent state,
14383 since we no longer insert the expected token via unput.
14384 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
14385 that is no longer emitted after the above change.
14386
5ededac6
PE
14387 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
14388 the first one. This change is from Paul Hilfinger, and it fixes
14389 regression reported by Werner Lemberg in
161a71f3 14390 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
14391
14392 (resolve_sr_conflict): Don't invoke state_errs_set
14393 unless one or more tokens have been explicitly made errors.
14394 Otherwise, the above change causes Bison to abort.
14395
14396 * tests/existing.at (GNU pic Grammar): New test case, taken from
14397 Lemberg's email.
14398
b8be9132
AD
143992003-03-31 Akim Demaille <akim@epita.fr>
14400
14401 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
14402
d423d460
AD
144032003-03-31 Akim Demaille <akim@epita.fr>
14404
14405 * src/output.c (prepare_symbols): Avoid trailing spaces in the
14406 output.
14407
c7e441b4
AD
144082003-03-31 Akim Demaille <akim@epita.fr>
14409
14410 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
14411 From Paul Hilfinger.
14412
231897ad
AD
144132003-03-29 Akim Demaille <akim@epita.fr>
14414
14415 * m4/error.m4: Do not put under dynamic conditions some code which
14416 expansion is under static control.
14417
5b066063
AD
144182003-03-29 Akim Demaille <akim@epita.fr>
14419
14420 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
14421
22a74fec
AD
144222003-03-29 Akim Demaille <akim@epita.fr>
14423
14424 * doc/bison.texinfo (Strings are Destroyed): New.
14425
0eee27e7
PE
144262003-03-13 Paul Eggert <eggert@twinsun.com>
14427
14428 * .cvsignore: Add configure.lineno.
14429 * src/.cvsignore: Add yacc.
14430 * tests/.cvsignore: Add testsuite.log.
14431 * doc/fdl.texi: Sync with latest FSF version.
14432
f61aad93
PE
144332003-03-12 Paul Eggert <eggert@twinsun.com>
14434
537636c7
PE
14435 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
14436 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
14437 cursor, instead of leaving it undefined. This fixes a bug
14438 reported by Tim Van Holder in
161a71f3 14439 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
14440 * tests/input.at (Torturing the Scanner): Test the scanner on
14441 an empty input file, which was Tim Van Holder's test case.
14442
14443 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
14444 <sys/resource.h> can be included, include sys/time.h and
14445 sys/times.h first, if available. This works around the SunOS
14446 4.1.4 porting bug reported by Bruce Becker in
161a71f3 14447 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
14448
14449 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
14450 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
14451 AC_HEADER_SYS_WAIT.
14452
f61aad93
PE
14453 Merge changes from gnulib. This was prompted because the CVS
14454 snapshot didn't build on Solaris 7 due to strnlen problems.
14455
14456 These changes need to be merged back into gnulib:
14457 * lib/hash.c: Include <stdbool.h> unconditionally.
14458 * m4/onceonly.m4 (m4_quote): New macro.
14459 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
14460 Quote AC_FOREACH variable-expansions properly.
14461 The 2003-01-03 obstack.h change also needs merging.
14462 {end of changes requiring merging}
5b066063 14463
f61aad93
PE
14464 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14465 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
14466 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
14467 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
14468 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
14469 New files, imported from gnulib.
14470 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
14471 above.
14472
14473 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
14474 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
14475 gnulib sources.
14476
14477 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
14478 Add.
14479 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
14480 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
14481 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
14482 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
14483 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
14484 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
14485 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
14486 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
14487 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
14488 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
14489 (jm_PREREQ_ARGMATCH): Remove.
14490 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
14491 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
14492
14493 * src/system.h: Include <stdbool.h> unconditionally.
14494
14495 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
14496 assuming at least C89 in the bitset code for some time now.
14497
d2ffe116
AD
144982003-03-03 Akim Demaille <akim@epita.fr>
14499
14500 * ro.po: New.
14501
052826fd
AD
145022003-03-02 Akim Demaille <akim@epita.fr>
14503
14504 * doc/bison.texinfo (Table of Symbols): Reactivate the
14505 documentation for %lex-param, and %parse-param.
14506
c4749565
AD
145072003-03-02 Akim Demaille <akim@epita.fr>
14508
14509 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
14510 generate verbose error messages.
14511 Use the number of tokens as an upper bound in yytname, as it
14512 cannot be a non terminal.
14513
d5286af1
AD
145142003-03-02 Akim Demaille <akim@epita.fr>
14515
14516 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
14517 message.
14518
22e304a6
AD
145192003-03-02 Akim Demaille <akim@epita.fr>
14520
22e304a6
AD
14521 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
14522 Use them to exercise yycheck overrun.
14523 Based on Andrew Suffield's grammar.
14524
67a25fed
AD
145252003-03-02 Akim Demaille <akim@epita.fr>
14526
14527 Create tests/local.at for Bison generic testing macros.
14528
14529 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
14530 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
14531 This new file.
14532 * tests/calc.at (AT_CHECK_CALC): Adjust.
14533 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
14534 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
14535 * tests/local.at: here.
14536 (AT_COMPILE_CXX): Tags the tests using it as c++.
14537 Ignore the test if CXX is not functional.
14538
9c2b381f
PE
145392003-03-01 Paul Eggert <eggert@twinsun.com>
14540
14541 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
14542 not loc->end, since loc->end might contain garbage and this leads
14543 to undefined behavior on some platforms.
14544 (id_loc, token_start): Use (IF_LINTed) initial values that do not
14545 depend on *loc, so that the reader doesn't give the the false
14546 impression that *loc is initialized.
14547 (<INITIAL>"%%"): Do not bother setting code_start, since its value
14548 does not survive the return.
14549
0433ba88
AD
145502003-03-01 Akim Demaille <akim@epita.fr>
14551
14552 * src/scan-gram.l (code_start): Always initialize it when entering
14553 into yylex, as SC_EPILOGUE is activated *before* the corresponding
14554 yylex invocation. An alternative would be making it static, but
14555 then it starts with the second %%'s beginning, instead of its end.
14556
b305ea69
PE
145572003-02-28 Paul Eggert <eggert@twinsun.com>
14558
14559 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
14560 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 14561 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 14562
c3d25e01
PE
145632003-02-26 Paul Eggert <eggert@twinsun.com>
14564
14565 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
14566 Remove Sequent/Pyramid discussion (nobody uses them any more).
14567 Merge VMS and MS-DOS discussion; these ports may well be dead
14568 but let's keep mentioning them for now. Put <> around email
14569 addresses. Add copyright notice.
14570
c267ffbc
PE
145712003-02-24 Paul Eggert <eggert@twinsun.com>
14572
14573 * data/glr.c (yy_reduce_print): yylineno -> yylno,
14574 to avoid collision with flex use of yylineno.
14575 Problem reported by Bruce Lilly in
161a71f3 14576 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
14577 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
14578 * data/yacc.c (yy_reduce_print): Likewise.
14579
14580 * config/depcomp: Sync with Automake 1.7.3.
14581
f939fc12
AD
145822003-02-21 Akim Demaille <akim@epita.fr>
14583
14584 * data/lalr1.cc: Use temporary variables instead of casts to
14585 change integer types.
14586 Suggested by Paul Eggert.
14587
95923bd6
AD
145882003-02-21 Akim Demaille <akim@epita.fr>
14589
14590 * doc/bison.texinfo: Use "location" consistently to refer to @n,
14591 to avoid confusions with lalr1.cc's notion of Position.
14592 Suggested by Paul Eggert.
14593
2cdc240e
AD
145942003-02-20 Akim Demaille <akim@epita.fr>
14595
14596 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
14597 before initial_columns.
14598 (location.hh): Use consistent variable names when defining the
14599 operator<<.
14600 Use "last" so that we subtract from Positions, not from unsigned.
14601
5d003116
AD
146022003-02-20 Akim Demaille <akim@epita.fr>
14603
14604 * data/lalr1.cc (position.hh): New subfile, including the extended
14605 and Doxygen'ed documentation of class Position.
14606 (location.hh): Use it.
14607 Document a` la Doxygen.
ba1ecc07 14608 With the help of Benoit Perrot.
5d003116 14609
d02b25f9
AD
146102003-02-20 Akim Demaille <akim@epita.fr>
14611
14612 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
14613 AT_YACC_IF.
14614 Redefine AT_YYERROR_SEES_LOC_IF using it.
14615 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
14616 not defined.
14617 Don't use the location in yy::Parser::error_ and
14618 yy::Parser::print_ when not %locations.
14619 Activate more lalr1.cc tests.
14620
0d1c3a04
AD
146212003-02-19 Akim Demaille <akim@epita.fr>
14622
14623 * data/lalr1.cc: When displaying a line number, be sure to make it
14624 an int.
14625
60a777aa
AD
146262003-02-19 Akim Demaille <akim@epita.fr>
14627
14628 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
14629 Remove, useless.
14630 (YYABORT, YYACCEPT, YYERROR): New.
14631 * tests/calc.at: Renable the lalr1.cc test.
14632
0b86fc41
AD
146332003-02-19 Akim Demaille <akim@epita.fr>
14634
14635 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
14636 error recovery, mixing with/without pops and discarding of the
14637 lookahead.
14638 Exercise YYERROR.
14639 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
14640
da99a5dc
PE
146412003-02-17 Paul Eggert <eggert@twinsun.com>
14642
14643 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
14644 * tests/testsuite.at (AT_COMPILE): Use them.
14645 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 14646 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 14647
93b8c255
PE
146482003-02-12 Paul Eggert <eggert@twinsun.com>
14649
14650 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
14651 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 14652 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
14653 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
14654 Check for malloc failure, for consistency with yacc.c.
14655 (yytname_size): Remove, for consistency with yacc.c.
14656
14657 The bug still remains in data/lalr1.cc, as I didn't have time
14658 to fix it there.
14659
7548fed2
AD
146602003-02-06 Akim Demaille <akim@epita.fr>
14661
14662 * configure.ac (GXX): Rename as...
14663 (CXX): this, to keep the original Autoconf semantics.
14664 Require 2.57.
14665 * data/lalr1.cc: Fix b4_copyright invocations.
14666 If YYDEBUG is not defined, don't depend upon name_ being defined.
14667 (location.hh): Include string and iostream.
14668 (Position::filename): New member.
14669 (Position::Position ()): New.
14670 (operator<< (Position)): New.
14671 (operator- (Position, int)): New.
14672 (Location::first, Location::last): Rename as...
14673 (Location::begin, Location::end): these, to mock the conventional
14674 iterator names.
14675 (operator<< (Location)): New.
14676 * tests/atlocal.in (CXX): New.
14677 * tests/testsuite.at (AT_COMPILE_CXX): New.
14678 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
14679 locations in a more synthetic way.
14680 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
14681 lalr1.cc is used.
14682 Adjust the C locations to match those from Emacs: first column is
14683 column 0.
14684 Change all the expected results.
14685 Conform to the GCS: simplify the locations when applicable.
14686 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
14687 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
14688 these CPP macros with the m4 macros new defined by...
14689 (AT_CHECK_PUSHDEFS): this, i.e.:
14690 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 14691 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
14692 New macros.
14693 (AT_CHECK_POPDEFS): Undefine them.
14694 (AT_CHECK_CALC_LALR1_CC): New.
14695 Use it for the first lalr1.cc test.
14696
43a176ef
AD
146972003-02-04 Akim Demaille <akim@epita.fr>
14698
14699 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
14700 Location as is defined.
14701
fc049e9c
AD
147022003-02-04 Akim Demaille <akim@epita.fr>
14703
14704 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
14705 name_ being defined.
14706
a737b216
PE
147072003-02-03 Paul Eggert <eggert@twinsun.com>
14708
14709 * src/gram.h (start_symbol): Remove unused decl.
14710
14711 Use more-consistent naming conventions for local vars.
14712
14713 * src/derives.c (derives_compute): Change type of local var from
14714 int to rule_number.
14715 * src/gram.c (grammar_rules_partial_print): Likewise.
14716 * src/print.c (print_core): Likewise.
14717 * src/reduce.c (reduce_grammar_tables): Likewise.
14718
14719 * src/gram.c (grammar_dump): Change name of item_number *
14720 local var from r to rp.
14721 * src/nullable.c (nullable_compute): Likewise.
14722
14723 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
14724
14725 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
14726 for symbol or symbol_number var.
14727 * src/reader.c (grammar_start_symbol_set): Likewise.
14728 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
14729 Likewise.
14730 * src/state.c (transitions_to): Likewise.
14731 * src/state.h: Likewise.
14732 * src/tables.c (symbol_number_to_vector_number): Likewise.
14733
14734 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
14735 char * var.
14736
14737 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
14738 var.
14739
14740 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
14741 var.
14742
14743 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
14744 Use str, not s, for char * var. Use ch, not c, for character var.
14745 Use size for size var.
14746
14747 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
14748 char * var.
14749 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
14750 uniqstr var.
14751 * src/uniqstr.h: Likewise.
14752
14753 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14754 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14755 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
14756 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
14757 param to have same name as that of enum, so that we don't use
14758 "s" to stand for a non-state.
14759
68e93ad5
AD
147602003-02-02 Akim Demaille <akim@epita.fr>
14761
14762 * src/scan-skel.l: Scan more than one inert character per yylex
14763 invocation.
14764
92898986
PE
147652003-02-01 Paul Eggert <eggert@twinsun.com>
14766
14767 Version 1.875a.
14768
1d9d5d71
PE
14769 * po/LINGUAS: Add ms.
14770
0435d061
AD
147712003-01-30 Akim Demaille <akim@epita.fr>
14772
14773 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
14774
6029a57f
PH
147752003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14776
14777 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
14778 of $1.
0435d061
AD
14779
14780 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 14781 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 14782 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 14783
6029a57f
PH
14784 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
14785 (b4_rhs_location): Ditto.
0435d061 14786 (yyfill): New function to copy from stack tree into array
6029a57f 14787 incrementally.
0435d061
AD
14788 (yyuserAction): Modify to allow incremental move of semantic values
14789 to rhs array when in GLR mode.
14790 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
14791 as needed.
14792 Remove dummy use of yystack, as there is now a guaranteed use.
14793 (yydoAction): Modify to allow incremental move of semantic values
14794 to rhs array when in GLR mode.
14795 (yyresolveAction): Ditto.
14796 (yyglrShiftDefer): Update comment.
0435d061 14797 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
14798 (yyglrReduce): Ditto.
14799 (yydoAction): Ditto
0435d061 14800
6029a57f
PH
14801 * tests/glr-regr1.at: Rename to ...
14802 * tests/glr-regression.at: Add new regression test for the problems
14803 described above (adapted from S. Eken).
14804 Update copyright notice.
14805 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
14806 * tests/Makefile.am: Ditto.
14807
6cee6297
PE
148082003-01-28 Paul Eggert <eggert@twinsun.com>
14809
14810 * data/lalr1.cc: Do not use @output_header_name@ unless
14811 b4_defines_flag is set. This fixes two bugs reported by
14812 Tim Van Holder in
161a71f3
PE
14813 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
14814 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 14815
b2a836b5
PE
148162003-01-21 Paul Eggert <eggert@twinsun.com>
14817
14818 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
14819 we don't need to worry about yyerrlab1 being reported as an
14820 "unused label" by non-GCC C compilers. The downside is that if
14821 locations are used then a couple of statements are duplicated each
14822 time YYERROR is invoked, but the upside is that the warnings
14823 should vanish.
14824 (yyerrlab1): Move code to YERROR.
14825 (yyerrlab2): Remove. Change uses back to yyerrlab1.
14826 This reverts some of the 2002-12-27 change.
14827
4196b931
PE
148282003-01-17 Paul Eggert <eggert@twinsun.com>
14829
14830 * src/output.c (symbol_printers_output): Fix typo that led
14831 to core dump. Problem reported by Antonio Rus in
161a71f3 14832 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 14833
3ae831b4
AD
148342003-01-13 Akim Demaille <akim@epita.fr>,
14835 Quoc Peyrot <chojin@lrde.epita.fr>,
14836 Robert Anisko <anisko_r@lrde.epita.fr>
14837
14838 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
14839 when the stacks contain one element, as the loop would otherwise
14840 free the last state, and then use the top state (the one we just
14841 popped). This means that the initial elements will not be freed
14842 explicitly, as is the case in yacc.c; it is not a problem, as
14843 these elements have fake values.
14844
e3aa65c5
PE
148452003-01-11 Paul Eggert <eggert@twinsun.com>
14846
14847 * NEWS: %expect-violations are now just warnings, reverting
14848 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
14849 bootstrapping problem reported by Matthias Klose; see
161a71f3 14850 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
14851 * src/conflicts.c (conflicts_print): Likewise.
14852 * tests/conflicts.at (%expect not enough, %expect too much,
14853 %expect with reduce conflicts): Likewise.
14854 * doc/bison.texinfo (Expect Decl): Document this. Also mention
14855 that the warning is enabled if the number of conflicts changes
14856 (not necessarily increases).
14857
14858 * src/getargs.c (version): Update copyright year.
14859
f0057011
AD
148602003-01-09 Akim Demaille <akim@epita.fr>
14861
14862 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
14863
1ee6d2a0
PE
148642003-01-08 Paul Eggert <eggert@twinsun.com>
14865
14866 * Makefile.maint (WGETFLAGS):
14867 New macro, containing "-C off" to disable proxy caches.
14868 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
14869 (rel-check): Use $(WGET) instead of wget.
14870
d4fd77c4
PE
148712003-01-06 Paul Eggert <eggert@twinsun.com>
14872
14873 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
14874 the GLR paper of Scott, Johnstone and Hussain.
14875
464c6927
PE
148762003-01-04 Paul Eggert <eggert@twinsun.com>
14877
d600ee67
PE
14878 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
14879 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
14880 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
14881 (EXTRA_LIBRARIES): New var, for liby.a.
14882 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
14883 (EXTRA_SCRIPTS): New var, for yacc.
14884
464c6927
PE
14885 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
14886 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
14887 Problem reported by Nelson H. F. Beebe.
14888
148892003-01-03 Paul Eggert <eggert@twinsun.com>
14890
14891 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
14892 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
14893 when compiling Bison 1.875's `bitset bset = obstack_alloc
14894 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
14895
14896 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
14897 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
14898 grow to a huge size with typical invocation.
d600ee67 14899
464c6927
PE
14900 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
14901 Use the pattern recommended by Autoconf 2.57, except also protect
14902 against double-definition.
14903 * src/system.h: Likewise.
14904 Portability issues reported by Nelson H. F. Beebe.
d600ee67 14905
464c6927
PE
14906 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
14907 All uses changed. Provide a definition in both C and C++.
14908 (yytrue, yyfalse): Define even if defined (__cplusplus).
14909
14910 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
14911 Reported by Nelson H. F. Beebe.
d600ee67 14912
464c6927
PE
14913 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
14914
0f42c7d5
PE
149152003-01-02 Paul Eggert <eggert@twinsun.com>
14916
14917 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
14918 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
14919 Bug reported by Nelson H. F. Beebe.
14920
dc546b0f
PE
149212003-01-01 Paul Eggert <eggert@twinsun.com>
14922
14923 * Version 1.875.
14924
2c09b6a7
PE
149252002-12-30 Paul Eggert <eggert@twinsun.com>
14926
14927 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
14928 Moved here from...
14929 (<INITIAL>","): Here. This causes stray "," to be treated
14930 more uniformly.
14931
dc546b0f 14932 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
14933 last brace in braced code when not in Yacc mode, for compatibility
14934 with Bison 1.35. This resurrects the 2001-12-15 patch to
14935 src/reader.c.
14936
14937 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
14938 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
14939
535c0f63
PE
149402002-12-28 Paul Eggert <eggert@twinsun.com>
14941
14942 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
14943 that of SYM's type. This fixes Debian bug 168069, reported by
14944 Thomas Olsson.
d600ee67 14945
963fcc17
PE
149462002-12-28 Paul Eggert <eggert@twinsun.com>
14947
14948 Version 1.75f.
14949
14950 Switch back to the Yacc style of conflict reports, undoing some
14951 of the 2002-07-30 change.
14952 * doc/bison.texinfo (Understanding): Use Yacc style for
14953 conflict reports. Also, use new way of locating rules.
14954 * src/conflicts.c (conflict_report):
14955 Renamed from conflict_report_yacc, removing the old
14956 'conflict_report'. Translate the entire conflict report at once,
14957 so that we don't assume that "," has the same interpretation in
14958 all languages.
14959 (conflicts_output): Use Yacc-style conflict report for each state,
14960 instead of our more-complicated style.
14961 (conflicts_print): Use Yacc-style conflict report, except print
14962 the input file name when not emulating Yacc.
14963 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
14964 Conflicted Reduction, %expect not enough, %expect too much,
14965 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
14966 * tests/existing.at (GNU Cim Grammar): Likewise.
14967 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
14968
14969 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
14970 fatal): Don't invoke fflush; it's not needed and it might even be
14971 harmful for stdout, as stdout might not be open.
14972 * src/reduce.c (reduce_print): Likewise.
14973
b1efe548
PE
149742002-12-27 Paul Eggert <eggert@twinsun.com>
14975
14976 Fix a bug where error locations were not being recorded correctly.
14977 This problem was originally reported by Paul Hilfinger in
161a71f3 14978 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
14979
14980 * data/yacc.c (yyparse): New local var yylerrsp, to record the
14981 top of the location stack's error locations.
14982 (yyerrlab): Set it. When discarding a token, push its location
14983 onto yylerrsp so that we don't lose track of the error's end.
14984 (yyerrlab1): Now is only the target of YYERROR, so that we can
14985 properly record the location of the action that failed. For GCC
14986 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
14987 GCC warning about yyerrlab1 being unused if YYERROR is unused.
14988 (yyerrlab2): New label, which yyerrlab now falls through to.
14989 Compute the error's location by applying YYLLOC_DEFAULT to
14990 the locations of all the symbols that went into the error.
14991 * doc/bison.texinfo (Location Default Action): Mention that
14992 YYLLOC_DEFAULT is also invoked for syntax errors.
14993 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14994 Error locations include the locations of all the tokens that were
14995 discarded, not just the last token.
d600ee67 14996
983c5c2c
PE
149972002-12-26 Paul Eggert <eggert@twinsun.com>
14998
b1efe548
PE
14999 * src/files.c: Include quote.h.
15000 (compute_output_file_names): Warn if we detect conflicting
15001 outputs to the same file. This should catch the misunderstanding
15002 exemplified by Debian Bug 165349, reported by Bruce Stephens..
15003
15004 * src/conflicts.c (conflicts_print): If the user specifies
15005 "%expect N", report an error if there are any reduce/reduce
15006 conflicts. This is what the manual says should happen.
15007 This fixes Debian bug 130890, reported by Anthony DeRobertis.
15008 * tests/conflicts.at (%expect with reduce conflicts): New test.
15009
983c5c2c
PE
15010 Don't use m4_include on relative file names, as it doesn't work as
15011 desired if there happens to be a file with that name under ".".
d600ee67 15012
983c5c2c
PE
15013 * m4sugar/version.m4: Remove; it was included but it wasn't used.
15014 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
15015 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
15016 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
15017 * src/output.c (output_skeleton): Use full path names when
15018 specifying a file to include; don't rely on include path, as
15019 it's unreliable when the working file contains a file with
15020 that name.
d600ee67 15021
983c5c2c
PE
150222002-12-25 Paul Eggert <eggert@twinsun.com>
15023
15024 Remove obsolete references to bison.simple and bison.hairy.
15025 Problem mentioned by Aubin Mahe in
161a71f3 15026 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
15027 * data/glr.c: Comment fix.
15028 * doc/bison.1: Remove references. Also, mention "yacc".
15029
15030 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
15031 with -g option.
15032
15033 * src/parse-gram.y (declaration): Use enum "report_states" rather
15034 than its numeric value 1.
15035
15036 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
15037 opening a new one. This fixes Debian bug 165349, reported by
15038 Bruce Stephens.
15039
23f2d9dc
PE
150402002-12-24 Paul Eggert <eggert@twinsun.com>
15041
15042 Version 1.75e.
15043
15044 * Makefile.maint (cvs-update): Don't assume that the shell
15045 supports $(...), as Solaris sh doesn't.
15046
15047 * src/parse-gram.y (lloc_default): Remove test for empty
15048 nonterminals at the end, since it didn't change the result.
15049
150502002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
15051
15052 If the user does not define YYSTYPE as a macro, Bison now declares it
15053 using typedef instead of defining it as a macro. POSIX requires this.
15054 For consistency, YYLTYPE is also declared instead of defined.
15055
15056 %union directives can now have a tag before the `{', e.g., the
15057 directive `%union foo {...}' now generates the C code
15058 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
15059 The default union tag is `YYSTYPE', for compatibility with Solaris 9
15060 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
15061 instead of `yyltype'.
15062
15063 `yystype' and `yyltype' are now obsolescent macros instead of being
15064 typedefs or tags; they are no longer documented and will be
15065 withdrawn in a future release.
15066
15067 * data/glr.c (b4_location_type): Remove.
15068 (YYSTYPE): Renamed from yystype.
15069 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
15070 (struct YYLTYPE): Renamed from struct yyltype.
15071 (YYLTYPE): Renamed from yyltype.
15072 (yyltype, yystype): New (and obsolescent) macros,
15073 for backward compatibility.
15074 * data/yacc.c: Likewise.
15075
15076 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
15077 does not specify a union tag. This is for compatibility with
15078 Solaris 9 yacc.
15079
15080 * src/parse-gram.y (add_param): 2nd arg is now char * not char
15081 const *, since it is now modified by stripping surrounding { }.
15082 (current_braced_code): Remove.
15083 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
15084 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
15085 trailing " {...}". Now of type <chars>.
15086 (grammar_declaration): Adjust to bundled tokens.
15087 (code_content): Remove; stripping is now done by add_param.
15088 (print_token_value): Print contents of bundled tokens.
15089 (token_name): New function.
15090
15091 * src/reader.h (braced_code, current_braced_code): Remove.
15092 (token_name): New decl.
15093
15094 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
15095 token_type, not braced_code code_kind. All uses changed.
15096 (SC_PRE_CODE): New state, for scanning after a keyword that
15097 has (or usually has) an immediately-following braced code.
15098 (token_type): New local var, to keep track of which token type
15099 to return when scanning braced code.
15100 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 15101 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
15102 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
15103 instead of returning a token type immediately.
15104 (<INITIAL>"{"): Set token type.
15105 (<SC_BRACED_CODE>"}"): Use it.
15106 (handle_action_dollar, handle_action_at): Now returns bool
15107 indicating success. Fail if ! current_rule; this prevents a core dump.
15108 (handle_symbol_code_dollar, handle_symbol_code_at):
15109 Remove; merge body into caller.
15110 (handle_dollar, handle_at): Complain in invalid contexts.
15111
15112 * NEWS, doc/bison.texinfo: Document the above.
15113 * NEWS: Fix years and program names in copyright notice.
15114
879ca4f8
PE
151152002-12-17 Paul Eggert <eggert@twinsun.com>
15116
15117 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
15118 Reporting, Table of Symbols): Omit mentions of %lex-param and
15119 %parse-param from the documentation for now.
15120
1c5fe69d
PE
151212002-12-15 Paul Eggert <eggert@twinsun.com>
15122
15123 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
15124 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
15125 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
15126 disagreed with the Bison documentation. Bug
15127 reported by Andrew Walrond.
d600ee67 15128
1c5fe69d
PE
15129 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
15130 as the caller now does that.
15131 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
15132 (YYEMPTY): Parenthesize right hand side, since others use it.
15133 (yyparse): Don't assume that our generated code is the only code
15134 that sets yychar.
15135
d1de5372
PE
151362002-12-13 Paul Eggert <eggert@twinsun.com>
15137
15138 Version 1.75d.
15139
15140 POSIX requires a "yacc" command.
15141 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
15142 (MOSTLYCLEANFILES): Add yacc.
15143 (yacc): New rule.
1c5fe69d 15144 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
15145 as an alias for bison y.
15146
15147 * po/LINGUAS: Add da.
d600ee67 15148
d1de5372
PE
15149 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
15150 problem with latest <getopt.h>.
15151 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
15152
15153 * doc/fdl.texi: Upgrade to 1.2.
15154 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
15155 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
15156 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
15157 gnulib.
15158 * config/install-sh: Sync with autotools.
15159
15160 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 15161 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
15162 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
15163 locations are requested.
15164 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
15165 locations are requested.
15166
d0f3fe23
PE
151672002-12-12 Paul Eggert <eggert@twinsun.com>
15168
15169 Remove unportable casts and storage allocation tricks.
15170 While we're at it, remove almost all casts, since they
15171 usually aren't needed and are a sign of trouble.
15172
15173 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
15174
15175 * src/derives.c (derives_compute): Do not subtract NTOKENS from
15176 the pointer DSET returned by malloc; this isn't portable.
15177 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
15178 Similarly for DERIVES.
15179 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
15180 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
15181 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
15182
15183 * src/derives.c (derives_compute): Do not bother invoking
15184 int_of_rule_number, since rule numbers are integers.
15185
15186 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
15187 rather than XMALLOC (char, N).
15188
15189 * src/files.c (filename_split): Rewrite to avoid cast.
15190
15191 * src/gram.h (symbol_number_as_item_number,
15192 item_number_as_symbol_number, rule_number_as_item_number,
15193 item_number_as_rule_number):
15194 Now inline functions rather than macros, to avoid casts.
15195 * src/state.h (state_number_as_int): Likewise.
15196 * src/tables.c (state_number_to_vector_number,
15197 symbol_number_to_vector_number): Likewise.
15198
15199 * src/gram.h (int_of_rule_number): Remove; no longer used.
15200
15201 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
15202 since the resulting storage is always stored into.
15203
15204 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
15205 where it's needed.
15206
15207 * src/muscle_tab.c (muscle_m4_output):
15208 Now inline. Return bool, not int.
15209 * src/state.c (state_compare): Likewise.
15210 * src/symtab.c (symbol_check_defined,
15211 symbol_check_alias_consistency, symbol_pack, symbol_translation,
15212 hash_compare_symbol, hash_symbol):
15213 Likewise.
15214 * src/uniqstr.c (uniqstr_print): Likewise.
15215 * src/muscle_tab.c (muscle_m4_output_processor):
15216 New function, to avoid casts.
15217 * src/state.c (state_comparator, stage_hasher): Likewise.
15218 * src/symtab.c (symbol_check_defined_processor,
15219 symbol_check_alias_consistency_processor, symbol_pack_processor,
15220 symbol_translation_processor, hash_symbol_comparator,
15221 hash_symbol_hasher): Likewise.
15222 * src/uniqstr.c (uniqstr_print_processor): Likewise.
15223 * src/muscle_tab.c (muscles_m4_output):
15224 Use new functions instead of casting old functions unportably.
15225 * src/state.c (state_hash_new): Likewise.
15226 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
15227 symbols_token_translations_init):
15228 Likewise.
15229 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
15230
15231 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
15232 var instead of casting to long, to avoid casts.
15233 (prepare_states): Use MALLOC rather than alloca, so that we don't
15234 have to worry about alloca.
15235 * src/state.c (state_hash_lookup): Likewise.
15236
15237 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
15238 local var instead of casting to unsigned char, to avoid casts.
15239
15240 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
15241 STATE_ALLOC): Remove.
15242 (transitions_new, errs_new, reductions_new, state_new): Use malloc
15243 rather than calloc, and use offsetof to avoid allocating slightly
15244 too much storage.
15245 (state_new): Initialize all members.
15246
15247 * src/state.c (state_hash): Use unsigned accumulator, not signed.
15248
15249 * src/symtab.c (symbol_free): Remove; unused.
15250 (symbol_get): Remove cast in lhs of assignment.
15251 (symbols_do): Now static. Accept generic arguments, not
15252 hashing-related ones.
15253
15254 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
15255 (symbol_processor): Remove.
15256 (symbols_do): Remove decl; now static.
15257
15258 * src/system.h (alloca): Remove; decl no longer needed.
15259 (<stddef.h>): Include, for offsetof.
15260 (<inttypes.>, <stdint.h>): Include if available.
15261 (uintptr_t): New type, if system lacks it.
15262 (CALLOC, MALLOC, REALLOC): New macros.
15263 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
15264 new macros.
15265
15266 * src/tables.c (table_size): Now int, to pacify GCC.
15267 (table_grow, table_ninf_remap): Use signed table size.
15268 (save_row): Don't bother initializing locals when not needed.
15269 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
15270 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
15271
15272 * src/vcg.h: Correct misspellings.
15273
15274 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
15275
15276
15277 * src/getargs.c (getargs): Don't assume EOF == -1.
15278
26b4a969
PE
152792002-12-09 Paul Eggert <eggert@twinsun.com>
15280
15281 Change identifier spellings to avoid collisions with names
15282 that are reserved by POSIX.
15283
15284 Don't use names ending in _t, since POSIX reserves them.
15285 For consistency, remove _e and _s endings -- they're weren't
15286 needed to remove ambiguity. All uses changed.
15287 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
15288 turn was just renamed from struniq_t.
15289 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
15290 which in turn was just renamed from struniq_processor_t.
15291 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
15292 in turn was renamed from hash_compare_struniq_t.
15293 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
15294 (state_list): Renamed from state_list_t.
15295 * src/assoc.h (assoc): Renamed from assoc_t.
15296 * src/conflicts.c (enum conflict_resolution): Renamed from
15297 enum conflict_resolution_e.
15298 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
15299 (rule_list): Renamed from rule_list_t.
15300 * src/getargs.h (enum trace): Renamed from enum trace_e.
15301 (enum report): Renamed from enum report_e.
15302 * src/gram.h (item_number): Renamed from item_number_t.
15303 (rule_number): Renamed from rule_number_t.
15304 (struct rule_s): Remove the "rule_s" part; not used.
15305 (rule): Renamed from rule_t.
15306 (rule_filter): Renamed from rule_filter_t.
15307 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
15308 (goto_list): Renamed from goto_list_t.
15309 * src/lalr.h (goto_number): Renamed from goto_number_t.
15310 * src/location.h (location): Renamed from location_t.
15311 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
15312 and moved here from:
15313 * src/muscle_tab.h (muscle_entry_t): here.
15314 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
15315 (rule_list): Renamed from rule_list_t.
15316 * src/print_graph.c (static_graph): Renamed from graph.
15317 * src/reader.h (braced_code): Renamed from braced_code_t.
15318 Remove brace_code_e tag.
15319 * src/relation.h (relation_node): Renamed from relation_node_t.
15320 (relation_nodes): Renamed from relation_nodes_t.
15321 (relation): Renamed from relation_t.
15322 * src/state.h (state_number): Renamed from state_number_t.
15323 (struct state): Renamed from struct state_s.
15324 (state): Renamed from state_t.
15325 (transitions): Renamed from transitions_t. Unused (and
15326 misspelled) transtion_s tag removed.
15327 (errs): Renamed from errs_t. Unused errs_s tag removed.
15328 (reductions): Renamed from reductions_t. Unused tag
15329 reductions_s removed.
15330 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
15331 (struct symbol_list): Renamed from struct symbol_list_s.
15332 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
15333 (struct symbol): Renamed from struct symbol_s.
15334 (symbol): Renamed from symbol_t.
15335 * src/tables.c (vector_number): Renamed from vector_number_t.
15336 (action_number): Renamed from action_t.
15337 * src/tables.h (base_number): Renamed from base_t.
15338 * src/vcg.h (enum color): Renamed from enum color_e.
15339 (enum textmode): Renamed from enum textmode_e.
15340 (enum shape): Renamed from enum shape_e.
15341 (struct colorentry): Renamed from struct colorentry_s.
15342 (struct classname): Renamed from struct classname_s.
15343 (struct infoname): Renamed from struct infoname_s.
15344 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
15345 (enum decision): Renamed from enum decision_e.
15346 (enum orientation): Renamed from enum orientation_e.
15347 (enum alignment): Renamed from enum alignment_e.
15348 (enum arrow_mode): Renamed from enum arrow_mode_e.
15349 (enum crossing_type): Renamed from enum crossing_type_e.
15350 (enum view): Renamed from enum view_e.
15351 (struct node): Renamed from struct node_s.
15352 (node): Renamed from node_t.
15353 (enum linestyle): Renamed from enum linestyle_e.
15354 (enum arrowstyle): Renamed from enum arrowstyle_e.
15355 (struct edge): Renamed from struct edge.
15356 (edge): Renamed from edge_t.
15357 (struct graph): Renamed from struct graph_s.
15358 (graph): Renamed from graph_t.
15359 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
15360 Rename value_t -> value.
15361 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
15362 value_t_as_yystype -> value_as_yystype.
15363
15364 Don't include <errno.h> in the mainstream code, since it
15365 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
15366 * lib/get-errno.c, lib/get-errno.h: New files.
15367 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
15368 get-errno.c.
15369 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
15370 * src/output.c (output_skeleton): Likewise.
15371 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
15372 instead of errno.
15373 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
15374 Likewise.
15375 (handle_action_dollar, handle_action_at): Likewise.
15376 * src/system.h: Do not include <errno.h>.
15377 (TAB_EXT): Renamed from EXT_TAB.
15378 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
15379
15380 Avoid str[a-z]*, since <string.h> reserves that name space.
15381 Change all instances of "struniq" in names to "uniqstr", and
15382 likewise for "STRUNIQ" and "UNIQSTR".
15383 * src/uniqstr.c: Renamed from src/struniq.c.
15384 * src/uniqstr.h: Renamed from src/struniq.h.
15385 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
15386 * src/files.c (strsuffix): Remove; unused.
15387 (concat2): Renamed from stringappend. Now static.
15388 * src/files.h (strsuffix, stringappend): Remove; unused.
15389 * src/parse-gram.y (<chars>): Renamed from <string>.
15390 (<uniqstr>): Renamed from <struniq>.
15391 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
15392 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
15393 (struct graph_s.expand): Renamed from struct graph_s.stretch.
15394 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
15395 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
15396 (N_EXPAND): Renamed from N_STRETCH.
15397
15398 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
15399 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
15400 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
15401 Remove; unused.
15402 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
15403 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
15404 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
15405 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
15406 (BASE_MAXIMUM): Renamed from BASE_MAX.
15407 (BASE_MINIMUM): Renamed from BASE_MIN.
15408 (ACTION_MAX): Remove; unused.
15409 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
15410 Unnecessary casts removed from above defines.
15411
15412
15413 Fix misspelling in names.
15414 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
15415 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
15416 G_NODE_ALIGNEMENT.
15417
15418
15419 * lib/timevar.c (timevar_report): Renamed from time_report,
15420 for consistency with other names.
15421 * lib/timevar.h (timevar_report): New decl.
15422 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
15423
15424
15425 Sort include-file uses.
15426
15427 Reorder all include files under src to be in the order "system.h".
15428 then the ../lib include files in angle brackets (alphabetized),
15429 then the . include files in double-quotes (alphabetized). Fix
15430 dependency breakages encountered in this process, as follows:
15431 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
15432 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
15433 * src/state.h: Include "symtab.h".
15434
996b1c7e
PE
154352002-12-08 Paul Eggert <eggert@twinsun.com>
15436
15437 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
15438 since this causes problems when __file__ contains character
15439 sequences like "@" that are treated specially by src/scan-skel.l.
15440 Instead, just use the file's basename. This fixes the bug
15441 reported by Martin Mokrejs in
161a71f3 15442 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 15443
e19c4e5d
PE
154442002-12-06 Paul Eggert <eggert@twinsun.com>
15445
15446 Add support for rules that do not have trailing semicolons, as
15447 POSIX requires. Improve the quality of locations in Bison
15448 diagnostics.
26b4a969 15449
e19c4e5d
PE
15450 * src/location.c: Include <quotearg.h>.
15451 (empty_location): Now const.
15452 (location_print): New function. Follow the recommendation of the
15453 GNU Coding Standards for locations that span file boundaries.
15454 * src/location.h: Do not include <quotearg.h>; no longer needed.
15455 (boundary): New type.
15456 (location_t): Use it. This allows locations to span file boundaries.
15457 All member uses changed: file -> start.file or end.file (as needed),
15458 first_line -> start.line, first_column -> start.column,
15459 last_line -> end.line, last_column -> end.column.
15460 (equal_boundaries): New function.
15461 (LOCATION_RESET, LOCATION_STEP): Remove.
15462 (LOCATION_PRINT): Remove. All callers changed to use location_print.
15463 (empty_location): Now const.
15464 (location_print): New decl.
15465 * src/parse-gram.y (lloc_default): New function, which handles
15466 empty locations more accurately.
15467 (YYLLOC_DEFAULT): Use it.
15468 (%token COLON): Remove.
15469 (%token ID_COLON): New token.
26b4a969 15470 (rules): Use it.
e19c4e5d
PE
15471 (declarations, rules): Remove trailing semicolon.
15472 (declaration, rules_or_grammar_declaration):
15473 Allow empty (";") declaration.
15474 (symbol_def): Remove empty actions; no longer needed.
15475 (rules_or_grammar_declaration): Remove trailing semicolon.
15476 (semi_colon.opt): Remove.
15477 * src/reader.h: Include location.h.
15478 (scanner_cursor): New decl.
15479 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
15480 rolling our own.
15481 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
15482 of *loc.
15483 (STEP): Remove. No longer needed, now that adjust_location does
15484 the work. All uses removed.
15485 (scanner_cursor): New var.
15486 (adjust_location): Renamed from extend_location. It now sets
15487 *loc and adjusts the scanner cursor. All uses changed.
15488 Don't bother testing for CR.
15489 (handle_syncline): Remove location arg; now updates scanner cursor.
15490 All callers changed.
15491 (unexpected_end_of_file): Now accepts start boundary of token or
15492 comment, not location. All callers changed. Update scanner cursor,
15493 not the location.
15494 (SC_AFTER_IDENTIFIER): New state.
15495 (context_state): Renamed from c_context. All uses changed.
15496 (id_loc, code_start, token_start): New local vars.
15497 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
15498 processing of Yacc white space and equivalents here.
15499 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
15500 instead of returning ID immediately, since we need to search for
15501 a subsequent colon.
15502 (<INITIAL>"'", "\""): Save token_start.
15503 (<INITIAL>"%{", "{", "%%"): Save code_start.
15504 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
15505 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
15506 BEGIN context_state at end, not INITIAL.
15507 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
15508 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
15509 Return correct token start.
15510 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
15511 the start of a character, string or multiline comment is found.
15512 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
15513 Reduction): Adjust reported locations to match the more-precise
15514 results now expected.
15515 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
15516 * tests/reduce.at (Useless Rules, Reduced Automaton,
15517 Underivable Rules): Likewise.
15518 * tests/regression.at (Invalid inputs): No longer `expecting ";"
15519 or "|"' now that so many other tokens are allowed by the new grammar.
15520
15521 * src/complain.h (current_file): Remove duplicate decl;
15522 current_file is now owned by files.h.
15523 * src/complain.c, src/scan-gram.l: Include files.h.
15524
155252002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 15526
e19c4e5d
PE
15527 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
15528 promotes to int; it might be unsigned int.
15529 * data/yacc.c (yy_reduce_print): Likewise.
15530
15531 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
15532 be #defined in the prologue, not in the Bison declarations.
15533 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 15534
b64755e3
PE
155352002-12-02 Paul Eggert <eggert@twinsun.com>
15536
15537 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
15538 * lib/strtoul.c: New file, from gnulib.
15539 This fixes a porting bug reported by Peter Klein in
161a71f3 15540 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 15541
6e746484
PE
155422002-11-30 Paul Eggert <eggert@twinsun.com>
15543
b64755e3
PE
15544 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
15545 and put only a forward declaration in the prologue. This is for
15546 consistency with the other scanner helper functions.
15547
6ba55592
PE
15548 Type clashes now generate warnings, not errors, since it
15549 appears that POSIX may allow some grammars with type clashes.
15550 * src/reader.c (grammar_current_rule_check): Warn about
15551 type clashes instead of complaining.
15552 * tests/input.at (Type Clashes): Expect warnings, not complaints.
15553
6e746484
PE
15554 Add Yacc library, since POSIX requires it.
15555 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
15556 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
15557 * lib/main.c, lib/yyerror.c: New files.
15558
15559 gram_error can be static; it need not be extern.
15560 * src/reader.h (gram_error): Remove decl.
15561 * src/parse-gram.y (gram_error): Now static. Add static decl.
15562 (print_token_value): Omit parameter names from forward decl,
15563 for consistency.
15564
88510f9c
PE
155652002-11-29 Paul Eggert <eggert@twinsun.com>
15566
6e746484
PE
15567 * doc/bison.texinfo: Emphasize that yylex and yyerror must
15568 be declared before being used. E.g., one should typically
15569 declare them in the prologue. Use GNU coding style in examples.
15570 Put "const" consistently after the type it modifies. Mention
15571 that C99 supports "inline". Mention that yyerror traditionally
15572 returns "int".
15573
88510f9c
PE
15574 %parse-param and %lex-param now take just one argument, the
15575 declaration; the argument name is deduced from the declaration.
15576
15577 * doc/bison.texinfo (Parser Function, Pure Calling, Error
15578 Reporting, Table of Symbols): Document this.
15579 * src/parse-gram.y (add_param): New function.
15580 (COMMA): Remove.
15581 (declaration): Implement new rule for %parse-param and %lex-param.
15582 * src/scan-gram.l: "," now elicits a warning, rather than being
15583 a token; this is more compatible with byacc.
15584 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
15585
bb92250c
PE
155862002-11-27 Paul Eggert <eggert@twinsun.com>
15587
15588 Rename identifiers to avoid real and potential collisions.
15589
15590 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
15591 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 15592 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
15593 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
15594 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
15595 * src/parse-gram.y (print_token_value): Renamed from yyprint.
15596 All uses changed.
15597 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
15598 The name "yycontrol" violates the name space rules, and this stuff
15599 wasn't being used anyway.
15600 (input): Remove action; this stuff wasn't being used.
15601 (gram_error): Rename local variable yylloc -> loc.
15602 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
15603 (YY_DECL): Don't use "yy" at start of local variables.
15604 All uses changed, e.g., yylloc -> loc.
15605 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
15606 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
15607 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
15608 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
15609
15610 * src/parse-gram.y (gram_error): loc is now const *.
15611 * src/reader.h (gram_error): Likewise.
15612
3af4feb2
PE
156132002-11-24 Paul Eggert <eggert@twinsun.com>
15614
15615 Version 1.75c.
15616
15617 * tests/actions.at (Actions after errors): Use an output format
15618 more similar to that of the Printers and Destructors test.
15619 Test the position of the ';' token too.
15620 (Printers and Destructors): Likewise.
15621 (Printers and Destructors: %glr-parser): Remove for now, to avoid
15622 unnecessarily alarming people when the test fails.
15623
15624 * data/yacc.c (yyerrlab1): Move this label down, so that the
15625 parser does not discard the lookahead token if the user code
15626 invokes YYERROR. This change is required for POSIX conformance.
15627
15628 * lib/error.c: Sync with gnulib.
15629
156302002-11-22 Paul Eggert <eggert@twinsun.com>
15631
15632 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
15633 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
15634 * lib/xmalloc.c: Likewise.
26b4a969 15635
58004308
PE
156362002-11-20 Paul Eggert <eggert@twinsun.com>
15637
15638 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
15639
156402002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 15641
58004308
PE
15642 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
15643 should use `if (! x) abort ();' rather than `assert (x);', and
15644 anyway it's one less thing to worry about configuring.
15645
15646 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
15647 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
15648 and replace all instances of assert with abort.
15649 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
15650 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
15651
15652 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
15653 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
15654 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
15655 hash_find_entry, hash_rehash, hash_insert): Likewise.
15656 * src/conflicts.c (resolve_sr_conflict): Likewise.
15657 * src/lalr.c (set_goto_map, map_goto): Likewise.
15658 * src/nullable.c (nullable_compute): Likewise.
15659 * src/output.c (prepare_rules, token_definitions_output): Likewise.
15660 * src/reader.c (packgram, reader): Likewise.
15661 * src/state.c (state_new, state_free, state_transitions_set,
15662 state_reduction_find): Likewise.
15663 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
15664 symbol_pack): Likewise.
15665 * src/tables.c (conflict_row, pack_vector): Likewise.
15666 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15667 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15668 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
15669 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
15670
15671 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
15672 (ARGMATCH_CONSTRAINT): New macro.
15673 (ARGMATCH_ASSERT): Use it.
15674
15675 * src/system.h (verify): New macro.
15676 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
15677 rather than assert.
15678 * src/tables.c (tables_generate): Likewise.
15679
15680 * src/struniq.c (struniq_assert): Now returns void, and aborts
15681 if the assertion is false.
15682 (struniq_assert_p): Remove.
15683 * src/struniq.h: Likewise.
15684
76ae8198
PE
156852002-11-18 Paul Eggert <eggert@twinsun.com>
15686
15687 * data/glr.c (yygetLRActions): Replace `yyindex' with
15688 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
15689 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 15690 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 15691
d3c4e709
AD
156922002-11-18 Akim Demaille <akim@epita.fr>
15693
15694 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
15695 space.
15696 From Tim Van Holder.
15697
8d8a7238
PE
156982002-11-17 Paul Eggert <eggert@twinsun.com>
15699
15700 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
15701 to "SyntaxError" for consistency with my 2002-11-15 change.
15702
15703 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
15704 not define to {}, since this breaks the common use of `YYDPRINTF
15705 ((...));' if a single statement is desired (e.g. before `else').
15706 Work around GCC warnings by surrounding corresponding calls with
15707 {} if needed.
15708 (yyhasResolvedValue): Remove unused function.
15709 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
15710 loop body.
15711 (yyreportSyntaxError): Renamed from yyreportParseError.
15712 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
15713 All uses changed.
15714 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
15715 extern when possible. Remove unused initializations.
15716
b0937b22
AD
157172002-11-16 Akim Demaille <akim@epita.fr>
15718
15719 Augment the similarity between GLR and LALR traces.
15720
15721 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
15722 (YY_REDUCE_PRINT): New.
15723 (yyparse): Use them.
15724 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
15725 YYDPRINT here.
15726 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
15727 state reached after the reduction/recovery, since...
15728 (yyparse, yyprocessOneStack): Report the state we are entering in.
15729
c5e3e510
AD
157302002-11-16 Akim Demaille <akim@epita.fr>
15731
15732 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
15733 Add support for --trace=skeleton.
15734 * src/scan-skel.l: %option debug.
15735 Scan strings of non-@ or \n instead of character by character.
15736 (scan_skel): Handle trace_skeleton.
15737 (QPUTS): New.
15738 (@output_parser_name@, @output_header_name@): ``Restore'' their
15739 support (used to be M4 macros).
15740 * data/yacc.c: Quote larger chunks, a la glr.c.
15741 * data/lalr1.cc: Likewise.
15742 The header guards are no longer available, so use some other
15743 string than `YYLSP_NEEDED'.
15744
4c6cc1db
AD
157452002-11-16 Akim Demaille <akim@epita.fr>
15746
15747 Make the ``Printers and Destructors'' test more verbose, taking
15748 `yacc.c''s behavior as (possibly wrong) reference.
15749
15750 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
15751 instead of fprint on stdout.
15752 Set and report the last_line of the symbols.
15753 Consistently display values and locations.
15754
6d9e8019
PE
157552002-11-16 Paul Eggert <eggert@twinsun.com>
15756
15757 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
15758
6e649e65
PE
157592002-11-15 Paul Eggert <eggert@twinsun.com>
15760
b25d88f6
PE
15761 * tests/actions.at (Actions after errors): New test case.
15762
6e649e65
PE
15763 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
15764 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
15765 tests/action.at, tests/calc.at, tests/conflicts.at,
15766 tests/cxx-type.at, tests/regression.at:
15767 "parse error" -> "syntax error" for POSIX compatibility.
15768 "parsing stack overflow..." -> "parser stack overflow" so
15769 that code matches Bison documentation.
15770
0f39aab9
AD
157712002-11-15 Akim Demaille <akim@epita.fr>
15772
15773 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
15774 take two BRACED_CODE, not two string_content.
15775 Free the scanner's obstack when we are done.
15776 (code_content): New.
15777 * tests/calc.at: Adjust.
15778 * doc/bison.texinfo: Adjust.
15779 Also, make sure to include the `,' for these declarations.
15780
761c1926
AD
157812002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
15782
15783 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
15784 definition; avoids potential autoreconf problems.
15785
b0f98b10
AD
157862002-11-15 Akim Demaille <akim@epita.fr>
15787
15788 Always check the value returned by yyparse.
15789
15790 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
15791 returned by yyparse.
15792 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
15793 Adjust calls.
15794 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
15795 returned by yyparse.
15796
970785f1
PH
157972002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15798
15799 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
15800 on input.at test.
15801
8fcc7db1
PE
158022002-11-14 Paul Eggert <eggert@twinsun.com>
15803
7ec1b48e
PE
15804 * src/output.c (output_skeleton): Call xfopen instead of
15805 duplicating xfopen's body.
15806
cfff7583 15807 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 15808 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 15809
8fcc7db1
PE
15810 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
15811 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
15812 Group compiler. Instead, use "$CC -E bar.c". Include the .h
15813 file twice in the grammar, as an extra check.
15814
15815 * tests/input.at (Torturing the Scanner): Surround the
15816 backslash-newline tests with "#if 0", to make it less likely that
15817 we'll run into compiler bugs. Bring back solitary \ inside
15818 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 15819 test backslash-newline in C character constant.
8fcc7db1 15820
4e8d992c
AD
158212002-11-14 Akim Demaille <akim@epita.fr>
15822
15823 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
15824 status of the compiler.
f32b346d 15825 Calling `exit 1' is no longer needed.
4e8d992c
AD
15826 Reported by Nelson H. F. Beebe.
15827
9501dc6e
AD
158282002-11-14 Akim Demaille <akim@epita.fr>
15829
15830 * tests/atlocal.in (CPPFLAGS): We have config.h.
15831 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
15832 New.
15833 * tests/actions.at, tests/calc.at, tests/conflicts.at,
15834 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
15835 * tests/regression.at, tests/torture.at: Use them for all the
15836 grammars that are to be compiled.
15837 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
15838 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
15839 * doc/bison.texinfo (GLR Parsers): Document `inline'.
15840
18b519c0
AD
158412002-11-14 Akim Demaille <akim@epita.fr>
15842
15843 * doc/bison.texinfo: Various formatting changes (alignments in
15844 samples, additional @group/@end group, GCS in samples.
15845 Use @deffn instead of simple @table to define the directives,
15846 macros, variables etc.
15847
9a86cdb9
PE
158482002-11-13 Paul Eggert <eggert@twinsun.com>
15849
daa33def 15850 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 15851 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 15852
daa33def 15853 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 15854 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
15855 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
15856 * tests/headers.at (export YYLTYPE): Likewise.
15857
15858 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 15859 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 15860
9a86cdb9
PE
15861 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
15862 comments, since they're not portable. Use GNU coding style.
15863
9c1e26bd
AD
158642002-11-13 Akim Demaille <akim@epita.fr>
15865
15866 * data/yacc.c: Leave bigger chunks of quoted text.
15867 (YYDSYMPRINTF): New.
15868 Use it to report symbol activities.
15869 * data/glr.c (YYDSYMPRINTF): New.
15870 Use it.
15871
87f721cc
PE
158722002-11-12 Paul Eggert <eggert@twinsun.com>
15873
15874 Version 1.75b.
15875
15876 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
15877 (yyglrReduce): Return yyok, not 0.
15878 This should avoid the enumerated-type warnings reported
464c6927 15879 by Nelson H. F. Beebe in
161a71f3 15880 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
15881
15882 * lib/bbitset.h (BITSET_INLINE): Remove.
15883 * lib/bitset.h [! BITSET_INLINE]: Remove.
15884 (bitset_set, bitset_reset, bitset_test): Rename local vars
15885 to avoid shadowing warnings by GCC.
15886
15887 * data/glr.c (inline): Remove #define. It's the user's
15888 responsibility to #define it away, just like 'const'.
464c6927 15889 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 15890 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 15891
87f721cc
PE
15892 * Makefile.maint (po-check): Scan .l and .y files instead of the
15893 .c and the .h files that they generate. This fixes the bug
15894 reported by Tim Van Holder in:
161a71f3 15895 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
15896 Look for N_ as well as for _. Try to avoid matching #define for
15897 N_ and _.
15898 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
15899 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
15900 * src/scan-gram.l: Revamp regular expressions so that " and '
15901 do not confuse xgettext.
15902
15903 * src/struniq.h (struniq_new): Do not declare the return type
15904 to be 'const'; this violates the C standard.
15905 * src/struniq.c (struniq_new): Likewise.
15906
be14ade5
AD
159072002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
15908
15909 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
15910 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
15911 linker.
15912
05291fbc
AD
159132002-11-12 Akim Demaille <akim@epita.fr>
15914
15915 * Makefile.maint: Sync with Autoconf:
15916 (local_updates): New.
15917
1f5fd52e
AD
159182002-11-12 Akim Demaille <akim@epita.fr>
15919
15920 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
15921
283f1e64
AD
159222002-11-12 Akim Demaille <akim@epita.fr>
15923
15924 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
15925 locations.
15926
886b69d1
AD
159272002-11-12 Akim Demaille <akim@epita.fr>
15928
15929 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
15930 not yyvalue.
15931
3df37415
AD
159322002-11-12 Akim Demaille <akim@epita.fr>
15933
15934 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
15935 Use it to test the GLR parser.
15936
7bd6c77e
AD
159372002-11-12 Akim Demaille <akim@epita.fr>
15938
15939 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
15940 defines it.
15941 * data/glr.c (yystos): New.
15942 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
15943 (YYDSYMPRINT): New.
15944 (yyval): Don't define it, it is handled via M4.
15945 (yyrecoverParseError): Free verbosely the discarded symbols.
15946 * data/yacc.c (yysymprint): Remove, rather...
15947 (b4_yysymprint_generate): invoke.
15948 * data/c.m4 (b4_yysymprint_generate): New.
15949 Accept pointers as arguments, as opposed to the version from
15950 yacc.c.
15951 (b4_yydestruct_generate): Likewise.
15952 * tests/cations.at (Printers and Destructors): Use Bison directives
15953 instead of CPP macros.
15954 Don't rely on internal details.
15955
b0400cc6
AD
159562002-11-12 Akim Demaille <akim@epita.fr>
15957
15958 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
15959 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
15960 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
15961 it against YYEMPTY and so forth), work on yytoken (i.e., set
15962 it to YYEMPTY etc.).
15963 (yydestruct): Replace with a b4_yydestruct_generate invocation.
15964 (b4_symbol_actions): Remove.
15965 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
15966 for 0, end-of-input.
15967
72f889cc
AD
159682002-11-12 Akim Demaille <akim@epita.fr>
15969
15970 * doc/bison.texinfo (Destructor Decl): New.
15971
b1ae9233
AD
159722002-11-12 Akim Demaille <akim@epita.fr>
15973
15974 * src/tables.c (tables_generate): Use free for pointers that
15975 cannot be NULL, not XFREE.
15976 (pack_vector): Use assert, not fatal, for bound violations.
15977 * src/state.c (state_new): Likewise.
15978 * src/reader.c (reader): Likewise.
15979 * src/lalr.c (set_goto_map): Likewise.
72f889cc 15980 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
15981 the file name.
15982
7ec2d4cd
AD
159832002-11-12 Akim Demaille <akim@epita.fr>
15984
15985 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
15986 Restore.
15987 * src/scan-gram.l (last_string): Is global to the file, not to
15988 yylex.
15989 * src/parse-gram.y (input): Don't append the epilogue here,
15990 (epilogue.opt): do it here, and free the scanner's obstack.
15991 * src/reader.c (epilogue_set): Rename as...
15992 (epilogue_augment): this.
15993 * data/c.m4 (b4_epilogue): Defaults to empty.
15994
573a6cd3
AD
159952002-11-12 Akim Demaille <akim@epita.fr>
15996
15997 * src/getargs.c (long_options): Remove duplicates.
15998 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
15999 Remove.
16000 * doc/bison.rnh: Remove.
16001 * doc/bison.texinfo (VMS Invocation): Remove.
16002
95612cfa
AD
160032002-11-12 Akim Demaille <akim@epita.fr>
16004
16005 * src/struniq.h, src/struniq.c (struniq_t): Is const.
16006 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
16007
16008 Use struniq for symbols.
16009
16010 * src/symtab.h (symbol_t): The tag member is a struniq.
16011 (symbol_type_set): Adjust.
16012 * src/symtab.c (symbol_new): Takes a struniq.
16013 (symbol_free): Don't free the tag member.
16014 (hash_compare_symbol_t, hash_symbol_t): Rename as...
16015 (hash_compare_symbol, hash_symbol): these.
16016 Use the fact that tags as struniqs.
16017 (symbol_get): Use struniq_new.
16018 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
16019 Returns a strniq.
16020 * src/reader.h (merger_list, grammar_currentmerge_set): The name
16021 and type members are struniqs.
16022 * src/reader.c (get_merge_function)
16023 (grammar_current_rule_merge_set): Adjust.
16024 (TYPE, current_type): Are struniq.
16025
16026 Use struniq for file names.
16027
16028 * src/files.h, src/files.c (infile): Split into...
16029 (grammar_file, current_file): these.
16030 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
16031 * src/reduce.c (reduce_print): Likewise.
16032 * src/getargs.c (getargs): Likewise.
16033 * src/complain.h, src/complain.c: Likewise.
16034 * src/main.c (main): Call struniqs_new early enough to use it for
16035 file names.
16036 Don't free the input file name.
16037
3e6656f9
AD
160382002-11-12 Akim Demaille <akim@epita.fr>
16039
16040 * src/symtab.c (symbol_free): Remove dead deactivated code:
16041 type_name are properly removed.
16042 Don't use XFREE to free items that cannot be NULL.
16043 * src/struniq.h, src/struniq.c: New.
16044 * src/main.c (main): Initialize/free struniqs.
16045 * src/parse-gram.y (%union): Add astruniq member.
16046 (yyprint): Adjust.
16047 * src/scan-gram.l (<{tag}>): Return a struniq.
16048 Free the obstack bit that used to store it.
16049 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
16050
7672019c
PE
160512002-11-11 Paul Eggert <eggert@twinsun.com>
16052
16053 Revamp to fix many (but not all) of the C- and M4-related quoting
16054 problems. Among other things, this fixes the Bison bug reported
16055 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 16056 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
16057
16058 Use new @ escapes consistently. Represent brackets with @{ and @}
16059 rather than @<:@ and @:>@, since this works a bit better with dumb
16060 editors like vi. Represent @ with @@, since @ is now consistently
16061 an escape. Use @oline@ and @ofile@ rather than __oline__ and
16062 __ofile__, to avoid unexpected expansions. Similarly, use @output
16063 rather than #output.
16064
16065 * data/c.m4 (b4_copyright): Omit file name from comment, since
16066 the file name could contain "*/".
16067 (b4_synclines_flag): Don't quote the 2nd argument; it should already
16068 be quoted. All uses changed.
16069
16070 * data/glr.c: Use new @ escapes consistently.
16071 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
16072 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
16073 Remove, since they couldn't handle arbitrary characters in file
16074 names.
16075 * data/lalr1.cc: Likewise.
16076 * data/yacc.c: Likewise.
16077
16078 * src/files.c (output_infix): Remove; all uses removed.
16079 * src/files.h: Likewise.
16080
16081 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
16082 mishandled funny characters in file names, and anyway it isn't
16083 needed any more.
16084 * data/yacc.c: Likewise.
16085 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
16086
16087 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
16088 * data/yacc.c: Likewise.
16089
16090 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
16091 strings now.
16092 (muscle_init): Quote filename as a C string.
16093 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
16094 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
16095 * src/output.c (escaped_file_name_output): New function.
16096 (prepare_symbols): Quote tokens for M4.
16097 (prepare): Don't insert output_infix, output_prefix,
16098 output_parser_name, output_header_name; this is now down by scan-skel.
16099 Insert skeleton as a C string.
16100
16101 * src/output.c (user_actions_output, symbol_destructors_output,
16102 symbol_printers_output): Quote filenames for C and M4.
16103 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16104
16105 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
16106 escapes other than \\ and \'; this simplifies the code.
16107 (<SC_STRING>): Likewise, for \\ and \".
16108 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
16109 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
16110 Use new escapes @{ and @} for [ and ].
16111
16112 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
16113 them with auto vars.
16114 Switch to new escape scheme, where @ is the escape character uniformly.
16115 Abort if a stray escape character is found. Avoid unbounded input
16116 buffer when parsing non-escaped text.
16117
16118 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
16119 __oline__, #output, $@, and @{ do not have unintended meanings.
16120
acea4f3b
PE
161212002-11-09 Paul Eggert <eggert@twinsun.com>
16122
16123 Fix the test failure due to GCC warnings described in
161a71f3 16124 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
16125 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
16126 evaluate to 0 if it's impossible for NINF to be in the respective
16127 table.
16128 (yygetLRActions, yyrecoverParseError): Use them.
16129
16130 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
16131 counted in the token inserted at end of file. Now takes
16132 location_t *, not location_t, so that the location can be
16133 adjusted. All uses changed.
16134
16135 * tests/regression.at (Invalid inputs): Adjust wording in
16136 diagnostic to match the new behavior.
16137
16138 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
16139 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
16140 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
16141 abort ();'. This reduces the runtime of the "Many lookaheads"
16142 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
16143 GCC 3.2.
16144
20ef1ad5
PE
161452002-11-07 Paul Eggert <eggert@twinsun.com>
16146
16147 * src/parse-gram.y (CHARACTER): Remove unused token.
16148 All uses removed.
16149
16150 * src/scan-gram.l: Remove stack option. We no longer use the
16151 stack, since the stack was never deeper than 1; instead, use the
16152 new auto var c_context to record the stacked value.
16153
16154 Remove nounput option. At an unexpected end of file, we now unput
16155 the minimal input necessary to end cleanly; this simplifies the
16156 code.
16157
16158 Avoid unbounded token sizes where this is easy.
16159
16160 (unexpected_end_of_file): New function.
16161 Use it to systematize the error message on unexpected EOF.
16162 (last-string): Now auto, not static.
16163 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
16164 (scanner_last_string_free): Remove; not used.
16165 (percent_percent_count): Move decl to just before use.
16166 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
16167 not the (never otherwised-used) CHARACTER.
16168
93724f13
AD
161692002-11-07 Akim Demaille <akim@epita.fr>
16170
16171 Let yyerror always receive the msg as last argument, so that
16172 yyerror can be variadic.
16173
16174 * data/yacc.c (b4_yyerror_args): New.
16175 Use it when calling yyerror.
16176 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
16177 Use it when calling yyerror.
16178 * doc/bison.texinfo (Error Reporting): Adjust.
16179 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
16180 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
16181
6e40b4eb
AD
161822002-11-06 Akim Demaille <akim@epita.fr>
16183
16184 #line should have quoted strings.
16185 Ideally, this should be done by m4_quotearg.
16186
16187 * src/scan-skel.l: Include quotearg.h.
16188 Quote __ofile__.
16189 * src/output.c (symbol_printers_output)
16190 (symbol_destructors_output): Quote the file name.
16191
2dfbfc12
AD
161922002-11-06 Akim Demaille <akim@epita.fr>
16193
16194 * tests/regression.at (Invalid inputs): Adjust to the recent
16195 messages.
16196
437c2d80
AD
161972002-11-06 Akim Demaille <akim@epita.fr>
16198
16199 Restore --no-lines.
16200 Reported by Jim Kent.
16201
16202 * data/c.m4 (b4_syncline): New.
16203 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
16204 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
16205 * src/output.c (user_actions_output): Likewise.
16206 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 16207 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 16208
900c5db5
AD
162092002-11-06 Akim Demaille <akim@epita.fr>
16210
16211 * src/main.c (main): Free `infile'.
16212 * src/scan-gram.l (handle_syncline): New.
16213 Recognize `#line'.
16214 * src/output.c (user_actions_output, symbol_destructors_output)
16215 (symbol_printers_output): Use the location's file name, not
16216 infile.
16217 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16218
e183b123 162192002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 16220
e183b123 16221 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 16222 either has GLR conflict entries.
e183b123 16223
193eb6b7
PE
162242002-11-05 Paul Eggert <eggert@twinsun.com>
16225
e183b123
PE
16226 * src/scan-gram.l: Use more accurate diagnostics, e.g.
16227 "integer out of range" rather than "invalid value".
16228 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
16229 accordingly.
16230
193eb6b7
PE
16231 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
16232 Also, remove one static variable in the scanner.
16233
16234 * src/scan-gram.l (braces_level): Now auto, not static.
16235 Initialize to zero if the compiler is being picky.
16236 (INITIAL): Clear braces_level instead of incrementing it.
16237 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
16238 as POSIX 1003.1-2001 requires.
16239 * src/system.h (IF_LINT): New macro, taken from coreutils.
16240 * configure.ac: Define "lint" if --enable-gcc-warnings.
16241
29c01725
AD
162422002-11-05 Akim Demaille <akim@epita.fr>
16243
16244 * src/scan-gram.l: When it starts with `%', complain about the
16245 whole directive, not just that `invalid character: %'.
16246
8aeac3ca
AD
162472002-11-04 Akim Demaille <akim@epita.fr>
16248
16249 * Makefile.maint: Update from Autoconf.
16250 (update, cvs-update, po-update, do-po-update): New.
16251
793a58bb
AD
162522002-11-04 Akim Demaille <akim@epita.fr>
16253
16254 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
16255 and yyerror.
16256 Have yyerror `use' its arguments.
16257 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
16258 returns true when location & yacc & pure & parse-param.
16259 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
16260
c4d720cd
AD
162612002-11-04 Akim Demaille <akim@epita.fr>
16262
16263 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
16264 clashes.
16265 * src/scan-gram.l: Use [\'] instead of ['] to pacify
16266 font-lock-mode.
16267 Use complain_at.
16268 Use quote, not quote_n since LOCATION_PRINT no longer uses the
16269 slot 0.
16270
613a0dc5
PE
162712002-11-03 Paul Eggert <eggert@twinsun.com>
16272
16273 * src/reader.c (get_merge_function, grammar_current_rule_check):
16274 Use consistent diagnostics for reporting type name clashes.
16275 Quote the types with <>, for consistency with Yacc.
16276 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
16277
2a8d363a
AD
162782002-11-03 Akim Demaille <akim@epita.fr>
16279
16280 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
16281 New.
16282 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
16283 (b4_parse_param): Remove.
16284 Use b4_identification.
16285 Propagate b4_pure_args where needed to pass them to yyerror.
16286 * data/glr.m4 (b4_parse_param): Remove.
16287 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
16288 (b4_lpure_formals): New.
16289 Use b4_identification.
16290 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
16291 b4_user_formals and b4_user_args.
16292 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
16293 (yyreportAmbiguity): When using a pure parser, also need
16294 the location, and the parse-params.
16295 Adjust callers.
16296 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
16297 When using a pure parser, also need the parse-params.
16298 Adjust callers.
16299 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
16300 (%pure-parser + %parse-param) LALR and GLR parsers.
16301 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
16302 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
16303 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
16304 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
16305 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
16306 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
16307 * doc/bison.texinfo: Untabify the whole file.
16308 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
16309 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
16310 (Error Reporting): Adjust to these new directives.
16311 Document %error-verbose, deprecate YYERROR_VERBOSE.
16312
9e32add8
AD
163132002-11-03 Akim Demaille <akim@epita.fr>
16314
16315 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
16316 AT_CHECK_CALC_GLR invocations to use % directives, instead of
16317 command line options.
16318 * tests/cxx-type.at: Formatting changes.
16319
b02d90a5
PE
163202002-11-03 Paul Eggert <eggert@twinsun.com>
16321
16322 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
16323 to count columns correctly, and to check for invalid inputs.
9e32add8 16324
b02d90a5
PE
16325 Use mbsnwidth to count columns correctly. Account for tabs, too.
16326 Include mbswidth.h.
16327 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
16328 (extend_location): New function.
16329 (YY_LINES): Remove.
16330
16331 Handle CRLF in C code rather than in Lex code.
16332 (YY_INPUT): New macro.
16333 (no_cr_read): New function.
16334
16335 Scan UCNs, even though we don't fully handle them yet.
16336 (convert_ucn_to_byte): New function.
16337
16338 Handle backslash-newline correctly in C code.
16339 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
16340 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
16341 all uses changed.
16342 (tag, splice): New EREs. Do not allow NUL or newline in tags.
16343 Use {splice} wherever C allows backslash-newline.
16344 YY_STEP after space, newline, vertical-tab.
16345 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 16346
b02d90a5
PE
16347 (letter, id): Don't assume ASCII; e.g., spell out a-z.
16348
16349 ({int}, handle_action_dollar, handle_action_at): Check for integer
16350 overflow.
9e32add8 16351
b02d90a5
PE
16352 (YY_STEP): Omit trailing semicolon, so that it's more like C.
16353
16354 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
16355 as well as \000. Check for UCHAR_MAX, not 255.
16356 Allow \x with an arbitrary positive number of digits, as in C.
16357 Check for overflow here.
16358 Allow \? and UCNs, for compatibility with C.
16359
16360 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
16361 with quote slot used by complain_at.
16362
16363 * tests/input.at: Add tests for backslash-newline, m4 quotes
16364 in symbols, long literals, and funny escapes in strings.
16365
16366 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
16367 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
16368 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
16369 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
16370 * m4/mbswidth.m4: New file, from GNU coreutils.
16371
16372 * doc/bison.texinfo (Grammar Outline): Document // comments.
16373 (Symbols): Document that trigraphs have no special meaning in Bison,
16374 nor is backslash-newline allowed.
16375 (Actions): Document that trigraphs have no special meaning.
16376
16377 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
16378 no longer used.
16379
163802002-11-02 Paul Eggert <eggert@twinsun.com>
16381
16382 * src/reader.c: Don't include quote.h; not needed.
16383 (get_merge_function): Reword warning to be consistent with
16384 type clash diagnostic in grammar_current_rule_check.
16385
16386 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
16387 bug in trigraph handling.
16388
16389 * src/output.c (prepare_symbols): When printing token names,
16390 escape "[" as "@<:@" and likewise for "]".
16391
16392 * src/system.h (errno): Remove declaration, as we are now
16393 assuming C89 or better, and C89 guarantees errno.
16394
762b212b
PE
163952002-10-30 Paul Eggert <eggert@twinsun.com>
16396
16397 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
16398 Check for close failures.
16399 * src/files.h (xfclose): Return void, not int, since it always
16400 returned zero.
16401 * src/files.c (xfclose): Likewise. Report I/O error if ferror
16402 indicates one.
16403 * src/output.c (output_skeleton): Use xfclose rather than fclose
16404 and ferror. xfclose now checks ferror.
16405
16406 * data/glr.c (YYLEFTMOST_STATE): Remove.
16407 (yyreportTree): Use a stack-based leftmost state. This avoids
16408 our continuing battles with bogus warnings about initializers.
16409
56100c60
AD
164102002-10-30 Akim Demaille <akim@epita.fr>
16411
16412 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
16413 #if.
16414
51b4a04c
PH
164152002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16416
16417 * tests/glr-regr1.at: New test for reported regressions.
16418 * tests/testsuite.at: Add glr-regr1.at test.
16419 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 16420
bf1ebda2
PE
164212002-10-24 Paul Eggert <eggert@twinsun.com>
16422
5c16c6b1
PE
16423 Version 1.75a.
16424
bf1ebda2
PE
16425 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
16426 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
16427 we use malloc. Don't assume 'A' through 'Z' are contiguous.
16428 Don't assume strdup exists; POSIX says its an XSI extension.
16429 Check for buffer overflow on input.
16430
b526ee61
AD
164312002-10-24 Akim Demaille <akim@epita.fr>
16432
16433 * src/output.c (output_skeleton): Don't disable M4sugar comments
16434 too soon: it results in comments being expanded.
16435 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
16436 first output.
16437
f1886bb2
AD
164382002-10-24 Akim Demaille <akim@epita.fr>
16439
16440 * data/yacc.c (m4_int_type): New.
16441 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
16442 char' as only yacc.c wants K&R portability.
16443 * data/glr.c (yysigned_char): Remove.
16444 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
16445 Reported by Quoc Peyrot.
16446
c5576256
PE
164472002-10-23 Paul Eggert <eggert@twinsun.com>
16448
16449 * src/main.c (main): With --trace=time, report times even if a
16450 non-fatal error occurs. Formerly, the times were reported in some
16451 such cases but not in others.
16452 * src/reader.c (reader): Just return if a complaint has been issued,
16453 instead of exiting, so that 'main' can report times.
16454
27b0ffea
AD
164552002-10-22 Akim Demaille <akim@epita.fr>
16456
16457 * src/system.h: Include sys/types.
16458 Reported by Bert Deknuydt.
16459
223a7883
PE
164602002-10-23 Paul Eggert <eggert@twinsun.com>
16461
16462 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
16463 Suggested by Art Haas.
16464
164652002-10-22 Paul Eggert <eggert@twinsun.com>
16466
16467 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
16468 decl; not needed any more.
16469 * src/main.c (main): Use return to exit, undoing yesterday's change.
16470 The last OS that we could find where this wouldn't work is
16471 SunOS 3.5, and that's too old to worry about now.
16472
16473 * data/glr.c (struct yyltype): Define members even when not
16474 doing locations. This is more consistent with yacc.c, and it
16475 works around the following bug reports:
161a71f3
PE
16476 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
16477 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 16478
223a7883
PE
16479 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
16480 @acronym consistently. Standardize on "Yacc" instead of "YACC",
16481 "Algol" instead of "ALGOL". Give a bit more history about BNF.
16482
8b76775a
AD
164832002-10-22 Akim Demaille <akim@epita.fr>
16484
16485 * data/README: New.
16486
6db10d14
PE
164872002-10-21 Paul Eggert <eggert@twinsun.com>
16488
16489 Be consistent about 'bool'; the old code used an enum in one
16490 module and an int in another, and this violates the C standard.
16491 * m4/stdbool.m4: New file, from coreutils 4.5.3.
16492 * configure.ac (AC_HEADER_STDBOOL): Add.
16493 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
16494 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
16495 * src/symtab.c (hash_compare_symbol_t): Likewise.
16496 * src/system.h (bool, false, true): Use a definition consistent
16497 with ../lib/hash.c. All uses changed.
16498
16499 * src/complain.c (warning_issued): Renamed from warn_message_count,
16500 so that we needn't worry about integer overflow (!).
16501 Now of type bool. All uses changed.
16502 (complaint_issued): Renamed from complain_message_count; likewise.
16503
16504 * src/main.c (main): Use exit to exit with failure.
27b0ffea 16505
6db10d14
PE
16506 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
16507 rather than 1 and 0.
16508 * src/main.c (main): Likewise.
16509 * src/getargs.c (getargs): Likewise.
16510 * src/reader.c (reader): Likewise.
16511
16512 * src/getarg.c (getargs): Remove duplicate code for
16513 "Try `bison --help'".
16514
16515 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
16516 What was that "2" for?
16517
16518 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
16519 * src/getargs.c (usage): Likewise.
16520
16521 * src/getargs.c (getargs): When there are too few operands, report
16522 the last one. When there are too many, report the first extra
16523 one. This is how diffutils does it.
16524
92a060fd
PE
165252002-10-20 Paul Eggert <eggert@twinsun.com>
16526
16527 Remove K&R vestiges.
16528 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
16529 * src/complain.c (VA_START): Remove. Assume prototypes.
16530 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
16531 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
16532 fatal): Assume prototypes.
16533 * src/complain.h: Assume prototypes.
16534 * src/system.h (PARAMS): Remove.
16535 Include <limits.h> unconditionally, since it's guaranteeed even
16536 for a freestanding C89 compiler.
16537 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
16538 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 16539
e7cb57c0
AD
165402002-10-20 Akim Demaille <akim@epita.fr>
16541
16542 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
16543 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
16544 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
16545 (yyresolveStates, yyresolveAction, yyresolveStack)
16546 (yyprocessOneStack): Use them.
16547 (yy_reduce_print): New.
16548 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
16549
0245f82d
AD
165502002-10-20 Akim Demaille <akim@epita.fr>
16551
16552 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
16553 arguments and output `void'.
16554 (b4_c_function): Rename as...
16555 (b4_c_function_def): this.
16556 (b4_c_function_decl, b4_c_ansi_function_def)
16557 (b4_c_ansi_function_decl): New.
16558 Change the interpretation of the arguments: before `int, foo', now
16559 `int foo, foo'.
16560 * data/yacc.c (yyparse): Prototype and define thanks to these.
16561 Adjust b4_c_function_def uses.
16562 * data/glr.c (yyparse): Likewise, but ANSI only.
16563
39912f52
AD
165642002-10-20 Akim Demaille <akim@epita.fr>
16565
16566 * src/output.c (prepare): Move the definition of `tokens_number',
16567 `nterms_number', `undef_token_number', `user_token_number_max'
16568 to...
16569 (prepare_tokens): Here.
16570 (prepare_tokens): Rename as...
16571 (prepare_symbols): this.
16572 (prepare): Move the definition of `rules_number' to...
16573 (prepare_rules): here.
16574 (prepare): Move the definition of `last', `final_state_number',
16575 `states_number' to...
16576 (prepare_states): here.
16577 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
16578
20c1e2ad
AD
165792002-10-20 Akim Demaille <akim@epita.fr>
16580
16581 * src/tables.h, src/tables.c, src/output.c: Comment changes.
16582
21964f43
AD
165832002-10-20 Akim Demaille <akim@epita.fr>
16584
16585 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
16586 * data/c.m4: here.
16587
66d30cd4
AD
165882002-10-20 Akim Demaille <akim@epita.fr>
16589
16590 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
16591 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
16592 `pair'.
16593 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
16594 `name' to...
16595 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
16596 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
16597 These.
16598
95f2c9fe
PE
165992002-10-19 Paul Eggert <eggert@twinsun.com>
16600
16601 Do not create a temporary file, as that involves security and
16602 cleanup headaches. Instead, use a pair of pipes.
16603 Derived from a suggestion by Florian Krohm.
16604 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
16605 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
16606 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
16607 (BISON_PREREQ_SUBPIPE): Add.
16608 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
16609 Add subpipe.h, subpipe.c.
16610 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
16611 * po/POTFILES.in: Add lib/subpipe.c.
16612 * src/output.c: Include "subpipe.h".
16613 (m4_invoke): Remove decl.
16614 (scan_skel): New decl.
16615 (output_skeleton): Use pipe rather than temporary file for m4 input.
16616 Check that m4sugar.m4 is readable, to avoid deadlock.
16617 Check for pipe I/O error.
16618 * src/scan-skel.l (readpipe): Remove decl.
16619 (scan_skel): New function, to be used in place of m4_invoke.
16620 Read from stream rather than file.
66d30cd4 16621
95f2c9fe
PE
16622 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
16623 float, as this generates a warning on Solaris 8 + GCC 3.2 with
16624 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
16625 this generates a more-accurate value anyway.
16626
16627 * lib/timevar.c (timervar_accumulate): Rename locals to
16628 avoid confusion with similarly-named more-global.
16629 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
16630
16631 * src/output.c (prepare): Use xstrdup to convert char const *
16632 to char *, to avoid GCC warning.
16633
c19988b7
AD
166342002-10-19 Akim Demaille <akim@epita.fr>
16635
16636 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
16637 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
16638 Use them to have `calc.y' ready for %pure-parser.
16639 * data/yacc.c (YYLEX): Pass a yylex return type to
16640 b4_c_function_call.
16641
ae7453f2
AD
166422002-10-19 Akim Demaille <akim@epita.fr>
16643
16644 Prototype support of %lex-param and %parse-param.
16645
16646 * src/parse-gram.y: Add the definition of the %lex-param and
16647 %parse-param tokens, plus their rules.
16648 Drop the `_' version of %glr-parser.
16649 Add the "," token.
16650 * src/scan-gram.l (INITIAL): Scan them.
16651 * src/muscle_tab.c: Comment changes.
16652 (muscle_insert, muscle_find): Rename `pair' as `probe'.
16653 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
16654 (muscle_entry_s): The `value' member is no longer const.
16655 Adjust all dependencies.
16656 * src/muscle_tab.c (muscle_init): Adjust: use
16657 MUSCLE_INSERT_STRING.
16658 Initialize the obstack earlier.
16659 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
16660 (muscle_pair_list_grow): New.
16661 * data/c.m4 (b4_c_function_call, b4_c_args): New.
16662 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
16663 * tests/calc.at: Use %locations, not --locations.
16664 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
16665
0e575721
AD
166662002-10-19 Akim Demaille <akim@epita.fr>
16667
16668 * src/getargs.c (usage): Take status as argument and exit
16669 accordingly.
16670 Report the traditional `Try ... --help' message when status != 0.
16671 (usage, version): Don't take a FILE * as arg, it is pointless.
16672 (getargs): When there is an incorrect number of arguments, make it
16673 an error, and report it GNUlically thanks to `usage ()'.
16674
724ce7f5
PE
166752002-10-18 Paul Eggert <eggert@twinsun.com>
16676
3a781eb2
PE
16677 * data/glr.c (yyreportParseError): Don't assume that sprintf
16678 yields the length of the printed string, as this is not true
16679 on SunOS 4.1.4. Reported by Peter Klein.
16680
724ce7f5
PE
16681 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
16682 * tests/conflicts.at (%nonassoc and eof): Likewise.
16683 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
16684
473d0a75
AD
166852002-10-17 Akim Demaille <akim@epita.fr>
16686
16687 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
16688 * src/getargs.c (trace_types, trace_args): Adjust.
16689 * src/reader.c (grammar_current_rule_prec_set)
16690 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
16691 Standardize error messages.
16692 And s/@prec/%prec/!
16693 (reader): Use trace_flag to enable scanner/parser debugging,
16694 instead of an adhoc scheme.
16695 * src/scan-gram.l: Remove trailing debugging code.
16696
e76d2469
PE
166972002-10-16 Paul Eggert <eggert@twinsun.com>
16698
93e2236a
PE
16699 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
16700 MUSCLE_TAB_H.
16701
e76d2469
PE
16702 * NEWS: Officially drop support for building Bison with K&R C,
16703 since it didn't work anyway and it's not worth worrying about.
16704 * Makefile.maint (wget_files): Remove ansi2knr.c.
16705 (ansi2knr.c-url_prefix): Remove.
16706 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
16707 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16708 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16709
5bd1c419
PE
167102002-10-15 Paul Eggert <eggert@twinsun.com>
16711
16712 Stop using the "enum_" trick for K&R-style function definitions;
16713 it confused me, and I was the author! Instead, assume that people
16714 who want to use K&R C compilers (when using these modules in GCC,
16715 perhaps?) will run ansi2knr.
16716
16717 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
16718 All uses of "enum_" changed to "enum ".
16719 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16720 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 16721
5bd1c419
PE
16722 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
16723 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
16724 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
16725 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
16726 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
16727 abitset_not, abitset_ones, abitset_or, abitset_or_and,
16728 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
16729 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
16730 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
16731 Use function prototypes; this removes the need for declaring
16732 static functions simply to provide their prototypes.
16733 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
16734 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
16735 bitset_count_, bitset_create, bitset_dump, bitset_first,
16736 bitset_free, bitset_init, bitset_last, bitset_next,
16737 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
16738 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
16739 bitset_print, bitset_release_memory, bitset_toggle_,
16740 bitset_type_choose, bitset_type_get, bitset_type_name_get,
16741 debug_bitset): Likewise.
16742 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
16743 * lib/bitset_stats.c (bitset_log_histogram_print,
16744 bitset_percent_histogram_print, bitset_stats_and,
16745 bitset_stats_and_cmp, bitset_stats_and_or,
16746 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
16747 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
16748 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
16749 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
16750 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
16751 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
16752 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
16753 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
16754 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
16755 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
16756 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
16757 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
16758 bitset_stats_zero): Likewise.
16759 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16760 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16761 bitsetv_dump, debug_bitsetv): Likewise.
16762 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
16763 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
16764 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
16765 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
16766 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
16767 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
16768 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
16769 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
16770 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
16771 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
16772 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
16773 Likewise.
16774 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
16775 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
16776 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
16777 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
16778 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
16779 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
16780 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
16781 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
16782 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
16783 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
16784 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 16785
ae26e1f0
AD
167862002-10-14 Akim Demaille <akim@epita.fr>
16787
16788 Version 1.75.
16789
d43baf71
AD
167902002-10-14 Akim Demaille <akim@epita.fr>
16791
16792 * tests/Makefile.am (maintainer-check-posix): New.
16793
7ebc83e3
AD
167942002-10-14 Akim Demaille <akim@epita.fr>
16795
16796 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
16797 member.
16798
05846dae
AD
167992002-10-14 Akim Demaille <akim@epita.fr>
16800
16801 * src/tables.c (table_ninf_remap): base -> tab.
16802 Reported by Matt Rosing.
16803
1318e37d
PE
168042002-10-14 Paul Eggert <eggert@twinsun.com>
16805
447fbb17
PE
16806 * tests/action.at, tests/calc.at, tests/conflicts.at,
16807 tests/cxx-type.at, tests/headers.at, tests/input.at,
16808 tests/regression.at, tests/synclines.at, tests/torture.at:
16809 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
16810 so that the tests still work even if POSIXLY_CORRECT is set.
16811 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 16812
1318e37d
PE
16813 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
16814 for portability to K&R hosts. Fix typo: signed char is guaranteed
16815 only to 127, not to 128.
16816 * data/glr.c (yysigned_char): New type.
16817 * data/yacc.c (yysigned_char): Likewise.
16818 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
16819
cc0f0794
PE
168202002-10-13 Paul Eggert <eggert@twinsun.com>
16821
5038f418
PE
16822 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
16823 true due to limited range of data type" warning from GCC.
16824
cc0f0794
PE
16825 * data/c.m4 (b4_token_defines): Protect against double-inclusion
16826 by wrapping enum yytokentype's definition inside #ifndef
16827 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
16828
6fed0802
AD
168292002-10-13 Akim Demaille <akim@epita.fr>
16830
16831 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
16832 Un yy- yyrhs to avoid the name clash with the global YYRHS.
16833
32f0598d
AD
168342002-10-13 Akim Demaille <akim@epita.fr>
16835
16836 * Makefile.maint: Update from Autoconf 2.54.
16837 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
16838
7ea9a33f
AD
168392002-10-13 Akim Demaille <akim@epita.fr>
16840
16841 * src/print.c (print_state): Separate the list of solved conflicts
16842 from the other items.
16843 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
16844
ea99527d
AD
168452002-10-13 Akim Demaille <akim@epita.fr>
16846
16847 Let nondeterministic skeletons be usable with deterministic
16848 tables.
16849
16850 With the patch, GAWK compiled by GCC without -O2 passes its test
16851 suite using a GLR parser driven by LALR tables. It fails with -O2
16852 because `struct stat' gives two different answers on my machine:
16853 88 (definition of an auto var) and later 96 (memset on this var).
16854 Hence the stack is badly corrumpted. The headers inclusion is to
16855 blame: if I move the awk.h inclusion before GLR's system header
16856 inclusion, the two struct stat have the same size.
16857
16858 * src/tables.c (pack_table): Always create conflict_table.
16859 (token_actions): Always create conflict_list.
16860 * data/glr.c (YYFLAG): Remove, unused.
16861
f377f69f
AD
168622002-10-13 Akim Demaille <akim@epita.fr>
16863
16864 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
16865 (O0FLAGS): New.
16866 (VALGRIND, GXX): New.
16867 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
16868 * tests/bison.in: Run $PREBISON a pre-command.
16869 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
16870 (maintainer-check-g++): New.
16871 * Makefile.am (maintainer-check): New.
16872
2a1fe6ed
AD
168732002-10-13 Akim Demaille <akim@epita.fr>
16874
16875 * data/glr.c: Formatting changes.
16876 Tweak some trace messages to match yacc.c's.
16877
f50adbbd
AD
168782002-10-13 Akim Demaille <akim@epita.fr>
16879
16880 GLR parsers sometimes raise parse errors instead of performing the
16881 default reduction.
16882 Reported by Charles-Henry de Boysson.
16883
16884 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 16885 check the length of the traces when %glr.
f50adbbd
AD
16886 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
16887 GLR's traces.
16888 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
16889 Test GLR parsers.
16890 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
16891 (yyltype): Remove the yy prefix from the member names.
16892 (yytable): Complete its comment.
16893 (yygetLRActions): Map error action number from YYTABLE from
16894 YYTABLE_NINF to 0.
16895 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
16896 (which was a bug: it should have been YYTABEL_NINF, and yet it was
16897 not satisfying as we could compare an YYACTION computed from
16898 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
16899 only value for error actions.
16900 (yyreportParseError): In verbose parse error messages, don't issue
16901 `error' in the list of expected tokens.
16902 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
16903 next action to perform to match glr.c's decoding.
16904 (yytable): Complete its comment.
16905
bcbad5b9
PE
169062002-10-13 Paul Eggert <eggert@twinsun.com>
16907
16908 Fix problem reported by Henrik Grubbstroem in
161a71f3 16909 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
16910 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
16911 because the Bison parser reads the second action before reducing
16912 the first one.
16913 * src/scan-gram.l (rule_length): New static var.
16914 Use it to keep track of the rule length in the scanner, since
16915 we can't expect the parser to be in lock-step sync with the scanner.
16916 (handle_action_dollar, handle_action_at): Use this var.
16917 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 16918
14904b89
PE
169192002-10-12 Paul Eggert <eggert@twinsun.com>
16920
1fe611e5
PE
16921 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
16922 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
16923 Include <sys/time.h> when checking for clock_t and struct tms.
16924 Use same include order as source.
16925 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 16926 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 16927
1fe611e5
PE
16928 * lib/timevar.c: Update copyright date and clarify comments.
16929 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 16930
1fe611e5
PE
16931 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
16932 GCC version as of today, then merge Bison's changes.
16933 Change "GCC" to "Bison" in copyright notice. timevar.def's
16934 author is Akim, so change that too.
16935
98194095
PE
16936 * src/reader.c (grammar_current_rule_check):
16937 Don't worry about the default action if $$ is untyped.
16938 Prevents bogus warnings reported by Jim Gifford in
161a71f3 16939 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 16940
14904b89
PE
16941 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
16942 * data/glr.c, data/lalr1.cc, data/yacc.c:
16943 Output token definitions before the first part of user declarations.
16944 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 16945 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 16946
ff6dca18
PE
169472002-10-11 Paul Eggert <eggert@twinsun.com>
16948
16949 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
16950 (yyparse): here. This undoes some of the 2002-07-25 change.
16951 Compatibility problem reported by Ralf S. Engelschall with
16952 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
16953
eb714592
AD
169542002-10-11 Akim Demaille <akim@epita.fr>
16955
16956 * tests/regression.at Characters Escapes): New.
16957 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
16958 characters.
16959 Reported by Jan Nieuwenhuizen.
16960
b7195100
AD
169612002-10-11 Akim Demaille <akim@epita.fr>
16962
16963 * po/id.po: New.
16964
f28a0f2d
PE
169652002-10-10 Paul Eggert <eggert@twinsun.com>
16966
16967 Portability fixes for bitsets; this also avoids several GCC
16968 warnings.
16969
16970 * lib/abitset.c: Include <stddef.h>, for offsetof.
16971 * lib/lbitset.c: Likewise.
16972
16973 * lib/abitset.c (abitset_bytes): Return a size that is aligned
16974 properly for vectors of objects. Do not assume that adding a
16975 header size to a multiple of a word size yields a value that is
16976 properly aligned for the whole union.
16977 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16978
16979 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16980 unique names for structures.
16981 * lib/ebitset.c (ebitset_bytes): Likewise.
16982 * lib/lbitset.c (lbitset_bytes): Likewise.
16983
16984 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
16985 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
16986 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
16987 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
16988 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
16989 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
16990 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
16991 to improve the type-checking that GCC can do.
16992 * lib/bitset.c (bitset_op4_cmp): Likewise.
16993 * lib/bitset_stats.c (bitset_stats_count,
16994 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
16995 bitset_stats_copy, bitset_stats_disjoint_p,
16996 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
16997 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
16998 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
16999 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
17000 bitset_stats_and_or_cmp, bitset_stats_andn_or,
17001 bitset_stats_andn_or_cmp, bitset_stats_or_and,
17002 bitset_stats_or_and_cmp): Likewise.
17003 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
17004 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
17005 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
17006 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
17007
17008 * lib/abitset.h: Include bitset.h, not bbitset.h.
17009 * lib/ebitset.h: Likewise.
17010 * lib/lbitset.h: Likewise.
17011
17012 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
17013 All instances of parameters of type enum bitset_opts are now of
17014 type enum_bitset_opts, to conform to the C Standard, and similarly
17015 for enum_bitset_type.
17016 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17017 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
17018
17019 Do not use "struct bitset_struct" to mean different things in
17020 different modules. Not only is this confusing, it violates
17021 the C Standard, which requires that structure types in different
17022 modules must be compatible if one is to be passed to the other.
17023 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
17024 All instances of "struct bitset_struct *" replaced with "bitset".
17025 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
17026 (union bitset_union, struct abitset_struct, struct ebitset_struct,
17027 struct lbitset_struct, struct bitset_stats_struct): New types.
17028 All uses of struct bitset_struct changed to union bitset_union,
17029 etc.
ba0fe3c7 17030 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
17031 struct bitset_struct): Remove.
17032 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
17033 struct bitset_struct): Remove.
17034 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
17035 bitset_struct): Remove.
17036 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
17037 Likewise.
17038
17039 Do not call a function of type T using a call that assumes the
17040 function is of a different type U. Standard C requires that a
17041 function must be called with a type that is compatible with its
17042 definition.
17043 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17044 New decls.
17045 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17046 New functions.
17047 * lib/ebitset.c (PFV): Remove.
17048 * lib/lbitset.c (PFV): Likewise.
17049 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
17050 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
17051 decls.
17052 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
17053 (ebitset_vtable): Use them.
17054 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
17055 lbitset_xor): New functions.
17056 (lbitset_vtable): Use them.
17057
17058 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
17059 Declare.
17060
17061 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
17062 GCC warning.
17063 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
17064 Use offsetof, for simplicity.
17065
6fbe4984
PE
170662002-10-06 Paul Eggert <eggert@twinsun.com>
17067
17068 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
17069 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 17070 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
17071 which was inadvertently undone by the 2002-09-30 patch.
17072 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
17073 the same width as int.
17074
420f93c8
PE
170752002-10-04 Paul Eggert <eggert@twinsun.com>
17076
17077 Version 1.50.
17078
17079 * configure.ac (AC_INIT), NEWS: Increment version number.
17080
17081 * doc/bison.texinfo: Minor spelling, grammar, and white space
17082 fixes.
17083 (Symbols): Mention that any negative value returned from yylex
17084 signifies end-of-input. Warn about negative chars. Mention
17085 the portable Standard C character set.
17086
17087 The GNU coding standard says CFLAGS and YFLAGS are reserved
17088 for the installer to set.
17089 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
17090 * src/Makefile.am (AM_CFLAGS): Likewise.
17091 (AM_YFLAGS): Renamed from YFLAGS.
17092
17093 Fix some MAX and MIN problems.
17094 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
17095 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
17096 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
17097 * src/reader.c (reader): Use it.
17098
17099 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
17100 POSIX 1003.1-2001 has removed fgrep.
17101
171022002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
17103
17104 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
17105 interpreted as signed.
17106 * lib/ebitset.c (ebitset_list): Fix bug.
17107
ff68026d
PE
171082002-10-01 Paul Eggert <eggert@twinsun.com>
17109
17110 More fixes for 64-bit hosts and large bitsets.
17111
17112 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
17113 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
17114 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
17115 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
17116 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
17117 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
17118 bitset_count_): Likewise.
17119 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
17120 bitset_first, bitset_last): Likewise.
17121 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
17122 bitset_stats_list_reverse, bitset_stats_size,
17123 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
17124 Likewise.
17125 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17126 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17127 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17128 bitsetv_reflexive_transitive_closure): Likewise.
17129 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
17130 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
17131 Likewise.
17132 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
17133 Likewise.
420f93c8 17134
ff68026d
PE
17135 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
17136 Use size_t, not unsigned int, to count bytes.
17137 * lib/abitset.h (abitset_bytes): Likewise.
17138 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
17139 Likewise.
17140 * lib/bitset.h (bitset_bytes): Likewise.
17141 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
17142 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
17143 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17144 * lib/ebitset.c (ebitset_bytes): Likewise.
17145 * lib/ebitset.h (ebitset_bytes): Likewise.
17146 * lib/lbitset.c (lbitset_bytes): Likewise.
17147 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 17148
ff68026d
PE
17149 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
17150 abitset_subset_p, abitset_disjoint_p, abitset_and,
17151 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
17152 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
17153 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
17154 abitset_or_and, abitset_or_and_cmp):
17155 Use bitset_windex instead of unsigned int.
17156 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17157 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
17158 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
17159 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
17160 Likewise.
17161 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 17162
ff68026d
PE
17163 * lib/bitset.c (bitset_print):
17164 Use proper printf formats for widths of integer types.
17165 * lib/bitset_stats.c (bitset_percent_histogram_print,
17166 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
17167 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17168 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17169 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 17170
ff68026d
PE
17171 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
17172 BITSET_SIZE_MAX): New macros.
17173 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
17174 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
17175 to BITSET_WINDEX_MAX.
17176
17177 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
17178 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
17179 since we now return the bitset_bindex type (not int).
17180
17181 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
17182 when computing sizes.
17183 * lib/ebitset.c (ebitset_elts_grow): Likewise.
17184
17185 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
17186 and avoid cast to unsigned.
17187
6aa452a6
AD
171882002-09-30 Akim Demaille <akim@epita.fr>
17189
17190 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
17191 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
17192 Updates from Michael Hayes.
17193
927f7817
AD
171942002-09-30 Art Haas <ahaas@neosoft.com>
17195
17196 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
17197 invocations.
17198 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
17199 defined.
17200
9738f41e
AD
172012002-09-27 Akim Demaille <akim@epita.fr>
17202
17203 Version 1.49c.
17204
a5c75d7f
AD
172052002-09-27 Akim Demaille <akim@epita.fr>
17206
17207 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
17208 (Because of AC_LIBSOURCE).
17209
8280e179
AD
172102002-09-27 Akim Demaille <akim@epita.fr>
17211
17212 Playing with Autoscan.
17213
17214 * configure.ac: Remove the old LIBOBJ tweaks.
17215 (AC_REPLACE_FUNCS): Add strrchr and strtol.
17216 * lib/strrchr.c: New.
17217 * lib/strtol.c: New, from the Coreutils 4.5.1.
17218
ae64af35
AD
172192002-09-27 Akim Demaille <akim@epita.fr>
17220
17221 Playing with Autoscan.
17222
17223 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
17224 * lib/Makefile.am (libbison_a_SOURCES): No longer include
17225 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
17226 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
17227 Coreutils 4.5.1.
17228
d1a1114f
AD
172292002-09-24 Akim Demaille <akim@epita.fr>
17230
17231 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
17232 (Frequently Asked Questions, Parser Stack Overflow): New.
17233
b906441c
AD
172342002-09-13 Akim Demaille <akim@epita.fr>
17235
17236 Playing with autoscan.
17237
17238 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
17239 * src/files.c (skeleton_find): Remove, unused.
17240 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
17241 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
17242
bd701811
AD
172432002-09-13 Akim Demaille <akim@epita.fr>
17244
17245 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
17246 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
17247
e0a13e7b
AD
172482002-09-13 Akim Demaille <akim@epita.fr>
17249
17250 * configure.ac: Require 2.54.
17251 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
17252 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
17253 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
17254 Remove, provided by Autoconf macros.
17255
c97011bf
AD
172562002-09-12 Akim Demaille <akim@epita.fr>
17257
17258 * m4/prereq.m4: Update, from Coreutils 4.5.1.
17259
d862b1be
AD
172602002-09-12 Akim Demaille <akim@epita.fr>
17261
17262 * m4/prereq.m4: Update, from Fileutils 4.1.5.
17263 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
17264 Reported by Martin Mokrejs.
17265
3d38c03a
AD
172662002-09-10 Akim Demaille <akim@epita.fr>
17267
17268 * src/parse-gram.y: Associate a human readable string to each
17269 token type.
17270 * tests/regression.at (Invalid inputs): Adjust.
17271
b6347355
AD
172722002-09-10 Gary V. Vaughan <gary@gnu.org>
17273
17274 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
17275 with an Autoconf-2.5x style configure.ac.
17276
09ba4ab2
PE
172772002-09-06 Paul Eggert <eggert@twinsun.com>
17278
17279 * doc/bison.texinfo (Conditions): Make explicit that the GPL
17280 exception applies only to yacc.c. This is a modification of a
17281 patch originally suggested by Akim Demaille.
17282
21846f69
AD
172832002-09-06 Akim Demaille <akim@epita.fr>
17284
09ba4ab2
PE
17285 * data/c.m4 (b4_copyright): Move the GPL exception comment from
17286 here to...
17287 * data/yacc.c: here.
17288
21846f69
AD
17289 * data/lalr1.cc (struct yyltype): Don't define it, since we use
17290 LocationType.
17291 (b4_ltype): Default to yy::Location from location.hh.
17292
c0ad8bf3
AD
172932002-09-04 Jim Meyering <jim@meyering.net>
17294
17295 * data/yacc.c: Guard the declaration of yytoknum also with
17296 `#ifdef YYPRINT', so it is declared only when used.
17297
3a93251e
AD
172982002-09-04 Akim Demaille <akim@epita.fr>
17299
17300 * configure.in: Rename as...
17301 * configure.ac: this.
17302 Bump to 1.49c.
17303
427c0dda
AD
173042002-09-04 Akim Demaille <akim@epita.fr>
17305
17306 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
17307 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
17308 translate maintainer only messages.
17309
6a254321
PE
173102002-08-12 Paul Eggert <eggert@twinsun.com>
17311
645e30d1
PE
17312 Version 1.49b.
17313
6a254321
PE
17314 * Makefile.am (SUBDIRS): Remove intl.
17315 (DISTCLEANFILES): Remove.
17316 * NEWS: Mention that GNU M4 is now required. Clarify what is
17317 meant by "larger grammars". Mention the pt_BR translation.
17318 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
17319 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
17320 Bump version from 0.11.2 to 0.11.5.
17321 (BISON_PREREQ_STAGE): Remove.
17322 (AM_GNU_GETTEXT): Use external gettext.
17323 (AC_OUTPUT): Remove intl/Makefile.
17324
17325 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
17326
17327 * data/glr.c: Include string.h, for strlen.
17328 (yyreportParseError): Use size_t for yysize.
17329 (yy_yypstack): No longer nested inside yypstates, as nested
17330 functions are not portable. Do not assume size_t is the
17331 same width as int.
17332 (yypstates): Do not assume that ptrdiff_t is the same width
17333 as int, and similarly for yyposn and YYINDEX.
17334
17335 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
17336
17337 * lib/Makefile.am (INCLUDES): Do not include from the intl
17338 directory, which has been removed.
17339 * src/Makefile.am (INCLUDES): Likewise.
17340
17341 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
17342 (bitsets_sources, additional_bitsets_sources, timevars_sources):
17343 New vars.
17344
17345 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
17346 * tests/Makefile.am (EXTRA_DIST): Likewise.
17347
17348 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
17349 Do not assume that bitset_windex is the same width as unsigned.
17350
17351 * lib/abitset.c (abitset_unused_clear): Do not assume that
17352 bitset_word is the same width as int.
17353 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
17354 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
17355 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
17356 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
17357 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
17358
17359 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
17360 portability to one's complement hosts!).
17361 * lib/ebitset.c (ebitset_op1): Likewise.
17362 * lib/lbitset.c (lbitset_op1): Likewise.
17363
17364 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
17365 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
17366 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
17367 Sync with fileutils.
17368 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
17369 lib/gettext.h: Sync with diffutils.
17370
17371 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
17372 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
17373
17374 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
17375 PROTOTYPES to check for prototypes, and "defined __STDC__" to
17376 check for void *.
17377
17378 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
17379 size_t; the old version tried to do this but casted improperly.
17380 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
17381 (bitset_test): Now returns int, not unsigned long.
17382
17383 * lib/bitset_stats.c: Include "gettext.h".
17384 (_): New macro.
17385 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
17386 name locals "index", as it generates unnecessary warnings on some
17387 hosts that have an "index" function.
17388
17389 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
17390 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
17391 they need translation.
17392 * src/LR0.c (state_list_append, new_itemsets, get_state,
17393 append_states, generate_states): Likewise.
17394 * src/assoc.c (assoc_to_string): Likewise.
17395 * src/closure.c (print_closure, set_firsts, closure): Likewise.
17396 * src/gram.c (grammar_dump): Likewise.
17397 * src/injections.c (injections_compute): Likewise.
17398 * src/lalr.c (lookaheads_print): Likewise.
17399 * src/relation.c (relation_transpose): Likewise.
17400 * src/scan-gram.l: Likewise.
17401 * src/tables.c (table_grow, pack_vector): Likewise.
17402
17403 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
17404 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
17405 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
17406 * m4/mbstate_t.m4: Sync with fileutils.
17407 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
17408
17409 * po/LINGUAS: Add pt_BR.
17410 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
17411 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
17412 lib/timevar.c.
17413 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
17414 manual recommends.
17415 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
17416
17417 * src/complain.c (strerror_r): Remove decl; not needed.
17418 (strerror): Use same pattern as ../lib/error.c.
17419
17420 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
17421
17422 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
17423
17424 * src/main.c (main): Cast result of bindtextdomain and textdomain
17425 to void, to avoid a GCC warning when --disable-nls is in effect.
17426
17427 * src/scan-gram.l: Use strings rather than escapes when possible,
17428 to minimize the number of warnings from xgettext.
17429 (handle_action_dollar, handle_action_at): Don't use isdigit,
17430 as it mishandles negative chars and it may not work as expected
17431 outside the C locale.
17432
17433 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
17434 this is a GCC extension and is not portable to other compilers.
17435
17436 * src/system.h (alloca): Use same pattern as ../lib/error.c.
17437 Do not include <ctype.h>; no longer needed.
17438 Do not include <malloc.h>; no longer needed (and generates
17439 warnings on OpenBSD 3.0).
17440
17441 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
17442 it's not portable.
17443
17444 * tests/regression.at: Do not use 'cc -c input.c -o input';
17445 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
17446
17447 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
17448 exit status as failure, not just exit status 1. Sun C exits
17449 with status 2 sometimes.
17450
17451 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
17452 Use it for the two large tests.
17453
c8f002c7
AD
174542002-08-02 Akim Demaille <akim@epita.fr>
17455
17456 * src/conflicts.c (conflicts_output): Don't output rules never
17457 reduced here, since anyway that computation doesn't work.
17458 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
17459 (rule_useless_p, rule_never_reduced_p): New.
17460 (grammar_rules_partial_print): Use a filter instead of a range.
17461 Display the title only if needed.
17462 (grammar_rules_print): Adjust.
17463 (grammar_rules_never_reduced_report): New.
17464 * src/tables.c (action_row): Move the computation of rules never
17465 reduced to...
17466 (token_actions): here.
17467 * src/main.c (main): Make the parser before making the report, so
17468 that rules never reduced are computed.
17469 Call grammar_rules_never_reduced_report.
17470 * src/print.c (print_results): Report rules never reduced.
17471 * tests/conflicts.at, tests/reduce.at: Adjust.
17472
cd08e51e
AD
174732002-08-01 Akim Demaille <akim@epita.fr>
17474
17475 Instead of attaching lookaheads and duplicating the rules being
17476 reduced by a state, attach the lookaheads to the reductions.
17477
17478 * src/state.h (state_t): Remove the `lookaheads',
17479 `lookaheads_rule' member.
17480 (reductions_t): Add a `lookaheads' member.
17481 Use a regular array for the `rules'.
17482 * src/state.c (reductions_new): Initialize the lookaheads member
17483 to 0.
17484 (state_rule_lookaheads_print): Adjust.
17485 * src/state.h, src/state.c (state_reductions_find): New.
17486 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
17487 (count_rr_conflicts): Adjust.
17488 * src/lalr.c (LArule): Remove.
17489 (add_lookback_edge): Adjust.
17490 (state_lookaheads_count): New.
17491 (states_lookaheads_initialize): Merge into...
17492 (initialize_LA): this.
17493 (lalr_free): Adjust.
17494 * src/main.c (main): Don't free nullable and derives too early: it
17495 is used by --verbose.
17496 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
17497
bb0027a9
AD
174982002-08-01 Akim Demaille <akim@epita.fr>
17499
17500 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
17501 `rule_number_t**'.
17502 (set_derives, free_derives): Rename as...
17503 (derives_compute, derives_free): this.
17504 Adjust all dependencies.
17505 * src/nullable.c (set_nullable, free_nullable): Rename as...
17506 (nullable_compute, nullable_free): these.
17507 (rule_list_t): Store rule_t *, not rule_number_t.
17508 * src/state.c (state_rule_lookaheads_print): Directly compare rule
17509 pointers, instead of their numbers.
17510 * src/main.c (main): Call nullable_free, and derives_free earlier,
17511 as they were lo longer used.
17512
3325ddc4
AD
175132002-08-01 Akim Demaille <akim@epita.fr>
17514
17515 * lib/timevar.c (get_time): Include children time.
17516 * src/lalr.h (LA, LArule): Don't export them: used with the
17517 state_t.
17518 * src/lalr.c (LA, LArule): Static.
17519 * src/lalr.h, src/lalr.c (lalr_free): New.
17520 * src/main.c (main): Call it.
17521 * src/tables.c (pack_vector): Check whether loc is >= to the
17522 table_size, not >.
17523 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
17524 (tables_generate): do it, since that's also it which allocates
17525 them.
17526 Don't free LA and LArule, main does.
17527
c6f1a33c
AD
175282002-07-31 Akim Demaille <akim@epita.fr>
17529
17530 Separate parser tables computation and output.
17531
17532 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
17533 (conflict_list, conflict_list_cnt, table, check, table_ninf)
17534 (yydefgoto, yydefact, high): Move to...
17535 * src/tables.h, src/tables.c: here.
17536 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17537 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17538 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
17539 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
17540 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
17541 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
17542 (action_row, save_row, token_actions, save_column, default_goto)
17543 (goto_actions, sort_actions, matching_state, pack_vector)
17544 (table_ninf_remap, pack_table, prepare_actions): Move to...
17545 * src/tables.c: here.
17546 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
17547 * src/output.c (token_actions, output_base, output_conflicts)
17548 (output_check): Merge into...
17549 (prepare_actions): this.
17550 (actions_output): Rename as...
17551 (user_actions_output): this.
17552 * src/main.c (main): Call tables_generate and tables_free.
17553
1509d42f
AD
175542002-07-31 Akim Demaille <akim@epita.fr>
17555
17556 Steal GCC's --time-report support.
17557
17558 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
17559 stolen/adjusted from GCC.
17560 * m4/stage.m4: Remove time related checks.
17561 * m4/timevar.m4: New.
17562 * configure.in: Adjust.
17563 * src/system.h: Adjust to using timevar.h.
17564 * src/getargs.h, src/getargs.c: Support trace_time for
17565 --trace=time.
17566 * src/main.c (stage): Remove.
17567 (main): Replace `stage' invocations with timevar calls.
17568 * src/output.c: Insert pertinent timevar calls.
17569
273a74fa
AD
175702002-07-31 Akim Demaille <akim@epita.fr>
17571
17572 Let --trace have arguments.
17573
17574 * src/getargs.h (enum trace_e): New.
17575 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
17576 (long_options, short_options): --trace/-T takes an optional
17577 argument.
17578 Change all the uses of trace_flag to reflect the new flags.
17579 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
17580
17581 Strengthen `stage' portability.
17582
17583 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
17584 * configure.in: Use it.
17585 Don't check for malloc.h and sys/times.h.
17586 * src/system.h: Include them when appropriate.
17587 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
17588 times and struct tms are available.
17589
217598da
AD
175902002-07-30 Akim Demaille <akim@epita.fr>
17591
17592 In verbose parse error message, don't report `error' as an
17593 expected token.
17594 * tests/actions.at (Printers and Destructors): Adjust.
17595 * tests/calc.at (Calculator $1): Adjust.
17596 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
17597 error message, do not report the parser accepts the error token in
17598 that state.
17599
52489d44
AD
176002002-07-30 Akim Demaille <akim@epita.fr>
17601
17602 Normalize conflict related messages.
17603
17604 * src/complain.h, src/complain.c (warn, complain): New.
17605 * src/conflicts.c (conflicts_print): Use them.
17606 (conflict_report_yacc): New, extracted from...
17607 (conflicts_print): here.
17608 * tests/conflicts.at, tests/existing.at: Adjust.
17609
e8832397
AD
176102002-07-30 Akim Demaille <akim@epita.fr>
17611
17612 Report rules which are never reduced by the parser: those hidden
17613 by conflicts.
17614
17615 * src/LR0.c (save_reductions): Don't make the final state too
17616 different: save its reduction (accept) instead of having a state
17617 without any action (no shift or goto, no reduce).
17618 Note: the final state is now a ``regular'' state, i.e., the
17619 parsers now contain `reduce 0' as default reduction.
17620 Nevertheless, since they decide to `accept' when yystate =
17621 final_state, they still will not reduce rule 0.
17622 * src/print.c (print_actions, print_reduction): Adjust.
17623 * src/output.c (action_row): Track reduced rules.
17624 (token_actions): Report rules never reduced.
17625 * tests/conflicts.at, tests/regression.at: Adjust.
17626
caf23d24
AD
176272002-07-30 Akim Demaille <akim@epita.fr>
17628
17629 `stage' was accidently included in a previous patch.
17630 Initiate its autoconfiscation.
17631
17632 * configure.in: Look for malloc.h and sys/times.h.
17633 * src/main.c (stage): Adjust.
17634 Report only when trace_flag.
17635
640748ee
AD
176362002-07-29 Akim Demaille <akim@epita.fr>
17637
17638 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
17639 state_number_t.
17640 (errs_t): symbol_t*, not symbol_number_t.
17641 (reductions_t): rule_t*, not rule_number_t.
17642 (FOR_EACH_SHIFT): New.
17643 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
17644 * src/print.c, src/print_graph.c: Adjust.
17645
88bce5a2
AD
176462002-07-29 Akim Demaille <akim@epita.fr>
17647
17648 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
17649
17650 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
17651 (endtoken, accept): these.
17652 * src/reader.c (reader): Set endtoken's default tag to "$end".
17653 Set undeftoken's tag to "$undefined" instead of "$undefined.".
17654 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
17655 Adjust.
17656
1bfb97db
AD
176572002-07-29 Akim Demaille <akim@epita.fr>
17658
17659 * src/reduce.c (reduce_grammar): When the language is empty,
17660 complain about the start symbol, not the axiom.
17661 Use its location.
17662 * tests/reduce.at (Empty Language): New.
17663
fc5734fe
AD
176642002-07-26 Akim Demaille <akim@epita.fr>
17665
17666 * src/reader.h, src/reader.c (gram_error): ... can't get
17667 yycontrol without making too strong assumptions on the parser
17668 itself.
17669 * src/output.c (prepare_tokens): Use the real 0th value of
17670 token_translations instead of `0'.
17671 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
17672 visible here.
17673 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
17674 for the time being: %locations ought to provide it to yyerror.
17675
3650b4b8
AD
176762002-07-25 Akim Demaille <akim@epita.fr>
17677
17678 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
17679 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
17680 * tests/regression.at (Web2c Actions): Adjust.
17681
4b3d3a8e
AD
176822002-07-25 Akim Demaille <akim@epita.fr>
17683
17684 Stop storing rules from 1 to nrules + 1.
17685
17686 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
17687 * src/nullable.c, src/output.c, src/print.c, src/reader.c
17688 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
17689 Iterate from 0 to nrules.
17690 Use rule_number_as_item_number and item_number_as_rule_number.
17691 Adjust to `derive' now containing possibly 0.
17692 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
17693 Handle the `- 1' part in rule numbers from/to item numbers.
17694 * src/conflicts.c (log_resolution): Fix the message which reversed
17695 shift and reduce.
17696 * src/output.c (action_row): Initialize default_rule to -1.
17697 (token_actions): Adjust.
17698 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
17699 expected output.
17700 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
17701
4a2a22f4
AD
177022002-07-25 Akim Demaille <akim@epita.fr>
17703
17704 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
17705 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
17706 (b4_c_knr_arg_decl): New.
17707 * data/yacc.c: Use it to define yysymprint, yydestruct, and
17708 yyreport_parse_error.
17709
b8df3223
AD
177102002-07-25 Akim Demaille <akim@epita.fr>
17711
17712 * data/yacc.c (yyreport_parse_error): New, extracted from...
17713 (yyparse): here.
17714 (yydestruct, yysymprint): Move above yyparse.
17715 Be K&R compliant.
17716
a762e609
AD
177172002-07-25 Akim Demaille <akim@epita.fr>
17718
17719 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
17720 replace...
17721 (b4_sint_type, b4_uint_type): these.
17722 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
17723 * tests/regression.at (Web2c Actions): Adjust.
17724
12b0043a
AD
177252002-07-25 Akim Demaille <akim@epita.fr>
17726
17727 * src/gram.h (TIEM_NUMBER_MAX): New.
17728 (item_number_of_rule_number, rule_number_of_item_number): Rename
17729 as...
17730 (rule_number_as_item_number, item_number_as_rule_number): these.
17731 Adjust dependencies.
17732 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17733 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17734 (symbol_number_to_vector_number): New.
17735 (order): Of vector_number_t* type.
17736 (base_t, BASE_MAX, BASE_MIN): New.
17737 (froms, tos, width, pos, check): Of base_t type.
17738 (action_number_t, ACTION_MIN, ACTION_MAX): New.
17739 (actrow): Of action_number_t type.
17740 (conflrow): Of unsigned int type.
17741 (table_ninf, base_ninf): New.
17742 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
17743 (muscle_insert_int_table, muscle_insert_base_table)
17744 (muscle_insert_rule_number_table): New.
17745 (prepare_tokens): Output `toknum' as int_table.
17746 (action_row): Returns a rule_number_t.
17747 Use ACTION_MIN, not SHRT_MIN.
17748 (token_actions): yydefact is rule_number_t*.
17749 (table_ninf_remap): New.
17750 (pack_table): Use it for `base' and `table'.
17751 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
17752 replaced with...
17753 (YYPACT_NINF, YYTABLE_NINF): these.
17754 (yypact, yytable): Compute their types instead of hard-coded
17755 `short'.
17756 * tests/regression.at (Web2c Actions): Adjust.
17757
5dde258a
AD
177582002-07-19 Akim Demaille <akim@epita.fr>
17759
17760 * src/scan-gram.l (id): Can start with an underscore.
17761
a945ec39
AD
177622002-07-16 Akim Demaille <akim@epita.fr>
17763
17764 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
17765 Adjust all former `associativity' dependencies.
17766 * src/symtab.c (symbol_new): Default associativity is `undef', not
17767 `right'.
17768 (symbol_check_alias_consistence): Adjust.
17769
fae437e8
AD
177702002-07-09 Akim Demaille <akim@epita.fr>
17771
17772 * doc/bison.texinfo: Properly set the ``header'' part.
17773 Use @dircategory ``GNU programming tools'' as per Texinfo's
17774 documentation.
17775 Use @copying.
17776
1a715ef2
AD
177772002-07-09 Akim Demaille <akim@epita.fr>
17778
17779 * lib/quotearg.h: Protect against multiple inclusions.
17780 * src/location.h (location_t): Add a `file' member.
17781 (LOCATION_RESET, LOCATION_PRINT): Adjust.
17782 * src/complain.c (warn_at, complain_at, fatal_at): Drop
17783 `error_one_per_line' support.
17784
a5d50994
AD
177852002-07-09 Akim Demaille <akim@epita.fr>
17786
17787 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
17788 * src/reader.c (lineno): Remove.
17789 Adjust all dependencies.
17790 (get_merge_function): Take a location and use complain_at.
17791 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
17792 * tests/regression.at (Invalid inputs, Mixing %token styles):
17793 Adjust.
17794
b275314e
AD
177952002-07-09 Akim Demaille <akim@epita.fr>
17796
17797 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
17798 recovery rule, and forbid extensions when --yacc.
17799 (gram_error): Use complain_at.
17800 * src/reader.c (reader): Exit if there were parse errors.
17801
865b9df1
AD
178022002-07-09 Akim Demaille <akim@epita.fr>
17803
17804 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
17805 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
17806 Reported by R Blake <blakers@mac.com>.
17807
c76e14da
AD
178082002-07-09 Akim Demaille <akim@epita.fr>
17809
17810 * data/yacc.c: Output the copyright notive in the header.
17811
7db2ed2d
AD
178122002-07-03 Akim Demaille <akim@epita.fr>
17813
17814 * src/output.c (froms, tos): Are state_number_t.
17815 (save_column): sp, sp1, and sp2 are state_number_t.
17816 (prepare): Rename `final' as `final_state_number', `nnts' as
17817 `nterms_number', `nrules' as `rules_number', `nstates' as
17818 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
17819 unused.
17820 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
17821 * data/lalr1.cc (nsym_): Remove, unused.
17822
e68e0410
AD
178232002-07-03 Akim Demaille <akim@epita.fr>
17824
17825 * src/lalr.h, src/lalr.c (goto_number_t): New.
17826 * src/lalr.c (goto_list_t): New.
17827 Propagate them.
17828 * src/nullable.c (rule_list_t): New.
17829 Propagate.
17830 * src/types.h: Remove.
17831
e1a4f3a4
AD
178322002-07-03 Akim Demaille <akim@epita.fr>
17833
17834 * src/closure.c (print_fderives): Use rule_rhs_print.
17835 * src/derives.c (print_derives): Use rule_rhs_print.
17836 (rule_list_t): New, replaces `shorts'.
17837 (set_derives): Add comments.
17838 * tests/sets.at (Nullable, Firsts): Adjust.
17839
536545f3
AD
178402002-07-03 Akim Demaille <akim@epita.fr>
17841
17842 * src/output.c (prepare_actions): Free `tally' and `width'.
17843 (prepare_actions): Allocate and free `order'.
17844 * src/symtab.c (symbols_free): Free `symbols'.
17845 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
17846 * src/output.c (m4_invoke): Move to...
17847 * src/scan-skel.l: here.
17848 (<<EOF>>): Close yyout, and free its name.
17849
8b752b00
AD
178502002-07-03 Akim Demaille <akim@epita.fr>
17851
17852 Fix some memory leaks, and fix a bug: state 0 was examined twice.
17853
17854 * src/LR0.c (new_state): Merge into...
17855 (state_list_append): this.
17856 (new_states): Merge into...
17857 (generate_states): here.
17858 (set_states): Don't ensure a proper `errs' state member here, do it...
17859 * src/conflicts.c (conflicts_solve): here.
17860 * src/state.h, src/state.c: Comment changes.
17861 (state_t): Rename member `shifts' as `transitions'.
17862 Adjust all dependencies.
17863 (errs_new): For consistency, also take the values as argument.
17864 (errs_dup): Remove.
17865 (state_errs_set): New.
17866 (state_reductions_set, state_transitions_set): Assert that no
17867 previous value was assigned.
17868 (state_free): New.
17869 (states_free): Use it.
17870 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
17871 temporary storage: use `errs' and `nerrs' as elsewhere.
17872 (set_conflicts): Allocate and free this `errs'.
17873
613f5e1a
AD
178742002-07-02 Akim Demaille <akim@epita.fr>
17875
17876 * lib/libiberty.h: New.
17877 * lib: Update the bitset implementation from upstream.
17878 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
17879 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
17880 * src/main.c: Adjust bitset stats calls.
17881
26e0cadc
PE
178822002-07-01 Paul Eggert <eggert@twinsun.com>
17883
17884 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
17885 char, so that negative chars don't collide with $.
17886
1154cced
AD
178872002-06-30 Akim Demaille <akim@epita.fr>
17888
17889 Have the GLR tests be `warning' checked, and fix the warnings.
17890
17891 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
17892 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
17893 (yyremoveDeletes): `yyi' and `yyj' are size_t.
17894 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
17895 (yyaddDeferredAction): static.
17896 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
17897 (yyreportParseError): yyprefix is const.
17898 yytokenp is used only when verbose.
17899 (yy__GNUC__): Replace with __GNUC__.
17900 (yypdumpstack): yyi is size_t.
17901 (yypreference): Un-yy local variables and arguments, to avoid
17902 clashes with `yyr1'. Anyway, we are not in the user name space.
17903 (yytname_size): be an int, as is compared with ints.
17904 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
17905 Use them.
17906 * tests/cxx-gram.at: Use quotation to protect $1.
17907 Use AT_COMPILE to enable warnings hunts.
17908 Prototype yylex and yyerror.
17909 `Use' argc.
17910 Include `string.h', not `strings.h'.
17911 Produce and prototype stmtMerge only when used.
17912 yylex takes a location.
17913
97650f4e
AD
179142002-06-30 Akim Demaille <akim@epita.fr>
17915
17916 We spend a lot of time in quotearg, in particular when --verbose.
17917
17918 * src/symtab.c (symbol_get): Store a quoted version of the key.
17919 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
17920 Adjust all callers.
17921
d2576365
AD
179222002-06-30 Akim Demaille <akim@epita.fr>
17923
17924 * src/state.h (reductions_t): Rename member `nreds' as num.
17925 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
17926 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
17927
ccaf65bc
AD
179282002-06-30 Akim Demaille <akim@epita.fr>
17929
17930 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
17931 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
17932 (shifts_to): Rename as...
17933 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
17934 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
17935 (TRANSITION_IS_DISABLED, transitions_to): these.
17936
87675353
AD
179372002-06-30 Akim Demaille <akim@epita.fr>
17938
17939 * src/print.c (print_shifts, print_gotos): Merge into...
17940 (print_transitions): this.
17941 (print_transitions, print_errs, print_reductions): Align the
17942 lookaheads columns.
17943 (print_core, print_transitions, print_errs, print_state,
17944 print_grammar): Output empty lines separator before, not after.
17945 (state_default_rule_compute): Rename as...
17946 (state_default_rule): this.
17947 * tests/conflicts.at (Defaulted Conflicted Reduction),
17948 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
17949 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
17950
ce4ccb4b
AD
179512002-06-30 Akim Demaille <akim@epita.fr>
17952
17953 Display items as we display rules.
17954
17955 * src/gram.h, src/gram.c (rule_lhs_print): New.
17956 * src/gram.c (grammar_rules_partial_print): Use it.
17957 * src/print.c (print_core): Likewise.
17958 * tests/conflicts.at (Defaulted Conflicted Reduction),
17959 (Unresolved SR Conflicts): Adjust.
17960 (Unresolved SR Conflicts): Adjust and rename as...
17961 (Resolved SR Conflicts): this, as was meant.
17962 * tests/regression.at (Web2c Report): Adjust.
17963
bc933ef1
AD
179642002-06-30 Akim Demaille <akim@epita.fr>
17965
17966 * src/print.c (state_default_rule_compute): New, extracted from...
17967 (print_reductions): here.
17968 Pessimize, but clarify the code.
17969 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
17970
53d4308d
AD
179712002-06-30 Akim Demaille <akim@epita.fr>
17972
17973 * src/output.c (action_row): Let default_rule be always a rule
17974 number.
17975
574fb2d5
AD
179762002-06-30 Akim Demaille <akim@epita.fr>
17977
17978 * src/closure.c (print_firsts, print_fderives, closure):
17979 Use BITSET_EXECUTE.
17980 * src/lalr.c (lookaheads_print): Likewise.
17981 * src/state.c (state_rule_lookaheads_print): Likewise.
17982 * src/print_graph.c (print_core): Likewise.
17983 * src/print.c (print_reductions): Likewise.
17984 * src/output.c (action_row): Likewise.
17985 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
17986
05811fd7
AD
179872002-06-30 Akim Demaille <akim@epita.fr>
17988
17989 * src/print_graph.c: Use report_flag.
17990
0e4d5753
AD
179912002-06-30 Akim Demaille <akim@epita.fr>
17992
17993 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
17994 to...
17995 * src/relation.h, src/relation.c (traverse, relation_digraph)
17996 (relation_print, relation_transpose): New.
17997
24c7d800
AD
179982002-06-30 Akim Demaille <akim@epita.fr>
17999
18000 * src/state.h, src/state.c (shifts_to): New.
18001 * src/lalr.c (build_relations): Use it.
18002
9222837b
AD
180032002-06-30 Akim Demaille <akim@epita.fr>
18004
18005 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
18006 (item_number_of_rule_number, rule_number_of_item_number): New.
18007 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
18008 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18009 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
18010 Propagate their use.
18011 Much remains to be done, in particular wrt `shorts' from types.h.
18012
260008e5
AD
180132002-06-30 Akim Demaille <akim@epita.fr>
18014
18015 * src/symtab.c (symbol_new): Initialize the `printer' member.
18016
8a731ca8
AD
180172002-06-30 Akim Demaille <akim@epita.fr>
18018
18019 * src/LR0.c (save_reductions): Remove, replaced by...
18020 * src/state.h, src/state.c (state_reductions_set): New.
18021 (reductions, errs): Rename as...
18022 (reductions_t, errs_t): these.
18023 Adjust all dependencies.
18024
32e1e0a4
AD
180252002-06-30 Akim Demaille <akim@epita.fr>
18026
18027 * src/LR0.c (state_list_t, state_list_append): New.
18028 (first_state, last_state): Now symbol_list_t.
18029 (this_state): Remove.
18030 (new_itemsets, append_states, save_reductions): Take a state_t as
18031 argument.
18032 (set_states, generate_states): Adjust.
18033 (save_shifts): Remove, replaced by...
18034 * src/state.h, src/state.c (state_shifts_set): New.
18035 (shifts): Rename as...
18036 (shifts_t): this.
18037 Adjust all dependencies.
18038 * src/state.h (state_t): Remove the `next' member.
18039
e5fb6710
AD
180402002-06-30 Akim Demaille <akim@epita.fr>
18041
18042 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
18043 escaped in slot 0.
18044
c7ca99d4
AD
180452002-06-30 Akim Demaille <akim@epita.fr>
18046
18047 Use hash.h for the state hash table.
18048
18049 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
18050 (allocate_storage): Use state_hash_new.
18051 (free_storage): Use state_hash_free.
18052 (new_state, get_state): Adjust.
18053 * src/lalr.h, src/lalr.c (states): Move to...
18054 * src/states.h (state_t): Remove the `link' member, no longer
18055 used.
18056 * src/states.h, src/states.c: here.
18057 (state_hash_new, state_hash_free, state_hash_lookup)
18058 (state_hash_insert, states_free): New.
18059 * src/states.c (state_table, state_compare, state_hash): New.
18060 * src/output.c (output_actions): Do not free states now, since we
18061 still need to know the final_state number in `prepare', called
18062 afterwards. Do it...
18063 * src/main.c (main): here: call states_free after `output'.
18064
df0e7316
AD
180652002-06-30 Akim Demaille <akim@epita.fr>
18066
18067 * src/state.h, src/state.c (state_new): New, extracted from...
18068 * src/LR0.c (new_state): here.
18069 * src/state.h (STATE_ALLOC): Move to...
18070 * src/state.c: here.
18071 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
18072 * src/state.h, src/state.c: here.
18073
39f41916
AD
180742002-06-30 Akim Demaille <akim@epita.fr>
18075
18076 * src/reader.c (gensym): Rename as...
18077 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
18078 (getsym): Rename as...
18079 (symbol_get): this.
18080
d57650a5
AD
180812002-06-30 Akim Demaille <akim@epita.fr>
18082
18083 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
18084 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
18085 * src/output.c, src/print.c, src/print_graph.c: Propagate.
18086 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
18087
5a08f1ce
AD
180882002-06-30 Akim Demaille <akim@epita.fr>
18089
18090 Make the test suite pass with warnings checked.
18091
18092 * tests/actions.at (Printers and Destructors): Improve.
18093 Avoid unsigned vs. signed issues.
18094 * tests/calc.at: Don't exercise the scanner here, do it...
18095 * tests/input.at (Torturing the Scanner): here.
18096
720623af
PH
180972002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18098
88e7e941 18099 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
18100 reorganize first lines parallel to yacc.c.
18101
fb8135fa
AD
181022002-06-28 Akim Demaille <akim@epita.fr>
18103
18104 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
18105 (b4_token_enum, b4_token_defines): New, factored from...
18106 * data/lalr1.cc, data/yacc.c, glr.c: here.
18107
41442480
AD
181082002-06-28 Akim Demaille <akim@epita.fr>
18109
18110 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
18111 unused variables.
18112 * src/output.c (merger_output): static.
18113
e0e5bf84
AD
181142002-06-28 Akim Demaille <akim@epita.fr>
18115
ba0fe3c7 18116 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
18117 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
18118 pacify GCC.
18119 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 18120
676385e2
PH
181212002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18122
18123 Accumulated changelog for new GLR parsing features.
18124
6a254321 18125 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
18126 conflicts_total_count.
18127 * src/conflicts.h: Ditto.
18128 * src/output.c (token_actions): Use the new name.
18129 (output_conflicts): Change conflp => conflict_list_heads, and
18130 confl => conflict_list for better readability.
18131 * data/glr.c: Use the new names.
18132 * NEWS: Add self to GLR announcement.
e0e5bf84 18133
676385e2
PH
18134 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
18135
18136 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
18137 Akim Demaille.
18138
18139 * data/bison.glr: Change name to glr.c
18140 * data/glr.c: Renamed from bison.glr.
18141 * data/Makefile.am: Add glr.c
e0e5bf84
AD
18142
18143 * src/getargs.c:
18144
676385e2 18145 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 18146 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 18147
676385e2
PH
18148 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18149
18150 * data/bison.glr: Be sure to restore the
18151 current #line when returning to the skeleton contents after having
18152 exposed the input file's #line.
18153
18154 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18155
18156 * data/bison.glr: Bring up to date with changes to bison.simple.
18157
18158 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18159
18160 * data/bison.glr: Correct definitions that use b4_prefix.
18161 Various reformatting.
18162 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
18163 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
18164 yytokenp argument; now part of stack.
18165 (yychar): Define to behave as documented.
18166 (yyclearin): Ditto.
e0e5bf84 18167
676385e2
PH
18168 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18169
18170 * src/reader.h: Add declaration for free_merger_functions.
18171
18172 * src/reader.c (merge_functions): New variable.
18173 (get_merge_function): New function.
18174 (free_merger_functions): New function.
18175 (readgram): Check for %prec that is not followed by a symbol.
18176 Handle %dprec and %merge declarations.
18177 (packgram): Initialize dprec and merger fields in rules array.
18178
18179 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
18180 conflict_list_cnt, conflict_list_free): New variables.
18181 (table_grow): Also grow conflict_table.
e0e5bf84 18182 (prepare_rules): Output dprec and merger tables.
676385e2 18183 (conflict_row): New function.
e0e5bf84 18184 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
18185 default reduction in conflicted states for GLR parser so that there
18186 are spaces for the conflict lists.
18187 (save_row): Also save conflict information.
18188 (token_actions): Allocate conflict list.
18189 (merger_output): New function.
18190 (pack_vector): Pack conflict table, too.
18191 (output_conflicts): New function to output yyconflp and yyconfl.
18192 (output_check): Allocate conflict_tos.
18193 (output_actions): Output conflict tables, also.
18194 (output_skeleton): Output b4_mergers definition.
18195 (prepare): Output b4_max_rhs_length definition.
18196 Use 'bison.glr' as default skeleton for GLR parsers.
18197
18198 * src/gram.c (glr_parser): New flag.
18199 (grammar_free): Call free_merger_functions.
18200
18201 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
18202 all pairs of conflicting reductions, rather than just all tokens
18203 causing conflicts. Needed to size conflict tables.
e0e5bf84 18204 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
18205 interface.
18206 (conflicts_print): Ditto.
18207 (count_total_conflicts): New function.
18208
18209 * src/reader.h (merger_list): New type.
18210 (merge_functions): New variable.
18211
18212 * src/lex.h (tok_dprec, tok_merge): New token types.
18213
18214 * src/gram.h (rule_s): Add dprec and merger fields.
18215 (glr_parser): New flag.
18216
18217 * src/conflicts.h (count_total_conflicts): New function.
18218
18219 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
18220
18221 * doc/bison.texinfo (Generalized LR Parsing): New section.
18222 (GLR Parsers): New section.
18223 (Language and Grammar): Mention GLR parsing.
18224 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
18225 Correct typo ("tge" -> "the").
18226
18227 * data/bison.glr: New skeleton for GLR parsing.
18228
18229 * tests/cxx-gram.at: New tests for GLR parsing.
18230
18231 * tests/testsuite.at: Include cxx-gram.at.
18232
18233 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 18234
676385e2
PH
18235 * src/parse-gram.y:
18236
18237 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
18238
18239 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 18240
b5480d74 182412002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
18242
18243 * src/options.h, src/options.c: Remove.
18244 * src/getargs.c (short_options, long_options): New.
18245
60491a94
AD
182462002-06-27 Akim Demaille <akim@epita.fr>
18247
18248 * data/bison.simple, data/bison.c++: Rename as...
18249 * data/yacc.c, data/lalr1.cc: these.
18250 * doc/bison.texinfo (Environment Variables): Remove.
18251
9be0c25b
AD
182522002-06-25 Raja R Harinath <harinath@cs.umn.edu>
18253
18254 * src/getargs.c (report_argmatch): Initialize strtok().
18255
1ae72863
AD
182562002-06-20 Akim Demaille <akim@epita.fr>
18257
18258 * data/bison.simple (b4_symbol_actions): New, replaces...
18259 (b4_symbol_destructor, b4_symbol_printer): these.
18260 (yysymprint): Be sure to call YYPRINT only for tokens, and using
18261 user token numbers.
18262
87542d29
AD
182632002-06-20 Akim Demaille <akim@epita.fr>
18264
18265 * data/bison.simple (yydestructor): Rename as...
18266 (yydestruct): this.
18267
1a31ed21
AD
182682002-06-20 Akim Demaille <akim@epita.fr>
18269
18270 * src/symtab.h, src/symtab.c (symbol_type_set)
18271 (symbol_destructor_set, symbol_precedence_set): The location is
18272 the last argument.
18273 Adjust all callers.
18274
e776192e
AD
182752002-06-20 Akim Demaille <akim@epita.fr>
18276
18277 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
18278 internals.
18279 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
18280 Takes a location.
18281 * src/symtab.h, src/symtab.c (symbol_class_set)
18282 (symbol_user_token_number_set): Likewise.
18283 Adjust all callers.
18284 Promote complain_at.
18285 * tests/input.at (Type Clashes): Adjust.
18286
5c1180b3
AD
182872002-06-20 Akim Demaille <akim@epita.fr>
18288
18289 * data/bison.simple (YYLEX): Fix the declaration when
18290 %pure-parser.
18291
e3170060
AD
182922002-06-20 Akim Demaille <akim@epita.fr>
18293
18294 * data/bison.simple (yysymprint): Don't print the token number,
18295 just its name.
18296 * tests/actions.at (Destructors): Rename as...
18297 (Printers and Destructors): this.
18298 Also exercise %printer.
18299
253862fd
AD
183002002-06-20 Akim Demaille <akim@epita.fr>
18301
18302 * data/bison.simple (YYDSYMPRINT): New.
18303 Use it to remove many of the #if YYDEBUG/if (yydebug).
18304
366eea36
AD
183052002-06-20 Akim Demaille <akim@epita.fr>
18306
18307 * src/symtab.h, src/symtab.c (symbol_t): printer and
18308 printer_location are new members.
18309 (symbol_printer_set): New.
18310 * src/parse-gram.y (PERCENT_PRINTER): New token.
18311 Handle its associated rule.
18312 * src/scan-gram.l: Adjust.
18313 (handle_destructor_at, handle_destructor_dollar): Rename as...
18314 (handle_symbol_code_at, handle_symbol_code_dollar): these.
18315 * src/output.c (symbol_printers_output): New.
18316 (output_skeleton): Call it.
18317 * data/bison.simple (yysymprint): New. Cannot be named yyprint
18318 since there are already many grammar files with a user `yyprint'.
18319 Replace the calls to YYPRINT to calls to yysymprint.
18320 * tests/calc.at: Adjust.
18321 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
18322 taking advantage of parser very internal details (stack size!).
18323
4f25ebb0
AD
183242002-06-20 Akim Demaille <akim@epita.fr>
18325
18326 * src/scan-gram.l: Complete the scanner with the missing patterns
18327 to pacify Flex.
18328 Use `quote' and `symbol_tag_get' where appropriate.
18329
93b68a0e
AD
183302002-06-19 Akim Demaille <akim@epita.fr>
18331
18332 * tests/actions.at (Destructors): Augment to test locations.
18333 * data/bison.simple (yydestructor): Pass it the current location
18334 if locations are enabled.
18335 Prototype only when __STDC__ or C++.
18336 Change the argument names to move into the yy name space: there is
18337 user code here.
18338
58612f1d
AD
183392002-06-19 Akim Demaille <akim@epita.fr>
18340
74310291
AD
18341 * data/bison.simple (b4_pure_if): New.
18342 Use it instead of #ifdef YYPURE.
18343
183442002-06-19 Akim Demaille <akim@epita.fr>
18345
18346 * data/bison.simple (b4_location_if): New.
58612f1d
AD
18347 Use it instead of #ifdef YYLSP_NEEDED.
18348
f25bfb75
AD
183492002-06-19 Akim Demaille <akim@epita.fr>
18350
18351 Prepare @$ in %destructor, but currently don't bind it in the
18352 skeleton, as %location use is not cleaned up yet.
18353
18354 * src/scan-gram.l (handle_dollar, handle_destructor_at)
18355 (handle_action_at): New.
18356 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
18357 a braced_code_t and a location as additional arguments.
18358 (handle_destructor_dollar): Instead of requiring `b4_eval', just
18359 unquote one when outputting `b4_dollar_dollar'.
18360 Adjust callers.
18361 * data/bison.simple (b4_eval): Remove.
18362 (b4_symbol_destructor): Adjust.
18363 * tests/input.at (Invalid @n): Adjust.
18364
c732d2c6
AD
183652002-06-19 Zack Weinberg <zack@codesourcery.com>
18366
18367 * doc/bison.texinfo: Document ability to have multiple
18368 prologue sections.
18369
8c165d89
AD
183702002-06-18 Akim Demaille <akim@epita.fr>
18371
18372 * src/files.c (compute_base_names): When computing the output file
18373 names from the input file name, strip the directory part.
18374
ca98bf57
AD
183752002-06-18 Akim Demaille <akim@epita.fr>
18376
18377 * data/bison.simple.new: Comment changes.
18378 Reported by Andreas Schwab.
18379
0bfb02ff
AD
183802002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
18381
18382 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
18383 there are no `label `yyoverflowlab' defined but not used' warnings
18384 when yyoverflow is defined.
18385
24c0aad7
AD
183862002-06-18 Akim Demaille <akim@epita.fr>
18387
18388 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
18389 new member.
18390 (symbol_destructor_set): Adjust.
18391 * src/output.c (symbol_destructors_output): Output the destructor
18392 locations.
18393 Output the symbol name.
18394 * data/bison.simple (b4_symbol_destructor): Adjust.
18395
5719c109
AD
183962002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
18397 and Akim Demaille <akim@epita.fr>
18398
18399 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
18400 what's left on the stack when the error recovery hits EOF.
18401 * tests/actions.at (Destructors): Complete to exercise this case.
18402
9280d3ef
AD
184032002-06-17 Akim Demaille <akim@epita.fr>
18404
18405 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
18406 arguments is really empty, not only equal to `[]'.
18407 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
18408 member.
18409 (symbol_destructor_set): New.
18410 * src/output.c (symbol_destructors_output): New.
18411 * src/reader.h (brace_code_t, current_braced_code): New.
18412 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
18413 (handle_dollar): Rename as...
18414 (handle_action_dollar): this.
18415 (handle_destructor_dollar): New.
18416 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
18417 (grammar_declaration): Use it.
18418 * data/bison.simple (yystos): Is always defined.
18419 (yydestructor): New.
18420 * tests/actions.at (Destructors): New.
18421 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
18422
dafdc66f
AD
184232002-06-17 Akim Demaille <akim@epita.fr>
18424
18425 * src/symlist.h, src/symlist.c (symbol_list_length): New.
18426 * src/scan-gram.l (handle_dollar, handle_at): Compute the
18427 rule_length only when needed.
18428 * src/output.c (actions_output, token_definitions_output): Output
18429 the full M4 block.
18430 * src/symtab.c: Don't access directly to the symbol tag, use
18431 symbol_tag_get.
18432 * src/parse-gram.y: Use symbol_list_free.
18433
56c47203
AD
184342002-06-17 Akim Demaille <akim@epita.fr>
18435
18436 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
18437 (symbol_list_prepend, get_type_name): Move to...
18438 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
18439 (symbol_list_prepend, symbol_list_n_type_name_get): here.
18440 Adjust all callers.
18441 (symbol_list_free): New.
18442 * src/scan-gram.l (handle_dollar): Takes a location.
18443 * tests/input.at (Invalid $n): Adjust.
18444
1e0bab92
AD
184452002-06-17 Akim Demaille <akim@epita.fr>
18446
18447 * src/reader.h, src/reader.c (symbol_list_new): Export it.
18448 (symbol_list_prepend): New.
18449 * src/parse-gram.y (%union): `list' is a new member.
18450 (symbols.1): New, replaces...
18451 (terms_to_prec.1, nterms_to_type.1): these.
18452 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
18453 Take a location as additional argument.
18454 Adjust all callers.
18455
04e60654
AD
184562002-06-15 Akim Demaille <akim@epita.fr>
18457
18458 * src/parse-gram.y: Move %token in the declaration section so that
18459 we don't depend upon CVS Bison.
18460
10e5b8bd
AD
184612002-06-15 Akim Demaille <akim@epita.fr>
18462
18463 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
18464 * src/print.c (print_core): Use it.
18465
9801d40c
AD
184662002-06-15 Akim Demaille <akim@epita.fr>
18467
18468 * src/conflicts.c (log_resolution): Accept the rule involved in
18469 the sr conflicts instead of the lookahead number that points to
18470 that rule.
18471 (flush_reduce): Accept the current lookahead vector as argument,
18472 instead of the index in LA.
18473 (resolve_sr_conflict): Accept the current number of lookahead
18474 bitset to consider for the STATE, instead of the index in LA.
18475 (set_conflicts): Adjust.
18476 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
18477
c0263492
AD
184782002-06-15 Akim Demaille <akim@epita.fr>
18479
18480 * src/state.h (state_t): Replace the `lookaheadsp' member, a
18481 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
18482 Adjust all dependencies.
18483 * src/lalr.c (initialize_lookaheads): Split into...
18484 (states_lookaheads_count, states_lookaheads_initialize): these.
18485 (lalr): Adjust.
18486
9757c359
AD
184872002-06-15 Akim Demaille <akim@epita.fr>
18488
18489 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
18490 out of...
18491 (grammar_rules_print): here.
18492 * src/reduce.c (reduce_output): Use it.
18493 * tests/reduce.at (Useless Rules, Reduced Automaton)
18494 (Underivable Rules): Adjust.
18495
6b98e4b5
AD
184962002-06-15 Akim Demaille <akim@epita.fr>
18497
18498 Copy BYacc's nice way to report the grammar.
18499
18500 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
18501 New.
18502 Don't print the rules' location, it is confusing and useless.
18503 (rule_print): Use grammar_rhs_print.
18504 * src/print.c (print_grammar): Use grammar_rules_print.
18505
6b98e4b5
AD
185062002-06-15 Akim Demaille <akim@epita.fr>
18507
18508 Complete and rationalize `useless thing' warnings.
18509
18510 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
18511 (symbol_tag_print): New.
18512 Use them everywhere in place of accessing directly the tag member.
18513 * src/gram.h, src/gram.c (rule_print): New.
18514 Use it where a rule used to be printed `by hand'.
18515 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
18516 (reduce_grammar_tables): Report the useless rules.
18517 (reduce_print): Useless things are a warning, not an error.
18518 Report it as such.
18519 * tests/reduce.at (Useless Nonterminals, Useless Rules):
18520 (Reduced Automaton, Underivable Rules): Adjust.
18521 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
18522 * tests/conflicts.at (Unresolved SR Conflicts)
18523 (Solved SR Conflicts): Adjust.
18524
ee000ba4
AD
185252002-06-15 Akim Demaille <akim@epita.fr>
18526
18527 Let symbols have a location.
18528
18529 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
18530 (getsym): Adjust.
18531 Adjust all callers.
18532 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
18533 Use location_t, not int.
18534 * src/symtab.c (symbol_check_defined): Take advantage of the
18535 location.
18536 * tests/regression.at (Invalid inputs): Adjust.
18537
8efe435c
AD
185382002-06-15 Akim Demaille <akim@epita.fr>
18539
18540 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
18541 (input): Don't try to initialize yylloc here, do it in the
18542 scanner.
18543 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
18544 * src/gram.h (rule_t): Change line and action_line into location
18545 and action_location, of location_t type.
18546 Adjust all dependencies.
18547 * src/location.h, src/location.c (empty_location): New.
18548 * src/reader.h, src/reader.c (grammar_start_symbol_set)
18549 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
18550 (grammar_current_rule_symbol_append)
18551 (grammar_current_rule_action_append): Expect a location as argument.
18552 * src/reader.c (grammar_midrule_action): Adjust to attach an
18553 action's location as dummy symbol location.
18554 * src/symtab.h, src/symtab.c (startsymbol_location): New.
18555 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
18556 the line numbers.
18557
1921f1d7
AD
185582002-06-14 Akim Demaille <akim@epita.fr>
18559
18560 Grammar declarations may be found in the grammar section.
18561
18562 * src/parse-gram.y (rules_or_grammar_declaration): New.
18563 (declarations): Each declaration may end with a semicolon, not
18564 just...
18565 (grammar_declaration): `"%union"'.
18566 (grammar): Branch to rules_or_grammar_declaration.
18567
4515534c
AD
185682002-06-14 Akim Demaille <akim@epita.fr>
18569
18570 * src/main.c (main): Invoke scanner_free.
18571
f958596b
AD
185722002-06-14 Akim Demaille <akim@epita.fr>
18573
18574 * src/output.c (m4_invoke): Extracted from...
18575 (output_skeleton): here.
18576 Free tempfile.
18577
2c569025
AD
185782002-06-14 Akim Demaille <akim@epita.fr>
18579
18580 * src/parse-gram.y (directives, directive, gram)
18581 (grammar_directives, precedence_directives, precedence_directive):
18582 Rename as...
18583 (declarations, declaration, grammar, grammar_declaration)
18584 (precedence_declaration, precedence_declarator): these.
18585 (symbol_declaration): New.
18586
592e8d4d
AD
185872002-06-14 Akim Demaille <akim@epita.fr>
18588
18589 * src/files.c (action_obstack): Remove, unused.
18590 (output_obstack): Remove it, and all its dependencies, as it is no
18591 longer needed.
18592 * src/reader.c (epilogue_set): Build the epilogue in the
18593 muscle_obstack.
18594 * src/output.h, src/output.c (muscle_obstack): Move to...
18595 * src/muscle_tab.h, src/muscle_tab.h: here.
18596 (muscle_init): Initialize muscle_obstack.
18597 (muscle_free): New.
18598 * src/main.c (main): Call it.
18599
0c15323d
AD
186002002-06-14 Akim Demaille <akim@epita.fr>
18601
18602 * src/location.h: New, extracted from...
18603 * src/reader.h: here.
18604 * src/Makefile.am (noinst_HEADERS): Merge into
18605 (bison_SOURCES): this.
18606 Add location.h.
18607 * src/parse-gram.y: Use location_t instead of Bison's.
18608 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
18609 Use location_t instead of ints.
18610
e96c9728
AD
186112002-06-14 Akim Demaille <akim@epita.fr>
18612
18613 * data/bison.simple, data/bison.c++: Be sure to restore the
18614 current #line when returning to the skeleton contents after having
18615 exposed the input file's #line.
18616
75d1fe16
AD
186172002-06-12 Akim Demaille <akim@epita.fr>
18618
18619 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
18620 eager.
18621 * tests/actions.at (Exotic Dollars): New.
18622
6c35d22c
AD
186232002-06-12 Akim Demaille <akim@epita.fr>
18624
18625 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
18626 ['"/] too eagerly.
18627 * tests/input.at (Torturing the Scanner): New.
18628
1d6412ad
AD
186292002-06-11 Akim Demaille <akim@epita.fr>
18630
18631 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
18632 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
18633 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
18634 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
18635 * src/reader.c (reader): Use it.
18636
4cdb01db
AD
186372002-06-11 Akim Demaille <akim@epita.fr>
18638
18639 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
18640 Adjust all callers.
18641 (scanner_last_string_free): New.
18642
44995b2e
AD
186432002-06-11 Akim Demaille <akim@epita.fr>
18644
18645 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
18646 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
18647 (last_string, YY_OBS_FREE): New.
18648 Use them when returning an ID.
18649
e9955c83
AD
186502002-06-11 Akim Demaille <akim@epita.fr>
18651
18652 Have Bison grammars parsed by a Bison grammar.
18653
18654 * src/reader.c, src/reader.h (prologue_augment): New.
18655 * src/reader.c (copy_definition): Remove.
18656
18657 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
18658 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
18659 (grammar_current_rule_prec_set, grammar_current_rule_check)
18660 (grammar_current_rule_symbol_append)
18661 (grammar_current_rule_action_append): Export.
18662 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
18663 (symbol_list_action_append): Remove.
18664 Hook the routines from reader.
18665 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
18666 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18667
18668 * src/reader.c (read_declarations): Remove, unused.
18669
18670 * src/parse-gram.y: Handle the epilogue.
18671 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
18672 (grammar_start_symbol_set): this.
18673 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
18674 * src/reader.c (readgram): Remove, unused.
18675 (reader): Adjust to insert eoftoken and axiom where appropriate.
18676
18677 * src/reader.c (copy_dollar): Replace with...
18678 * src/scan-gram.h (handle_dollar): this.
18679 * src/parse-gram.y: Remove `%thong'.
18680
18681 * src/reader.c (copy_at): Replace with...
18682 * src/scan-gram.h (handle_at): this.
18683
18684 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
18685 New.
18686
18687 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
18688 time being.
18689
18690 * src/reader.h, src/reader.c (grammar_rule_end): New.
18691
18692 * src/parse.y (current_type, current_class): New.
18693 Implement `%nterm', `%token' support.
18694 Merge `%term' into `%token'.
18695 (string_as_id): New.
18696 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
18697 type name.
18698
18699 * src/parse-gram.y: Be sure to handle properly the beginning of
18700 rules.
18701
18702 * src/parse-gram.y: Handle %type.
18703 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
18704
18705 * src/parse-gram.y: More directives support.
18706 * src/options.c: No longer handle source directives.
18707
18708 * src/parse-gram.y: Fix %output.
18709
18710 * src/parse-gram.y: Handle %union.
18711 Use the prologue locations.
18712 * src/reader.c (parse_union_decl): Remove.
18713
18714 * src/reader.h, src/reader.c (epilogue_set): New.
18715 * src/parse-gram.y: Use it.
18716
18717 * data/bison.simple, data/bison.c++: b4_stype is now either not
18718 defined, then default to int, or to the contents of %union,
18719 without `union' itself.
18720 Adjust.
18721 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
18722
18723 * src/output.c (actions_output): Don't output braces, as they are
18724 already handled by the scanner.
18725
18726 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
18727 characters to themselves.
18728
18729 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
18730 that the epilogue has a proper #line.
18731
18732 * src/parse-gram.y: Handle precedence/associativity.
18733
18734 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
18735 a terminal.
18736 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
18737 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
18738 at all to define terminals that cannot be emitted.
18739
18740 * src/scan-gram.l: Escape M4 characters.
18741
18742 * src/scan-gram.l: Working properly with escapes in user
18743 strings/characters.
18744
18745 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
18746 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
18747 grammar.
18748 Use more modest sizes, as for the time being the parser does not
18749 release memory, and therefore the process swallows a huge amount
18750 of memory.
18751
18752 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
18753 stricter %token grammar.
18754
18755 * src/symtab.h (associativity): Add `undef_assoc'.
18756 (symbol_precedence_set): Do nothing when passed an undef_assoc.
18757 * src/symtab.c (symbol_check_alias_consistence): Adjust.
18758
18759 * tests/regression.at (Invalid %directive): Remove, as it is now
18760 meaningless.
18761 (Invalid inputs): Adjust to the new error messages.
18762 (Token definitions): The new grammar doesn't allow too many
18763 eccentricities.
18764
18765 * src/lex.h, src/lex.c: Remove.
18766 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
18767 (copy_character, copy_string2, copy_string, copy_identifier)
18768 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
18769 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
18770 (parse_action): Remove.
18771 * po/POTFILES.in: Adjust.
18772
2e047461
AD
187732002-06-11 Akim Demaille <akim@epita.fr>
18774
cd05d13c 18775 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
18776 rule's action member: return the action as a string.
18777 Don't require `rule_length' as an argument: compute it.
18778 (grammar_current_rule_symbol_append)
18779 (grammar_current_rule_action_append): New, eved out from
18780 (readgram): here.
18781 Remove `action_flag', `rulelength', unused now.
18782
9af3fbce
AD
187832002-06-11 Akim Demaille <akim@epita.fr>
18784
18785 * src/reader.c (grammar_current_rule_prec_set).
18786 (grammar_current_rule_check): New, eved out from...
18787 (readgram): here.
18788 Remove `xaction', `first_rhs': useless.
18789 * tests/input.at (Type clashes): New.
18790 * tests/existing.at (GNU Cim Grammar): Adjust.
18791
1485e106
AD
187922002-06-11 Akim Demaille <akim@epita.fr>
18793
18794 * src/reader.c (grammar_midrule_action): New, Eved out from
18795 (readgram): here.
18796
da4160c3
AD
187972002-06-11 Akim Demaille <akim@epita.fr>
18798
18799 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
18800 New.
18801 (readgram): Use them as replacement of inlined code, crule and
18802 crule1.
18803
f6d0f937
AD
188042002-06-11 Akim Demaille <akim@epita.fr>
18805
18806 * src/reader.c (grammar_end, grammar_symbol_append): New.
18807 (readgram): Use them.
18808 Make the use of `p' as local as possible.
18809
69078d4b
AD
188102002-06-10 Akim Demaille <akim@epita.fr>
18811
18812 GCJ's parser requires the tokens to be defined before the prologue.
18813
18814 * data/bison.simple: Output the token definition before the user's
18815 prologue.
18816 * tests/regression.at (Braces parsing, Duplicate string)
18817 (Mixing %token styles): Check the output from bison.
18818 (Early token definitions): New.
18819
5e424082
AD
188202002-06-10 Akim Demaille <akim@epita.fr>
18821
18822 * src/symtab.c (symbol_user_token_number_set): Don't complain when
18823 assigning twice the same user number to a token, so that we can
18824 use it in...
18825 * src/lex.c (lex): here.
18826 Also use `symbol_class_set' instead of hand written code.
18827 * src/reader.c (parse_assoc_decl): Likewise.
18828
44536b35
AD
188292002-06-10 Akim Demaille <akim@epita.fr>
18830
18831 * src/symtab.c, src/symtab.c (symbol_class_set)
18832 (symbol_user_token_number_set): New.
18833 * src/reader.c (parse_token_decl): Use them.
18834 Use a switch instead of ifs.
18835 Use a single argument.
18836
8b9f2372
AD
188372002-06-10 Akim Demaille <akim@epita.fr>
18838
18839 Remove `%thong' support as it is undocumented, unused, duplicates
18840 `%token's job, and creates useless e-mail traffic with people who
18841 want to know what it is, why it is undocumented, unused, and
18842 duplicates `%token's job.
18843
18844 * src/reader.c (parse_thong_decl): Remove.
18845 * src/options.c (option_table): Remove "thong".
18846 * src/lex.h (tok_thong): Remove.
18847
3ae2b51f
AD
188482002-06-10 Akim Demaille <akim@epita.fr>
18849
18850 * src/symtab.c, src/symtab.c (symbol_type_set)
18851 (symbol_precedence_set): New.
18852 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
18853 (value_components_used): Remove, unused.
18854
2f1afb73
AD
188552002-06-09 Akim Demaille <akim@epita.fr>
18856
18857 Move symbols handling code out of the reader.
18858
18859 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
18860 (axiom): Move to...
18861 * src/symtab.h, src/symtab.c: here.
18862
18863 * src/gram.c (start_symbol): Remove: use startsymbol->number.
18864 * src/reader.c (startval): Rename as...
18865 * src/symtab.h, src/symtab.c (startsymbol): this.
18866 * src/reader.c: Adjust.
18867
18868 * src/reader.c (symbol_check_defined, symbol_make_alias)
18869 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18870 (token_translations_init)
18871 Move to...
18872 * src/symtab.c: here.
18873 * src/reader.c (packsymbols): Move to...
18874 * src/symtab.h, src/symtab.c (symbols_pack): here.
18875 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
18876 argument.
18877
e9bca3ad
AD
188782002-06-03 Akim Demaille <akim@epita.fr>
18879
18880 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
18881 then statements.
18882
86eff183
AD
188832002-06-03 Akim Demaille <akim@epita.fr>
18884
18885 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
18886 structs with non literals.
18887 * src/scan-skel.l: never-interactive.
18888 * src/conflicts.c (enum conflict_resolution_e): No trailing
18889 comma.
18890 * src/getargs.c (usage): Split long literal strings.
18891 Reported by Hans Aberg.
18892
717be197
AD
188932002-05-28 Akim Demaille <akim@epita.fr>
18894
18895 * data/bison.c++: Use C++ ostreams.
18896 (cdebug_): New member.
18897
670ddffd
AD
188982002-05-28 Akim Demaille <akim@epita.fr>
18899
18900 * src/output.c (output_skeleton): Be sure to allocate enough room
18901 for `/' _and_ for `\0' in full_skeleton.
18902
769b430f
AD
189032002-05-28 Akim Demaille <akim@epita.fr>
18904
18905 * data/bison.c++: Catch up with bison.simple:
18906 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18907 and Paul Eggert <eggert@twinsun.com>: `error' handing.
18908 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
18909 and popping traces.
18910
7067cb36
PH
189112002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18912
18913 * src/output.c (output_skeleton): Put an explicit path in front of
18914 the skeleton file name, rather than relying on the -I directory,
18915 to partially alleviate effects of having a skeleton file lying around
18916 in the current directory.
769b430f 18917
4a713ec2
PH
189182002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18919
769b430f 18920 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
18921 obstack_printf should be obstack_fgrow1.
18922
b408954b
AD
189232002-05-26 Akim Demaille <akim@epita.fr>
18924
18925 * src/state.h (state_t): `solved_conflicts' is a new member.
18926 * src/LR0.c (new_state): Set it to 0.
18927 * src/conflicts.h, src/conflicts.c (print_conflicts)
18928 (free_conflicts, solve_conflicts): Rename as...
18929 (conflicts_print, conflicts_free, conflicts_solve): these.
18930 Adjust callers.
18931 * src/conflicts.c (enum conflict_resolution_e)
18932 (solved_conflicts_obstack): New, used by...
18933 (log_resolution): this.
18934 Adjust to attach the conflict resolution to each state.
18935 Complete the description with the precedence/associativity
18936 information.
18937 (resolve_sr_conflict): Adjust.
18938 * src/print.c (print_state): Output its solved_conflicts.
18939 * tests/conflicts.at (Unresolved SR Conflicts)
18940 (Solved SR Conflicts): Exercise --report=all.
18941
a49aecd5
AD
189422002-05-26 Akim Demaille <akim@epita.fr>
18943
18944 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18945 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18946 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
18947 (token_number_t, item_number_as_token_number)
18948 (token_number_as_item_number, muscle_insert_token_number_table):
18949 Rename as...
18950 (symbol_number_t, item_number_as_symbol_number)
18951 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
18952 these, since it is more appropriate.
18953
5504898e
AD
189542002-05-26 Akim Demaille <akim@epita.fr>
18955
18956 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
18957 `Error:' lines.
18958 * data/bison.simple (yystos) [YYDEBUG]: New.
18959 (yyparse) [YYDEBUG]: Display the symbols which are popped during
18960 error recovery.
18961 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
18962
ec3bc396
AD
189632002-05-25 Akim Demaille <akim@epita.fr>
18964
18965 * doc/bison.texinfo (Debugging): Split into...
18966 (Tracing): this new section, its former contents, and...
18967 (Understanding): this new section.
18968 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
18969 by...
18970 (report_flag): this.
18971 Adjust all dependencies.
18972 (report_args, report_types, report_argmatch): New.
18973 (usage, getargs): Report/support -r, --report.
18974 * src/options.h
18975 (struct option_table_struct): Rename as..,
18976 (struct option_table_s): this.
18977 Rename the `set_flag' member to `flag' to match with getopt_long's
18978 struct.
18979 * src/options.c (option_table): Split verbose into an entry for
18980 %verbose, and another for --verbose.
18981 Support --report/-r, so remove -r from the obsolete --raw.
18982 * src/print.c: Attach full item sets and lookaheads reports to
18983 report_flag instead of trace_flag.
18984 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
18985
78df8250
PE
189862002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18987 and Paul Eggert <eggert@twinsun.com>
769b430f 18988
78df8250
PE
18989 * data/bison.simple (yyparse): Correct error handling to conform to
18990 POSIX and yacc. Specifically, after syntax error is discovered,
18991 do not reduce further before shifting the error token.
18992 Clean up the code a bit by removing the labels yyerrdefault,
18993 yyerrhandle, yyerrpop.
18994 * NEWS: Document the above.
18995
c0c9ea05
PH
189962002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18997
18998 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
18999 type; it isn't always big enough, since it doesn't necessarily
19000 include non-terminals.
769b430f 19001 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
19002 the latter can be removed.
19003 (yy_token_number_type): Remove, only one use.
19004 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
19005 don't use TokenNumberType as element type.
769b430f 19006
c0c9ea05
PH
19007 * tests/regression.at: Modify expected output to agree with change
19008 to yyr1 and yytranslate.
769b430f 19009
6390a83f
FK
190102002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
19011
19012 * src/reader.c (parse_action): Use copy_character instead of
19013 obstack_1grow.
19014
db7c8e9a
AD
190152002-05-13 Akim Demaille <akim@epita.fr>
19016
19017 * tests/regression.at (Token definitions): Prototype yylex and
19018 yyerror.
19019
fcc61800
PH
190202002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19021
158c687b 19022 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
19023 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
19024 32-bit arithmetic.
19025 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
19026
5683e9b2
AD
190272002-05-07 Akim Demaille <akim@epita.fr>
19028
19029 * tests/synclines.at: Be sure to prototype yylex and yyerror to
19030 avoid GCC warnings.
19031
0c2d3f4c
AD
190322002-05-07 Akim Demaille <akim@epita.fr>
19033
19034 Kill GCC warnings.
19035
19036 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
19037 over the RHS of each rule.
19038 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
19039 * src/state.h (state_t): Member `nitems' is unsigned short.
19040 * src/LR0.c (get_state): Adjust.
19041 * src/reader.c (packgram): Likewise.
19042 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
19043 `Type'.
19044 (muscle_insert_int_table): Remove, unused.
19045 (prepare_rules): Remove `max'.
19046
1565b720
AD
190472002-05-06 Akim Demaille <akim@epita.fr>
19048
19049 * src/closure.c (print_firsts): Display of the symbol tags.
19050 (bitmatrix_print): Move to...
19051 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
19052 here.
19053 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
19054
cfaee611
AD
190552002-05-06 Akim Demaille <akim@epita.fr>
19056
19057 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
19058 hash_do_for_each.
19059
458be8e0
AD
190602002-05-06 Akim Demaille <akim@epita.fr>
19061
19062 * src/LR0.c (new_state, get_state): Instead of using the global
19063 `kernel_size' and `kernel_base', have two new arguments:
19064 `core_size' and `core'.
19065 Adjust callers.
19066
a900a624
AD
190672002-05-06 Akim Demaille <akim@epita.fr>
19068
19069 * src/reader.c (packgram): No longer end `ritem' with a 0
19070 sentinel: it is not used.
19071
d4e7d3a1
AD
190722002-05-05 Akim Demaille <akim@epita.fr>
19073
19074 New experimental feature: display the lookaheads in the report and
19075 graph.
19076
19077 * src/print (print_core): When --trace-flag, display the rules
19078 lookaheads.
19079 * src/print_graph.c (print_core): Likewise.
19080 Swap the arguments.
19081 Adjust caller.
19082
39ceb25b
AD
190832002-05-05 Akim Demaille <akim@epita.fr>
19084
19085 * tests/torture.at (Many lookaheads): New test.
19086
5372019f
AD
190872002-05-05 Akim Demaille <akim@epita.fr>
19088
19089 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
19090 (GENERATE_MUSCLE_INSERT_TABLE): this.
19091 (output_int_table, output_unsigned_int_table, output_short_table)
19092 (output_token_number_table, output_item_number_table): Replace with...
19093 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
19094 (muscle_insert_short_table, muscle_insert_token_number_table)
19095 (muscle_insert_item_number_table): these.
19096 Adjust all callers.
19097 (prepare_tokens): Don't free `translations', since...
19098 * src/reader.h, src/reader.c (grammar_free): do it.
19099 Move to...
19100 * src/gram.h, src/gram.c (grammar_free): here.
19101 * data/bison.simple, data/bison.c++: b4_token_number_max is now
19102 b4_translate_max.
19103
5df5f6d5
AD
191042002-05-05 Akim Demaille <akim@epita.fr>
19105
19106 * src/output.c (output_unsigned_int_table): New.
19107 (prepare_rules): `i' is unsigned.
19108 `prhs', `rline', `r2' are unsigned int.
19109 Rename muscle `rhs_number_max' as `rhs_max'.
19110 Output muscles `prhs_max', `rline_max', and `r2_max'.
19111 Free rline and r1.
19112 * data/bison.simple, data/bison.c++: Adjust to use these muscles
19113 to compute types instead of constant types.
19114 * tests/regression.at (Web2c Actions): Adjust.
19115
b87f8b21
AD
191162002-05-04 Akim Demaille <akim@epita.fr>
19117
19118 * src/symtab.h (SALIAS, SUNDEF): Rename as...
19119 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
19120 Adjust dependencies.
19121 * src/output.c (token_definitions_output): Be sure not to output a
19122 `#define 'a'' when fed with `%token 'a' "a"'.
19123 * tests/regression.at (Token definitions): New.
19124
8bb936e4
PE
191252002-05-03 Paul Eggert <eggert@twinsun.com>
19126
19127 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
19128 for K&R C.
19129
191302002-05-03 gettextize <bug-gnu-gettext@gnu.org>
19131
19132 * Makefile.am (SUBDIRS): Remove intl.
19133 (EXTRA_DIST): Add config/config.rpath.
19134
53c71a12
AD
191352002-05-03 Akim Demaille <akim@epita.fr>
19136
19137 * data/bison.simple (m4_if): Don't output empty enums.
19138 And actually, output valid enum definitions :(.
19139
289dd0cf
AD
191402002-05-03 Akim Demaille <akim@epita.fr>
19141
19142 * configure.bat: Remove, completely obsolete.
19143 * Makefile.am (EXTRA_DIST): Adjust.
19144 Don't distribute config.rpath...
19145 * config/Makefile.am (EXTRA_DIST): Do it.
19146
db85e524
AD
191472002-05-03 Akim Demaille <akim@epita.fr>
19148
19149 * configure.in (GETTEXT_VERSION): New.
19150 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
19151
83ccf991
AD
191522002-05-03 Akim Demaille <akim@epita.fr>
19153
19154 * data/bison.simple (b4_token_enum): New.
19155 (b4_token_defines): Use it to output tokens both as #define and
19156 enums.
19157 Suggested by Paul Eggert.
19158 * src/output.c (token_definitions_output): Don't output spurious
19159 white spaces.
19160
1f418995
AD
191612002-05-03 Akim Demaille <akim@epita.fr>
19162
19163 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19164
45119f04
RA
191652002-05-02 Robert Anisko <robert@lrde.epita.fr>
19166
19167 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
19168 Update the stack class, give a try to deque as the default container.
19169
b2d52318
AD
191702002-05-02 Akim Demaille <akim@epita.fr>
19171
19172 * data/bison.simple (yyparse): Do not implement @$ = @1.
19173 (YYLLOC_DEFAULT): Adjust to do it.
19174 * doc/bison.texinfo (Location Default Action): Fix.
19175
3a8b4109
AD
191762002-05-02 Akim Demaille <akim@epita.fr>
19177
19178 * src/reader.c (parse_braces): Merge into...
19179 (parse_action): this.
19180
84614e13
AD
191812002-05-02 Akim Demaille <akim@epita.fr>
19182
19183 * configure.in (ALL_LINGUAS): Remove.
19184 * po/LINGUAS, hr.po: New.
19185
fdbcd8e2
AD
191862002-05-02 Akim Demaille <akim@epita.fr>
19187
19188 Remove the so called hairy (semantic) parsers.
19189
19190 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
19191 * src/gram.h, src/gram.c (semantic_parser): Remove.
19192 (rule_t): Remove the guard and guard_line members.
19193 * src/lex.h (token_t): remove tok_guard.
19194 * src/options.c (option_table): Remove %guard and %semantic_parser
19195 support.
19196 * src/output.c, src/output.h (guards_output): Remove.
19197 (prepare): Adjust.
19198 (token_definitions_output): Don't output the `T'
19199 tokens (???).
19200 (output_skeleton): Don't output the guards.
19201 * src/files.c, src/files.c (attrsfile): Remove.
19202 * src/reader.c (symbol_list): Remove the guard and guard_line
19203 members.
19204 Adjust dependencies.
19205 (parse_guard): Remove.
19206 * data/bison.hairy: Remove.
19207 * doc/bison.texinfo (Environment Variables): Remove occurrences of
19208 BISON_HAIRY.
19209
82b6cb3f
AD
192102002-05-02 Akim Demaille <akim@epita.fr>
19211
19212 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
19213 (parse_guard): Rename the formal argument `stack_offset' as
19214 `rule_length', which is more readable.
19215 Adjust callers.
19216 (copy_at, copy_dollar): Instead of outputting the hard coded
19217 values of $$, $n and so forth, output invocation to b4_lhs_value,
19218 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
19219 Note: this patch partially drops `semantic-parser' support: it
19220 always does `rule_length - n', where semantic parsers ought to
19221 always use `-n'.
82b6cb3f
AD
19222 * data/bison.simple, data/bison.c++ (b4_lhs_value)
19223 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
19224
6cbfbcc5
AD
192252002-05-02 Akim Demaille <akim@epita.fr>
19226
19227 * configure.in (AC_INIT): Bump to 1.49b.
19228 (AM_INIT_AUTOMAKE): Short invocation.
19229
b8548114
AD
192302002-05-02 Akim Demaille <akim@epita.fr>
19231
19232 Version 1.49a.
19233
c20cd1fa
AD
192342002-05-01 Akim Demaille <akim@epita.fr>
19235
19236 * src/skeleton.h: Remove.
19237
8a9566d4
AD
192382002-05-01 Akim Demaille <akim@epita.fr>
19239
19240 * src/skeleton.h: Fix the #endif.
19241 Reported by Magnus Fromreide.
19242
8c6d399a
PE
192432002-04-26 Paul Eggert <eggert@twinsun.com>
19244
19245 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
19246 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 19247 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 19248
2b7ed18a
RA
192492002-04-25 Robert Anisko <robert@lrde.epita.fr>
19250
19251 * src/scan-skel.l: Postprocess quadrigraphs.
19252
19253 * src/reader.c (copy_character): New function, used to output
19254 single characters while replacing `[' and `]' with quadrigraphs, to
19255 avoid troubles with M4 quotes.
19256 (copy_comment): Output characters with copy_character.
19257 (read_additionnal_code): Likewise.
19258 (copy_string2): Likewise.
19259 (copy_definition): Likewise.
19260
19261 * tests/calc.at: Exercise M4 quoting.
19262
34a89c50
AD
192632002-04-25 Akim Demaille <akim@epita.fr>
19264
19265 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
19266 between `!' and the command.
19267 Reported by Paul Eggert.
19268
0dd1580a
RA
192692002-04-24 Robert Anisko <robert@lrde.epita.fr>
19270
19271 * tests/calc.at: Exercise prologue splitting.
19272
19273 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
19274 `b4_post_prologue' instead of `b4_prologue'.
19275
19276 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
19277 muscles.
19278 (output): Free pre_prologue_obstack and post_prologue_obstack.
19279 * src/files.h, src/files.c (attrs_obstack): Remove.
19280 (pre_prologue_obstack, post_prologue_obstack): New.
19281 * src/reader.c (copy_definition): Add a parameter to specify the
19282 obstack to fill, instead of using attrs_obstack unconditionally.
19283 (read_declarations): Pass pre_prologue_obstack to copy_definition if
19284 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
19285
83c1796f
PE
192862002-04-23 Paul Eggert <eggert@twinsun.com>
19287
19288 * data/bison.simple: Remove unnecessary commentary and white
19289 space differences from 1_29-branch.
19290 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
19291
19292 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
19293 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
19294 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
19295 constructors or destructors.
19296
19297 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
19298
1207eeac
AD
192992002-04-23 Akim Demaille <akim@epita.fr>
19300
19301 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
19302 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
19303 location with columns.
19304 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
19305 All reported by Paul Eggert.
19306
78ab8f67
AD
193072002-04-22 Akim Demaille <akim@epita.fr>
19308
19309 * src/reduce.c (dump_grammar): Move to...
19310 * src/gram.h, src/gram.c (grammar_dump): here.
19311 Be sure to separate long item numbers.
19312 Don't read the members of a rule's prec if its nil.
19313
133c20e2
AD
193142002-04-22 Akim Demaille <akim@epita.fr>
19315
19316 * src/output.c (table_size, table_grow): New.
19317 (MAXTABLE): Remove, replace uses with table_size.
19318 (pack_vector): Instead of dying when the table is too big, grow it.
19319
9515e8a7
AD
193202002-04-22 Akim Demaille <akim@epita.fr>
19321
19322 * data/bison.simple (yyr1): Its type is that of a token number.
19323 * data/bison.c++ (r1_): Likewise.
19324 * tests/regression.at (Web2c Actions): Adjust.
19325
23c5a174
AD
193262002-04-22 Akim Demaille <akim@epita.fr>
19327
19328 * src/reader.c (token_translations_init): 256 is now the default
19329 value for the error token, i.e., it will be assigned another
19330 number if the user assigned 256 to one of her tokens.
19331 (reader): Don't force 256 to error.
19332 * doc/bison.texinfo (Symbols): Adjust.
19333 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
19334 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
19335 etc. instead of 10, 20, 30 (which was used to `jump' over error
19336 (256) and undefined (2)).
19337
5fbb0954
AD
193382002-04-22 Akim Demaille <akim@epita.fr>
19339
19340 Propagate more token_number_t.
19341
19342 * src/gram.h (token_number_as_item_number)
19343 (item_number_as_token_number): New.
19344 * src/output.c (GENERATE_OUTPUT_TABLE): New.
19345 Use it to create output_item_number_table and
19346 output_token_number_table.
19347 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19348 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
19349 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
19350 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
19351
4f940944
AD
193522002-04-22 Akim Demaille <akim@epita.fr>
19353
19354 * src/output.h, src/output.c (get_lines_number): Remove.
19355
3ded9a63
AD
193562002-04-19 Akim Demaille <akim@epita.fr>
19357
19358 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
19359 as Lex/Flex'.
19360 (Debugging): More details about enabling the debugging features.
19361 (Table of Symbols): Describe $$, $n, @$, and @n.
19362 Suggested by Tim Josling.
19363
e0c471a9
AD
193642002-04-19 Akim Demaille <akim@epita.fr>
19365
19366 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
19367
fecc10cd
AD
193682002-04-10 Akim Demaille <akim@epita.fr>
19369
19370 * src/system.h: Rely on HAVE_LIMITS_H.
19371 Suggested by Paul Eggert.
19372
51dec47b
AD
193732002-04-09 Akim Demaille <akim@epita.fr>
19374
19375 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
19376 full stderr, and strip it according to the bison options, instead
19377 of composing the error message from different bits.
19378 This makes it easier to check for several error messages.
19379 Adjust all the invocations.
19380 Add an invocation exercising the error token.
19381 Add an invocation demonstrating a stupid error message.
19382 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
19383 Adjust the tests.
19384 Error message are for stderr, not stdout.
19385
007a50a4
AD
193862002-04-09 Akim Demaille <akim@epita.fr>
19387
19388 * src/gram.h, src/gram.c (error_token_number): Remove, use
19389 errtoken->number.
19390 * src/reader.c (reader): Don't specify the user token number (2)
19391 for $undefined, as it uselessly prevents using it.
19392 * src/gram.h (token_number_t): Move to...
19393 * src/symtab.h: here.
19394 (state_t.number): Is a token_number_t.
19395 * src/print.c, src/reader.c: Use undeftoken->number instead of
19396 hard coded 2.
19397 (Even though this 2 is not the same as above: the number of the
19398 undeftoken remains being 2, it is its user token number which
19399 might not be 2).
19400 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
19401 `user_token_number_max'.
19402 Output `undef_token_number'.
19403 * data/bison.simple, data/bison.c++: Use them.
19404 Be sure to map invalid yylex return values to
19405 `undef_token_number'. This saves us from gratuitous SEGV.
19406
19407 * tests/conflicts.at (Solved SR Conflicts)
19408 (Unresolved SR Conflicts): Adjust.
19409 * tests/regression.at (Web2c Actions): Adjust.
19410
06446ccf
AD
194112002-04-08 Akim Demaille <akim@epita.fr>
19412
19413 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
19414 Adding #line.
19415 Remove the duplicate `typedefs'.
19416 (RhsNumberType): Fix the declaration and various other typos.
19417 Use __ofile__.
19418 * data/bison.simple: Use __ofile__.
19419 * src/scan-skel.l: Handle __ofile__.
19420
62a3e4f0
AD
194212002-04-08 Akim Demaille <akim@epita.fr>
19422
19423 * src/gram.h (item_number_t): New, the type of item numbers in
19424 RITEM. Note that it must be able to code symbol numbers as
19425 positive number, and the negation of rule numbers as negative
19426 numbers.
19427 Adjust all dependencies (pretty many).
19428 * src/reduce.c (rule): Remove this `short *' pointer: use
19429 item_number_t.
19430 * src/system.h (MINSHORT, MAXSHORT): Remove.
19431 Include `limits.h'.
19432 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
19433 (shortcpy): Remove.
19434 (MAXTABLE): Move to...
19435 * src/output.c (MAXTABLE): here.
19436 (prepare_rules): Use output_int_table to output rhs.
19437 * data/bison.simple, data/bison.c++: Adjust.
19438 * tests/torture.at (Big triangle): Move the limit from 254 to
19439 500.
19440 * tests/regression.at (Web2c Actions): Ajust.
19441
19442 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
19443 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
19444 passes, but produces negative #line number, once fixed, GCC is
19445 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
19446 C), it passes.
19447 * src/state.h (state_h): Code input lines on ints, not shorts.
19448
bb88b0fc
AD
194492002-04-08 Akim Demaille <akim@epita.fr>
19450
19451 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
19452 and then the grammar.
19453
9a636f47
AD
194542002-04-08 Akim Demaille <akim@epita.fr>
19455
19456 * src/system.h: No longer using strndup.
19457
680e8701
AD
194582002-04-07 Akim Demaille <akim@epita.fr>
19459
19460 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
19461 * src/output.c (output_table_data): Return the longest number.
19462 (prepare_tokens): Output `token_number_max').
19463 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
19464 New.
19465 Use them to define yy_token_number_type/TokenNumberType.
19466 Use this type for yytranslate.
19467 * tests/torture.at (Big triangle): Push the limit from 124 to
19468 253.
19469 * tests/regression.at (Web2c Actions): Adjust.
19470
817e9f41
AD
194712002-04-07 Akim Demaille <akim@epita.fr>
19472
19473 * tests/torture.at (Big triangle): New.
19474 (GNU AWK Grammar, GNU Cim Grammar): Move to...
19475 * tests/existing.at: here.
19476
5123689b
AD
194772002-04-07 Akim Demaille <akim@epita.fr>
19478
19479 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
19480 nritems.
19481 Adjust dependencies.
19482
f3849179
AD
194832002-04-07 Akim Demaille <akim@epita.fr>
19484
19485 * src/reader.c: Normalize increments to prefix form.
19486
bd02036a
AD
194872002-04-07 Akim Demaille <akim@epita.fr>
19488
19489 * src/reader.c, symtab.c: Remove debugging code.
19490
db8837cb
AD
194912002-04-07 Akim Demaille <akim@epita.fr>
19492
19493 Rename all the `bucket's as `symbol_t'.
19494
19495 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
19496 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
19497 * src/symtab.c, src/symtab.h (bucket): Rename as...
19498 (symbol_t): this.
19499 (symbol_list_new, bucket_check_defined, bucket_make_alias)
19500 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
19501 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19502 (buckets_new, buckets_free, buckets_do): Rename as...
19503 (symbol_list_new, symbol_check_defined, symbol_make_alias)
19504 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19505 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
19506 (symbols_new, symbols_free, symbols_do): these.
19507
72a23c97
AD
195082002-04-07 Akim Demaille <akim@epita.fr>
19509
19510 Use lib/hash for the symbol table.
19511
19512 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
19513 EOF.
19514 * src/lex.c (lex): Set the `number' member of new terminals.
19515 * src/reader.c (bucket_check_defined, bucket_make_alias)
19516 (bucket_check_alias_consistence, bucket_translation): New.
19517 (reader, grammar_free, readgram, token_translations_init)
19518 (packsymbols): Adjust.
19519 (reader): Number the predefined tokens.
19520 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
19521 for predefined tokens.
19522 * src/symtab.h (bucket): Remove all the hash table related
19523 members.
19524 * src/symtab.c (symtab): Replace by...
19525 (bucket_table): this.
19526 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19527 (buckets_new, buckets_do): New.
19528
280a38c3
AD
195292002-04-07 Akim Demaille <akim@epita.fr>
19530
19531 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
19532 (start_symbol, max_user_token_number, semantic_parser)
19533 (error_token_number): Initialize.
19534 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
19535 Initialize.
19536 (reader): Don't.
19537 (errtoken, eoftoken, undeftoken, axiom): Extern.
19538
03b31c0c
AD
195392002-04-07 Akim Demaille <akim@epita.fr>
19540
19541 * src/gram.h (rule_s): prec and precsym are now pointers
19542 to the bucket giving the priority/associativity.
19543 Member `associativity' removed: useless.
19544 * src/reduce.c, src/conflicts.c: Adjust.
19545
8b3df748
AD
195462002-04-07 Akim Demaille <akim@epita.fr>
19547
19548 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
19549 Properly escape the symbols' TAG when outputting them.
19550
e601aa1d
AD
195512002-04-07 Akim Demaille <akim@epita.fr>
19552
19553 * src/lalr.h (LA): Is a bitsetv, not bitset*.
19554
b0299a2e
AD
195552002-04-07 Akim Demaille <akim@epita.fr>
19556
19557 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
19558 (LArule): this, which is an array to rule_t*.
19559 * src/print.c, src/conflicts.c: Adjust.
19560
d7e1f00c
AD
195612002-04-07 Akim Demaille <akim@epita.fr>
19562
19563 * src/gram.h (rule_t): Rename `number' as `user_number'.
19564 `number' is a new member.
19565 Adjust dependencies.
19566 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
19567
cc9305dd
AD
195682002-04-07 Akim Demaille <akim@epita.fr>
19569
19570 As a result of the previous patch, it is no longer needed
19571 to reorder ritem itself.
19572
19573 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
19574
b0940840
AD
195752002-04-07 Akim Demaille <akim@epita.fr>
19576
19577 Be sure never to walk through RITEMS, but use only data related to
19578 the rules themselves. RITEMS should be banished.
19579
19580 * src/output.c (output_token_translations): Rename as...
19581 (prepare_tokens): this.
19582 In addition to `translate', prepare the muscles `tname' and
19583 `toknum', which were handled by...
19584 (output_rule_data): this.
19585 Remove, and move the remainder of its outputs into...
19586 (prepare_rules): this new routines, which also merges content from
19587 (output_gram): this.
19588 (prepare_rules): Be sure never to walk through RITEMS.
19589 (output_stos): Rename as...
19590 (prepare_stos): this.
19591 (output): Always invoke prepare_states, after all, just don't use it
19592 in the output if you don't need it.
19593
643a5994
AD
195942002-04-07 Akim Demaille <akim@epita.fr>
19595
19596 * src/LR0.c (new_state): Display `nstates' as the name of the
19597 newly created state.
19598 Adjust to initialize first_state and last_state if needed.
19599 Be sure to distinguish the initial from the final state.
19600 (new_states): Create the itemset of the initial state, and use
19601 new_state.
19602 * src/closure.c (closure): Now that the initial state has its
19603 items properly set, there is no need for a special case when
19604 creating `ruleset'.
19605
19606 As a result, now the rule 0, reducing to $axiom, is visible in the
19607 outputs. Adjust the test suite.
19608
19609 * tests/conflicts.at (Solved SR Conflicts)
19610 (Unresolved SR Conflicts): Adjust.
19611 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
19612 * tests/conflicts.at (S/R in initial): New.
19613
b4c4ccc2
AD
196142002-04-07 Akim Demaille <akim@epita.fr>
19615
19616 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
19617 the RHS of the rules.
19618 * src/output.c (output_gram): Likewise.
19619
bba97eb2
AD
196202002-04-07 Akim Demaille <akim@epita.fr>
19621
19622 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
19623 bucket.
19624 Adjust all dependencies.
19625 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
19626 `number' of the buckets too.
19627 * src/gram.h: Include `symtab.h'.
19628 (associativity): Move to...
19629 * src/symtab.h: here.
19630 No longer include `gram.h'.
19631
c3b407f4
AD
196322002-04-07 Akim Demaille <akim@epita.fr>
19633
19634 * src/gram.h, src/gram.c (rules_rhs_length): New.
19635 (ritem_longest_rhs): Use it.
19636 * src/gram.h (rule_t): `number' is a new member.
19637 * src/reader.c (packgram): Set it.
19638 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
19639 the end of `rules', and count them out of `nrules'.
19640 (reduce_output, dump_grammar): Adjust.
19641 * src/print.c (print_grammar): It is no longer needed to check for
19642 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
19643 * tests/reduce.at (Reduced Automaton): New test.
19644
11652ab3
AD
196452002-04-07 Akim Demaille <akim@epita.fr>
19646
19647 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
19648 lacking `+ 1' to nrules, Bison reported as useless a token if it
19649 was used solely to set the precedence of the last rule...
19650
26b23c1a
AD
196512002-04-07 Akim Demaille <akim@epita.fr>
19652
19653 * data/bison.c++, data/bison.simple: Don't output the current file
19654 name in #line, to avoid useless diffs between two identical
19655 outputs under different names.
19656
18bcecb0
AD
196572002-04-07 Akim Demaille <akim@epita.fr>
19658
19659 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
19660 Normalize loops to using `< nrules + 1', not `<= nrules'.
19661
fa770c86
AD
196622002-04-07 Akim Demaille <akim@epita.fr>
19663
19664 * TODO: Update.
19665
d9b739c3
AD
196662002-04-07 Akim Demaille <akim@epita.fr>
19667
19668 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
19669 bucket.value as bucket.number.
19670
99013900
AD
196712002-04-07 Akim Demaille <akim@epita.fr>
19672
19673 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
19674 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19675 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
19676 RHS, instead of being an index in RITEMS.
19677
e966383b
PE
196782002-04-04 Paul Eggert <eggert@twinsun.com>
19679
19680 * doc/bison.texinfo: Update copyright date.
19681 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
19682 (Symbols): Warn about running Bison in one character set,
19683 but compiling and/or running in an incompatible one.
19684 Warn about character code 256, too.
19685
196862002-04-03 Paul Eggert <eggert@twinsun.com>
19687
19688 * src/bison.data (YYSTACK_ALLOC): Depend on whether
19689 YYERROR_VERBOSE is nonzero, not whether it is defined.
19690
19691 Merge changes from bison-1_29-branch.
c307773e 19692
8d6c48b9
PE
196932002-03-20 Paul Eggert <eggert@twinsun.com>
19694
19695 Merge fixes from Debian bison_1.34-1.diff.
19696
19697 * configure.in (AC_PREREQ): 2.53.
19698
e53c6322
AD
196992002-03-20 Akim Demaille <akim@epita.fr>
19700
19701 * src/conflicts.c (log_resolution): Argument `resolution' is const.
19702
9ffbeca7
PE
197032002-03-19 Paul Eggert <eggert@twinsun.com>
19704
21db0b2a
PE
19705 * src/bison.simple (YYCOPY): New macro.
19706 (YYSTACK_RELOCATE): Use it.
19707 Remove Type arg; no longer needed. All callers changed.
19708 (yymemcpy): Remove; no longer needed.
19709
9ffbeca7
PE
19710 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
19711 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
19712
642cb8f8
AD
197132002-03-19 Akim Demaille <akim@epita.fr>
19714
19715 Test and fix the #line outputs.
19716
19717 * tests/atlocal.at (GCC): New.
19718 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 19719 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
19720 (Action synch line, Epilogue synch line): New tests.
19721 * src/reader.c (parse_union_decl): Define the muscle stype_line.
19722 * data/bison.simple, data/bison.c++: Use it.
19723
3c31a486
AD
197242002-03-19 Akim Demaille <akim@epita.fr>
19725
19726 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
19727 (Solved SR Conflicts, %expect not enough, %expect right)
19728 (%expect too much): Move to...
19729 * tests/conflicts.at: this new file.
19730
0d8bed56
AD
197312002-03-19 Akim Demaille <akim@epita.fr>
19732
19733 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19734 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
19735 that we can move to enums for instance.
19736 * src/output.c (token_definitions_output): Output a list of
19737 `token-name, token-number' instead of the #define.
19738 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
19739
9208d17f
AD
197402002-03-14 Akim Demaille <akim@epita.fr>
19741
19742 Use Gettext 0.11.1.
19743
af27eacb
RA
197442002-03-09 Robert Anisko <robert@lrde.epita.fr>
19745
19746 * data/bison.c++: Make the user able to add members to the generated
19747 parser by subclassing.
19748
9101a310
RA
197492002-03-05 Robert Anisko <robert@lrde.epita.fr>
19750
19751 * src/reader.c (read_additionnal_code): `c' should be an integer, not
19752 a character.
19753 Reported by Nicolas Tisserand and Nicolas Burrus.
19754
fff9bf0b
RA
197552002-03-04 Robert Anisko <robert@lrde.epita.fr>
19756
19757 * src/reader.c: Warn about lacking semi-colons, do not complain.
19758
64dba31e
RA
197592002-03-04 Robert Anisko <robert@lrde.epita.fr>
19760
19761 * data/bison.c++: Remove a debug line.
19762
374f5a14
RA
197632002-03-04 Robert Anisko <robert@lrde.epita.fr>
19764
19765 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
19766 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
19767 provide a default implementation.
19768
bfcf1f3a
AD
197692002-03-04 Akim Demaille <akim@epita.fr>
19770
19771 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
19772 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
19773 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
19774 * tests/semantic.at (Parsing Guards): Similarly.
19775 * src/reader.at (readgram): Complain if the last rule is not ended
19776 with a semi-colon.
19777
65ccf9fc
AD
197782002-03-04 Akim Demaille <akim@epita.fr>
19779
19780 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
19781 * src/closure.c: here.
19782 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
19783 RTC.
19784 * src/warshall.h, src/warshall.c: Remove.
19785 * tests/sets.at (Broken Closure): Adjust.
19786
d0039cbc
AD
197872002-03-04 Akim Demaille <akim@epita.fr>
19788
19789 * src/output.c (output_skeleton): tempdir is const.
19790 bytes_read is unused.
19791
345cea78
AD
197922002-03-04 Akim Demaille <akim@epita.fr>
19793
19794 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19795 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
19796 Update.
19797 From Michael Hayes.
19798
564801f7
AD
197992002-03-04 Akim Demaille <akim@epita.fr>
19800
19801 * src/closure.c (closure): `r' is unused.
19802
e5352bc7
AD
198032002-03-04 Akim Demaille <akim@epita.fr>
19804
19805 * tests/sets.at (Broken Closure): Add the ending `;'.
19806 * src/reader.at (readgram): Complain if a rule is not ended with a
19807 semi-colon.
19808
914feea9
AD
198092002-03-04 Akim Demaille <akim@epita.fr>
19810
19811 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
19812 (count_sr_conflicts): Use bitset_count.
19813 * src/reduce.c (inaccessable_symbols): Ditto.
19814 (bits_size): Remove.
19815 * src/warshall.h, src/warshall.c: Convert to bitsetv.
19816
f0250de6
AD
198172002-03-04 Akim Demaille <akim@epita.fr>
19818
19819 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
19820 * src/reduce.c: Remove the `bitset_zero's following the
19821 `bitset_create's, as now it is performed by the latter.
19822
ef017502
AD
198232002-03-04 Akim Demaille <akim@epita.fr>
19824
19825 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
19826 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
19827 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
19828 latest sources from Michael.
19829
76514394
AD
198302002-03-04 Akim Demaille <akim@epita.fr>
19831
19832 * src/output.c (output): Don't free the grammar.
19833 * src/reader.c (grammar_free): New.
19834 * src/main.c (main): Call it and don't free symtab here.
19835
55024580
AD
198362002-03-04 Akim Demaille <akim@epita.fr>
19837
19838 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
19839 before returning.
19840 Reported by Benoit Perrot.
19841
f9abaa2c
AD
198422002-03-04 Akim Demaille <akim@epita.fr>
19843
19844 Use bitset operations when possible, not loops over bits.
19845
19846 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
19847 bitset_or.
19848 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
19849 * src/reduce.c (useless_nonterminals): Formatting changes.
19850 * src/warshall.c (TC): Use bitset_or.
19851
0e721e75
AD
198522002-03-04 Akim Demaille <akim@epita.fr>
19853
19854 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
19855 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
19856 Ditto.
19857
0fb1ffb1
AD
198582002-03-04 Akim Demaille <akim@epita.fr>
19859
19860 * src/lalr.c (F): Now a bitset*.
19861 Adjust all dependencies.
19862
b86796bf
AD
198632002-03-04 Akim Demaille <akim@epita.fr>
19864
19865 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
19866 Adjust all dependencies.
19867
602bbf31
AD
198682002-03-04 Akim Demaille <akim@epita.fr>
19869
19870 * src/L0.c, src/LR0.h (nstates): Be size_t.
19871 Adjust comparisons (signed vs unsigned).
19872 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
19873 bitset*.
19874 Adjust all dependencies.
19875
d8a0245c
AD
198762002-03-04 Akim Demaille <akim@epita.fr>
19877
19878 * src/closure.c (firsts): Now, also a bitset.
19879 Adjust all dependencies.
19880 (varsetsize): Remove, now unused.
19881 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
19882
34ba9743
AD
198832002-03-04 Akim Demaille <akim@epita.fr>
19884
19885 * src/print.c: Convert to use bitset.h, not hand coded iterations
19886 over ints.
19887
ed86e78c
AD
198882002-03-04 Akim Demaille <akim@epita.fr>
19889
19890 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
19891
dfdb1797
AD
198922002-03-04 Akim Demaille <akim@epita.fr>
19893
19894 * src/closure.c (ruleset): Be a bitset.
19895 (rulesetsize): Remove.
19896
7086e707
AD
198972002-03-04 Akim Demaille <akim@epita.fr>
19898
19899 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19900 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
19901 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
19902 * src/closure.c (fderives): Be an array of bitsets.
19903
98254360
RA
199042002-02-28 Robert Anisko <robert@lrde.epita.fr>
19905
19906 * data/bison.c++: Merge the two generated headers. Insert a copyright
19907 notice in each output file.
19908
a75c057f
AD
199092002-02-28 Akim Demaille <akim@epita.fr>
19910
19911 * data/bison.c++: Copy the prologue of bison.simple to fetch
19912 useful M4 definitions, such as b4_header_guard.
19913
06b00abc
AD
199142002-02-25 Akim Demaille <akim@epita.fr>
19915
19916 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
19917 translator friendly scheme for the bgr
19918 copyright notice.
06b00abc 19919
70e7d534
AD
199202002-02-25 Akim Demaille <akim@epita.fr>
19921
19922 * src/output.c (header_output): Remove, now handled completely via
19923 M4.
19924
abe017f6
AD
199252002-02-25 Akim Demaille <akim@epita.fr>
19926
19927 * m4/m4.m4: New, from CVS Autoconf.
19928 * configure.in: Invoke it.
19929 * src/output.c (output_skeleton): Use its result instead of the
19930 hard coded name.
19931
381fb12e
AD
199322002-02-25 Akim Demaille <akim@epita.fr>
19933
19934 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
19935 Fileutils 4.1.5.
19936 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
19937 * src/output.c (output_skeleton): Use mkstemp to create a real
19938 temporary file.
19939 Move the filling of `skeleton' and its muscle to...
19940 (prepare): here.
19941 (output): Move the definition of the prologue muscle to...
19942 (prepare): here.
19943 * src/system.h (DEFAULT_TMPDIR): New.
19944
6f38107f
PE
199452002-02-14 Paul Eggert <eggert@twinsun.com>
19946
19947 Remove the support for C++ namespace cleanliness; it was
19948 causing more problems than it was curing, since it didn't work
19949 properly on some nonstandard C++ compilers. This can wait
19950 for a proper C++ parser.
19951
19952 * NEWS: Document this.
19953 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
19954 of C++, as it's treated like C now.
19955 * src/bison.simple (YYSTD): Remove.
19956 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
19957 Treat C++ just like Standard C instead of trying to support
19958 namespace cleanliness.
19959
80cce3da
AD
199602002-02-14 Akim Demaille <akim@epita.fr>
19961
19962 * tests/regression.at (else): Adjust to Andreas' change.
19963
842e8679
AD
199642002-02-14 Akim Demaille <akim@epita.fr>
19965
19966 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
19967
4bda3f10
AD
199682002-02-13 Andreas Schwab <schwab@suse.de>
19969
19970 * src/output.c (output_rule_data): Don't output NULL, it might
19971 not be defined yet.
19972
4162fa07 199732002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 19974
4162fa07
RA
19975 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
19976 (Copyright notice): Update.
b418ecd8 19977
bd16a5dc
AD
199782002-02-11 Akim Demaille <akim@epita.fr>
19979
19980 * tests/regression.at (%nonassoc and eof): Don't include
19981 nonportable headers.
19982
8d69a1a3
RA
199832002-02-08 Robert Anisko <robert@lrde.epita.fr>
19984
19985 * data/bison.c++: Correct error recovery. Make the user able to
19986 initialize the starting location.
19987
9b2d0677
AD
199882002-02-07 Akim Demaille <akim@epita.fr>
19989
19990 * tests/input.at: New.
19991
69e2658b
RA
199922002-02-07 Robert Anisko <robert@lrde.epita.fr>
19993
19994 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 19995 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
19996 directives around tables only needed for debugging.
19997
4aacc3a7
RA
199982002-02-07 Robert Anisko <robert@lrde.epita.fr>
19999
20000 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
20001 C++ parsers.
20002 (yy::b4_name::parse): Use print_.
20003
762a801e
RA
200042002-02-07 Robert Anisko <robert@lrde.epita.fr>
20005
20006 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
20007
4bb2bc3f
RA
200082002-02-07 Robert Anisko <robert@lrde.epita.fr>
20009
20010 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
20011 C++ parsers.
20012 (yy::b4_name::parse): Build verbose error messages, and use error_.
20013
6b45a3ca
RA
200142002-02-06 Robert Anisko <robert@lrde.epita.fr>
20015
20016 * data/bison.c++: Fix m4 quoting in comments.
20017
50997c6e
RA
200182002-02-06 Robert Anisko <robert@lrde.epita.fr>
20019
20020 * data/bison.c++: Adjust the parser code. Fix some muscles that were
20021 not expanded by m4.
20022
3f3eed27
AD
200232002-02-05 Akim Demaille <akim@epita.fr>
20024
20025 * data/bison.c++: Adjust to the M4 back end.
20026 More is certainly needed.
20027
be2a1a68
AD
200282002-02-05 Akim Demaille <akim@epita.fr>
20029
20030 Give a try to M4 as a back end.
20031
20032 * lib/readpipe.c: New, from wdiff.
20033 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
20034 BISON_HAIRY.
20035 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
20036 specific values. Now it is m4 that performs the lookup.
20037 * src/parse-skel.y: Remove.
20038 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
20039 * src/output.c (actions_output, guards_output)
20040 (token_definitions_output): No longer keeps track of the output
20041 line number, hence remove the second argument.
20042 (guards_output): Check against the guard member of a rule, not the
20043 action member.
20044 Adjust callers.
20045 (output_skeleton): Don't look for the skeleton location, let m4 do
20046 that.
20047 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
20048 file will be used.
20049 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
20050 (prepare): Given that for the time being changesyntax is not
20051 usable in M4, rename the muscles using `-' to `_'.
20052 Define `defines_flag', `output_parser_name' and `output_header_name'.
20053 * src/output.h (actions_output, guards_output)
20054 (token_definitions_output): Adjust prototypes.
20055 * src/scan-skel.l: Instead of scanning the skeletons, it now
20056 processes the output of m4: `__oline__' and `#output'.
20057 * data/bison.simple: Adjust to be used by M4(sugar).
20058 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
20059 to date.
20060 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
20061 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
20062 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
20063 shamelessly stolen from CVS Autoconf.
20064
beda758b
AD
200652002-02-05 Akim Demaille <akim@epita.fr>
20066
20067 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
20068 * configure.in: Check for the declarations of free and malloc.
20069 * src/muscle_tab.c: Adjust.
20070
5ece6d43
AD
200712002-02-05 Akim Demaille <akim@epita.fr>
20072
20073 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
20074 which have no values.
20075
5bb18f9a
AD
200762002-02-05 Akim Demaille <akim@epita.fr>
20077
20078 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
20079 * data/: here.
20080
894dd62e
PE
200812002-01-29 Paul Eggert <eggert@twinsun.com>
20082
20083 * src/bison.simple (YYSIZE_T): Do not define merely because
20084 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
20085 On some platforms, <alloca.h> does not declare YYSTD (size_t).
20086
82841af7
AD
200872002-01-27 Akim Demaille <akim@epita.fr>
20088
20089 Fix `%nonassoc and eof'.
20090
20091 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
20092 which were not properly copied! Replace
20093 memcpy (res->errs, src->errs, src->nerrs);
20094 with
20095 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
20096 !!!
20097 * tests/regression.at (%nonassoc and eof): Adjust to newest
20098 Autotest: `.' is not in the PATH.
20099
318b76e9
AD
201002002-01-27 Akim Demaille <akim@epita.fr>
20101
20102 * tests/sets.at (AT_EXTRACT_SETS): New.
20103 (Nullable): Use it.
20104 (Firsts): New.
20105
30d2f3d5
AD
201062002-01-26 Akim Demaille <akim@epita.fr>
20107
20108 * tests/actions.at, tests/calc.at, tests/headers.at,
20109 * tests/torture.at: Adjust to the newest Autotest which no longer
20110 forces `.' in the PATH.
20111
30f8c395
AD
201122002-01-25 Akim Demaille <akim@epita.fr>
20113
20114 * tests/regression.at (%nonassoc and eof): New.
20115 Suggested by Robert Anisko.
20116
29ae55f1
AD
201172002-01-24 Akim Demaille <akim@epita.fr>
20118
20119 Bison dumps core when trying to complain about broken input files.
20120 Reported by Cris van Pelt.
20121
20122 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
20123 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
20124 into...
20125 (Invalid inputs): Strengthen: exercise parse_percent_token.
20126
2b548aa6
RA
201272002-01-24 Robert Anisko <robert.anisko@epita.fr>
20128
20129 * src/Makefile.am: Add bison.c++.
20130 * src/bison.c++: New skeleton.
20131
bb0146c2
AD
201322002-01-21 Paolo Bonzini <bonzini@gnu.org>
20133
20134 * po/it.po: New.
20135
bec30531
AD
201362002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
20137
20138 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
20139
fc6edc45
MA
201402002-01-20 Marc Autret <marc@gnu.org>
20141
20142 * src/files.c (compute_output_file_names): Fix
20143
5e5d5415
MA
201442002-01-20 Marc Autret <marc@gnu.org>
20145
20146 * tests/output.at: New test.
20147 * src/files.c (compute_base_names): Don't map extensions when
20148 the YACC flag is set, use defaults.
20149 Reported by Evgeny Stambulchik.
20150
44ea3fbd
MA
201512002-01-20 Marc Autret <marc@gnu.org>
20152
ba0fe3c7
PE
20153 * src/system.h: Need to define __attribute__ away for non-GCC
20154 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
20155 Suggested by Albert Chin-A-Young.
20156
338963d1
TVH
201572002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
20158
20159 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
20160 canonical definition.
20161 * src/system.h: Use the canonical definition for PARAMS (avoids
20162 a conflict with the macro from lib/hash.h).
20163
c57b2479
AD
201642002-01-11 Akim Demaille <akim@epita.fr>
20165
20166 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 20167 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 20168
b85810ae
AD
201692002-01-09 Akim Demaille <akim@epita.fr>
20170
20171 * src/files.c, src/files.h (output_infix): New.
20172 (tab_extension): Remove.
20173 (compute_base_names): Compute the former, drop the latter.
20174 * src/output.c (prepare): Insert the muscles `output-infix', and
20175 `output-suffix'.
20176 * src/parse-skel.y (string, string.1): New.
20177 (section.header): Use it.
20178 (section.yacc): Remove.
20179 (prefix): Remove too.
20180 * src/scan-skel.l: Adjust.
20181 * src/bison.simple, src/bison.hairy: Adjust.
20182
cae60122
AD
201832002-01-09 Akim Demaille <akim@epita.fr>
20184
20185 * configure.in (WERROR_CFLAGS): Compute it.
20186 * src/Makefile.am (CFLAGS): Pass it.
20187 * tests/atlocal.in (CFLAGS): Idem.
20188 * src/files.c: Fix a few warnings.
20189 (get_extension_index): Remove, unused.
20190
ae404801
AD
201912002-01-08 Akim Demaille <akim@epita.fr>
20192
20193 * src/getargs.c (AS_FILE_NAME): New.
20194 (getargs): Use it to convert DOSish file names.
20195 * src/files.c (base_name): Rename as full_base_name to avoid
20196 clashes with `base_name ()'.
20197 (filename_split): New.
20198 (compute_base_names): N-th rewrite, using filename_split.
20199
22312b71
AD
202002002-01-08 Akim Demaille <akim@epita.fr>
20201
20202 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
20203 New, stolen from the Fileutils 4.1.
20204 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20205 * configure.in: Check for the presence of memrchr, and of its
20206 prototype.
20207
a67cef01
TVH
202082002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
20209
20210 * lib/hash.h (__P): Added definition for this macro.
20211 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
20212 BUILT_SOURCES, to ensure they are generated first.
20213 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
20214 %error-verbose to allow bootstrapping with bison 1.30x.
20215
2b25d624
AD
202162002-01-06 Akim Demaille <akim@epita.fr>
20217
20218 * src/reader.c (parse_braces): Don't fetch the next char, the
20219 convention is to fetch on entry.
20220 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
20221 'switch' without a following semicolon.
20222 * tests/regression.at (braces parsing): New.
20223
3460813b
AD
202242002-01-06 Akim Demaille <akim@epita.fr>
20225
20226 Bison is dead wrong in its RR conflict reports.
20227
20228 * tests/torture.at (GNU Cim Grammar): New.
20229 * src/conflicts.c (count_rr_conflicts): Fix.
20230
73784c64
AD
202312002-01-06 Akim Demaille <akim@epita.fr>
20232
20233 Creating package.m4 from configure.ac causes too many problems.
20234
20235 * tests/Makefile.am (package.m4): Create it by hand,
20236 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
20237
25d81090
AD
202382002-01-06 Akim Demaille <akim@epita.fr>
20239
20240 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
20241 skeleton.h.
20242
a9b8959e
PE
202432002-01-04 Paul Eggert <eggert@twinsun.com>
20244
20245 * doc/bison.texinfo (Debugging):
20246 Remove YYSTDERR; it's no longer defined or used.
20247 Also, s/cstdio.h/cstdio/.
20248
25d81090
AD
202492002-01-03 Akim Demaille <akim@epita.fr>
20250
20251 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
20252
1109455c
AD
202532002-01-03 Akim Demaille <akim@epita.fr>
20254
20255 * src/parse-skel.y (process_skeleton): Don't bind the parser's
20256 tracing code to --trace, wait for a better --trace option, with
20257 args.
20258
7ea5e977
AD
202592002-01-03 Akim Demaille <akim@epita.fr>
20260
20261 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
20262 The ISO C++ standard is extremely clear about it: stderr is
20263 considered a macro, not a regular symbol (see table 94 `Header
20264 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
20265 Therefore std:: does not apply to it. It still does with fprintf.
20266 Also, s/cstdio.h/cstdio/.
20267
fab5b110
AD
202682002-01-03 Akim Demaille <akim@epita.fr>
20269
20270 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
20271 for non system headers.
20272
aed7fd9b
AD
202732002-01-02 Akim Demaille <akim@epita.fr>
20274
20275 Equip the skeleton chain with location tracking, runtime trace,
20276 pure parser and scanner.
20277
20278 * src/parse-skel.y: Request a pure parser, locations, and prefix
20279 renaming.
20280 (%union): Having several members with the same type does not help
20281 type mismatches, simplify.
20282 (YYPRINT, yyprint): New.
20283 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
20284 (skel_error): this.
20285 Handle locations.
20286 * src/scan-skel.l: Adjust to these changes.
20287 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
20288 (LOCATION_PRINT, skel_control_t): New.
20289
24fad99e
AD
202902001-12-30 Akim Demaille <akim@epita.fr>
20291
20292 * src/parse-skel.y: Get rid of the shift/reduce conflict:
20293 replace `gb' with BLANKS.
20294 * src/scan-skel.l: Adjust.
20295
a4b36db4
AD
202962001-12-30 Akim Demaille <akim@epita.fr>
20297
20298 * src/system.h: We don't need nor want bcopy.
20299 Throw away MS-DOS crap: we don't need getpid.
20300 * configure.in: We don't need strndup. It was even causing
20301 problems: because Flex includes the headers *before* us,
20302 _GNU_SOURCE is not defined by config.h, and therefore strndup was
20303 not visible.
20304 * lib/xstrndup.c: New.
20305 * src/scan-skel.l: Use it.
20306 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
20307 * src/parse-skel.y: Use %directives instead of #defines.
20308
1239777d
AD
203092001-12-30 Akim Demaille <akim@epita.fr>
20310
20311 * src/skeleton.h: New.
20312 * src/output.c (output_parser, output_master_parser): Remove, dead
20313 code.
20314 * src/output.h (get_lines_number, actions_output, guards_output)
20315 (token_definitions_output): Prototype them.
20316 * src/parse-skel.y: Add the license notice.
20317 Include output.h and skeleton.h.
20318 (process_skeleton): Returns void, and takes a single parameter.
20319 * src/scan-skel.l: Add the license notice.
20320 Include skeleton.h.
20321 Don't use %option yylineno: it seems that then Flex imagines
20322 REJECT has been used, and therefore it won't reallocate its
20323 buffers (which makes no other sense to me than a bug). It results
20324 in warnings for `unused: yy_flex_realloc'.
20325
9b3add5b
RA
203262001-12-30 Robert Anisko <robert.anisko@epita.fr>
20327
20328 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20329 (MUSCLE_INSERT_PREFIX): ...to there.
20330 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20331 (MUSCLE_INSERT_PREFIX): Move from here...
20332
20333 * src/bison.hairy: Add a section directive. Put braces around muscle
20334 names. This parser skeleton is still broken, but Bison should not
20335 choke on a bad muscle 'syntax'.
20336 * src/bison.simple: Add a section directive. Put braces around muscle
20337 names.
20338
20339 * src/files.h (strsuffix, stringappend): Add declarations.
20340 (tab_extension): Add declaration.
20341 (short_base_name): Add declaration.
20342
20343 * src/files.c (strsuffix, stringappend): No longer static. These
20344 functions are used in the skeleton parser.
20345 (tab_extension): New.
20346 (compute_base_names): Use the computations done in this function
fab5b110 20347 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
20348 names.
20349 (short_base_name): No longer static.
20350
20351 * src/output.c (output_skeleton): New.
20352 (output): Disable call to output_master_parser, and give a try to
20353 a new skeleton handling system.
20354 (guards_output, actions_output): No longer static.
20355 (token_definitions_output, get_lines_number): No longer static.
20356
20357 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
20358
fab5b110 20359 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
20360 parse-skel.y.
20361
20362 * src/parse-skel.y: New file.
20363 * src/scan-skel.l: New file.
20364
b5b61c61
AD
203652001-12-29 Akim Demaille <akim@epita.fr>
20366
20367 %name-prefix is broken.
20368
20369 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
20370 Adjust all dependencies.
20371 * tests/headers.at (export YYLTYPE): Strengthen this test: use
20372 %name-prefix.
20373
20374 Renaming yylval but not yylloc is not consistent. Now we do.
20375
20376 * src/bison.simple: Prefix yylloc if used.
20377 * doc/bison.texinfo (Decl Summary): Document that.
20378
8c9a50be
AD
203792001-12-29 Akim Demaille <akim@epita.fr>
20380
20381 * doc/bison.texinfo: Promote `%long-directive' over
20382 `%long_directive'.
20383 Remove all references to fixed-output-files, yacc is enough.
20384
d99361e6
AD
203852001-12-29 Akim Demaille <akim@epita.fr>
20386
20387 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
20388 user prologue. These are defaults.
20389 * tests/actions.at (Mid-rule actions): Make sure the user can
20390 define YYDEBUG and YYERROR_VERBOSE.
20391
b9cecb91
AD
203922001-12-29 Akim Demaille <akim@epita.fr>
20393
20394 * src/output.c (header_output): Don't forget to export YYLTYPE and
20395 yylloc.
20396 * tests/headers.at (export YYLTYPE): New, make sure it does.
20397 * tests/regression.at (%union and --defines, Invalid CPP headers):
20398 Move to...
20399 * tests/headers.at: here.
20400
aea13e97
AD
204012001-12-29 Akim Demaille <akim@epita.fr>
20402
20403 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
20404
931394cb
AD
204052001-12-29 Akim Demaille <akim@epita.fr>
20406
20407 * tests/actions.at (Mid-rule actions): Output on a single line
20408 instead of several.
20409
704a47c4
AD
204102001-12-29 Akim Demaille <akim@epita.fr>
20411
20412 * doc/bison.texinfo: Formatting changes.
20413
091e20bb
AD
204142001-12-29 Akim Demaille <akim@epita.fr>
20415
20416 Don't store the token defs in a muscle, just be ready to output it
20417 on command. Now possible via `symbols'. Fixes a memory leak.
20418
20419 * src/output.c (token_definitions_output): New.
20420 (output_parser, header_output): Use it.
20421 * src/reader.c (symbols_save): Remove.
20422
cce71710
AD
204232001-12-29 Akim Demaille <akim@epita.fr>
20424
20425 * src/bison.simple: Do not provide a default for YYSTYPE and
20426 YYLTYPE before the user's prologue. Otherwise it's hardly... a
20427 default.
20428
82c035a8
AD
204292001-12-29 Akim Demaille <akim@epita.fr>
20430
20431 Mid-rule actions are simply... ignored!
20432
20433 * src/reader.c (readgram): Be sure to attach mid-rule actions to
20434 the empty-rule associated to the dummy symbol, not to the host
20435 rule.
20436 * tests/actions.at (Mid-rule actions): New.
20437
8419d367
AD
204382001-12-29 Akim Demaille <akim@epita.fr>
20439
20440 Memory leak.
20441
20442 * src/reader.c (reader): Free grammar.
20443
375d5806
AD
204442001-12-29 Akim Demaille <akim@epita.fr>
20445
20446 Memory leak.
20447
20448 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
20449 since it allocates it for each state, although only one is needed.
20450 (allocate_storage): Do it here.
20451
f51cb8ff
AD
204522001-12-29 Akim Demaille <akim@epita.fr>
20453
20454 * src/options.h, src/options.c (create_long_option_table): Rename
20455 as...
20456 (long_option_table_new): this, with a clearer prototype.
20457 (percent_table): Remove, unused,
20458 * src/getargs.c (getargs): Adjust.
20459
29e88316
AD
204602001-12-29 Akim Demaille <akim@epita.fr>
20461
20462 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
20463 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
20464 as states.
20465
b9f71f19
AD
204662001-12-29 Akim Demaille <akim@epita.fr>
20467
20468 * src/lalr.c (build_relations): Rename `states' as `states1'.
20469 Sorry, I don't understand exactly what it is, no better name...
20470
1a2b5d37
AD
204712001-12-29 Akim Demaille <akim@epita.fr>
20472
20473 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
20474 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
20475 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
20476 as rules.
20477
1cca533e
AD
204782001-12-29 Akim Demaille <akim@epita.fr>
20479
20480 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
20481 ago.
20482
c03ae966
AD
204832001-12-29 Akim Demaille <akim@epita.fr>
20484
20485 * src/reader.c, src/reader.h (user_toknums): Remove.
20486 Adjust all users to use symbols[i]->user_token_number.
20487
5a670b1e
AD
204882001-12-29 Akim Demaille <akim@epita.fr>
20489
20490 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
20491 Adjust all users to use symbols[i]->prec or ->assoc.
20492
ad949da9
AD
204932001-12-29 Akim Demaille <akim@epita.fr>
20494
20495 * src/reader.c, src/reader.h (tags): Remove.
20496 Adjust all users to use symbols[i]->tag.
20497
0e78e603
AD
204982001-12-29 Akim Demaille <akim@epita.fr>
20499
20500 * src/gram.h, src/gram.c (symbols): New, similar to state_table
20501 and rule_table.
20502 * src/reader.c (packsymbols): Fill this table.
20503 Drop sprec.
20504 * src/conflicts.c (resolve_sr_conflict): Adjust.
20505 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
20506 single table.
20507 Use symbols[i]->tag instead of tags[i].
20508
213e640e
AD
205092001-12-29 Akim Demaille <akim@epita.fr>
20510
20511 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
20512 In addition, put a comment in there, to replace...
20513 * tests/regression.at (%union and C comments): Remove.
20514
e7b8bef1
AD
205152001-12-29 Akim Demaille <akim@epita.fr>
20516
20517 * tests/regression.at (Web2c Actions): Blindly move the actual
20518 output as expected output. The contents *seem* right to me, but I
20519 can't pretend reading perfectly parser tables... Nonetheless, all
20520 the other tests pass correctly, the table look OK, even though the
20521 presence of `$axiom' is to be noted: AFAICS it is useless (but
20522 harmless).
20523
b68e7744
AD
205242001-12-29 Akim Demaille <akim@epita.fr>
20525
20526 * src/reader.c (readgram): Don't add the rule 0 if there were no
20527 rules read. In other words, add it _after_ having performed
20528 grammar sanity checks.
20529 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
20530
78d5bae9
AD
205312001-12-29 Akim Demaille <akim@epita.fr>
20532
20533 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
20534 visible, and some states have now a different number.
20535
ff442794
AD
205362001-12-29 Akim Demaille <akim@epita.fr>
20537
20538 * src/reader.c (readgram): Bind the initial rule's lineno to that
20539 of the first rule.
20540 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20541 (Solved SR Conflicts): Adjust rule 0's line number.
20542
610ab194
AD
205432001-12-29 Akim Demaille <akim@epita.fr>
20544
20545 Fix the `GAWK Grammar' failure.
20546
20547 * src/LR0.c (final_state): Initialize to -1 so that we do compute
20548 the reductions of the first state which was mistakenly confused
20549 with the final state because precisely final_state was initialized
20550 to 0.
20551 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
20552 now noticed by Bison.
20553 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
20554 have a reduction on $default.
20555
29d29c8f
AD
205562001-12-29 Akim Demaille <akim@epita.fr>
20557
20558 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
20559 rule line numbers.
20560 * src/closure.c (print_closure): Likewise.
20561 * src/derives.c (print_derives): Likewise.
20562 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
20563 now.
20564
7c6b64d0
AD
205652001-12-29 Akim Demaille <akim@epita.fr>
20566
20567 * src/lalr.c (lookaheads_print): New.
20568 (lalr): Call it when --trace-flag.
20569 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
20570 are dumped.
20571
3d4daee3
AD
205722001-12-29 Akim Demaille <akim@epita.fr>
20573
20574 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
20575 when walking through ritem, even via rule->rhs.
20576 * src/reduce.c (dump_grammar, useful_production, reduce_output)
20577 (useful_production, useless_nonterminals): Likewise.
20578 (reduce_grammar_tables): Likewise, plus update nritems.
20579 * src/nullable.c (set_nullable): Likewise.
20580 * src/lalr.c (build_relations): Likewise.
20581 * tests/sets.at (Nullable): Adjust.
20582 Fortunately, now, the $axiom is no longer nullable.
20583
9e7f6bbd
AD
205842001-12-29 Akim Demaille <akim@epita.fr>
20585
20586 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
20587 the 0-sentinel.
20588 * src/gram.c (ritem_longest_rhs): Likewise.
20589 * src/reduce.c (nonterminals_reduce): Likewise.
20590 * src/print_graph.c (print_graph): Likewise.
20591 * src/output.c (output_rule_data): Likewise.
20592 * src/nullable.c (set_nullable): Likewise.
20593
255ef638
AD
205942001-12-29 Akim Demaille <akim@epita.fr>
20595
20596 * src/output.c: Comment changes.
20597
0d8a7363
AD
205982001-12-27 Paul Eggert <eggert@twinsun.com>
20599
20600 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
20601 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
20602 Sparc, as they were causing more porting problems than the
20603 (minor) performance improvement was worth.
20604
20605 Also, catch up with 1.31's YYSTD.
20606
3db472b9
AD
206072001-12-27 Akim Demaille <akim@epita.fr>
20608
20609 * src/output.c (output_gram): Rely on nritems, not the
20610 0-sentinel. See below.
20611 Use -1 as separator, not 0.
20612 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
20613 Rely on -1 as separator in yyrhs, instead of 0.
20614 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
20615 twice `Now at end of input', therefore there are two lines less to
20616 expect.
20617
b365aa05
AD
206182001-12-27 Akim Demaille <akim@epita.fr>
20619
20620 * tests/regression.at (Unresolved SR Conflicts):
20621 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
20622 below.
20623
30171f79
AD
206242001-12-27 Akim Demaille <akim@epita.fr>
20625
20626 * src/LR0.c (new_state): Recognize the final state by the fact it
20627 is reached by eoftoken.
20628 (insert_start_shifting_state, insert_eof_shifting_state)
20629 (insert_accepting_state, augment_automaton): Remove, since now
20630 these states are automatically computed from the initial state.
20631 (generate_states): Adjust.
20632 * src/print.c: When reporting a rule number to the user, substract
20633 1, so that the axiom rule is rule 0, and the first user rule is 1.
20634 * src/reduce.c: Likewise.
20635 * src/print_graph.c (print_core): For the time being, just as for
20636 the report, depend upon --trace-flags to dump the full set of
20637 items.
20638 * src/reader.c (readgram): Once the grammar read, insert the rule
20639 0: `$axiom: START-SYMBOL $'.
20640 * tests/set.at: Adjust: rule 0 is now displayed, and since the
20641 number of the states has changed (the final state is no longer
20642 necessarily the last), catch up.
20643
75142d45
AD
206442001-12-27 Akim Demaille <akim@epita.fr>
20645
20646 Try to make the use of the eoftoken valid. Given that its value
20647 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
20648 is used instead of > 0 where appropriate, (ii), depend upon nritems
20649 instead of the 0-sentinel.
20650
20651 * src/gram.h, src/gram.c (nritems): New.
20652 Expected to be duplication of nitems, but for the time being...
20653 * src/reader.c (packgram): Assert nritems and nitems are equal.
20654 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
20655 * src/closure.c (print_closure, print_fderives): Likewise.
20656 * src/gram.c (ritem_print): Likewise.
20657 * src/print.c (print_core, print_grammar): Likewise.
20658 * src/print_graph.c: Likewise.
20659
b7c49edf
AD
206602001-12-27 Akim Demaille <akim@epita.fr>
20661
20662 * src/main.c (main): If there are complains after grammar
20663 reductions, then output the report anyway if requested, then die.
20664 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
20665 * src/reader.c (eoftoken): New.
20666 (parse_token_decl): If the token being defined has value `0', it
20667 is the eoftoken.
20668 (packsymbols): No longer hack `tags' to insert `$' by hand.
20669 Be sure to preserve the value of the eoftoken.
20670 (reader): Make sure eoftoken is defined.
20671 Initialize nsyms to 0: now eoftoken is created just like the others.
20672 * src/print.c (print_grammar): Don't special case the eof token.
20673 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
20674 lie anyway, albeit pleasant.
20675 * tests/calc.at: Exercise error messages with eoftoken.
20676 Change the grammar so that empty input is invalid.
20677 Adjust expectations.
20678 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
20679
ec2da99f
AD
206802001-12-27 Akim Demaille <akim@epita.fr>
20681
20682 * configure.in: Check the protos of strchr ans strspn.
20683 Replace strchr if needed.
20684 * src/system.h: Provide the protos of strchr, strspn and memchr if
20685 missing.
20686 * lib/strchr.c: New.
20687 * src/reader.c (symbols_save): Use strchr.
20688
8adfa272
AD
206892001-12-27 Akim Demaille <akim@epita.fr>
20690
20691 * src/print.c, src/print_graph.c (escape): New.
20692 Use it to quote the TAGS outputs.
20693 * src/print_graph.c (print_state): Now errors are in red, and
20694 reductions in green.
20695 Prefer high to wide: output the state number on a line of its own.
20696
80dac38c
AD
206972001-12-27 Akim Demaille <akim@epita.fr>
20698
20699 * src/state.h, src/state.c (reductions_new): New.
20700 * src/LR0.c (set_state_table): Let all the states have a
20701 `reductions', even if reduced to 0.
20702 (save_reductions): Adjust.
20703 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
20704 * src/print.c (print_reductions, print_actions): Adjust.
20705 * src/output.c (action_row): Adjust.
20706
2cec70b9
AD
207072001-12-27 Akim Demaille <akim@epita.fr>
20708
20709 * src/state.h, src/state.c (errs_new, errs_dup): New.
20710 * src/LR0.c (set_state_table): Let all the states have an errs,
20711 even if reduced to 0.
20712 * src/print.c (print_errs, print_reductions): Adjust.
20713 * src/output.c (output_actions, action_row): Adjust.
20714 * src/conflicts.c (resolve_sr_conflict): Adjust.
20715
13ca549a
AD
207162001-12-27 Akim Demaille <akim@epita.fr>
20717
20718 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
20719
5092aba5
AD
207202001-12-27 Akim Demaille <akim@epita.fr>
20721
20722 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
20723 * src/print.c: here.
20724 (lookaheadset, shiftset): New, used as additional storage by
20725 print_reductions.
20726 (print_results): Adjust.
20727 (print_shifts, print_gotos, print_errs): New, extracted from...
20728 (print_actions): here.
20729 * src/print_graph.c (print_actions): Remove dead code.
20730
11e2beca
AD
207312001-12-27 Akim Demaille <akim@epita.fr>
20732
20733 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
20734 `$n' and `@n'.
20735
dac3c910
AD
207362001-12-27 Akim Demaille <akim@epita.fr>
20737
20738 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
20739 (build_relations): Adjust.
20740
d0b0fefa
AD
207412001-12-27 Akim Demaille <akim@epita.fr>
20742
20743 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
20744 duplication.
20745
adc8c848
AD
207462001-12-27 Akim Demaille <akim@epita.fr>
20747
20748 * src/reader.c (packgram): Catch nitems overflows.
20749
14d293ac
AD
207502001-12-27 Akim Demaille <akim@epita.fr>
20751
20752 * src/files.c, src/files.h (guard_obstack): Remove.
20753 * src/output.c (output): Adjust.
20754 * src/reader.c (parse_braces): New, factoring...
20755 (copy_action, copy_guard): these two which are renamed as...
20756 (parse_action, parse_guard): these.
20757 As a voluntary consequence, using braces around guards is now
20758 mandatory.
20759
f499b062
AD
207602001-12-27 Akim Demaille <akim@epita.fr>
20761
20762 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
20763 * src/reader.c (symbol_list): `guard' and `guard_line' are new
20764 members.
20765 (symbol_list_new): Adjust.
20766 (copy_action): action_line is the first line, not the last.
20767 (copy_guard): Just as for actions, store the `action' only, not
20768 the switch/case/break flesh.
20769 Don't parse the user action that might follow the guard, let...
20770 (readgram): do it, i.e., now, there can be an action after a
20771 guard.
20772 In other words the guard is just explicitly optional.
20773 (packgram): Adjust.
20774 * src/output.c (guards_output): New.
20775 (output_parser): Call it when needed.
20776 (output): Also free the guard and attrs obstacks.
20777 * src/files.c, src/files.h (obstack_save): Remove.
20778 (output_files): Remove.
20779 As a result, if one needs the former `.act' file, using an
20780 appropriate skeleton which requires actions and guards is now
20781 required.
20782 * src/main.c (main): Adjust.
20783 * tests/semantic.at: New.
20784 * tests/regression.at: Use `input.y' as input file name.
20785 Avoid 8+3 problems by requiring input.c when the test needs the
20786 parser.
20787
d945f5cd
AD
207882001-12-27 Akim Demaille <akim@epita.fr>
20789
20790 * src/reader.c (symbol_list_new): Be sure to initialize all the
20791 fields.
20792
d200e455
AD
207932001-12-27 Akim Demaille <akim@epita.fr>
20794
20795 All the hacks using a final pseudo state are now useless.
20796
20797 * src/LR0.c (set_state_table): state_table holds exactly nstates.
20798 * src/lalr.c (nLA): New.
20799 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
20800 instead of lookaheadsp from the pseudo state (nstate + 1).
20801
f9507c28
AD
208022001-12-27 Akim Demaille <akim@epita.fr>
20803
20804 * src/output.c (action_row, token_actions): Use a state_t instead
20805 of a integer, and nlookaheads instead of the following state's
20806 lookaheadsp.
20807
065fbd27
AD
208082001-12-27 Akim Demaille <akim@epita.fr>
20809
20810 * src/conflicts.c (log_resolution, flush_shift)
20811 (resolve_sr_conflict, set_conflicts, solve_conflicts)
20812 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
20813 (conflicts_print, print_reductions): Use a state_t instead of an
20814 integer when referring to a state.
20815 As much as possible, depend upon nlookaheads, instead of the
20816 `lookaheadsp' member of the following state (since lookaheads of
20817 successive states are successive, the difference between state n + 1
20818 and n served as the number of lookaheads for state n).
20819 * src/lalr.c (add_lookback_edge): Likewise.
20820 * src/print.c (print_core, print_actions, print_state)
20821 (print_results): Likewise.
20822 * src/print_graph.c (print_core, print_actions, print_state)
20823 (print_graph): Likewise.
20824 * src/conflicts.h: Adjust.
20825
1b177bd7
AD
208262001-12-27 Akim Demaille <akim@epita.fr>
20827
20828 * src/bison.hairy: Formatting/comment changes.
20829 ANSIfy.
20830 Remove `register' indications.
20831 Add plenty of `static'.
20832
7742ddeb
AD
208332001-12-27 Akim Demaille <akim@epita.fr>
20834
20835 * src/output.c (prepare): Drop the muscle `ntbase' which
20836 duplicates ntokens.
20837 * src/bison.simple: Formatting/comment changes.
20838 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
20839 is an undocumented synonym.
20840
1fa14068
AD
208412001-12-22 Akim Demaille <akim@epita.fr>
20842
20843 * src/output.c (output_table_data): Change the prototype to use
20844 `int' for array ranges: some invocations do pass an int, not a
20845 short.
20846 Reported by Wayne Green.
20847
b9752825
AD
208482001-12-22 Akim Demaille <akim@epita.fr>
20849
20850 Some actions of web2c.y are improperly triggered.
20851 Reported by Mike Castle.
20852
20853 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
20854 * tests/regression.at (Web2c): Rename as...
20855 (Web2c Report): this.
20856 (Web2c Actions): New.
20857
776209d6
AD
208582001-12-22 Akim Demaille <akim@epita.fr>
20859
20860 Reductions in web2c.y are improperly reported.
20861 Reported by Mike Castle.
20862
20863 * src/conflicts.c (print_reductions): Fix.
20864 * tests/regression.at (Web2c): New.
20865
275fc3ad
AD
208662001-12-18 Akim Demaille <akim@epita.fr>
20867
20868 Some host fail on `assert (!"foo")', which expands to
20869 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
20870 Reported by Nelson Beebee.
20871
20872 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
20873 `#define it_succeeded 0' and `assert (it_succeeded)'.
20874
897668ee
MA
208752001-12-17 Marc Autret <autret_m@epita.fr>
20876
20877 * src/bison.simple: Don't hard code the skeleton line and filename.
20878 * src/output.c (output_parser): Rename 'line' as 'output_line'.
20879 New line counter 'skeleton_line' (skeleton-line muscle).
20880
ab3399e0
PE
208812001-12-17 Paul Eggert <eggert@twinsun.com>
20882
20883 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
20884 YYDEBUG must be defined to a nonzero value.
20885
20886 * src/bison.simple (yytname): Do not assume that the user defines
20887 YYDEBUG to a properly parenthesized expression.
20888
3877f72b
AD
208892001-12-17 Akim Demaille <akim@epita.fr>
20890
20891 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
20892 nlookaheads is a new member.
20893 Adjust all users.
20894 * src/lalr.h (nlookaheads): Remove this orphan declaration.
20895 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
20896 state.
776209d6 20897
331dbc1b
AD
208982001-12-17 Akim Demaille <akim@epita.fr>
20899
20900 * src/files.h, src/files.c (open_files, close_files): Remove.
20901 * src/main.c (main): Don't open/close files, nor invoke lex_free,
20902 let...
20903 * src/reader.c (reader): Do it.
776209d6 20904
be750e4c
AD
209052001-12-17 Akim Demaille <akim@epita.fr>
20906
20907 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 20908
709ae8c6
AD
209092001-12-17 Akim Demaille <akim@epita.fr>
20910
20911 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
20912 (flush_reduce): New.
20913 (resolve_sr_conflict): Adjust.
776209d6 20914
f87685c3
AD
209152001-12-17 Akim Demaille <akim@epita.fr>
20916
20917 * src/output.c (output_obstack): Be static and rename as...
20918 (format_obstack): this, to avoid any confusion with files.c's
20919 output_obstack.
20920 * src/reader.h (muscle_obstack): Move to...
20921 * src/output.h: here, since it's defined in output.c.
20922
837491d8
AD
209232001-12-17 Akim Demaille <akim@epita.fr>
20924
20925 * src/output.c (action_row, save_column, default_goto)
20926 (sort_actions, matching_state, pack_vector): Better variable
20927 locality.
20928
796d61fb
AD
209292001-12-17 Akim Demaille <akim@epita.fr>
20930
20931 * src/output.c: Various formatting changes.
776209d6 20932
64d15509
AD
209332001-12-17 Akim Demaille <akim@epita.fr>
20934
20935 * src/files.c (output_files): Free the output_obstack.
20936 * src/main.c (main): Call print and print_graph conditionally.
20937 * src/print.c (print): Work unconditionally.
20938 * src/print_graph.c (print_graph): Work unconditionally.
20939 * src/conflicts.c (log_resolution): Output only if verbose_flag.
20940
fbc8ecb7
MA
209412001-12-16 Marc Autret <autret_m@epita.fr>
20942
20943 * src/output.c (actions_output): Fix. When we use %no-lines,
20944 there is one less line per action.
20945
f0440388
MA
209462001-12-16 Marc Autret <autret_m@epita.fr>
20947
20948 * src/bison.simple: Remove a useless #line directive.
20949 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
20950 * src/output.c (get_lines_number): New.
776209d6 20951 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
20952 output muscles.
20953 Fix line numbering.
20954 (actions_output): Computes the number of lines taken by actions.
20955 (output_master_parser): Insert new skeleton which is the name of
20956 the output parser file name.
20957
a79986b8
MA
209582001-12-15 Marc Autret <autret_m@epita.fr>
20959
20960 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
20961
4ec8e00f
MA
209622001-12-15 Marc Autret <autret_m@epita.fr>
20963
20964 * src/output.c (output_gram): Keep track of the hairy one.
20965
1a4648ff
AD
209662001-12-15 Akim Demaille <akim@epita.fr>
20967
20968 Make `make distcheck' work.
20969
20970 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
20971 system.h which uses libgettext.h.
20972
9c2c67e6
AD
209732001-12-15 Akim Demaille <akim@epita.fr>
20974
20975 * src/nullable.c (set_nullable): Useless rules must be skipped,
20976 otherwise, since we range over their symbols, we might look at a
20977 nonterminal which no longer ``exists'', i.e., it is not counted in
20978 `nvars', hence we overflow our arrays.
20979
93ede233
AD
209802001-12-15 Akim Demaille <akim@epita.fr>
20981
20982 The header can also be produced directly, without any obstack!
20983 Yahoo!
20984
20985 * src/files.c, src/files.h (defines_obstack): Remove.
20986 (compute_header_macro): Global.
20987 (defines_obstack_save): Remove.
20988 * src/reader.c (parse_union_decl): No longer output to
20989 defines_obstack: its content can be found in the `stype' muscle
20990 anyway.
20991 (output_token_translations): Merge into...
20992 (symbols_output): this.
20993 Rename as...
20994 (symbols_save): this.
20995 (reader): Adjust.
20996 * src/output.c (header_output): New.
20997 (output): Call it.
20998
2666f928
AD
209992001-12-15 Akim Demaille <akim@epita.fr>
21000
21001 * src/reader.c (parse_union_decl): Instead of handling two obstack
21002 simultaneously, use one to define the `stype' muscle, and use the
21003 value of the latter to fill defines_obstack.
21004 (copy_comment): Remove.
21005 (copy_comment2): Work for a single obstack.
21006 Rename as...
21007 (copy_comment): this.
21008
428046f8
AD
210092001-12-15 Akim Demaille <akim@epita.fr>
21010
21011 * src/lex.c, src/lex.h (xgetc): No longer static.
21012 * src/reader.c (parse_union_decl): Revamp.
21013
ea52d706
AD
210142001-12-15 Akim Demaille <akim@epita.fr>
21015
21016 Still making progress in separating Bison into (i) input, (ii)
21017 process, (iii) output: now we can directly output the parser file
21018 without using table_obstack at all.
21019
21020 * src/files.c, src/files.h (table_obstack): Bye bye.
21021 (parser_file_name): New.
21022 * src/files.c (compute_output_file_names): Compute it.
21023 * src/output.c (actions_output, output_parser)
21024 (output_master_parser): To a file instead of an obstack.
21025
3f96f4dc
AD
210262001-12-15 Akim Demaille <akim@epita.fr>
21027
21028 Attach actions to rules, instead of pre-outputting them to
21029 actions_obstack.
21030
21031 * src/gram.h (rule_t): action and action_line are new members.
21032 * src/reader.c (symbol_list): Likewise.
21033 (copy_action): Save the actions within the rule.
21034 (packgram): Save them in rule_table.
21035 * src/output.c (actions_output): New.
21036 (output_parser): Use it on `%%actions'.
21037 (output_rule_data): Don't free rule_table.
21038 (output): Do it.
21039 (prepare): Don't save the `action' muscle.
21040 * src/bison.simple: s/%%action/%%actions/.
21041
51576fb3
AD
210422001-12-15 Akim Demaille <akim@epita.fr>
21043
21044 * src/reader.c (copy_action): When --yacc, don't append a `;'
21045 to the user action: let it fail if lacking.
dee049eb 21046 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 21047
2648a72d
AD
210482001-12-14 Akim Demaille <akim@epita.fr>
21049
21050 * src/lex.c (literalchar): Simply return the char you decoded, non
21051 longer mess around with obstacks and int pointers.
21052 Adjust all callers.
21053
92790e5b
AD
210542001-12-14 Akim Demaille <akim@epita.fr>
21055
21056 * src/lex.c (literalchar): Don't escape the special characters,
21057 just decode them, and keep them as char (before, eol was output as
21058 the 2 char string `\n' etc.).
21059 * src/output.c (output_rule_data): Use quotearg to output the
21060 token strings.
21061
927c1557
PE
210622001-12-13 Paul Eggert <eggert@twinsun.com>
21063
21064 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
21065 Do not infringe on the global user namespace when using C++.
21066 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
21067 All uses of `fprintf' and `stderr' changed.
21068
21069 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
21070
ed8e1f68
AD
210712001-12-13 Akim Demaille <akim@epita.fr>
21072
21073 The computation of nullable is broken: it doesn't handle empty
21074 RHS's properly.
21075
21076 * tests/torture.at (GNU AWK Grammar): New.
21077 * tests/sets.at (Nullable): New.
21078 * src/nullable.c (set_nullable): Instead of blindly looping over
21079 `ritems', loop over the rules, and then over their rhs's.
21080
21081 Work around Autotest bugs.
21082
21083 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
21084 frame, because Autotest understand lines starting with a `+' as
21085 traces from the shell. Then, they are not processed properly.
21086 Admittedly an Autotest bug, but we don't have time to wait for
21087 Autotest to catch up.
21088 * tests/regression.at (Broken Closure): Adjust to the new table
21089 frames.
21090 Move to...
21091 * tests/sets.at: here.
21092
cb581495
AD
210932001-12-13 Akim Demaille <akim@epita.fr>
21094
21095 * src/closure.c (closure): Use nrules instead of playing tricks
21096 with BITS_PER_WORD.
21097
2e729273
AD
210982001-12-13 Akim Demaille <akim@epita.fr>
21099
21100 * src/print.c (print_actions): Output the handling of `$' as the
21101 traces do: shifting the token EOF. Before EOF was treated as a
21102 nonterminal.
21103 * tests/regression.at: Adjust some tests.
21104 * src/print_graph.c (print_core): Complete the set of items via
21105 closure. The next-to-final and final states are still unsatisfying,
21106 but that's to be addressed elsewhere.
21107 No longer output the rule numbers, but do output the state number.
21108 A single loop for the shifts + gotos is enough, but picked a
21109 distinct color for each.
21110 (print_graph): Initialize and finalize closure.
21111
107f7dfb
AD
211122001-12-13 Akim Demaille <akim@epita.fr>
21113
21114 * src/reader.c (readgram): Remove dead code, an strip useless
21115 braces.
21116 (get_type): Remove, unused.
21117
9b53a24f
AD
211182001-12-12 Akim Demaille <akim@epita.fr>
21119
21120 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
21121 on that of lib/error.c.
21122
dbfb6dcd
AD
211232001-12-12 Akim Demaille <akim@epita.fr>
21124
21125 Some hosts don't like `/' in includes.
21126
21127 * src/system.h: Include libgettext.h without qualifying the path.
21128 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
21129 $(top_srcdir).
21130
c25fb648
MA
211312001-12-11 Marc Autret <autret_m@epita.fr>
21132
21133 * src/output.c (output_parser): Remove useless muscle.
21134
710ddc4f
MA
211352001-12-11 Marc Autret <autret_m@epita.fr>
21136
21137 * src/bison.simple: Remove #line just before %%epilogue. It
21138 is now handled in ...
21139 * src/reader.c (read_additionnal_code): Add the output of a
21140 #line for the epilogue.
21141
e83d80b8
MA
211422001-12-10 Marc Autret <autret_m@epita.fr>
21143
927c1557 21144 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
21145 replace precedent remove.
21146 * src/bison.simple: Remove #line before %%prologue because
21147 %%input-line is wrong at this time.
21148
971d5158
MA
211492001-12-10 Marc Autret <autret_m@epita.fr>
21150
21151 * src/reader.c (symbols_output): Clean up.
927c1557 21152 * src/output.c (output_gram, output): Clean up.
971d5158 21153
5edafffd
AD
211542001-12-10 Akim Demaille <akim@epita.fr>
21155
21156 * src/lalr.c (initialize_lookaheads): New. Extracted from...
21157 * src/LR0.c (set_state_table): here.
21158 * src/lalr.c (lalr): Call it.
21159
0279f8e9
AD
211602001-12-10 Akim Demaille <akim@epita.fr>
21161
21162 * src/state.h (shifts): Remove the `number' member: shifts are
21163 attached to state, hence no longer need to be labelled with a
21164 state number.
21165
190c4f5f
AD
211662001-12-10 Akim Demaille <akim@epita.fr>
21167
21168 Now that states have a complete set of members, the linked list of
21169 shifts is useless: just fill directly the state's shifts member.
21170
21171 * src/state.h (shifts): Remove the `next' member.
21172 * src/LR0.c (first_state, last_state): Remove.
21173 Adjust the callers.
21174 (augment_automaton): Don't look for the shifts that must be added
21175 a shift on EOF: it is those of the state we looked for! But now,
21176 since shifts are attached, it is no longer needed to looking
21177 merely by its id: its number.
21178
2a73b93d
AD
211792001-12-10 Akim Demaille <akim@epita.fr>
21180
21181 * src/LR0.c (augment_automaton): Better variable locality.
21182 Remove an impossible branch: if there is a state corresponding to
21183 the start symbol being shifted, then there is shift for the start
21184 symbol from the initial state.
21185
74392f6a
AD
211862001-12-10 Akim Demaille <akim@epita.fr>
21187
21188 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
21189 only when appropriate: when insert_start_shifting_state' is not
21190 invoked.
21191 * tests/regression.at (Rule Line Numbers): Adjust.
21192
37c82725
AD
211932001-12-10 Akim Demaille <akim@epita.fr>
21194
21195 * src/LR0.c (augment_automaton): Now that all states have shifts,
21196 merge the two cases addition shifts to the initial state.
21197
6a164e0c
AD
211982001-12-10 Akim Demaille <akim@epita.fr>
21199
21200 * src/lalr.c (set_state_table): Move to...
21201 * src/LR0.c: here.
21202 * src/lalr.c (lalr): Don't call it...
21203 * src/LR0.c (generate_states): do it.
21204 * src/LR0.h (first_state): Remove, only the table is used.
21205
7215de24
AD
212062001-12-10 Akim Demaille <akim@epita.fr>
21207
21208 * src/LR0.h (first_shift, first_reduction): Remove.
21209 * src/lalr.c: Don't use first_shift: find shifts through the
21210 states.
21211
80e25d4d
AD
212122001-12-10 Akim Demaille <akim@epita.fr>
21213
21214 * src/LR0.c: Attach shifts to states as soon as they are
21215 computed.
21216 * src/lalr.c (set_state_table): Instead of assigning shifts to
21217 state, just assert that the mapping was properly done.
21218
0ab3728b
AD
212192001-12-10 Akim Demaille <akim@epita.fr>
21220
21221 * src/LR0.c (insert_start_shift): Rename as...
21222 (insert_start_shifting_state): this.
21223 (insert_eof_shifting_state, insert_accepting_state): New.
21224 (augment_automaton): Adjust.
21225 Better locality of the variables.
21226 When looking if the start_symbol is shifted from the initial
21227 state, using `while (... symbol != start_symbol ...)' sounds
21228 better than `while (... symbol < start_symbol ...)': If fail
21229 to see how the order between symbols could be relevant!
21230
78af9bbc
AD
212312001-12-10 Akim Demaille <akim@epita.fr>
21232
21233 * src/getargs.h: Don't declare `spec_name_prefix' and
21234 `spec_file_prefix', declared by src/files.h.
21235 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
21236 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
21237 * src/output.c (prepare): Adjust.
21238 * src/reader.c (symbols_output): Likewise.
21239 * src/vmsgetargs.c: Vaguely adjust, but who cares?
21240
bdef2a41
AD
212412001-12-10 Akim Demaille <akim@epita.fr>
21242
21243 * src/muscle_tab.c (muscle_init): NULL is a better default than
21244 `"0"'.
21245
3735969c
AD
212462001-12-10 Akim Demaille <akim@epita.fr>
21247
21248 * src/reader.c (reader): Calling symbols_output once is enough.
21249
49701457
AD
212502001-12-10 Akim Demaille <akim@epita.fr>
21251
21252 Now that states have a complete set of members, the linked list of
21253 reductions is useless: just fill directly the state's reductions
21254 member.
21255
21256 * src/state.h (struct reductions): Remove member `number' and
21257 `next'.
21258 * src/LR0.c (first_reduction, last_reduction): Remove.
21259 (save_reductions): Don't link the new reductions, store them in
21260 this_state.
21261 * src/lalr.c (set_state_table): No need to attach reductions to
21262 states, it's already done.
21263 * src/output.c (output_actions): No longer free the shifts, then
21264 the reductions, then the states: free all the states and their
21265 members.
21266
0edad749
AD
212672001-12-10 Akim Demaille <akim@epita.fr>
21268
21269 * src/options.c (OPTN, DRTV, BOTH): New.
21270 (option_table): Use them.
21271
0edad749
AD
21272 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
21273 the job of system.h.
21274 * src/options.c: Don't include stdio.h and xalloc.h for the same
21275 reasons.
21276
5449dd0f
AD
212772001-12-10 Akim Demaille <akim@epita.fr>
21278
21279 * src/output.c (output, prepare): Make sure the values of the
21280 muscles `action' and `prologue' are 0-terminated.
21281
a870c567
AD
212822001-12-10 Akim Demaille <akim@epita.fr>
21283
21284 Clean up GCC warnings.
21285
21286 * src/reader.c (copy_action): `buf' is not used.
21287 (parse_skel_decl): Be static.
21288 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
21289 * src/options.h (create_long_option_table): Have a real prototype.
21290 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
21291 (hash_delete_at): Return const void *.
21292 Adjust casts to preserve the const.
21293
80df8768
AD
212942001-12-10 Akim Demaille <akim@epita.fr>
21295
21296 * configure.in: Require 2.52g.
21297 M4 is not needed, but AUTOM4TE is.
21298 * m4/m4.m4: Remove.
21299 * tests/Makefile.am: Adjust.
21300
f693ad14
AD
213012001-12-10 Akim Demaille <akim@epita.fr>
21302
21303 One structure for states is enough, even though theoretically
21304 there are LR(0) states and LALR(1) states.
21305
21306 * src/lalr.h (state_t): Remove.
21307 (state_table): Be state_t **, not state_t *.
21308 * src/state.h (core, CORE_ALLOC): Rename as...
21309 (state_t, STATE_ALLOC): this.
21310 Add the LALR(1) members: shifts, reductions, errs.
21311 * src/LR0.c (state_table): Rename as...
21312 (state_hash): this, to avoid name clashes with the global
21313 `state_table'.
21314 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
21315 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
21316
74ffbcb6
AD
213172001-12-10 Akim Demaille <akim@epita.fr>
21318
21319 Bison dumps core on bash.y.
21320 Reported by Pascal Bart.
21321
21322 * src/warshall.c (bitmatrix_print): New.
21323 (TC): Use it.
ba0fe3c7 21324 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
21325 j must be the outer loop.
21326 * tests/regression.at (Broken Closure): New.
21327
07708e19
AD
213282001-12-05 Akim Demaille <akim@epita.fr>
21329
21330 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
21331 its argument.
ba1ecc07 21332 Reported by Peter Hamorsky.
07708e19 21333
92b16366
AD
213342001-12-05 Akim Demaille <akim@epita.fr>
21335
21336 * src/conflicts.c (err_table): Remove.
21337 (resolve_sr_conflict): Adjust.
21338 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
21339 Rename as...
21340 (state_t.reductions, state_t.shifts): this.
21341
076ab033
AD
213422001-12-05 Akim Demaille <akim@epita.fr>
21343
21344 * src/reduce.c (reduce_grammar_tables): No longer disable the
21345 removal of useless rules via CPP but via `if (0)', so that the
21346 compiler still check the code is valid.
21347 For instance, it should have noticed `rline' no longer exists: use
21348 the `line' member of rule_t.
21349 * src/gram.c (dummy, rline): Remove, unused.
21350
3843c413
AD
213512001-12-05 Akim Demaille <akim@epita.fr>
21352
21353 * src/output.c (pack_vector): Use assert, not berror.
21354 * src/main.c (berror): Remove, unused.
21355
43168960
AD
213562001-12-05 Akim Demaille <akim@epita.fr>
21357
21358 New experimental feature: if --verbose --trace output all the
21359 items of a state, not only its kernel.
21360
21361 * src/print.c (print_core): If `trace_flag', then invoke closure
21362 before outputting the items of the state (print_core is no longer
21363 a correct name them).
21364 (print_results): Invoke new_closure/free_closure if needed.
21365
b2872512
AD
213662001-12-05 Akim Demaille <akim@epita.fr>
21367
21368 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
21369 * src/closure.c, src/closure.h (itemsetsize): Rename as...
21370 (nitemset): for consistency with the rest of the project.
21371
23cbcc6c
AD
213722001-12-05 Akim Demaille <akim@epita.fr>
21373
21374 * src/closure.c (print_closure): Improve.
21375 (closure): Use it for printing input and output.
21376
03ec521c
AD
213772001-12-05 Akim Demaille <akim@epita.fr>
21378
21379 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
21380 indexed by nonterminals.
21381
3a7456dd
AD
213822001-12-05 Akim Demaille <akim@epita.fr>
21383
21384 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
21385 what it was!).
21386 * src/warshall.h: Remove accidental duplication of the content.
21387
1cbcf2e7
AD
213882001-12-05 Akim Demaille <akim@epita.fr>
21389
21390 * src/closure.c (set_fderives): De-obfuscate.
21391
84182270
AD
213922001-12-05 Akim Demaille <akim@epita.fr>
21393
21394 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
21395
3f6f053c
AD
213962001-12-05 Akim Demaille <akim@epita.fr>
21397
21398 * src/closure.c (set_firsts): De-obfuscate.
21399
7a5350ba
AD
214002001-12-05 Akim Demaille <akim@epita.fr>
21401
21402 * src/output.c (action_row): De-obfuscate
21403 using the good o' techniques: arrays not pointers, variable
21404 locality, BITISSET, RESETBIT etc.
21405
d954473d
AD
214062001-12-05 Akim Demaille <akim@epita.fr>
21407
21408 Pessimize the code to simplify it: from now on, all the states
21409 have a valid SHIFTS, which NSHIFTS is possibly 0.
21410
21411 * src/LR0.c (shifts_new): Be global and move to..
21412 * src/state.c, src/state.h: here.
21413 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
21414 * src/print_graph: Adjust.
21415
9839bbe5
AD
214162001-12-05 Akim Demaille <akim@epita.fr>
21417
21418 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
21419 * src/conflicts.c: Use it.
21420 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
21421 incorrectly ``simplified''.
21422
9f136c07
AD
214232001-12-05 Akim Demaille <akim@epita.fr>
21424
21425 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
21426 using the good o' techniques: arrays not pointers, variable
21427 locality, BITISSET, RESETBIT etc.
21428
b608206e
AD
214292001-12-05 Akim Demaille <akim@epita.fr>
21430
21431 * src/state.h (SHIFT_SYMBOL): New.
21432 * src/conflicts.c: Use it to deobfuscate.
21433
52afa962
AD
214342001-12-05 Akim Demaille <akim@epita.fr>
21435
21436 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
21437 (print_reductions): De-obfuscate using the good o' techniques:
21438 arrays not pointers, variable locality, BITISSET.
21439
e74dc321
AD
214402001-12-05 Akim Demaille <akim@epita.fr>
21441
21442 * src/conflicts.c (print_reductions): Arrays, not pointers.
21443 Use BITISSET.
21444
768fca83
AD
214452001-12-05 Akim Demaille <akim@epita.fr>
21446
21447 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21448
a17e599f
AD
214492001-12-05 Akim Demaille <akim@epita.fr>
21450
21451 * src/conflicts.c (print_reductions): Improve variable locality.
21452
a04bc341
AD
214532001-12-05 Akim Demaille <akim@epita.fr>
21454
21455 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21456
c8ea038e
AD
214572001-12-05 Akim Demaille <akim@epita.fr>
21458
21459 * src/conflicts.c (print_reductions): Improve variable locality.
21460
aa2aab3c
AD
214612001-12-05 Akim Demaille <akim@epita.fr>
21462
21463 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
21464 * src/lalr.c: Use them.
21465
b178c8cc
AD
214662001-12-05 Akim Demaille <akim@epita.fr>
21467
21468 * src/LR0.c (augment_automaton): Formatting changes.
21469 Better variable locality.
21470
f67d13aa
AD
214712001-12-05 Akim Demaille <akim@epita.fr>
21472
21473 * src/lalr.c (matrix_print): New.
21474 (transpose): Use it.
21475 Use arrays instead of pointers.
21476
c2713865
AD
214772001-12-05 Akim Demaille <akim@epita.fr>
21478
21479 * src/lalr.c (maxrhs): Move to...
21480 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
21481 * src/lalr.c (build_relations): Adjust.
21482
9887c18a
AD
214832001-12-05 Akim Demaille <akim@epita.fr>
21484
21485 * src/lalr.c (transpose): Free the memory allocated to the
21486 argument, as it is replaced by the results by the unique caller.
21487 (build_relations): Merely invoke transpose: it handles the memory
21488 deallocation.
21489 Improve variable locality.
21490 Avoid variables used as mere abbreviations.
21491 (compute_lookaheads): Use arrays instead of pointers.
21492
4d4f699c
AD
214932001-12-05 Akim Demaille <akim@epita.fr>
21494
21495 * src/lalr.c (initialize_F): Improve variable locality.
21496 Avoid variables used as mere abbreviations.
21497
80a69750
AD
214982001-12-05 Akim Demaille <akim@epita.fr>
21499
21500 * src/derives.c (print_derives): Display the ruleno.
21501 * src/lalr.c (initialize_F, transpose): Better variable locality
21502 to improve readability.
21503 Avoid variables used as mere abbreviations.
21504
fe961097
AD
215052001-12-05 Akim Demaille <akim@epita.fr>
21506
21507 * src/lalr.c (traverse): Use arrays instead of pointers.
21508
e3e4e814
AD
215092001-12-05 Akim Demaille <akim@epita.fr>
21510
21511 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
21512 the handling of squeue.
21513 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21514
630e182b
AD
215152001-12-05 Akim Demaille <akim@epita.fr>
21516
21517 Because useless nonterminals are now kept alive (instead of being
21518 `destroyed'), we now sometimes examine them, and store information
21519 related to them. Hence we need to know their number, and adjust
21520 memory allocations.
21521
21522 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
21523 static.
21524 * src/LR0.c (allocate_itemsets): The memory allocated to
21525 `symbol_count' was used for two different purpose: once to count
21526 the number of occurrences of each symbol, and later reassigned to
21527 `shift_symbol', containing the symbol that can be shifted from a
21528 given state.
21529 Deobfuscate, i.e., allocate, use and free `symbol_count' here
21530 only, and...
21531 (new_itemsets): Allocate `shift_symbol' here.
21532 (allocate_itemsets): symbol_count includes useless nonterminals.
21533 Make room for them.
21534 (free_storage): Use `free', not `XFREE', for pointers that cannot
21535 be null.
21536
81b51460
AD
215372001-12-05 Akim Demaille <akim@epita.fr>
21538
21539 * src/nullable.c (set_nullable): Deobfuscate the handling of
21540 ritem.
21541 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21542
3067fbef
AD
215432001-12-05 Akim Demaille <akim@epita.fr>
21544
21545 * src/gram.c, src/gram.h (ritem_print): New.
21546 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
21547 (This useless function was defined only to work around VMS linkers
21548 that can't handle compilation units with variables only).
21549 * src/reduce.c (dump_grammar): Use it to trace the construction of
21550 ritem.
21551
c2bea5f9
PE
215522001-12-04 Paul Eggert <eggert@twinsun.com>
21553
7d27c823
PE
21554 * src/bison.simple (union yyalloc): Change member names
21555 to be the same as the stack names.
21556 (yyparse): yyptr is now union yyalloc *, not char *.
21557 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
21558 and may generate better code on some machines.
c2bea5f9
PE
21559 (yystpcpy): Use prototype if __STDC__ is defined, not just
21560 if __cplusplus is defined.
35687a9d 21561
2c8a9dfa
AD
215622001-11-30 Akim Demaille <akim@epita.fr>
21563
21564 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
21565 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
21566 Gettext doesn't compile cleanly, and dies with -Werror.
21567 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
21568 Include WARNING_CFLAGS here.
21569 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
21570 before being defined.
21571
f4e421e6
AD
215722001-11-27 Paul Eggert <eggert@twinsun.com>
21573
21574 * lib/quotearg.h (quotearg_n, quotearg_n_style):
21575 First arg is int, not unsigned.
21576 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
21577 (SIZE_MAX, UINT_MAX): New macros.
21578 (quotearg_n_options): Abort if N is negative.
21579 Avoid overflow check on hosts where size_t is 64 bits and int
21580 is 32 bits, as overflow is impossible there.
21581 Fix off-by-one typo that caused unnecessary reallocation.
21582
7093d0f5
AD
215832001-11-29 Paul Eggert <eggert@twinsun.com>
21584
21585 Name space cleanup in generated parser.
21586
21587 * doc/bison.texinfo (Bison Parser): Discuss system headers
21588 and their effect on the user name space.
21589
21590 * src/bison.simple:
21591 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
21592 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
21593 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
21594
21595 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
21596 on user names when possible.
21597
21598 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
21599 Simplify test for whather <alloca.h> exists.
21600
21601 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
21602
21603 (<stdio.h>): Include if YYDEBUG.
21604
21605 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
21606 ! defined (yyoverflow) && ! defined (yymemcpy).
21607
21608 (yymemcpy, yyparse): Rename local variables as needed so that
21609 they all begin with 'yy'.
21610
21611 (yystrlen, yystpcpy): New functions.
21612
21613 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
21614 All uses changed.
21615
21616 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
21617 instead of relying on string.h functions. Use YYSTACK_ALLOC
21618 and YYSTACK_FREE instead of malloc and free.
21619
fd51e5ff
AD
216202001-11-30 Akim Demaille <akim@epita.fr>
21621
21622 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
21623 before their first uses.
21624 (YYBISON, YYPURE): Move to the top of the output.
21625
7d13ff5f
AD
216262001-11-30 Akim Demaille <akim@epita.fr>
21627
21628 * tests/reduce.at (Useless Nonterminals): Fix.
21629
892a3995
AD
216302001-11-30 Akim Demaille <akim@epita.fr>
21631
21632 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
21633 if body instead of `;' to pacify GCC's warnings.
21634
68f1e3ed
AD
216352001-11-30 Akim Demaille <akim@epita.fr>
21636
21637 Instead of mapping the LHS of unused rules to -1, keep the LHS
21638 valid, but flag the rules as invalid.
21639
21640 * src/gram.h (rule_t): `useful' is a new member.
21641 * src/print.c (print_grammar): Adjust.
21642 * src/derives.c (set_derives): Likewise.
21643 * src/reader.c (packgram, reduce_output): Likewise.
21644 * src/reduce.c (reduce_grammar_tables): Likewise.
21645 * tests/reduce.at (Underivable Rules, Useless Rules): New.
21646
d2d1b42b
AD
216472001-11-30 Akim Demaille <akim@epita.fr>
21648
21649 * src/reduce.c (reduce_output): Formatting changes.
21650 * src/print.c (print_results, print_grammar): Likewise.
21651 * tests/regression.at (Rule Line Numbers)
21652 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
21653
760b53a8
AD
216542001-11-30 Akim Demaille <akim@epita.fr>
21655
21656 * src/reduce.c (nonterminals_reduce): Instead of throwing away
21657 useless nonterminals, move them at the end of the symbol arrays.
21658 (reduce_output): Adjust.
21659 * tests/reduce.at (Useless Nonterminals): Adjust.
21660
00238958
AD
216612001-11-30 Akim Demaille <akim@epita.fr>
21662
21663 * src/reduce.c: Various comment/formatting changes.
21664 (nonterminals_reduce): New, extracted from...
21665 (reduce_grammar_tables): here.
21666 (reduce_grammar): Call nonterminals_reduce.
21667
396452de
PE
216682001-11-29 Paul Eggert <eggert@twinsun.com>
21669
21670 * src/bison.simple (YYSTACK_REALLOC): Remove.
21671 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
21672 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
21673 New macros.
21674 (union yyalloc): New type.
21675 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
21676 an arbitrary restriction on hosts where size_t is wider than int.
21677
21678 (yyparse): Don't dump core if alloca or malloc fails; instead, report
21679 a parser stack overflow. Allocate just one block of memory for all
21680 three stacks, instead of allocating three blocks; this typically is
21681 faster and reduces fragmentation.
21682
21683 Do not limit the number of items in the stack to a value that fits
21684 in 'int', as this is an arbitrary limit on hosts with 64-bit
21685 size_t and 32-bit int.
21686
147e184c
MA
216872001-11-29 Marc Autret <autret_m@epita.fr>
21688
21689 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
21690 of defining YYERROR_VERBOSE.
21691 [AT_DATA]: $4 is now out of C declarations in the prologue.
21692
426cf563
MA
216932001-11-28 Marc Autret <autret_m@epita.fr>
21694
21695 * src/reader.c (parse_dquoted_param): New.
21696 (parse_skel_decl): Use it.
21697 * src/lex.h: Add its prototype.
21698 * src/lex.c (literalchar): Become not static.
21699
c7925b99
MA
217002001-11-28 Marc Autret <autret_m@epita.fr>
21701
21702 * src/output.h: And put its extern declaration here.
21703 * src/output.c (error_verbose): Define here.
21704 (prepare): Echo name modification.
21705 * src/getargs.h: Clean its extern declaration.
21706 * src/getargs.c (error_verbose_flag): Remove.
21707 (getargs): Remove case 'e'.
21708 * src/options.c (option_table): 'error-verbose' is now seen as simple
21709 percent option.
21710 Include output.h.
21711
21712 * src/reader.c (read_declarations): Remove case tok_include.
21713 (parse_include_decl): Remove.
21714 * src/lex.h (token_t): Remove tok_include.
21715 * src/options.c (option_table): 'include' is now a simple command line
21716 option.
21717
5b5d1929
MA
217182001-11-28 Marc Autret <autret_m@epita.fr>
21719
21720 * src/bison.simple: Adjust muscle names.
21721 * src/muscle_tab.c (muscle_init): Also rename the muscles.
21722 * src/output.c (prepare): s/_/-/ for the muscles names.
21723 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
21724
8850be4b
MA
217252001-11-28 Marc Autret <autret_m@epita.fr>
21726
21727 * src/bison.simple: Fix debug.
21728 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
21729
4a38e613
AD
217302001-11-28 Akim Demaille <akim@epita.fr>
21731
21732 * src/LR0.c (shifts_new): New.
21733 (save_shifts, insert_start_shift, augment_automaton): Use it.
21734
4b35e1c1
AD
217352001-11-28 Akim Demaille <akim@epita.fr>
21736
21737 * src/closure.c (closure): `b' and `ruleno' denote the same value:
21738 keep ruleno only.
21739
d2b04478
AD
217402001-11-28 Akim Demaille <akim@epita.fr>
21741
21742 * src/closure.c (closure): Instead of looping over word in array
21743 then bits in words, loop over bits in array.
21744
2c4c30aa
AD
217452001-11-28 Akim Demaille <akim@epita.fr>
21746
21747 * src/closure.c (closure): No longer optimize the special case
21748 where all the bits of `ruleset[r]' are set to 0, to make the code
21749 clearer.
21750
576890b7
AD
217512001-11-28 Akim Demaille <akim@epita.fr>
21752
21753 * src/closure.c (closure): `r' and `c' are new variables, used to
21754 de-obfuscate accesses to RULESET and CORE.
21755
cb487d7d
AD
217562001-11-28 Akim Demaille <akim@epita.fr>
21757
21758 * src/reduce.c (reduce_print): Use ngettext.
21759 (dump_grammar): Improve the trace accuracy.
21760
6013d43f
AD
217612001-11-28 Akim Demaille <akim@epita.fr>
21762
21763 * src/reduce.c (dump_grammar): Don't translate trace messages.
21764
cb4956ee
AD
217652001-11-28 Akim Demaille <akim@epita.fr>
21766
21767 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
21768 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
21769 as all tags are free'ed afterwards.
21770 From Enrico Scholz.
21771
648185ab
PE
217722001-11-27 Paul Eggert <eggert@twinsun.com>
21773
21774 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
21775 use alloca when we didn't want to, and vice versa.
21776
68254a03
MA
217772001-11-27 Marc Autret <autret_m@epita.fr>
21778
9113b58f
AD
21779 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
21780 initialization.
68254a03
MA
21781 * src/output.c (prepare): Remove its update.
21782
04d843a2
MA
217832001-11-27 Marc Autret <autret_m@epita.fr>
21784
21785 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
21786 Use %error-verbose.
21787
d2079671 217882001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
21789
21790 * src/bison.simple: Remove YYERROR_VERBOSE using.
21791 Use %%error_verbose.
21792 (yyparse): Likewise.
21793 * src/output.c (prepare): Give its final value.
21794 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
21795 * src/getargs.h: Add its extern declaration.
21796 * src/getargs.c (error_verbose_flag): New int.
21797 (getargs): Update to catch new case.
21798 * src/options.c (option_table): 'error-verbose' is a new option.
21799 (shortopts): Update.
21800
e0327bc8
AD
218012001-11-27 Akim Demaille <akim@epita.fr>
21802
21803 * src/system.h: Use intl/libgettext.h.
21804 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
21805
000f1a3c
AD
218062001-11-27 Akim Demaille <akim@epita.fr>
21807
21808 * tests/torture.at (Exploding the Stack Size with Malloc):
21809 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
21810
26cfe0be
AD
218112001-11-27 Akim Demaille <akim@epita.fr>
21812
21813 * src/files.c: Include error.h.
21814 Reported by Hans Aberg.
21815
f6bd5427
MA
218162001-11-26 Marc Autret <autret_m@epita.fr>
21817
d2079671 21818 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
21819 (read_declarations): Add case tok_include.
21820 * src/getargs.h (include): Add its extern definition.
21821 * src/getargs.c (include): New const char *.
21822 (getargs): Add case '-I'.
21823 * src/options.c (option_table): Add include as command line and
21824 percent option.
21825 * src/lex.h (token_t): Add tok_include.
21826
2ca209c1
AD
218272001-11-26 Akim Demaille <akim@epita.fr>
21828
21829 * src/reader.c (readgram): Make sure rules for mid-rule actions
21830 have a lineno equal to that of their host rule.
21831 Reported by Hans Aberg.
21832 * tests/regression.at (Rule Line Numbers): New.
21833
0e41b407
AD
218342001-11-26 Akim Demaille <akim@epita.fr>
21835
21836 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
21837 size_ts.
21838
218392001-11-26 Akim Demaille <akim@epita.fr>
21840
21841 * src/complain.c, src/complain.h (error): Remove, provided by
21842 lib/error.[ch].
21843
e0c40012
AD
218442001-11-26 Akim Demaille <akim@epita.fr>
21845
21846 * src/reader.c (read_declarations): Don't abort on tok_illegal,
21847 issue an error message.
21848 * tests/regression.at (Invalid %directive): New.
21849 Reported by Hans Aberg.
21850
5e147124
AD
218512001-11-26 Akim Demaille <akim@epita.fr>
21852
21853 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
21854 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
21855
a034c8b8
AD
218562001-11-26 Akim Demaille <akim@epita.fr>
21857
21858 * src/conflicts.c (conflicts_print): Don't complain at all when
21859 there are no reduce/reduce conflicts, and as many shift/reduce
21860 conflicts as expected.
21861 * tests/regression.at (%expect right): Adjust.
21862
c64a20f3
AD
218632001-11-23 Akim Demaille <akim@epita.fr>
21864
21865 * lib/alloca.c: Update, from fileutils.
21866
5b0d29bb
AD
218672001-11-23 Akim Demaille <akim@epita.fr>
21868
21869 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
21870
722c4bfe
AD
218712001-11-23 Akim Demaille <akim@epita.fr>
21872
21873 * src/system.h: Include alloca.h.
21874 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
21875
6255b435
AD
218762001-11-23 Akim Demaille <akim@epita.fr>
21877
21878 * src/print_graph.c (print_actions): Remove `rule', unused.
21879 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
21880 pacify GCC's signed < unsigned warnings.
21881 * src/closure.c (itemsetsize): Likewise.
21882 * src/reader.c (symbol_list_new): Static.
21883
b29b2ed5
AD
218842001-11-23 Akim Demaille <akim@epita.fr>
21885
21886 Attaching lineno to buckets is stupid, since only one copy of each
21887 symbol is kept, only the line of the first occurrence is kept too.
21888
21889 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
21890 * src/reader.c (rline_allocated): Remove, unused.
21891 (symbol_list): Have a `line' member.
21892 (symbol_list_new): New.
21893 (readgram): Use it.
21894 * src/print.c (print_grammar): Output the rule line numbers.
21895 * tests/regression.at (Solved SR Conflicts)
21896 (Unresolved SR Conflicts): Adjust.
21897 Reported by Hans Aberg.
21898
a81b1d4a
MA
218992001-11-22 Marc Autret <autret_m@epita.fr>
21900
21901 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
21902
c1ecb3c1
MA
219032001-11-22 Marc Autret <autret_m@epita.fr>
21904
21905 * src/muscle_tab.c (muscle_init): Remove initialization of
21906 skeleton muscle.
21907 * src/output.c (output_master_parser): Do it here.
21908
fbe01355
AD
219092001-11-20 Akim Demaille <akim@epita.fr>
21910
21911 * po/sv.po: New.
21912 * configure.in (ALL_LINGUAS): Adjust.
21913 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
21914 longer contains strings to translate.
21915
81e895c0
AD
219162001-11-19 Akim Demaille <akim@epita.fr>
21917
21918 * src/conflicts.c (conflicts_print): Add a missing \n.
21919
6bb1878b
AD
219202001-11-19 Akim Demaille <akim@epita.fr>
21921
21922 * src/nullable.c (nullable_print): New.
21923 (set_nullable): Call it when tracing.
21924 Better locality of variables.
21925
d9ec2d07
AD
219262001-11-19 Akim Demaille <akim@epita.fr>
21927
21928 * src/print.c (print_actions): Better locality of variables.
21929
720e5c1b
AD
219302001-11-19 Akim Demaille <akim@epita.fr>
21931
21932 * src/derives.c (print_derives): Fix and enrich.
21933 * src/closure.c (print_fderives): Likewise.
21934
fb908786
AD
219352001-11-19 Akim Demaille <akim@epita.fr>
21936
21937 * src/closure.c (itemsetend): Remove, replaced with...
21938 (itemsetsize): new.
21939
125ecb56
AD
219402001-11-19 Akim Demaille <akim@epita.fr>
21941
21942 * src/LR0.c (kernel_end): Remove, replaced with...
21943 (kernel_size): new.
21944
d8cf039f
AD
219452001-11-19 Akim Demaille <akim@epita.fr>
21946
21947 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
21948 to clarify.
21949
7bec0760
AD
219502001-11-19 Akim Demaille <akim@epita.fr>
21951
21952 * src/closure.c (closure): Use arrays instead of pointers to clarify.
21953
c87d4863
AD
219542001-11-19 Akim Demaille <akim@epita.fr>
21955
21956 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
21957 trace messages.
21958 * src/LR0.c: Likewise.
21959 (allocate_itemsets): Use arrays instead of pointers to clarify.
21960
9bfe901c
AD
219612001-11-19 Akim Demaille <akim@epita.fr>
21962
21963 * src/getargs.c (statistics_flag): Replace with...
21964 (trace_flag): New.
21965 (longopts): Accept --trace instead of --statistics.
21966 * src/getargs.h, src/options.c: Adjust.
21967 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
21968 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
21969
97db7bd4
AD
219702001-11-19 Akim Demaille <akim@epita.fr>
21971
cc72668c 21972 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
21973 pointers to clarify the code.
21974 (save_reductions, save_shifts): Factor common parts of alternatives.
21975
2c5f66ed
AD
219762001-11-19 Akim Demaille <akim@epita.fr>
21977
21978 * src/LR0.c (new_state, get_state): Complete TRACE code.
21979 * src/closure.c: Include `reader.h' to get `tags', needed by the
21980 trace code.
21981 Rename the conditional DEBUG as TRACE.
21982 Output consistently TRACEs to stderr, not stdout.
21983 * src/derives.c: Likewise.
21984 * src/reduce.c: (inaccessable_symbols): Using if is better style
21985 than goto.
21986 Use `#if TRACE' instead of `#if 0' for tracing code.
21987
300f275f
AD
219882001-11-19 Akim Demaille <akim@epita.fr>
21989
21990 * src/system.h (LIST_FREE, shortcpy): New.
21991 * src/LR0.c: Use them.
21992 * src/output.c (free_itemsets, free_reductions, free_shifts):
21993 Remove, replaced by LIST_FREE.
21994
f59c437a
AD
219952001-11-19 Akim Demaille <akim@epita.fr>
21996
21997 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
21998 (REDUCTIONS_ALLOC): New.
21999 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
22000 allocation.
22001
6986fd9e
AD
220022001-11-19 Akim Demaille <akim@epita.fr>
22003
22004 * src/LR0.c (new_state): Complete trace code.
22005 * src/nullable.c (set_nullable): Don't translate traces.
22006
4bc30f78
AD
220072001-11-19 Akim Demaille <akim@epita.fr>
22008
22009 * src/print_graph.c (print_core): Better locality of variables.
22010 * src/print.c (print_core): Likewise.
22011
08a946e0
AD
220122001-11-19 Akim Demaille <akim@epita.fr>
22013
22014 * src/vcg.c: You do the output, so you are responsible of the
22015 handling of VCG syntax, in particular: use quotearg.
22016 * src/print_graph.c: Don't.
22017 (print_actions): Don't output the actions as part of the nodes,
22018 since that's the job of the edges.
22019 (print_state): Don't output by hand: fill the node description,
9bfe901c 22020 and ask for its output.
08a946e0 22021
f0473484
AD
220222001-11-19 Akim Demaille <akim@epita.fr>
22023
cc72668c
AD
22024 * src/bison.simple (yyparse): When verbosely reporting an error,
22025 no longer put additional quotes around token names.
f0473484
AD
22026 * tests/calc.at: Adjust.
22027
e41dc700
AD
220282001-11-19 Akim Demaille <akim@epita.fr>
22029
22030 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
22031 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
22032 * src/output.c: Adjust.
22033
652a871c
AD
220342001-11-19 Akim Demaille <akim@epita.fr>
22035
22036 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
22037 (rule_t): this.
22038 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
22039
b2ed6e58
AD
220402001-11-19 Akim Demaille <akim@epita.fr>
22041
22042 * src/gram.h (rule_t): New.
22043 (rule_table): New.
22044 (rrhs, rlhs): Remove, part of state_t.
22045 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
22046 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
22047 * src/reader.c, src/reduce.c: Adjust.
22048
edad7067
AD
220492001-11-19 Akim Demaille <akim@epita.fr>
22050
22051 * src/reader.c (symbols_output): New, extracted from...
22052 (packsymbols): Here.
22053 (reader): Call it.
22054
3feec034
AD
220552001-11-19 Akim Demaille <akim@epita.fr>
22056
22057 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
22058 (maxrhs): this new function.
22059
ddcd5fdf
AD
220602001-11-19 Akim Demaille <akim@epita.fr>
22061
cc72668c 22062 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
22063 Adjust.
22064
bb527fc2
AD
220652001-11-19 Akim Demaille <akim@epita.fr>
22066
cc72668c 22067 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
22068 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22069 * src/lalr.c: Adjust.
22070
a845a697
AD
220712001-11-19 Akim Demaille <akim@epita.fr>
22072
22073 * src/lalr.c (initialize_LA): Only initialize LA. Let...
22074 (set_state_table): handle the `lookaheads' members.
22075
f004bf6a
AD
220762001-11-19 Akim Demaille <akim@epita.fr>
22077
cc72668c
AD
22078 * src/lalr.h (lookaheads): Removed array, whose contents is now
22079 a member of...
f004bf6a
AD
22080 (state_t): this structure.
22081 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22082 Adjust.
22083
de326cc0
AD
220842001-11-19 Akim Demaille <akim@epita.fr>
22085
cc72668c
AD
22086 * src/lalr.h (consistent): Removed array, whose contents is now
22087 a member of...
de326cc0
AD
22088 (state_t): this structure.
22089 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22090 Adjust.
22091
90b4416b
AD
220922001-11-19 Akim Demaille <akim@epita.fr>
22093
cc72668c
AD
22094 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
22095 contents are now members of...
90b4416b
AD
22096 (state_t): this structure.
22097 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22098 Adjust.
22099
9703cc49
AD
221002001-11-19 Akim Demaille <akim@epita.fr>
22101
22102 * src/lalr.h (state_t): New.
22103 (state_table): Be a state_t * instead of a core **.
22104 (accessing_symbol): Remove, part of state_t.
22105 * src/lalr.c: Adjust.
22106 (set_accessing_symbol): Merge into...
22107 (set_state_table): this.
22108 * src/print_graph.c, src/conflicts.c: Adjust.
22109
d803322e
AD
221102001-11-14 Akim Demaille <akim@epita.fr>
22111
22112 * tests/calc.at, tests/output.at, tests/regression.at,
22113 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
22114 now the tests are run in private dirs, therefore AC_CLEANUP and
22115 family can be simplified to 0-ary.
22116 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
22117 use abs. path to find config.h.
22118 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
22119 stderr, there can be way too much random noise.
22120 Instead pass -Werror to GCC and rely on the exit status.
22121 Reported by Wolfram Wagner.
22122
3d76b07d
AD
221232001-11-14 Akim Demaille <akim@epita.fr>
22124
22125 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
22126 defined only if yyoverflow is defined, to avoid `warning: unused
22127 variable `yyvs1''.
22128 Reported by The Test Suite.
22129
09b503c8
AD
221302001-11-14 Akim Demaille <akim@epita.fr>
22131
22132 * src/print.c: Include reduce.h.
22133 Reported by Hans Aberg.
22134
221352001-11-14 Akim Demaille <akim@epita.fr>
22136
22137 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
22138 Revert a previous patch: these are really const.
22139 * src/conflicts.c (conflict_report): Additional useless pair of
22140 braces to pacify GCC's warnings for `if () if () {} else {}'.
22141 * src/lex.c (parse_percent_token): Replace equal_offset with
22142 arg_offset.
22143 arg is const.
22144 Be sure to strdup `arg' when used, since there is no reason for
22145 token_buffer not to change.
22146
0f37a994
AD
221472001-11-14 Akim Demaille <akim@epita.fr>
22148
22149 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
22150 definition.
22151 * src/main.c (main): Use them.
22152 Suggested by Hans Aberg.
22153
d39d93b8
AD
221542001-11-12 Akim Demaille <akim@epita.fr>
22155
22156 * src/system.h (ngettext): Now that we use ngettext, be sure to
22157 provide a default definition when NLS are not used.
22158
9edcd895
AD
221592001-11-12 Akim Demaille <akim@epita.fr>
22160
22161 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
22162 Use @kbd to denote user input.
22163 (Language and Grammar): ANSIfy the example.
22164 Adjust its layout for info/notinfo.
22165 (Location Tracking Calc): Output error messages to stderr.
22166 Output locations in a more GNUtically correct way.
22167 Fix a couple of Englishos.
22168 Adjust @group/@end group pairs.
22169
7da99ede
AD
221702001-11-12 Akim Demaille <akim@epita.fr>
22171
e3aa65c5 22172 %expect was not functioning at all.
7da99ede
AD
22173
22174 * src/conflicts.c (expected_conflicts): Set to -1.
22175 (conflict_report): Use ngettext.
22176 (conflicts_print): Check %expect and make its violation an error.
22177 * doc/bison.texinfo (Expect Decl): Adjust.
22178 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
22179 * tests/regression.at (%expect not enough, %expect right)
22180 (%expect too much): New.
22181
ba9dda1a
AD
221822001-11-12 Akim Demaille <akim@epita.fr>
22183
22184 * tests/regression.at (Conflicts): Rename as...
22185 (Unresolved SR Conflicts): this.
22186 (Solved SR Conflicts): New.
22187
337c5bd1
AD
221882001-11-12 Akim Demaille <akim@epita.fr>
22189
22190 * src/reduce.c (print_results): Rename as...
22191 (reduce_output): This.
22192 Output to OUT, passed as argument, instead of output_obstack.
22193 (dump_grammar): Likewise.
22194 (reduce_free): New.
22195 Also free V1.
22196 (reduce_grammar): No longer call reduce_output, since...
22197 * src/print.c (print_results): do it.
22198 * src/main.c (main): Call reduce_free;
22199
c73a41af
AD
222002001-11-12 Akim Demaille <akim@epita.fr>
22201
22202 * src/conflicts.c (print_reductions): Accept OUT as argument.
22203 Output to it, not to output_obstack.
22204 * src/print.c (print_actions): Adjust.
22205
0df87bb6
AD
222062001-11-12 Akim Demaille <akim@epita.fr>
22207
22208 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
22209 the result instead of using...
22210 (src_total, rrc_total, src_count, rrc_count): Remove.
22211 (any_conflicts): Remove.
22212 (print_conflicts): Split into...
22213 (conflicts_print, conflicts_output): New.
22214 * src/conflicts.h: Adjust.
22215 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 22216 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
22217 * tests/regression.at (Conflicts): New.
22218 Reported by Tom Lane.
22219
e4d3d4de
AD
222202001-11-12 Akim Demaille <akim@epita.fr>
22221
22222 * tests/regression.at (Invalid input): Remove, duplicate with
22223 ``Invalid input: 1''.
22224
6d7d248e
AD
222252001-11-12 Akim Demaille <akim@epita.fr>
22226
22227 * tests/torture.at (AT_DATA_STACK_TORTURE)
22228 (Exploding the Stack Size with Alloca)
22229 (Exploding the Stack Size with Malloc): New.
22230
e9e4c321
AD
222312001-11-12 Akim Demaille <akim@epita.fr>
22232
22233 * src/bison.simple (YYSTACK_REALLOC): New.
22234 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 22235 Reported by Per Allansson.
e9e4c321 22236
5f7e0832
AD
222372001-11-12 Pascal Bart <pascal.bart@epita.fr>
22238
22239 * src/bison.simple: Define type yystype instead of YYSTYPE, and
22240 define CPP macro, which substitute YYSTYPE by yystype.
22241 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
22242 with yyltype/YYLTYPE. This allows inclusion of the generated
22243 header within the parser if the compiler, such as GGC, accepts
22244 multiple equivalent #defines.
22245 From Akim.
22246
e3f1699f
AD
222472001-11-05 Akim Demaille <akim@epita.fr>
22248
22249 * src/reader.c (symbols_output): New, extracted from...
22250 (packsymbols): here.
22251 (reader): Adjust.
22252
65be0866
AD
222532001-11-05 Akim Demaille <akim@epita.fr>
22254
22255 * src/lex.c (parse_percent_token): s/quotearg/quote/.
22256
e4d910bf
AD
222572001-11-05 Akim Demaille <akim@epita.fr>
22258
22259 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
22260 pattern.
22261
951366c1
AD
222622001-11-05 Akim Demaille <akim@epita.fr>
22263
22264 * src/options.h (struct option_table_struct): set_flags is void*.
22265 * src/options.c (longopts): Support `--output' and `%output'.
22266 (usage): Adjust.
22267 * src/lex.h (tok_setopt): Remove, replaced with...
22268 (tok_intopt, tok_stropt): these new guys.
22269 * src/lex.c (getopt.h): Not needed.
22270 (token_buffer, unlexed_token_buffer): Not const.
22271 (percent_table): Promote `-' over `_' in directive names.
22272 Active `%name-prefix', `file-prefix', and `output'.
22273 (parse_percent_token): Accept possible arguments to directives.
22274 Promote `-' over `_' in directive names.
22275
d8988b2f
AD
222762001-11-04 Akim Demaille <akim@epita.fr>
22277
22278 * doc/bison.texinfo (Decl Summary): Split the list into
22279 `directives for grammars' and `directives for bison'.
22280 Sort'em.
22281 Add description of `%name-prefix', `file-prefix', and `output'.
22282 Promote `-' over `_' in directive names.
22283 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
22284 Simplify the description of `--name-prefix'.
22285 Promote `-' over `_' in directive names.
22286 Promote `--output' over `--output-file'.
22287 Fix the description of `--defines'.
22288 * tests/output.at: Exercise %file-prefix and %output.
22289
6468d18e
AD
222902001-11-02 Akim Demaille <akim@epita.fr>
22291
22292 * doc/refcard.tex: Update.
22293
6b7e85b9
AD
222942001-11-02 Akim Demaille <akim@epita.fr>
22295
22296 * src/symtab.h (SUNDEF): New.
22297 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
22298 stand for `uninitialized', instead of 0.
22299 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
22300 * src/lex.c (lex): Adjust.
22301
22302 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
22303 Number it 0.
22304 Let yylex return it instead of a plain 0.
22305 Reported by Dick Streefland.
22306
cd5aafcf
AD
223072001-11-02 Akim Demaille <akim@epita.fr>
22308
22309 * tests/regression.at (Mixing %token styles): New test.
22310
037ca2f1
AD
223112001-11-02 Akim Demaille <akim@epita.fr>
22312
22313 * src/reader.c (parse_thong_decl): Formatting changes.
22314 (token_translations_init): New, extracted from...
22315 (packsymbols): Here.
22316 Adjust.
22317
270a173c
AD
223182001-11-01 Akim Demaille <akim@epita.fr>
22319
22320 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
22321 Check that `9foo.y' produces correct cpp guards.
22322 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
22323 guards.
22324 Reported by Wwp.
22325
561f9a30
AD
223262001-11-01 Akim Demaille <akim@epita.fr>
22327
22328 * tests/regression.at (Invalid input: 2): New.
22329 * src/lex.c (unlexed_token_buffer): New.
22330 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
22331 too.
22332 Reported by Wwp.
22333
f987e9d2
AD
223342001-11-01 Akim Demaille <akim@epita.fr>
22335
22336 * tests/calc.at: Catch up with 1.30.
22337 * configure.in: Bump to 1.49a.
22338 Adjust to newer Autotest.
22339
0846f581
PB
223402001-10-19 Pascal Bart <pascal.bart@epita.fr>
22341
22342 * src/conflicts.c: Move global variables rrc_total and src_total ...
22343 (print_conflicts): here.
22344 * src/output.c (output): Free global variable user_toknums.
22345 * src/lex.c (token_obstack): Become static.
22346
3c1a79b3
AD
223472001-10-18 Akim Demaille <akim@epita.fr>
22348
22349 * tests/atlocal.in (GCC): Add.
22350 * tests/calc.at: s/m4_match/m4_bmatch/.
22351 s/m4_patsubst/m4_bpatsubst/.
22352 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
22353 * configure.in: AC_SUBST(GCC).
22354
5d52e7d0
MA
223552001-10-14 Marc Autret <autret_m@epita.fr>
22356
22357 * src/options.c (create_long_option_table): Fix.
22358
631aa1d3
AD
223592001-10-10 Akim Demaille <akim@epita.fr>
22360
22361 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
22362
f6ec6d13
AD
223632001-10-04 Akim Demaille <akim@epita.fr>
22364
22365 * src/reader.c (parse_union_decl): Push the caracters in
22366 union_obstack, not attrs_obstack.
22367
342b8b6e
AD
223682001-10-04 Akim Demaille <akim@epita.fr>
22369
22370 Merge in the branch 1.29.
22371
22372 * src/reader.c (packsymbols): Use a temporary obstack for
22373 `%%tokendef', since output_stack is already used elsewhere.
22374
22375 2001-10-02 Akim Demaille <akim@epita.fr>
22376
22377 Bump 1.29d.
22378
22379 2001-10-02 Akim Demaille <akim@epita.fr>
22380
22381 Version 1.29c.
22382
22383 2001-10-02 Akim Demaille <akim@epita.fr>
22384
22385 * tests/regression.at (Invalid CPP headers): New.
22386 From Alexander Belopolsky.
22387 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
22388
22389 2001-10-02 Akim Demaille <akim@epita.fr>
22390
22391 * tests/regression.at (Invalid input): New.
22392 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
22393 Reported by Shura.
22394
22395 2001-10-02 Akim Demaille <akim@epita.fr>
22396
22397 * tests/calc.at: Now that --debug works, the tests must be adjusted.
22398
22399 2001-10-02 Akim Demaille <akim@epita.fr>
22400
22401 * src/output.c (output_parser): Assert `skeleton'.
22402 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
22403 systems.
22404 From Shura.
22405
22406 2001-10-01 Marc Autret <autret_m@epita.fr>
22407
22408 * src/lex.h: Echo modifications.
22409 * src/lex.c (unlex): Parameter is now token_t.
22410 From Hans Aberg.
22411
22412 2001-10-01 Marc Autret <autret_m@epita.fr>
22413
22414 * src/main.c: Include lex.h.
22415 From Hans Aberg.
22416
22417 2001-09-29 Akim Demaille <akim@epita.fr>
22418
22419 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
22420
22421 2001-09-28 Akim Demaille <akim@epita.fr>
22422
22423 * tests/testsuite.at: Update to newer Autotest.
22424 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
22425
22426 2001-09-27 Akim Demaille <akim@epita.fr>
22427
22428 Position independent wrapper.
22429
22430 * tests/bison: Remove.
22431 * tests/bison.in: New.
22432 * configure.in: Adjust.
22433
22434 2001-09-27 Paul Eggert <eggert@twinsun.com>
22435
22436 Port quotearg fixes from tar 1.13.24.
22437
22438 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
22439 tm to be declared.
22440 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
22441 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
22442
22443 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
22444 * m4/mbrtowc.m4: New file.
22445 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
22446 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
22447
22448 2001-09-27 Akim Demaille <akim@epita.fr>
22449
22450 Bump to 1.29c.
22451
22452 2001-09-27 Akim Demaille <akim@epita.fr>
22453
22454 Version 1.29b.
22455
22456 2001-09-25 Akim Demaille <akim@epita.fr>
22457
22458 * src/system.h: Include `xalloc.h'.
22459 Remove it from the C files.
22460 * src/files.c (output_files): Free the obstacks.
22461 * src/lex.c (init_lex): Rename as...
22462 (lex_init): this.
22463 (lex_free): New.
22464 * src/main.c (main): Use it.
22465
22466 2001-09-24 Marc Autret <autret_m@epita.fr>
22467
22468 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
22469 to output informations in fout (FILE*).
22470 (open_graph, close_graph): Likewise.
22471 (output_graph, output_edge, output_node): Likewise.
22472 * src/vcg.h: Update function prototypes.
22473 * src/print_graph.c (print_graph): Open output graph file.
22474 (print_actions): Adjust.
22475 * src/files.h: Remove extern declaration.
22476 * src/files.c: Remove graph_obstack declaration.
22477 (open_files): Remove graph_obstack initialization.
22478 (output_files): Remove graph_obstack saving.
22479
22480 2001-09-24 Marc Autret <autret_m@epita.fr>
22481
22482 * src/files.c (compute_output_file_names): Fix.
22483
22484 2001-09-24 Marc Autret <autret_m@epita.fr>,
22485 Akim Demaille <akim@epita.fr>
22486
22487 * src/reader.c (reader): Remove call to free_symtab ().
22488 * src/main.c (main): Call it here.
22489 Include symtab.h.
22490 * src/conflicts.c (initialize_conflicts): Rename as...
22491 (solve_conflicts): this.
22492 * src/print.c (print_core, print_actions, print_state)
22493 (print_grammar): Dump to a file instead a `output_obstack'.
22494 (print_results): Dump `output_obstack', and then proceed with the
22495 FILE *.
22496 * src/files.c (compute_output_file_names, close_files): New.
22497 (output_files): Adjust.
22498 * src/main.c (main): Adjust.
22499
22500 2001-09-23 Marc Autret <autret_m@epita.fr>
22501
22502 * src/files.c (compute_header_macro): Computes header macro name
22503 from spec_defines_file when given.
22504
22505 2001-09-23 Marc Autret <autret_m@epita.fr>
22506
22507 * src/files.c (output_files): Add default extensions.
22508
22509 2001-09-22 Akim Demaille <akim@epita.fr>
22510
22511 * src/conflicts.c (finalize_conflicts): Rename as...
22512 (free_conflicts): this.
22513
22514 2001-09-22 Akim Demaille <akim@epita.fr>
22515
22516 * src/gram.c (gram_free): Rename back as...
22517 (dummy): this.
22518 (output_token_translations): Free `token_translations'.
22519 * src/symtab.c (free_symtab): Free the tag field.
22520
22521 2001-09-22 Akim Demaille <akim@epita.fr>
22522
22523 Remove `translations' as it is always set to true.
22524
22525 * src/gram.h: Adjust.
22526 * src/reader.c (packsymbols, parse_token_decl): Adjust
22527 * src/print.c (print_grammar): Adjust.
22528 * src/output.c (output_token_translations): Adjust.
22529 * src/lex.c (lex): Adjust.
22530 * src/gram.c: Be sure the set pointers to NULL.
22531 (dummy): Rename as...
22532 (gram_free): this.
22533
22534 2001-09-22 Akim Demaille <akim@epita.fr>
22535
22536 * configure.in: Invoke AM_LIB_DMALLOC.
22537 * src/system.h: Use dmalloc.
22538 * src/LR0.c: Be sure to have pointers initialized to NULL.
22539 (allocate_itemsets): Allocate kernel_items only if needed.
22540
22541 2001-09-22 Akim Demaille <akim@epita.fr>
22542
22543 * configure.in: Bump to 1.29b.
22544 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
22545 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
22546 need xmalloc.c in calc.y.
22547 From Pascal Bart.
22548
22549 2001-09-21 Akim Demaille <akim@epita.fr>
22550
22551 Version 1.29a.
22552 * Makefile.maint, config/config.guess, config/config.sub,
22553 * config/missing: Update from masters.
22554 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
22555 upon package.m4.
22556 * configure.in (ALL_LINGUAS): Add `tr'.
22557
22558 2001-09-21 Akim Demaille <akim@epita.fr>
22559
22560 * tests/Makefile.am (package.m4): Move to...
22561 ($(srcdir)/$(TESTSUITE)): here.
22562
22563 2001-09-20 Akim Demaille <akim@epita.fr>
22564
22565 * src/complain.c: No longer try to be standalone: use system.h.
22566 Don't assume __STDC__ is defined to 1. Just test if it is defined.
22567 * src/complain.h: Likewise.
22568 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
22569 Remove the unused variable `n'.
22570 From Albert Chin-A-Young.
22571
22572 2001-09-18 Marc Autret <autret_m@epita.fr>
22573
22574 * doc/bison.1: Update.
22575 * doc/bison.texinfo (Bison Options): Update --defines and --graph
22576 descriptions.
22577 (Option Cross Key): Update.
22578 Add --graph.
22579
22580 2001-09-18 Marc Autret <autret_m@epita.fr>
22581
22582 * tests/regression.at: New test (comment in %union).
22583
22584 2001-09-18 Marc Autret <autret_m@epita.fr>
22585
22586 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
22587 do that.
22588 Reported by Keith Browne.
22589
22590 2001-09-18 Marc Autret <autret_m@epita.fr>
22591
22592 * tests/output.at: Add tests for --defines and --graph.
22593
22594 2001-09-18 Marc Autret <autret_m@epita.fr>
22595
22596 * tests/output.at: Removes tests of %{header,src}_extension features.
22597
22598 2001-09-18 Akim Demaille <akim@epita.fr>
22599
22600 * tests/Makefile.am (package.m4): New.
22601 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
22602 (_AT_CHECK_CALC_ERROR): Likewise.
22603 Factor the `, ' part of verbose error messages.
22604
22605 2001-09-18 Marc Autret <autret_m@epita.fr>
22606
22607 * src/getargs.c (longopts): Declare --defines and --graph as options
22608 with optional arguments.
22609 * src/files.h: Add extern declarations.
22610 * src/files.c (spec_graph_file, spec_defines_file): New.
22611 (output_files): Update.
22612 Remove CPP-outed code.
22613
22614 2001-09-18 Marc Autret <autret_m@epita.fr>
22615
22616 Turn off %{source,header}_extension feature.
22617
22618 * src/files.c (compute_exts_from_gf): Update.
22619 (compute_exts_from_src): Update.
22620 (output_files): CPP-out useless code.
22621 * src/files.h: Remove {header,source}_extension extern declarations.
22622 * src/reader.c (parse_dquoted_param): CPP-out.
22623 (parse_header_extension_decl): Remove.
22624 (parse_source_extension_decl): Remove.
22625 (read_declarations): Remove cases tok_{hdrext,srcext}.
22626 * src/lex.c (percent_table): Remove {header,source}_extension entries.
22627 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
22628
22629 2001-09-10 Akim Demaille <akim@epita.fr>
22630
22631 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
22632 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
22633 (AT_CHECK_OUTPUT): this.
22634 Merely check ls' exit status, its output is useless.
22635
22636 2001-09-10 Akim Demaille <akim@epita.fr>
22637
22638 * tests/calc.at: Use m4_match.
22639 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
22640
22641 2001-09-10 Marc Autret <autret_m@epita.fr>,
22642 Akim Demaille <akim@epita.fr>
22643
22644 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
22645 enum color_e.
22646 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
22647 to `normal'.
22648 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
22649 * src/lex.h: Adjust prototype.
22650 (token_t): Add `tok_undef'.
22651 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
22652 (parse_percent_token): Now returns token_t.
22653 Add default statement in switch.
22654 (lex): Separate `c' as an input variable, from the token_t result
22655 part.
22656 (unlexed): Is a token_t.
22657
22658 2001-09-10 Akim Demaille <akim@epita.fr>
22659
22660 * configure.in: Bump to 1.29a.
22661
22662 2001-09-07 Akim Demaille <akim@epita.fr>
22663
22664 Version 1.29.
22665
22666 2001-08-30 Akim Demaille <akim@epita.fr>
22667
22668 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
22669 * m4/atconfig.m4: Remove.
22670 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
22671 * tests/bison: New.
22672 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
22673 m4_if, m4_patsubst, and m4_regexp.
22674 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
22675 `input' file instead of echo.
22676
22677 2001-08-29 Akim Demaille <akim@epita.fr>
22678
22679 Bump to 1.28e.
22680
22681 2001-08-29 Akim Demaille <akim@epita.fr>
22682
22683 Version 1.28d.
22684
22685 2001-08-29 Paul Eggert <eggert@twinsun.com>
22686
22687 * src/bison.simple (yyparse): Don't take the address of an
22688 item before the start of an array, as that doesn't conform to
22689 the C Standard.
22690
22691 2001-08-29 Robert Anisko <anisko_r@epita.fr>
22692
22693 * doc/bison.texinfo (Location Tracking Calc): New node.
22694
22695 2001-08-29 Paul Eggert <eggert@twinsun.com>
22696
22697 * src/output.c (output): Do not define const, as this now
22698 causes more problems than it cures.
22699
22700 2001-08-29 Akim Demaille <akim@epita.fr>
22701
22702 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
22703 the nodes.
22704 Be sure to tag the `detailmenu'.
22705
22706 2001-08-29 Akim Demaille <akim@epita.fr>
22707
22708 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
22709 download in a tmp dir.
22710
22711 2001-08-28 Marc Autret <autret_m@epita.fr>
22712
22713 * config/depcomp: New file.
22714
22715 2001-08-28 Marc Autret <autret_m@epita.fr>
22716
22717 * doc/bison.1 (mandoc): Adjust.
22718 From Juan Manuel Guerrero.
22719
22720 2001-08-28 Marc Autret <autret_m@epita.fr>
22721
22722 * src/print_graph.c (print_state): Fix.
22723
22724 2001-08-27 Marc Autret <autret_m@epita.fr>
22725
22726 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
22727 char * members.
22728 Echo modifications to the functions prototypes.
22729 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
22730
22731 2001-08-27 Marc Autret <autret_m@epita.fr>
22732
22733 * src/vcg.c: Include `xalloc.h'.
22734 (add_colorentry): New.
22735 (add_classname): New.
22736 (add_infoname): New.
22737 * src/vcg.h: Add new prototypes.
22738
22739 2001-08-27 Akim Demaille <akim@epita.fr>
22740
22741 * Makefile.maint: Sync. again with CVS Autoconf.
22742
22743 2001-08-27 Akim Demaille <akim@epita.fr>
22744
22745 * Makefile.maint: Formatting changes.
22746 (po-update, cvs-update, update): New targets.
22747 (AMTAR): Remove.
22748
22749 2001-08-27 Akim Demaille <akim@epita.fr>
22750
22751 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22752 * Makefile.maint: Sync. with CVS Autoconf.
22753
22754 2001-08-27 Marc Autret <autret_m@epita.fr>
22755
22756 * src/vcg.h (struct infoname_s): New.
22757 (struct colorentry_s): New.
22758 (graph_s): New fields {vertical,horizontal}_order in structure.
22759 Add `infoname' field.
22760 Add `colorentry' field;
22761 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
22762 (G_HORIZONTAL_ORDER): New.
22763 (G_INFONAME): New.
22764 (G_COLORENTRY): New.
22765 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
22766 Add output of `infoname'.
22767 Add output of `colorentry'.
22768
22769 2001-08-27 Marc Autret <autret_m@epita.fr>
22770
22771 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
22772 This one shadowed a global parameter.
22773
22774 2001-08-24 Marc Autret <autret_m@epita.fr>
22775
22776 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
22777 instead of `unsigned'.
22778 (print_state): Do not call obstack_object_size () in obstack_grow ()
22779 to avoid macro variables shadowing.
22780
22781 2001-08-23 Marc Autret <autret_m@epita.fr>
22782
22783 * src/lex.c (percent_table): Typo: s/naem/name/.
22784 Add graph option.
22785 Normalize new options declarations.
22786
22787 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
22788
22789 * tests/suite.at: Exercise %header_extension and %source_extension.
22790
22791 2001-08-16 Marc Autret <autret_m@epita.fr>
22792
22793 * src/reader.c (parse_dquoted_param): New.
22794 (parse_header_extension_decl): Use it.
22795 (parse_source_extension_decl): Likewise.
22796
22797 2001-08-16 Marc Autret <autret_m@epita.fr>
22798
22799 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
22800 (get_xxxx_str): Use assert () instead of complain ().
22801 Remove return invokations in default cases.
22802 (get_decision_str): Modify default behaviour. Remove second argument.
22803 Echo modifications on calls.
22804 (output_graph): Fix.
22805
22806 2001-08-16 Marc Autret <autret_m@epita.fr>
22807
22808 * src/getargs.c (usage): Update with ``-g, --graph''.
22809
22810 2001-08-16 Marc Autret <autret_m@epita.fr>
22811
22812 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
22813 (Option Cross Key): Likewise.
22814 * doc/bison.1: Update.
22815
1c8c2190
PB
228162001-09-25 Pascal Bart <pascal.bart@epita.fr>
22817
22818 * src/output.c (output_master_parser): Don't finish action_obstack.
22819 (output_parser): Don't care about the muscle action, here.
22820 (prepare): Copy the action_obstack in the action muscle.
22821 (output): Free action_obstack.
22822
180d45ba
PB
228232001-09-23 Pascal Bart <pascal.bart@epita.fr>
22824
22825 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
22826 will contain `%union' declaration.
22827 (parse_union_decl): Delete #line directive output.
22828 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
22829 informations about %union.
22830 (parse_union_decl): Copy the union_obstack in the muscle stype.
22831 * src/bison.simple: Add new #line directive.
22832 Add typdef %%stype YYSTYPE.
22833
c51d1a19
PB
228342001-09-23 Pascal Bart <pascal.bart@epita.fr>
22835
22836 * src/bison.simple: Add new `#line' directive.
22837
6f9344da
PB
228382001-09-22 Pascal Bart <pascal.bart@epita.fr>
22839
22840 * src/bison.simple: New `#line' directive.
22841 * src/output.c (output_parser): Support new dynamic muscle input_line.
22842
652def80
MA
228432001-09-22 Marc Autret <autret_m@epita.fr>
22844
22845 * src/output.c (output_master_parser): New.
22846 (output_parser): Be more re-entrant.
22847
25b222fa
MA
228482001-09-21 Marc Autret <autret_m@epita.fr>
22849
22850 * src/reader.c (copy_definition, parse_union_decl): Update and use
22851 `linef' muscle.
22852 (copy_action): Likewise.
22853 Use obstack_1grow ().
22854 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
22855
6bc35ae5
MA
228562001-09-21 Marc Autret <autret_m@epita.fr>
22857
22858 * src/options.c (option_table): Adjust.
22859 * src/lex.c (parse_percent_token): Fix.
22860
c0629aa1
PB
228612001-09-20 Pascal Bart <pascal.bart@epita.fr>
22862
22863 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 22864
82b6d266
PB
228652001-09-20 Pascal Bart <pascal.bart@epita.fr>
22866
22867 * src/lex.c (parse_percent_token): Change type of variable `tx', which
22868 is now an option_table_struct*.
22869 (option_strcmp): New function option_strcmp.
22870 (parse_percent_token): Call option_strcmp.
22871 * src/getargs.c (xalloc.h, options.h): Include it.
22872 (getargs): Call create_long_option_table.
22873 (getargs): Free longopts at the end of the function.
22874 (shortopts): Move in options.c.
22875 * src/options.c (create_long_option_table): New function. Convert
22876 information from option_table to option structure.
22877 * src/reader.c (options.h): Include it.
22878
22879 * src/Makefile.am: Adjust.
22880 * src/options.c (option_table): Create from longopts and percent_table.
22881 * src/getargs.c (longopts): Delete.
22882 * src/lex.c (struct percent_table_struct): Delete.
22883 (percent_table): Delete.
22884 (options.h): Include it.
22885 * src/options.c: Create.
22886 * src/options.h: Create.
22887 Declare enum opt_access_e.
22888 Define struct option_table_struct.
22889
75f5aaea
MA
228902001-09-20 Marc Autret <autret_m@epita.fr>
22891
22892 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
22893 sections of Bison.
22894
f508cb0a
PB
228952001-09-19 Pascal Bart <pascal.bart@epita.fr>
22896
22897 * src/bison.simple: s/%%filename/%%skeleton.
22898 * src/muscle_tab.c (getargs.h): Include it.
22899 (muscle_init): Insert new muscle skeleton.
22900
13105fc1
PB
229012001-09-18 Pascal Bart <pascal.bart@epita.fr>
22902
22903 * src/output.c (output_parser): Delete unused variable actions_dumped.
22904
b0c4483e
PB
229052001-09-07 Pascal Bart <pascal.bart@epita.fr>
22906
22907 * src/output.c (output): Delete call to reader_output_yylsp.
22908 * src/reader.c (reader): Likewise.
ba0fe3c7 22909 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 22910
11d82f03
MA
229112001-09-02 Marc Autret <autret_m@epita.fr>
22912
22913 * src/reader.c: Include muscle_tab.h.
22914 (parse_union_decl): Update.
22915 (parse_macro_decl): Rename parse_muscle_decl.
22916 Update to use renamed functions and variable.
22917 (read_declarations, copy_action, read_additionnal_code, : Updated
22918 with correct variables and functions names.
22919 (packsymbols, reader): Likewise.
342b8b6e 22920
11d82f03 22921 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 22922
11d82f03
MA
22923 * src/output.c: Include muscle_tab.h
22924 In all functions using macro_insert, change by using muscle_insert ().
22925 (macro_obstack): Rename muscle_obstack.
22926 Echo modifications in the whole file.
22927 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
22928 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
22929 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
22930
22931 * src/muscle_tab.h: Update double inclusion macros.
22932 (macro_entry_s): Rename muscle_entry_s.
22933 Update prototypes.
342b8b6e 22934
11d82f03
MA
22935 * src/muscle_tab.c: Include muscle_tab.h.
22936 Rename macro_tabble to muscle_table.
22937 (mhash1, mhash2, mcmp): Use muscle_entry.
22938 (macro_init): Rename muscle_init. Update.
22939 (macro_insert): Rename muscle_insert. Update.
22940 (macro_find): Rename muscle_find. Update.
22941
22942 * src/main.c: Include muscle_tab.h.
22943 (main): Call muscle_init ().
22944 * src/Makefile.am (bison_SOURCES): Echo modifications.
22945
93a37297
MA
229462001-09-02 Marc Autret <autret_m@epita.fr>
22947
f753cd62 22948 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 22949
f753cd62
MA
22950 * src/muscle_tab.c, src/muscle_tab.h: Add files.
22951
229522001-09-02 Marc Autret <autret_m@epita.fr>
22953
22954 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 22955
682d48cd
PB
229562001-09-01 Pascal Bart <pascal.bart@epita.fr>
22957
342b8b6e 22958 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
22959 filename.
22960
087c8fda
MA
229612001-09-01 Marc Autret <autret_m@epita.fr>
22962
22963 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
22964 to an explicit value to activate the feature. We do it here.
22965
dda680cb
PB
229662001-08-31 Pascal Bart <pascal.bart@epita.fr>
22967
22968 * src/output.c (prepare): Delete the `filename' muscule insertion.
22969 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
22970 (parse_union_decl): Likewise.
22971 * src/macrotab.c (macro_init): Initialize filename by infile.
22972
9e644e64
MA
229732001-08-31 Marc Autret <autret_m@epita.fr>
22974
22975 * src/bison.simple (YYLSP_NEEDED): New definition.
22976 * src/output.c (prepare): Add macro insertion of `locations_flag'
22977
17da6427
PB
229782001-08-31 Pascal Bart <pascal.bart@epita.fr>
22979
22980 * src/output.c (prepare): Delete insertion of previous muscles,
22981 and insert the `prefix' muscles.
22982 * src/macrotab.c (macro_init): Likewise.
22983 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 22984 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
22985 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
22986 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 22987 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
22988 name_prefix.
22989
e8cb70b9
PB
229902001-08-31 Pascal Bart <pascal.bart@epita.fr>
22991
22992 * src/main.c (main): Standardize.
22993 * src/output.c (output_table_data, output_parser): Likewise.
22994 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
22995
63c2d5de
MA
229962001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
22997
342b8b6e 22998 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
22999 %%epilogue.
23000 * src/output.c (output): Rename %%declarations to %%prologue.
23001 * src/bison.simple: Echo modifications.
342b8b6e 23002
d8cb5183
MA
230032001-08-31 Marc Autret <autret_m@epita.fr>
23004
23005 * src/reader.c (readgram): CleanUp.
23006 (output_token_defines): Likewise.
23007 (packsymbols): Likewise.
23008 (reader): Likewise.
23009 * src/output.c (output): CPP-out useless code.
23010
6c686258
PB
230112001-08-31 Pascal Bart <pascal.bart@epita.fr>
23012
342b8b6e 23013 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
23014 output_trailers and output_headers.
23015 * src/output.h: Remove obsolete functions prototypes of output_headers
23016 and output_trailers.
23017
8f451ef7
PB
230182001-08-30 Pascal Bart <pascal.bart@epita.fr>
23019
23020 * src/main.c: Include macrotab.h.
342b8b6e 23021 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
23022 Adjust functions prototypes.
23023 * src/macrotab.c (macro_insert): Constify key and value.
23024 (macro_find): Constify key.
23025 (macro_insert): Include 'xalloc.h'
23026 (macro_insert): Use XMALLOC.
23027 (macro_find): Constify return value.
23028 * src/output.c (output_table_data): Rename table to table_data.
23029 (output_parser): Constify macro_key, macro_value.
23030
997b6fd0 230312001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
23032
23033 * src/reader.c (parse_skel_decl): New.
342b8b6e 23034 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
23035 * src/lex.h (token_t): New token `tok_skel'.
23036 * src/lex.c (percent_table): Add skeleton option entry.
23037 Standardize.
23038
ff48177d
MA
230392001-08-29 Marc Autret <autret_m@epita.fr>
23040
23041 * src/bison.simple: Add %%user_code directive at the end.
23042 * src/reader.c (read_additionnal_code): New.
23043 (reader): Use it.
23044 * src/output.c (output_program): Remove.
23045 (output): Update.
23046
b33160bf
MA
230472001-08-28 Marc Autret <autret_m@epita.fr>
23048
23049 * src/output.c (output_actions): Clean up.
4e5caae2 23050 (output_gram): CPP-out useless code.
b33160bf
MA
23051 * src/reader.c (reader): Clean up, CPP-out useless code.
23052
d1a2daf7
PB
230532001-08-28 Pascal Bart <pascal.bart@epita.fr>
23054
342b8b6e 23055 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 23056 directive.
d1a2daf7
PB
23057 * src/bison.simple: Add `%%definitions'.
23058
2b763dfe
MA
230592001-08-28 Marc Autret <autret_m@epita.fr>
23060
23061 * config/depcomp: New file.
23062
f1a87ef6
PE
230632001-08-27 Paul Eggert <eggert@twinsun.com>
23064
23065 * src/bison.simple (yyparse): Don't take the address of an
23066 item before the start of an array, as that doesn't conform to
23067 the C Standard.
23068
82e236e2
RA
230692001-08-27 Robert Anisko <robert.anisko@epita.fr>
23070
f1a87ef6 23071 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
23072 obstack. It was done too late here.
23073
23074 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
23075 completely wrong.
23076 (reader): Initialize the macro obstack here, since we need it to grow
23077 '%define' directives.
23078
23079 * src/reader.h: Declare the macro obstack as extern.
23080
b0cfa28a
RA
230812001-08-27 Robert Anisko <robert.anisko@epita.fr>
23082
23083 * src/output.c (output_parser): Fix. Store single '%' characters in
23084 the output obstack instead of throwing them away.
23085
6fc74234
AD
230862001-08-27 Akim Demaille <akim@epita.fr>
23087
23088 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23089
9c76d118
RA
230902001-08-25 Robert Anisko <robert.anisko@epita.fr>
23091
23092 * lib/Makefile.am: Adjust.
23093
a8289c62
RA
230942001-08-25 Robert Anisko <robert.anisko@epita.fr>
23095
23096 * src/bison.simple: Update and add '%%' directives.
23097
b6610515
RA
230982001-08-25 Robert Anisko <robert.anisko@epita.fr>
23099
23100 * src/reader.c (reader): Remove calls to 'output_headers' and
23101 'output_trailers'. Remove some C output.
23102 (readgram): Disable a piece of code that was writing a default
23103 definition for 'YYSTYPE'.
23104 (reader_output_yylsp): Remove.
23105 (packsymbols): Output token defintions to a macro.
23106 (copy_definition): Disable C output.
6fc74234 23107
b6610515
RA
23108 * src/reader.c (parse_macro_decl): New function used to parse macro
23109 declarations.
23110 (copy_string2): Put the body of copy_string into this new function.
23111 Add a parameter to let the caller choose whether he wants to copy the
23112 string delimiters or not.
23113 (copy_string): Be a simple call to copy_string2 with the last argument
23114 bound to true.
23115 (read_declarations): Add case for macro definition.
23116 (copy_identifier): New.
6fc74234 23117 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
23118 rather than lex.
23119
26f609ff
RA
231202001-08-25 Robert Anisko <robert.anisko@epita.fr>
23121
23122 * src/output.c (prepare): Add prefixed names.
23123 (output_parser): Output semantic actions.
23124 (output_parser): Fix bug on '%%line' directives.
6fc74234 23125
26f609ff
RA
23126 * src/output.c (output_headers): Remove. The C code printed by this
23127 function should now be in the skeletons.
23128 (output_trailers): Remove.
23129 (output): Disable call to 'reader_output_yylsp'.
23130 (output_rule_data): Do not output tables to the table obstack.
23131
23132 * src/output.c: Remove some C dedicated output.
23133 Improve the use of macro and output obstacks.
23134 (output_defines): Remove.
6fc74234 23135
26f609ff
RA
23136 * src/output.c (output_token_translations): Associate 'translate'
23137 table with a macro. No output to the table obstack.
23138 (output_gram): Same for 'rhs' and 'prhs'.
23139 (output_stos): Same for 'stos'.
23140 (output_rule_data): Same for 'r1' and 'r2'.
23141 (token_actions): Same for 'defact'.
23142 (goto_actions): Same for 'defgoto'.
23143 (output_base): Same for 'pact' and 'pgoto'.
23144 (output_table): Same for 'table'.
23145 (output_check): Same for 'check'.
6fc74234 23146
26f609ff
RA
23147 * src/output.c (output_table_data): New function.
23148 (output_short_table): Remove.
23149 (output_short_or_char_table): Remove.
6fc74234 23150
26f609ff
RA
23151 * src/output.c (output_parser): Replace most of the skeleton copy code
23152 with something new. Skeletons are now processed character by character
23153 rather than line by line, and Bison looks for '%%' macros. This is the
23154 first step in making Bison's output process (a lot) more flexible.
23155 (output_parser): Use the macro table.
23156
6f43b113
RA
231572001-08-25 Robert Anisko <robert.anisko@epita.fr>
23158
23159 * src/main.c (main): Initialize the macro table.
23160
dd3127cf
RA
231612001-08-25 Robert Anisko <robert.anisko@epita.fr>
23162
23163 * src/lex.c (percent_table): Add tok_define.
23164 * src/lex.h: Add tok_define.
23165
aa321494
RA
231662001-08-25 Robert Anisko <robert.anisko@epita.fr>
23167
23168 * src/macrotab.c: New file.
23169 * src/macrotab.h: New file.
23170 * src/Makefile.am: Update.
23171
68bd3b6b
RA
231722001-08-25 Robert Anisko <robert.anisko@epita.fr>
23173
23174 * lib/hash.c: New file.
23175 * lib/hash.h: New file.
23176 * lib/Makefile.am: Update.
23177
45f8dd1e
AD
231782001-08-15 Akim Demaille <akim@epita.fr>
23179
23180 Version 1.28c.
23181
40a64a7a 231822001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
23183
23184 * src/reader.c (readgram): Indent output macro YYSTYPE.
23185 (packsymbols): Likewise.
23186 (output_token_defines): Likewise.
23187 * src/files.c: Standardize.
23188 (compute_header_macro): New.
23189 (defines_obstack_save): New. Use compute_header_macro.
23190 (output_files): Update. Use defines_obstack_save.
23191
f9a8293a
AD
231922001-08-15 Akim Demaille <akim@epita.fr>
23193
23194 * doc/bison.texinfo (Table of Symbols): Document
23195 YYSTACK_USE_ALLOCA.
23196
150ca7a7
AD
231972001-08-15 Akim Demaille <akim@epita.fr>
23198
23199 * missing: Update from CVS Automake.
23200 * config/config.guess, config/config.sub, config/texinfo.tex:
23201 Update from gnu.org.
23202
69b5cec4
AD
232032001-08-15 Akim Demaille <akim@epita.fr>
23204
23205 * Makefile.maint: Sync with CVS Autoconf.
23206
f2b5126e
PB
232072001-08-14 Pascal Bart <pascal.bart@epita.fr>
23208
69b5cec4 23209 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
23210 `fdl.texi'.
23211 * doc/fdl.texi: Add to package.
23212
4ecbf796
MA
232132001-08-14 Marc Autret <autret_m@epita.fr>
23214
23215 Turn on %{source,header}_extension features.
23216
69b5cec4 23217 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
23218 source_extension.
23219 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 23220 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
23221 between options.
23222
95fb5662
MA
232232001-08-14 Marc Autret <autret_m@epita.fr>
23224
23225 * src/files.c (compute_base_names): Add extensions computing when
23226 `--file-prefix' used.
23227 Standardize function calls.
23228
78d09da9
MA
232292001-08-13 Marc Autret <autret_m@epita.fr>
23230
69b5cec4 23231 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
23232 defining it (defined but null disables alloca).
23233
5a009f2c
MA
232342001-08-13 Marc Autret <autret_m@epita.fr>
23235
23236 * src/bison.simple (_yy_memcpy): CPP reformat.
23237
1e41465a
PB
232382001-08-13 Pascal Bart <pascal.bart@epita.fr>
23239
23240 * tests/atconfig.in (CPPFLAGS): Fix.
23241
c67a198d
PB
232422001-08-10 Pascal Bart <pascal.bart@epita.fr>
23243
79282c6c 23244 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
23245 `gpl.texi'.
23246 * doc/gpl.texi: Add to package.
23247
09a6de7e
MA
232482001-08-10 Marc Autret <autret_m@epita.fr>
23249
23250 * src/print_graph.h: Fix.
23251 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
23252
b77b9ee0
AD
232532001-08-10 Akim Demaille <akim@epita.fr>
23254
23255 * src/system.h: Provide default declarations for stpcpy, strndup,
23256 and strnlen.
23257
3e259915
MA
232582001-08-10 Robert Anisko <anisko_r@epita.fr>
23259
23260 * doc/bison.texinfo (Locations): Update @$ stuff.
23261
ca96bc2d
MA
232622001-08-09 Robert Anisko <anisko_r@epita.fr>
23263
23264 * src/bison.simple (YYLLOC_DEFAULT): Update.
23265 (yyparse): Adjust.
23266
fdc6758b
MA
232672001-08-08 Marc Autret <autret_m@epita.fr>
23268
b77b9ee0 23269 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
23270 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
23271 Reported by Fabrice Bauzac.
957d4dbf 23272
600cad3b
MA
232732001-08-08 Marc Autret <autret_m@epita.fr>
23274
23275 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
23276 * src/vcg.c (output_node): Fix.
23277 * src/vcg.h: Cleanup.
23278 * src/print_graph.c: Add comments.
b77b9ee0 23279 (node_output_size): New global variable. Simplify the formatting of
600cad3b 23280 the VCG graph output.
b77b9ee0 23281 (print_actions): Unused code is now used. It notifies the final state
600cad3b 23282 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 23283 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
23284 blue.
23285 Get the current node name and node_obstack by argument.
23286 (node_obstack): New variable.
23287 (print_state): Manage node_obstack.
23288 (print_core): Use node_obstack given by argument.
23289 A node is not only computed here but in print_actions also.
23290 (print_graph): CPP out useless code instead of commenting it.
23291
976e528f
AD
232922001-08-07 Pascal Bart <pascal.bart@epita.fr>
23293
23294 * tests/atconfig.in (CPPFLAGS): Fix.
23295
20e8e5ca
AD
232962001-08-07 Akim Demaille <akim@epita.fr>
23297
23298 * src/print_graph.c (quote): New.
23299 (print_core): Use it.
23300
957d4dbf 233012001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 23302
3e3da797
AD
23303 * src/vcg.c (complain.h): Include it.
23304 Unepitaize `return' invocations.
c4b66126 23305 [NDEBUG] (main): Remove.
79282c6c 23306 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
23307 * src/files.c (open_files): Initialize graph_obstack.
23308 * src/print_graph.c (print_actions): CPP out useless code.
23309 (print_core): Don't output the last `\n' in labels.
23310 Use `quote'.
23311 * src/files.c (output_files): Output the VCG file.
23312 * src/main.c (main): Invoke print_graph ();
3e3da797 23313
957d4dbf 233142001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
23315
23316 Automaton VCG graph output.
23317 Using option ``-g'' or long option ``--graph'', you can generate
23318 a gram_filename.vcg file containing a VCG description of the LALR (1)
23319 automaton of your grammar.
23320
23321 * src/main.c: Call to print_graph() function.
23322 * src/getargs.h: Update.
23323 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
23324 (graph_flag): New flag.
23325 (longopts): Update.
23326 (getargs): Add case `g'.
23327 * src/files.c (graph_obstack): New obstack struct.
23328 (open_files): Initialize new obstack.
23329 (output_files): Saves graph_obstack if required.
23330 * src/files.h (graph_obstack): New extern declaration.
23331 * src/Makefile.am: Add new source files.
23332
927c1557 233332001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
23334
23335 * src/print_graph.c, src/print_graph.h (graph): New.
23336 * src/vcg.h: New file.
23337 * src/vcg.c: New file, VCG graph handling.
23338
7333d403
AD
233392001-08-06 Marc Autret <autret_m@epita.fr>
23340
23341 Add of %source_extension and %header_extension which specify
23342 the source or/and the header output file extension.
23343
23344 * src/files.c (compute_base_names): Remove initialisation of
23345 src_extension and header_extension.
23346 (compute_exts_from_gf): Update.
23347 (compute_exts_from_src): Update.
23348 (output_files): Update.
23349 * src/reader.c (parse_header_extension_decl): New.
23350 (parse_source_extension_decl): New.
23351 (read_declarations): New case statements for the new tokens.
23352 * src/lex.c (percent_table): Add entries for %source_extension
23353 and %header_extension.
23354 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
23355
84163231
AD
233562001-08-06 Marc Autret <autret_m@epita.fr>
23357
23358 * configure.in: Bump to 1.28c.
23359 * doc/bison.texinfo: Texinfo thingies.
23360
8303fc42
AD
233612001-08-04 Pascal Bart <pascal.bart@epita.fr>
23362
23363 * tests/atconfig.in (CPPFLAGS): Add.
23364 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
23365
70a84437
AD
233662001-08-03 Akim Demaille <akim@epita.fr>
23367
23368 Version 1.28b.
23369
2ce10144
AD
233702001-08-03 Akim Demaille <akim@epita.fr>
23371
23372 * tests/Makefile.am (check-local): Ship testsuite.
23373 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
23374 Include `string.h'.
23375
1e3e4bc1
AD
233762001-08-03 Akim Demaille <akim@epita.fr>
23377
23378 * configure.in: Try using -Wformat when compiling.
23379
42b45b7f
AD
233802001-08-03 Akim Demaille <akim@epita.fr>
23381
23382 * configure.in: Bump to 1.28b.
23383
8f13fe33
AD
233842001-08-03 Akim Demaille <akim@epita.fr>
23385
23386 * src/complain.c: Adjust strerror_r portability issues.
23387
b37ba92c
AD
233882001-08-03 Akim Demaille <akim@epita.fr>
23389
23390 Version 1.28a.
23391
b0ce6046
AD
233922001-08-03 Akim Demaille <akim@epita.fr>
23393
23394 * src/getargs.c, src/getarg.h (skeleton)): Constify.
23395 * src/lex.c (literalchar): Avoid name clashes on `buf'.
23396 * src/getargs.c: Include complain.h.
23397 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
23398 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
23399
d01c415b
AD
234002001-08-03 Akim Demaille <akim@epita.fr>
23401
23402 * src/reader.c (readgram): Display hidden chars in error messages.
23403
459dd1a6
AD
234042001-08-03 Akim Demaille <akim@epita.fr>
23405
23406 Update to gettext 0.10.39.
23407
53b74c0c
AD
234082001-08-03 Akim Demaille <akim@epita.fr>
23409
23410 * lib/strspn.c: New.
23411
234a3be3
AD
234122001-08-01 Marc Autret <autret_m@epita.fr>
23413
23414 * doc/bison.texinfo: Update.
23415 * doc/bison.1 (mandoc): Update.
23416 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
23417 * src/files.c: Support output files extensions computing.
23418 (src_extension): New static variable.
23419 (header_extension): New static variable.
23420 (tr): New function.
23421 (get_extension_index): New function, gets the index of an extension
23422 filename in a string.
23423 (compute_exts_from_gf): New function, computes extensions from the
23424 grammar file extension.
23425 (compute_exts_from_src): New functions, computes extensions from the
23426 C source file extension, file given by ``-o'' option.
23427 (compute_base_names): Update.
23428 (output_files): Update.
23429
847bf1f5
AD
234302001-08-01 Robert Anisko <anisko_r@epita.fr>
23431
d995fee7 23432 * doc/bison.texi: Document @$.
847bf1f5
AD
23433 (Locations): New section.
23434
d074a105
AD
234352001-07-18 Akim Demaille <akim@epita.fr>
23436
23437 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
23438 * config/prev-version.txt, config/move-if-change: New.
23439 * Makefile.am: Adjust.
23440
3419715d
AD
234412001-07-08 Pascal Bart <pascal.bart@epita.fr>
23442
23443 * src/bison.simple (yyparse): Suppress warning `comparaison
23444 between signed and unsigned'.
23445
62ab6972
AD
234462001-07-05 Pascal Bart <pascal.bart@epita.fr>
23447
23448 * src/getargs.h (raw_flag): Remove.
23449 * src/getargs.c: Die on `-r'/`--raw'.
23450 * src/lex.c (parse_percent_token): Die on `%raw'.
23451 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
23452 * tests/calc.at: Suppress test with option `--raw'.
23453
1e24cc5b
AD
234542001-07-14 Akim Demaille <akim@epita.fr>
23455
23456 * config/: New.
23457 * configure.in: Require Autoconf 2.50.
23458 Update to gettext 0.10.38.
23459
32dfccf8
AD
234602001-03-16 Akim Demaille <akim@epita.fr>
23461
23462 * doc/bison.texinfo: ANSIfy the examples.
23463
cd5bd6ac
AD
234642001-03-16 Akim Demaille <akim@epita.fr>
23465
23466 * getargs.c (skeleton): New variable.
23467 (longopts): --skeleton is a new option.
23468 (shortopts, getargs): -S is a new option.
23469 * getargs.h: Declare skeleton.
23470 * output.c (output_parser): Use it.
23471
5141b016
AD
234722001-03-16 Akim Demaille <akim@epita.fr>
23473
23474 * m4/strerror_r.m4: New.
23475 * m4/error.m4: Run AC_FUNC_STRERROR_R.
23476 * lib/error.h, lib/error.c: Update.
23477
447992b9
AD
234782001-03-16 Akim Demaille <akim@epita.fr>
23479
23480 * src/getargs.c (longopts): Clean up.
23481
274d42ce
AD
234822001-02-21 Akim Demaille <akim@epita.fr>
23483
23484 * src/reader.c (gensym): `gensym_count' is your own.
23485 Use a static buf to create the symbol name, as token_buffer is no
23486 longer a buffer.
23487
22c821f3
AD
234882001-02-08 Akim Demaille <akim@epita.fr>
23489
23490 * src/conflicts.c (conflict_report): Be sure not to append to res
23491 between two calls, which could happen if both first sprintf were
23492 skipped, but not the first cp += strlen.
23493
18569462
AD
234942001-02-08 Akim Demaille <akim@epita.fr>
23495
23496 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
23497 New, from fileutils 4.0.37.
23498 * configure.in: Require Autoconf 2.49c. I took some time before
23499 making this decision. This is the only way out for portability
23500 issues in Bison, it would mean way too much duplicate effort to
23501 import in Bison features implemented in 2.49c since 2.13.
23502 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
23503
0d8f3c8a
AD
235042001-02-02 Akim Demaille <akim@epita.fr>
23505
23506 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 23507 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 23508
f17bcd1f
AD
235092001-01-19 Akim Demaille <akim@epita.fr>
23510
23511 Get rid of the ad hoc handling of token_buffer in the scanner: use
23512 the obstacks.
23513
23514 * src/lex.c (token_obstack): New.
23515 (init_lex): Initialize it. No longer call...
23516 (grow_token_buffer): this. Remove it.
23517 Adjust all the places which used it to use the obstack.
23518
511e79b3
AD
235192001-01-19 Akim Demaille <akim@epita.fr>
23520
23521 * src/lex.h: Rename all the tokens:
23522 s/\bENDFILE\b/tok_eof/g;
23523 s/\bIDENTIFIER\b/tok_identifier/g;
23524 etc.
23525 Let them be enums, not #define, to ease debugging.
23526 Adjust all the code.
23527
0d6508ef
AD
235282001-01-18 Akim Demaille <akim@epita.fr>
23529
23530 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
23531 * src/lex.c (maxtoken, grow_token_buffer): Static.
23532
6deb4447
AD
235332001-01-18 Akim Demaille <akim@epita.fr>
23534
23535 Since we now use obstacks, more % directives can be enabled.
23536
23537 * src/lex.c (percent_table): Also accept `%yacc',
23538 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
23539 `%debug'.
23540 Handle the actions for `%semantic_parser' and `%pure_parser' here,
23541 instead of returning a token.
23542 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
23543 * src/reader.c (read_declarations): Adjust.
23544 * src/files.c (open_files): Don't call `compute_base_names', don't
23545 compute `attrsfile' since they depend upon data which might be
23546 *in* the input file now.
23547 (output_files): Do it here.
23548 * src/output.c (output_headers): Document the fact that this patch
23549 introduces a guaranteed SEGV for semantic parsers.
23550 * doc/bison.texinfo: Document them.
23551 * tests/suite.at: Exercise these %options.
23552
ff4423cc
AD
235532000-12-20 Akim Demaille <akim@epita.fr>
23554
23555 Also handle the output file (--verbose) with obstacks.
23556
23557 * files.c (foutput): Remove.
23558 (output_obstack): New.
23559 Adjust all dependencies.
23560 * src/conflicts.c: Return a string.
23561 * src/system.h (obstack_grow_string): Rename as...
23562 (obstack_sgrow): this. Be ready to work with non literals.
23563 (obstack_fgrow4): New.
23564
956dba3a
AD
235652000-12-20 Akim Demaille <akim@epita.fr>
23566
23567 * src/files.c (open_files): Fix the computation of short_base_name
23568 in the case of `-o foo.tab.c'.
23569
337bab46
AD
235702000-12-20 Akim Demaille <akim@epita.fr>
23571
23572 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
23573 (copy_dollar): Now that everything uses obstacks, get rid of the
23574 FILE * parameters.
23575
5d3214b8
AD
235762000-12-20 Akim Demaille <akim@epita.fr>
23577
23578 * src/files.c (open_files): Actually the `.output' file is based
23579 on the short_base_name, not base_name.
23580 * tests/suite.at (Checking output file names): Adjust.
23581
29092a57
AD
235822000-12-20 Akim Demaille <akim@epita.fr>
23583
23584 * src/bison.s1: Remove, we now use directly...
23585 * src/bison.simple: this.
23586 * src/Makefile.am: Use pkgdata instead of data.
23587
ea5607fd
AD
235882000-12-20 Akim Demaille <akim@epita.fr>
23589
23590 * src/files.c (guard_obstack): New.
23591 (open_files): Initialize it.
23592 (output_files): Dump it...
23593 * src/files.h: Export it.
23594 * src/reader.c (copy_guard): Use it.
23595
27110317
AD
235962000-12-19 Akim Demaille <akim@epita.fr>
23597
23598 * src/files.c (outfile, defsfile, actfile): Removed as global
23599 vars.
23600 (open_files): Don't compute them.
23601 (output_files): Adjust.
23602 (base_name, short_base_name): Be global.
23603 Adjust dependencies.
23604
19c50364
AD
236052000-12-19 Akim Demaille <akim@epita.fr>
23606
23607 * src/files.c (strsuffix): New.
23608 (stringappend): Be just like strcat but allocate.
23609 (base_names): Eve out from open_files.
23610 Try to simplify the rather hairy computation of base_name and
23611 short_base_name.
23612 (open_files): Use it.
23613 * tests/suite.at (Checking output file names): New test.
23614
573c1d9f
AD
236152000-12-19 Akim Demaille <akim@epita.fr>
23616
23617 * src/system.h (obstack_grow_literal_string): Rename as...
23618 (obstack_grow_string): this.
23619 * src/output.c (output_parser): Recognize `%% actions' instead of
23620 `$'.
23621 * src/bison.s1: s/$/%% actions/.
23622 * src/bison.hairy: Likewise.
23623
ef7ddedd
AD
236242000-12-19 Akim Demaille <akim@epita.fr>
23625
23626 * src/output.c (output_parser): Compute the `#line' lines when
23627 there are.
23628 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
23629 Suggested by Hans Aberg.
23630
ff61dabd
AD
236312000-12-19 Akim Demaille <akim@epita.fr>
23632
23633 Let the handling of the skeleton files be local to the procedures
23634 that use it.
23635
23636 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
23637 longer static.
23638 (fparser, open_extra_files): Remove.
23639 (open_files, output_files): Don't take care of fparser.
23640 * src/files.h: Adjust.
23641 * src/output.c (output_parser): Open and close the file to the
23642 skeleton.
23643 * src/reader.c (read_declarations): When %semantic_parser, open
23644 fguard.
23645
55b96341
AD
236462000-12-19 Akim Demaille <akim@epita.fr>
23647
23648 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
23649 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
23650
358c15b7
AD
236512000-12-19 Akim Demaille <akim@epita.fr>
23652
23653 * src/files.c (open_files): Yipee! We no longer need all the code
23654 looking for `/tmp' since we have no tmp file.
23655
7de3329e
AD
236562000-12-19 Akim Demaille <akim@epita.fr>
23657
23658 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
23659 New macros.
23660 * src/files.c (open_files): Less dependency on MSDOS etc.
23661
3abcd459
AD
236622000-12-14 Akim Demaille <akim@epita.fr>
23663
23664 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
23665 Provide a default definition.
23666 Use it when executing the default @ action.
23667 * src/reader.c (reader_output_yylsp): No longer include
23668 `timestamp' and `text' in the default YYLTYPE.
23669
2a91a95e
AD
236702000-12-12 Akim Demaille <akim@epita.fr>
23671
23672 * src/reader.c (copy_definition, parse_union_decl, copy_action)
23673 (copy_guard): Quote the file names.
23674 Reported by Laurent Mascherpa.
23675
14d3eb9b
AD
236762000-12-12 Akim Demaille <akim@epita.fr>
23677
23678 * src/output.c (output_headers, output_program, output): Be sure
23679 to escape special characters when outputting filenames.
23680 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
23681 (output_headers): Don't depend on them, Use ACTSTR.
23682
d7045ec6
AD
236832000-11-17 Akim Demaille <akim@epita.fr>
23684
23685 * lib/obstack.h: Formatting changes.
23686 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
23687 prevents type checking.
23688 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
23689 cast the value to (void *): assigning a `foo *' to a `void *'
23690 variable is valid.
23691 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
23692 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
23693 append characters.
23694
6fd54b73
AD
236952000-11-17 Akim Demaille <akim@epita.fr>
23696
23697 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
23698 as...
23699 (suite.m4, regression.m4, calc.m4): these.
23700 * tests/atgeneral.m4: Update from CVS Autoconf.
23701
4c50eae6
AD
237022000-11-17 Akim Demaille <akim@epita.fr>
23703
23704 * tests/regression.m4 (%union and --defines): New test,
23705 demonstrating a current bug in the obstack implementation.
23706
a35f64ea
AD
237072000-11-17 Akim Demaille <akim@epita.fr>
23708
23709 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
23710 macros.
23711 Use them to declare the variables which are global or local to
23712 `yyparse'.
23713
7de23534
AD
237142000-11-17 Akim Demaille <akim@epita.fr>
23715
23716 * acconfig.h: Remove, no longer used.
23717
aa7815f5
AD
237182000-11-07 Akim Demaille <akim@epita.fr>
23719
23720 * src: s/Copyright (C)/Copyright/g.
23721
5af1f549
AD
237222000-11-07 Akim Demaille <akim@epita.fr>
23723
23724 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
23725 defining.
23726 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
23727
553e2b22
AD
237282000-11-07 Akim Demaille <akim@epita.fr>
23729
23730 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
23731 Merge in a single CPP if/else.
23732
8a4f41d6
AD
237332000-11-07 Akim Demaille <akim@epita.fr>
23734
23735 * src/output.c (output): Remove useless variables.
23736 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
23737 argument `data' for consistency with the prototypes.
23738 Qualify it `const'.
23739 (obstack_copy, obstack_copy0): Rename the second argument as
23740 `address' for consistency. Qualify it `const'.
23741 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
23742 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
23743 `const' their input argument (`data' or `address').
23744 Adjust the corresponding macros to include `const' in casts.
23745
095a3fb5
AD
237462000-11-03 Akim Demaille <akim@epita.fr>
23747
23748 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
23749 s/PFILE1/BISON_HAIRY/.
23750 Adjust dependencies.
23751
d1cdce7c
AD
237522000-11-03 Akim Demaille <akim@epita.fr>
23753
090c5ebf 23754 For some reason, this was not applied.
d1cdce7c
AD
23755
23756 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23757 `unlink': it's no longer used.
23758
9311529b
AD
237592000-11-03 Akim Demaille <akim@epita.fr>
23760
23761 * src/files.c (skeleton_find): New function, eved out of...
23762 (open_files, open_extra_files): here.
23763
d8880f69
AD
237642000-11-03 Akim Demaille <akim@epita.fr>
23765
23766 Don't use `atexit'.
23767
23768 * src/files.c (obstack_save): New function.
23769 (done): Rename as...
23770 (output_files): this.
23771 Use `obstack_save'.
23772 * src/main.c (main): Don't use `atexit' to register `done', since
23773 it no longer has to remove tmp files, just call `output_files'
23774 when there are no errors.
23775
0dbb648e
AD
237762000-11-02 Akim Demaille <akim@epita.fr>
23777
23778 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23779 `unlink': it's no longer used.
23780 * src/files.h: Formatting changes.
23781
896fe5c1
AD
237822000-11-02 Akim Demaille <akim@epita.fr>
23783
23784 Remove the last uses of mktemp and unlink/delete.
23785
23786 * src/files.c (fdefines, ftable): Removed.
23787 (defines_ostack, table_obstack): New.
23788 Adjust dependencies of the former into uses of the latter.
23789 * src/output.c (output_short_or_char_table, output_short_table):
23790 Convert to using obstacks.
23791 * src/reader.c (copy_comment2): Accept one FILE * and two
23792 obstacks.
23793 (output_token_defines, reader_output_yylsp): Use obstacks.
23794 * src/system.h (obstack_fgrow3): New.
1f65350a 23795 * po/POTFILES.in: Adjust.
896fe5c1 23796
dd60faec
AD
237972000-11-01 Akim Demaille <akim@epita.fr>
23798
23799 Change each use of `fattrs' into a use of `attrs_obstack'.
23800
23801 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
23802 * src/files.c (fattrs): Remove.
23803 (attrs_obstack): New.
23804 Adjust all dependencies.
23805 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
23806
8c7ebe49
AD
238072000-11-01 Akim Demaille <akim@epita.fr>
23808
23809 Introduce obstacks.
23810 Change each use of `faction' into a use of `action_obstack'.
23811
23812 * lib/obstack.h, lib/obstack.c: New files.
23813 * src/files.c (faction): Remove.
23814 (action_obstack): New.
23815 Adjust all dependencies.
23816
77aee789
AD
238172000-10-20 Akim Demaille <akim@epita.fr>
23818
23819 * lib/quote.h (PARAMS): New macro. Use it.
23820
43591cec
AD
238212000-10-16 Akim Demaille <akim@epita.fr>
23822
23823 * src/output.c (output_short_or_char_table): New function.
23824 (output_short_table, output_token_translations): Use it.
23825 (goto_actions): Use output_short_table.
23826
1e9798d5
AD
238272000-10-16 Akim Demaille <akim@epita.fr>
23828
23829 * src/symtab.c (bucket_new): New function.
23830 (getsym): Use it.
23831
23832 * src/output.c (output_short_table): New argument to display the
23833 comment associated with the table.
23834 Adjust dependencies.
23835 (output_gram): Use it.
23836 (output_rule_data): Nicer output layout for YYTNAME.
23837
f282676b
AD
238382000-10-16 Akim Demaille <akim@epita.fr>
23839
23840 * src/lex.c (read_typename): New function.
23841 (lex): Use it.
23842 * src/reader.c (copy_dollar): Likewise.
23843
550a72a3
AD
238442000-10-16 Akim Demaille <akim@epita.fr>
23845
23846 * src/reader.c (copy_comment2): Expect the input stream to be on
23847 the `/' which is suspected to open a comment, instead of being
23848 called after `//' or `/*' was read.
23849 (copy_comment, copy_definition, parse_union_decl, copy_action)
23850 (copy_guard): Adjust.
23851
131e2fef
AD
238522000-10-16 Akim Demaille <akim@epita.fr>
23853
23854 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
23855 `read_signed_integer'.
23856
79282c5a
AD
238572000-10-16 Akim Demaille <akim@epita.fr>
23858
23859 * src/reader.c (copy_dollar): New function.
23860 (copy_guard, copy_action): Use it.
23861
ff4a34be
AD
238622000-10-16 Akim Demaille <akim@epita.fr>
23863
23864 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
23865 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
23866 New files, from Fileutils 4.0.27.
23867 * src/main.c (printable_version): Remove.
23868 * src/lex.c, src/reader.c: Use `quote'.
23869
238702000-10-04 Akim Demaille <akim@epita.fr>
23871
23872 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
23873
14ded682
AD
238742000-10-04 Akim Demaille <akim@epita.fr>
23875
23876 * doc/bison.texinfo: Various typos spotted by Neil Booth.
23877
8e03724b
AD
238782000-10-04 Akim Demaille <akim@epita.fr>
23879
23880 When a literal string is used to define two different tokens,
23881 `bison -v' segfaults.
23882 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
23883
23884 * tests/regression.m4: New file.
23885 Include the core of the sample provided by Piotr Gackiewicz.
23886 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
23887 properly.
23888
a9e64249
AD
238892000-10-04 Akim Demaille <akim@epita.fr>
23890
23891 * src/reader.c (parse_expect_decl): Keep `count' within the size
23892 of `buffer'.
23893 From Neil Booth.
23894
da9abf43
AD
238952000-10-02 Paul Eggert <eggert@twinsun.com>
23896
23897 * bison.s1 (yyparse): Assign the default value
23898 unconditionally, to avoid a GCC warning and make the parser a
23899 tad smaller.
23900
c33638bb
AD
239012000-10-02 Akim Demaille <akim@epita.fr>
23902
23903 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
23904 options.
23905
444c570a
AD
239062000-10-02 Akim Demaille <akim@epita.fr>
23907
23908 * src/derives.c, src/print.c, src/reduce.c: To ease the
23909 translation, move some `\n' out of the translated strings.
23910
89cab50d
AD
239112000-10-02 Akim Demaille <akim@epita.fr>
23912
23913 The location tracking mechanism is precious for parse error
23914 messages. Nevertheless, it is enabled only when `@n' is used in
23915 the grammar, which is a different issue (you can use it in error
23916 message, but not in the grammar per se). Therefore, there should
23917 be another means to enable it.
23918
23919 * src/getargs.c (getargs): Support `--locations'.
23920 (usage): Report it.
23921 * src/getargs.h (locationsflag): Export it.
23922 * src/lex.c (percent_table): Support `%locations'.
23923 * src/reader.c (yylsp_needed): Remove this variable, now replaced
23924 with `locationsflag'.
23925 * doc/bison.texinfo: Document `--locations' and `%locations'.
23926 Sort the options.
23927 * tests/calc.m4: Test it.
23928
23929 For regularity of the names, replace each
23930 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
23931 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
23932 In addition replace each `flag' with `_flag'.
23933
d6c2cba0
AD
239342000-10-02 Akim Demaille <akim@epita.fr>
23935
23936 Also test parse error messages, including with YYERROR_VERBOSE.
23937
23938 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
23939 associative).
23940 Use it to check the computations.
23941 Use it to check `nonassoc' is honored.
23942 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
23943 `--yyerror-verbose'.
23944 (_AT_CHECK_CALC): Adjust to this option.
23945 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
23946
5a35a6cb
AD
239472000-10-02 Akim Demaille <akim@epita.fr>
23948
23949 Test also `--verbose', `--defines' and `--name-prefix'. Testing
23950 the latter demonstrates a flaw in the handling of non debugging
23951 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
23952 was used in order to simplify:
23953
23954 #if YYDEBUG
23955 if (yydebug)
23956 {
23957 ...
23958 }
23959 #endif
23960
23961 into
23962
23963 if (yydebug)
23964 {
23965 ...
23966 }
23967
23968 unfortunately this leads to a CPP conflict when
23969 `--name-prefix=foo' is used since it produces `#define yydebug
23970 foodebug'.
23971
23972 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
23973 (YYDPRINTF): New macro.
23974 Spread its use.
23975 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
23976 the bison options.
23977 Also test `--verbose', `--defines' and `--name-prefix'.
23978
71da9eea
AD
239792000-10-02 Akim Demaille <akim@epita.fr>
23980
23981 Improve the readability of the produced parsers.
23982
23983 * src/bison.s1: Formatting changes.
23984 Improve the comment related to the `$' mark.
23985 (yydefault): Don't fall through to `yyresume': `goto' there.
23986 * src/output.c (output_parser): When the `$' is met, skip the end
23987 of its line.
23988 New variable, `number_of_dollar_signs', to check there's exactly
23989 one `$' in the parser skeleton.
23990
95e36146
AD
239912000-10-02 Akim Demaille <akim@epita.fr>
23992
23993 * lib/xstrdup.c: New file, from the fileutils.
23994 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
23995 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
23996 instead of strlen + xmalloc + strcpy.
23997 * src/symtab.c (copys): Remove, use xstrdup instead.
23998
d7020c20
AD
239992000-10-02 Akim Demaille <akim@epita.fr>
24000
24001 * src/gram.h (associativity): New enum type which replaces the
24002 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
24003 `right_assoc', `left_assoc' and `non_assoc'.
24004 Adjust all dependencies.
24005 * src/reader.c: Formatting changes.
24006 (LTYPESTR): Don't define it, use it as a literal in
24007 `reader_output_yylsp'.
24008 * src/symtab.h (symbol_class): New enum type which replaces the
24009 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
24010 `sunknown', `stoken and `snterm'.
24011
1916f98e
AD
240122000-10-02 Akim Demaille <akim@epita.fr>
24013
24014 * src/getargs.c (fixed_outfiles): Rename as...
24015 (yaccflag): for consistency and accuracy.
24016 Adjust dependencies.
24017
d7913476
AD
240182000-10-02 Akim Demaille <akim@epita.fr>
24019
24020 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
24021 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
24022 difficult and introduced a lot of core dump. It turns out that
24023 Bison used an implementation of `xmalloc' based on `calloc', and
24024 at various places it does depend upon the initialization to 0. I
24025 have not tried to isolate the pertinent places, and all the former
24026 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
24027 someone should address this issue.
24028
24029 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
24030 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
24031 files.
24032 Adjust dependencies.
24033 * src/warshall.h: New file.
24034 Propagate.
24035
340ef489
AD
240362000-10-02 Akim Demaille <akim@epita.fr>
24037
24038 Various anti-`extern in *.c' changes.
24039
24040 * src/system.h: Include `assert.h'.
24041
b2ca4022
AD
240422000-10-02 Akim Demaille <akim@epita.fr>
24043
24044 * src/state.h (nstates, final_state, first_state, first_shift)
24045 (first_reduction): Move their exportation from here...
24046 * src/LR0.h: to here.
24047 Adjust dependencies.
24048 * src/getargs.c (statisticsflag): New variable.
24049 Add support for `--statistics'.
24050 Adjust dependencies.
24051
24052 Remove a lot of now useless `extern' statements in most files.
24053
403b315b
AD
240542000-10-02 Akim Demaille <akim@epita.fr>
24055
24056 * src/LR0.h: New file.
24057 Propagate its use.
24058
07a58c13
AD
240592000-10-02 Akim Demaille <akim@epita.fr>
24060
24061 * src/print.h: New file.
24062 Propagate its use.
24063 * src/print.c: Formatting and ordering changes.
24064 (verbose, terse): Replace with...
24065 (print_results): this new function.
24066 Adjust dependencies.
24067
0619caf0
AD
240682000-10-02 Akim Demaille <akim@epita.fr>
24069
24070 * src/conflicts.c (conflict_report): New function.
24071 (conflict_log, verbose_conflict_log): Replace with...
24072 (print_conflicts): this function.
24073 Adjust dependencies.
24074 * src/conflicts.h: New file.
24075 Propagate its inclusion.
24076
3519ec76
AD
240772000-10-02 Akim Demaille <akim@epita.fr>
24078
24079 * src/nullable.h: New file.
24080 Propagate its inclusion.
24081 * src/nullable.c: Formatting changes.
24082
015acc48
AD
240832000-10-02 Akim Demaille <akim@epita.fr>
24084
24085 * src/reduce.h: New file.
24086 Propagate its inclusion.
24087 * src/reduce.c: Topological sort and other formatting changes.
24088 (bool, TRUE, FALSE): Move their definition to...
24089 * src/system.h: here.
24090
8963a27b
AD
240912000-10-02 Akim Demaille <akim@epita.fr>
24092
24093 * src/files.c: Formatting changes.
24094 (tryopen, tryclose, openfiles): Rename as...
24095 (xfopen, xfclose, open_files): this.
24096 (stringappend): static.
24097 * src/files.h: Complete the list of exported symbols.
24098 Propagate its use.
24099
a70083a3
AD
241002000-10-02 Akim Demaille <akim@epita.fr>
24101
24102 * src/reader.h: New file.
24103 Propagate its use instead of tedious list of `extern' and
24104 prototypes.
24105 * src/reader.c: Formatting changes, topological sort,
24106 s/register//.
24107
abadc117
AD
241082000-10-02 Akim Demaille <akim@epita.fr>
24109
24110 * src/lex.h: Prototype `lex.c' exported functions.
24111 * src/reader.c: Adjust.
24112 * src/lex.c: Formatting changes.
24113 (safegetc): Rename as...
24114 (xgetc): this.
24115
720d742f
AD
241162000-10-02 Akim Demaille <akim@epita.fr>
24117
24118 * src/lalr.h: New file.
24119 Propagate its inclusion instead of prototypes and `extern'.
24120 * src/lalr.c: Formatting changes, topological sorting etc.
24121
f2acea59
AD
241222000-10-02 Akim Demaille <akim@epita.fr>
24123
24124 * src/output.c (token_actions): Introduce a temporary array,
24125 YYDEFACT, that makes it possible for this function to use
24126 output_short_table.
24127
d019d655
AD
241282000-10-02 Akim Demaille <akim@epita.fr>
24129
24130 `user_toknums' is output as a `short[]' in `output.c', while it is
24131 defined as a `int[]' in `reader.c'. For consistency with the
24132 other output tables, `user_toknums' is now defined as a table of
24133 shorts.
24134
24135 * src/reader.c (user_toknums): Be a short table instead of an int
24136 table.
24137 Adjust dependencies.
24138
24139 Factor the short table outputs.
24140
24141 * src/output.c (output_short_table): New function.
24142 * src/output.c (output_gram, output_stos, output_rule_data)
24143 (output_base, output_table, output_check): Use it.
24144
6c89f1c1
AD
241452000-10-02 Akim Demaille <akim@epita.fr>
24146
24147 * src/output.c (output): Topological sort of the functions, in
24148 order to get rid of the `static' prototypes.
24149 No longer use `register'.
24150 * src/output.h: New file.
24151 Propagate its inclusion in files explicitly prototyping functions
24152 from output.c.
24153
d9efd181
AD
241542000-09-21 Akim Demaille <akim@epita.fr>
24155
24156 * src/atgeneral.m4: Update from Autoconf.
24157
c29240e7 241582000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
24159
24160 * src/closure.h: New file.
24161 * src/closure.c: Formatting changes, topological sort over the
24162 functions, use of closure.h.
24163 (initialize_closure, finalize_closure): Rename as...
24164 (new_closure, free_closure): these. Adjust dependencies.
24165 * src/LR0.c: Formatting changes, topological sort, use of
24166 cloture.h.
24167 (initialize_states): Rename as...
24168 (new_states): this.
24169 * src/Makefile.am (noinst_HEADERS): Adjust.
24170
499daa50
AD
241712000-09-20 Akim Demaille <akim@epita.fr>
24172
24173 * src/acconfig.h: Don't protect config.h against multiple
24174 inclusion.
24175 Don't define PARAMS.
24176 * src/system.h: Define PARAMS.
24177 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
24178 purpose of config.h. system.h must not try to fix wrong
24179 definitions in config.h.
24180
cc84fd5d
AD
241812000-09-20 Akim Demaille <akim@epita.fr>
24182
24183 * src/derives.h: New file.
24184 * src/main.c, src/derives.h: Use it.
24185 Formatting changes.
24186 * src/Makefile.am (noinst_HEADERS): Adjust.
24187
db5b3a89
AD
241882000-09-20 Akim Demaille <akim@epita.fr>
24189
24190 * tests/atgeneral.m4: Update from Autoconf.
24191 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
24192 (AT_CHECK_CALC): New macros.
24193 Use these macros to test bison with options `', `--raw',
24194 `--debug', `--yacc', `--yacc --debug'.
24195
ceed8467
AD
241962000-09-19 Akim Demaille <akim@epita.fr>
24197
24198 * src/output.c: Formatting changes.
24199 * src/machine.h: Remove, leaving its contents in...
24200 * src/system.h: here.
24201 Include stdio.h.
24202 Adjust all dependencies on stdio.h and machine.h.
24203 * src/getargs.h: New file.
24204 Let all `extern' declarations about getargs.c be replaced with
24205 inclusion of `getargs.h'.
24206 * src/Makefile.am (noinst_HEADERS): Adjust.
24207
24208 * tests/calc.m4 (yyin): Be initialized in main, not on the global
24209 scope.
24210 (yyerror): Returns void, not int.
24211 * doc/bison.texinfo: Formatting changes.
24212
05a1d24b
AD
242132000-09-19 Akim Demaille <akim@epita.fr>
24214
24215 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
24216 portable.
24217
cbd25751
AD
242182000-09-18 Akim Demaille <akim@epita.fr>
24219
24220 * configure.in: Append WARNING_CFLAGS to CFLAGS.
24221 * src/Makefile.am (INCLUDES): Don't.
24222 Be ready to fetch headers in lib/.
24223
13863333
AD
242242000-09-18 Akim Demaille <akim@epita.fr>
24225
24226 * doc/bison.texinfo: Update the copyright.
24227 ANSIfy and GNUify the examples.
24228 Remove the old menu.
24229
0d533154
AD
242302000-09-18 Akim Demaille <akim@epita.fr>
24231
24232 First set of tests: use the `calc' example from the documentation.
24233
24234 * src/bison.s1 (yyparse): Condition the code using `yytname' which
24235 is defined only when YYDEBUG is.
24236 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
24237 * src/files.c (tryopen, tryclose): Formatting changes.
24238 Move to the top and be static.
24239 * src/reader.c (read_signed_integer): Likewise.
24240 * tests/calc.m4: New file.
24241 * Makefile.am, suite.m4: Adjust.
24242 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
24243
e79137ac
AD
242442000-09-18 Akim Demaille <akim@epita.fr>
24245
24246 Add support for an Autotest test suite for Bison.
24247
24248 * m4/m4.m4, m4/atconfig.m4: New files.
24249 * m4/Makefile.am (EXTRA_DIST): Adjust.
24250 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
24251 files.
24252 * src/getargs.c: Display a more standard --version message.
24253 * src/reader.c (reader): Formatting changes.
24254 No longer depend upon VERSION_STRING.
24255 * configure.in: No longer use `dnl'.
24256 Set up the test suite and the new directory `tests/.
24257 (VERSION_STRING): Remove.
24258
27821bff
AD
242592000-04-14 Akim Demaille <akim@epita.fr>
24260
24261 * src/reader.c (copy_comment2): New function, same as former
24262 `copy_comment', but outputs into two FILE *.
24263 (copy_comment): Use it.
24264 (parse_union_decl): Use it.
24265 (get_type, parse_start_decl): Use the same `invalid' message.
24266 (parse_start_decl, parse_union_decl): Use the same `multiple'
24267 message.
24268 (parse_union_decl, copy_guard, copy_action): Use the same
24269 `unmatched' message.
24270 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
24271
cfe5fbc0
AD
242722000-03-31 Akim Demaille <akim@epita.fr>
24273
24274 * src/files.c (tryopen, tryclose): Move to the top.
24275 Be static.
24276
cb7db13e
AD
242772000-03-31 Akim Demaille <akim@epita.fr>
24278
24279 * src/main.c (main): Don't call `done', exit does it.
24280
a0f6b076
AD
242812000-03-31 Akim Demaille <akim@epita.fr>
24282
36281465
AD
24283 * allocate.c: s/return (foo)/return foo/.
24284 * lalr.c: Likewise.
24285 * LR0.c: Likewise.
24286 * output.c: Likewise.
24287 * reader.c: Likewise.
24288 * symtab.c: Likewise.
24289 * vmsgetargs.c: Likewise.
24290
242912000-03-31 Akim Demaille <akim@epita.fr>
24292
24293 Clean up the error reporting functions.
a0f6b076
AD
24294
24295 * src/report.c: New file.
24296 * src/report.h: Likewise.
24297 * src/Makefile.am: Adjust.
24298 * m4/error.m4: New file.
24299 * m4/Makefile.am: Adjust.
24300 * configure.in (jm_PREREQ_ERROR): Call it.
24301 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
24302 Remove.
24303 (fatal, fatals): Remove. All callers use complain.c::fatal.
24304 (warn, warni, warns, warnss, warnss): Remove. All callers use
24305 complain.c::complain.
24306 (toomany): Remove, use fatal instead.
24307 * src/files.c (done): No argument, use complain_message_count.
24308 * src/main.c (main): Register `done' to `atexit'.
24309
24310 * src/getargs.c (usage): More `fputs', less `fprintf'.
24311
18539825
AD
243122000-03-28 Akim Demaille <akim@epita.fr>
24313
24314 * lib/: New directory.
24315 * Makefile.am (SUBDIRS): Adjust.
24316 * configure.in: Adjust.
24317 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
24318 useless.
24319 * src/alloca.c: Moved to lib/.
24320 * src/getopt.c: Likewise.
24321 * src/getopt1.c: Likewise.
24322 * src/getopt.h: Likewise.
24323 * src/ansi2knr.c: Likewise.
24324 * src/ansi2knr.1: Likewise.
24325 * src/Makefile.am: Adjust.
24326 * lib/Makefile.am: New file.
24327
9f306f2a
AD
243282000-03-28 Akim Demaille <akim@epita.fr>
24329
24330 * src/getargs.c (usage): Refresh the help message.
24331
0ba347b6
AD
243322000-03-17 Akim Demaille <akim@epita.fr>
24333
24334 * src/getopt1.c: Updated from textutils 2.0e
24335 * src/getopt.c: Likewise.
24336 * src/getopt.h: Likewise.
24337
dbe7f271
AD
243382000-03-17 Akim Demaille <akim@epita.fr>
24339
24340 * src/Makefile.am (bison.simple): Fix the awk program: quote only
24341 the file name, not the whole `#line LINE FILE'.
24342
75bbe78d
AD
243432000-03-17 Akim Demaille <akim@epita.fr>
24344
24345 On syntax errors, report the token on which we choked.
24346
aa5fd0ee
AD
24347 * src/bison.s1 (yyparse): In the label yyerrlab, when
24348 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 24349
7b306f52
AD
243502000-03-17 Akim Demaille <akim@epita.fr>
24351
aa5fd0ee 24352 * src/reader.c (copy_at): New function.
7b306f52
AD
24353 (copy_guard): Use it.
24354 (copy_action): Use it.
24355
e87b5700
AD
243562000-03-17 Akim Demaille <akim@epita.fr>
24357
24358 Be kind to translators, save some useless translations.
24359
aa5fd0ee 24360 * src/main.c (banner): New function.
e87b5700
AD
24361 (fatal_banner): Use it.
24362 (warn_banner): Use it.
24363
ae3c3164
AD
243642000-03-17 Akim Demaille <akim@epita.fr>
24365
aa5fd0ee
AD
24366 * src/reader.c (copy_definition): Use copy_string and
24367 copy_comment. Removed now unused `match', `ended',
24368 `cplus_comment'.
ae3c3164
AD
24369 (copy_comment, copy_string): Moved, to be visible from
24370 copy_definition.
24371
4dc58e7c
AD
243722000-03-17 Akim Demaille <akim@epita.fr>
24373
aa5fd0ee
AD
24374 * src/reader.c (copy_string): Declare `static inline'. No
24375 problems with inline, since it is checked by configure.
4dc58e7c
AD
24376 (copy_comment): Likewise.
24377
0a6384c4
AD
243782000-03-17 Akim Demaille <akim@epita.fr>
24379
aa5fd0ee 24380 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 24381
3cef001a
AD
243822000-03-17 Akim Demaille <akim@epita.fr>
24383
aa5fd0ee 24384 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
24385 (copy_action): Use it. Removed now unused `match', `ended',
24386 `cplus_comment'.
24387 (copy_guard): Likewise.
24388
ca36d2ef
AD
243892000-03-17 Akim Demaille <akim@epita.fr>
24390
aa5fd0ee 24391 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
24392 (copy_action): Use it.
24393 (copy_guard): Likewise.
24394
6666f98f
AD
243952000-03-17 Akim Demaille <akim@epita.fr>
24396
24397 Change the handling of @s so that they behave exactly like $s.
24398 There is now a pseudo variable @$ (readble and writable), location
24399 of the lhs of the rule (by default ranging from the location of
24400 the first symbol of the rhs, to the location of the last symbol,
24401 or, if the rhs is empty, YYLLOC).
24402
24403 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
24404 yyval.
24405 (yyparse): When providing a default semantic action, provide a
24406 default location action.
24407 (after the $): No longer change `*YYLSP', just stack YYLOC the
24408 same way you stack YYVAL.
24409 * src/reader.c (read_declarations): Use warns.
24410 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
24411 (copy_action, case '@'): Likewise.
24412 Use a standard error message, to save useless work from
24413 translators.
24414
41aca2e0
AD
244152000-03-17 Akim Demaille <akim@epita.fr>
24416
aa5fd0ee
AD
24417 * src/bison.s1: Formatting and cosmetics changes.
24418 * src/reader.c: Likewise.
41aca2e0
AD
24419 Update the Copyright notice.
24420
dc08c1d5
AD
244212000-03-17 Akim Demaille <akim@epita.fr>
24422
aa5fd0ee
AD
24423 * src/bison.s1 (#line): All set to `#line' only, since the
24424 Makefile now handles them.
dc08c1d5 24425
9ee3c97b
AD
244262000-03-16 Akim Demaille <akim@epita.fr>
24427
24428 * src/output.c (output_rule_data): Output the documentation of
24429 some of the tables.
24430 (Copyright notice): Update.
24431 Formatting changes.
24432
0de741ca
AD
244332000-03-16 Akim Demaille <akim@epita.fr>
24434
24435 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
24436 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
24437 One `#if YYDEBUG' remains, since it uses variables which are
24438 defined only if `YYDEBUG != 0'.
24439
bb10be54
AD
244402000-03-16 Akim Demaille <akim@epita.fr>
24441
24442 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
24443 and related variables so that the similarities are highlighted.
24444
b07b484a
AD
244452000-03-16 Akim Demaille <akim@epita.fr>
24446
24447 * src/bison.s1: Properly indent CPP directives.
24448
361f60b3
AD
244492000-03-16 Akim Demaille <akim@epita.fr>
24450
24451 * src/bison.s1: Properly indent the `alloca' CPP section.
24452
8c44d3ec
AD
244532000-03-16 Akim Demaille <akim@epita.fr>
24454
24455 Do not hard code values of directories in `configure.in'.
24456 Update the `configure' tool chain.
24457
24458 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
24459 src/makefile.am.
24460 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
24461 (AC_OUTPUT): Add m4/Makefile.
24462 Bump to bison 1.28a, 1.29 has never been released.
24463 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
24464 handled via src/Makefile.am.
24465 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
24466 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
24467 autoheader.
24468 * Makefile.am (SUBDIRS): Add m4.
24469 (ACLOCAL_AM_FLAGS): New variable.
24470 (AUTOMAKE_OPTIONS): Add check-news.
24471 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
24472 the proper line number and file name.
24473 (DEFS): Propagate the location of bison library files and of the
24474 locale files.
24475 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
24476 builddir.
24477 * acinclude.m4: Remove, replaced by the directory m4.
24478 * m4/Makefile.am (EXTRA_DIST): New variable.
24479 * m4/gettext.m4: New file, from the fileutils.
24480 * m4/lcmessage.m4: Likewise
24481 * m4/progtest.m4: Likewise.
24482 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
24483
f95997e7
AD
244842000-03-10 Akim Demaille <akim@epita.fr>
24485
24486 * src/closure.c:
24487 Formatting changes of various comments.
24488 Respect the GNU coding standards at various places.
24489 Don't use `_()' when no translation is needed.
24490
244911999-12-13 Jesse Thilo <jthilo@gnu.org>
24492
24493 * src/files.c:
24494 OS/2 honors TMPDIR environment variable.
24495
244961999-12-13 Jesse Thilo <jthilo@gnu.org>
24497
24498 * doc/bison.texinfo: Tweaked spelling and grammar.
24499 Updated ISBN.
24500 Removed reference to price of printed copy.
24501 Mention BISON_SIMPLE and BISON_HAIRY.
24502
245031999-12-13 Jesse Thilo <jthilo@gnu.org>
24504
24505 * configure.in, NEWS:
24506 Bison 1.29 released.
24507
245081999-10-27 Jesse Thilo <jthilo@gnu.org>
24509
24510 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
24511 Added reference card.
24512
245131999-07-26 Jesse Thilo <jthilo@gnu.org>
24514
24515 * po/ru.po: Added Russian translation.
24516
245171999-07-26 Jesse Thilo <jthilo@gnu.org>
24518
24519 * configure.in: Added Russian translation.
24520
245211999-07-06 Jesse Thilo <jthilo@gnu.org>
24522
24523 * configure.in, NEWS, README:
24524 Released version 1.28.
24525
245261999-06-14 Jesse Thilo <jthilo@gnu.org>
24527
24528 * src/system.h:
24529 Squashed redefinition warning on some systems.
24530
24531 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
24532 Have configure build version string instead of relying on ANSI string
24533 concatentation.
24534
245351999-06-14 Jesse Thilo <jthilo@gnu.org>
24536
24537 * po/POTFILES.in: Got rid of version.c.
24538
245391999-06-14 Jesse Thilo <jthilo@gnu.org>
24540
24541 * acconfig.h, configure.in:
24542 Have configure build version string instead of relying on ANSI string
24543 concatentation.
24544
245451999-06-08 Jesse Thilo <jthilo@gnu.org>
24546
24547 * doc/bison.1:
24548 Dropped mention of `+' for long-named options.
24549
245501999-05-30 Jesse Thilo <jthilo@gnu.org>
24551
24552 * src/files.c: Added <unistd.h> for unlink().
24553
24554 * src/Makefile.am, src/system.h:
24555 I18n fixes.
24556
245571999-05-30 Jesse Thilo <jthilo@gnu.org>
24558
24559 * README: Added a FAQ list.
24560
24561 * configure.in, acconfig.h:
24562 I18n fixes.
24563
245641999-05-30 Jesse Thilo <jthilo@gnu.org>
24565
24566 * doc/FAQ, doc/Makefile.am:
24567 Added a FAQ list.
24568
245691999-05-19 Jesse Thilo <jthilo@gnu.org>
24570
24571 * src/alloc.h, src/symtab.h, src/version.c:
24572 Protected inclusion of "config.h" with HAVE_CONFIG_H.
24573
245741999-04-18 Jesse Thilo <jthilo@gnu.org>
24575
24576 * src/.cvsignore, src/Makefile.am:
24577 Reorganized: sources in `src', documentation in `doc'.
24578
24579 * src/lex.c (literalchar):
24580 fixed the code for escaping double quotes (thanks
24581 Jonathan Czisny.)
24582
245831999-04-18 Jesse Thilo <jthilo@gnu.org>
24584
24585 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
24586 Adjusted paths to reflect directory reorganization.
24587
245881999-04-18 Jesse Thilo <jthilo@gnu.org>
24589
24590 * doc/.cvsignore, doc/Makefile.am:
24591 Reorganized: sources in `src', documentation in `doc'.
24592
245931999-04-18 Jesse Thilo <jthilo@gnu.org>
24594
24595 * configure.in:
24596 Updated AC_INIT file to reflect directory reorganization.
24597
24598 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
24599 Reorganized: sources in `src', documentation in `doc'.
24600
246011999-04-13 Jesse Thilo <jthilo@gnu.org>
24602
24603 * src/allocate.c:
24604 Don't declare calloc() and realloc() if not necessary.
24605
246061999-04-13 Jesse Thilo <jthilo@gnu.org>
24607
24608 * configure.in, acconfig.h, acinclude.m4:
24609 Don't declare calloc() and realloc() if not necessary.
24610
246111999-03-23 Jesse Thilo <jthilo@gnu.org>
24612
24613 * po/.cvsignore: Added i18n support.
24614
246151999-03-23 Jesse Thilo <jthilo@gnu.org>
24616
24617 * acconfig.h, configure.in, Makefile.am:
24618 Added i18n support.
24619
246201999-03-22 Jesse Thilo <jthilo@gnu.org>
24621
24622 * src/bison.s1: Fixed #line numbers.
24623
246241999-03-15 Jesse Thilo <jthilo@gnu.org>
24625
24626 * po/es.po, po/fr.po, po/nl.po, po/de.po:
24627 Added PO files from Translation Project.
24628
246291999-03-03 Jesse Thilo <jthilo@gnu.org>
24630
24631 * Makefile.am:
24632 Added support for non-ANSI compilers (ansi2knr).
24633
246341999-02-16 Jesse Thilo <jthilo@gnu.org>
24635
24636 * configure.in: Bumped version number to 1.27.
24637
24638 * Makefile.am:
24639 Added `bison.simple' to list of files removed by `make distclean'.
24640
246411999-02-12 Jesse Thilo <jthilo@gnu.org>
24642
24643 * src/files.c, src/files.h:
24644 Defined locations of parser files in config.h instead of Makefile.
24645
246461999-02-12 Jesse Thilo <jthilo@gnu.org>
24647
24648 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
24649 Defined locations of parser files in config.h instead of Makefile.
24650
246511999-02-09 Jesse Thilo <jthilo@gnu.org>
24652
24653 * Makefile.am:
24654 Removed inappropriate use of $< macro.
24655
246561999-02-05 Jesse Thilo <jthilo@gnu.org>
24657
24658 * po/Makefile.in.in, po/POTFILES.in:
24659 Add `po' directory skeleton.
24660
246611999-01-27 Jesse Thilo <jthilo@gnu.org>
24662
24663 * README: Document help-bison list.
24664
24665 * configure.in: Add check for mkstemp().
24666
246671999-01-20 Jesse Thilo <jthilo@gnu.org>
24668
24669 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
24670 Hush a few compiler warnings.
24671
24672 * src/files.c:
24673 Add tryclose(), which verifies that fclose was successful.
24674 Hush a couple of compiler warnings.
24675
246761999-01-20 Jesse Thilo <jthilo@gnu.org>
24677
24678 * Makefile.am, OChangeLog:
24679 ChangeLog is now automatically generated. Include the old version as
24680 OChangeLog.
24681
246821999-01-14 Jesse Thilo <jthilo@gnu.org>
24683
24684 * 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:
24685 Update FSF address.
24686
246871999-01-14 Jesse Thilo <jthilo@gnu.org>
24688
24689 * doc/bison.texinfo: Fix formatting glitch.
24690
24691 * doc/bison.texinfo: Update FSF address.
24692
246931999-01-14 Jesse Thilo <jthilo@gnu.org>
24694
24695 * acconfig.h: Update FSF address.
24696
246971999-01-08 Jesse Thilo <jthilo@gnu.org>
24698
24699 * src/system.h:
24700 Don't define PACKAGE here, since config.h defines it.
24701
247021998-12-30 Jesse Thilo <jthilo@gnu.org>
24703
24704 * src/reader.c: Update copyright date.
24705
24706 * src/main.c:
24707 Ditch sprintf to statically-sized buffers in fatal/warn functions in
24708 favor of output directly to stderr (avoids buffer overruns).
24709
24710 * src/reader.c: Some checks for premature EOF.
24711
24712 * 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:
24713 Use prototypes if the compiler understands them.
24714
24715 * src/files.c: Honor TMPDIR on Unix hosts.
24716 Use prototypes if the compiler understands them.
24717
24718 * src/reader.c:
24719 Fix a couple of buffer overrun bugs.
24720 Use prototypes if the compiler understands them.
24721
24722 * src/system.h: Include unistd.h and ctype.h.
24723 Use #ifdef instead of #if for NLS symbols.
24724
247251998-12-30 Jesse Thilo <jthilo@gnu.org>
24726
24727 * doc/bison.texinfo:
24728 Delete comment "consider using @set for edition number, etc..." since
24729 we now are doing so.
24730
247311998-12-30 Jesse Thilo <jthilo@gnu.org>
24732
24733 * configure.in:
24734 Use prototypes if the compiler understands them.
24735
24736 * NEWS: Document 1.26 highlights.
24737
24738 * Makefile.am: Require Automake 1.3 or later.
24739
24740 * acconfig.h:
24741 Use prototypes if the compiler understands them.
24742
247431998-12-29 Jesse Thilo <jthilo@gnu.org>
24744
24745 * src/version.c:
24746 Use VERSION symbol from automake for version number.
24747
247481998-12-29 Jesse Thilo <jthilo@gnu.org>
24749
24750 * acconfig.h, configure.in, version.cin:
24751 Use VERSION symbol from automake for version number.
24752
247531998-11-28 Jesse Thilo <jthilo@gnu.org>
24754
24755 * Makefile.am:
24756 Distribute original version of simple parser (bison.s1), not built
24757 version (bison.simple).
24758
247591998-11-28 Jesse Thilo <jthilo@gnu.org>
24760
24761 * doc/bison.texinfo: Add info dir entry.
24762
24763 * doc/bison.texinfo:
24764 Let automake put version number into documentation.
24765
247661998-11-26 Jesse Thilo <jthilo@gnu.org>
24767
24768 * src/bison.cld, src/build.com, src/vmshlp.mar:
24769 Add non-RCS files from /gd/gnu/bison.
24770
247711998-11-26 Jesse Thilo <jthilo@gnu.org>
24772
24773 * doc/bison.1:
24774 Document the BISON_HAIRY and BISON_SIMPLE variables.
24775
247761998-11-25 Jesse Thilo <jthilo@gnu.org>
24777
24778 * src/version.c: Build version.c automatically.
24779
24780 * src/reader.c:
24781 Fix token numbering (used to start at 258, not 257).
24782
24783 * src/system.h: Include config.h.
24784
24785 * src/getargs.c: Update bug report address.
24786
24787 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
24788 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
24789
247901998-11-25 Jesse Thilo <jthilo@gnu.org>
24791
24792 * Makefile.am:
24793 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24794
24795 * configure.in, version.cin:
24796 Build version.c automatically.
24797
24798 * AUTHORS: Add AUTHORS file.
24799
24800 * README: Update bug report address.
24801
24802 * bison.simple:
24803 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24804
24805 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
24806 Add automake stuff.
24807
248081998-11-25 Jesse Thilo <jthilo@gnu.org>
24809
24810 * doc/bison.texinfo: Clean up some formatting.
24811
248121998-05-05 Richard Stallman <rms@gnu.org>
24813
24814 * doc/bison.texinfo:
24815 Explain better why to make a pure parser.
24816
248171998-01-05 Richard Stallman <rms@gnu.org>
24818
24819 * src/files.c (openfiles):
24820 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
24821 find a temporary directory, if possible. Do not unlink files while
24822 they are open.
24823
248241997-08-25 Richard Stallman <rms@gnu.org>
24825
24826 * src/reader.c (stack_offset;):
24827 Change some warni to warns.
24828
24829 * src/lex.c (literalchar): Use warns, not warni.
24830
248311997-06-28 Richard Stallman <rms@gnu.org>
24832
24833 * src/bison.s1: Add a Bison version comment.
24834
24835 * src/main.c (fatal, warn, berror):
24836 Use program_name.
24837
248381997-06-28 Richard Stallman <rms@gnu.org>
24839
24840 * Makefile.in (bison_version): New variable.
24841 (dist): Use that variable.
24842 (bison.s1): Substitute the Bison version into bison.simple.
24843
24844 * bison.simple: Add a Bison version comment.
24845
248461997-06-18 Richard Stallman <rms@gnu.org>
24847
24848 * src/main.c (fatal, warn, berror):
24849 Make error messages standard.
24850 (toomany): Improve error message text.
24851
24852 * 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:
24853 new.h renamed to alloc.h.
24854
248551997-06-18 Richard Stallman <rms@gnu.org>
24856
24857 * Makefile.in: new.h renamed to alloc.h.
24858
248591997-05-24 Richard Stallman <rms@gnu.org>
24860
24861 * src/lex.c (literalchar):
24862 Fix the code for escaping \, " and '.
24863
24864 (lex): Avoid trouble when there are many chars
24865 to discard in a char literal with just several chars in it.
24866
248671997-05-17 Richard Stallman <rms@gnu.org>
24868
24869 * src/bison.s1:
24870 Use malloc, if using alloca is troublesome.
24871 (YYSTACK_USE_ALLOCA): New flag macro.
24872 Define it for some systems and compilers.
24873 (YYSTACK_ALLOC): New macro.
24874 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24875 If it was malloc'd, free it.
24876
248771997-05-17 Richard Stallman <rms@gnu.org>
24878
24879 * bison.simple:
24880 Use malloc, if using alloca is troublesome.
24881 (YYSTACK_USE_ALLOCA): New flag macro.
24882 Define it for some systems and compilers.
24883 (YYSTACK_ALLOC): New macro.
24884 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24885 If it was malloc'd, free it.
24886
248871997-04-23 Richard Stallman <rms@gnu.org>
24888
24889 * src/bison.s1:
24890 (alloca) [__hpux]: Always define as __builtin_alloca.
24891
248921997-04-23 Richard Stallman <rms@gnu.org>
24893
24894 * bison.simple:
24895 (alloca) [__hpux]: Always define as __builtin_alloca.
24896
248971997-04-22 Richard Stallman <rms@gnu.org>
24898
24899 * src/bison.s1:
24900 [__hpux]: Include alloca.h (right for HPUX 10)
24901 instead of declaring alloca (right for HPUX 9).
24902
24903 * src/bison.s1 (__yy_memcpy):
24904 Declare arg `count' as unsigned int.
24905 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24906
249071997-04-22 Richard Stallman <rms@gnu.org>
24908
24909 * bison.simple:
24910 [__hpux]: Include alloca.h (right for HPUX 10)
24911 instead of declaring alloca (right for HPUX 9).
24912
24913 * bison.simple (__yy_memcpy):
24914 Declare arg `count' as unsigned int.
24915 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24916
249171997-01-03 Richard Stallman <rms@gnu.org>
24918
24919 * src/allocate.c: [__STDC__ or _MSC_VER]:
24920 Declare calloc and realloc to return void *.
24921
249221997-01-02 Richard Stallman <rms@gnu.org>
24923
24924 * src/system.h:
24925 [_MSC_VER]: Include stdlib.h and process.h.
24926 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
24927
24928 * src/main.c (main): Return FAILURE as a value.
24929 (printable_version): Declare arg as int, not char.
24930
249311997-01-02 Richard Stallman <rms@gnu.org>
24932
24933 * Makefile.in (dist):
24934 Explicitly check for symlinks, and copy them.
24935
249361996-12-19 Richard Stallman <rms@gnu.org>
24937
24938 * src/files.c:
24939 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
24940
249411996-12-18 Paul Eggert <eggert@gnu.org>
24942
24943 * src/bison.s1 (yyparse):
24944 If __GNUC__ and YYPARSE_PARAM are both defined,
24945 declare yyparse to have a void * argument.
24946
249471996-12-18 Paul Eggert <eggert@gnu.org>
24948
24949 * bison.simple (yyparse):
24950 If __GNUC__ and YYPARSE_PARAM are both defined,
24951 declare yyparse to have a void * argument.
24952
249531996-12-17 Richard Stallman <rms@gnu.org>
24954
24955 * src/reduce.c (nbits): Add some casts.
24956
249571996-08-12 Richard Stallman <rms@gnu.org>
24958
24959 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
24960
249611996-08-12 Richard Stallman <rms@gnu.org>
24962
24963 * bison.simple: Test _MSDOS as well as _MSDOS_.
24964
249651996-07-31 Richard Stallman <rms@gnu.org>
24966
24967 * src/bison.s1:
24968 [__sun && __i386]: Include alloca.h.
24969
249701996-07-31 Richard Stallman <rms@gnu.org>
24971
24972 * bison.simple:
24973 [__sun && __i386]: Include alloca.h.
24974
249751996-07-30 Richard Stallman <rms@gnu.org>
24976
24977 * src/bison.s1: Comment change.
24978
24979 * src/bison.s1: Test _MSDOS_, not MSDOS.
24980
249811996-07-30 Richard Stallman <rms@gnu.org>
24982
24983 * bison.simple: Comment change.
24984
24985 * bison.simple: Test _MSDOS_, not MSDOS.
24986
249871996-06-01 Richard Stallman <rms@gnu.org>
24988
24989 * 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:
24990 Insert `_' macro around many string constants.
24991
24992 * src/main.c:
24993 Insert `_' macro around many string constants.
24994
24995 (main): Call setlocale, bindtextdomain and textdomain.
24996
24997 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
24998 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
24999 [ENABLE_NLS]: Include libintl.h.
25000 [ENABLE_NLS] (gettext): Define.
25001 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
25002 (N_, PACKAGE, LOCALEDIR): New macros.
25003
250041996-06-01 Richard Stallman <rms@gnu.org>
25005
25006 * POTFILES.in: New file.
25007
25008 * Makefile.in (allocate.o):
25009 Define target explicitly.
25010
25011 * Makefile.in (CFLAGS): Set to @CFLAGS@.
25012 (LDFLAGS): Set to @LDFLAGS@.
25013 (configure): Run autoconf only if preceding `cd' succeeds.
25014 (bison.s1): Redirect output to temporary file then move the
25015 temporary to the target, rather than redirecting directly to bison.s1.
25016 (clean): Remove config.status and config.log.
25017 (distclean): Don't remove config.status here.
25018
250191996-05-12 Richard Stallman <rms@gnu.org>
25020
25021 * src/bison.s1:
25022 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25023
250241996-05-12 Richard Stallman <rms@gnu.org>
25025
25026 * bison.simple:
25027 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25028
250291996-05-11 Richard Stallman <rms@gnu.org>
25030
25031 * src/bison.s1 (__yy_memcpy):
25032 Really reorder the args, as was supposedly done on Feb 14 1995.
25033 (yyparse): Calls changed accordingly.
25034
250351996-05-11 Richard Stallman <rms@gnu.org>
25036
25037 * Makefile.in (dist): Don't use $(srcdir).
25038
25039 * bison.simple (__yy_memcpy):
25040 Really reorder the args, as was supposedly done on Feb 14 1995.
25041 (yyparse): Calls changed accordingly.
25042
250431996-01-27 Richard Stallman <rms@gnu.org>
25044
25045 * src/output.c (output_rule_data):
25046 Test YYERROR_VERBOSE in the conditional
25047 around the definition of ttyname.
25048
250491995-12-29 Richard Stallman <rms@gnu.org>
25050
25051 * src/bison.s1:
25052 Fix line numbers in #line commands.
25053
250541995-12-29 Richard Stallman <rms@gnu.org>
25055
25056 * bison.simple:
25057 Fix line numbers in #line commands.
25058
250591995-12-27 Richard Stallman <rms@gnu.org>
25060
25061 * src/bison.s1 (YYPARSE_PARAM_DECL):
25062 In C++, make it always null.
25063 (YYPARSE_PARAM_ARG): New macro.
25064 (yyparse): Use YYPARSE_PARAM_ARG.
25065
250661995-12-27 Richard Stallman <rms@gnu.org>
25067
25068 * bison.simple (YYPARSE_PARAM_DECL):
25069 In C++, make it always null.
25070 (YYPARSE_PARAM_ARG): New macro.
25071 (yyparse): Use YYPARSE_PARAM_ARG.
25072
250731995-11-29 Richard Stallman <rms@gnu.org>
25074
25075 * doc/bison.texinfo:
25076 Describe literal string tokens, %raw, %no_lines, %token_table.
25077
250781995-11-29 Daniel Hagerty <hag@gnu.org>
25079
25080 * doc/bison.texinfo: Fixed update date
25081
250821995-10-16 Richard Stallman <rms@gnu.org>
25083
25084 * src/version.c: Version 1.25.
25085
250861995-10-16 Richard Stallman <rms@gnu.org>
25087
25088 * NEWS: *** empty log message ***
25089
250901995-10-16 Richard Stallman <rms@gnu.org>
25091
25092 * doc/bison.1, doc/bison.rnh:
25093 Add new options.
25094
250951995-10-15 Richard Stallman <rms@gnu.org>
25096
25097 * src/vmsgetargs.c, src/getargs.c:
25098 Added -n, -k, and -raw switches.
25099 (noparserflag, toknumflag, rawtoknumflag): New variables.
25100
25101 * src/symtab.h (SALIAS):
25102 New #define for adding aliases to %token.
25103 (struct bucket): Added `alias' field.
25104
25105 * src/reduce.c (reduce_grammar):
25106 Revise error message.
25107 (print_notices): Remove final `.' from error message.
25108
25109 * src/reader.c (reader_output_yylsp):
25110 New function.
25111 (readgram): Use `#if 0' around code that accepted %command
25112 inside grammar rules: The documentation doesn't allow it,
25113 and it will fail since the %command processors scan for the next %.
25114 (parse_token_decl): Extended the %token
25115 declaration to allow a multi-character symbol as an alias.
25116 (parse_thong_decl): New function.
25117 (read_declarations): Added %thong declarations.
25118 (read_declarations): Handle NOOP to deal with allowing
25119 % declarations as another means to specify the flags.
25120 (readgram): Allow %prec prior to semantics embedded in a rule.
25121 (skip_to_char, read_declarations, copy_definition)
25122 (parse_token_decl, parse_start_decl, parse_type_decl)
25123 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
25124 (get_type_name, copy_guard, copy_action, readgram)
25125 (get_type, packsymbols): Revised most error messages.
25126 Changed `fatal' to `warnxxx' to avoid aborting for error.
25127 Revised and use multiple warnxxx functions to avoid using VARARGS1.
25128 (read_declarations): Improve the error message for
25129 an invalid character. Do not abort.
25130 (read_declarations, copy_guard, copy_action): Use
25131 printable_version to avoid unprintable characters in printed output.
25132 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
25133 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
25134 Allow the type of a non-terminal can be given
25135 more than once, as long as all specifications give the same type.
25136
25137 * src/output.c:
25138 (output_headers, output_trailers, output, output_gram)
25139 (output_rule_data): Implement noparserflag variable.
25140 Implement toknumflag variable.
25141 (output): Call reader_output_yylsp to output LTYPESTR.
25142
25143 * src/main.c (main):
25144 If reader sees an error, don't process the grammar.
25145 (fatals): Updated to not use VARARGS1.
25146 (printable_version, int_to_string, warn, warni, warns, warnss)
25147 (warnsss): New error reporting functions. Avoid abort for error.
25148
25149 * src/lex.h:
25150 Added THONG and NOOP for alias processing.
25151 Added SETOPT for the new code that allows setting options with %flags.
25152
25153 * src/lex.c:
25154 Include getopt.h. Add some extern decls.
25155 (safegetc): New function to deal with EOF gracefully.
25156 (literalchar); new function to deal with reading \ escapes.
25157 (lex): Use literalchar.
25158 (lex): Implemented "..." tokens.
25159 (literalchar, lex, parse_percent_token): Made tokenbuffer
25160 always contain the token. This includes growing the token
25161 buffer while reading an integer.
25162 (parse_percent_token): Replaced if-else statement with percent_table.
25163 (parse_percent_token): Added % declarations as another
25164 way to specify the flags -n, -l, and -r. Also added hooks for
25165 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
25166 major changes to files.c.
25167 (lex) Retain in the incoming stream a character following
25168 an incorrect '/'.
25169 (skip_white_space, lex): Revised most error messages
25170 and changed fatal to warn to avoid aborting.
25171 (percent_table): Added %thong declarations.
25172
25173 * src/gram.h: Comment changes.
25174
25175 * src/files.c (openfiles, open_extra_files, done):
25176 Add faction flag
25177 and actfile file. Handle noparserflag. Both for -n switch.
25178
25179 * src/conflicts.c (resolve_sr_conflict):
25180 Remove use of alloca.
25181
251821995-06-01 Jim Meyering <meyering@gnu.org>
25183
25184 * doc/bison.texinfo: *** empty log message ***
25185
251861995-05-06 Richard Stallman <rms@gnu.org>
25187
25188 * src/bison.s1: Comment change.
25189
251901995-05-06 Richard Stallman <rms@gnu.org>
25191
25192 * bison.simple: Comment change.
25193
251941995-05-03 Richard Stallman <rms@gnu.org>
25195
25196 * src/version.c: Version now 1.24.
25197
25198 * src/bison.s1: Change distribution terms.
25199
25200 * src/version.c: Version now 1.23.
25201
252021995-05-03 Richard Stallman <rms@gnu.org>
25203
25204 * doc/bison.texinfo:
25205 Rewrite "Conditions for Using Bison".
25206 Update version to 1.24.
25207
252081995-05-03 Richard Stallman <rms@gnu.org>
25209
25210 * bison.simple: Change distribution terms.
25211
252121995-02-23 Richard Stallman <rms@gnu.org>
25213
25214 * src/files.c: Test __VMS_POSIX as well as VMS.
25215
252161995-02-14 Jim Meyering <meyering@gnu.org>
25217
25218 * src/bison.s1 (__yy_memcpy):
25219 Renamed from __yy_bcopy to avoid
25220 confusion. Reverse FROM and TO arguments to be consistent with
25221 those of memcpy.
25222
252231995-02-14 Jim Meyering <meyering@gnu.org>
25224
25225 * bison.simple (__yy_memcpy):
25226 Renamed from __yy_bcopy to avoid
25227 confusion. Reverse FROM and TO arguments to be consistent with
25228 those of memcpy.
25229
252301994-11-10 David J. MacKenzie <djm@gnu.org>
25231
25232 * NEWS: reformat
25233
25234 * NEWS: New file.
25235
25236 * Makefile.in (DISTFILES): Include NEWS.
25237
25238 * Makefile.in (DISTFILES):
25239 Include install-sh, not install.sh.
25240
25241 * configure.in: Update to Autoconf v2 macro names.
25242
252431994-10-05 David J. MacKenzie <djm@gnu.org>
25244
25245 * Makefile.in: fix typo
25246
25247 * Makefile.in (prefix, exec_prefix):
25248 Let configure set them.
25249
252501994-09-28 David J. MacKenzie <djm@gnu.org>
25251
25252 * Makefile.in: Set datadir to $(prefix)/share.
25253
252541994-09-15 Richard Stallman <rms@gnu.org>
25255
25256 * src/bison.s1:
25257 Update copyright notice and GPL version.
25258
252591994-09-15 Richard Stallman <rms@gnu.org>
25260
25261 * bison.simple:
25262 Update copyright notice and GPL version.
25263
252641994-07-12 Richard Stallman <rms@gnu.org>
25265
25266 * src/reduce.c, src/reader.c:
25267 entered into RCS
25268
252691994-05-05 David J. MacKenzie <djm@gnu.org>
25270
25271 * Makefile.in: entered into RCS
25272
252731994-03-26 Richard Stallman <rms@gnu.org>
25274
25275 * src/bison.s1: entered into RCS
25276
252771994-03-26 Richard Stallman <rms@gnu.org>
25278
25279 * bison.simple: entered into RCS
25280
252811994-03-25 Richard Stallman <rms@gnu.org>
25282
25283 * src/main.c: entered into RCS
25284
252851994-03-24 Richard Stallman <rms@gnu.org>
25286
25287 * src/conflicts.c: entered into RCS
25288
252891994-01-02 Richard Stallman <rms@gnu.org>
25290
25291 * Makefile.in: *** empty log message ***
25292
252931993-11-21 Richard Stallman <rms@gnu.org>
25294
25295 * src/bison.s1: *** empty log message ***
25296
252971993-11-21 Richard Stallman <rms@gnu.org>
25298
25299 * doc/bison.texinfo: entered into RCS
25300
25301 * doc/bison.texinfo: *** empty log message ***
25302
253031993-11-21 Richard Stallman <rms@gnu.org>
25304
25305 * bison.simple: *** empty log message ***
25306
253071993-10-25 David J. MacKenzie <djm@gnu.org>
25308
25309 * doc/bison.texinfo: *** empty log message ***
25310
253111993-10-19 Richard Stallman <rms@gnu.org>
25312
25313 * src/bison.s1: *** empty log message ***
25314
253151993-10-19 Richard Stallman <rms@gnu.org>
25316
25317 * bison.simple: *** empty log message ***
25318
253191993-10-14 Richard Stallman <rms@gnu.org>
25320
25321 * src/bison.s1: *** empty log message ***
25322
253231993-10-14 Richard Stallman <rms@gnu.org>
25324
25325 * bison.simple: *** empty log message ***
25326
253271993-09-14 David J. MacKenzie <djm@gnu.org>
25328
25329 * doc/bison.texinfo: *** empty log message ***
25330
253311993-09-13 Noah Friedman <friedman@gnu.org>
25332
25333 * Makefile.in: *** empty log message ***
25334
253351993-09-10 Richard Stallman <rms@gnu.org>
25336
25337 * src/conflicts.c: *** empty log message ***
25338
25339 * src/system.h: entered into RCS
25340
253411993-09-10 Richard Stallman <rms@gnu.org>
25342
25343 * doc/bison.1: entered into RCS
25344
253451993-09-06 Noah Friedman <friedman@gnu.org>
25346
25347 * src/version.c: entered into RCS
25348
253491993-09-06 Noah Friedman <friedman@gnu.org>
25350
25351 * Makefile.in: *** empty log message ***
25352
253531993-07-30 David J. MacKenzie <djm@gnu.org>
25354
25355 * Makefile.in: *** empty log message ***
25356
253571993-07-24 Richard Stallman <rms@gnu.org>
25358
25359 * src/bison.s1: *** empty log message ***
25360
253611993-07-24 Richard Stallman <rms@gnu.org>
25362
25363 * bison.simple: *** empty log message ***
25364
253651993-07-08 David J. MacKenzie <djm@gnu.org>
25366
25367 * Makefile.in: *** empty log message ***
25368
253691993-07-04 Richard Stallman <rms@gnu.org>
25370
25371 * src/bison.s1: *** empty log message ***
25372
253731993-07-04 Richard Stallman <rms@gnu.org>
25374
25375 * bison.simple: *** empty log message ***
25376
253771993-06-26 David J. MacKenzie <djm@gnu.org>
25378
25379 * src/getargs.c: entered into RCS
25380
253811993-06-26 David J. MacKenzie <djm@gnu.org>
25382
25383 * doc/bison.texinfo: *** empty log message ***
25384
25385 * doc/bison.1: New file.
25386
253871993-06-25 Richard Stallman <rms@gnu.org>
25388
25389 * src/getargs.c: New file.
25390
253911993-06-16 Richard Stallman <rms@gnu.org>
25392
25393 * src/bison.s1: *** empty log message ***
25394
253951993-06-16 Richard Stallman <rms@gnu.org>
25396
25397 * bison.simple: *** empty log message ***
25398
253991993-06-03 Richard Stallman <rms@gnu.org>
25400
25401 * src/bison.s1: New file.
25402
254031993-06-03 Richard Stallman <rms@gnu.org>
25404
25405 * doc/bison.texinfo: *** empty log message ***
25406
254071993-06-03 Richard Stallman <rms@gnu.org>
25408
25409 * bison.simple: New file.
25410
254111993-05-19 Richard Stallman <rms@gnu.org>
25412
25413 * doc/bison.texinfo: New file.
25414
254151993-05-07 Noah Friedman <friedman@gnu.org>
25416
25417 * Makefile.in: *** empty log message ***
25418
254191993-04-28 Noah Friedman <friedman@gnu.org>
25420
25421 * src/reader.c: *** empty log message ***
25422
254231993-04-23 Noah Friedman <friedman@gnu.org>
25424
25425 * src/alloc.h: entered into RCS
25426
254271993-04-20 David J. MacKenzie <djm@gnu.org>
25428
25429 * src/version.c: *** empty log message ***
25430
25431 * src/files.c, src/allocate.c:
25432 entered into RCS
25433
25434 * src/reader.c: *** empty log message ***
25435
25436 * src/lex.c: entered into RCS
25437
25438 * src/conflicts.c: New file.
25439
25440 * src/symtab.c: entered into RCS
25441
25442 * src/alloc.h: New file.
25443
25444 * src/LR0.c: entered into RCS
25445
254461993-04-18 Noah Friedman <friedman@gnu.org>
25447
25448 * src/reader.c: New file.
25449
25450 * src/version.c: *** empty log message ***
25451
254521993-04-18 Noah Friedman <friedman@gnu.org>
25453
25454 * Makefile.in: *** empty log message ***
25455
254561993-04-17 Noah Friedman <friedman@gnu.org>
25457
25458 * Makefile.in: *** empty log message ***
25459
254601993-04-15 Richard Stallman <rms@gnu.org>
25461
25462 * src/main.c, src/files.c:
25463 New file.
25464
254651993-04-15 Noah Friedman <friedman@gnu.org>
25466
25467 * configure.in: entered into RCS
25468
25469 * configure.in: *** empty log message ***
25470
25471 * configure.in: New file.
25472
254731993-04-14 Richard Stallman <rms@gnu.org>
25474
25475 * Makefile.in: New file.
25476
254771993-04-13 Richard Stallman <rms@gnu.org>
25478
25479 * src/version.c: New file.
25480
254811993-03-25 Richard Stallman <rms@gnu.org>
25482
25483 * src/output.c: entered into RCS
25484
254851992-09-25 Richard Stallman <rms@gnu.org>
25486
25487 * configure.bat: entered into RCS
25488
254891992-06-22 Richard Stallman <rms@gnu.org>
25490
25491 * src/vmsgetargs.c: entered into RCS
25492
254931992-06-22 Richard Stallman <rms@gnu.org>
25494
25495 * doc/bison.rnh: entered into RCS
25496
254971992-04-20 David J. MacKenzie <djm@gnu.org>
25498
25499 * README: entered into RCS
25500
255011992-01-22 Richard Stallman <rms@gnu.org>
25502
25503 * src/machine.h: entered into RCS
25504
255051991-12-21 Richard Stallman <rms@gnu.org>
25506
25507 * src/lalr.c, src/closure.c:
25508 entered into RCS
25509
255101991-12-20 Richard Stallman <rms@gnu.org>
25511
25512 * src/state.h: entered into RCS
25513
255141991-12-18 Richard Stallman <rms@gnu.org>
25515
25516 * src/print.c, src/nullable.c, src/derives.c:
25517 entered into RCS
25518
255191991-11-03 David J. MacKenzie <djm@gnu.org>
25520
25521 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
25522 entered into RCS
25523
255241988-09-09 Richard Stallman <rms@gnu.org>
25525
25526 * src/bison.hairy: entered into RCS
25527
255281987-12-16 Richard Stallman <rms@gnu.org>
25529
25530 * REFERENCES: entered into RCS
dc546b0f 25531
f294a2c2 25532
04098407 25533 -----
f294a2c2 25534
e141f4d4
JD
25535 Copyright (C) 1987-1988, 1991-2010 Free Software Foundation,
25536 Inc.
f294a2c2 25537
04098407
PE
25538 Copying and distribution of this file, with or without
25539 modification, are permitted provided the copyright notice and this
25540 notice are preserved.