]> git.saurik.com Git - bison.git/blame - ChangeLog
comment change.
[bison.git] / ChangeLog
CommitLineData
8aec287e
AD
12010-05-07 Akim Demaille <demaille@gostai.com>
2
3 doc: fix typo.
4 * tests/synclines.at: here.
5
c826013f
AD
62010-05-04 Akim Demaille <demaille@gostai.com>
7
8 tests: enhance AT_SYNCLINES_COMPILE.
9 * tests/synclines.at (AT_SYNCLINES_COMPILE): More distcc patterns.
10 (AT_TEST_SYNCLINE): Remove GCC 4.5 protection which is already
11 taken care of in AT_SYNCLINES_COMPILE.
12
7789b6e3
AD
132010-05-04 Akim Demaille <demaille@gostai.com>
14
15 lalr1.cc: don't generate location.hh when location_type is defined
16 * data/bison.m4 (b4_percent_define_get): Accept a default value.
17 * data/c++.m4: Do not provide a default value for the %define
18 variable location_type, rather, use b4_percent_define_get with a
19 default argument where its value is needed.
20 * data/lalr1.cc: Do not load location.cc (which outputs both
21 location.hh and position.hh) if the user defined location_type.
22 Do not include location.hh either.
23
19ad326b
AD
242010-05-04 Akim Demaille <demaille@gostai.com>
25
26 lalr1.cc: minor refactoring.
27 * data/lalr1.cc: Don't issue empty namespaces.
28
f5da8149
AD
292010-05-04 Akim Demaille <demaille@gostai.com>
30
31 tests: fix %printer.
32 Currently, there is no check that %printer ... <foo> (nor
33 %destructor) is about an existing <foo> type. This C++ test had
34 it wrong (<::std::string> vs. <std::string>).
35
36 * tests/c++.at (AT_CHECK_VARIANTS): In list.yy, redefine the
37 pretty-printing of lists into something better for parser traces.
38 Update the expected output.
39 Fix correspondance between %type/%token and %printer.
40
49976d5c
AD
412010-05-04 Akim Demaille <demaille@gostai.com>
42
43 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
44 * tests/calc.at (Span): Instead of begin/end, as in the built-in
45 location class, use first and last.
46 Define YYLLOC_DEFAULT to adjust to these changes.
47 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
48 location_type changes.
49
bc81de36
JD
502010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
51
52 tests: fix maintainer-xml-check.
53 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
54 Update output to include comments now produced by --graph.
55 (xsl:template match="automaton"): As for --graph, name the
56 digraph after the grammar file.
57 * src/print-xml.c (escape_bufs): Enlarge array.
58 (print_xml): Add bug-report and url attributes to
59 bison-xml-report element.
60
b7666378
JD
612010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
62
63 In DOT output, convert from "/*" comments to "//" comments.
64 This handles the possibility that a "*/" might appear in
65 variable portions of those comments at some point in the future.
66 * src/graphviz.c (start_graph): Implement.
67
9b5049bd
JD
682010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
69
70 Document that undefined %prec identifier warnings will remain.
71 * NEWS (2.4.3): Here.
72 (2.4.2): Here.
73
02354690
JD
742010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
75
76 Revert 2009-12-30 change for undefined %prec token complaints.
77 That is, keep them as warnings because that should be sufficient
78 to satisfy POSIX without creating backward compatibility issues.
79 Suggested by Richard Stallman at
80 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
81 * NEWS (2.5): Remove mention of complaint.
56e92e0b
JD
82 * src/reader.c (grammar_rule_check): Convert complaint back to
83 warning.
02354690
JD
84 * tests/input.at (%prec's token must be defined): Update.
85
a7ddefd1
JD
862010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
87
88 build: don't require src/bison during bootstrap.
89 Suggested by Eric Blake at
90 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
91 * bootstrap.conf (bootstrap_epilogue): New function to make sure
92 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
93
c1bd4b2b
JD
942010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
95
96 i18n: fix untranslatable string.
97 Reported by Goran Uddeborg at
98 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
99 * src/muscle-tab.c (muscle_percent_define_insert): Here.
100
67f1a2c2
AD
1012010-04-13 Akim Demaille <demaille@gostai.com>
102
103 tests: calc: minor refactoring.
104 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
105
4f756f88
AD
1062010-04-13 Akim Demaille <demaille@gostai.com>
107
108 tests: calc: simplify location management.
109 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
110 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
111 define the appropriate AT_LOC accessors.
112 * tests/calc.at: Use AT_LOC accessors.
113
24bb8c8c
AD
1142010-04-13 Akim Demaille <demaille@gostai.com>
115
116 test location_type.
117 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
118 Define AT_LOCATION_TYPE_IF.
119 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
120 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
121 used, provide a user location type and use it.
122 (Simple LALR1 C++ Calculator): Add a test case for location_type.
123
af129079
AD
1242010-04-13 Akim Demaille <demaille@gostai.com>
125
126 tests: check fclose's return value.
127 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
128
36dc3637
AD
1292010-04-13 Akim Demaille <demaille@gostai.com>
130
131 tests: don't depend on the actual location type.
132 * tests/calc.at: Use yy::parser::location_type rather than
133 yy::location, since the former is always right, and might point to
134 another type than the latter.
135
c499231d
AD
1362010-04-13 Akim Demaille <demaille@gostai.com>
137
138 formatting changes.
139 * tests/calc.at: Formatting changes.
140
7799ef15
AD
1412010-04-13 Akim Demaille <demaille@gostai.com>
142
143 lalr1.cc: remove useless forward declaration.
144 * data/lalr1.cc: Include location.hh before stack.hh.
145 Remove the useless forward declarations of position and location.
146 Reported by Chris Morley.
147 * data/glr.cc: Likewise.
148
06cb07d5
JD
1492010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
150
151 * NEWS (2.4.3): Mention fix for Sun Studio C++.
152
4586c8cd
JD
1532010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
154
155 tests: fix for newer Sun Studio C++.
156 Reported by Dagobert Michelsen at
157 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
158 * THANKS (Dagobert Michelsen): Add.
159 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
160 Autoconf macro for handling the restrict keyword.
161 * gnulib: Update to latest, which no longer overrides that macro
162 from Autoconf.
163
44c2b42d
JD
1642010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
165
166 portability: fix pointer arithmetic to conform to C standard.
167 Reported by Tys Lefering at
168 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
169 This fix is already implemented in glr.c and does not apply to
170 lalr1.java.
171 * data/lalr1.cc (yy::parser::parse): Increase size of
172 yyerror_range and adjust subscripting so you don't have to
173 subtract one from the beginning of the array.
174 * data/yacc.c (b4_declare_parser_state_variables,
175 yyparse, yypush_parse): Likewise.
176
218287f5
AD
1772010-04-05 Akim Demaille <demaille@gostai.com>
178
179 remove useless include.
180 * src/graphviz.h: Don't include stdbool.h.
181
8176ab33
AD
1822010-04-05 Akim Demaille <demaille@gostai.com>
183
184 graph: sign the output file.
185 * src/graphviz.c (start_graph): Issue comments about Bison.
186 Suggested by Tys Lefering.
187
4ad3921d
JD
1882010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
189
190 portability: fix test suite for GCC 4.5's new #error message.
191 Reported by Tys Lefering at
192 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
193 * NEWS (2.4.3): Mention.
194 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
195
10a697de
AD
1962010-03-30 Akim Demaille <demaille@gostai.com>
197
198 fix comments.
199 * src/graphviz.h: Add missing license notice.
200 Document.
201
d6b347e4
AD
2022010-03-25 Akim Demaille <demaille@gostai.com>
203
204 tests: fix 250: parse.error=verbose overflow.
205 * tests/regression.at (parse.error=verbose overflow): Avoid the
206 double inclusion of stdlib.h as it triggers hard errors.
207
b8675840
JD
2082010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
209
210 portability: fix for BSD make.
211 Reported by Johan van Selst at
212 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
213 * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in
214 this dependency list as in package.m4's target rule.
215
8b9e021f
JD
2162010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
217
218 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
219 Reported by Johan van Selst at
220 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
221 * NEWS (2.4.3): New.
222 * THANKS (Johan van Selst): Add.
223 * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
224 targets so that gnulib's new c++defs.h is matched.
225 * gnulib: Update to latest.
226
96a381c5
JD
2272010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
228
229 maint: update for changes to gnulib's announce-gen.
230 * HACKING (Announce): RELEASE_TYPE=major must now be written
231 RELEASE_TYPE=stable.
232
e19a049c
JD
2332010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
234
235 Version 2.4.2.
236 * NEWS (2.4.2): Set version and date. For the recent test suite
237 portability fixes, don't be so optimistic about their success
238 given the lack of feedback on the affected platforms.
239
890aeb28
JD
2402010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
241
242 tests: fix maintainer-xml-check for recent changes.
243 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
244 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
245 output file whose name conflicts with a previous output file
246 is now never generated.
247
f39ab286
JD
2482010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
249
250 portability: fix several issues with M4 subprocess.
251
252 M4's output pipe was not being drained upon fatal errors during
253 scan_skel. As a result, broken-pipe messages from M4 were seen
254 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
255 failure in the test suite. The problem was that, on platforms
256 where the default disposition for SIGPIPE is ignore instead of
257 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
258 then reported it. However, there's some sort of race condition,
259 because the new test group occasionally succeeded.
260 Reported by Albert Chin at
261 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
262
263 There were also problems with the test suite livelocking on
264 Tru64 5.1b. Reported by Didier Godefroy at
265 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
266 Switching to create_pipe_bidi suggested by Akim Demaille.
267
268 To attempt to solve both of these problems, switch to gnulib's
269 create_pipe_bidi and register M4 process as a slave. Along the
270 way, clean up file name conflict handling, which was affected by
271 the broken-pipe problem before the switch.
272 * NEWS (2.4.2): Document.
273 * THANKS (Didier Godefroy): Add.
274 * bootstrap.conf (gnulib_modules): Add pipe.
275 * gnulib: Update to latest to make sure we have all the latest
276 fixes.
277 * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and
278 subpipe.c.
279 * po/POTFILES.in (lib/subpipe.c): Remove.
280 * src/files.c (compute_output_file_names): Update invocations
281 of output_file_name_check.
282 (output_file_name_check): In the case that the grammar file
283 would be overwritten, use complain instead of fatal, but replace
284 the output file name with /dev/null. Use the /dev/null solution
285 for the case of two conflicting output files as well because it
286 seems safer in case Bison one day tries to open both files at
287 the same time.
288 * src/files.h (output_file_name_check): Update prototype.
289 * src/output.c (output_skeleton): Use create_pipe_bidi and
290 wait_subprocess. Assert that scan_skel completely drains the
291 pipe.
292 * src/scan-skel.l (at_directive_perform): Update
293 output_file_name_check invocation.
294 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
295 grammar file actually isn't overwritten.
296 (Conflicting output files: -o foo.y): Update expected output.
297 * tests/skeletons.at (Fatal errors but M4 continues producing
298 output): New test group.
299
e32050b0
JD
3002010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
301
302 Update POTFILES.
303 * HACKING (Release Procedure): Add reminder about keeping
304 POTFILES files up-to-date.
305 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
306
efc4ed4a
JD
3072010-02-01 Joel E. Denny <jdenny@clemson.edu>
308
309 Code cleanup.
310 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
311 which is already defined in atconfig.
312
95611b56
JD
3132010-01-22 Joel E. Denny <jdenny@clemson.edu>
314
315 tests: fix missing include caught by g++ 4.4.1.
316 Reported by Tys Lefering.
317 * HACKING (Release checks): Add note about trying a recent GCC.
318 * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include
319 cstdlib for abort.
320 (_AT_DATA_EXPECT2_Y): Likewise.
321
d6e40cba
JD
3222010-01-21 Joel E. Denny <jdenny@clemson.edu>
323
324 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
325
80b70223
JD
3262010-01-21 Joel E. Denny <jdenny@clemson.edu>
327
328 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
329 * HACKING (Release Procedure): Update notes on copyright years.
330 * Makefile.am (update-package-copyright-year): New target rule.
331 * build-aux/update-package-copyright-year: New file.
332 * cfg.mk (update-copyright): Add update-package-copyright-year
333 as a dependency.
334
3320a276
JD
3352010-01-19 Joel E. Denny <jdenny@clemson.edu>
336
337 * bootstrap: Import improvements from latest gnulib.
338
e30c0477
JD
3392010-01-19 Joel E. Denny <jdenny@clemson.edu>
340
341 build: require Automake 1.11.1 to avoid a security flaw.
342 * HACKING (Release Procedure): Don't document Automake security
343 flaw here.
344 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
345 why here.
346
a538eeb1
JD
3472010-01-19 Joel E. Denny <jdenny@clemson.edu>
348
349 gnulib: update to latest.
350
d6bdb90a
JD
3512010-01-19 Joel E. Denny <jdenny@clemson.edu>
352
353 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
354
326e5cf8
JD
3552010-01-15 Joel E. Denny <jdenny@clemson.edu>
356
357 Thank the developer of the initial push parser implementation.
358 This unfortunate oversight is several years old.
359 * THANKS (Odd Arild Olsen): Add.
360
fca9c5ef
JD
3612010-01-04 Joel E. Denny <jdenny@clemson.edu>
362
363 Fix some comments concerning LR(0) versus LALR(1).
364
365 Stop equating LR(0) with nondeterminism and LALR(1) with
366 determinism. That is, if all states are consistent, then LR(0)
367 tables are deterministic. On the other hand, LALR(1) tables
368 might be nondeterministic before conflict resolution, and GLR
369 permits LALR(1) tables to remain nondeterministic.
370 * src/LR0.c, src/LR0.h: Here.
371 * src/lalr.c, src/lalr.h: Here.
372 * src/main.c (main): Here.
373 * src/state.c, src/state.h: Here.
374
375 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
376 parser tables.
377
e141f4d4
JD
3782010-01-04 Joel E. Denny <jdenny@clemson.edu>
379
380 maint: run "make update-copyright"
381
882be728
JD
3822009-12-30 Joel E. Denny <jdenny@clemson.edu>
383
384 POSIX: complain if %prec's token was not defined.
385 * NEWS (2.5): Document.
386 * src/reader.c (grammar_rule_check): Convert warning to
387 complaint.
388 * tests/input.at (%prec's token must be defined): Update.
389
8bb3a2e7
JD
3902009-12-30 Joel E. Denny <jdenny@clemson.edu>
391
392 POSIX: warn if %prec's token was not defined.
393 Reported by Florian Krohm at
394 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
395 * NEWS (2.4.2): Document.
396 * src/reader.c (grammar_rule_check): Implement.
397 (grammar_current_rule_prec_set): Add comments explaining that we
398 here assume a %prec identifier is a token, but we still manage
399 to support POSIX.
400 * tests/input.at (%prec's token must be defined): New test
401 group.
402
505e1551
JD
4032009-12-31 Joel E. Denny <jdenny@clemson.edu>
404
405 * HACKING (Release Procedure): Recommend a secure automake.
406
b8d19cf8
JD
4072009-12-29 Joel E. Denny <jdenny@clemson.edu>
408
409 portability: `<' and `>' are not always defined on addresses.
410 Specifically, don't sort objects by their memory addresses when
411 they're not allocated in the same array or other object. Though
412 I haven't found a test case where that fails on my platform, C
413 says the behavior is undefined.
414 * src/AnnotationList.c (AnnotationList__insertInto): Remove
415 FIXME. Use new id field of InadequacyList nodes rather than
416 their memory addresses when sorting.
417 (AnnotationList__compute_from_inadequacies): Add
418 inadequacy_list_node_count argument to pass to
419 InadequacyList__new_conflict.
420 * src/AnnotationList.h
421 (AnnotationList__compute_from_inadequacies): Update prototype
422 and documentation for new argument.
423 * src/InadequacyList.c (InadequacyList__new_conflict): Add
424 node_count argument and use it to assign a unique ID.
425 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
426 (InadequacyList): Add id field.
427 (InadequacyList__new_conflict): Update prototype and
428 documentation for new argument.
429 * src/ielr.c (ielr_compute_annotation_lists): Update
430 AnnotationList__compute_from_inadequacies invocation.
431
df222dfa
JD
4322009-12-20 Joel E. Denny <jdenny@clemson.edu>
433
434 Fix handling of yychar manipulation in user semantic actions.
435 The problem was that yacc.c didn't always update the yychar
436 translation afterwards. However, other skeletons appear to be
437 fine. glr.c appears to already translate yychar before every
438 use. lalr1.cc does not define yychar and does not document its
439 replacement, yyla, for users. It does provide yyclearin, but
440 that does not manipulate yyla and thus requires no translation
441 update. In lalr1.java, yychar is out of scope during semantic
442 actions.
443 * NEWS (2.5): Document.
444 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
445 yytoken here.
446 (yyparse, yypush_parse): Instead, translate before every use of
447 yytoken, and add comments explaining this approach.
448 * tests/actions.at (Destroying lookahead assigned by semantic
449 action): New test group checking that translation happens before
450 lookahead destructor calls at parser return. Previously,
451 incorrect destructors were called.
452 * tests/conflicts.at (parse.error=verbose and consistent
453 errors): New test group checking that translation happens at
454 syntax error detection before the associated verbose error
455 message and the associated lookahead destructor calls. While
456 the destructor call is fixed by this patch, the verbose error
457 message is currently incorrect due to another bug (see
458 comments in test group), so this is an expected failure for now.
459
4395a9ff
JD
4602009-12-21 Joel E. Denny <jdenny@clemson.edu>
461
462 YYFAIL: warn about uses and remove from lalr1.java.
463 * NEWS (2.5): Document.
464 * data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
465 and make it private. Update all uses.
466 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
467
1625df5b
JD
4682009-12-21 Joel E. Denny <jdenny@clemson.edu>
469
470 YYFAIL: deprecate.
471 * NEWS (2.4.2): Document deprecation and the phase-out plan.
472 * data/lalr1.java (parser::YYStack::YYFAIL): Add comment about
473 deprecation.
474 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
475 YYFAIL from GCC cpp's -Wunused-macros.
476 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
477 documentation.
478 (LocalWords): Remove YYFAIL.
479
5335b65a
JD
4802009-12-20 Joel E. Denny <jdenny@clemson.edu>
481
482 tests: cleanup.
483 * tests/c++.at (Syntax error discarding no lookahead): Don't
484 ignore stderr. Instead, eliminate remaining warnings.
485
d59beda0
JD
4862009-12-18 Joel E. Denny <jdenny@clemson.edu>
487
488 lalr1.cc: don't discard non-existent lookahead on syntax error.
489 * data/lalr1.cc (parser::parse): Check yyempty first.
490 * tests/c++.at (Syntax error discarding no lookahead): New test
491 group.
492
387b4d50
JD
4932009-12-17 Joel E. Denny <jdenny@clemson.edu>
494
495 Code cleanup.
496 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
497 function, which is no longer used.
498
a603c6e0
JD
4992009-12-16 Joel E. Denny <jdenny@clemson.edu>
500
501 Add gcc's -Wundef to test suite and fix another warning from it.
502 * NEWS (2.4.2): Update description of -Wundef fix.
503 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
504 (WARN_CFLAGS_TEST): New substitution.
505 * data/glr.c: Avoid warning about __STRICT_ANSI__.
506 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
507 WARN_CFLAGS.
508 (NO_WERROR_CFLAGS): Likewise.
509 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
510
19750d31
JD
5112009-12-16 Joel E. Denny <jdenny@clemson.edu>
512
513 * data/yacc.c: Reformat m4 a little.
514
c938d650
JD
5152009-12-16 Joel E. Denny <jdenny@clemson.edu>
516
517 Document gcc -Wundef fix.
518 * NEWS (2.4.2): Here.
519 * THANKS (Jonathan Nieder): Add.
520
fcd32abd
JN
5212009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
522
523 Simplify y.tab.c when location tracking is disabled.
524 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
525 tracking is not enabled. Instead, unconditionally define
526 YY_LOCATION_PRINT as a no-op for backward compatibility.
527
ae93128c
JN
5282009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
529
530 Avoid warnings from gcc -Wundef y.tab.c.
531 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
532 defined before using them.
533 * data/lalr1.cc: Likewise.
534 * data/yacc.c: Likewise.
535
c843aaab
JD
5362009-12-15 Joel E. Denny <jdenny@clemson.edu>
537
538 autoconf: update to latest for fix of M4 detection.
539 Reported by Eric Blake.
540 * submodules/autoconf: Update.
541
5c99151a
JD
5422009-12-15 Joel E. Denny <jdenny@clemson.edu>
543
544 portability: use -DGNULIB_POSIXCHECK.
545 Reported by Eric Blake. See discussions at
546 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
547 and
548 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
549 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
550 * bootstrap.conf (gnulib_modules): Add all the printf modules
551 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
552 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
553 (excluded_files): Remove m4/printf-posix.m4.
554 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
555 lib/libbison.a so gnulib libraries can be linked.
556
75f94c6d
JD
5572009-12-15 Joel E. Denny <jdenny@clemson.edu>
558
559 gnulib: update for fix of fprintf-posix, which we'll use soon.
560 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
561 targets so that gnulib's new arg-nonnull.h and link-warning.h
562 are matched.
563 * gnulib: Update.
564
ca01f454
JD
5652009-12-14 Joel E. Denny <jdenny@clemson.edu>
566
567 Enable assertion output and --disable-assert for configure.
568 * bootstrap.conf (gnulib_modules): Add assert module.
569 * src/system.h (aver): Define as assert, and summarize the
570 discussion on this issue.
571
9dc3ee6d
JD
5722009-12-14 Joel E. Denny <jdenny@clemson.edu>
573
574 Expand GLR acronym in summary of Bison.
575 Based on discussion with Akim Demaille starting at
576 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
577 * doc/bison.texinfo (Introduction): Here.
578 * src/getargs.c (usage): Here.
579
d013372c
AR
5802009-10-03 Alex Rozenman <rozenman@gmail.com>
581
582 Document named references.
583 * doc/bison.texinfo (Actions): Add new example and xref to
584 Using Named References node.
585 (Using Named References): New node.
586
5297ebb3
JD
5872009-10-16 Joel E. Denny <jdenny@clemson.edu>
588
589 cleanup.
590 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
591 of char*.
592 (Sbitset__isEmpty): Use Sbitset instead of char*.
593 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
594 instead of char. This helps to avoid casting errors.
595 (Sbitset__or): Use Sbitset instead of char*.
596
175620d3
JD
5972009-10-16 Joel E. Denny <jdenny@clemson.edu>
598
599 portability: don't assume 8-bit bytes.
600 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
601 * src/Sbitset.h (Sbitset__nbytes): Here.
602 (Sbitset__byteAddress): Here.
603 (Sbitset__bit_mask): Here.
604 (Sbitset__last_byte_mask): Here.
605 (Sbitset__ones): Here.
606 (SBITSET__FOR_EACH): Here.
607
786578e3
JD
6082009-10-11 Joel E. Denny <jdenny@clemson.edu>
609
610 portability: use va_start and va_end in the same function.
611 * src/complain.c (error_message): Move va_end from here...
612 (ERROR_MESSAGE): ... to here.
613
416a9da6
JD
6142009-10-08 Joel E. Denny <jdenny@clemson.edu>
615
616 * data/bison.m4: Update comments for rename to muscle-tab.h.
617
10659d0e
JD
6182009-10-07 Joel E. Denny <jdenny@clemson.edu>
619
620 Minor code cleanup.
621 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
622 replace all uses with UNIQSTR_CONCAT.
623 * src/uniqstr.c (uniqstr_vsprintf): New function.
624 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
625 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
626 macros.
627
3c5362b8
JD
6282009-10-06 Joel E. Denny <jdenny@clemson.edu>
629
630 * TODO (Complaint submessage indentation): New.
631
b143f404
JD
6322009-10-04 Joel E. Denny <jdenny@clemson.edu>
633
634 Minor code cleanup.
635 * src/parse-gram.y: Clean up sorting of declarations.
636 Use types to simplify %printer declarations where possible.
637 Provide %printer for BRACKETED_ID and symbol.prec.
638 * src/symtab.c: Whitespace change.
639
7439c5c0
JD
6402009-10-04 Joel E. Denny <jdenny@clemson.edu>
641
642 tests: skip tests of file names that platform does not support.
643 Reported by Michael Raskin at
644 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
645 * THANKS (Michael Raskin): Add.
646 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
647 to fail at least for file names containing ":" or "\".
648
45319f13
JD
6492009-09-23 Joel E. Denny <jdenny@clemson.edu>
650
651 yysyntax_error: avoid duplicate lookahead collection.
652 Except when memory reallocation is required, this change
653 eliminates the need to invoke yysyntax_error twice and thus to
654 repeat the collection of lookaheads. It also prepares for
655 future extensions that will make those repetitions more
656 expensive and that will require additional memory management in
657 yysyntax_error. Finally, it fixes an obscure bug already
658 exercised in the test suite.
659 * data/yacc.c (yysyntax_error): Add arguments for message
660 buffer variables stored in the parser. Instead of size, return
661 status similar to yyparse status but indicating success of
662 message creation. Other than the actual reallocation of the
663 message buffer, import and clean up memory management code
664 from...
665 (yyparse, yypush_parse): ... here.
666 * tests/regression.at (parse.error=verbose overflow): No longer
667 an expected failure.
668
52cea04a
JD
6692009-09-23 Joel E. Denny <jdenny@clemson.edu>
670
671 yysyntax_error: test memory management more.
672 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
673 * tests/regression.at (parse.error=verbose and
674 YYSTACK_USE_ALLOCA): New test group.
675 (parse.error=verbose overflow): New test group that reveals an
676 obscure bug. Expected fail for now.
677
37318e2f
JD
6782009-10-04 Joel E. Denny <jdenny@clemson.edu>
679
680 benchmarks: use %debug consistently among grammars.
681 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
682 %debug by default. It can affect the timings even if yydebug=0.
683 (generate_grammar_calc): For consistency with other grammars,
684 use YYDEBUG environment variable to set yydebug.
685
f74d6d25
JD
6862009-10-03 Joel E. Denny <jdenny@clemson.edu>
687
688 Remove dead code.
689 * src/symtab.c (symbol_pack): Here because every symbol's number
690 is always defined by this time.
691
5b1ff423
AR
6922009-10-03 Alex Rozenman <rozenman@gmail.com>
693
694 Add additional space after periods in NEWS.
695 * NEWS (2.5): here.
696
47eced30
JD
6972009-09-29 Joel E. Denny <jdenny@clemson.edu>
698
699 Use the correct conversion specifier for size_t.
700 Reported by Jim Meyering.
701 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
702 because Sbitset__Index is size_t.
703 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
704
d8f68fc2
JD
7052009-09-27 Joel E. Denny <jdenny@clemson.edu>
706
707 tests: don't abuse AT_BISON_CHECK.
708 * tests/regression.at (parse-gram.y: LALR = IELR): Move
709 additional shell commands outside of AT_BISON_CHECK.
710
43aabb70
JD
7112009-09-26 Joel E. Denny <jdenny@clemson.edu>
712
713 tests: check that parse-gram.y's IELR and LALR are identical.
714 * tests/atlocal.in (abs_top_srcdir): New shell variable.
715 * tests/regression.at (parse-gram.y: LALR = IELR): New test
716 group.
717
66381412
AR
7182009-09-19 Alex Rozenman <rozenman@gmail.com>
719
720 Keep sub-messages aligned. Fix strings for translation.
5b1ff423
AR
721 * src/location.h (location_print): Add return value.
722 * src/location.c (location_print): Return number of printed
66381412 723 characters.
5b1ff423
AR
724 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
725 new functions.
726 * src/complain.cpp (indent_ptr): New static variable.
727 (error_message, complain_at_indent, warn_at_indent): Implement
728 the alignment mechanism.
729 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
730 for translations. Use new alignment mechanism.
731 * tests/named-ref.at: Adjust test-cases.
66381412
AR
732 * NEWS (2.5): Add an announcement about named references.
733
a6ca4ce2
AD
7342009-09-17 Akim Demaille <demaille@gostai.com>
735
736 doc: fixes.
737 * doc/bison.texinfo: here.
738 Reported by Alex Rozenman.
739
3cdc21cf
AD
7402009-09-16 Akim Demaille <demaille@gostai.com>
741
742 doc: lalr1.cc and variants.
743 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
744 "variant" %define variables.
745 (C++ Semantic Values): Split into...
746 (C++ Unions, C++ Variants): these.
747 The latter is new.
748 (C++ Parser Interface): Fix type names.
749 Document parser::syntax_error.
750 Document the fact that locations are not mandatory.
751 (C++ Scanner Interface): Split into...
752 (Split Symbols, Complete Symbols): these.
753 The later is new.
754 (Calc++ Parsing Driver): Use variants.
755 Add more comments.
756 Adjust style.
757 (Calc++ Parser): Declare all the tokens, no
758 longer accept raw characters.
759 Remove %union.
760 Adjust types and printers.
761 Remove destructors.
762 (Calc++ Scanner): Use make_<SYMBOL> functions.
763 Use strerror in error message.
764
f50bfcd6
AD
7652009-09-16 Akim Demaille <demaille@gostai.com>
766
767 doc: spell checking.
768 * doc/bison.texinfo: here.
769
6b5a0de9
AD
7702009-09-16 Akim Demaille <demaille@gostai.com>
771
772 doc: comment changes.
773 * doc/bison.texinfo: Comment changes.
774
2b08bceb
AD
7752009-09-16 Akim Demaille <demaille@gostai.com>
776
777 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
778 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
779 constructor to take a token_type instead of the (internal) symbol
780 number.
781 Call yytranslate_.
782 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
783 don't call yytranslate_ here.
784
c981ce9b
AD
7852009-09-16 Akim Demaille <demaille@gostai.com>
786
787 TODO: statistics.
788 * TODO (Figures): New.
789
00d80a9c
JD
7902009-09-13 Joel E. Denny <jdenny@clemson.edu>
791
792 tests: clean up push.at test group titles.
793 * tests/push.at: Remove "Push Parsing: " from test group titles
794 because these are already under the banner "Push Parsing Tests".
795
f64e406b
AR
7962009-09-12 Alex Rozenman <rozenman@gmail.com>
797
798 Provide an additional sub-message for clarity.
799 Add "symbol not found in production" error message when
800 an "invalid reference" is detected in named references
801 resolution.
802 * src/scan-code.l: Update "invalid reference" case.
803 * tests/named-ref.at: Adjust test-cases.
804
bb31eb56
JD
8052009-09-10 Joel E. Denny <jdenny@clemson.edu>
806
807 Clean up yacc.c a little.
808 * data/yacc.c: Clean up M4 for readability, and make output
809 whitespace more consistent. For the main parse function
810 comment, instead of saying "yyparse or yypush_parse", say either
811 "yyparse" or "yypush_parse" depending on which it actually is.
812
2d399888
JD
8132009-09-10 Joel E. Denny <jdenny@clemson.edu>
814
815 Fix --enable-gcc-warnings.
816 * src/parse-gram.y (%printer <param>): Handle param_none.
817
ff601366
AD
8182009-09-09 Akim Demaille <demaille@gostai.com>
819
820 lalr1.cc: syntax_error as exceptions.
821 It is common to use sort of factories in the user actions. These
822 factories may check some "syntactic" constraints that are not
823 enforced by the grammar itself. This is possible using YYERROR
824 within the action itself. Provide the user with a means to throw
825 a syntax_error exception.
826
827 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
828 Declare and define yy::parser::syntax_error.
829 * data/lalr1.cc: Include stdexcept.
830 (yy::parser::parse): Wrap the user action within a try/catch.
831 * data/glr.cc: Include stdexcept.
832
29660062
AD
8332009-09-09 Akim Demaille <demaille@gostai.com>
834
835 lalr1.cc: add missing "inline".
836 * data/c++.m4 (b4_public_types_define): Add missing inline to
837 implementations provided in headers.
838
2055a44e
AD
8392009-09-09 Akim Demaille <demaille@gostai.com>
840
841 %param: documentation.
842 * NEWS (2.6): Document %param, %lex-param, and %parse-param
843 changes.
844 * doc/bison.texinfo: Document that %lex-param and %parse-param
845 are n-ary.
846 Changes some examples to demonstrate it.
847 (Calc++ Parser): Use %param.
848
dd875058
AD
8492009-09-09 Akim Demaille <demaille@gostai.com>
850
851 Regen.
852
f71db70b
AD
8532009-09-09 Akim Demaille <demaille@gostai.com>
854
855 style changes.
856 * src/parse-gram.y (add_param): Scope changes.
857
eaca4c11
AD
8582009-09-09 Akim Demaille <demaille@gostai.com>
859
860 %parse: support several arguments.
861 * src/parse-gram.y (current_param): New.
862 (param_type): Add param_none.
863 (params): New nonterminal.
864 Use it.
865
b18cdd91
AD
8662009-09-09 Akim Demaille <demaille@gostai.com>
867
868 Regen.
869
a7706735
AD
8702009-09-09 Akim Demaille <demaille@gostai.com>
871
872 %param.
873 Provide a means to factor lex-param and parse-param common
874 declarations.
875
876 * src/parse-gram.y (param_type): New.
877 Define a %printer for it.
878 (add_param): Use it.
879 (%parse-param, %lex-param): Merge into...
880 (%parse): this new token.
881 Adjust the grammar to use it.
882 * src/scan-gram.l (RETURN_VALUE): New.
883 (RETURN_PERCENT_FLAG): Use it.
884 (RETURN_PERCENT_PARAM): New.
885 Use it to support %parse-param, %lex-param and %param.
886
9789acf0
JD
8872009-09-03 Joel E. Denny <jdenny@clemson.edu>
888
889 Use aver not assert.
890 * src/output.c: Don't include assert.h.
891 (output_skeleton): Use aver not assert.
892 * src/system.h (aver): In documentation of why, add links to
893 Paul Eggert's explanations in the mailing lists.
894
61bc57e5
AR
8952009-09-05 Alex Rozenman <rozenman@gmail.com>
896
897 Use "Unresolved reference" error message when no symbols were found
898 in a symbolic reference resolution. Remove .expr and -expr from
899 the shown reference when the reference is unresolved.
900 * src/scan-code.l: Change the error message, adjust location columns,
901 rename variable "exact_mode" to "explicit_bracketing".
902 * tests/named-ref.at: Adjust existing tests and add a new one.
903
f4c75eaf
AD
9042009-09-04 Akim Demaille <demaille@gostai.com>
905
906 Adjust synclines in src/parse-gram.[ch].
907 * tests/bison.in: Do some magic (including working around issues
908 with ylwrap) when this wrapper is used to compile
909 src/parse-gram.y.
910
c6abeab1
JD
9112009-09-03 Joel E. Denny <jdenny@clemson.edu>
912
913 Complain about unused %define variables and %code qualifiers.
914 * NEWS (2.5): Document.
915 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
916 * doc/bison.texinfo (Decl Summary): Document complaint, and
917 improve %define documentation a little otherwise.
918 * tests/input.at (Reject unused %code qualifiers): Update.
919 (%define errors): Update.
920 (%define, --define, --force-define): Update.
921 (%define backward compatibility): Update.
922 (Unused %define api.pure): Update.
923 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
924
82db7cdb
JD
9252009-09-03 Joel E. Denny <jdenny@clemson.edu>
926
927 Don't suppress warnings about unused parse.error.
928 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
929 %define variable parse.error unless b4_error_verbose_flag is
930 actually expanded in a skeleton.
931
2755de8f
AD
9322009-09-03 Akim Demaille <demaille@gostai.com>
933
934 * NEWS (2.4.2): Add "Internationalization" item.
935
1deef26d
AD
9362009-09-03 Akim Demaille <demaille@gostai.com>
937
938 bootstrap: fix/improve find_tool.
939 * bootstrap (find_tool): Improve error messages.
940 Fix typo about find_tool_names.
941
2646cd54
JD
9422009-08-29 Joel E. Denny <jdenny@clemson.edu>
943
944 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
945 See
946 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
947 * src/scan-code.h (code_props_rule_action_init): Rename
948 named_ref arg to name so it doesn't shadow named_ref type. This
949 makes it consistent with the function definition in scan-code.l
950 anyway.
951
cf499cff
JD
9522009-08-28 Joel E. Denny <jdenny@clemson.edu>
953
954 %define: accept unquoted values.
955 * NEWS (2.5): Group all %define changes together, and document
956 this one. Remove quotes in IELR and canonical LR entry.
957 * doc/bison.texinfo: Remove quotes in most examples throughout.
958 (Decl Summary): Update %define documentation.
959 (Table of Symbols): Likewise.
960 * src/ielr.c (LrType): Update documentation.
961 * src/parse-gram.y (content.opt): Add production for ID.
962 * tests/actions.at: Remove quotes in most tests.
963 * tests/calc.at: Likewise.
964 * tests/existing.at: Likewise.
965 * tests/input.at: Likewise.
966 * tests/local.at: Likewise.
967 * tests/push.at: Likewise.
968 * tests/reduce.at: Likewise.
969 * tests/torture.at: Likewise.
970
6ba96404
JD
9712009-08-28 Joel E. Denny <jdenny@clemson.edu>
972
973 %define lr.type: make values lowercase IDs.
974 That is, "LALR" => "lalr", "IELR" => "ielr", and
975 "canonical LR" => "canonical-lr".
976 * NEWS (2.5): Update documentation.
977 * doc/bison.texinfo (Decl Summary): Likewise.
978 * src/ielr.c (ielr): Use new values.
979 * src/ielr.h (ielr): Update documentation.
980 * src/reader.c (prepare_percent_define_front_end_variables): Use
981 and validate new values.
982 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
983 grammars.
984 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
985
4413bbd3
EB
9862009-08-27 Eric Blake <ebb9@byu.net>
987
988 scan-gram: avoid portability trap with ctype usage.
989 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
990 Avoid compiler warning.
991
b70c7fb4
JD
9922009-08-27 Joel E. Denny <jdenny@clemson.edu>
993
994 tests: use perl for printing special sequences to files.
995 And skip tests if perl is not available. This is better than
996 playing tricks with shell portability. Suggested by Akim
997 Demaille.
998 * tests/input.at (Bad character literals): Use it here for
999 omitting final newlines.
1000 (Bad escapes in literals): Use it here for special characters.
1001
d1cc31c5
JD
10022009-08-26 Joel E. Denny <jdenny@clemson.edu>
1003
1004 tests: show a use of %define lr.default-reductions "consistent"
1005 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
1006 prevents the omission of expected tokens for %error-verbose.
1007
3bed3a75
AD
10082009-08-26 Akim Demaille <demaille@gostai.com>
1009
1010 tests: portability fix.
1011 * tests/input.at (Bad escapes in literals): Don't expect "echo
1012 '\0'" to output \ then 0.
1013
aa0cb40d
JD
10142009-08-26 Joel E. Denny <jdenny@clemson.edu>
1015
1016 Actually handle the yytable zero value correctly this time.
1017 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
1018 zero values in the YYTABLE comments.
1019 * data/glr.c (yytable_value_is_error): Don't check for zero
1020 value.
1021 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
1022 * data/yacc.c (yytable_value_is_error): Likewise.
1023 * data/lalr1.java (yy_table_value_is_error_): Likewise.
1024 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
1025 * src/tables.h: In header comments, explain why it's useless to
1026 check for a zero value in yytable.
1027
f2b30bdf
JD
10282009-08-25 Joel E. Denny <jdenny@clemson.edu>
1029
1030 More fixes related to last two patches.
1031 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
1032 comments: zero indicates syntax error not default action.
1033 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
1034 defined.
1035 * data/glr.c (yyis_pact_ninf): Rename to...
1036 (yypact_value_is_default): ... this.
1037 (yyisDefaultedState): Update for rename.
1038 (yyis_table_ninf): Rename to...
1039 (yytable_value_is_error): ... this, and check for value zero
1040 besides just YYTABLE_NINF.
1041 (yygetLRActions): Check for default value from yypact. It
1042 appears that this check is always performed before this function
1043 is invoked, and so adding the check here is probably redundant.
1044 However, the code may evolve after this subtlety is forgotten.
1045 Also, update for rename to yytable_value_is_error. Because that
1046 macro now checks for zero, a different but equivalent branch of
1047 the if-then-else here is evaluated.
1048 (yyreportSyntaxError): Update for rename to
1049 yytable_value_is_error. The zero condition was mishandled
1050 before.
1051 (yyrecoverSyntaxError): Update for renames. No behavioral
1052 changes.
1053 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1054 New function.
1055 (yy_table_value_is_error_): New function.
1056 (parse): Use new functions where possible. No behavioral
1057 changes.
1058 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1059 The zero condition was mishandled before.
1060 * data/yacc.c (yyis_pact_ninf): Rename to...
1061 (yypact_value_is_default): ... this.
1062 (yyis_table_ninf): Rename to...
1063 (yytable_value_is_error): ... this, and check for value zero
1064 besides just YYTABLE_NINF.
1065 (yysyntax_error): Update for rename to yytable_value_is_error.
1066 The zero condition was mishandled before.
1067 (yyparse): Update for renames. No behavioral changes.
1068 * src/tables.h: Improve comments about yypact, yytable, etc.
1069 more. Most importantly, say yytable value of zero means syntax
1070 error not default action.
1071
53f036ce
JD
10722009-08-25 Joel E. Denny <jdenny@clemson.edu>
1073
1074 Fix %error-verbose for conflicts resolved by %nonassoc.
1075 * NEWS (2.5): Document.
1076 * data/glr.c (yyreportSyntaxError): Fix this by checking
1077 yyis_table_ninf.
1078 * data/yacc.c (yysyntax_error): Likewise.
1079 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1080 yytable_ninf_.
1081 * data/lalr1.java (yysyntax_error): Likewise.
1082 * tests/conflicts.at (%nonassoc and eof): Update expected output
1083 and remove FIXME.
1084
87412882
JD
10852009-08-25 Joel E. Denny <jdenny@clemson.edu>
1086
1087 Some code and documentation improvements.
1088 * data/c.m4 (b4_table_value_equals): New macro to capture
1089 some repeated code.
1090 * data/glr.c (yyis_pact_ninf): Use it here.
1091 (yyis_table_ninf): Likewise.
1092 (yyreportSyntaxError): Improve internal comments.
1093 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1094 Use it everywhere possible.
1095 (yyis_table_ninf): Likewise.
1096 (yysyntax_error): Improve internal comments.
1097 * data/lalr1.cc (yysyntax_error_): Likewise.
1098 * data/lalr1.java (yysyntax_error): Likewise.
1099 * src/tables.h: Improve comments about yypact, yytable, etc.
1100
e6c849d8
JD
11012009-08-21 Joel E. Denny <jdenny@clemson.edu>
1102
1103 Use locale when quoting.
1104 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1105 quote rather than implementing quoting here.
1106
d8911864
EB
11072009-08-20 Eric Blake <ebb9@byu.net>
1108
b0778bdd
EB
1109 Make previous patch more robust.
1110 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1111 argmatch.h.
1112 (output_skeleton): Use it.
1113 Suggested by Akim Demaille.
1114
d8911864
EB
1115 Import latest m4/m4.m4.
1116 * submodules/autoconf: Update to autoconf 2.64.
1117 * configure.ac (M4_GNU_OPTION): New define.
1118 * src/output.c (output_skeleton): Use it to resolve FIXME.
1119 * NEWS: Mention this.
1120
c2724603
JD
11212009-08-19 Joel E. Denny <jdenny@clemson.edu>
1122
1123 Fix complaints about escape sequences.
1124 Discussed starting at
1125 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1126 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1127 For a \0 and similar escape sequences meaning the null
1128 character, report an invalid escape sequence instead of an
1129 invalid null character because the latter does not actually
1130 appear in the user's input.
1131 In all escape sequence complaints, don't escape the initial
1132 backslash, and don't quote when the sequence appears at the end
1133 of the complaint line unless there's whitespace that quotearg
1134 won't escape.
1135 Consistently say "invalid" not "unrecognized".
1136 Consistently prefer "empty character literal" over "extra
1137 characters in character literal" warning for invalid escape
1138 sequences; that is, consistently discard those sequences.
1139 * tests/input.at (Bad escapes in literals): New.
1140
17aed602
AD
11412009-08-19 Akim Demaille <demaille@gostai.com>
1142
1143 doc: fixes.
1144 * doc/bison.texinfo: Fix minor Texinfo errors.
1145
9142239a
AD
11462009-08-19 Akim Demaille <demaille@gostai.com>
1147
1148 tests: distcc compliance.
1149 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
1150 error messages from the output.
1151
171ad99d
AD
11522009-08-19 Akim Demaille <demaille@gostai.com>
1153
1154 variables: simplify the upgrade of namespace into api.namespace.
1155
1156 This patch simplifies "variables: rename namespace as
1157 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
1158 Suggested by Joel E. Denny in
1159 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
1160
1161 * src/muscle-tab.c (muscle_percent_variable_update): New.
1162 (muscle_percent_define_insert): Use it in replacement of the
1163 previous tr invocation.
1164 Remove variable_tr, no longer needed.
1165 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1166 Remove.
1167 * data/c++.m4: No longer handle namespace -> api.namespace.
1168 * tests/input.at (%define backward compatibility): Check that
1169 namespace is treated as api.namespace.
1170
d59e456d
AD
11712009-08-19 Akim Demaille <demaille@gostai.com>
1172
1173 doc: %initial-action to initialize yylloc.
1174 Reported by Bill Allombert.
1175 * doc/bison.texinfo: Set fill-column to 76.
1176 (Location Type): Document the use of %initial-action to initialize
1177 yylloc.
1178
ceb8b8e6
AD
11792009-08-19 Akim Demaille <demaille@gostai.com>
1180
1181 lalr1.cc: use state_type.
1182 * data/lalr1.cc (yysyntax_error_): Use state_type.
1183 Move argument names into yy*.
1184
7580c379
AD
11852009-08-19 Akim Demaille <demaille@gostai.com>
1186
1187 lalr1.cc: get rid of yyparse's yystate.
1188 yystate and yystack_[0].state are equal, keep only the latter.
1189 The former was also used as a temporary variable to compute the
1190 post-reduction state. Move this computation into an auxiliary
1191 function.
1192
1193 * data/glr.c (yyLRgotoState): Fuse variable definition and first
1194 assignment.
1195 * data/lalr1.cc (yy_lr_goto_state_): New.
1196 (yyparse): Use it.
1197 Replace remaining uses of yystate by yystate_[0].state.
1198 Remove the former.
1199
c4dc4c46
AD
12002009-08-19 Akim Demaille <demaille@gostai.com>
1201
1202 lalr1.cc: destroy $$ when YYERROR is called.
1203 * data/lalr1.cc (yyreduce): Compute the resulting state before
1204 running the user action so that yylhs is a valid symbol.
1205 (yyerrorlab): Since yylhs is complete (it knows its type), we can
1206 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
1207 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
1208
c67e466f
JD
12092009-08-18 Joel E. Denny <jdenny@clemson.edu>
1210
1211 maint: update for gnulib's recent update-copyright changes
1212 * gnulib: Update.
1213 * .x-update-copyright (COPYING): Add as it's no longer implied
1214 when .x-update-copyright is present.
1215 * cfg.mk (update-copyright-local): Remove, now ignored.
1216 (update-copyright): Declare update-b4-copyright as a dependency.
1217
af6d2358
AD
12182009-08-17 Akim Demaille <demaille@gostai.com>
1219
1220 build: require gettext 0.17.
1221
1222 Suggested by Bruno Haible.
1223 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1224 * configure.ac: require gettext 0.17 to ensure compatibility with
1225 gnulib.
1226
91a2b9b1
AD
12272009-08-17 Akim Demaille <demaille@gostai.com>
1228
1229 build: lower gettext requirements.
1230
1231 Bison was uselessly requiring the formatstring macros from
1232 gettext, which resulted in mo files not being installed on systems
1233 that perfectly supported Bison mo files. Lower the requirement.
1234 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1235
b0778bdd
EB
1236 * configure.ac: Require need-ngettext instead of
1237 need-formatstring-macros.
1238 Reported by Martin Jabocs.
1239 Suggested by Bruno Haible.
1240 * INSTALL: Restructure.
1241 (Internationalization): New.
91a2b9b1 1242
585935e8
JD
12432009-08-14 Joel E. Denny <jdenny@clemson.edu>
1244
1245 maint: fix use of copyright year intervals.
1246 * gnulib: Update.
1247 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1248 as now recommended in gnulib/NEWS.
1249 * build-aux/update-b4-copyright: Fix.
1250 * cfg.mk (update-copyright-env): Configure update-copyright.
1251
83b60c97
JD
12522009-08-13 Joel E. Denny <jdenny@clemson.edu>
1253
1254 Make it easier to write deterministic tests.
1255 Continues Akim's work from his 2009-06-10 commits.
1256 * src/reader.c (check_and_convert_grammar): Don't add any
1257 symbols after the first symbols_do invocation.
1258 * src/symtab.c (symbols_sorted): New static global.
1259 (user_token_number_redeclaration): Update comments.
1260 (symbol_from_uniqstr): If a new symbol is being created, assert
1261 that symbols_sorted hasn't been allocated yet.
1262 (symbols_free): Free symbols_sorted.
1263 (symbols_cmp, symbols_cmp_qsort): New functions.
1264 (symbols_do): Sort symbol_table into symbols_sorted on first
1265 invocation.
1266 * tests/input.at (Numbered tokens): Recombine tests now that the
1267 output should be deterministic across multiple numbers.
1268
28169bab
AD
12692009-08-12 Akim Demaille <demaille@gostai.com>
1270
1271 tests: GCC 4.5 compliance.
1272 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
1273 messages about #error.
1274
9f14e187
AD
12752009-08-12 Akim Demaille <demaille@gostai.com>
1276
1277 build: fix the generation of the documentation.
1278 Some of our targets use "bison --help", but they can't depend on
1279 "bison" itself (to avoid additional requirements on the user), so
1280 they used to call "make src/bison" in the commands. Then
1281 concurrent builds may fail: one make might be aiming one of its
1282 jobs at compiling src/bison, and another job at generating the man
1283 page. If the latter is faster than the former, then we have two
1284 makes that concurrently try to compile src/bison.
1285
1286 This might also be a more convincing explanation for the failure
1287 described in the patch "build: fix paths".
1288
1289 * Makefile.am (SUFFIXES): Initialize.
1290 * build-aux/move-if-change: New, symlink to gnulib's.
1291 * build-aux/local.mk: Ship it.
1292 * doc/common.x: Remove, merged into...
1293 * doc/bison.x: here.
1294 * doc/local.mk (doc/bison.help): New.
1295 ($(CROSS_OPTIONS_TEXI)): Depend on it.
1296 Use src/bison.
1297 (.x.1): Replace with...
1298 (doc/bison.1): this explicit, simpler, target.
1299 (common_dep): Remove, inlined where appropriate.
1300 (SUFFIXES, PREPATH): Remove, unused.
1301
d1b55e81
AD
13022009-08-12 Akim Demaille <demaille@gostai.com>
1303
1304 gnulib: improve prefixing.
1305 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
1306 change the value of...
1307 (gl_LIBOBJS): this.
1308 Adjust more variables.
1309 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
1310 gl_LIBOBJS.
1311 (prefix): Also transform rules whose targets have slashes.
1312 Use $prefix liberally.
1313 Map @MKDIR_P@ to $(MKDIR_P).
1314 Prefix directories that are mkdir'd.
1315
838205d5
AD
13162009-08-12 Akim Demaille <demaille@gostai.com>
1317
1318 build: fix paths.
1319 When using $(top_builddir) inconsistently, Make (including GNU
1320 Make) is sometimes confused. As a result it may want to build
1321 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
1322 file, different names) concurrently, which, amusingly enough,
1323 might end with:
1324
1325 ranlib lib/libbison.a
1326 ranlib lib/libbison.a
1327 make[2]: *** [lib/libbison.a] Segmentation fault
1328
1329 on OS X.
1330
1331 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
1332 needed.
1333
67af7198
AD
13342009-08-12 Akim Demaille <demaille@gostai.com>
1335
1336 distcheck: fix.
1337
b0778bdd 1338 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
67af7198 1339
c467dc42
JD
13402009-08-10 Joel E. Denny <jdenny@clemson.edu>
1341
1342 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
1343
dfaa4860
JD
13442009-08-10 Joel E. Denny <jdenny@clemson.edu>
1345
1346 Miscellaneous code readability improvements.
1347
1348 * src/reader.c (reader): Move %define front-end variable
1349 defaults and checking into...
1350 (prepare_percent_define_front_end_variables): ... this new
1351 function.
1352
1353 * src/scan-gram.l (INITIAL): For consistency with string
1354 literals, don't store open quote on character literal. It's
1355 discarded before returning anyway.
1356 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1357 Make length test more readable, and make the character stored
1358 for an empty literal more obvious while consistent with the
1359 previous behavior.
1360
1361 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1362 USER_NUMBER_HAS_STRING_ALIAS throughout.
1363 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1364 that is repeated in symtab.h. Improve argument names to make it
1365 clear which side of the symbol-string alias pair is which.
1366 (symbol_check_alias_consistency): Improve local variable names
1367 for the same purpose.
1368 * src/symtab.h (struct symbol): Make comments about aliases
1369 clearer.
1370 (symbol_make_alias): Improve comments and argument name.
1371 * src/output.c (token_definitions_output): Update for rename to
1372 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1373
ce268795
AR
13742009-08-08 Alex Rozenman <rozenman@gmail.com>
1375
1376 Convert "misleading reference" messages to warnings.
1377 * src/scan-code.l: New function 'show_sub_messages', more
1378 factoring.
1379 * tests/named-ref.at: Adjust tests.
1380
401b73af
JD
13812009-08-06 Joel E. Denny <jdenny@clemson.edu>
1382
1383 maint: run "make update-copyright"
1384
a1a9422d
JD
13852009-08-06 Joel E. Denny <jdenny@clemson.edu>
1386
1387 maint: make update-b4-copyright easier to use
1388 * build-aux/update-b4-copyright: In warnings, report line
1389 numbers rather than character positions.
1390 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1391 that update-copyright runs it.
1392 * gnulib: Update.
1393
0b61a8ec
JD
13942009-08-05 Joel E. Denny <jdenny@clemson.edu>
1395
1396 maint: clean up update-b4-copyright code
1397 * build-aux/update-b4-copyright: Do not accept 2-digit
1398 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1399 Don't accept a `[' in a b4_copyright argument.
1400 Format code more consistently.
1401 Don't assume b4*copyright never occurs.
1402
269e222e
JD
14032009-08-04 Joel E. Denny <jdenny@clemson.edu>
1404
1405 maint: automate b4_copyright updates.
1406 * Makefile.am (update-b4-copyright): New target rule.
1407 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
1408 * build-aux/update-b4-copyright: New.
1409 * data/yacc.c: Remove stray characters around b4_copyright
1410 invocations.
1411
35905f2b
JD
14122009-08-04 Joel E. Denny <jdenny@clemson.edu>
1413
1414 maint: automate annual package-wide copyright-year update.
1415 * .x-update-copyright: New.
1416 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1417 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1418 update-copyright. Remove gnumakefile, which is implied by
1419 maintainer-makefile.
1420 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1421 * gnulib: Update.
1422 * maint.mk: Remove, now copied from gnulib.
1423 * examples/extexi: Add missing "(C)" in copyright statement so
1424 update-copyright can recognize it.
1425 * src/LR0.h: Likewise.
1426 * src/print.h: Likewise.
1427 * src/print_graph.h: Likewise.
1428 * src/gram.c: Add missing comma in copyright statement.
1429 * src/gram.h: Likewise.
1430
b30e18dc
JD
14312009-08-04 Joel E. Denny <jdenny@clemson.edu>
1432
1433 Fix "make distcheck".
1434 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1435 of just calc.stamp.
1436
8d90395d
JD
14372009-08-01 Joel E. Denny <jdenny@clemson.edu>
1438
1439 Pacify "gcc -Wunused" for the input function from Flex.
1440 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1441 and later.
1442 * src/scan-code.l: Add "%option noinput", which I cannot find in
1443 the Flex manual, but which Flex has supported since at least as
1444 far back as 2.5.4. However, if any of our developers still use
1445 Flex 2.5.4, they'll need to stop configuring with
1446 --enable-gcc-warnings because "%option noinput" didn't work
1447 correctly until Flex 2.5.6.
1448 * src/scan-gram.l: Likewise.
1449 * src/scan-skel.l: Likewise.
1450
ba4184ec
AR
14512009-07-31 Alex Rozenman <rozenman@gmail.com>
1452
1453 Fix --enable-gcc-warnings problems.
1454 * src/reader.c: Adjust variable names.
1455 * src/scan-code.l: Fix prototypes and adjust names.
1456 * src/named-ref.c: Remove redundant "if".
1457
91a2af97
JD
14582009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1459
1460 Fix a --enable-gcc-warnings problem.
1461 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1462 variable.
1463
3208e3f4
JD
14642009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1465
1466 Warn about character literals not of length one.
1467 * NEWS (2.5): Document.
1468 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1469 the length.
1470 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1471 * tests/input.at (Bad character literals): New test group.
1472
5add20ab 14732009-07-24 Alex Rozenman <rozenman@gmail.com>
13cdf208
AR
1474
1475 Fix some memory leaks.
1476 * src/named-ref.c: Add a pointer check (named_ref_free).
1477 * src/scan-code.l: New function (variant_table_free). Called in
1478 code_scanner_free.
1479 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1480
e459fb0e
JD
14812009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1482
1483 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1484
c4be5517
JD
14852009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1486
1487 Some M4 cleanup in the testsuite.
1488 Suggested by Eric Blake at
1489 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1490 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1491 complicate the code by distinguishing between a missing value
1492 and an empty string value for an optional argument. This fix is
1493 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1494 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1495 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1496 arguments are not needed because of the following changes.
1497 Fix stale comments.
1498 Bison developers should use GNU M4 and should not use
1499 POSIXLY_CORRECT when building the test suite, so do not
1500 complicate the code by avoiding $10 and above.
1501 Do not quote an empty string value for an optional argument, and
1502 do not distinguish between a missing value and an empty string
1503 value.
1504
feeb56cd
JD
15052009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1506
1507 Revert unnecessary column realignment in --help output.
1508 Reported by Akim Demaille at
1509 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1510 * src/getargs.c (usage): Here.
1511
5add20ab 15122009-07-04 Alex Rozenman <rozenman@gmail.com>
629e4def
AR
1513
1514 Alphabetical order in src/local.mk.
1515 * src/local.mk: Adjust.
1516
5add20ab 15172009-07-04 Alex Rozenman <rozenman@gmail.com>
872b52bc
AR
1518
1519 Style changes and factoring.
1520 * src/named-ref.h: Add comments.
1521 * src/parse-gram.y: Readability and style changes.
1522 * src/reader.c: Factoring: assign_named_ref function.
1523 * src/scan-code.l: Factoring and style changes. Rename
1524 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1525 Use "unsigned" type for variant index. Improve readablity.
1526 * src/scan-gram.l: Change error messages and add comments.
1527 * src/symlist.h: symbol_list_null: New function decl.
1528 * src/symlist.c: symbol_list_null: Implement here.
1529 * tests/named-refs.at: Adjust for new error messages.
1530
83ea2423
EB
15312009-06-29 Eric Blake <ebb9@byu.net>
1532
1533 scan-code: avoid compiler warnings
1534 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1535
5ece73ea
AD
15362009-06-29 Akim Demaille <demaille@gostai.com>
1537
1538 build: avoid concurrent extraction of calc++.
1539 * examples/calc++/Makefile.am (calc.stamp): New.
1540 Depend on it to create the sources of calc++ so that concurrent
1541 builds don't launch several "extexi" in parallel.
1542 Not only this is inefficient, this also builds incorrect sources
1543 with several extractions mixed together.
1544
ad597a78
AD
15452009-06-29 Akim Demaille <demaille@gostai.com>
1546
1547 parse.error: fix.
1548 * data/bison.m4: Move code related to specific variables after the
1549 definition of the variable-maintaining macros so that we don't
1550 "invoke" b4_percent_define_check_values before it is defined.
1551
31b850d2
AD
15522009-06-29 Akim Demaille <demaille@gostai.com>
1553
1554 variables: parse.error
1555
1556 Implement, document, and test the replacement of %error-verbose
1557 by %define parse.error "verbose".
1558 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
1559 values of the parse.error variable.
1560 Make "simple" its default value.
1561 Check the valid values.
1562 * src/parse-gram.y: Use %define parse.error.
1563 (PERCENT_ERROR_VERBOSE): New token.
1564 Support it.
1565 * src/scan-gram.l: Support %error-verbose.
1566
1567 * doc/bison.texinfo (Decl Summary): Replace the documentation of
1568 %define error-verbose by that of %define parse.error.
1569 * NEWS: Document it.
1570
1571 * tests/actions.at, tests/calc.at: Use parse.error instead of
1572 %error-verbose.
1573
b9f1d9a4
AR
15742009-06-27 Alex Rozenman <rozenman@gmail.com>
1575
1576 Implement support for named symbol references.
1577 * src/parse-gram.y: Add new syntax (named_ref.opt).
1578 * src/reader.c: Store named refs in symbol lists.
1579 * src/reader.h: New argument for symbol_append and
1580 action_append functions.
1581 * src/scan-code.h: Add new field (named_ref) into
1582 code_props data structure. Keeps named ref of midrule
1583 actions.
1584 * src/scan-code.l: Support for named refs in semantic
1585 action code. New function 'parse_named_ref'.
1586 * src/scan-gram.l: Support bracketed id.
1587 * src/symlist.c: Store named refs in symbol lists.
1588 * src/symlist.h: New field in symbol list: named_ref.
1589 * src/named-ref.h: New file, a struct for named_ref.
1590 * src/named-ref.cp: New file, named_ref_new function.
1591 * src/local.mk: Add two new files.
1592 * tests/testsuite.at: Include new test group:
1593 * tests/named-refs.at: this new file.
1594
b5c212b6
AD
15952009-06-25 Akim Demaille <demaille@gostai.com>
1596
1597 hash: check insertion for memory exhaustion.
1598 * src/uniqstr.c (uniqstr_new): New.
1599
67501061
AD
16002009-06-24 Akim Demaille <demaille@gostai.com>
1601
1602 variables: rename namespace as api.namespace.
1603 Discussed in
1604 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
1605
1606 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1607 New.
1608 (b4_percent_define_use): New.
1609 Use it where applicable.
1610 * data/c++.m4: Replace uses of the variable "namespace" by
1611 "api.namespace".
1612 Default the latter to the former.
1613 * doc/bison.texinfo (Decl Summary): Document "namespace" as
1614 obsolete.
1615 Document api.namespace.
1616 Use @samp to document %define uses, keep @code for identifiers.
1617 * NEWS: Likewise.
1618 * tests/c++.at, tests/input.at: Test api.namespace instead of
1619 namespace. (The tests passed with namespace.)
1620
41976786
AD
16212009-06-11 Akim Demaille <demaille@gostai.com>
1622
1623 style changes.
1624 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1625 * src/print-xml.c: Style changes.
1626 * tests/conflicts.at: Comment changes.
1627
44bb9084
AD
16282009-06-11 Akim Demaille <demaille@gostai.com>
1629
1630 xml: beware of user strings used to give a %prec to rules.
1631 * tests/conflicts.at (%prec with user strings): New.
1632 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1633 XML output.
1634
04d1e39d
AD
16352009-06-11 Akim Demaille <demaille@gostai.com>
1636
1637 hash: check insertion for memory exhaustion.
1638 * src/muscle-tab.c (muscle_insert, muscle_grow)
1639 * src/state.c (state_hash_insert): Check the return value of
1640 hash_insert.
1641
a8873669
AD
16422009-06-11 Akim Demaille <demaille@gostai.com>
1643
1644 tests: honor TESTSUITEFLAGS in every check target.
1645 * tests/local.mk (RUN_TESTSUITE): New.
1646 (check-local, installcheck-local, maintainer-check-g++)
1647 (maintainer-check-posix, maintainer-check-valgrind): Use it.
1648
8893145a
AD
16492009-06-10 Akim Demaille <demaille@gostai.com>
1650
1651 deterministic test suite.
1652 Some consistency checks on symbols are performed after all the
1653 symbols were read, by an iteration over the symbol table. This
1654 traversal is nondeterministic, which can be a problem for test
1655 cases.
1656 Avoid this.
1657 Addresses another form of nondeterminism reported by Joel E. Denny.
1658 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1659
1660 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1661 test in two.
1662 Use different file names for the three tests to make the
1663 maintenance easier.
1664
92d7a23a
AD
16652009-06-10 Akim Demaille <demaille@gostai.com>
1666
1667 gnulib: update.
b0778bdd
EB
1668 * gnulib: Update to latest.
1669 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1670 * m4/.gitignore: Regen.
1671 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1672 Call xalloc_die on hash_insert failures.
1673 Requested by the new __warn_unused_result__ attribute of
1674 hash_insert.
92d7a23a 1675
12cf133f
AD
16762009-06-10 Akim Demaille <demaille@gostai.com>
1677
1678 deterministic user-token-number redeclaration errors.
1679 Address nondeterminism reported by Joel E. Denny.
1680 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1681
1682 * src/uniqstr.h: Comment changes.
1683 * src/location.h (boundary_cmp, location_cmp): New.
1684 * src/symtab.c (user_token_number_redeclaration): New.
1685 (symbol_translation): Use it.
1686 * tests/input.at (Numbered tokens): Adjust the expected output.
1687
796a2b0a
AD
16882009-05-25 Akim Demaille <demaille@gostai.com>
1689
1690 build: avoid ignored errors.
1691 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
1692 errors, they pollute the output.
1693
0b6d43c5
JD
16942009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1695
1696 Convert multiple variable definition warnings to complaints.
1697 * NEWS (2.5): Add a new entry for that change.
1698 * doc/bison.texinfo (Decl Summary): Update %define entry.
1699 (Bison Options): Update -D/--define/-F/--force-define entry.
1700 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
1701 * src/muscle-tab.h (muscle_percent_define_insert): Update
1702 comments.
1703 * tests/input.at (`%define errors'): Update.
1704 (`%define, --define, --force-define'): Update.
1705
de5ab940
JD
17062009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1707
1708 -F/--force-define and relative %define/-D/--define priorities.
1709 * NEWS (2.5): Add documentation to -D/--define entry.
1710 * build-aux/cross-options.pl: Hard-code association of
1711 --force-define with %define.
1712 * doc/bison.texinfo (Decl Summary): In %define entry,
1713 cross-reference command-line options.
1714 (Bison Options): Add documentation to -D/--define entry.
1715 (Option Cross Key): Widen column for --force-define row.
1716 * src/getargs.c (usage): Document -F/--force-define. Realign
1717 options in output.
1718 (short_options, long_options, getargs): Parse -F/--force-define,
1719 and update muscle_percent_define_insert invocations.
1720 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
1721 (muscle_percent_define_insert): Add argument with that type.
1722 * src/muscle-tab.c (muscle_percent_define_insert): Implement
1723 -F/--force-define behavior and priorities.
1724 (muscle_percent_define_ensure): Update
1725 muscle_percent_define_insert invocation.
1726 * src/parse-gram.y (prologue_declaration): Update
1727 muscle_percent_define_insert invocations.
1728 * tests/input.at (`%define, --define'): Rename to...
1729 (`%define, --define, --force-define'): ... this and extend.
1730
f8e7258f
JD
17312009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1732
1733 Update some comments to make sense for -D.
1734 * data/bison.m4 (b4_check_user_names): In header comments, say
1735 "user occurrence" instead of "grammar occurrence".
1736 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
1737 (muscle_percent_code_grow): Likewise just for consistency.
1738
b987342b
JD
17392009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1740
1741 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1742
4977e0a7
JD
17432009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1744
1745 Handle a trailing `:' in a user-supplied C++ namespace better.
1746 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1747 among the closing braces here. This fix might make the
1748 generated code easier to debug, but otherwise it should be
1749 insignificant because a trailing `:' is a C++ error already.
1750
9b04dad7
AD
17512009-05-19 Akim Demaille <demaille@gostai.com>
1752
1753 remove useless variable.
1754 * src/getargs.c (skeleton_arg): Remove now useless variable.
1755 Should help the compiler see that this printf-like call is sane.
1756
4c6622c2
AD
17572009-05-15 Akim Demaille <demaille@gostai.com>
1758
1759 Rename token.prefix as api.tokens.prefix.
1760 Discussed here.
1761 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
1762
1763 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
1764 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
1765 (token.prefix): Rename as...
1766 (api.tokens.prefix): this.
1767
3c248d70
AD
17682009-05-11 Akim Demaille <demaille@gostai.com>
1769
1770 doc: use C++ headers.
1771 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1772 headers.
1773
99c08fb6
AD
17742009-05-11 Akim Demaille <demaille@gostai.com>
1775
1776 doc: token.prefix
1777 * doc/bison.simple (Decl Summary): Document token.prefix.
1778 (Calc++ Parser): Various fixes.
1779 Formatting changes.
1780 Use token.prefix.
1781 Introduce a macro TOKEN to shorten the code and make it more
1782 readable.
1783 (Calc++ Scanner): Adjust.
1784 * NEWS (Variable token.prefix): New.
1785
84a1cb5a
AD
17862009-05-04 Akim Demaille <demaille@gostai.com>
1787
1788 bison: catch bad symbol names.
1789 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1790 * tests/input.at: Adjust.
1791
cdf3f113
AD
17922009-05-04 Akim Demaille <demaille@gostai.com>
1793
1794 identifiers: dashes are letters.
1795 Dashes can now start identifiers (symbols and directives).
84a1cb5a 1796
cdf3f113
AD
1797 * src/scan-gram.l ({letter}): Add dash.
1798 ({id}): Remove it.
1799 * tests/input.at (Symbols): Adjust.
1800 Remove stray comment.
1801 * tests/regression.at (Invalid inputs): Adjust error message.
1802 * doc/bison.texinfo (Symbols): Update.
1803
98a345a2
JD
18042009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1805
1806 Declare %code to be a permanent feature.
1807 * NEWS (2.4.2): Here.
1808 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
1809 experimental.
1810 (Decl Summary): Likewise.
1811
67212941
JD
18122009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1813
1814 Convert underscores to dashes in some %define variable names.
1815 For now, just api.push-pull and lr.keep-unreachable-states.
1816 Maintain old names for backward compatibility.
1817 * NEWS (2.5): Document.
1818 * data/c.m4 (b4_identification): Update comment.
1819 * data/yacc.c: Update access.
1820 * doc/bison.texinfo: Update.
1821 * etc/bench.pl.in (bench_push_parser): Update use.
1822 * src/files.c (tr): Move to...
1823 * src/getargs.c, src/getargs.h (tr): ... here because I can't
1824 think of a better place to expose it. My logic is that, for all
1825 uses of tr so far, command-line arguments can be involved, and
1826 getargs.h is already included.
1827 * src/main.c (main): Update access.
1828 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
1829 variable names to new variable names before assigning value.
1830 * src/reader.c (reader): Update setting default.
1831 * tests/calc.at: Update uses.
1832 * tests/conflicts.at (Unreachable States After Conflict
1833 Resolution): Update use.
1834 * tests/input.at (%define enum variables): Update use.
1835 (%define backward compatibility): New test group.
1836 * tests/push.at: Update uses.
1837 * tests/reduce.at: Update uses.
1838 * tests/torture.at: Update uses.
1839
ba5c6d94
JD
18402009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1841
1842 Set all front-end %define defaults in one place.
1843 * src/main.c (main): Move lr.keep_unreachable_states default...
1844 * src/reader.c (reader): ... to here.
1845
5bab9d08
JD
18462009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1847
1848 Rename lr.default_reductions to lr.default-reductions.
1849 * NEWS (2.5): Here.
1850 * doc/bison.texinfo: Here.
1851 * src/lalr.c (initialize_LA): Here.
1852 * src/print.c (print_reductions): Here.
1853 * src/reader.c (reader): Here.
1854 * src/tables.c (action_row): Here.
1855 * tests/input.at (%define enum variables): Here.
1856 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1857
d521ee19
JD
18582009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1859
1860 Pacify ./configure --enable-gcc-warnings.
1861 * tests/input.at (Symbols): Prototype yyerror and yylex.
1862
18632009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
1864
1865 Document how `%define "var" "value"' is not M4-friendly.
1866 * src/parse-gram.y (variable): In comments here.
1867
8f0d265e
JD
18682009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1869
1870 Clean up recent patches a little.
1871 Reported by Akim Demaille.
1872 * doc/bison.texinfo (Understanding): Fix typos.
1873 * src/print.c (print_reductions): Don't use negated variable.
1874
f4909773
JD
18752009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1876
1877 List accepted values for a %define enum variable with an invalid value.
1878 Suggested by Akim Demaille at
1879 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1880 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1881 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
1882 * tests/input.at (%define lr.default_reductions invalid values): Merge
1883 into...
1884 (%define enum variables): ... here, and update output.
1885
110ef36a
JD
18862009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1887
1888 Rename "default rule" to "default reduction".
1889 This includes changing variable names in code, changing
1890 comments, and renaming %define lr.default_rules to %define
1891 lr.default_reductions.
1892 * NEWS (2.5): Update IELR documentation.
1893 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
1894 documentation.
1895 * data/glr.c, data/lalr1.java: Sync copyright dates.
1896 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1897 and lr.type documentation. Make some other wording
1898 improvements.
1899 (Glossary): Adjust cross-references and Default Reduction
1900 definition.
1901 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1902 Remove a confusing comment pointed out by Akim Demaille.
1903 (initialize_LA): Adjust code.
1904 * src/print-xml.c (print_reductions): Adjust code.
1905 * src/print.c (print_reductions): Adjust code.
1906 * src/reader.c (reader): Adjust code.
1907 * src/tables.c (action_row): Adjust code.
1908 (token_actions): Adjust code.
1909 * src/tables.h: Adjust YYDEFACT documentation.
1910 * tests/input.at (%define lr.default_rules invalid values):
1911 Rename test group to...
1912 (%define lr.default_reductions invalid values): ... this, and
1913 update grammar file and expected output.
1914 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1915 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1916
746ee38c
AD
19172009-04-21 Akim Demaille <demaille@gostai.com>
1918
1919 tests: check the use of dashes and periods in symbols.
1920 * tests/input.at (Symbol): New test group.
1921
eb45ef3b
JD
19222009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1923
1924 Document %define lr.type and lr.default_rules.
1925 * NEWS (2.5): Add an entry.
1926 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1927 besides just LALR(1) and GLR(1).
1928 * doc/bison.texinfo (Introduction): Likewise.
1929 (Language and Grammar): Bison is no longer limited to LALR(1)
1930 restrictions.
1931 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1932 when trying to distinguish from GLR. Talk about LR(1) grammars
1933 rather than LALR(1) grammars.
1934 (Decl Summary): In %define api.push_pull entry, say it applies
1935 to deterministic parsers in C rather than LALR(1) parsers in C.
1936 Add lr.default_rules entry.
1937 Add lr.type entry.
1938 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1939 restrictions.
1940 (Generalized LR Parsing): Same changes as for the previous GLR
1941 section.
1942 (Memory Management): Say deterministic rather than LALR(1).
1943 (Understanding): Correct some bison output.
1944 Index discussion of "accepting state".
1945 Say deterministic rather than LALR(1).
1946 (Bison Options): In --yacc entry, say deterministic rather than
1947 LALR(1).
1948 In --report, --graph, and --xml entries, just don't mention
1949 LALR(1).
1950 (C++ Parsers): Say deterministic rather than LALR(1).
1951 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1952 (Glossary): Add Accepting State, Consistent State, Default Rule,
1953 and IELR(1) definitions.
1954 In Generalized LR (GLR) definition, make same changes as in
1955 previous GLR sections.
1956 In LALR(1) definition, say Bison uses LALR(1) by default rather
1957 than implying Bison is limited to LALR(1).
1958 (LocalWords): Add IELR.
1959
db34f798
JD
19602009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1961
1962 Finish implementing %define lr.type.
1963 Its value can be "LALR", "IELR", or "canonical LR".
1964 * lib/timevar.def (TV_IELR_PHASE1): New var.
1965 (TV_IELR_PHASE2): New var.
1966 (TV_IELR_PHASE3): New var.
1967 (TV_IELR_PHASE4): New var.
1968 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1969 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1970 Sbitset.h, ielr.h, and ielr.c.
1971 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1972 trace_types): Add trace_ielr.
1973 * src/lalr.h, src/lalr.c (ngotos): Export it.
1974 (F): Rename to...
1975 (goto_follows): ... this, update all uses, and export it.
1976 (set_goto_map): Export it.
1977 (map_goto): Export it.
1978 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1979 handled in ielr.
1980 (initialize_LA): Export it. Move lookback allocation to...
1981 (lalr): ... here because, for canonical LR, initialize_LA must
1982 be invoked but lookback and much of the rest of LALR isn't
1983 needed.
1984 * main.c (main): Instead of lalr, invoke ielr, which invokes
1985 lalr.
1986 * src/reader.c (reader): Default lr.type to "LALR".
1987 Default lr.default_rules to "accepting" if lr.type is "canonical
1988 LR". Leave the default as "all" otherwise.
1989 Check for a valid lr.type value.
1990 * src/state.h, src/state.c (struct state_list): Add state_list
1991 member.
1992 (state_new): Initialize state_list member to NULL.
1993 (state_new_isocore): New function, exported.
1994 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1995 exercises all values of lr.type.
1996 (GNU AWK Grammar): Rename test group to...
1997 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1998 AT_TEST_EXISTING_GRAMMAR.
1999 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
2000 (GNU pic Grammar): Rename test group to...
2001 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
2002 AT_TEST_EXISTING_GRAMMAR.
2003 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
2004 all values of lr.type.
2005 (Single State Split): New test groups using AT_TEST_LR_TYPE.
2006 (Lane Split): Likewise.
2007 (Complex Lane Split): Likewise.
2008 (Split During Added Lookahead Propagation): Likewise.
2009
7fe11bb5
JD
20102009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2011
2012 Add new files for IELR and canonical LR implementation.
2013 * src/AnnotationList.c: New.
2014 * src/AnnotationList.h: New.
2015 * src/InadequacyList.c: New.
2016 * src/InadequacyList.h: New.
2017 * src/Sbitset.c: New.
2018 * src/Sbitset.h: New.
2019 * src/ielr.c: New.
2020 * src/ielr.h: New.
2021
7254f6a8
JD
20222009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2023
2024 Implement %define lr.default_rules.
2025 Its value describes the states that are permitted to contain
2026 default rules: "all", "consistent", or "accepting".
2027 * src/reader.c (reader): Default lr.default_rules to "all".
2028 Check for a valid lr.default_rules value.
2029 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
2030 is "accepting", then only mark the accepting state as
2031 consistent.
2032 (initialize_LA): Tell state_lookahead_tokens_count whether
2033 lr.default_rules is "accepting".
2034 * src/tables.c (action_row): If lr.default_rules is not "all",
2035 then disable default rules in inconsistent states.
2036 * src/print.c (print_reductions): Use this opportunity to
2037 perform some assertions about whether lr.default_rules was
2038 obeyed correctly.
2039 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
2040 helps with checking the parser tables for a grammar.
2041 * tests/input.at (%define lr.default_rules invalid values): New
2042 test group.
2043 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
2044 AT_TEST_TABLES_AND_PARSE.
2045 (`no %define lr.default_rules'): New test group generated by
2046 AT_TEST_LR_DEFAULT_RULES.
2047 (`%define lr.default_rules "all"'): Likewise.
2048 (`%define lr.default_rules "consistent"'): Likewise.
2049 (`%define lr.default_rules "accepting"'): Likewise.
2050
72e727f2
AD
20512009-04-20 Akim Demaille <demaille@gostai.com>
2052
2053 Formatting change.
2054
90462b8d
AD
20552009-04-20 Akim Demaille <demaille@gostai.com>
2056
2057 bison: factoring.
2058 * src/output.c (token_definitions_output): Use symbol_id_get
2059 instead of duplicating its logic.
2060 * TODO (YYERRCODE): Extend.
2061
4f646c37
AD
20622009-04-20 Akim Demaille <demaille@gostai.com>
2063
71b00ed8
AD
2064 variables: prefer error-verbose to error_verbose.
2065 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
2066 instead of error_verbose.
2067 * src/scan-gram.l (%error-verbose): Map to the error-verbose
2068 variable.
2069 * doc/bison.texinfo: Promote %define error-verbose instead of
2070 %error-verbose.
2071 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
2072
20732009-04-15 Akim Demaille <demaille@gostai.com>
2074
4f646c37
AD
2075 variables: accept dashes.
2076 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
2077 underscores.
2078 * src/scan-gram.l ({id}): Also accept dashes after the initial
2079 letter.
2080 ({directive}): Use {id}.
2081 * src/parse-gram.y: Comment and formatting changes.
2082 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
2083 symbols.
2084 * src/complain.h, src/complain.c (yacc_at): New.
2085 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
2086 symbol names.
2087 * src/output.c (token_definitions_output): Do not #define token
2088 names with dashes.
2089
184e3179
AD
20902009-04-20 Akim Demaille <demaille@gostai.com>
2091
2092 Consistently refer to Yacc, not YACC.
2093 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2094
41253c3a
JD
20952009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
2096
2097 Pacify make maintainer-check-posix.
2098 * tests/input.at (%define, --define): Move bison command-line
2099 options before grammar file name.
2100
197b82ba
JD
21012009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2102
2103 Document semicolon warnings.
2104 * NEWS (2.5): Here.
2105
0c90a1f5
AD
21062009-04-14 Akim Demaille <demaille@gostai.com>
2107
2108 variables: use `parse.assert' instead of `assert'.
2109 * TODO (assert): Remove.
2110 * data/bison.m4 (b4_assert_if): Replace with...
2111 (b4_parse_assert_if): this.
2112 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
2113 * doc/bison.texinfo (Decl Summary): Document parse.assert.
2114
fa819509
AD
21152009-04-14 Akim Demaille <demaille@gostai.com>
2116
16dc0d90 2117 variables: use `parse.trace' instead of `debug'.
fa819509
AD
2118 * src/getargs.c (getargs): Map -t to %define trace.parse.
2119 * src/scan-gram.l (%debug): Map to %define trace.parse.
2120 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
2121 names to `_' in macro names.
2122 (b4_debug_if): Replace with...
2123 (b4_parse_trace_if): this.
2124 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2125 * data/yacc.c: Adjust.
2126 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
2127 Use @code to label the variable list.
2128 Document the variable parse.trace.
2129 (Tracing): Promote the parse.trace variable.
2130 * TODO: %printer is not documented.
2131
f7dae1ea
AD
21322009-04-14 Akim Demaille <demaille@gostai.com>
2133
2134 doc: minor fixes.
2135 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2136 (Table of Symbols): Remove duplicate entry for %debug.
2137
3535c071
EB
21382009-04-10 Eric Blake <ebb9@byu.net>
2139
2140 submodules: update to latest
2141 * submodules/autoconf: Use latest upstream Autoconf.
2142
cf48f675
EB
21432009-04-06 Eric Blake <ebb9@byu.net>
2144
2145 Work around autoconf 2.63b bug in testsuite.
2146 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2147 autoconf bug related to # in test.
2148
50cca368
JD
21492009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2150
2151 * NEWS (2.5): New section. Describe new -D/--define feature.
2152
3583d96b
AD
21532009-04-06 Akim Demaille <demaille@gostai.com>
2154
2155 Regen.
2156 * src/parse-gram.h, src/parse-gram.c: Regen.
2157
00f5d575
AD
21582009-04-06 Akim Demaille <demaille@gostai.com>
2159
2160 rename muscle_tab.* as muscle-tab.* for consistency.
2161 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
2162 * src/muscle-tab.h, src/muscle-tab.c: these.
2163 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
2164 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
2165
76bf5102
AD
21662009-04-06 Akim Demaille <demaille@gostai.com>
2167
2168 Makefile: introduce $(BISON).
2169 * src/local.mk (BISON): New.
2170 (YACC): Use it.
2171
bc0f5737
AD
21722009-04-06 Akim Demaille <demaille@gostai.com>
2173
2174 parser: handle %locations as %define locations.
2175 * src/getargs.h, src/getargs.c (locations_flag): Remove.
2176 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
2177 to set "locations" to true.
2178 * src/output.c (prepare): Don't output "locations".
2179 * src/scan-gram.l (%locations): Handle it as a %<flag>.
2180 * src/parse-gram.y: It's no longer a token.
2181 Don't handle it.
2182 * data/bison.m4 (b4_locations_if): Define it with
2183 b4_percent_define_if_define.
2184 * data/c.m4, data/glr.cc: Adjust.
2185
697c912f
AD
21862009-04-06 Akim Demaille <demaille@gostai.com>
2187
2188 Regen.
2189 * src/parse-gram.c: Regen.
2190
4920ae8b
AD
21912009-04-06 Akim Demaille <demaille@gostai.com>
2192
2193 muscle: factor the handling of obsolete of obsolete directives.
2194 Suggested by Joel E. Denny.
50cca368 2195
4920ae8b
AD
2196 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
2197 New, extracted from...
2198 * src/parse-gram.y (prologue_declaration: pure-parser): here.
2199 Remove it.
2200 (prologue_declaration: "%<flag>"): Use
2201 muscle_percent_define_ensure.
2202 (%error-verbose, %pure-parser): No longer tokens.
2203 * src/scan-gram.l (pure-parser): Return as a %<flag>.
2204
1d5b3c08
JD
22052009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2206
2207 Fix options documentation.
2208 * build-aux/cross-options.pl: As in --help output, write optional
2209 arguments as [=ARG] not =[ARG].
2210 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2211
62c99cf4
JD
22122009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2213
2214 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2215 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2216 requirements for a correct m4 are stricter.
2217 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
2218 * configure.ac: Update to use AC_PROG_GNU_M4.
2219 Reported by Eric Blake.
2220
1c93f35b
JD
22212009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2222
2223 Help with updating web manual.
2224 * HACKING: Incorporate instructions from gnulib/doc/README.
2225 * bootstrap.conf (gnulib_modules): Add gendocs.
2226
86cfae0a
AD
22272009-04-03 Akim Demaille <demaille@gostai.com>
2228
2229 Regen.
2230 * src/parse-gram.h, src/parse-gram.c: Regen.
2231
ba061fa6
AD
22322009-04-03 Akim Demaille <demaille@gostai.com>
2233
2234 Factor %FLAG at scan level.
2235 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
2236 definitions and associated rules, replaced by....
2237 (PERCENT_FLAG): this new token type, and rule.
2238 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
2239 Use it for %debug and %error-verbose.
2240
b19ebeb3
AD
22412009-04-03 Akim Demaille <demaille@gostai.com>
2242
2243 Regen.
2244 * src/parse-gram.h, src/parse-gram.c: Regen.
2245
001a16a9
AD
22462009-04-03 Akim Demaille <demaille@gostai.com>
2247
2248 Treat %debug as %define debug.
2249 * data/bison.m4 (b4_debug_if): New.
2250 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
2251 * data/lalr1.java: Use it instead of b4_debug_flag.
2252 * src/getargs.h, src/getargs.c (debug_flag): Remove.
2253 * src/output.c (prepare): Don't output it.
2254 * src/parse-gram.y: Treat %debug as %define debug.
2255
22562009-04-03 Akim Demaille <demaille@gostai.com>
2257
2258 Treat %error-verbose as %define error_verbose.
2259 This allows to pass -Derror_verbose on the command line. Better
2260 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
2261 ERROR_VERBOSE being defined as false or true.
2262 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
2263 on b4_percent_define_ifdef, for does not check the defined value,
2264 but only whether the symbol is defined, rely on
2265 b4_percent_define_flag_if, so that a value of "false" is processed
2266 as a false.
2267 If not defined, define the flag to "false".
2268 (b4_error_verbose_if): New.
2269 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
2270 b4_error_verbose_flag.
2271 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
2272 * src/output.c (prepare): Don't output it.
2273 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
2274
92822aff
JD
22752009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2276
2277 Fix strange %define locations for default values.
2278 Reported by Akim Demaille at
2279 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2280 and discussed again starting at
2281 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2282 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2283 because location information is bogus.
2284 Use angle brackets to delimit fake file name because square brackets
2285 look like underexpanded m4. Choose a better fake file name.
2286 Use negative line numbers.
2287 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2288 * src/location.c (location_print): If line for a boundary is negative,
2289 only print that boundary's file name.
2290 * src/location.h: Document that.
2291 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2292 defaults): Update output.
2293
e021191b
JD
22942009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2295
2296 Pacify ./configure --enable-gcc-warnings.
2297 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
2298 in lib won't compile with it.
2299 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
2300
78f65418
AD
23012009-03-31 Akim Demaille <demaille@gostai.com>
2302
2303 bootstrap: --help to stdout.
2304 * bootstrap (usage): Don't send --help to stderr.
2305 Use a here doc instead of a long string.
2306
f7e241f4
AD
23072009-03-31 Akim Demaille <demaille@gostai.com>
2308
2309 bootstrap: README-hacking no longer exists
2310 * bootstrap (checkout_only_file): Set to HACKING.
2311
31d3e510
AD
23122009-03-26 Akim Demaille <demaille@gostai.com>
2313
2314 doc: merge HACKING and README-hacking.
2315 Two files is confusing.
2316 Reported by Alexandre Duret-Lutz.
1f9d8248 2317
31d3e510
AD
2318 * README-hacking: Merge into...
2319 * HACKING (Working from the repository): here.
2320
81535bfa
AD
23212009-03-26 Akim Demaille <demaille@gostai.com>
2322
2323 doc: update README-hacking.
2324 * README-hacking: We now use git and git submodules.
2325 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2326
56f772e9
AD
23272009-03-26 Akim Demaille <demaille@gostai.com>
2328
2329 lalr1.cc: avoid GCC 4.3 warnings.
2330 GCC 4.3 now warns about "a || b && c" and asks for explicit
2331 parentheses.
2332 Reported by Alexandre Duret-Lutz.
2333 * data/location.cc: Update copyright years.
2334 (Position::operator==): Use parens to make precedence explicit.
2335 Compare lines and columns first, as they are more likely to be
2336 different, and they are faster to compare.
2337
11c073b7
AD
23382009-03-26 Akim Demaille <demaille@gostai.com>
2339
2340 gnulib: update.
2341 * gnulib: Update to latest.
2342 * src/local.mk (AM_CFLAGS): Move to...
2343 * Makefile.am: here.
2344 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
2345 AM_CFLAGS.
2346
91be6b28
AD
23472009-03-02 Akim Demaille <demaille@gostai.com>
2348
2349 Comment changes.
2350
cbf25ce7
AD
23512009-03-02 Akim Demaille <demaille@gostai.com>
2352
2353 Share b4_yytranslate_define.
2354 * data/lalr1.cc (b4_yytranslate_define): Move to...
2355 * data/c++.m4: here.
2356
882f02ed
AD
23572009-03-02 Akim Demaille <demaille@gostai.com>
2358
2359 Use locations in the variant example.
1f9d8248
AD
2360 Yes, this obfuscates the point of this example, variants only.
2361 But glr.cc cannot work (yet?) without locations. This change
2362 makes it easier to use this example with glr.cc.
11c073b7 2363
882f02ed
AD
2364 * examples/variant.yy (assert): %define it.
2365 (locations): Request them.
2366 (yylex): Bind the location to the stage.
2367
0623bacc
AD
23682009-03-02 Akim Demaille <demaille@gostai.com>
2369
2370 Dub make_TOKEN as a public type interface.
2371 * data/c++.m4 (b4_symbol_constructor_declare)
2372 (b4_symbol_constructor_define): New empty stubs.
2373 (b4_public_types_declare, b4_public_types_define): Use them.
2374 * data/lalr1.cc (b4_symbol_constructor_declare)
2375 (b4_symbol_constructor_declare_)
2376 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
2377 Move to...
2378 * data/variant.hh: here.
2379 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
2380 needed.
2381 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
2382 b4_symbol_constructor_declare, as it is now done by
2383 b4_public_types_define and b4_public_types_declare.
2384
5f5a90df
AD
23852009-03-02 Akim Demaille <demaille@gostai.com>
2386
2387 Coding style changes.
2388 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2389 (b4_symbol_constructor_declarations)
2390 (b4_symbol_constructor_definition_)
2391 (b4_symbol_constructor_definitions)
2392 (b4_yytranslate_definition): Rename as...
2393 (b4_symbol_constructor_declare_)
2394 (b4_symbol_constructor_declare)
2395 (b4_symbol_constructor_define_)
2396 (b4_symbol_constructor_define)
2397 (b4_yytranslate_define): these.
2398 * data/variant.hh (b4_variant_definition): Rename as...
2399 (b4_variant_define): this.
2400
b47b6ff7
AD
24012009-03-02 Akim Demaille <demaille@gostai.com>
2402
2403 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
2404 * data/bison.m4 (b4_percent_define_if_define): New.
2405 * data/c++.m4 (b4_variant_if): Move to...
2406 * data/bison.m4: Here, using b4_percent_define_if_define.
2407 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
2408 * data/bison.m4: Here, using b4_percent_define_if_define.
2409
1d6b689b
AD
24102009-03-02 Akim Demaille <demaille@gostai.com>
2411
2412 Dub symbol_type_base as a public type.
2413 * data/c++.m4 (b4_public_types_declare): Now define
2414 symbol_type_base and symbol_type.
2415 (b4_public_types_define): New.
2416 In both cases, the definitions are taken verbatim from lalr1.cc.
2417 * data/lalr1.cc: Adjust.
2418
4f84717d
AD
24192009-03-02 Akim Demaille <demaille@gostai.com>
2420
2421 b4_public_types_declare.
2422 * data/c++.m4 (b4_public_types_declare): New.
2423 * data/glr.cc, data/lalr1.cc: Use it.
2424
b9e4eb5b
AD
24252009-03-02 Akim Demaille <demaille@gostai.com>
2426
2427 b4_semantic_type_declare.
2428 * data/c++.m4 (b4_semantic_type_declare): New.
2429 Factors and generalizes what was in glr.cc and lalr1.cc.
2430 * data/variant.hh (b4_semantic_type_declare): Redefine it for
2431 variants.
2432 * data/lalr1.cc, data/glr.cc: Use it.
2433
6a6e7f0c
AD
24342009-02-26 Akim Demaille <demaille@gostai.com>
2435
2436 Upgrade gnulib.
2437 * gnulib: Upgrade from master.
2438 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
2439 Regen.
2440
e9e61b00
AD
24412009-02-25 Akim Demaille <demaille@gostai.com>
2442
2443 Remove useless arguments.
2444 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
2445 relevant.
2446
3eead995
AD
24472009-02-25 Akim Demaille <demaille@gostai.com>
2448
2449 Comment changes.
2450 * data/lalr1.cc: here.
2451
87f28efe
AD
24522009-02-25 Akim Demaille <demaille@gostai.com>
2453
2454 Fix glr.cc's debug level handling.
2455 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
2456 glr.c which is used.
2457 (debug_level, set_debug_level): Adjust.
2458
9be2a009
AD
24592009-02-25 Akim Demaille <demaille@gostai.com>
2460
2461 Copyright years.
2462 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2463
07a6e87d
AD
24642009-02-25 Akim Demaille <demaille@gostai.com>
2465
2466 Style changes.
2467 * etc/bench.pl.in (generate_grammar_list): Consitently use
2468 location_type, not yy::location.
2469
33c78bd2
AD
24702009-02-25 Akim Demaille <demaille@gostai.com>
2471
2472 Comment change.
2473 * data/lalr1.cc: here.
2474
49572920
AD
24752009-02-19 Akim Demaille <demaille@gostai.com>
2476
2477 Make yyparser::error public.
2478 * data/lalr1.cc: here.
2479 There is no good reason to keep it private (and it is convenient
2480 to use it from the scanner for instance). It is already public in
2481 glr.cc.
2482
88654b47
AD
24832009-02-19 Akim Demaille <demaille@gostai.com>
2484
2485 Comment changes.
2486 * data/glr.cc: here.
2487
4524c55b
AD
24882009-02-19 Akim Demaille <demaille@gostai.com>
2489
2490 Remove trailing blanks.
6a6e7f0c
AD
2491 The epilogue has its own ending \n, no need to add another.
2492
4524c55b
AD
2493 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
2494 epilogue.
2495 * data/glr.cc: dnl when extending the epilogue.
2496 Remove stray "private:".
2497
6ceccee8
AD
24982009-02-19 Akim Demaille <demaille@gostai.com>
2499
2500 Use b4_c_modern.
2501 * data/c.m4 (b4_c_function_decl): Here.
2502
9c6a8966
AD
25032009-02-19 Akim Demaille <demaille@gostai.com>
2504
2505 Comment changes.
2506 * data/lalr1.cc: here.
2507
507aa0e2
AD
25082009-02-19 Akim Demaille <demaille@gostai.com>
2509
2510 Extract variant.hh
2511 * data/variant.hh: New, extracted from...
2512 * data/lalr1.cc: here.
2513 Adjust.
2514 * data/local.mk: Adjust.
2515
51bacae6
AD
25162009-02-19 Akim Demaille <demaille@gostai.com>
2517
2518 Extract stack.hh from lalr1.cc.
2519 * data/stack.hh: New.
2520 * data/lalr1.cc: Extract from here.
2521 * data/local.mk: Adjust.
2522
06c3084f
JD
25232009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2524
2525 Add reminder about uploading public key to keys.gnupg.net.
2526 * HACKING (Release Procedure): Here.
2527
0ea583d2
AD
25282009-01-28 Akim Demaille <demaille@gostai.com>
2529
2530 * NEWS: Update information about 2.4.1 and 2.4.2.
2531
402b123d
AD
25322008-11-04 Akim Demaille <demaille@gostai.com>
2533
2534 Reformat NEWS.
2535 * NEWS: Use more outline-mode markup.
2536 Suggested by Jim Meyering.
2537
74553c98
AD
25382009-01-08 Akim Demaille <demaille@gostai.com>
2539
2540 Fix grep portability issues.
2541 Grep on Solaris does not support -q.
2542 Reported by Summum Bonum.
2543
2544 * NEWS: Add a stub for 2.4.2.
2545 * THANKS: Add Summum Bonum.
2546 * tests/atlocal.in (EGREP): New.
2547 (CC, CXX, XSLTPROC): Make it possible to override them via
2548 envvars.
2549 * tests/java.at: Use $EGREP instead of egrep.
2550 Use AT_CHECK's ignore instead of grep's -q.
2551
84eedf86
AD
25522008-12-11 Akim Demaille <demaille@gostai.com>
2553
2554 Pass the token type to yysyntax_error.
2555 * data/yacc.c (yysyntax_error): Take the transated token instead
2556 of the raw number.
2557 Adjust callers.
2558 * TODO: Update.
2559
5860cc8c
AD
25602008-12-11 Akim Demaille <demaille@gostai.com>
2561
2562 Formatting changes.
2563 * data/glr.c: Formatting changes.
2564
2b008529
AD
25652008-12-11 Akim Demaille <demaille@gostai.com>
2566
2567 Propagate i18n changes into glr.c.
2568 * TODO: Update.
2569 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
2570 building the error message format dynamically.
2571 * data/lalr1.java: Formatting changes.
2572
2cd1af95
AD
25732008-12-11 Akim Demaille <demaille@gostai.com>
2574
2575 Use testsuite -C.
2576 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
2577 Solves problems when top_srcdir is an absolute path.
2578 Suggested by Eric Blake.
2579 * configure.ac: Require Autoconf 2.62.
2580
eeb29422
AD
25812008-12-11 Akim Demaille <demaille@gostai.com>
2582
2583 Simplify the i18n of the error messages.
2584 * data/lalr1.cc: Comment changes.
2585 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
2586 lalr1.cc instead of building dynamically the format string.
2587
6617622c
AD
25882008-12-08 Akim Demaille <demaille@gostai.com>
2589
2590 Fix portability issue in the test suite.
2591 * tests/local.at (AT_MATCHES_CHECK): New.
2592 Based on Perl instead of Sed. Sed has too many portability
2593 pitfalls, not ever Sed is GNU Sed.
2594 * tests/actions.at (Fix user actions without a trailing semicolon):
2595 Use it.
2596
2ca1136c
AD
25972008-12-08 Akim Demaille <demaille@gostai.com>
2598
2599 Update data/README.
2600 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2601
6c63b895
AD
26022008-12-08 Akim Demaille <demaille@gostai.com>
2603
2604 Install autoconf as a submodule to get m4sugar.
2605 * .gitmodules: Add submodules/autoconf.
2606 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2607 submodules/autoconf.
2608
417e31d2
AD
26092008-12-08 Akim Demaille <demaille@gostai.com>
2610
2611 Test token.prefix in all the skeletons.
2612 * data/java.m4 (b4_token_enum): Use the token.prefix.
2613 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
2614 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
2615 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
2616 * tests/java.at: Comment changes.
2617 (AT_CHECK_JAVA_MINIMAL): Define the END token.
2618 (Java parser class and package names): Add token.prefix check.
2619
97abf544
AD
26202008-12-08 Akim Demaille <demaille@gostai.com>
2621
2622 Fix regeneration of atconfig.
2623 * tests/local.mk (tests/atconfig): The rule was incorrect, but
2624 remove it: now that there is no tests/Makefile.am, the top-level
2625 Makefile properly updates atconfig when needed.
2626
e8cd1ad6
DJ
26272008-12-07 Di-an Jan <dianj@freeshell.org>
2628
2629 Implement the FIXME that ends an user action with a semicolon
2630 if it seems necessary.
2631 * src/scan-code.l (flex rules section): Flag cpp directive from
2632 any `#' to the first unescaped end-of-line. Semicolon is not
2633 needed after `;', `{', '}', or cpp directives and is needed after
2634 any other token (whitespaces and comments have no effect).
2635 * tests/actions.at (Fix user actions without a trailing semicolon):
2636 New test.
2637 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2638 to make user actions complete statements.
2639 Adjust column numbers in error messages.
2640 * tests/regression.at (Fix user actions without a trailing semicolon):
2641 Remove. Covered by new test.
2642
ce9447fc
AD
26432008-12-07 Akim Demaille <demaille@gostai.com>
2644
2645 Update gnulib.
2646 * gnulib: Update from master.
2647
d333175f
EB
26482008-12-05 Eric Blake <ebb9@byu.net>
2649
2650 Avoid compiler warning.
2651 * src/output.c (muscle_insert_item_number_table): Delete unused
2652 function.
2653
215b40ac
EB
26542008-12-02 Eric Blake <ebb9@byu.net>
2655
2656 Build testsuite with newer autoconf.
2657 * tests/output.at (m4_expand): Don't override in newer autoconf,
2658 where the underlying implementation changed.
2659 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2660 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2661 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2662 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2663 since some of them contain unbalanced ')'.
2664
3bb21113
AD
26652008-12-01 Akim Demaille <demaille@gostai.com>
2666
2667 Use b4_symbol for printers and destructors everywhere.
2668 * data/bison.m4 (b4_symbol_action_location): New.
2669 * data/c.m4 (b4_symbol_actions): Remove.
2670 Adjust all callers to use by b4_symbol_foreach and the corresponding
2671 b4_symbol_printer/destructor macro.
2672 * data/glr.cc: Adjust.
2673 * data/lalr1.java: Adjust the %destructor sanity check.
2674 * src/output.c (symbol_code_props_output): Remove, we no longer
2675 need the b4_symbol_printers/destructors tables.
2676
fb7c5b1f
AD
26772008-12-01 Akim Demaille <demaille@gostai.com>
2678
2679 Use b4_symbol_case_.
2680 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
2681 b4_symbol_case_.
2682
cf6fb222
AD
26832008-12-01 Akim Demaille <demaille@gostai.com>
2684
2685 Move b4_symbol based macro to bison.m4.
2686 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
2687 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
2688 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
2689 (b4_type_foreach): Move to...
2690 * data/bison.m4: Here.
2691 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
2692 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 2693
e3c52a63
AD
26942008-12-01 Akim Demaille <demaille@gostai.com>
2695
2696 b4_symbol/type_foreach.
2697 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
2698 Use them.
2699
2bde9113
AD
27002008-12-01 Akim Demaille <demaille@gostai.com>
2701
2702 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
2703 Instead of defining complex list of tuples to define various
2704 properties of the symbols, we now prefer to define symbols as
2705 "structs" in m4: using the symbol key (its number), and the
2706 property name, b4_symbol gives it value. Use this to handle
2707 destructors and printers.
2708
2bde9113
AD
2709 * src/output.c (CODE_PROP): New.
2710 (prepare_symbol_definitions): Use it to define the printer and
2711 destructor related attributes of the symbols.
2712 * data/lalr1.cc (b4_symbol_actions): Rename as...
2713 (b4_symbol_action): this.
2714 Use b4_symbol instead of 6 arguments.
2715 (b4_symbol_printer, b4_symbol_destructor): New.
2716 Use them instead of b4_symbol_actions.
2717
44494bf6
AD
27182008-12-01 Akim Demaille <demaille@gostai.com>
2719
2720 Avoid capturing variables too easily.
2721 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
2722 v__ and p__ instead of v and p.
2723
fad814bd
AD
27242008-12-01 Akim Demaille <demaille@gostai.com>
2725
2726 Remove spurious empty line before syncline.
2727 * data/bison.m4 (b4_syncline): Don't output an empty line before
2728 the output.
2729
feda5527
AD
27302008-11-26 Akim Demaille <demaille@gostai.com>
2731
2732 Convert lib/Makefile.am into lib/local.mk.
2733 The real problem is rather gnulib.mk, which itself is extracted
2734 from a Makefile.am that gnulib expects to the "recursive". The
2735 tool prefix-gnulib-mk converts such a gnulib.mk to be
2736 non-recursive. Also, some AC_SUBST variables need to be adjusted.
2737
2738 * etc/prefix-gnulib-mk: New.
2739 * bootstrap (slurp): Use it to convert further gnulib.mk.
2740 No longer try to avoid re-creation of lib/gnulib.mk as the changes
2741 are deeper.
2742 * lib/Makefile.am: Rename as...
2743 * lib/local.mk: this.
2744 Adjust to be prefixed.
2745 * Makefile.am, configure.ac: Adjust.
2746 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
2747
56ddee7f
AD
27482008-11-26 Akim Demaille <demaille@gostai.com>
2749
2750 s/_FLAGS/FLAGS/.
2751 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
2752 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
2753 Reported by Eric Blake.
2754
728e89a0
AD
27552008-11-26 Akim Demaille <demaille@gostai.com>
2756
2757 Use b4_parser_tables_define in glr.cc.
2758 * data/glr.c: Use b4_parser_tables_define instead of defining the
2759 (deterministic integral) tables by hand.
2760
2c1bf9bd
AD
27612008-11-26 Akim Demaille <demaille@gostai.com>
2762
2763 Use b4_parser_tables_define in Java.
2764 * data/java.m4 (b4_typed_parser_table): Rename as...
2765 (b4_typed_parser_table_define): this, for consistency.
2766 Accept a comment as $4.
2767 Move $2 into yy*_.
2768 (b4_integral_parser_table): Rename as...
2769 (b4_integral_parser_table_define): this.
2770 * data/lalr1.java: Adjust all uses.
2771 Use b4_parser_tables_define instead of generation by hand.
2772
ba206cf4
AD
27732008-11-26 Akim Demaille <demaille@gostai.com>
2774
2775 Prepare the convergence bw C style and Java table generation.
2776 * data/bison.m4 (b4_tables_map, b4_tables_declare)
2777 (b4_tables_define): Rename as...
2778 (b4_integral_parser_tables_map, b4_parser_tables_declare)
2779 (b4_parser_tables_define): these.
2780 * data/c.m4 (b4_table_define): Rename as...
2781 (b4_integral_parser_table_define): this.
2782 * data/lalr1.cc: Adjust.
2783 (b4_table_define, b4_table_declare): Rename as...
2784 (b4_integral_parser_table_define)
2785 (b4_integral_parser_table_declare): these.
2786 (yyrline_): Move the comment where it is actually used.
2787 * data/yacc.c: Adjust.
2788 (yyrline): Use b4_integral_parser_table_define.
2789
d12f8e49
AD
27902008-11-26 Akim Demaille <demaille@gostai.com>
2791
2792 Regen.
2793 * src/parse-gram.h, src/parse-gram.c: Regen.
2794
0991e29b
AD
27952008-11-26 Akim Demaille <demaille@gostai.com>
2796
2797 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
2798 * data/lalr1.cc (b4_tables_map): Move to...
2799 * data/bison.m4: here.
2800 Update the comment for yytable during the flight.
2801 (b4_tables_declare, b4_tables_define): New.
2802 * data/lalr1.cc: Use them.
2803 * data/c.m4 (b4_table_define): New.
2804 * data/yacc.c: Use b4_tables_define instead of output the tables
2805 by hand.
2806 * tests/regression.at (Web2c Actions): Adjust the expected output,
2807 the order of the tables changed.
2808
3d3bc1fe
AD
28092008-11-26 Akim Demaille <demaille@gostai.com>
2810
2811 Get rid of (yy)rhs and (yy)prhs.
2812 These tables are no longer needed in the parsers, and they don't seem to
2813 be useful. They are not documented either.
feda5527 2814
3d3bc1fe
AD
2815 * src/output.c (prepare_rules): Get rid of rhs and prhs.
2816 Adjust the computation of (yy)r2.
2817
08c81469
AD
28182008-11-26 Akim Demaille <demaille@gostai.com>
2819
2820 Rule length is unsigned.
2821 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
2822
932b0c96
AD
28232008-11-26 Akim Demaille <demaille@gostai.com>
2824
2825 Get rid of lalr1-split.cc.
2826 It was no longer maintainer.
feda5527 2827
932b0c96
AD
2828 * data/lalr1-split.cc: Remove.
2829 * etc/bench.pl.in (bench_fusion_parser): Remove.
2830 Adjust.
2831
8452c667
AD
28322008-11-26 Akim Demaille <demaille@gostai.com>
2833
2834 Use yy* consistently.
2835 * data/glr.c: Now that yyrhs no longer exists as a global
2836 variable, rename local "rhs" variables into "yyrhs" for
2837 consistency.
2838
783aa653
AD
28392008-11-25 Akim Demaille <demaille@gostai.com>
2840
2841 Get rid of yyrhs and yyprhs in glr.c.
2842 * data/glr.c (yyrhs, yyprhs): Remove.
2843 Instead, use the state stack and yystos.
2844
6130b755
AD
28452008-11-25 Akim Demaille <demaille@gostai.com>
2846
2847 Flag glr tests.
2848 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
2849 as an Autotest keyword.
2850
95a7b1c9
AD
28512008-11-25 Akim Demaille <demaille@gostai.com>
2852
2853 Prefer TESTSUITE_FLAGS.
2854 TESTSUITEFLAGS is barely readable.
feda5527 2855
95a7b1c9
AD
2856 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
2857 for backward compatibility.
2858 Use the former instead of the latter.
2859
b4f18401
AD
28602008-11-25 Akim Demaille <demaille@gostai.com>
2861
2862 Get rid of yyrhs and yyprhs in larl1.java.
2863 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
2864 (yy_reduce_print): Rather, use yystos_ and the state stack.
2865
c265fd6b
AD
28662008-11-25 Akim Demaille <demaille@gostai.com>
2867
2868 Formatting changes.
2869
68dbdee8
AD
28702008-11-25 Akim Demaille <demaille@gostai.com>
2871
2872 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
2873 They were used to get the symbol types, given a rule number, when
2874 displaying the top of the stack before a reduction. But the
2875 symbol type is available from the state stack. This has two be
2876 benefits: two tables less in the parser (making it smaller), and a
2877 more consistent use of the three stacks which will help to fuse
2878 them.
feda5527 2879
68dbdee8
AD
2880 * data/yacc.c (yyprhs, yyrhs): Remove.
2881 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
2882 (yy_reduce_print): Take yyssp as argument.
2883 Use it, together with yystos, to get the symbol type.
2884 * tests/regression.at (Web2c Report): Remove these tables from the
2885 expected output.
2886
6ab1adbe
AD
28872008-11-25 Akim Demaille <demaille@gostai.com>
2888
2889 b4_tables_map.
2890 The point is to factor the generation of the tables across skeletons.
2891 This is language dependant.
feda5527 2892
6ab1adbe
AD
2893 * data/c.m4 (b4_comment_): New.
2894 Should be usable to define how to generate tables independently of
2895 the language.
2896 (b4_c_comment): New.
2897 (b4_comment): Bounce to b4_c_comment.
2898 Now support $2 = [PREFIX] for indentation.
2899 * data/lalr1.cc (b4_table_declare): Don't output a comment if
2900 there is no comment.
2901 Indent it properly when there is one.
2902 Output the ending semicolon.
2903 (b4_table_define): Space changes.
2904 Output the ending semicolon.
2905 (b4_tables_map): New.
2906 Use it twice instead of declaring and defining the (integral)
2907 tables by hand.
2908
0fddb3d5
AD
29092008-11-25 Akim Demaille <demaille@gostai.com>
2910
2911 b4_table_declare.
2912 * data/lalr1.cc (b4_table_declare): New.
2913 Use it to declare the tables defined with b4_table_define.
2914 (b4_table_define): Declare a third arg to match b4_table_declare
2915 signature.
2916 Move all the comments around invocations of b4_table_define into
2917 the invocations itselves.
2918 Move things around to have the order for declarations and
2919 definitions.
2920
c4ddc0fb
AD
29212008-11-25 Akim Demaille <demaille@gostai.com>
2922
2923 Formatting changes.
2924 * data/lalr1.java: here.
2925
e0c653e7
AD
29262008-11-25 Akim Demaille <demaille@gostai.com>
2927
2928 b4_args is more general than only C++.
2929 * data/lalr1.cc (b4_args, _b4_args): Move to...
2930 * data/bison.m4: here.
2931
4182a0a1
DJ
29322008-11-21 Di-an Jan <dianj@freeshell.org>
2933
2934 Implement no-XXX arguments for --warnings, --report, --trace.
2935 * src/getargs.c (flags_argmatch): Handles no-XXX.
2936 Fix typo in doxygen comment.
2937
01466c3e
AD
29382008-11-21 Akim Demaille <demaille@gostai.com>
2939
2940 Display the changes in cross-options.texi.
2941 * build-aux/cross-options.pl ($sep): New, to separate items.
2942 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
2943 changes.
2944
a7c09cba
DJ
29452008-11-20 Di-an Jan <dianj@freeshell.org>
2946
2947 Improves options in the manual.
2948 * doc/bison.texinfo (-g, -x): Add space before argument.
2949 (Option Cross Key): Implement FIXME: listing directives also.
2950 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2951 (Short Option): Special case -d. Put arguments inside @option.
feda5527 2952 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
2953 src/scan-gram.l (actual name passed as the first argument)
2954 with special case for %define.
2955 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
2956 to build-aux/cross-options.pl.
2957 * src/getargs.c (usage): Document limitations of cross-options.pl.
2958 * src/scan-gram.l: Likewise.
2959
6c88b51e
JD
29602008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2961
2962 Fix unexpanded macros in GLR defines file.
2963 Reported by Csaba Raduly at
2964 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2965 * THANKS (Csaba Raduly): Add.
2966 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2967 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2968 lexer in a separate module that includes the defines file.
2969 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
2970 source.
2971 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2972 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2973 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2974 (AT_DATA_SOURCE_PROLOGUE): New.
2975 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2976 (AT_DATA_SOURCE): New.
2977 (AT_FULL_COMPILE): Extend to support an additional source file.
2978
1e034807
AD
29792008-11-18 Akim Demaille <demaille@gostai.com>
2980
2981 More TODO.
2982 * TODO: More short term issues.
2983
e3dda35c
AD
29842008-11-18 Akim Demaille <demaille@gostai.com>
2985
2986 Regen.
2987 * src/parse-gram.h, src/parse-gram.c: Regen.
2988
bd187d7b
AD
29892008-11-18 Akim Demaille <demaille@gostai.com>
2990
2991 Use b4_subtract where possible.
2992 * data/lalr1.cc (b4_subtract): Move to...
2993 * data/bison.m4: here.
2994 * data/glr.c (b4_rhs_data): Use it.
2995 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
2996
6085ab0d
AD
29972008-11-18 Akim Demaille <demaille@gostai.com>
2998
2999 Remove incorrect mode specification.
3000 * data/glr.cc: Don't pretend it's C code.
3001
9ce405ce
JD
30022008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3003
3004 Simplify last patch slightly.
3005 * src/getargs.c (getargs): Here.
3006
a8beef7e
JD
30072008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3008
3009 Fix last warning from --enable-gcc-warnings.
3010 * src/getargs.c (getargs): Don't assign const address to non-const
3011 pointer.
3012
d50eea6d
JD
30132008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3014
3015 Don't let maintainer-*-check targets force a version update.
3016 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
3017 handled.
3018
f5f419de
DJ
30192008-11-17 Di-an Jan <dianj@freeshell.org>
3020
3021 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
3022 Align menus. Adjust word wrapping. Use node names for menu names.
3023 (Examples): Don't abbreviate node names.
3024 (LocalWords): Remove abbreviations.
3025 (Copying): Make description a sentence.
d50eea6d 3026 (Java Action Features): Remove period to match the rest of menu.
f5f419de 3027
d73e55e0
DJ
30282008-11-17 Di-an Jan <dianj@freeshell.org>
3029
3030 Handles several --enable-gcc-warnings.
3031 * src/getargs.c (command_line_location): Set parameters to void.
3032 * src/output.c (symbol_type_name_cmp): Make static.
3033 (symbols_by_type_name): Set parameters to void.
3034 (symbol_definitions_output): Remove unused parameter. Rename as...
3035 (prepare_symbol_definitions): this.
3036 (muscles_output): Move symbol_definitions_output to...
3037 (output): here as prepare_symbol_definitions.
3038 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 3039 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 3040
68c989de
DJ
30412008-11-17 Di-an Jan <dianj@freeshell.org>
3042
3043 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
3044 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
3045
23ce6f4c
AD
30462008-11-16 Akim Demaille <demaille@gostai.com>
3047
3048 Add missing $(EXEEXT).
3049 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
3050 "src/bison$(EXEEXT)".
3051 Reported by Di-an Jan.
3052
dd704c35
AD
30532008-11-15 Akim Demaille <demaille@gostai.com>
3054
3055 * TODO: Update.
3056
dab244d5
AD
30572008-11-15 Akim Demaille <demaille@gostai.com>
3058
3059 Formatting changes.
3060 * tests/input.at: here.
3061
4b4da9fb
AD
30622008-11-15 Akim Demaille <demaille@gostai.com>
3063
3064 Remove duplicate header inclusion.
3065 * src/LR0.c: here.
3066
4ea3f53d
AD
30672008-11-15 Akim Demaille <demaille@gostai.com>
3068
3069 * src/parse-gram.h, src/parse-gram.c: Regen.
3070
cb823b6f
AD
30712008-11-15 Akim Demaille <demaille@gostai.com>
3072
3073 Support parametric types.
b06df3c2
AD
3074
3075 There are two issues to handle: first scanning nested angle
3076 bracket pairs to support types such as std::pair< std::string,
3077 std::list<std::string> > >.
3078
3079 Another issue is to address idiosyncracies of C++: do not glue two
3080 closing angle brackets together (otherwise it's operator>>), and
3081 avoid sticking blindly a TYPE to the opening <, as it can result
3082 in '<:' which is a digraph for '['.
3083
cb823b6f
AD
3084 * src/scan-gram.l (brace_level): Rename as...
3085 (nesting): this.
3086 (SC_TAG): New.
3087 Implement support for complex tags.
b06df3c2 3088 (tag): Accept
cb823b6f
AD
3089 , but not <.
3090 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
3091 (b4_symbol_variant): Leave space around types as parameters.
3092 * examples/variant.yy: Use nested template types and leading ::.
3093 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
3094 Rename as...
3095 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
3096 * tests/c++.at: Test parametric types.
3097
7b6e6753
AD
30982008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3099
3100 Test token.prefix.
3101 This is not sufficient, but we test at least that the make_SYMBOL
3102 interface is not affected by token.prefix. A more general test
3103 will be implemented when the support of token.prefix is generalized
3104 to more skeletons.
b06df3c2 3105
7b6e6753
AD
3106 * tests/c++.at: One more variant test, using token.prefix.
3107
dddec537
AD
31082008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3109
3110 Test the make_TOKEN interface.
3111 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
3112 Factor the common code in yylex.
3113 Use it to test "%define lex_symbol".
3114
7d3e21ba
AD
31152008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3116
3117 Formatting change.
3118
4fc55348
AD
31192008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3120
3121 Simplify code for variants bench marks.
3122 * etc/bench.pl.in (&generate_grammar_list): Define and use
3123 location_type.
3124 Factor the common code in yylex.
3125
070e6509
AD
31262008-11-15 Akim Demaille <demaille@gostai.com>
3127
3128 Better error message.
3129 * bootstrap (find_tool): Fix the error message.
3130
0078681b
AD
31312008-11-15 Akim Demaille <demaille@gostai.com>
3132
3133 Update variant.yy to newest interface.
3134 * examples/variant.yy: Define lex_symbol.
3135 Adjust.
3136
ff084799
AD
31372008-11-15 Akim Demaille <demaille@gostai.com>
3138
3139 Don't use locations in variant.yy.
3140 * examples/variant.yy: Adjust to not using locations.
3141
b0d79ec6
AD
31422008-11-15 Akim Demaille <demaille@gostai.com>
3143
3144 Comment changes.
3145 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
3146 comments for the license.
3147
d4977ce3
AD
31482008-11-15 Akim Demaille <demaille@gostai.com>
3149
3150 Remove tests/Makefile.am.
3151 * tests/Makefile.am: Rename as...
3152 * tests/local.mk: this.
3153 * Makefile.am, configure.ac: Adjust.
3154 * Makefile.am (DISTCLEANFILES): Define.
3155 (maintainer-check, maintainer-xml-check, maintainer-push-check):
3156 Remove, we no longer need to bounce to the real targets.
3157
87f1149a
AD
31582008-11-15 Akim Demaille <demaille@gostai.com>
3159
3160 Comment changes.
3161
36415906
AD
31622008-11-15 Akim Demaille <demaille@gostai.com>
3163
3164 djgpp/local.mk.
3165 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
3166 * djgpp/local.mk: this new file.
3167
e2c2f696
AD
31682008-11-15 Akim Demaille <demaille@gostai.com>
3169
3170 Remove doc/Makefile.am.
3171 * doc/Makefile.am: Rename as...
3172 * doc/local.mk: this.
3173 Adjust paths
3174 * Makefile.am, configure.ac: Adjust.
3175 * Makefile.am (MOSTLYCLEANFILES): New.
3176 * src/local.mk: Adjust.
3177
2ead32e6
AD
31782008-11-15 Akim Demaille <demaille@gostai.com>
3179
3180 Move sc_tight_scope into maint.mk.
b06df3c2
AD
3181 It does not work, and I don't know how it was supposed to work: it
3182 seems to be looking for sources in the build tree. I just moved
3183 it at a better place, fixing it is still required.
3184
2ead32e6
AD
3185 * src/local.mk (echo): Remove.
3186 (sc_tight_scope): Move to...
3187 * maint.mk: here.
3188
2df9ec37
AD
31892008-11-15 Akim Demaille <demaille@gostai.com>
3190
3191 Regen.
3192 * src/parse-gram.h, src/parse-gram.h: Regen.
3193
0305d25e
AD
31942008-11-15 Akim Demaille <demaille@gostai.com>
3195
3196 Remove src/Makefile.am.
3197 * src/Makefile.am: Rename as...
3198 * src/local.mk: this.
3199 Prefix all the paths with src/.
3200 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
3201 (AM_CPPFLAGS): Find find in builddir/src.
3202 (YACC): Move the flags into...
3203 (AM_YFLAGS): here.
3204 * maint.mk (sc_tight_scope): Disable.
3205 It used to bounce to the version in src/Makefile.am which is now
3206 part of this very Makefile.
3207 * Makefile.am, configure.ac: Adjust.
3208 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
3209 include "..." to find files "here": we are no longer in src/, so
3210 qualify the includes with src/.
3211 * doc/Makefile.am (PREPATH): No longer include the top_builddir
3212 prefix.
3213 (.x.1): Adjust to be able to create src/foo from the top level
3214 Makefile, instead of going bounce to src/Makefile the creation of
3215 foo.
3216
5277c0a3
AD
32172008-11-15 Akim Demaille <demaille@gostai.com>
3218
3219 Remove useless variable.
3220 * doc/Makefile.am (srcsrcdir): Remove.
3221
6a5aa0cd
AD
32222008-11-15 Akim Demaille <demaille@gostai.com>
3223
3224 Remove data/Makefile.am.
3225 * data/Makefile.am: Rename as...
3226 * data/local.mk: this.
3227 Adjust paths.
3228 * Makefile.am, configure.ac: Adjust.
3229
7cb794dc
AD
32302008-11-15 Akim Demaille <demaille@gostai.com>
3231
3232 Remove etc/Makefile.am.
3233 * etc/Makefile.am: Rename as...
3234 * etc/local.mk: this.
3235 Adjust.
3236 * Makefile.am, configure.ac: Adjust.
3237
cd409e3b
AD
32382008-11-15 Akim Demaille <demaille@gostai.com>
3239
3240 Remove examples/local.mk.
3241 examples/calc++/Makefile.am might be interesting to keep as is, since
3242 it is an example in itself.
2df9ec37 3243
cd409e3b
AD
3244 * examples/Makefile.am: Rename as...
3245 * examples/local.mk: this.
3246 Adjust.
3247 * Makefile.am, configure.ac: Adjust.
3248
9a1e4214
AD
32492008-11-15 Akim Demaille <demaille@gostai.com>
3250
3251 Remove build-aux/Makefile.am.
3252 Recursive Makefiles are really way too slow, let's get rid of some of
3253 them.
2df9ec37 3254
9a1e4214
AD
3255 * build-aux/Makefile.am: Rename as...
3256 * build-aux/local.mk: this.
3257 Adjust paths.
3258 * Makefile.am, configure.ac: Adjust.
3259
0634493c
AD
32602008-11-15 Akim Demaille <demaille@gostai.com>
3261
3262 Provide convenience constructors for locations and positions.
3263 * data/location.cc (position::position): Accept file, line and
3264 column as arguments with default values.
3265 Always qualify initial line and column literals as unsigned.
3266 (location::location): Provide convenience constructors.
3267
fe1b448a
AD
32682008-11-15 Akim Demaille <demaille@gostai.com>
3269
b06df3c2
AD
3270 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
3271 token type.
fe1b448a
AD
3272 Using template buys us nothing, and makes it uselessly complex to
3273 construct a symbol. Besides, it could not be generalized to other
3274 languages, while make_FOO would work in C/Java etc.
2df9ec37 3275
fe1b448a
AD
3276 * data/lalr1.cc (b4_symbol_): New.
3277 (b4_symbol): Use it.
3278 (b4_symbol_constructor_declaration_)
3279 (b4_symbol_constructor_definition_): Instead of generating
3280 specializations of an overloaded template function, just generate
3281 several functions whose names are forged from the token names
3282 without the token.prefix.
3283 (b4_symbol_constructor_declarations): Generate them for all the
3284 symbols, not just by class of symbol type, now that instead of
3285 specializing a function template by the token, we generate a
3286 function named after the token.
3287 (b4_symbol_constructor_specialization_)
3288 (b4_symbol_constructor_specializations): Remove.
3289 * etc/bench.pl.in: Adjust to this new API.
3290
5679f311
AD
32912008-11-13 Akim Demaille <demaille@gostai.com>
3292
3293 %define token.prefix.
b06df3c2
AD
3294 Provide a means to add a prefix to the name of the tokens as
3295 output in the generated files. Because of name clashes, it is
3296 good to have such a prefix such as TOK_ that protects from names
3297 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 3298
5679f311
AD
3299 * data/bison.m4 (token.prefix): Empty by default.
3300 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
3301 * data/lalr1.cc (b4_symbol): Ditto.
3302
3204049e
AD
33032008-11-13 Akim Demaille <demaille@gostai.com>
3304
3305 Compute at M4 time some of the subtractions.
90290ce5 3306 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
3307 (b4_rhs_data): Use it.
3308
202598d3
AD
33092008-11-13 Akim Demaille <demaille@gostai.com>
3310
3311 symbol::token.
b06df3c2 3312 This allows the user to get the type of a token returned by yylex.
2df9ec37 3313
202598d3
AD
3314 * data/lalr1.cc (symbol::token): New.
3315 (yytoknum_): Define when %define lex_symbol, independently of
3316 %debug.
3317 (yytoken_number_): Move into...
3318 (symbol::token): here, since that's the only use.
3319 The other one is YYPRINT which was not officially supported
3320 by lalr1.cc, and anyway it did not work since YYPRINT uses this
3321 array under a different name (yytoknum).
3322
fc2476c7
AD
33232008-11-13 Akim Demaille <demaille@gostai.com>
3324
3325 YYERRCODE.
3326 * TODO (YYERRCODE): Mention the case of $undef.
3327
865f1e9f
AD
33282008-11-13 Akim Demaille <demaille@gostai.com>
3329
3330 TODO: YYPRINT.
3331 * TODO (YYPRINT): New.
3332
cb0b136a
AD
33332008-11-13 Akim Demaille <demaille@gostai.com>
3334
3335 Comment changes.
3336 * data/lalr1.cc, data/yacc.c: Fix the description of the
3337 yytranslate and yytoknum tables.
3338
2c086d29
AD
33392008-11-13 Akim Demaille <demaille@gostai.com>
3340
3341 Define make_symbol in the header.
b06df3c2
AD
3342 To reach good performances these functions should be inlined (yet
3343 this is to measure precisely). To this end they must be available
3344 to the caller.
2df9ec37 3345
2c086d29
AD
3346 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
3347 location_type with the class name.
3348 Since will now be output in the header, declare "inline".
3349 No longer use b4_symbol_constructor_specializations, but
3350 b4_symbol_constructor_definitions in the header.
3351 Don't call it in the *.cc file.
3352
1c4af381
AD
33532008-11-13 Akim Demaille <demaille@gostai.com>
3354
3355 Define yytranslate in the header for lex_symbol.
3356 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
3357 into the header file when using %define lex_symbol.
3358 (yytranslate_): Declare inline.
3359
e51b0a82
AD
33602008-11-13 Akim Demaille <demaille@gostai.com>
3361
b06df3c2
AD
3362 Define the constructors of symbol_type in
3363 b4_symbol_constructor_definitions.
e51b0a82 3364 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
3365 forthcoming patch will move elsewhere. Hence the interest of
3366 putting them together.
2df9ec37 3367
b06df3c2
AD
3368 The stack_symbol_type does not need to be moved, it is used only
3369 by the parser.
2df9ec37 3370
e51b0a82
AD
3371 * data/lalr1.cc: Move symbol_type and symbol_base_type
3372 constructors into...
3373 (b4_symbol_constructor_definitions): here.
3374 Adjust.
3375
78835571
AD
33762008-11-13 Akim Demaille <demaille@gostai.com>
3377
3378 Make it easier to move the definition of yytranslate_.
3379 Forthcoming changes will make it possible to use yytranslate_
3380 from outside the parser implementation file.
2df9ec37 3381
78835571
AD
3382 * data/lalr1.cc (b4_yytranslate_definition): New.
3383 Use it.
3384
c1e6c88c
AD
33852008-11-13 Akim Demaille <demaille@gostai.com>
3386
3387 Remove useless class specification.
3388 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
3389 to refer to the class name to use a type defined by the class for
3390 arguments of member functions.
3391
4654b0c0
AD
33922008-11-13 Akim Demaille <demaille@gostai.com>
3393
3394 Finer input type for yytranslate.
3395 This patch is debatable: the tradition expects yylex to return an int
3396 which happens to correspond to token_number (which is an enum). This
3397 allows for instance to return characters (such as '*' etc.). But this
3398 goes against the stronger typing I am trying to have with the new
3399 lex interface which return a symbol_type. So in this case, feed
3400 yytranslate_ with a token_type.
2df9ec37 3401
4654b0c0
AD
3402 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
3403 expect a token_type.
3404
dd735e4e
AD
34052008-11-13 Akim Demaille <demaille@gostai.com>
3406
3407 Honor lex-params in %define lex_symbol mode.
3408 * data/lalr1.cc: Use b4_lex_param.
3409
6659366c
AD
34102008-11-13 Akim Demaille <demaille@gostai.com>
3411
3412 Simplify names.
3413 * src/output.c (symbol_definitions_output): Rename symbol
3414 attributes type_name and has_type_name as type and has_type.
3415 * data/lalr1.cc: Adjust uses.
3416
e9805e57
AD
34172008-11-13 Akim Demaille <demaille@gostai.com>
3418
3419 Use b4_type_names for the union type.
b06df3c2
AD
3420 The union used to compute the size of the variant used to iterate
3421 over the type of all the symbols, with a lot of redundancy. Now
3422 iterate over the lists of symbols having the same type-name.
2df9ec37 3423
e9805e57
AD
3424 * data/lalr1.cc (b4_char_sizeof_): New.
3425 (b4_char_sizeof): Use it.
3426 Adjust to be called with a list of numbers instead of a single
3427 number.
3428 Adjust its caller for new-line issues.
3429
aea10ef4
AD
34302008-11-13 Akim Demaille <demaille@gostai.com>
3431
3432 Define the "identifier" of a symbol.
b06df3c2
AD
3433 Symbols may have several string representations, for instance if
3434 they have an alias. What I call its "id" is a string that can be
3435 used as an identifier. May not exist.
2df9ec37 3436
b06df3c2
AD
3437 Currently the symbols which have the "tag_is_id" flag set are
3438 those that don't have an alias. Look harder for the id.
2df9ec37 3439
aea10ef4
AD
3440 * src/output.c (is_identifier): Move to...
3441 * src/symtab.c (is_identifier): here.
3442 * src/symtab.h, src/symtab.c (symbol_id_get): New.
3443 * src/output.c (symbol_definitions_output): Use it to define "id"
3444 and "has_id".
3445 Remove the definition of "tag_is_id".
3446 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
3447 "tag_is_id" were used to produce code.
3448 We still use "tag" for documentation.
3449
2ea7730c
AD
34502008-11-11 Akim Demaille <demaille@gostai.com>
3451
3452 Locations are no longer required by lalr1.cc.
3453 * data/lalr1.cc (_b4_args, b4_args): New.
3454 Adjust all uses of locations to make them optional.
3455 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
3456 (AT_CHECK_NAMESPACE): Check the use of locations.
3457 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
3458 without locations with lalr1.cc.
3459 Test these cases.
3460 * tests/output.at: Check lalr1.cc with and without location
3461 support.
3462 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
3463 Don't use locations.
3464
7ca2266a
AD
34652008-11-11 Akim Demaille <demaille@gostai.com>
3466
3467 AT_FULL_COMPILE.
3468 * tests/local.at (AT_FULL_COMPILE): New.
3469 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
3470
1a7a65f9
AD
34712008-11-11 Akim Demaille <demaille@gostai.com>
3472
3473 Support parens in calc++.
3474 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
3475 * examples/calc++/test (run): Check the expected output.
3476 Adjust callers.
3477 Check parens too.
3478
c944f7f2
AD
34792008-11-11 Akim Demaille <demaille@gostai.com>
3480
3481 Simplify lalr1.cc since %defines is mandatory.
3482 * data/lalr1.cc: Remove useless calls to b4_defines_if.
3483
dada3cd1
AD
34842008-11-11 Akim Demaille <demaille@gostai.com>
3485
3486 TODO: yyfmt.
3487 * TODO (yysyntax_error): New item.
3488
422c18f4
AD
34892008-11-11 Akim Demaille <demaille@gostai.com>
3490
3491 Prefer M4 to CPP.
3492 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
3493 YYERROR_VERBOSE.
3494
a0ffc175
AD
34952008-11-11 Akim Demaille <demaille@gostai.com>
3496
3497 Support i18n of the parse error messages.
3498 * TODO (lalr1.cc/I18n): Remove.
3499 * data/lalr1.cc (yysyntax_error_): Support the translation of the
3500 error messages, as done in yacc.c.
3501 Stay within the yy* pseudo namespace.
3502
00a8a083
AD
35032008-11-11 Akim Demaille <demaille@gostai.com>
3504
3505 More TODO.
3506 * TODO (single stack, yysyntax_error): New.
3507
09277875
AD
35082008-11-11 Akim Demaille <demaille@gostai.com>
3509
3510 Make it possible to return a symbol_type from yylex.
3511 * data/lalr1.cc (b4_lex_symbol_if): New.
3512 (parse): When lex_symbol is defined, expected yylex to return the
3513 complete lookahead.
3514 * etc/bench.pl.in (generate_grammar_list): Extend to support this
3515 yylex interface.
3516 (bench_variant_parser): Exercise it.
3517
64c1b92a
AD
35182008-11-11 Akim Demaille <demaille@gostai.com>
3519
3520 Remove useless bench case.
3521 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
3522 no longer used.
3523
2722aa42
AD
35242008-11-11 Akim Demaille <demaille@gostai.com>
3525
3526 Improve display of directives.
3527 * etc/bench.pl.in (parse_term): Don't add useless eol.
3528
918eb7c5
AD
35292008-11-11 Akim Demaille <demaille@gostai.com>
3530
3531 Use string_cast in the bench.
3532 * etc/bench.pl.in (generate_grammar_list): Define and use
3533 string_cast.
3534
39be9022
AD
35352008-11-11 Akim Demaille <demaille@gostai.com>
3536
3537 Replace yychar with a Boolean.
3538 * data/lalr1.cc (parse::yychar): Replace by...
3539 (parse::yyempty): this.
3540
a2e3fa77
AD
35412008-11-11 Akim Demaille <demaille@gostai.com>
3542
3543 Factor the tables.
3544 * TODO: New item.
3545
aba12ad1
AD
35462008-11-11 Akim Demaille <demaille@gostai.com>
3547
3548 Let yytranslate handle the eof case.
3549 * data/lalr1.cc (yytranslate_): Handle the EOF case.
3550 Adjust callers.
3551 No longer expect yychar to be equal to yyeof_, rather, test the
3552 lookahead's (translated) kind.
3553
27cb5b59
AD
35542008-11-11 Akim Demaille <demaille@gostai.com>
3555
3556 yychar cannot be empty in yyerrlab.
3557 * TODO (yychar == yyempty_): New.
3558 * data/lalr1.cc: Remove the handling of this case.
3559 This eases forthcoming changes related to yychar and yytranslate.
3560
fce629c0
AD
35612008-11-11 Akim Demaille <demaille@gostai.com>
3562
3563 Bench: syntactic sugar for %define/#define.
3564 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
3565 (&bench_push_parser, bench_variant_parser): Use this feature.
3566 (&eat): New.
3567 Use it.
3568
ce671960
AD
35692008-11-11 Akim Demaille <demaille@gostai.com>
3570
3571 Less memory pressure on the "list" bench.
3572 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
3573 the values, to limit memory pressure.
3574
2873fdf8
AD
35752008-11-11 Akim Demaille <demaille@gostai.com>
3576
3577 Introduce make_symbol.
b06df3c2
AD
3578 make_symbol provides a means to construct a full symbol (kind,
3579 value, location) in a single shot. It is meant to be a Symbol
3580 constructor, parameterized by the symbol kind so that overloading
3581 would prevent incorrect kind/value pairs. Unfortunately
3582 parameterized constructors do not work well in C++ (unless the
3583 parameter also appears as an argument, which is not acceptable),
3584 hence the use of a function instead of a constructor.
2df9ec37 3585
2873fdf8
AD
3586 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3587 (b4_symbol_constructor_declarations)
3588 (b4_symbol_constructor_specialization_)
3589 (b4_symbol_constructor_specializations)
3590 (b4_symbol_constructor_definition_)
3591 (b4_symbol_constructor_definitions): New.
3592 Use them where appropriate to generate declaration, declaration of
3593 the specializations, and implementations of the templated
3594 overloaded function "make_symbol".
3595 (variant::variant): Always define a default ctor.
3596 Also provide a copy ctor.
3597 (symbol_base_type, symbol_type): New ctor overloads for value-less
3598 symbols.
3599 (symbol_type): Now public, so that functions such as yylex can use
3600 it.
3601
8be046d7
AD
36022008-11-11 Akim Demaille <demaille@gostai.com>
3603
3604 Inform m4 whether a tag is a valid id.
3605 * src/output.c (is_identifier): New.
3606 (symbol_definitions_output): Use it to define tag_is_id.
3607 But maybe this should be done at m4 level?
3608
de62edee
AD
36092008-11-11 Akim Demaille <demaille@gostai.com>
3610
3611 Test 214 was failing: it greps with a pattern containing [ ]*
3612 which obviously meant to catch spaces and tabs, but contained only
3613 spaces. Tabulations in sources are a nuisance, so to simplify the
3614 matter, get rid of all the tabulations in the Java sources. The
3615 other skeletons will be treated equally later.
3616
3617 * data/java.m4, data/lalr1.java: Untabify.
3618 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
3619 tabulations are no longer generated.
3620
905f0697
PB
36212008-11-11 Paolo Bonzini <bonzini@gnu.org>
3622
3623 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3624 * configure.ac: Adjust usage.
3625 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3626 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3627 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3628
09ccae9b
DJ
36292008-11-10 Di-an Jan <dianj@freeshell.org>
3630
3631 Workaround Java's ``code too large'' problem for parser tables
3632 in most cases, by using one function per initialization.
3633 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
3634 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
3635 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
3636 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
3637 (yytname_): Use b4_typed_parser_table.
3638 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
3639 ``code too large'' error.
3640
1979121c
DJ
36412008-11-10 Di-an Jan <dianj@freeshell.org>
3642
3643 * NEWS: Document them.
de62edee 3644
1979121c
DJ
3645 General Java skeleton improvements.
3646 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
3647 using gcj < 4.3 in the testsuite, according to comments in
3648 gnulib/m4/javacomp.m4.
3649 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
3650 location_type, position_type): Remove extraneous brackets from
3651 b4_percent_define_default.
3652 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
3653 m4_define and m4_define_default.
3654 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
3655 which marks the end of user code with appropriate syncline, like all
3656 the other skeletons.
3657 (b4_user_post_prologue): Add. Don't silently drop.
3658 (yylex): Remove.
3659 (parse): Inline yylex.
3660 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
3661 (%{...%}): Fix typo of %code imports.
3662 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
3663
3664 Support annotations on parser class with %define annotations.
3665 * data/lalr1.java (annotations): Add to parser class modifier.
3666 * doc/bison.texinfo (Java Parser Interface): Document
3667 %define annotations.
3668 (Java Declarations Summary): Document %define annotations.
3669 * tests/java.at (Java parser class modifiers): Test annotations.
3670
3671 Do not generate code for %error-verbose unless requested.
3672 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
3673 Make private. Make conditional on %error-verbose.
3674 (getErrorVerbose, setErrorVerbose): New.
3675 (yytnamerr_): Make conditional on %error-verbose.
3676 (yysyntax_error): Make some code conditional on %error-verbose.
3677 * doc/bison.texinfo (Java Bison Interface): Remove the parts
3678 about %error-verbose having no effect.
3679 (getErrorVerbose, setErrorVerbose): Document.
3680
3681 Move constants for token names to Lexer interface.
3682 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
3683 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
3684 (parse): Qualify EOF to Lexer.EOF.
3685 * doc/bison.texinfo (Java Parser Interface): Move documentation of
3686 EOF and token names to Java Lexer Interface.
3687 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
3688
3689 Make yyerror public.
3690 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
3691 (yyerror): Change to public. Add Javadoc comments. Use longer
3692 parameter names. Make the body rather than the declarator
3693 conditional on %locations.
3694 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
3695
3696 Allow user to add code to the constructor with %code init.
3697 * data/java.m4 (b4_init_throws): New, for %define init_throws.
3698 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
3699 Add %code init to the front of the constructor body.
3700 * doc/bison.texinfo (YYParser.YYParser): Document %code init
3701 and %define init_throws.
3702 (Java Declarations Summary): Document %code init and
3703 %define init_throws.
3704 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
3705 (Java constructor init and init_throws): Add tests.
de62edee 3706
42f832d6
AD
37072008-11-10 Akim Demaille <demaille@gostai.com>
3708
3709 Update TODO.
3710 * TODO (-D): is implemented.
3711 (associativity): Same precedence must have the same associativity.
3712 For instance, how can a * b / c be parsed if * is %left and / is
3713 %right?
3714 (YYERRORCODE, YYFAIL, YYBACKUP): New.
3715
247efe34
AD
37162008-11-10 Akim Demaille <demaille@gostai.com>
3717
3718 Formatting changes.
3719
5d731440
AD
37202008-11-10 Akim Demaille <demaille@gostai.com>
3721
3722 More information about the symbols.
3723 * src/output.c (type_names_output): Document all the symbols,
3724 including those that don't have a type-name.
3725 (symbol_definitions_output): Define "is_token" and
3726 "has_type_name".
3727 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
3728 type-name, now that they are defined too in b4_type_names.
3729
21db118b
AD
37302008-11-10 Akim Demaille <demaille@gostai.com>
3731
3732 Regen.
3733
6ed15cde
AD
37342008-11-10 Akim Demaille <demaille@gostai.com>
3735
3736 Make parser::yytranslate static.
b06df3c2
AD
3737 Small speedup (1%) on the list grammar. And makes yytranslate_
3738 available in non member functions.
de62edee 3739
6ed15cde
AD
3740 * data/lalr1.cc (yytranslate_): Does not need to be a instance
3741 function.
3742
30bb2edc
AD
37432008-11-10 Akim Demaille <demaille@gostai.com>
3744
3745 Avoid trailing spaces.
3746 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
3747 * data/lalr1.cc: Don't indent before rule and symbol actions, as
3748 they can be empty, and anyway this incorrectly indents the first
3749 action.
3750
b3a28fd4
AD
37512008-11-10 Akim Demaille <demaille@gostai.com>
3752
3753 Comment changes.
3754
914202bd
AD
37552008-11-10 Akim Demaille <demaille@gostai.com>
3756
3757 Use "enum" for integral constants.
3758 This is just nicer to read, I observed no speedup.
de62edee 3759
914202bd
AD
3760 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
3761 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
3762 (yyuser_token_number_max_, yyundef_token_): Move into...
3763 (yytranslate_): here.
3764
c17f9a4a
AD
37652008-11-10 Akim Demaille <demaille@gostai.com>
3766
3767 Shortcuts in bench directives.
3768 * etc/bench.pl.in (parse_dirs): New.
3769 Use it.
3770 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
3771 Create the benches in "benches/".
3772
b9855ea5
AD
37732008-11-10 Akim Demaille <demaille@gostai.com>
3774
3775 Formatting changes.
3776 * data/lalr1.cc: here.
3777
6e097787
AD
37782008-11-10 Akim Demaille <demaille@gostai.com>
3779
3780 Adjust verbose message to using emacs.
3781 * etc/bench.pl.in: Inform compilation-mode when we change the
3782 directory.
3783 (generate_grammar_list): Recognize %define "variant" in addition
3784 to %define variant.
3785
4c3cc7da
AD
37862008-11-10 Akim Demaille <demaille@gostai.com>
3787
3788 Classify symbols by type-name.
3789 * src/uniqstr.h (UNIQSTR_CMP): New.
3790 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
3791 (type_names_output): New.
3792 (muscles_output): Use it.
3793 * data/lalr1.cc (b4_symbol_action_): Remove.
3794 (b4_symbol_case_, b4_type_action_): New.
3795 Adjust uses of b4_symbol_action_ to use b4_type_action_.
3796
d69c9694
AD
37972008-11-10 Akim Demaille <demaille@gostai.com>
3798
3799 Change the handling of the symbols in the skeletons.
3800 Before we were using tables which lines were the symbols and which
3801 columns were things like number, tag, type-name etc. It is was
3802 difficult to extend: each time a column was added, all the numbers had
3803 to be updated (you asked for colon $2, not for "tag"). Also, it was
3804 hard to filter these tables when only a subset of the symbols (say the
3805 tokens, or the nterms, or the tokens that have and external number
3806 *and* a type-name) was of interest.
de62edee 3807
d69c9694
AD
3808 Now instead of monolithic tables, we define one macro per cell. For
3809 instance "b4_symbol(0, tag)" is a macro name which contents is
3810 self-decriptive. The macro "b4_symbol" provides easier access to
3811 these cells.
de62edee 3812
d69c9694
AD
3813 * src/output.c (type_names_output): Remove.
3814 (symbol_numbers_output, symbol_definitions_output): New.
3815 (muscles_output): Call them.
3816 (prepare_symbols): Define b4_symbols_number.
3817
5263bea9
AD
38182008-11-10 Akim Demaille <demaille@gostai.com>
3819
3820 --trace=muscles
3821 * src/getargs.h, src/getargs.c (trace_muscle): New.
3822 (trace_types, trace_args): Support it.
3823 * src/output.c (output_skeleton): Use it.
3824
4175f6bb
AD
38252008-11-10 Akim Demaille <demaille@gostai.com>
3826
3827 muscles_output.
3828 * src/output.c (muscles_output): New, extracted from...
3829 (output_skeleton): here.
3830 Adjust.
3831
1de69d6a
AD
38322008-11-10 Akim Demaille <demaille@gostai.com>
3833
3834 Formatting changes.
3835
36db78a7
AD
38362008-11-10 Akim Demaille <demaille@gostai.com>
3837
3838 Update the variant example.
3839 * examples/variant.yy: Formatting changes.
3840 One stage build.
3841
e5eb92e7
AD
38422008-11-10 Akim Demaille <demaille@gostai.com>
3843
3844 Support constructor with an argument.
3845 This improves the "list" bench by 2%.
de62edee 3846
e5eb92e7
AD
3847 * data/lalr1.cc (variant::build): Add an overloaded version with
3848 an argument.
3849 * tests/c++.at (AT_CHECK_VARIANT): Check it.
3850
76307410
AD
38512008-11-10 Akim Demaille <demaille@gostai.com>
3852
3853 Test variants.
3854 * tests/c++.at (AT_CHECK_VARIANTS): New.
3855 Use it with and without %define assert.
3856
d78f0ac9
AD
38572008-11-10 Akim Demaille <demaille@gostai.com>
3858
3859 Add %precedence support.
3860 Unfortunately it is not possible to reuse the %prec directive. This
3861 is because to please POSIX, we do not require to end the rules with a
3862 semicolon. As a result,
de62edee 3863
d78f0ac9 3864 foo: bar %prec baz
de62edee 3865
d78f0ac9
AD
3866 is ambiguous: either a rule which precedence is that of baz, or a rule,
3867 and then a declaration of the precedence of the token baz.
de62edee 3868
d78f0ac9
AD
3869 * doc/bison.texinfo: Document %precedence.
3870 (Precedence Only): New.
3871 * src/assoc.h, src/assoc.c (precedence_assoc): New.
3872 * src/conflicts.c (resolve_sr_conflict): Support it.
3873 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
3874 Parse it.
3875 * tests/calc.at: Use %precedence for NEG.
3876 * tests/conflicts.at (%precedence does not suffice)
3877 (%precedence suffices): New tests.
3878
c85be41a
AD
38792008-11-09 Akim Demaille <demaille@gostai.com>
3880
3881 Make benches in a sub dirs.
3882 * etc/bench.pl.in ($dir): New.
3883 Use it.
3884 Check the use of constructors with an argument.
3885 (bench_variant_parser): Fix.
3886
db65ca1f
AD
38872008-11-09 Akim Demaille <demaille@gostai.com>
3888
3889 fix eof condition
3890
9b0efa5b
AD
38912008-11-09 Akim Demaille <demaille@gostai.com>
3892
3893 Fix --help.
3894
432ac57a
AD
38952008-11-09 Akim Demaille <demaille@gostai.com>
3896
3897 Require the generation of parse-gram.output.
3898 * src/Makefile.am (YACC): Pass --report=all.
3899
deef2a0a
AD
39002008-11-09 Akim Demaille <demaille@gostai.com>
3901
3902 Formatting changes.
3903
df72984a
AD
39042008-11-09 Akim Demaille <demaille@gostai.com>
3905
3906 Update TODO.
3907 * TODO: Remove obsolete items.
3908 Update others.
3909
f10e19fd
AD
39102008-11-09 Akim Demaille <demaille@gostai.com>
3911
3912 Enhance bench.pl.
3913 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
3914 (@token, $grammar, $bench): New.
3915 (generate_grammar_variant): Rename as...
3916 (generate_grammar_list): this.
3917 (generate_grammar): Adjust.
3918 (bench_grammar): Rename as...
3919 (bench): this.
3920 Use it in the various bench-marking routines.
3921 (-b, -g): New options.
3922
5de9c593
AD
39232008-11-09 Akim Demaille <demaille@gostai.com>
3924
3925 Use a static hierarchy for symbols in the C++ parser.
3926 * data/lalr1.cc (symbol_base_type, symbol_type)
3927 (stack_symbol_type): Make it a static hierarchy.
3928 Adjust dependencies.
3929
757f8f98
AD
39302008-11-09 Akim Demaille <demaille@gostai.com>
3931
3932 bench.pl -d, --directive.
3933 * etc/bench.pl.in (@directive): New.
3934 (&bench_grammar): Use it.
3935 (&bench_list_grammar): New, to provide access to the "variant"
3936 grammar.
3937 Use it.
3938 (getopts): Support -d, --directive.
3939
d3be4f6d
AD
39402008-11-09 Akim Demaille <demaille@gostai.com>
3941
3942 Use inline for small operations.
3943 * data/lalr1.cc (symbol_base_type, symbol_type)
3944 (stack_symbol_type): Declare constructor and other operations as
3945 inline.
3946 (yy_destroy_): Inline.
3947
1f7d007b
AD
39482008-11-09 Akim Demaille <demaille@gostai.com>
3949
3950 Introduce a hierarchy for symbols.
3951 * data/lalr1.cc (symbol_base_type, symbol_type): New.
3952 (data_type): Rename as...
3953 (stack_symbol_type): this.
3954 Derive from symbol_base_type.
3955 (yy_symbol_value_print_): Merge into...
3956 (yy_symbol_print_): this.
3957 Rename as...
3958 (yy_print_): this.
3959 (yydestruct_): Rename as...
3960 (yy_destroy_): this.
3961 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
3962 (parser::parse): yyla is now of symbol_type.
3963 Use its type member instead of yytoken.
3964
bc0b0477
AD
39652008-11-09 Akim Demaille <demaille@gostai.com>
3966
3967 Rename data_type and stack_symbol_type.
3968 * data/lalr1.cc (data_type): Rename as...
3969 (stack_symbol_type): this.
3970
57295d14
AD
39712008-11-09 Akim Demaille <demaille@gostai.com>
3972
3973 Handle semantic value and location together.
3974 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
3975 yydata.value and yydata.location.
3976 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
3977 (YY_SYMBOL_PRINT): Now take semantic value and location as a
3978 single arg.
3979 Adjust all callers.
3980 (yydestruct_): New overload for a stack symbol.
3981
e9b0834e
AD
39822008-11-09 Akim Demaille <demaille@gostai.com>
3983
3984 Push a complete symbol, not connected parts.
3985 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
3986 state, value and location.
3987 Adjust callers.
3988
6082531a
AD
39892008-11-09 Akim Demaille <demaille@gostai.com>
3990
3991 Agregate yylval and yylloc.
3992 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
3993 (parser::yyla): this.
3994
33c195cc
AD
39952008-11-09 Akim Demaille <demaille@gostai.com>
3996
3997 Rely on the state stack to display reduction traces.
b06df3c2
AD
3998 To display rhs symbols before a reduction, we used information
3999 about the rule reduced, which required the tables yyrhs and
4000 yyprhs. Now use rely only on the state stack to get the same
4001 information.
de62edee 4002
33c195cc
AD
4003 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
4004 Use them.
4005 (parser::yyrhs_, parser::yyprhs_): Remove.
4006 (parser::yy_reduce_print_): Use the state stack.
4007
e1f93869
AD
40082008-11-09 Akim Demaille <demaille@gostai.com>
4009
4010 Fuse yyval and yyloc into yylhs.
4011 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
4012 yylhs.
4013 (parse): Replace yyval and yyloc with yylhs.value and
4014 yylhs.location.
4015 After a user action, compute yylhs.state earlier.
4016 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
4017 fresh error_token.
4018
2935744b
DJ
40192008-11-09 Di-an Jan <dianj@freeshell.org>
4020
4021 Remove unused variable.
4022 * src/output.c (type_names_output): Remove unused variable sep.
4023
bbf9ca37
PB
40242008-11-09 Paolo Bonzini <bonzini@gnu.org>
4025
4026 Change tests/output.at quoting.
4027 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
4028 expanding arguments.
4029
d9a9b96b
JD
40302008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4031
4032 Don't add a semicolon to actions for %skeleton or %language.
4033 It breaks Java test cases as reported by Akim Demaille.
4034 * src/scan-code.l: Implement.
4035
51365192
JD
40362008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4037
4038 Clean up %skeleton and %language priority implementation.
4039 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
4040 remove static qualifier because others will soon need to see it.
4041 (language_prio): Likewise.
4042 (getargs): Use command_line_prio rather than 0.
4043 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
4044 enum fields.
4045 (skeleton_prio): Extern it.
4046 (language_prio): Extern it.
4047 * src/parse-gram.y: Use grammar_prio rather than 1.
4048
9380cfd0
AD
40492008-11-07 Akim Demaille <demaille@gostai.com>
4050
4051 Moving push traces into yypush_.
4052 * data/lalr1.cc (yypush_): Now takes a optional trace message.
4053 Adjust all uses.
4054
8901f32e
AD
40552008-11-07 Akim Demaille <demaille@gostai.com>
4056
4057 The single-stack C++ parser is now the standard one.
4058 * data/lalr1.cc: Rename as...
4059 * data/lalr1-split.cc: this.
4060 * data/lalr1-fusion.cc: Rename as...
4061 * data/lalr1.cc: this.
4062 * etc/bench.pl.in: Adjust.
4063
8cdabf02
AD
40642008-11-07 Akim Demaille <demaille@gostai.com>
4065
4066 Avoid empty-if warnings.
4067 Reported by Quentin Hocquet.
de62edee 4068
8cdabf02
AD
4069 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
4070 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
4071
5a893c2b
AD
40722008-11-07 Akim Demaille <demaille@gostai.com>
4073
4074 Pass command line location to skeleton_arg and language_argmatch.
4075 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
4076 The location argument is now mandatory.
4077 Adjust all dependencies.
4078 (getargs): Use command_line_location.
4079
58697c6d
AD
40802008-11-07 Akim Demaille <demaille@gostai.com>
4081
4082 -D, --define.
4083 * src/getargs.c (usage): Document -D.
4084 Fix help string for --locations.
4085 (command_line_location): New.
4086 (short_options, long_options, getargs): Support -D, --define.
4087 (getargs): Move -d support at the right place.
4088 * doc/bison.texinfo (Bison Options): Update.
4089 * tests/input.at (%define, --define): New.
4090
9fe5a457
AD
40912008-11-07 Akim Demaille <demaille@gostai.com>
4092
4093 Initialize the muscle table before parsing the command line.
4094 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
4095 (getargs): Define file_name.
4096 * src/main.c (main): Initialize muscle_tab before calling
4097 getargs.
4098 * src/muscle_tab.c (muscle_init): No longer define file_name, as
4099 its value is not available yet.
4100
56c5eca9
AD
41012008-11-07 Akim Demaille <demaille@gostai.com>
4102
4103 Locations without columns for command line arguments.
4104 * src/location.c (location_print): Don't display negative columns.
4105 * src/location.h: Document this.
4106
9b9e0a7d
AD
41072008-11-07 Akim Demaille <demaille@gostai.com>
4108
4109 Fix --help.
4110 * src/getargs.c (usage): Fix help string for -W.
4111
74eae918
AD
41122008-11-07 Akim Demaille <demaille@gostai.com>
4113
4114 Handle more general types of option arguments.
4115 * build-aux/cross-options.pl: The argument ends at the first
4116 space, not the first non-symbol character.
4117 Use @var for each word appearing the argument description.
4118
a3d4c6fb
AD
41192008-11-07 Akim Demaille <demaille@gostai.com>
4120
4121 Destroy the variants that remain on the stack in case of error.
4122 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
4123 destructor.
4124 Display the value only if yymsg is nonnull.
4125 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
4126
2d32fc9f
AD
41272008-11-07 Akim Demaille <demaille@gostai.com>
4128
4129 Add "%define assert" to variants.
4130 This is used to help the user catch cases where some value gets
4131 ovewritten by a new one. This should not happen, as this will
4132 probably leak.
de62edee 4133
2d32fc9f
AD
4134 Unfortunately this uncovered a bug in the C++ parser itself: the
4135 lookahead value was not destroyed between two calls to yylex. For
4136 instance if the previous lookahead was a std::string, and then an int,
4137 then the value of the std::string was correctly taken (i.e., the
4138 lookahead was now an empty string), but std::string structure itself
4139 was not reclaimed.
de62edee 4140
2d32fc9f
AD
4141 This is now done in variant::build(other&) (which is used to take the
4142 value of the lookahead): other is not only stolen from its value, it
4143 is also destroyed. This incurs a new performance penalty of a few
4144 percent, and union becomes faster again.
de62edee 4145
2d32fc9f
AD
4146 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
4147 (b4_variant_if): New.
4148 (variant::built): New.
4149 Use it whereever the status of the variant changes.
4150 * etc/bench.pl.in: Check the penalty of %define assert.
4151
f6038cb8
AD
41522008-11-07 Akim Demaille <demaille@gostai.com>
4153
4154 Use "%define variant" in bench.pl.
4155 * etc/bench.pl.in: No longer use the pseudo directive %variants,
4156 just use %define variants.
4157
ccde1f98
AD
41582008-11-07 Akim Demaille <demaille@gostai.com>
4159
4160 Regen.
4161 * src/parse-gram.h, src/parse-gram.c: Regen.
4162
58bd33b7
JD
41632008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
4164
4165 Fix user actions without a trailing semicolon.
4166 Reported by Sergei Steshenko at
4167 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
4168 * THANKS (Sergei Steshenko): Add.
4169 * src/scan-code.l (SC_RULE_ACTION): Fix it.
4170 * tests/regression.at (Fix user actions without a trailing semicolon):
4171 New test case.
4172
639867b5
AD
41732008-11-04 Akim Demaille <demaille@gostai.com>
4174
4175 Use b4_copyright_years.
4176 * data/yacc.c (b4_copyright_years): New.
4177 Fix its value according to the comments in the file.
4178 Use it and undefine it.
4179
3c262606
AD
41802008-11-04 Akim Demaille <demaille@gostai.com>
4181
4182 Formatting changes.
4183 * data/lalr1-fusion.cc, src/parse-gram.y: here.
4184
a2b93d52
AD
41852008-11-04 Akim Demaille <demaille@gostai.com>
4186
4187 Formatting changes.
4188 * data/lalr1-fusion.cc: here.
4189
3a2803df
AD
41902008-11-04 Akim Demaille <demaille@gostai.com>
4191
4192 Use strict on bench.pl.
4193 * etc/bench.pl.in (&run, &generate_grammar): New.
4194 Rename the grammar generating functions for consistency.
4195 Change the interface so that the list of benches to run is passed
4196 as (optionless) arguments.
4197 (&compile): Use &run.
4198
a0d4650a
AD
41992008-11-04 Akim Demaille <demaille@gostai.com>
4200
4201 Remove spurious initial empty lines.
4202 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
4203 * data/yacc.c: End the @output lines with an @.
4204
cac9e09b
AD
42052008-11-04 Akim Demaille <demaille@gostai.com>
4206
4207 Improve the display of sizes.
4208 * etc/bench.p.in: Higher precision.
4209 Sort by decreasing size.
4210
4af4348a
AD
42112008-11-04 Akim Demaille <demaille@gostai.com>
4212
4213 Don't memcpy C++ structures.
4214 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
4215 arguments.
4216 (variant::build): New overload for
4217 copy-construction-that-destroys.
4218 (variant::swap): New.
4219 (parser::yypush_): Use it in variant mode.
4220
ef05c4d6
AD
42212008-11-04 Akim Demaille <demaille@gostai.com>
4222
4223 Better defaults for bench.pl.
4224 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
4225 default values.
4226 Adjust &verbose uses.
4227 (-q, --quiet): New.
4228
9718cfa9
AD
42292008-11-04 Akim Demaille <demaille@gostai.com>
4230
4231 Make variant.yy more complex.
4232 std::list cannot be copied via memcpy, they are more demanding than
4233 std::string. Use one std::list to strengthen the test.
de62edee 4234
9718cfa9
AD
4235 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
4236 Adjust.
4237 Create a list of strings, instead of a single large string.
4238
a6df593d
AD
42392008-11-04 Akim Demaille <demaille@gostai.com>
4240
4241 bench.pl --bench.
4242 * etc/bench.pl.in (--bench, $bench): New.
4243
006a0303
AD
42442008-11-04 Akim Demaille <demaille@gostai.com>
4245
4246 Sort methods.
4247 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
4248 Define it after as().
4249
faef3466
AD
42502008-11-04 Akim Demaille <demaille@gostai.com>
4251
4252 Useless parens.
4253 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
4254
2141aded
AD
42552008-11-04 Akim Demaille <demaille@gostai.com>
4256
4257 Issue missing synclines after user actions.
4258 * data/c.m4 (b4_case): Issue synclines on the output file.
4259
e426d17b
AD
42602008-11-04 Akim Demaille <demaille@gostai.com>
4261
4262 Remove trailing empty line.
4263 * data/lalr1-fusion.cc: Don't add an empty line after the user's
4264 epilogue.
4265
a9ce3f54
AD
42662008-11-04 Akim Demaille <demaille@gostai.com>
4267
4268 Fix output of copyright years.
4269 * data/bison.m4 (b4_copyright): Fix the indentation of the
4270 copyright year paragraph.
4271 Use b4_copyright_years when no years are given.
4272 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
4273 (b4_copyright_years): New.
4274 Use it.
4275
59c544c2
AD
42762008-11-04 Akim Demaille <demaille@gostai.com>
4277
4278 Avoid the spurious initial empty line.
4279 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
4280 the end of @output request to suppress the empty line that
4281 results.
4282
96b15448
AD
42832008-11-04 Akim Demaille <demaille@gostai.com>
4284
4285 Remove parser::rhs_number_type.
4286 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
4287 (yyrhs_): Use b4_table_define.
4288
f0633174
AD
42892008-11-04 Akim Demaille <demaille@gostai.com>
4290
4291 Fix iteration type.
4292 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
4293
417b8004
AD
42942008-11-04 Akim Demaille <demaille@gostai.com>
4295
4296 Factor the declaration of the integer tables.
4297 * data/lalr1-fusion.cc (b4_table_define): New.
4298 Use it.
4299
1a5246c6
AD
43002008-11-03 Akim Demaille <demaille@gostai.com>
4301
4302 Fix indentation of tables in lalr1.cc
4303 * data/lalr1-fusion.cc: Fix the indentation.
4304
f8a95c9c
AD
43052008-11-03 Akim Demaille <demaille@gostai.com>
4306
4307 Destroy the lhs symbols after reduction.
4308 * data/lalr1-fusion.cc (parse): After the user action, when in
4309 variant mode, destroy the lhs symbols.
4310
d7f4d823
AD
43112008-11-03 Akim Demaille <demaille@gostai.com>
4312
4313 Simplify yysyntax_error_ use.
4314 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
4315 type, but make it unnamed in the declaration when it is not used.
4316
8b9c89fb
AD
43172008-11-03 Akim Demaille <demaille@gostai.com>
4318
4319 Let yy::variant::build return an lvalue.
4320 * data/lalr1-fusion.cc (variant::build): Return a reference to the
4321 object.
4322
83243c24
AD
43232008-11-03 Akim Demaille <demaille@gostai.com>
4324
4325 Define yy::variant only when needed.
4326 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
4327 used.
4328
429b4848
AD
43292008-11-03 Akim Demaille <demaille@gostai.com>
4330
4331 Bench the three-stack lalr1.cc.
4332 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
4333 one-stack one.
4334
414c76a4
AD
43352008-11-03 Akim Demaille <demaille@gostai.com>
4336
4337 Fail on parse error in calc++.
4338 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
4339 status.
4340 * examples/calc++/test ($me, $number, $exit, run): New.
4341 Use them to propagate errors to the exit status.
4342
8a5783fd
AD
43432008-11-03 Akim Demaille <demaille@gostai.com>
4344
4345 Don't specify the skeleton twice in the example.
4346 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
4347 file does what is needed.
4348
0cc5bead
AD
43492008-11-03 Akim Demaille <demaille@gostai.com>
4350
4351 bench: Improve output.
4352 * etc/bench.pl.in (bench_grammar): Tune the printf format.
4353
5b421a4e
AD
43542008-11-03 Akim Demaille <demaille@gostai.com>
4355
4356 bench: check impact of %debug on variants.
4357 * etc/bench.pl.in (variant_grammar): Fix the computation of
4358 $variant.
4359 Generate a grammar file that can work with or without %debug.
4360 Do use the @directive.
4361 (bench_variant_parser): Check impact of %debug.
4362 (@directives): Rename all the occurrences to...
4363 (@directive): this, for consistency.
4364
d11ee647
AD
43652008-11-03 Akim Demaille <demaille@gostai.com>
4366
4367 bench: report the size too.
4368 * etc/bench.pl.in ($iterations): Defaults to -3.
4369 (&bench_grammar): Require hireswallclock.
4370 Compute and display the size of the result.
4371 More comments.
4372
e1b74b92
AD
43732008-11-03 Akim Demaille <demaille@gostai.com>
4374
4375 bench: More use of the verbosity level.
4376 * etc/bench.pl.in ($verbose, &verbose): New.
4377 Use them.
4378 More POD documentation.
4379
7e5f9c54
AD
43802008-11-03 Akim Demaille <demaille@gostai.com>
4381
4382 bench.pl: a command line interface
4383 * etc/bench.pl.in: More doc.
4384 Some fixes in the documentation.
4385 ($cflags, $iterations, &help, &getopt): New.
4386 Use them.
4387 (&variant_grammar): Let the number of stages be 10 times what is
4388 specified.
4389
7109a18d
AD
43902008-11-03 Akim Demaille <demaille@gostai.com>
4391
4392 Bench the use of Boost.Variants.
4393 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
4394 New.
4395 (&compile): Be ready to compile C++ parsers.
4396 (&bench_push_parser): Move debug information to the outermost
4397 level.
4398 * THANKS: Add Michiel De Wilde.
4399
922730fe
AD
44002008-11-03 Akim Demaille <demaille@gostai.com>
4401
4402 bench.pl: Pass directives as a list instead of as a string.
4403 * etc/bench.pl.in (&directives): New.
4404 (&triangular_grammar, &calc_grammar): Use it to format the Bison
4405 directives.
4406 (&triangular_grammar): Do use the directives (were ignored).
4407 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
4408 directives.
4409
7484f1d4
AD
44102008-11-03 Akim Demaille <demaille@gostai.com>
4411
4412 Improve genericity of bench.pl.
4413 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
4414 argument.
4415 (&bench_push_parser): New.
4416 Call it.
4417
15129f25
AD
44182008-11-03 Akim Demaille <demaille@gostai.com>
4419
4420 Add documentation to bench.pl.
4421 * etc/bench.pl.in: Comment changes.
4422
0e0ed236
AD
44232008-11-03 Akim Demaille <demaille@gostai.com>
4424
4425 Fuse the three stacks into a single one.
de62edee 4426
b06df3c2
AD
4427 In order to make it easy to perform benchmarks to ensure that
4428 there are no performance loss, lalr1.cc is forked into
4429 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
4430 lalr1.cc.
4431
4432 Meanwhile, to make sure that lalr1-fusion.cc is correctly
4433 exercized by the test suite, the user must install a symbolic link
4434 from lalr1.cc to it.
de62edee 4435
b06df3c2
AD
4436 Instead of having three stacks (state, value, location), use a
4437 stack of triples. This considerably simplifies the code (and it
4438 will be easier not to require locations as currently does the C++
4439 parser), and also gives a 10% speedup according to
4440 etc/bench (probably mainly since memory allocation is done once
4441 instead of three times).
de62edee 4442
0e0ed236
AD
4443 Another motivation is to make it easier to destruct properly
4444 semantic values: now that they are bound to their state (hence
4445 symbol type) it will be easier to call the appropriate destructor.
de62edee 4446
0e0ed236 4447 These changes should probably benefit the C parser too.
de62edee 4448
b06df3c2
AD
4449 * data/lalr1.cc: Copy as...
4450 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
4451 (b4_rhs_value, b4_rhs_location): New definitions overriding those
4452 from c++.m4.
4453 (state_stack_type, semantic_stack_type, location_stack_type)
4454 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
4455 (data_type, stack_type, yystack_): New.
4456 (YYLLOC_DEFAULT, yypush_): Adjust.
4457 (yyerror_range): Now based on data_type, not location_type.
4458
7dedf26e
AD
44592008-11-03 Akim Demaille <demaille@gostai.com>
4460
4461 Push the state, value, and location at the same time.
4462 This is needed to prepare a forthcoming patch that fuses the three
4463 stacks into one.
de62edee 4464
7dedf26e
AD
4465 * data/lalr1.cc (parser::yypush_): New.
4466 (parser::yynewstate): Change the semantics: instead of arriving to
4467 this label when value and location have been pushed, but yystate
4468 is to be pushed on the state stack, now the three of them must
4469 have been pushed before. yystate still must be the new state.
4470 This allows to use yypush_ everywhere instead of individual
4471 handling of the stacks.
4472
c4585f1e
AD
44732008-11-03 Akim Demaille <demaille@gostai.com>
4474
4475 Prefer references to pointers.
4476 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
4477 definition to use references instead of pointers.
4478 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
4479 Take the value and location as references.
4480 Adjust callers.
4481
56017c17
AD
44822008-11-03 Akim Demaille <demaille@gostai.com>
4483
4484 stack::size instead of stack::height.
4485 * data/lalr1.cc (stack::height): Rename as...
4486 (stack::size): this.
4487 Fix the output type.
4488 Comment changes.
4489
5ab8c47b
AD
44902008-11-03 Akim Demaille <demaille@gostai.com>
4491
4492 Use variants to support objects as semantic values.
b06df3c2
AD
4493 This patch was inspired by work by Michiel De Wilde. But he used
4494 Boost variants which (i) requires Boost on the user side, (ii) is
4495 slow, and (iii) has useless overhead (the parser knows the type of
4496 the semantic value there is no reason to duplicate this
4497 information as Boost.Variants do).
4498
4499 This implementation reserves a buffer large enough to store the
4500 largest objects. yy::variant implements this buffer. It was
4501 implemented with Quentin Hocquet.
de62edee 4502
5ab8c47b
AD
4503 * src/output.c (type_names_output): New.
4504 (output_skeleton): Invoke it.
4505 * data/c++.m4 (b4_variant_if): New.
4506 (b4_symbol_value): If needed, provide a definition for variants.
4507 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
4508 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
4509 (b4_char_sizeof, yy::variant): New.
4510 (parser::parse): If variants are requested, define
4511 parser::union_type, parser::variant, change the definition of
4512 semantic_type, construct $$ before running the user action instead
4513 of performing a default $$ = $1.
4514 * examples/variant.yy: New.
4515 Based on an example by Michiel De Wilde.
4516
1fa5d8bb
AD
45172008-11-03 Akim Demaille <demaille@gostai.com>
4518
4519 Parameterize the extraction of semantic values.
4520 To make future changes easier, no longer rely on ".TYPE" being the
4521 way to get a semantic value.
de62edee 4522
1fa5d8bb
AD
4523 * data/c.m4 (b4_symbol_value): New.
4524 Use it.
4525 * data/c++.m4, data/yacc.c: Use it.
4526 * data/glr.c: Use b4_symbol_value.
4527 (b4_rhs_data): New.
4528 Use it.
4529
91ba8a55
AD
45302008-11-03 Akim Demaille <demaille@gostai.com>
4531
4532 Prepare easier M4 changes.
4533 * data/lalr1.cc: Use escaped [] instead of literals to prepare
4534 future changes.
4535
c9ba9e59
JD
45362008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4537
4538 Initiate further development.
4539 * NEWS: Create an empty section for new entries.
4540 * gnulib: Update submodule to HEAD.
4541
bfb40910
JD
45422008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4543
4544 * NEWS: Version 2.4.
4545
241fda7a
JD
45462008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4547
4548 Prepare for next release.
4549 * NEWS: Briefly mention changes since 2.3b.
4550 * README: Say GNU m4 1.4.6, which we've been requiring in release
4551 announcements already, not 1.4.3, which breaks the build.
4552
ed4d67dc
JD
45532008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4554
4555 Say %language is experimental.
4556 We're thinking of extending it's effect on output file naming. See the
4557 thread at
4558 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
4559 * NEWS: Say it's experimental.
4560 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
4561 recommend it over %skeleton for now.
4562 (Bison Options): Likewise.
4563 (C++ Bison Interface): Use %skeleton not %language.
4564 (Calc++ Parser): Use %skeleton not %language.
4565 * src/getargs.c (usage): Say it's experimental.
4566
e254a580
DJ
45672008-11-01 Di-an Jan <dianj@freeshell.org>
4568 Paolo Bonzini <bonzini@gnu.org>
4569
4570 Support all Java parser class modifiers.
4571 * data/java.m4 (b4_percent_define_get3): New.
4572 (b4_final_if, b4_strictfp_if): New.
4573 * data/lalr1.java (final, strictfp, extends, implements): Support.
4574 * doc/bison.texinfo (final, strictfp, extends, implements): Add
4575 documentation.
4576 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
4577 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
4578 (AT_CHECK_JAVA_GREP): New.
4579 (Java parser class modifiers): New test.
4580 (Java parser class extends and implements): New test.
4581
4582 Model exception propagation better with throws and lex_throws.
4583 * data/java.m4 (b4_list2): New.
4584 (throws): Change default.
4585 * data/lalr1.java (yyaction): Add throws.
4586 (parse): Add lex_throws in addition to throws.
4587 * doc/bison.texinfo (throws, lex_throws): Add documentation.
4588 * tests/java.at (Java throws specifications): New test.
4589
4590 Improve documentation for Java parsers.
4591 * doc/bison.texinfo (Java Parsers): Add subsections.
4592 Don't quote first argument of %define.
4593 (Java Bison Interface): Document output files. Move documentation
4594 of parser class and merge into Java Parser Interface. Document
4595 features that error out. Document directives with no effect.
4596 Move note about Javadoc higher.
4597 (Java Semantic Values): Explicitly mention stype.
4598 Document that generic types cannot be used.
4599 (Java Location Values): Use @deftypeivar. Document constructors.
4600 Correct return value for toString.
4601 (Java Parser Interface): List undocumented constants/fields.
4602 Move documentation of fields added by %parse-param closer to list
4603 of members. Document that token names are added as fields.
4604 Document constructors accurately. Remove error method.
4605 (Java Scanner Interface): Move note on %pure-parser to Java Bison
4606 Interface. Describe %code lexer and yylex accutately.
4607 Remove documentation that does not match the code.
4608 (Java Action Features): New.
4609 (Java Differences): Add reference. Add item on semantic values.
4610 Add note about @{ ... @}. Clarify %% epilogue placement.
4611 (Java Declarations Summary): New.
4612
4613 Fix Java skeleton.
4614 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
4615 (b4_remove_comma): Quote test argument.
4616 (b4_identification): Remove "bison" field.
4617 * tests/java.at (Java parser class and package names): New test.
4618 (Java %parse-param and %lex-param): New test.
4619 (Java stype, position_class and location_class): New test.
4620
f259e4e6
PB
46212008-10-31 Di-an Jan <dianj@freeshell.org>
4622
4623 * data/lalr1.jave: Update copyright years.
4624 (YYParser): Correct name of "generated from" file in Javadoc:
4625 use b4_file_name instead of @ofile@.
4626 (Location constructor): Correct Javadoc parameter name.
4627 (yylloc): Add missing opening m4 quote after b4_location_if.
4628 This removes a stray [ in the Javadoc of Lexer.getStartPos.
4629 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
4630 (YYParser constructor): Correct Javadoc parameter name.
4631
cae5057f
JD
46322008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
4633
4634 Always put auxiliary code files in the same dir as other output files.
4635 * src/files.c (compute_file_name_parts): When the user specifies
4636 --output but not --file-prefix, extract the directory prefix from the
4637 file prefix not from the grammar file name. This affects the location
4638 of files like location.hh generated by the C++ skeleton. The includes
4639 in the other output files require this fix.
4640 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
4641 for expected output files.
4642 (Output files): Add a test for the above.
4643
4af432ba
JD
46442008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
4645
4646 * gnulib: Update submodule to HEAD.
4647
e26d4e43
JD
46482008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4649
4650 Update copyright year.
4651 * src/files.c: Here.
4652
c0ee9e21
DJ
46532008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
4654
4655 Don't overwrite the input file.
4656 * src/files.c (output_file_name_check): Fatal error if using input file
4657 for output.
4658 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
4659 argument.
4660 (Conflicting output files): Add test.
4661
482dc52f
AD
46622008-10-28 Akim Demaille <demaille@gostai.com>
4663
4664 Space changes.
4665 * data/lalr1.cc: Formatting changes.
4666
52cbbe84
AD
46672008-10-28 Akim Demaille <demaille@gostai.com>
4668
4669 Don't define debugging functions when !YYDEBUG.
4670 * data/lalr1.cc (debug_stream, set_debug_stream)
4671 (debug_level_type, debug_level, set_debug_level): Don't
4672 declare them when YYDEBUG is not defined.
4673 The implementation are already YYDEBUG-aware.
4674
0925d5bf
AD
46752008-10-28 Akim Demaille <demaille@gostai.com>
4676
4677 Prefer "continue" for empty loop bodies.
4678 * etc/bench.pl.in: Use "continue" instead of {}.
4679
cf98343c
AD
46802008-10-28 Akim Demaille <demaille@gostai.com>
4681
4682 Space and comments changes.
4683 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
4684 * data/c.m4, data/lalr1.cc: Space changes.
4685
9f467b7d
AD
46862008-10-28 Akim Demaille <demaille@gostai.com>
4687
4688 Make gnulib a submodule.
4689 * gnulib: New.
4690 * .gitmodules (gnulib): New.
4691
0f0e1ace
JD
46922008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4693
4694 Fix yyerror_range for user-defined location type in C++. Reported by
4695 Georg Sauthoff at
4696 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
4697 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
4698 * THANKS (Georg Sauthoff): Add.
4699
548e2104
JD
47002008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4701
4702 Update several administrative files mainly to facilitate releasing.
4703 * HACKING (Administrivia): Make the git-merge-changelog notes more
4704 helpful.
4705 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
4706 (Release Procedure): Update for git and add numerous details that were
4707 previously missing.
4708 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
4709 * maint.mk (announcement): Don't list bison as a bootstrap tool so
4710 that announcements don't claim we bootstrapped with whatever bison
4711 happened to be in PATH. Add flex as a bootstrap tool.
4712 * Makefile.maint: Remove, previously replaced by maint.mk.
4713 * Makefile.cfg: Remove, and migrate settings to...
4714 * cfg.mk: ... here for the sake of `make announcement'.
4715 * bootstrap.conf (gnulib_modules): Add announce-gen.
4716 * README: Say GNU Bison instead of just Bison. Suggested by Karl
4717 Berry.
4718
ddf17a6e
PB
47192008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
4720
4721 Small but important bugfixes for the Java skeleton.
4722 * data/lalr1.java (yyerror): Change Location to b4_location_type.
4723 (yy_symbol_print): Call toString on yyvaluep.
4724
e1145ad8
AD
47252008-08-29 Akim Demaille <demaille@gostai.com>
4726
4727 Clarify UPDATED use.
215b40ac 4728 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 4729 not to the release date of Bison.
215b40ac 4730 Reported by Joel E. Denny.
e1145ad8 4731
0df72d78
AD
47322008-08-29 Akim Demaille <demaille@gostai.com>
4733
4734 * README: Update FAQ pointer.
4735 Reported by Joel E. Denny.
4736
9a90b6bb
EB
47372008-08-27 Eric Blake <ebb9@byu.net>
4738
4739 Resync m4sugar from autoconf.
4740 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
4741 (m4_init): Adjust to latest m4.git changes.
4742 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
4743 effects.
4744 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
4745 (_m4_list_cmp): Reduce side effects.
4746
65015668
AD
47472008-08-27 Akim Demaille <demaille@gostai.com>
4748
4749 Check yyerrok in calc.at.
215b40ac
EB
4750 * tests/calc.at (calc.y): Use yyerrok on "( error )".
4751 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
4752 expected.
65015668 4753
98e26a92
AD
47542008-08-27 Akim Demaille <demaille@gostai.com>
4755
4756 Support yyerrok in lalr1.cc.
4757 YYBACKUP is still to import back into lalr1.cc.
215b40ac 4758 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 4759
86c0e784
JD
47602008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4761
4762 For maintainer-check*, don't recompile for a $(VERSION) update.
4763 * cfg.mk: New file.
4764 (_is-dist-target): Override the one in GNUmakefile.
4765 * Makefile.am (EXTRA_DIST): Add cfg.mk.
4766
88511166
JD
47672008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4768
4769 Update for recent change to gnulib.
4770 * src/parse-gram.y: Don't include strverscmp.h. It comes from
4771 string.h now.
4772
6bbb2ed5
EB
47732008-08-15 Eric Blake <ebb9@byu.net>
4774
d67c52e8
EB
4775 Remaining m4sugar merge from autoconf.
4776 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
4777 * data/m4sugar/foreach.m4: New file, copied from autoconf.
4778 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
4779 * src/output.c (output_skeleton): Tell m4 how to find it.
4780
6bbb2ed5
EB
4781 Partial m4sugar merge from autoconf: m4_map.
4782 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
4783 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
4784 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
4785 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
4786 for empty list.
4787 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
4788 Likewise.
4789 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
4790 declares it.
4791
8dce3875
JD
47922008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
4793
4794 Keep .version and PACKAGE_VERSION in sync.
4795 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
4796 dependency, and add comments justifying this in more detail. Discussed
4797 starting at
4798 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
4799
882a1fbf
EB
48002008-08-06 Eric Blake <ebb9@byu.net>
4801
a3764451
EB
4802 Partial m4sugar merge from autoconf: m4_shiftn.
4803 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
4804 (m4_shift2, m4_shift3): New macros.
4805 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
4806 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
4807 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
4808 * data/java.m4 (b4_remove_comma): Likewise.
4809
882a1fbf
EB
4810 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
4811 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
4812 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
4813 (m4_init): Consolidate wrapped text into single m4_wrap.
4814 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
4815 in wrapped text.
4816
a30e920d
EB
48172008-08-05 Eric Blake <ebb9@byu.net>
4818
dfcc5959
EB
4819 Partial m4sugar merge from autoconf: builtins, version.m4.
4820 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
4821 (m4_prepend): Remove, as it is unused and inherently quadratic,
4822 whereas m4_append is linear in newer m4.
4823 (m4_mkstemp): New builtin.
4824 (m4_symbols): Make rename conditional.
4825 (m4_version_prereq): Ensure fatal error if used in bison, which
4826 intentionally lacks version.m4.
4827
a30e920d
EB
4828 Fix comments in m4sugar.
4829 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
4830
445b7470
JD
48312008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4832
4833 Update for recent .gitignore fix in Gnulib.
4834 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
4835 anchored .gitignore entries.
4836
a1e50014
JD
48372008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4838
4839 Set gnu or gnits strictness.
4840 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
4841 development and gnits strictness for releases. Based on Eric Blake's
4842 suggestion at
4843 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
4844
d43f77e7
PB
48452008-07-31 Paolo Bonzini <bonzini@gnu.org>
4846
4847 * NEWS: Clarify documentation of %language.
4848
fee2ed87
PB
48492008-07-31 Paolo Bonzini <bonzini@gnu.org>
4850
4851 Support usage of git-merge-changelog.
4852 * .gitattributes: New.
4853 * HACKING: Document usage of git-merge-changelog.
4854 * bootstrap: Install git-merge-changelog entries in .git/config
4855 if appropriate.
4856
78029cd5
JD
48572008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4858
4859 Remove remaining dependence on CVS Id keyword.
4860 * ChangeLog: For the sake of people still using CVS, don't use dollars
4861 when mentioning Id.
4862 * data/xslt/bison.xsl: Remove Id from header comments, where it was
4863 unusual anyway.
4864 * data/xslt/xml2dot.xsl: Likewise.
4865 * data/xslt/xml2text.xsl: Likewise.
4866 * data/xslt/xml2xhtml.xsl: Likewise.
4867 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
4868 * doc/Makefile.am (neutralize): Remove, no longer needed.
4869 (.x.1): Don't use neutralize.
4870 (edit): Don't substitute for ID.
4871 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
4872
c53d18b1
JD
48732008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4874
4875 Fix dependence on computed configure variables.
4876 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
4877 $(top_srcdir)/configure.ac so that changes to computed variables, such
4878 as PACKAGE_VERSION, are seen.
4879 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
4880
5523ac79
JD
48812008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
4882
4883 Update copyright dates for recent changes.
4884 * Makefile.am: Here.
4885 * src/Makefile.am: Here.
4886 * src/reduce.c: Here.
4887 * tests/reduce.at: Here.
4888
8fa36911
JD
48892008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
4890
4891 Use git-version-gen for version names between releases.
4892 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
4893 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
4894 * .prev-version: New.
4895 * .version.in: Remove.
78029cd5 4896 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
4897 revision.
4898 * GNUmakefile: Remove, now copied from Gnulib.
4899 * Makefile.am: Add code suggested by comments in
4900 build-aux/git-version-gen.
4901 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
4902 .prev-version, and .version.
4903 * NEWS (2.3b+): Rename to...
4904 (?.?): ... this because we're dropping the "+" version naming scheme,
4905 but, in general, we still can't be sure of our next release name.
4906 * bootstrap: Add a quick hack to remove from .gitignore the
4907 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
4908 entry. This should really be fixed in gnulib instead.
4909 * bootstrap.conf (gnulib_modules): Add gnumakefile.
4910 * configure.ac (AC_INIT): Set version name by invoking
4911 build-aux/git-version-gen.
4912 (AC_CONFIG_FILES): Remove .version, now generated by
4913 build-aux/git-version-gen.
4914 * maint.mk: New, copied from coreutils.
4915 * doc/.cvsignore (bison.1): Add.
4916 * doc/.gitignore (/bison.1): Add.
4917 * doc/bison.1: Remove, generated.
4918 * src/.cvsignore (revision.c): Remove.
4919 * src/.gitignore (/revision.c): Remove.
4920 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
4921 (BUILT_SOURCES): Remove revision.c.
4922 (revision.c): Remove.
4923 * src/getargs.c (version): Don't print revision after the VERSION.
4924 * src/revision.h: Remove.
4925
bcf07cb7
JD
49262008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4927
4928 Fix untranslatable composition of sentences. Reported by Goran
4929 Uddeborg at
4930 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
4931 * THANKS (Goran Uddeborg): Add.
4932 * src/reduce.c (reduce_print): Report the number of nonterminals and
4933 rules useless in the grammar in separate sentences.
4934 * tests/reduce.at (Useless Rules): Update output.
4935 (Reduced Automaton): Likewise.
4936 (Underivable Rules): Likewise.
4937 (Empty Language): Likewise.
4938
9aacab9a
JD
49392008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4940
4941 Fix some .gitignore and .cvsignore problems.
4942 * bootstrap (insert_sorted_if_absent): Replace all uses with...
4943 (insert_vc_ignore): ... this new function, which prepends `/' to all
4944 .gitignore entries before passing them to insert_sorted_if_absent.
4945 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
4946 .cvsignore files are maintained even though Bison developers run
4947 bootstrap while using Git.
4948 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
4949 unneeded by Bison.
4950 (gnulib): Add.
4951 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
4952 unneeded. Reported by Eric Blake.
4953 * lib/.gitignore (/*~): Add.
4954 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
4955 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
4956 Blake.
4957 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
4958
a9fc7990
JD
49592008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4960
4961 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
4962 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
4963 * bootstrap.conf (gnulib_modules): Add unsetenv.
4964 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
4965 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
4966 (/setenv.m4): Add.
4967 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
4968 the first argument because it may become position-dependent, and unset
4969 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
4970 Add comments explaining these issues in more detail.
4971
0f1d6f10
JD
49722008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
4973
4974 Add .gitignore everywhere based on .cvsignore.
4975 * .gitignore: New.
4976 * build-aux/.gitignore: New.
4977 * data/.gitignore: New.
4978 * doc/.gitignore: New.
4979 * etc/.gitignore: New.
4980 * examples/.gitignore: New.
4981 * examples/calc++/.gitignore: New.
4982 * lib/.gitignore: New.
4983 * m4/.gitignore: New.
4984 * po/.gitignore: New.
4985 * runtime-po/.gitignore: New.
4986 * src/.gitignore: New.
4987 * tests/.gitignore: New.
4988
7bd1665a
JD
49892008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4990
4991 * NEWS (2.3b+): New section, empty for now.
4992 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
4993
72c5b982
JD
49942008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4995
4996 * NEWS (2.3b): Update release date since there has been a delay in
4997 getting the announcements and tarballs out.
4998
bd02cd5d
JD
49992008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5000
5001 * NEWS: Version 2.3b.
5002 * configure.ac (AC_INIT): Likewise.
5003 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
5004
9126263e
JD
50052008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5006
5007 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
5008 been doing it for years.
5009 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
5010 (Release Procedure): Add FIXME about make alpha being unmaintained.
5011
fa6aa7b3
JD
50122008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
5013
5014 * data/yacc.c: Reformat m4 a little for readability.
5015 * src/lalr.c (build_relations): Correct comment.
5016
d30b312d
JMG
50172008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5018
5019 DJGPP specific issue.
5020 * djgpp/config.sed: Fixes required to run configure scripts generated
5021 by autoconf 2.62.
5022
138d4cd9
JD
50232008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5024
5025 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
5026 coordinator@translationproject.org.
5027
8f7e2e1f
JD
50282008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5029
5030 * THANKS: Add Eric Blake.
5031
f55efa38
JD
50322008-04-23 Eric Blake <ebb9@byu.net>
5033
5034 Revert prior patch, by working around autoconf regression.
5035 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
5036 ("Output file name: ("): Uncomment test.
5037 ("Output file name: )"): Likewise.
5038 Based on an idea from Noah Misch.
5039
096c9f9d
JD
50402008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5041
5042 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
5043 2.61. Reported by Juan Manuel Guerrero at
5044 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
5045 * tests/output.at ("Output file name: ("): Comment out test case for
5046 now.
5047 ("Output file name: )"): Likewise.
5048
0f664b89
JD
50492008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5050
5051 * GNUmakefile: Update git-version-gen invocation so make dist
5052 succeeds.
5053
1cfe6375
JD
50542008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5055
5056 Update to the current gnulib CVS repository, and fix trigraph handling
5057 in Bison.
5058 * bootstrap: Update gnulib CVS repository URL.
5059 (symlink_to_dir): Encapsulate the code that guarantees the destination
5060 directory exists into...
5061 (check_dst_dir): ... this new function, and...
5062 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
5063 fail when copying files into lib/uniwidth/.
5064 * src/output.c (prepare_symbols): When writing yytname muscles, where
5065 symbol names will be encoded in C-string literals, tell quotearg to
5066 escape trigraphs. This used to be the default in gnulib.
5067 * tests/regression.at (Token definitions): Because of the change in
5068 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
5069 escapes trigraphs in symbol names. Thus, yytname no longer has
5070 trigraphs unnecessarily doubly escaped. Update test case output.
5071 Extend test case to be sure Bison's own error messages will no longer
5072 have trigraphs in symbol names unnecessarily escaped once.
5073
74c52fc8
JD
50742008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
5075
5076 Fix make dist infinite loop reported by Juan Manuel Guerrero at
5077 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
5078 * .cvsignore: Add .version.
5079 * .version.in: New.
5080 * bootstrap.conf (gnulib_modules): Add git-version-gen.
5081 * configure.ac (AC_CONFIG_FILES): Add .version.
5082 * build-aux/.cvsignore: Add git-version-gen.
5083
8e55b3aa
JD
50842008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5085
5086 * NEWS (2.3a+): Mention that -g now takes an argument.
5087 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
5088 consistency. Update the -g and -x entries now that they take
5089 arguments. Use brackets to indicate optional arguments.
5090 * src/getargs.c (usage): Explain the relationship between arguments of
5091 long and short options more completely. Document --defines and -d
5092 separately since the former takes an argument but, for POSIX Yacc, the
5093 latter does not.
5094 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 5095 (getargs): Sort cases.
8e55b3aa 5096
59c5ac72
AD
50972008-02-28 Akim Demaille <demaille@gostai.com>
5098
5099 * doc/bison.texinfo: Fix a few typos.
5100
118d4978
AD
51012008-02-28 Akim Demaille <akim@epita.fr>
5102
5103 * doc/bison.texinfo (Bison Options): Document -W.
5104 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
5105
7020f1e9
AD
51062008-02-28 Akim Demaille <akim@epita.fr>
5107
5108 * src/getargs.c (short_options): Split and sort for readability.
5109 -g and -x take optional arguments, just like their long options.
5110 * build-aux/cross-options.pl: Use /x to make the regexp easier to
5111 understand.
5112 Fix the handling of $opt which resulted in all the argument to be
5113 considered as optional.
5114
59da312b
JD
51152008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
5116
5117 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
5118 say its interface is experimental.
5119 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5120 Java.
5121 (Bison Options): In the -L and --language entry, mention Java.
5122 (Java Bison Interface): Say the interface is experimental.
5123 * src/getargs.c (usage): Mention -L and --language.
5124
5125 * NEWS (2.3a+): Say the push parsing interface is experimental.
5126 * doc/bison.texinfo (Push Decl): Likewise.
5127 (Decl Summary): Likewise in the "%define api.push_pull" entry.
5128 (Push Parser Function): Likewise.
5129 (Pull Parser Function): Likewise.
5130 (Parser Create Function): Likewise.
5131 (Parser Delete Function): Likewise.
5132 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
5133 yypull_parse, and yypush_parse entries.
5134
5135 * NEWS (2.3a+): Mention XML support, and say the schema is
5136 experimental.
5137 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
5138 * src/getargs.c (usage): Say the XML schema is experimental.
5139
5140 * NEWS (2.3a+): Say option instead of flag.
5141
2bb3ebec
WP
51422008-02-21 Wojciech Polak <polak@gnu.org>
5143
5144 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
5145 text.
5146
333e670c
JD
51472008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
5148
5149 Fix impure push parser compile error reported by Bob Rossi at
5150 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
5151 * data/yacc.c: Clean up whitespace in the output a little.
5152 (yypstate_allocated): Define for impure push parsers regardless of
5153 whether the pull interface is also requested.
5154 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
5155 check impure push parsers without the pull interface.
5156
5157 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
5158 yyerror takes arguments specified by %parse-param while yypstate_new
5159 does not.
5160 * doc/bison.texinfo (Parser Create Function): Document that
5161 yypstate_new returns 0 for multiple impure parser instances.
5162 * tests/push.at (Push Parsing: Multiple impure instances): Update
5163 expected stderr output.
5164
798096e1
JD
51652008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5166
5167 * runtime-po/POTFILES.in (push.c): Remove.
5168
9ca7f077
JD
51692008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5170
5171 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
5172 * data/push.c: Rename to...
5173 * data/yacc.c: ... this, overwriting it.
5174 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
5175 `%push-pull-parser' -> `%define api.push_pull "both"'.
5176 Remove old yacc.c tests, and update push.c tests to yacc.c.
5177
42ee26bb
JD
51782008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5179
5180 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
5181 `"%code top" blocks' instead of `%code "top" blocks'.
5182 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
5183 Clean up whitespace in the output a little.
5184
b1cc23c4
JD
51852008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5186
5187 Fix documentation problems reported by Tim Josling at
5188 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
5189 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
5190 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
5191 integers. Explain the effect of literal string aliases on error
5192 messages. Copy token 0 documentation from the C++ skeleton
5193 documentation.
5194
ab7f29f8
JD
51952008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5196
5197 Accept a token number in a %left, %right, or %nonassoc for POSIX
5198 conformance. Reported by Tim Josling at
5199 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
5200 * NEWS (2.3a+): Mention.
5201 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
5202 and code numbers are treated by precedence declarations.
5203 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
5204 of symbols.1.
5205 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
5206 of symbol.
5207 (symbol.prec): New, just like symbol but allows INT.
5208 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
5209 longer holds.
5210 * tests/regression.at (Token number in precedence declaration): New
5211 test case.
5212
a924ef36
JMG
52132008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5214
5215 DJGPP specific issues.
5216 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
5217 be changed. Copyright timestamp adjusted.
5218 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
5219 be changed. Copyright timestamp adjusted.
5220 * djgpp/config.site: Copyright timestamp adjusted.
5221 * djgpp/config_h.sed: Copyright timestamp adjusted.
5222 * djgpp/djunpack.bat: Copyright timestamp adjusted.
5223 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
5224 filename translation list.
5225 * djgpp/subpipe.c (init_subpipe): Check the environment variables
5226 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
5227 files shall be created. Before trying to use the temp dir where the
5228 environment variable points to check that the dir really exists. If
5229 not default to the cwd as temp dir. Copyright timestamp adjusted.
5230 * djgpp/subpipe.h: Copyright timestamp adjusted.
5231 * djgpp/testsuite.sed: Copyright timestamp adjusted.
5232
389c8cfd
PE
52332008-01-30 Paul Eggert <eggert@cs.ucla.edu>
5234
5235 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
5236
5d1cfef4
PE
52372008-01-09 Paul Eggert <eggert@cs.ucla.edu>
5238
5239 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
5240 Problem reported by Claudio Saavedra in
5241 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
5242
e2dcf996
WP
52432008-01-05 Wojciech Polak <polak@gnu.org>
5244
5245 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
5246 document's title with the input grammar file name.
5247
da730230
JD
52482007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
5249
5250 Automate regression testing of the XML/XSLT implementation. Discussed
5251 starting at
5252 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
5253 * configure.ac (XSLTPROC): New substitution.
5254 * Makefile.am (maintainer-xml-check): New phony target invoking...
5255 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
5256 invoking make maintainer-check with BISON_TEST_XML=1.
5257 * tests/atlocal.in (XSLTPROC): New.
5258 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
5259 not to report reachable memory when Bison is expected to have a
5260 non-zero exit status and (2) to compare XML/XSLT output with --graph
5261 and --report=all output for every working grammar when
5262 BISON_TEST_XML=1.
5263 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
5264 (AT_BISON_CHECK_XML): New.
5265 (AT_QUELL_VALGRIND): New.
5266 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
5267 (AT_CHECK): ... don't redefine this since this was the old way to
5268 quell Valgrind.
5269 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
5270 AT_BISON_CHECK invocations.
5271 * tests/c++.at: Likewise.
5272 * tests/calc.at: Likewise.
5273 * tests/conflicts.at: Likewise.
5274 * tests/cxx-type.at: Likewise.
5275 * tests/existing.at: Likewise.
5276 * tests/glr-regression.at: Likewise.
5277 * tests/headers.at: Likewise.
5278 * tests/input.at: Likewise.
5279 * tests/java.at: Likewise.
5280 * tests/output.at: Likewise.
5281 * tests/push.at: Likewise.
5282 * tests/reduce.at: Likewise.
5283 * tests/regression.at: Likewise.
5284 * tests/sets.at: Likewise.
5285 * tests/skeletons.at: Likewise.
5286 * tests/synclines.at: Likewise.
5287 * tests/torture.at: Likewise.
5288 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
5289 tends to hang xsltproc.
5290 (Big horizontal): Likewise.
5291
408476bc
JD
52922007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5293
5294 In XML output, remove redundant class attribute on symbol element.
5295 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
5296 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
5297 look up a symbol to determine whether it's a nonterminal or terminal.
5298 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
5299 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
5300
5301 Add prec/assoc information to XML output.
5302 * src/gram.c (grammar_rules_print_xml): For each rule that has a
5303 %prec, add a percent_prec attribute.
5304 * src/print-xml.c (print_grammar): For each terminal that has a
5305 precedence or associativity, add a prec or assoc attribute.
5306 (xml_indent): New.
5307 (xml_puts): Use xml_indent.
5308 (xml_printf): Use xml_indent.
5309 * src/print-xml.h (xml_indent): Prototype.
5310
5311 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
5312 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5313
d4a26c48
JD
53142007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5315
5316 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
5317 (bison:ruleByNumber): ... this for clarity.
5318 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
5319 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
5320 (xsl:template match="reduction"): Update.
5321 (xsl:template match="item"): Update.
5322 (xsl:template match="reduction"): Update.
5323
5324 In the XML output, don't print the list of rules where symbols appear.
5325 Compute it in XSLT instead. Discussed at
5326 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
5327 * data/xslt/bison.xsl (bison:ruleByLhs): New.
5328 (bison:ruleByRhs): New.
5329 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
5330 bison:ruleByRhs.
5331 (xsl:template match="terminal/rule"): Remove.
5332 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5333 bison:ruleByRhs.
5334 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5335 Remove.
5336 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
5337 bison:ruleByRhs and mode="number-link" for rule template.
5338 (xsl:template match="terminal/rule"): Remove.
5339 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5340 bison:ruleByRhs and mode="number-link" for rule template.
5341 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5342 Rewrite as...
5343 (xsl:template match="rule" mode="number-link"): ... this.
5344 * src/print-xml.c (print_grammar): Don't print the list of rules.
5345
ef1b4273
JD
53462007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5347
5348 Don't let --report affect XML output; always print all information.
5349 Discussed at
5350 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
5351 * src/conflicts.c (log_resolution): Implement.
5352 * src/print-xml.c (print_core): Implement.
5353 (print_state): Implement.
5354 (print_xml): Implement.
5355
5356 * NEWS (2.3a+): Fix quotes.
5357 * src/parse-gram.y (prologue_declaration): For consistency with -v,
5358 don't let %verbose clear the list specified by --report.
5359
0f6cd9e3
AD
53602007-11-26 Akim Demaille <akim@epita.fr>
5361
5362 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
5363
d80fb37a
JD
53642007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
5365
5366 In the XML output, list useless and unused symbols and rules with the
5367 useful ones and add a "usefulness" attribute. Discussed starting at
5368 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
5369 * src/gram.c (grammar_rules_partial_print_xml): Remove.
5370 (grammar_rules_print_xml): Print all rules instead of just those
5371 useful in the grammar, and add a "usefulness" attribute.
5372 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
5373 * src/print-xml.c (print_rules_useless_in_parser): Remove.
5374 (print_grammar): Print all nonterminals instead of just useful ones,
5375 and add a "usefulness" attribute to nonterminals and terminals.
5376 (print_xml): Don't print a separate "reductions" or
5377 "rules-useless-in-parser" element.
5378 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
5379 (reduce_xml): Remove.
5380 (reduce_token_unused_in_grammar): New.
5381 (reduce_nonterminal_useless_in_grammar): New.
5382 * src/reduce.h (reduce_xml): Remove prototype.
5383 (reduce_token_unused_in_grammar): Add prototype.
5384 (reduce_nonterminal_useless_in_grammar): Add prototype.
5385 * data/xslt/xml2text.xsl: Update for XML changes.
5386 * data/xslt/xml2xhtml.xsl: Update for XML changes.
5387 * tests/reduce.at (Useless Terminals): Update output.
5388 (Useless Rules): Update output.
5389 (Reduced Automaton): Update output.
5390
5391 Say "Terminals unused in grammar" instead of "Unused terminals".
5392 * NEWS (2.3a+): Update.
5393 * doc/bison.texinfo (Understanding): Update example output.
5394 * src/reduce.c (reduce_output): Implement.
5395 * data/xslt/xml2text.xsl: Implement.
5396 * data/xslt/xml2xhtml.xsl: Implement.
5397
1bb2bd75
JD
53982007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
5399
5400 Accept --report-file=FILE to override the default `.output' filename.
5401 * NEWS (2.3a+): Mention.
5402 * doc/bison.texinfo (Bison Options): Add an entry.
5403 * src/files.c (compute_output_file_names): Don't override
5404 spec_verbose_file if already set.
5405 * src/getargs.c (usage): Document --report-file.
5406 (REPORT_FILE_OPTION): New anonymous enum member.
5407 (long_options): Add entry for it.
5408 (getargs): Add case for it setting spec_verbose_file.
5409
5410 * build-aux/cross-options.pl: Don't record a short option just because
5411 there's an arg.
5412 * doc/.cvsignore: Add yacc.1.
5413
a005a9c4
AD
54142007-11-14 Akim Demaille <akim@epita.fr>
5415
5416 * doc/yacc.1.in: New.
5417 * configure.ac, doc/Makefile.am: Adjust.
5418 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
5419 config.h symbol.
5420 Use AC_SUBST for assignments too.
5421 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
5422
cff03fb2
JD
54232007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5424
5425 * src/gram.c: Remove comments that duplicate comments in gram.h.
5426
5427 When reporting useless rules and nonterminals, say "useless in grammar"
5428 instead of "useless", and say "useless in parser" instead of "never
5429 reduced". Discussed starting at
5430 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
5431 * NEWS (2.3a+): Mention this change.
5432 * data/xslt/xml2text.xsl: Update output text and expected input XML
5433 element names to match changes below.
5434 * data/xslt/xml2xhtml.xsl: Likewise.
5435 (xsl:template match="bison-xml-report"): Add missing entry in Table of
5436 Contents: "Rules useless in parser due to conflicts".
5437 * doc/bison.texinfo (Decl Summary): Reword a little.
5438 (Understanding): Update example output for changes below.
5439 * src/gram.c: (rule_useful_p): Rename to...
5440 (rule_useful_in_grammar_p): ... this.
5441 (rule_useless_p): Rename to...
5442 (rule_useless_in_grammar_p): ... this.
5443 (rule_never_reduced_p): Rename to...
5444 (rule_useless_in_parser_p): ... this.
5445 (grammar_rules_print): Update for renames.
5446 (grammar_rules_print_xml): Update for renames.
5447 (grammar_rules_never_reduced_report): Rename to...
5448 (grammar_rules_useless_report): ... this since it is used for either
5449 kind of useless rule.
5450 * src/gram.h: Reword comments and update function names in prototypes.
5451 * src/main.c (main): Say "rule useless in parser due to conflicts".
5452 * src/print-xml.c (print_rules_never_reduced): Rename to...
5453 (print_rules_useless_in_parser): ... this, and rename output XML
5454 element "rules-never-reduced" to "rules-useless-in-parser".
5455 (print_xml): Update for rename.
5456 * src/print.c (print_results): Say "Rules useless in parser due to
5457 conflicts".
5458 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
5459 (nonterminals_reduce): Say "nonterminal useless in grammar".
5460 (reduce_output): Say "Nonterminals useless in grammar".
5461 Say "Rules useless in grammar".
5462 (reduce_xml): Rename output XML element "useless" to
5463 "useless-in-grammar".
5464 (reduce_print): Don't report the count of grammatically useless rules
5465 as "rules never reduced" just because %yacc is specified.
5466 In the correct report of this count, say nonterminal(s) and rule(s)
5467 "useless in grammar".
5468 * tests/conflicts.at (S/R in initial): Update expected output.
5469 (Defaulted Conflicted Reduction): Likewise.
5470 (Unreachable States After Conflict Resolution): Likewise.
5471 * tests/existing.at (GNU pic Grammar): Likewise.
5472 * tests/reduce.at (Useless Nonterminals): Likewise.
5473 (Useless Rules): Likewise.
5474 (Reduced Automaton): Likewise.
5475 (Underivable Rules): Likewise.
5476 (Empty Language): Likewise.
5477
66f0441d
JD
54782007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5479
5480 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
5481 here document and before the EOF so that BSD's implementation of Bourne
5482 shell doesn't parse the delimiter as part of the here document.
5483 * doc/.cvsignore: Add cross-options.texi.
5484 * src/getargs.c (usage): Add a blank line after the warning categories.
5485
d0ee4105
PB
54862007-11-08 Paolo Bonzini <bonzini@gnu.org>
5487
5488 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
5489
e8b1fb9b
AD
54902007-11-05 Akim Demaille <akim@epita.fr>
5491
5492 Remove Id: from bison.1.
5493 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
5494 (perl -0777 -pi -e 's/\.PP\nId): New.
5495 (.x.1): Use it to ignore the version control revision.
5496
2f7a96b5
AD
54972007-11-05 Akim Demaille <demaille@gostai.com>
5498
5499 * build-aux/Makefile.am: Ship cross-options.pl.
5500 * doc/Makefile.am: Always refer to cross-options.texi with
5501 $(srcdir).
5502 (MAINTAINERCLEANFILES): Add it.
5503
f4101aa6
AD
55042007-11-04 Akim Demaille <demaille@gostai.com>
5505
5506 Generate the long/short option cross-table.
5507 * build-aux/cross-options.pl: New.
5508 * doc/Makefile.am (cross-options.texi): New.
5509 * doc/bison.texinfo: Use it.
5510
727a1401
AD
55112007-11-04 Akim Demaille <demaille@gostai.com>
5512
5513 Generate bison.1 using help2man.
5514 * doc/common.x, doc/bison.x: New.
5515 * doc/Makefile.am (bison.1, .x.1): New.
5516 The code is taken from autoconf-2.61/man/Makefile.am.
5517 * configure.ac: Look for help2man.
5518
6aeb9c57
AD
55192007-11-04 Akim Demaille <demaille@gostai.com>
5520
5521 Complete --help.
5522 * src/getargs.c (usage): Document -W, make it clear that -d,
5523 -g and -x have optional arguments.
5524
d7be4085
AD
55252007-11-04 Akim Demaille <demaille@gostai.com>
5526
5527 Find sha1sum when named gsha1sum.
5528 * bootstrap (find_tool): New.
5529 ($SHA1SUM): New.
5530
d9df47b6
JD
55312007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5532
5533 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
5534 at
5535 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
5536 * NEWS (2.3a+): Mention.
5537 * data/bison.m4 (b4_pure_if): Don't define it here.
5538 * data/c.m4 (b4_identification): Depend on individual skeletons to
5539 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
5540 values of the %define variables api.pure or api.push_pull. Define
5541 YYPURE, YYPUSH, and YYPULL accordingly.
5542 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
5543 glr.cc has already defined b4_pure_flag.
5544 * data/push.c: Define b4_pure_if based on `%define api.pure'.
5545 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 5546 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
5547 * doc/bison.texinfo (Pure Decl): Update.
5548 (Push Decl): Update.
5549 (Decl Summary): Add api.pure to %define entry.
5550 In %pure-parser entry, say it's deprecated and reference %define.
5551 (Pure Calling): Update.
5552 (Error Reporting): Update.
5553 (C++ Scanner Interface): Update.
5554 (How Can I Reset the Parser): Update.
5555 (Table of Symbols): In %pure-parser entry, say it's deprecated and
5556 reference %define.
5557 * src/getargs.c (pure_parser): Remove global variable.
5558 * src/getargs.h (pure_parser): Remove extern.
5559 * src/output.c (prepare): Don't define pure_flag muscle.
5560 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
5561 wrapper around `%define api.pure'.
5562 * tests/calc.at (Simple LALR Calculator): Update.
5563 (Simple GLR Calculator): Update.
5564 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
5565 Update.
5566 (GLR: Resolve ambiguity, pure, locations): Update.
5567 (GLR: Merge conflicting parses, pure, no locations): Update.
5568 (GLR: Merge conflicting parses, pure, locations): Update.
5569 * tests/glr-regression.at (Uninitialized location when reporting
5570 ambiguity): Update
5571 * tests/input.at (Unused %define api.pure): New test case.
5572 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
5573 AT_PURE_IF and AT_PURE_AND_LOC_IF.
5574 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5575
c373bf8b
JD
55762007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5577
5578 %define push_pull -> %define api.push_pull. Discussed starting at
5579 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
5580 * data/push.c: Expect the new name.
5581 * data/yacc.c: Likewise.
5582 * doc/bison.texinfo (Push Decl): Update.
5583 (Decl Summary): Update %define entry.
5584 (Push Parser Function): Update.
5585 (Pull Parser Function): Update.
5586 (Parser Create Function): Update.
5587 (Parser Delete Function): Update.
5588 * tests/calc.at (Simple LALR Calculator): Update.
5589 * tests/input.at (%define enum variables): Update.
5590 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5591 (Push Parsing: Multiple impure instances): Update.
5592 (Push Parsing: Unsupported Skeletons): Update.
5593 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
5594 (Exploding the Stack Size with Malloc): Update.
5595
5596 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
5597 other entries some.
5598
32f19b6b
JD
55992007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
5600
5601 For the XML output's terminal element, rename @number to @token-number,
5602 and add @symbol-number. In the nonterminal element, rename @number to
5603 @symbol-number. Discussed starting at
5604 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
5605 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
5606 renames.
5607 (xsl:template match="nonterminal"): Likewise.
5608 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
5609 (xsl:template match="nonterminal"): Likewise.
5610 * src/print-xml.c (print_grammar): Implement.
5611
255a6b90
JD
56122007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5613
5614 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
5615 2007-10-11 change, the child elements here are items not rules.
408476bc 5616 (xsl:template match="item"): New.
255a6b90
JD
5617 (xsl:template match="rule"): Update for new reduced itemset.
5618 (xsl:template match="point"): Remove.
5619 (xsl:template match="empty"): For consistency with --graph, don't
5620 output "/* empty */".
5621 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
5622 line-wrap, don't pass a negative value as first-line-length since this
5623 won't work with the following changes.
5624 (xsl:template name="line-wrap"): Simplify slightly.
5625 (xsl:template name="ws-search"): Eliminate recursion.
5626 * src/print_graph.c (print_core): Don't print a reduction's lookahead
5627 set next to an item whose dot is not at the end of the RHS even if it
5628 happens to be associated with the same rule.
5629
88c78747
JD
56302007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5631
31984206
JD
5632 Add %define lr.keep_unreachable_states.
5633 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
5634 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
5635 * src/main.c (main): Implement it.
5636 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5637 Extend to test it, and fix a typo.
5638
56392007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5640
5641 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
5642 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
5643 the example .output text.
5644 * tests/regression.at (Extra lookahead sets in report): Improve wording
5645 of comments.
5646
b7a70162
WP
56472007-10-17 Wojciech Polak <polak@gnu.org>
5648
5649 * src/print-xml.c (print_grammar): Renamed
5650 <terminal> and <nonterminal> attributes:
5651 "type" to "number" and "symbol" to "name".
5652 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
5653 Use new attribute names.
5654 (xsl:template match="nonterminal"): Likewise.
5655 * data/xslt/xml2xhtml.xsl: Likewise.
5656
a0de5091
JD
56572007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
5658
5659 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
5660 (Option Cross Key): Likewise.
5661
5662 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
5663 next to an item whose dot is not at the end of the RHS even if it
5664 happens to be associated with the same rule.
5665 * src/print.c (print_core): Likewise.
5666 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
5667 (Resolved SR Conflicts): Update output.
5668 * tests/regression.at (Extra lookahead sets in report): New test case.
5669
4c20d18d
WP
56702007-10-11 Wojciech Polak <polak@gnu.org>
5671
5672 * src/print-xml.c (print_core): Remove item set
5673 redundancy.
5674 * data/xslt/bison.xsl (bison:ruleNumber): New key.
5675 Improve processing time. Suggested by Joel E. Denny.
5676 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
5677 Write xsl:param "required" attribute as comment.
5678 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
5679 (xsl:template match="rule"): Support new reduced itemset.
5680 (xsl:template match="point"): Remove.
5681 * data/xslt/xml2xhtml.xsl: Likewise.
5682
f506ad1c
JD
56832007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5684
5685 * src/getargs.c (version): Update copyright year.
5686
21f1b063
JD
56872007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5688
5689 Make xml2dot.xsl and --graph produce the same output.
5690 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
5691 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
5692 escaped later.
5693 (xsl:template name="output-node"): Use the new escape template instead
5694 of the string-replace template directly.
5695 (xsl:template name="output-edge"): Likewise.
5696 (xsl:template name="escape"): New, escapes backslashes and newlines in
5697 addition to quotation marks.
5698 * src/graphviz.c (start_graph, output_node, output_edge): Add
5699 whitespace to output for legibility.
5700
5701 Make xml2text.xsl and --report produce the same output, and remove the
5702 XML "conflicts" element since a conflict summary is easily extracted
5703 from the automaton.
5704 * data/xslt/bison.xsl: New.
5705 (xsl:template match="state" mode="bison:count-conflicts): New.
5706 * data/xslt/xml2text.xsl: Import bison.xsl.
5707 (xsl:template match="bison-xml-report"): Instead of styling the
5708 "conflicts" element, style the "automaton" element with mode
5709 "conflicts". Unlike the former, the latter lists S/R and R/R
5710 conflicts for a state on the same line.
5711 (xsl:template match="conflicts"): Remove.
5712 (xsl:template match="conflict"): Remove.
5713 (xsl:template match="terminal"): Line-wrap the list of rules in which
5714 the terminal is used.
5715 (xsl:template match="nonterminal"): Likewise for nonterminals.
5716 (xsl:template match="automaton" mode="conflicts"): New.
5717 (xsl:template match="state" mode="conflicts"): New.
5718 (xsl:template name="line-wrap"): New.
5719 (xsl:template name="ws-search"): New.
5720 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
5721 (xsl:template match="bison-xml-report"): Instead of styling the
5722 "conflicts" element, style the "automaton" element with mode
5723 "conflicts."
5724 (xsl:template match="conflicts"): Remove.
5725 (xsl:template match="conflict"): Remove.
5726 (xsl:template match="automaton" mode="conflicts"): New.
5727 (xsl:template match="state" mode="conflicts): New.
5728 * src/conflicts.c (conflicts_output_xml): Remove.
5729 * src/conflicts.h (conflicts_output_xml): Remove prototype.
5730 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
5731 * src/print.c (print_grammar): Consistently wrap at the 66th column so
5732 the corresponding XSLT is easier. Also, never wrap between a word and
5733 the comma that follows it.
5734
793fbca5
JD
57352007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5736
5737 Improve C++ namespace support. Discussed starting at
5738 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
5739 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
5740 b4_namespace_close): New macros that interpret the %define variable
5741 "namespace" so its value can contain "::" to indicate nested
5742 namespaces.
5743 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
5744 the above macros.
5745 * data/lalr1.cc (b4_namespace): Likewise.
5746 * data/location.cc (b4_namespace): Likewise.
5747 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
5748 inside a new table in the general %define entry. Document `%define
5749 namespace' there as well. Point the %name-prefix entry to it since it
5750 explains it more completely in the case of C++.
5751 (C++ Bison Interface): Mention `%define namespace' instead of
5752 %name-prefix.
5753 (Table of Symbols): Remove the `%define push_pull' entry. The %define
5754 entry suffices.
5755 * tests/c++.at (Relative namespace references): New test case.
5756 (Absolute namespace references): New test case.
5757 (Syntactically invalid namespace references): New test case.
5758 * tests/input.at (C++ namespace reference errors): New test case.
5759
35b8730d
JD
57602007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5761
5762 Add syncline support and location accessor to internal %define
5763 interfaces.
5764 * data/bison.m4 (b4_percent_define_get_loc): New.
5765 (b4_percent_define_get_syncline): New.
5766 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
5767 (b4_percent_define_default): Record defining location as line 1 rather
5768 than 0 for the sake of synchronizing #line's, and define
5769 b4_percent_define_syncline(VARIABLE).
5770 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
5771 * src/muscle_tab.c (muscle_syncline_grow): New.
5772 (muscle_code_grow): Use muscle_syncline_grow.
5773 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
5774 define b4_percent_define_syncline(VARIABLE).
5775 (muscle_percent_define_get_loc): New.
5776 (muscle_percent_define_get_syncline): New.
5777 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
5778 remove some unused variables.
5779 (muscle_percent_define_default): Record defining location as line 1
5780 rather than 0 for the sake of synchronizing #line's, and define
5781 b4_percent_define_syncline(VARIABLE).
5782 (muscle_percent_define_check_values): Use
5783 muscle_percent_define_get_loc.
5784 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
5785 (muscle_percent_define_get_syncline): Prototype.
5786 * tests/skeletons.at (%define Boolean variables: invalid skeleton
5787 defaults): Update output for location change.
5788 (Complaining during macro argument expansion): Extend to test
5789 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
5790
7dc4a694
JD
57912007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
5792
5793 Fix some error-reporting macro bugs.
5794 * data/bison.m4 (b4_cat): New.
5795 (b4_error, b4_error_at): Use b4_cat to send error directives directly
5796 to stdout so they don't become arguments to other macros. Update
5797 comments and add examples.
5798 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
5799 add examples.
5800 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
5801 after printing the error directive so that M4 doesn't report subsequent
5802 problems that are induced by this problem.
5803 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
5804 instead of just in them. Recognize @\n in both places. Both expand to
5805 the empty string. Needed by b4_cat.
5806 * tests/skeletons.at (Complaining during macro argument expansion):
5807 New test case.
5808 (Fatal errors make M4 exit immediately): New test case.
5809
d4bd2295
JD
58102007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
5811
5812 Implement --print-datadir.
5813 * src/getargs.c (usage): Mention.
5814 (PRINT_DATADIR_OPTION): New anonymous enum member.
5815 (long_options): Add entry for it.
5816 (getargs): Add case for it calling compute_pkgdatadir.
5817 * src/output.c (output_skeleton): Encapsulate data directory
5818 computation from here...
5819 (prepare): ... and from here...
5820 (compute_pkgdatadir): ... into this new function.
5821 * src/output.h (compute_pkgdatadir): Prototype.
5822
34cdeddf
JD
58232007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
5824
5825 * src/print-xml.c (escape_bufs): New static global variable
5826 replacing...
5827 (xml_escape_n): ... the static local variable buf here.
5828 (print_xml): Free memory for escape_bufs.
5829 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
5830
d782395d
JD
58312007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
5832
5833 Replace `%push-parser' and `%push-pull-parser' with
5834 `%define push_pull "push"' and `%define push_pull "both"'.
5835 `%define push_pull "pull"' is the default.
5836 * doc/bison.texinfo (Push Decl, Push Parser Function,
5837 Pull Parser Function, Parser Create Function, Parser Delete Function):
5838 Update declarations.
5839 (Decl Summary, Table of Symbols): Replace %push-parser and
5840 %push-pull-parser entries with a %define push_pull entry.
5841 * data/bison.m4 (b4_percent_define_check_values): New macro.
5842 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
5843 definitions...
5844 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
5845 definitions...
5846 * data/push.c: ... to here and compute them from the value of the
5847 %define variable push_pull.
5848 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
5849 parsing requests here...
5850 * data/yacc.c: ... hack this to switch to push.c any time
5851 b4_use_push_pull_flag or the %define variable push_pull is set. This
5852 will go away when we mv push.c yacc.c.
5853 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
5854 push parsing is not supported since unused %define variables are
5855 reported anyway.
5856 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
5857 * src/muscle_tab.h (muscle_percent_define_check_values): Update
5858 comments for consistency with b4_percent_define_check_values.
5859 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
5860 muscles.
5861 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
5862 Remove.
5863 (prologue_declaration): Remove %push-parser and %push-pull-parser
5864 rules.
5865 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
5866 * tests/calc.at: Update declarations.
5867 * tests/input.at (%define enum variables): New test case.
5868 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
5869 declaration.
5870 (Push Parsing: Multiple impure instances): Update declaration.
5871 (Push Parsing: Unsupported Skeletons): New test case.
5872 * tests/torture.at (Exploding the Stack Size with Alloca): Update
5873 declaration.
5874 (Exploding the Stack Size with Malloc): Update declaration.
5875
3f999f78
WP
58762007-09-24 Wojciech Polak <polak@gnu.org>
5877
5878 Add XSLT transformations.
5879
5880 * data/xslt/xml2dot.xsl: Transform XML into DOT.
5881 * data/xslt/xml2text.xsl: Transform XML into plain text.
5882 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
5883 * data/Makefile.am (xsltdir): New variable.
5884 (dist_xslt_DATA): Add xslt/*.xsl files.
5885
a4f75309
PE
58862007-09-23 Paul Eggert <eggert@cs.ucla.edu>
5887
5888 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
5889 Problem reported by Wojciech Polak.
5890 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
5891 (xml_printf): Undo change I made on 21 September; that is,
5892 indent 2 spaces, not 1.
5893
ad5feac4
JD
58942007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
5895
5896 Pacify ./configure --enable-gcc-warnings.
5897 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
5898 `char const *' instead of `char *'.
5899 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
5900 local variable `sep'.
5901
41d7a5f2
PE
59022007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5903
5904 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
5905 elsewhere.
5906 * src/print-xml.c: Prefer "const" after types; that's more consistent.
5907 (xml_printf): Indent just 1 space for level.
5908 (e_char, xlate_char): Remove.
5909 (xml_escape_string): Rewrite to avoid undefined behavior (used
5910 storage that was freed from the stack).
5911 (xml_escape_n): Don't bother checking for subscript error.
5912
3f999f78
WP
59132007-09-21 Wojciech Polak <polak@gnu.org>
5914
5915 Add Bison XML Automaton Report.
41d7a5f2
PE
5916
5917 Add support for an -x option to generate an XML report.
5918 It is not documented yet.
5919 * src/print-xml.c: New file.
5920 * src/print-xml.h: Likewise.
5921 * lib/timevar.def (TV_XML): New var.
5922 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
5923 * src/conflicts.c: Include print-xml.h.
5924 (solved_conflicts_xml_obstack): New var.
5925 (log_resolution, conflicts_solve, conflicts_free):
5926 Add support for XML report.
5927 (conflicts_output_val): New function.
5928 * src/conflicts.h (conflicts_output_val): New decl.
5929 * src/files.c (spec_xml_file): New var.
5930 (compute_output_file_names, output_file_names_free): Add XML support.
5931 * src/files.h (spec_xml_file): New decl.
5932 * src/getargs.c (xml_flag): New var.
5933 (usage, short_options, long_options, getargs): Add XML support.
5934 * src/getargs.h (xml_flag): New decl.
5935 * src/gram.c: Include print-xml.h.
5936 (rule_lhs_print_xml, rule_rhs_print_xml):
5937 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
5938 New functions.
5939 * src/gram.h: Declare external ones.
5940 * src/main.c: Include print-xml.h.
5941 (main): Add XML support.
5942 * src/reduce.c: Include print-xml.h.
5943 (reduce_xml): New function.
5944 * src/reduce.h: Declare it.
5945 * src/state.c: Include print-xml.h.
5946 (state_new): Add XML support.
5947 (state_rule_lookahead_tokens_print_xml): New function.
5948 * src/state.h: Declare it.
5949 (struct state): New member solved_conflicts_xml.
5950 * src/symtab.c (symbol_class_get_string): New function.
5951 * src/symtab.h: Declare it.
5952
6d8e724d
PE
59532007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5954
5955 * GNUmakefile: Switch to coreutils's version.
5956 * bootstrap: Likewise.
5957 * Makefile.cfg: Adjust to new GNUmakefile.
5958 * README-hacking: Likewise.
5959
5960 Import from gnulib:
5961
5962 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
5963 Bruno Haible <bruno@clisp.org>
5964
5965 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
5966 and is a script that invokes bison. Tighten the code. Add comments.
5967
922bdd7f
JD
59682007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
5969
5970 Spell "boolean" as "Boolean". Reported by Akim Demaille.
5971 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
5972 * doc/bison.texinfo (Decl Summary): Fix.
5973 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
5974 * tests/input.at (Boolean %define variables): Update output.
5975 * tests/skeletons.at (%define boolean variables: invalid skeleton
5976 defaults): Rename to...
5977 (%define Boolean variables: invalid skeleton defaults): ... this and
5978 update output.
5979
1b17b01d
JD
59802007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
5981
5982 In impure push mode, don't allow more than one yypstate to be allocated
5983 since multiple impure parsers would corrupt yynerrs.
5984 * data/push.c (yypstate_allocated): New static global variable
5985 initialized to 0.
5986 (yypull_parse): If yypstate_new returns 0, don't report it as memory
5987 exhaustion if yypstate_allocated is 1, but still return 2.
5988 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
5989 already 1. Otherwise, set it to 1.
5990 (yypstate_delete): Set it to 0.
5991 * tests/push.at (Push Parsing: Multiple impure instances): New test
5992 case.
5993
9987d1b3
JD
59942007-08-17 Bob Rossi <bob@brasko.net>
5995
5996 * doc/bison.texinfo (Push Decl): Document the push parser.
5997 (Table of Symbols): Ditto.
5998 (Pure Decl): Ditto.
5999 (Decl Summary): Ditto.
6000 (Multiple Parsers, Push Parser Function, Pull Parser Function,
6001 Parser Create Function, Parser Delete Function):
6002 Add new push parser symbols.
6003 (Table of Symbols): Document push-parser, push-pull-parser,
6004 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
6005
f16b0819
PE
60062007-08-15 Paul Eggert <eggert@cs.ucla.edu>
6007
6008 Update to GPLv3.
6009 * doc/gpl-3.0.texi: New file.
6010 * doc/gpl.texi: Remove.
6011 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
6012 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
6013 * README-hacking, TODO, bootstrap, bootstrap.conf:
6014 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
6015 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
6016 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
6017 * data/lalr1.cc, data/lalr1.java, data/location.cc:
6018 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
6019 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
6020 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
6021 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
6022 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
6023 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
6024 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
6025 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
6026 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
6027 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
6028 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
6029 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
6030 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
6031 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
6032 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
6033 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
6034 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
6035 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
6036 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
6037 * src/complain.c, src/complain.h, src/conflicts.c:
6038 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
6039 * src/files.h, src/flex-scanner.h, src/getargs.c:
6040 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
6041 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
6042 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
6043 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
6044 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
6045 * src/print.c, src/print.h, src/print_graph.c:
6046 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
6047 * src/reduce.h, src/relation.c, src/relation.h:
6048 * src/revision.h, src/scan-code.h, src/scan-code.l:
6049 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
6050 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
6051 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
6052 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
6053 * tests/Makefile.am, tests/actions.at, tests/c++.at:
6054 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
6055 * tests/existing.at, tests/glr-regression.at:
6056 * tests/headers.at, tests/input.at, tests/java.at:
6057 * tests/local.at, tests/output.at, tests/push.at:
6058 * tests/reduce.at, tests/regression.at, tests/sets.at:
6059 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
6060 * tests/torture.at:
6061 Update to GPLv3.
6062
728c4be2
JD
60632007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6064
6065 Get rid of broken %no-parser, -n, and --no-parser implementation and
6066 documentation.
6067 * TODO: Don't mention them.
6068 * doc/bison.1: Likewise.
6069 * doc/bison.texinfo (Decl Summary): Likewise.
6070 (Bison Options): Likewise.
6071 (Option Cross Key): Likewise.
6072 * src/getargs.c (no_parser_flag): Remove global variable.
6073 (usage): Don't print description of -n and --no-parser.
6074 (long_options): Remove --no-parser entry here.
6075 (getargs): Remove -n case in the switch here.
6076 * src/getargs.h (no_parser_flag): Remove extern.
6077 * tests/regression.at (Web2c Actions): Remove comment that mentions
6078 --no-parser.
6079
5d31a216
JD
60802007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6081
6082 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
6083 name user variables starting with `yy'. Just pass NULL instead of a
6084 dummy local &yylval to yypush_parse.
6085 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
6086 starting with `yy'.
6087
a2ea208d
JD
60882007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
6089
6090 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
6091 true since it's then always used regardless of whether yyoverflow is
6092 defined. Reported by Christian Burger at
6093 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
6094 * THANKS: Add Christian Burger.
6095
91661ebb
JD
6096 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6097 node names: say "Decl Summary" not "Bison Declaration Summary".
6098
cbd50549
JD
60992007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
6100
6101 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
6102 determine whether this function has already complained about an invalid
6103 value for a %define boolean variable, don't check whether Bison has
6104 ever examined the value. As written, the check was a tautology.
6105 Instead, record and check for this complaint using a separate muscle.
6106
eb1b0740
JD
61072007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
6108
6109 Fix push parsing memory leak reported by Brandon Lucia at
6110 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
6111 * THANKS: Add Brandon Lucia.
6112 * data/push.c (yypstate_delete): Free the stack if it was reallocated
6113 but the parse never completed and thus freed it.
6114 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
6115 * tests/testsuite.at: Include push.at.
6116 * test/push.at: New.
6117 (Push Parsing: Memory Leak for Early Deletion): New test case.
6118
9d774aff
JD
61192007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
6120
6121 Improve handling of multiple S/R conflicts in the same state and of S/R
6122 conflicts involving multiple reductions.
6123 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
6124 set for a state here or Bison will abort if it is reassigned on a
6125 later conflicted reduction in the same state.
6126 Similarly, don't finalize and assign the solved conflicts report here
6127 or it will be lost if it is reassigned on a later conflicted reduction
6128 in the same state.
6129 (set_conflicts): Instead, assign them both here after all S/R conflicts
6130 in the state have been fully examined.
6131 * src/print.c (shift_set): Rename to...
6132 (no_reduce_set): ... this.
6133 (print_reductions): Update for rename, and add %nonassoc error action
6134 tokens to no_reduce_set so that, when printing the first remaining
6135 reduction on an error action token, the reduction is enclosed in
6136 brackets.
6137 (print_results): Update for rename.
6138 * tests/conflicts.at (Solved conflicts report for multiple reductions
6139 in a state): New test case.
6140 (%nonassoc error actions for multiple reductions in a state): New test
6141 case.
6142
6143 * src/main.c (main): Don't depend on C99 features.
6144
10159d2a
JD
61452007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
6146
6147 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
6148 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
6149 uniwidth.
10159d2a 6150
953b3935
JD
61512007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
6152
6153 * bootstrap (slurp): Create target directories that don't exist.
6154 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
6155
6ce2d93a
JD
61562007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6157
6158 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
6159 than item number.
6160 * closure.c (closure): Likewise.
6161 * state.h (reductions): Comment sorting of rules.
6162 (state): Comment sorting of items.
6163
ce3448d5
JD
61642007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
6165
6166 Fix C++ test cases after recent Gnulib changes. Discussed starting at
6167 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
6168 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
6169 definition in order to avoid Gnulib headers since we don't use config.h
6170 here.
6171 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
6172 rather than AT_DATA so that config.h is included.
6173
8a86eef0
JD
61742007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
6175
6176 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
6177 instead of fprintf. Guard these functions with #if YYDEBUG instead of
6178 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
6179 and so that YYFPRINTF is guaranteed to be defined here.
6180
b1a81613
JD
61812007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6182
6183 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
6184 with...
6185 (muscle_percent_define_check_values): ... this more helpful function.
6186 Again, it's not used yet, but it will be.
6187 * src/muscle_tab.h: Likewise.
6188
71b61d4d
JD
6189 Improve some comments in parser table construction.
6190 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
6191 (generate_states): Don't mention ruleset, which is internal to closure.
6192 * src/closure.c (closure): Explain sorting of core and itemset, which
6193 is required for this function to behave correctly.
6194 * src/closure.h (closure): Mention sorting.
6195
2a6b783d
JD
61962007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
6197
6198 * src/lalr.c (state_lookahead_tokens_count): For code readability,
6199 move the check for disabled transitions to an aver since conflict
6200 resolution hasn't happened yet.
6201
6202 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
6203 labels a state as inconsistent just because it has error transitions.
6204 The original form of this check appeared in revision 1.1 of lalr.c,
6205 which was committed on 1991-12-21. Now (at least), changing the
6206 consistency label on such a state appears to have no useful effect in
6207 any of the places it is examined, which I enumerate below. The key
6208 point to understanding each item in this enumeration is that a state
6209 with an error transition is labelled consistent in the first place only
6210 if it has no rules, so the check cannot matter for states that have
6211 rules. (1) Labelling a state as inconsistent will cause set_conflicts
6212 to try to identify its conflicts, and a state must have *rules* to have
6213 conflicts. (2) Labelling a state as inconsistent will affect how
6214 action_row sets the default *rule* for the state. (3) Labelling a
6215 state as inconsistent will cause build_relations to add lookback edges
6216 to *rules* in that state.
6217 * src/state.h (struct state): Word the comment for member consistent
6218 more carefully.
6219
14462c2b
JD
62202007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
6221
6222 Don't depend on C99 features.
6223 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
6224 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
6225 * src/reader.c (check_and_convert_grammar): Fix for-loop.
6226 * src/state.c (state_mark_reachable_states): Fix for-loop.
6227 (state_remove_unreachable_states): Fix for-loop.
6228
6229 Don't widen struct state with member reachable just to temporarily
6230 record reachability. Instead, use a local bitset.
6231 * src/state.h (struct state): Remove member.
6232 * src/state.c (state_new): Don't initialize it.
6233 (state_mark_reachable_states): Rename to...
6234 (state_record_reachable_states): ... this, and use bitset.
6235 (state_remove_unreachable_states): Use bitset.
6236
5a43d418
JD
62372007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
6238
6239 * src/Makefile.am (yacc): Quote target action commands properly so
6240 that the yacc script isn't corrupt. Reported by Hans Aberg at
6241 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
6242
0c650a20
JD
6243 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
6244 the case of pure parsers. Reported by Frans Englich at
6245 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
6246 * THANKS: Add Frans Englich.
6247
61fee93e
JD
6248 * NEWS (2.3a+): In the %code entry, reference section `Bison
6249 Declaration Summary' from the manual now since the %code summary has
6250 moved there.
6251 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
6252 in the rules section must be terminated by semicolons.
6253
f124d423
JD
62542007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
6255
6256 Extend the front-end API for %define variables to more completely
6257 mirror the back-end. This will be useful in the future.
6258 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
6259 Update comments to mention the new front-end counterparts of these
6260 macros.
6261 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
6262 for muscle_string_decode and muscle_location_decode.
6263 (muscle_string_decode): New static function.
6264 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
6265 (muscle_percent_define_get, muscle_percent_define_ifdef): New
6266 functions.
6267 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
6268 muscle_percent_define_get to mimic the b4_percent_define_flag_if
6269 implementation more closely.
6270 (muscle_percent_define_invalid_value): New function.
6271 * src/muscle_tab.h (muscle_percent_define_get,
6272 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
6273 Prototype.
6274
75ad86ee
JD
62752007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
6276
6277 * NEWS (2.3a+): Mention yesterday's state-removal change.
6278 (2.3a): Remove the %language entry, which was added after 2.3a.
6279 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
6280 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
6281 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
6282 tests/existing.at: Update copyright date.
6283
5967f0cf
JD
62842007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6285
6286 If conflict resolution makes states unreachable, remove those states,
6287 report rules that are then unused, and don't report conflicts in those
6288 states.
6289 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
6290 New global function.
6291 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
6292 function.
6293 * src/main.c (main): After conflict resolution, remove the unreachable
6294 states and update all data structures that reference states by number.
6295 * src/state.c (state_new): Initialize each state's reachable member to
6296 false.
6297 (state_mark_reachable_states): New static function.
6298 (state_remove_unreachable_states): New global function.
6299 * src/state.h (struct state): Add member bool reachable.
6300 (state_remove_unreachable_states): Prototype.
6301 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6302 New test case.
6303 * tests/existing.at (GNU pic Grammar): Update test case output now that
6304 an unused rule is discovered.
6305
b09f4f48
JD
63062007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6307
6308 Minor code cleanup in parser table construction.
6309 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
6310 (new_itemsets, save_reductions): Update for rename to nitemset.
6311 * src/closure.c (nritemset): Rename to...
6312 (nitemset): ... this since the "r" appears to meaningless and isn't
6313 used in the comments.
6314 (closure): Update for rename.
6315 * src/closure.h (nritemset): Update extern to...
6316 (nitemset): ... this.
6317 * src/lalr.c (LA): Fix a typo in comments.
6318 * src/print.c (print_core): Update for rename to nitemset.
6319 * src/print_graph.c (print_graph): Likewise.
6320 * src/state.h: Fix some typos in header comments.
6321
bbb44d83
PE
63222007-04-04 Paul Eggert <eggert@cs.ucla.edu>
6323
9b33de72
PE
6324 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
6325 still sticks to ASCII. Sorry!
6326
bbb44d83
PE
6327 * README-hacking: New file, taken mostly from coreutils, with changes
6328 for Bison. Contains much of the contents of:
6329 * README-cvs: Remove.
6330 * bootstrap: Sync from gnulib.
6331 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
6332 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
6333
29553547
JD
63342007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
6335
6336 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
6337 Setzer.
6338 (Java Differences): Fix some typos.
6339 * THANKS: Add Sebastian Setzer.
6340
01b477c6
PB
63412007-03-07 Paolo Bonzini <bonzini@gnu.org>
6342
730739e4
AD
6343 * data/java.m4 (b4_single_class_if): Remove.
6344 (b4_abstract_if): Look at "%define abstract".
6345 (b4_lexer_if): New.
6346 (b4_union_name): Rename...
6347 (b4_yystype): ... to this. Map to "%define stype".
6348 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
6349 b4_maybe_throws): Fix quoting.
6350 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
6351 * data/lalr1.java (Lexer interface): Always define.
6352 (Lexer interface within parser class): Remove.
6353 (YYLexer class): New, used when "%code lexer" is present.
6354 (constructor): When "%code lexer" is used, pass %lex-param
6355 to the lexer constructor.
6356 (yylex, yyparse): Remove %lex-param from method invocations
6357 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
6358
6359 * doc/bison.texinfo (Java Bison Interface): Mention "%define
6360 abstract". Rename "%define union_name" to "%define stype".
6361 Rename method names according to previous patch.
6362 (Java Scanner Interface): Describe "%code lexer" instead of
6363 "%pure-parser" and "%define single_class".
6364 (Java Differences): Mention "%code lexer".
6365
6366 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
6367 Include scanner here, using macros from tests/local.at.
6368 (AT_DATA_CALC_Y): Remove final argument.
6369 (_AT_CHECK_JAVA_CALC): Likewise.
6370 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
6371 of %locations and %error-verbose.
6372 (main): Test with and without %lex-param.
6373 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
6374 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 6375
122bea3a
JMG
63762007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6377
6378 DJGPP spefic issue. Inhibit the use of disallowed characters for
6379 file name genertion on Win98, WinXP, etc. These are |<>":?*\
6380 and concern testsuite case 46.
6381 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
6382 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
6383 * djgpp/config.bat: Inhibit the use of disallowed characters.
6384
9611cfa2
JD
63852007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6386
6387 Miscellaneous %define and %code cleanup.
6388 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
6389 values are interpreted.
6390 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
6391 documentation a little more.
6392 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
6393 muscle_percent_define_insert, muscle_percent_code_grow): New
6394 functions/macros.
6395 * src/muscle_tab.h (muscle_percent_define_insert,
6396 muscle_percent_code_grow): Prototype.
6397 * src/parse-gram.y (prologue_declaration): Use
6398 muscle_percent_define_insert and muscle_percent_code_grow when parsing
6399 %define and %code directives.
6400
6401 Make it easy to share %define boolean variables between the front-end
6402 and back-end. Though not used yet, this will be useful in the future.
6403 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
6404 Bison uses of names rather than just skeleton uses of names.
6405 (b4_percent_define_get, b4_percent_define_ifdef): Rename
6406 b4_percent_define_skeleton_variables(VARIABLE) to
6407 b4_percent_define_bison_variables(VARIABLE).
6408 (b4_percent_code_get, b4_percent_code_ifdef): Rename
6409 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
6410 b4_percent_code_bison_qualifiers(QUALIFIER).
6411 (b4_check_user_names_wrap): Update for renames.
6412 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
6413 muscle_percent_define_default): New functions mimicking
6414 b4_percent_define_flag_if and b4_percent_define_default.
6415
6416 For %define variables, report locations for invalid values and
bbb44d83 6417 redefinitions.
9611cfa2
JD
6418 * data/bison.m4 (b4_percent_define_flag_if): Read
6419 b4_percent_define_loc(VARIABLE) to report the location of an invalid
6420 value for VARIABLE.
6421 (b4_percent_define_default): Save a special location in
6422 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
6423 must later be reported as invalid.
6424 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
6425 functions.
6426 (muscle_percent_define_insert): Record the location of VARIABLE in
6427 muscle percent_define_loc(VARIABLE), and use it to report the previous
6428 location for a redefinition.
6429 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
6430 (muscle_percent_define_default): Update like b4_percent_define_default.
6431 (muscle_grow_user_name_list): Rename to...
6432 (muscle_user_name_list_grow): ... this for consistency and use
6433 muscle_location_grow.
6434 * src/muscle_tab.h (muscle_location_grow): Prototype.
6435 * tests/input.at (%define errors): Update expected output.
6436 * tests/skeletons.at (%define boolean variables: invalid skeleton
6437 defaults): New test case.
6438
0bf92491
JD
64392007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
6440
6441 * src/print.c (lookahead_set, state_default_rule): Remove.
6442 (print_reductions): Replace state_default_rule invocation with
6443 equivalent use of yydefact, which was computed in token_actions in
6444 tables.c.
6445 (print_results): Don't allocate lookahead_set.
6446
d3b12988
PB
64472007-02-27 Paolo Bonzini <bonzini@gnu.org>
6448
6449 * data/lalr1.java: Prefix all private members with yy.
6450
f57a7536
JD
64512007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
6452
6453 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 6454 Sebastien Fricker at
f57a7536 6455 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 6456 * THANKS: Add Sebastien Fricker.
f57a7536
JD
6457 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
6458 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
6459 accept a variable number of arguments.
6460
6404a5bf
JD
64612007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
6462
6463 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
6464
e4e09639
JMG
64652007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6466
6467 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
6468 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
6469 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
6470
d7e0a1a7
PE
64712007-02-11 Paul Eggert <eggert@cs.ucla.edu>
6472
6473 Undo my 2007-02-07 change, switching back to the c-strcase module
6474 introduced in the 2007-02-03 change. Bruno Haible reported that
6475 the 2007-02-07 change would be dangerous in Turkish if we add a
6476 language whose name contains "i", since "i" is not lowercase "I"
6477 in Turkish.
6478 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
6479 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
6480 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
6481 * m4/.cvsignore: Remove strcase.m4.
6482 * src/getargs.c: Revert 2007-02-07 change, as follows.
6483 Include c-strcase.h.
6484 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
6485
deee93a1
JD
64862007-02-11 Bruno Haible <bruno@clisp.org>
6487
6488 Enable the Java related testsuite tests when the only Java compiler
6489 found is a gcj < 4.3. Discussed at
6490 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
6491 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
6492
574add85
JD
64932007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
6494
6495 * data/Makefile.am: Update copyright date.
6496 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
6497 yypstate_new returns NULL.
6498 (yypstate_new): Return NULL if malloc does.
6499 * src/reader.c (packgram): Move translation of rule actions from the
6500 beginning of packgram to...
6501 (check_and_convert_grammar): ... here right before packgram is invoked
6502 so it's easier to write more complete comments, and remove redundant
6503 code.
6504
e785ccf7
JD
65052007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
6506
6507 As in semantic actions, make @$ in %initial-action, %destructor, and
6508 %printer imply %locations.
6509 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
6510 scanning @$.
6511 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
6512 (@$ in %initial-action implies %locations,
6513 @$ in %destructor implies %locations,
6514 @$ in %printer implies %locations): ... these new test cases.
6515
1cfe1ed7
PE
65162007-02-07 Paul Eggert <eggert@cs.ucla.edu>
6517
6518 Undo most of the 2007-02-03 change, switching to the strcase module
6519 now that gnulib strcase has been fixed.
6520 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
6521 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
6522 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
6523 * m4/.cvsignore: Add strcase.m4.
6524 * src/getargs.c: Revert 2007-02-03 change, as follows.
6525 Don't include c-strcase.h.
6526 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
6527 strcasecmp has "unspecified behavior" outside the POSIX locale,
6528 but it works fine in practice if at least one argument is ASCII,
6529 as is the case in Bison.
6530
0049ec86
PB
65312007-02-07 Paolo Bonzini <bonzini@gnu.org>
6532
6533 * tests/java.at: Skip tests if only one of javac/java is present.
6534 Reported by Joel E. Denny.
6535 * tests/atlocal.in: Adjust copyright years.
6536
65372007-02-05 Paolo Bonzini <bonzini@gnu.org>
6538
6539 * data/lalr1.java (Stack): Work around old verifiers that disallow
6540 access to the private fields of an inner class, from the outer class.
6541 We can make Stack's fields public because user code doesn't have access
6542 to the instance of Stack used by parse(). Reported by Paul Eggert.
6543
2c2b7220
PE
65442007-02-03 Paul Eggert <eggert@cs.ucla.edu>
6545
6546 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
6547 the right spot for these files?
6548 * bootstrap.conf (gnulib_modules): Add c-strcase.
6549 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
6550 c-strncasecmp.c.
6551 * src/getargs.c: Include c-strcase.h.
6552 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
6553 to avoid unspecified behavior.
6554
b2b81dae
JD
65552007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
6556
6557 * doc/bison.texinfo (Decl Summary): Correct typo.
6558
c1d19e10
PB
65592007-01-30 Paolo Bonzini <bonzini@gnu.org>
6560
6561 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
6562 Complain if the value does not match empty, "true" or "false".
6563 * data/c++.m4: Adjust default definitions of %define variables.
6564 * data/java.m4: Adjust default definitions of %define variables.
6565 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
6566 to above behavior.
6567 * tests/input.at (Boolean %define variables): Test new behavior.
6568
8405b70c
PB
65692007-01-29 Paolo Bonzini <bonzini@gnu.org>
6570
6571 * NEWS: Mention java.
6572 * TODO: Remove things that are done.
6573 * bootstrap.conf: Add javacomp-script and javaexec-script.
6574 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
6575
6576 * data/Makefile.am: Add new files.
6577 * data/java-skel.m4: New.
6578 * data/java.m4: New.
6579 * data/lalr1.java: New.
6580
6581 * doc/bison.texinfo: Put "A Complete C++ Example" under
6582 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
6583 under Other Languages.
6584
6585 * src/getargs.c (valid_languages): Add Java.
6586 * src/getargs.h (struct bison_language): Update size of string fields.
6587
6588 * tests/Makefile.am: Add java.at.
6589 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
6590 * tests/java.at: New.
6591 * tests/testsuite.at: Include it.
6592
3eb82471
JD
65932007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
6594
6595 Clean up.
6596 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
6597 at_directive_argv arguments so these no longer have to be global
6598 variables. Also, update the implementation for the following changes.
6599 (fail_for_at_directive_too_many_args,
6600 fail_for_at_directive_too_few_args): Add at_directive_name argument.
6601 (at_directive_name): Remove as at_directive_argv[0] will be used for
6602 this now.
6603 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
6604 for the directive name.
6605 (at_directive_argc, at_directive_argv): Make these local within
6606 skel_lex instead of global.
6607 (INITIAL): Update directive start action for above changes.
6608 (SC_AT_DIRECTIVE_ARG): Rename to...
6609 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
6610 (SC_AT_DIRECTIVE_SKIP_WS): Update.
6611 (scan_skel): Move yylex_destroy to...
6612 (skel_scanner_free): ... here.
6613 * tests/skeletons.at (installed skeleton file name): Rename to...
6614 (installed skeleton file names): ... this.
6615
148d66d8
JD
66162007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
6617
6618 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6619 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
6620 Summary" not "Directives".
6621 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
6622 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
6623 since the former is now the more complete one.
6624 (Prologue Alternatives): Likewise and do the same for %defines.
6625 (Table of Symbols): Add summary of %code, add summary of %define, and
6626 move full %code documentation to...
6627 (Decl Summary): ... here for consistency with other entries in these
6628 sections.
6629 Move %define entry in order to keep this list alphabetized.
6630 Reword %define entry a little to put less emphasis on the skeleton
6631 concept, which most users shouldn't have to think about.
6632
665f0c24
PE
66332007-01-26 Paul Eggert <eggert@cs.ucla.edu>
6634
6635 Adjust to recent gnulib changes.
6636 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
6637 Add string.h, string_.h, unistd_.h, wchar_.h.
6638 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
6639 * src/system.h: Don't include <stpcpy.h>; this is now done by
6640 <string.h>.
6641
592d0b1e
PB
66422007-01-23 Paolo Bonzini <bonzini@gnu.org>
6643
6644 Simplify implementation of unqualified %code, implement macros for
6645 uniform treatment of boolean %define flags. Document %define.
6646 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
6647 b4_percent_code_ifdef): New.
6648 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
6649 * data/c++.m4: Define default value for global_tokens_and_yystype.
6650 * data/glr.cc: Likewise.
6651 * data/location.cc: Use b4_percent_define_flag_if.
6652
148d66d8 6653 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
6654
6655 * src/parse-gram.y (Unqualified %code): Change muscle name to
6656 b4_percent_code().
6657 (content.opt): Default to empty.
6658
a7867f53
JD
66592007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6660
6661 Implement support for relative and absolute skeleton file names.
6662 Discussed starting at
6663 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
6664 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
6665 (Bison Options): Document in --skeleton entry.
6666 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
6667 full_skeleton can't necessarily hold all of pkgdatadir.
6668 If the specified skeleton file name contains a `/', don't prepend
6669 pkgdatadir.
6670 * src/parse-gram.y (prologue_declaration): If the specified skeleton
6671 file name contains a `/', prepend the grammar file directory.
6672 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
6673 * skeletons.at: New file.
6674 (relative skeleton file names): New test case.
6675 (installed skeleton file names): New test case.
6676 * tests/testsuite.at: Include skeletons.at.
6677
6678 * bootstrap: Update copyright to 2007.
6679
830c9b18
PB
66802007-01-17 Paolo Bonzini <bonzini@gnu.org>
6681
6682 * bootstrap: Remove occurrences of .#bootmp from the files.
6683
a8c2e813
AD
66842007-01-17 Akim Demaille <akim@epita.fr>
6685
6686 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
6687 nonterminals.
6688 Use per-type %printer.
6689
279cabb6
JD
66902007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6691
6692 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
6693 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6694 djgpp/config.site, src/files.c, src/files.h, src/main.c,
6695 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
6696 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
6697 tests/glr-regression.at, tests/input.at, tests/local.at,
6698 tests/output.at, tests/torture.at: Update copyright to 2007.
6699
bb32f4f2
AD
67002007-01-16 Akim Demaille <akim@epita.fr>
6701
6702 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
6703 error code.
6704 (Calc++ Scanner): Exit with failure if we can't open the input
6705 file.
6706 Accept "-" standing for stdin.
6707 (Calc++ Top Level): Print the result only if the parsing was
6708 successful.
6709
7cff04b5
AD
67102007-01-16 Akim Demaille <akim@epita.fr>
6711
6712 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
6713
a4e25e1d
JD
67142007-01-15 Paolo Bonzini <bonzini@gnu.org>
6715 and Joel E. Denny <jdenny@ces.clemson.edu>
6716
6717 Clean up %define and %code implementation in M4 some. Most
6718 importantly, rename all related macros to be in the b4_percent_define
6719 and b4_percent_code namespaces. Also, complete support for `.' in
6720 %define variable names and %code qualifiers.
6721 * data/bison.m4 (b4_check_user_names): Check for special
6722 "SKELETON-NAMESPACE(name)" macros instead of using two nested
6723 m4_foreach loops.
6724 (b4_get_percent_define, b4_get_percent_code): Rename to...
6725 (b4_percent_define_get, b4_percent_code_get): ... these.
6726 Extend documentation with examples.
6727 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
6728 b4_percent_define_skeleton_variables and
6729 b4_percent_code_skeleton_qualifiers.
6730 Expect any value for the %define variable `foo' to be stored in the
6731 macro named `b4_percent_define(foo)'; expect any %code blocks for the
6732 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
6733 expect any unqualified %code blocks to be stored in a macro named
6734 `b4_percent_code_unqualified'.
6735 Use m4_indir so that %define variable names and %code qualifiers can
6736 contain `.', which is allowed by the grammar parser.
6737 (b4_percent_define_default): New macro to set a default value for a
6738 %define variable.
6739 (m4_wrap): Update wrapped code, and fix some underquoting.
6740 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
6741 Expect grammar uses of %define variables and %code qualifiers to be
6742 defined in b4_percent_define_user_variables and
6743 b4_percent_code_user_qualifiers.
6744 * data/c++.m4: Use b4_percent_define_default rather than
6745 m4_define_default. Fix some underquoting. Skeleton usage of %define
6746 variable define_location_comparison now implies skeleton usage of
6747 %define variable filename_type.
6748 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6749 data/push.c, data/yacc.c: Update macro names.
6750 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
6751 muscle names.
6752
e37c665c
JMG
67532007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6754
6755 DJGPP specific issues.
6756
6757 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
6758 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
6759
7d2d521f
JD
67602007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6761
6762 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
6763 run parsers in all tests so that Valgrind is invoked during
6764 maintainer-check-valgrind.
6765 (Duplicate representation of merged trees): Free all semantic values.
6766 (Duplicated user destructor for lookahead): Likewise.
6767
e0ac9b4b
JD
67682007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6769
6770 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
6771 command-line prefix.
6772 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
6773 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
6774 miss Valgrind messages.
6775 (Exploding the Stack Size with Malloc): Likewise.
6776
78143faa
JD
67772007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6778
6779 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
6780 locals. Reported by Juan Manuel Guerrero at
6781 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
6782 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
6783 Fix some indentation also.
6784 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
6785 explaining this issue.
6786
7ecec4dd
JD
67872007-01-09 Paolo Bonzini <bonzini@gnu.org>
6788 and Joel E. Denny <jdenny@ces.clemson.edu>
6789
6790 Simplify union and prologue handling, and escape union and lex/parse
6791 params with digraphs.
6792 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
6793 values to the empty string since these are no longer guaranteed
6794 initialized by the front-end.
6795 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
6796 braces around b4_user_stype since this is no longer done by the
6797 front-end.
6798 * src/files.c, src/files.h (pre_prologue_obstack,
6799 post_prologue_obstack): Remove.
6800 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
6801 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
6802 with digraphs. This fixes lex params and parse params.
6803 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
6804 * src/output.c (prepare): Remove muscle insertion of the prologues.
6805 (output): Remove freeing of pre_prologue_obstack and
6806 post_prologue_obstack.
6807 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
6808 than prologue_augment for prologue parsing so you don't need prologue
6809 obstacks.
5c80250c
JD
6810 (grammar_declaration): For %union RHS, use `braceless' instead of
6811 "{...}" so that braces are already stripped and code is escaped with
6812 digraphs.
7ecec4dd
JD
6813 * src/reader.c (prologue_augment): Remove.
6814 (reader): Remove initialization of pre_prologue_obstack and
6815 post_prologue_obstack.
6816 * src/reader.h (prologue_augment): Remove.
6817
6818 * data/c.m4: Remove stray parenthesis.
6819
16dc6a9e
JD
68202007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6821
6822 Remove quotes from variables names in %define directives and from
6823 qualifiers in %code directives, and restrict the characters that are
6824 allowed in them to M4-friendly ones. For %define, continue to support
6825 the quoted form as a deprecated feature. Discussed starting at
6826 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
6827 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
6828 %code.
6829 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
6830 (Decl Summary): In %defines entry, update mention of `%code requires'
6831 and `%code provides'.
16dc6a9e
JD
6832 (C++ Location Values): Update %define uses.
6833 (Calc++ Parser Interface): Likewise.
6834 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 6835 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
6836 * src/parse-gram.y (prologue_declaration): For %define variables, use
6837 `variable' instead of `STRING'.
6838 (grammar_declaration): For %code qualifiers, use `ID' instead of
6839 `STRING'.
6840 (variable): New nonterminal that takes an `ID' or a `STRING'.
6841 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
6842 and %define uses.
6843 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
6844 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
6845 (%define errors): Update %define uses.
6846
e9813cd4
JD
68472007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6848
6849 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
6850 instead of muscle_insert for %define values so that M4-special
6851 characters are replaced with digraphs.
6852 * tests/input.at (%define errors): Extend to check weird values.
6853
6afc30cc
JD
68542007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6855
6856 Instead of having skeletons declare all valid %define variables and
6857 %code qualifiers, provide macros that retrieve the associated values
6858 and build these lists automatically. Thus Bison will now warn when a
6859 variable or qualifier is not used by the skeleton in the current
6860 invocation regardless of whether it might sometimes be used by that
6861 skeleton in other invocations. Also, move all %define value macros to
6862 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
6863 form, which is replaced by %code.
6864 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
6865 (b4_check_user_names): ... this, and change the series of valid name
6866 arguments to a single list argument for names used in the skeleton
6867 similar to the existing list argument for names used in the grammar.
6868 Warn instead of complaining.
6869 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
6870 values and %code code, to format %code code properly, and to build
6871 lists of all %define variables and %code qualifiers used in the
6872 skeleton: b4_skeleton_percent_define_variables and
6873 b4_skeleton_percent_code_qualifiers.
6874 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
6875 Remove, and...
6876 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
6877 the skeleton names lists can finish building first. In place of
6878 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
6879 expect the lists b4_user_percent_define_variables and
6880 b4_user_percent_code_qualifiers.
6881 * data/c++.m4: Where setting default values for b4_parser_class_name,
6882 b4_location_type, b4_filename_type, b4_namespace, and
6883 b4_define_location_comparison, update their names to the
6884 b4_percent_define_ namespace.
6885 * data/glr.c: Don't use b4_check_percent_define_variables and
6886 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6887 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
6888 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 6889 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
6890 * data/location.cc: Use b4_get_percent_define.
6891 * data/push.c: Don't use b4_check_percent_define_variables and
6892 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6893 * data/yacc.c: Likewise, and don't call m4_exit in
6894 b4_use_push_for_pull_if or m4_wrap code will never execute.
6895 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
6896 Rename to...
6897 (muscle_grow_user_name_list): ... this for consistency with the
6898 terminology used in bison.m4.
6899 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
6900 %define variable names, and rename muscle used_percent_define_variables
6901 to user_percent_define_variables.
6902 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
6903 user_percent_code_qualifiers.
6904 (content): Remove.
6905 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
6906 {CODE} form is no longer accepted.
6907 * tests/input.at (Reject bad %code qualifiers): Rename to...
6908 (Reject unused %code qualifiers): ... this, and update test output.
6909 (%define error): Update test output.
6910
7eb8a0bc
JD
69112007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
6912
6913 Check for unrecognized %define variables similar to checking for
6914 unrecognized %code qualifiers. Check for redefined %define variables.
6915 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
6916 generalizes...
6917 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
6918 (b4_check_percent_define_variables): New, also wraps it.
6919 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
6920 variables using b4_check_percent_define_variables.
6921 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
6922 all those exercised in the test suite and all those listed in the
6923 `Default values' section of c++.m4. Are there others?
6924 * data/push.c, data/yacc.c: Declare no valid %define variables.
6925 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
6926 similar to muscle_find, but it works even when the muscle stores a
6927 const value.
6928 (muscle_grow_used_name_list): New function for constructing the used
6929 name list muscles that b4_check_for_unrecognized_names requires.
6930 * src/parse-gram.y (prologue_declaration): Warn if a variable is
6931 %define'd more than once. Define the b4_used_percent_define_variables
6932 muscle with muscle_grow_used_name_list.
6933 (grammar_declaration): Abbreviate %code code with
6934 muscle_grow_used_name_list.
6935 * tests/input.at (%define errors): New.
6936
3fc65ead
JD
69372007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6938
6939 Provide warn_at, complain_at, and fatal_at function callbacks to the
6940 skeletons, and use this for %code qualifier complaints.
6941 * data/bison.m4 (b4_error_at): New, invoked by...
6942 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
6943 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
6944 @fatal_at(...@) directives.
6945 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
6946 qualifiers in b4_used_percent_code_qualifiers and to use
6947 b4_complain_at.
6948 * src/location.c, src/location.h (boundary_set_from_string): New global
6949 function.
6950 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
6951 function.
6952 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
6953 to b4_used_percent_code_qualifiers.
6954 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
6955 function.
6956 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
6957 (lineno): Rename to...
6958 (out_lineno): ... this so I don't misunderstand it again.
6959 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
6960 here; these newlines are in the input but not the output file.
6961 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
6962 (at_directive_perform): ... this new static function, and add handling
6963 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
6964 directives.
6965 * tests/input.at (Reject bad %code qualifiers): Update test output with
6966 locations and extend.
6967
6968 * tests/output.at (Output file name: [, Output file name: ]): Remove
6969 bogus comment about these tests failing.
6970
1c7b7e1d
JD
69712007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6972
6973 Clean up b4_check_percent_code_qualifiers a little.
6974 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
6975 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
6976 documentation and add examples.
6977 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
6978 qualifiers here.
6979
08af01c2
JD
69802007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6981
6982 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
6983 unreliable -- especially when they're hidden inside another macro.
6984 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
6985 data/c.m4: Remove m4_divert(-1).
6986 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6987 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
6988 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 6989 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
6990 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
6991 pushed and popped by m4sugar, should be first on the stack.
6992
6993 Provide warn, complain, and fatal function callbacks to the skeletons.
6994 This provides more flexibility than m4_fatal, improves the error
6995 message format, and captures messages for translation. Discussed
6996 starting at
6997 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
6998 * data/bison.m4 (b4_error): New, invoked by...
6999 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
7000 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
7001 directives. Because these M4 macros might be called when the current
7002 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
7003 the previous removal of uses of m4_divert, which caused trouble.
7004 (b4_check_percent_code_qualifiers): Use b4_complain instead of
7005 m4_fatal to report unrecognized %code qualifiers.
7006 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
7007 push parser requests.
7008 * data/glr.c: Use b4_complain instead of m4_fatal to report
7009 non-deterministic push parser requests.
7010 Update @output usage to @output(...@) form.
7011 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
7012 report missing %defines. Update @output usage to @output(...@) form.
7013 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
7014 @output(...@) form.
7015 * src/main.c (main): Invoke skel_scanner_free.
7016 * src/scan-skel.h (skel_scanner_free): Prototype new function.
7017 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
7018 obstack_for_string from flex-scanner.h.
7019 (YY_DECL): Use to declare skel_lex static.
7020 (decode_at_digraphs): Remove; now handled in the new
7021 SC_AT_DIRECTIVE_ARG start condition.
7022 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
7023 functions.
7024 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
7025 at_directive_argv): New static globals.
7026 (INITIAL): Use fail_for_invalid_at.
7027 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
7028 recognize the start of a generalized `@directive(...@)' form and
7029 start...
7030 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
7031 directive args (using the new obstack_for_string), to decode the
7032 contained @ diagraphs, and to perform the directive. It recognizes
7033 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
7034 @output(...@).
7035 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
7036 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
7037 `@,'.
7038 (scan_skel): Initialize obstack_for_string on the first call.
7039 (skel_scanner_free): New function to free obstack_for_string.
7040 * tests/input.at (Reject bad %code qualifiers): Update test output.
7041
8e0a5e9e
JD
70422007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
7043
7044 Consolidate the 4 prologue alternative directives (%code, %requires,
7045 %provides, and %code-top) into a single %code directive with an
7046 optional qualifier field. Discussed at
7047 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
7048 * NEWS (2.3a+): Rewrite the existing entry for the prologue
7049 alternatives.
7050 * doc/bison.texinfo (Prologue Alternatives): Update.
7051 (Decl Summary): Update to %code "requires" and %code "provides".
7052 (Calc++ Parser): Update to %code "requires".
148d66d8 7053 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
7054 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
7055 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
7056 are replaced by b4_percent_code_provides and b4_percent_code_requires,
7057 which are skeleton-specific.
7058 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
7059 declare what %code qualifiers it supports and to complain if any other
7060 qualifiers were used in the grammar.
7061 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
7062 and b4_user_code([b4_percent_code_provides]) in place of
7063 b4_user_requires and b4_user_provides.
7064 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
7065 Add b4_user_code([b4_percent_code_top]) and
7066 b4_user_code([b4_percent_code]).
7067 Invoke b4_check_percent_code_qualifiers.
7068 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7069 PERCENT_REQUIRES): Remove.
7070 (grammar_declaration): Remove RHS's for %code-top, %provides, and
7071 %requires. Rewrite the %code RHS as the unqualified form defining the
7072 muscle b4_percent_code. Add another RHS for the qualified %code form,
7073 which defines muscles of the form b4_percent_code_QUALIFIER and the
7074 b4_used_percent_code_qualifiers muscle.
7075 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7076 PERCENT_REQUIRES): Remove.
7077 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
7078 %code "requires" and %code "provides".
7079 * tests/input.at (Reject bad %code qualifiers): New.
7080
95021767
JD
70812007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7082
7083 Use the new code_props interface for destructors and printers.
7084 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
7085 printer_location members, and change the type of the destructor and
7086 printer members to code_props.
7087 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
7088 symbol_printer_get, semantic_type_destructor_set,
7089 semantic_type_printer_set, default_tagged_destructor_set,
7090 default_tagless_destructor_set, default_tagged_printer_set,
7091 default_tagless_printer_set): Use code_props in arguments and return
7092 types in place of char const * and location.
7093 (symbol_destructor_location_get, symbol_printer_location_get): Remove
7094 since the locations are now contained in the return of
7095 symbol_destructor_get and symbol_printer_get.
7096 * src/output.c (symbol_destructors_output, symbol_printers_output):
7097 Replace with...
7098 (symbol_code_props_output): ... this to eliminate duplicate code.
7099 (output_skeleton): Update to use symbol_code_props_output.
7100 * src/reader.c (symbol_should_be_used): Update use of
7101 symbol_destructor_get.
7102 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7103 Update uses of the various _destructor_set and _printer_set functions.
7104 * src/symtab.c: (default_tagged_destructor_location,
7105 default_tagless_destructor_location, default_tagged_printer_location,
7106 default_tagless_printer_location): Remove since we...
7107 (default_tagged_destructor, default_tagless_destructor,
7108 default_tagged_printer, default_tagless_printer): ... change the type
7109 of these to code_props.
7110 (symbol_new, semantic_type_new, symbol_destructor_set,
7111 semantic_type_destructor_set, symbol_destructor_get,
7112 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
7113 symbol_check_alias_consistency, default_tagged_destructor_set,
7114 default_tagless_destructor_set, default_tagged_printer_set,
7115 default_tagless_printer_set): Update.
7116 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
7117 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
7118 code_props members.
7119 (symbol_print): Use SYMBOL_CODE_PRINT.
7120
f6857bbf
JD
71212007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7122
7123 Use the new code_props interface for rule actions.
7124 * src/symlist.h (symbol_list): Replace action, action_location, and
7125 used members with a code_props action_props member.
7126 * src/reader.c (symbol_should_be_used, grammar_rule_check,
7127 grammar_midrule_action, grammar_current_rule_merge_set,
7128 grammar_current_rule_symbol_append, packgram): Update.
7129 * src/scan-code.h (translate_rule_action): Remove, no longer used.
7130 * src/scan-code.l (handle_action_dollar): Update.
7131 (translate_rule_action): Remove, no longer used.
7132 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
7133
7c0c6181
JD
71342007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7135
7136 Use the new code_props interface in parse-gram.y.
7137 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
7138 Update all uses of translate_* functions to use the new code_props
7139 interface and to use gram_scanner_last_string_free and
7140 code_scanner_last_string_free where possible.
7141 (grammar_declaration): symbol_list_destructor_set and
7142 symbol_list_printer_set now perform the translation, so don't do it
7143 here. Use gram_scanner_last_string_free where possible.
7144 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
7145 translate_code): Remove, no longer used.
7146 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
7147 symbol_list_printer_set): Perform code translation here rather than
7148 depending on the caller to do so.
7149
7150 * src/symlist.h (struct symbol_list): Correct some documentation typos.
7151 * src/scan-gram.h (gram_last_string): Remove declaration.
7152 * src/scan-gram.l (last_string): Declare it static.
7153
28e52c0d
JD
71542007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7155
7156 Encapsulate code properties and related functionality for the various
7157 destructors, printers, and actions into a code_props structure and
7158 interface. This patch merely implements code_props in scan-code.h and
7159 scan-code.l. Future patches will rewrite other modules to use it.
7160 Discussed starting at
7161 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
7162 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
7163 consistently initialize const structs that have an empty location
7164 field.
7165 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
7166 to ensure consistency.
7167 * src/scan-code.h (code_props): New structure.
7168 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
7169 function, macro, and const global variable for initializing a
7170 code_props with no code.
7171 (code_props_plain_init, code_props_symbol_action_init,
7172 code_props_rule_action_init, code_props_translate_code): The rest of
7173 the new code_props functional interface. Among other things, the init
7174 functions set the code_props kind field so that
7175 code_props_translate_code will know whether to behave like
7176 translate_symbol_action, translate_rule_action, or translate_code.
7177 These old translate functions must remain until all other modules are
7178 updated to use the new code_props interface.
7179 (code_scanner_last_string_free): New function similar to
7180 gram_scanner_last_string_free.
7181 (code_scanner_free): Add documentation.
7182 * src/scan-code.l: Implement the new interface.
7183 (code_lex): Make it static, add a code_props* argument, and remove the
7184 rule argument.
7185 (last_string): New static global similar to the one in scan-gram.l.
7186 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
7187 instead of rule.
7188 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
7189 code_props since Bison may one day use this information for destructors
7190 and printers.
7191 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
7192 (handle_action_dollar): Use symbol_list_n_get and set used flag
7193 directly since symbol_list_n_used_set is removed.
7194 (translate_action): Add a code_props* argument and remove the rule,
7195 action, and location arguments. Pass the code_props* on to code_lex.
7196 (translate_rule_action, translate_symbol_action, translate_code):
7197 Rewrite as wrappers around the new code_props interface.
7198 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
7199 it would eventually need to break the encapsulation of code_props.
7200
96034983
JD
72012007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7202
7203 * etc/.cvsignore: New.
7204
945e396c
JD
72052007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7206
7207 Add maintainer-push-check to run maintainer-check using push parsing in
7208 place of pull parsing where available.
7209 * Makefile.am (maintainer-push-check): New.
7210 * data/bison.m4 (b4_use_push_for_pull_if): New.
7211 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
7212 appropriately based on their existing values.
7213 (yypush_parse): Don't print push-parser-specific diagnostics if push
7214 parsing is being used in place of pull parsing.
7215 * data/yacc.c: If push parsing should replace pull parsing, redirect to
7216 push.c.
7217 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
7218 variable, and insert b4_use_push_for_pull_flag into muscles.
7219 * tests/Makefile.am (maintainer-push-check): New.
7220
7d596384
JD
72212006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7222
7223 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
7224 (whether successful or failed) so that yypush_parse can be invoked
7225 again to start a new parse using the same yypstate.
7226 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
7227 check multiple yypull_parse invocations on the same yypstate. For pull
7228 mode, extend to check multiple yyparse invocations.
7229 (Exploding the Stack Size with Alloca): Extend to try with
7230 %push-pull-parser.
7231 (Exploding the Stack Size with Malloc): Likewise.
7232
7233 * tests/calc.at (Simple LALR Calculator): Don't specify
7234 %skeleton "push.c" since %push-pull-parser implies that now.
7235 * tests/headers.at (export YYLTYPE): Don't check for the push
7236 declarations. Otherwise, this test case can't be used to see if push
7237 mode can truly emulate pull mode.
7238 * tests/input.at (Torturing the Scanner): Likewise.
7239 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
7240 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
7241 AT_YACC_IF, which now includes the case of push mode since %skeleton
7242 need not be used for push mode. This will be more intuitive once
7243 push.c is renamed to yacc.c.
7244
7172e23e
JD
72452006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7246
7247 For push mode, convert yyparse from a macro to a function, invoke yylex
7248 instead of passing a yylexp argument to yypull_parse, and don't
7249 generate yypull_parse or yyparse unless %push-pull-parser is declared.
7250 Discussed starting at
7251 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
7252 * data/bison.m4 (b4_pull_if): New.
7253 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
7254 * data/push.c: Improve M4 quoting a little.
7255 (b4_generate_macro_args, b4_parenthesize): Remove.
7256 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
7257 any time a pull parser is requested.
7258 Don't #define this as a wrapper around yypull_parse. Instead, when
7259 both push and pull are requested, make it a function that does that
7260 same thing.
7261 (yypull_parse): If there's a b4_prefix, #define this to
7262 b4_prefix[pull_parse] when both push and pull are requested.
7263 Don't define this as a function unless both push and pull are
7264 requested.
7265 Remove the yylexp argument and hard-code yylex invocation instead.
7266 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
7267 %push-parser.
7268 * src/getargs.c (pull_parser): New global initialized to true.
7269 * getargs.h (pull_parser): extern it.
7270 * src/output.c (prepare): Insert pull_flag muscle.
7271 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
7272 (prologue_declaration): Set both push_parser and pull_parser = true for
7273 %push-pull-parser. Set push_parser = true and pull_parser = false for
7274 %push-parser.
7275 * src/scan-gram.l: Don't accept %push_parser as an alternative to
7276 %push-parser since there's no backward-compatibility concern here.
7277 Scan %push-pull-parser.
7278 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
7279 instead of %push-parser.
7280 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
7281 prototype it in the module that calls yyparse.
7282 * tests/input.at (Torturing the Scanner): Likewise.
7283 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
7284
2e7944cb
JD
72852006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
7286
7287 Update etc/bench.pl. Optimize push mode a little (the yyn change
7288 deserves most of the credit).
7289 * Makefile.am (SUBDIRS): Add etc subdirectory.
7290 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
7291 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
7292 yytoken, yyval, and yyloc declarations to...
7293 (yyparse or yypush_parse): ... here to improve performance. For
7294 yypush_parse invocations after the first, be sure to assign yyn its old
7295 value again.
7296 (yypstate_new): Don't bother initializing the yyresult field since the
7297 initial value isn't used.
7298 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
7299 remove the #define that, in push mode, set it to yyps->NAME.
7300 * etc/Makefile.am: New.
7301 * etc/bench.pl: Remove and build it instead from...
7302 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
7303 "tests/bison" from the build directory by default rather than just
7304 invoking "bison" from $PATH.
7305 (calc_grammar): Update push parser code: don't declare yylval globally,
7306 don't define yyparse_wrapper, and don't #define yyparse.
7307 (bench_grammar): Update to check all working combinations of yacc.c,
7308 push.c, impure, pure, pull, and push.
7309
c3d50342
JD
73102006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7311
7312 For push mode, add pull wrappers around yypush_parse.
7313 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
7314 (yypull_parse): New function wrapping yypush_parse.
7315 (yyparse): New #define wrapping yypull_parse.
7316 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
7317 is declared.
7318 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
7319 prototype yylex in the module that calls yyparse, and don't prototype
7320 yyparse there. Otherwise, the yyparse expansion won't compile.
7321 * tests/input.at (Torturing the Scanner): Likewise.
7322
94ebeba5
JD
73232006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7324
7325 Enable push parsers to operate in impure mode. Thus, %push-parser no
7326 longer implies %pure-parser. The point of this change is to move
7327 towards being able to test the push parser code by running the entire
7328 test suite as if %push-parser had been declared.
7329 * data/push.c (yypush_parse): For impure mode, remove the
7330 yypushed_char, yypushed_val, and yypushed_loc arguments.
7331 Instead, declare these as local variables initialized to the global
7332 yychar, yylval, and yylloc.
7333 For the first yypush_parse invocation only, restore the initial values
7334 of these global variables when it's time to read a token since they
7335 have been overwritten.
7336 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
7337 %push-parser.
7338 * tests/calc.at (Simple LALR(1) Calculator): Always declare
7339 %pure-parser along with %push-parser since this test case was designed
7340 for pure push parsers.
7341 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
7342 (AT_YACC_OR_PUSH_IF): New.
7343 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
7344 add a note that it's still wrong for some cases (as it has been for a
7345 while).
7346 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
7347 %push-parser no longer implies %pure-parser.
7348
a0633178
JD
73492006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7350
7351 Remove some unnecessary differences between the pull parser code and
7352 the push parser code. This patch enables yynerrs in push mode.
7353 * data/push.c: Reformat M4 a little.
7354 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
7355 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
7356 because push mode is on. Instead, if pure mode is on, move yynerrs
7357 to...
7358 (b4_declare_parser_state_variables): ... here.
7359 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
7360 to yyps->NAME so it can be used in yypush_parse.
7361 (yypush_parse): Don't omit uses of yynerrs in push mode.
7362
8646b6a3
JD
73632006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7364
7365 Fix bug such that the first pushed token's value and location are
7366 sometimes overwritten (sometimes by %initial-action) before being used.
7367 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
7368 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
7369 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
7370 more closely mimic the pull parser logic.
7371 Don't copy the pushed token to yychar, yylval, and yylloc until it's
7372 time to read a token, which is after any initialization of yylval and
7373 yylloc.
7374 (gottoken): Rename label to...
7375 (yyread_pushed_token): ... for clarity and to avoid infringing on the
7376 user namespace.
7377
9baf4d74
JD
73782006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7379
7380 Rearrange initialization of the parser state variables so that the
7381 skeleton doesn't have to have a copy for pull mode and another for push
7382 mode. This patch also fixes at least a bug such that yylloc was not
7383 initialized (with b4_location_initial_line and
7384 b4_location_initial_column) upon calling yypush_parse. However, that
7385 initialization now overwrites the first token's location;
7386 %initial-action assigning @$ already did the same thing, and both bugs
7387 will be fixed in a later patch.
7388 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
7389 (b4_declare_parser_state_variables): Remove initialization of yytoken,
7390 yyss, yyvs, yyls, and yystacksize.
7391 (yypstate_new): Remove initialization of some yypstate fields: yystate,
7392 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
7393 yylsp.
7394 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
7395 yyps->NAME so it can be used in yypush_parse.
7396 (yyparse or yypush_parse): For yypush_parse, don't print the
7397 "Starting parse" diagnostic for invocations after the first.
7398 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
7399 yypush_parse, only do it for the first invocation.
7400 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
7401 initialization to occur in yypush_parse but only on the first
7402 invocation.
7403
23522164
JD
74042006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7405
7406 * data/push.c: Add CPP guards around push parser declarations in both
7407 the header and the code file.
7408 In the code file, move the push parser declarations to the same place
7409 they appear in the header file.
7410 Clean up the M4 some, especially the inconsistent underquoting in
7411 some b4_c_function_def and b4_c_function_decl uses.
7412
bb010fe5
JD
74132006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7414
7415 Encapsulate the push parser state variables into an M4 macro so the
7416 push skeleton doesn't have to list them again for pull mode's yyparse.
7417 For push mode, remove yypush_parse's local equivalents of these
7418 variables to eliminate unnecessary copying between the two sets at
7419 run-time. This patch also fixes at least a bug related to multiple
7420 %initial-action invocations in push mode.
7421 * data/push.c (b4_declare_parser_variables): Rename to...
7422 (b4_declare_scanner_communication_variables): ... this for clarity and
7423 update both uses.
7424 (b4_declare_yyparse_variables): Remove and move its contents to the one
7425 spot where it was invoked.
7426 (b4_declare_parser_state_variables): New macro containing the parser
7427 state variables required by push mode.
7428 (struct yypstate): Replace all fields but yynew with
7429 b4_declare_parser_state_variables.
7430 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
7431 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
7432 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
7433 (yyparse or yypush_parse): For yyparse in pull mode, replace local
7434 parser state variable declarations with
7435 b4_declare_parser_state_variables.
7436 Don't initialize parser state variables when calling yypush_parse since
7437 yypstate_new already does that.
7438 Invoke the user's initial action only upon the first yypush_parse
7439 invocation.
7440 Remove all code that copies between the local parser state variables
7441 and the yypstate.
7442
2d212f8c
JD
74432006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7444
7445 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
7446 prevent a name collision in a future patch where these names will
7447 sometimes be #define'd.
7448 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
7449 since it no longer has the same name as the existing argument.
7450 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
7451
e6e704dc
JD
74522006-12-19 Paolo Bonzini <bonzini@gnu.org>
7453 and Joel E. Denny <jdenny@ces.clemson.edu>
7454
7455 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
7456 that the argument is case-insensitive, and there's no `=' here.
7457 For the %skeleton entry, mention that %language is better.
7458 (Bison Options): Likewise for --language and --skeleton. Move the
7459 --skeleton entry so that the `Tuning the parser' section is sorted
7460 alphabetically on long options.
7461 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
7462 %language directive in detail here; cross-reference the %language
7463 documentation instead.
7464 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
7465 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 7466 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
7467 * examples/extexi (normalize): Instead of replacing every %require
7468 argument with the current Bison version, just substitute for
7469 `@value{VERSION}'. This guarantees that we're testing what actually
7470 appears in the documentation.
7471 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
7472 rather than `@VERSION@'.
7473
0e021770
PE
74742006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7475
fd575f05
PE
7476 * NEWS: Reword the %language news a bit, and put it earlier.
7477
0e021770
PE
7478 * src/getargs.c (skeleton_arg): Last arg is now location const *.
7479 Rewrite to simplify the logic.
7480 (language_argmatch): Likewise.
fd575f05
PE
7481 (program_name): We now own this var.
7482 * src/getargs.h (struct bison_language): Use char[] rather than
7483 const char *.
0e021770
PE
7484
7485 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
7486 Java is supported.
7487 * src/complain.c (program_name): Remove decl; no longer needed.
7488 * src/main.c (program_name): Remove; now belongs to getargs.
7489
74902006-12-18 Paolo Bonzini <bonzini@gnu.org>
7491
7492 * NEWS: Document %language.
7493
7494 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
7495
7496 * data/c-skel.m4, data/c++-skel.m4: New files.
7497 * data/glr.c: Complain on push parsers.
7498
7499 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
7500 over %skeleton.
148d66d8 7501 (Decl Summary): Document %language and %skeleton.
0e021770
PE
7502 (Command line): Document -L.
7503
7504 * examples/extexi: Rewrite %require directive.
7505 * examples/calc++/Makefile.am: Pass VERSION to extexi.
7506
7507 * src/files.c (compute_exts_from_gc): Look in language structure
7508 for .y extension.
7509 (compute_file_name_parts): Check whether .tab should be added.
7510 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
7511 (language, skeleton_arg, language_argmatch): New.
7512 (long_options): Add --language.
7513 (getargs): Use skeleton_arg, add -L/--language.
7514 * src/getargs.h: Include location.h.
7515 (struct bison_language, language, skeleton_arg, language_argmatch): New.
7516 * src/output.c (prepare): Pick default skeleton from struct language.
7517 Don't dispatch C skeletons here.
7518 * src/parse-gram.y (PERCENT_LANGUAGE): New.
7519 (prologue_declaration): Add "%language" rule, use skeleton_arg.
7520 * src/scan-gram.l ("%language"): New rule.
7521
7522 * tests/calc.at: Test %skeleton and %language.
7523 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
7524 (AT_GLR_IF): Look for %skeleton "glr.cc".
7525 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
7526 (AT_YACC_IF): Reject %language.
7527
5691bf57
PE
75282006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7529
db06f0ce
PE
7530 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
7531 since it wasn't used; only the typedef name 'semantic_type' is needed.
7532 Also, omit trailing white space.
7533
5691bf57
PE
7534 * bootstrap: Sync from coreutils.
7535 (gnulib_extra_files): Add build-aux/announce.gen.
7536 (slurp): Adjust .gitignore files like .cvsignore files.
7537 * build-aux/announce-gen: Remove from CVS, since bootstrap
7538 now creates this.
7539
791934e4
JD
75402006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
7541
7542 Make %push-parser imply %pure-parser. This fixes several bugs; see
7543 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
7544 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
7545 pure_parser = true.
7546 * data/push.c: Don't bother testing b4_push_if when deciding whether
7547 to expand b4_declare_parser_variables globally.
7548 (yypush_parse): Likewise in here.
7549
7550 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
7551 (yy_reduce_print): Reformat M4 for readability.
7552
ee5abb37
JD
75532006-12-15 Bob Rossi <bob@brasko.net>
7554 and Joel Denny <jdenny@ces.clemson.edu>
7555
7556 * data/push.c (yypstate): Add typedef, and update all uses of
7557 struct yypstate to just yypstate.
7558 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
7559
16ca01f9
JD
75602006-12-14 Bob Rossi <bob@brasko.net>
7561
7562 * data/push.c (yypush_parse): Declare prototype regardless of
7563 %locations option.
7564
ab8e7e1a
JD
75652006-12-14 Bob Rossi <bob@brasko.net>
7566
7567 * data/push.c (yyparse): Remove the prototype and the #define when in
7568 push-parser mode.
7569
9bf32be3
JD
75702006-12-13 Bob Rossi <bob@brasko.net>
7571
7572 * data/push.c (yypstate_init): Rename to...
7573 (yypstate_new): ... this and use b4_c_function_def.
7574 (yypstate_delete): New.
7575 (yypush_parse): Change parameters yynval and yynlloc to be const.
7576 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
7577 yypstate_delete functions.
7578
f02e2948
JD
75792006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
7580
7581 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
7582 strange test case titles. Reported by Bob Rossi.
7583
38eb7751
PE
75842006-12-13 Paul Eggert <eggert@cs.ucla.edu>
7585
7586 * TODO: Add pointer to Sylvain Schmitz's work on static detection
7587 of potential ambiguities in GLR grammers.
7588
bd9d212b
JD
75892006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
7590
7591 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
7592 `bison ', use m4_index instead of m4_substr since chopping up a string
7593 containing M4-special characters causes problems here.
7594
7595 Fix a couple of bugs related to special characters in user-specified
7596 file names, and make it easier for skeletons to compute output file
7597 names with the same file name prefix as Bison-computed output file
7598 names.
7599 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
7600 b4_parser_file_name and b4_spec_defines_file instead of
7601 @output_parser_name@ and @output_header_name@, which are now redundant.
7602 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
7603 b4_parser_file_name, b4_spec_defines_file, and the new
7604 @basename(FILENAME@) instead of @output_parser_name@ and
7605 @output_header_name@, which inappropriately escaped the file names as
7606 C string literals.
7607 * src/files.c (all_but_ext): Remove static qualifier.
7608 (compute_output_file_names): Move `free (all_but_ext)' to...
7609 (output_file_names_free): ... here since all_but_ext is needed later.
7610 * src/files.h (all_but_ext): Extern.
7611 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
7612 exactly what MUSCLE_INSERT_STRING used to do.
7613 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
7614 characters are escaped properly.
7615 * src/output.c (prepare): Define muscle file_name_all_but_ext as
7616 all_but_ext.
7617 For pkgdatadir muscle, maintain previous functionality by using
7618 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
7619 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
7620 digraphs would never be expanded. Hopefully no one has M4-special
7621 characters in his Bison installation path.
7622 * src/scan-skel.l: Don't parse @output_header_name@ and
7623 @output_parser_name@ anymore since they're now redundant.
7624 In @output, use decode_at_digraphs.
7625 Parse a new @basename command that invokes last_component.
7626 (decode_at_digraphs): New.
7627 (BASE_QPUTS): Remove unused.
7628 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
7629 (Output file name): New tests.
7630
3f7ca628
JD
76312006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
7632
7633 Warn about output files that are generated by the skeletons and that
7634 conflict with other output files.
7635 * data/glr.c: Don't generate the header file here when glr.cc does.
7636 * src/files.c (file_names, file_names_count): New static globals.
7637 (compute_output_file_names): Invoke output_file_name_check for files
7638 not generated by the skeletons and remove existing checks.
7639 (output_file_name_check): New function that warns about conflicting
7640 output file names.
7641 (output_file_names_free): Free file_names.
7642 * src/files.h (output_file_name_check): Declare.
7643 * src/scan-skel.l: Invoke output_file_name_check for files generated by
7644 the skeletons.
7645 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
7646 (Conflicting output files): New tests.
7647
178e123e
PE
76482006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7649
7650 * doc/bison.texinfo: Fix a couple of typos.
7651
76522006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
7653
7654 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
7655 Rename to...
7656 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
7657 update all uses.
7658 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
7659 (yypush_parse): Rename yypvars argument to yyps and remove redundant
7660 local pv.
7661 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
7662 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
7663
ea17f233
JD
76642006-12-07 Bob Rossi <bob@brasko.net>
7665 and Joel Denny <jdenny@ces.clemson.edu>
7666
7667 * data/push.c (yypvarsinit): Change return type from void* to struct
7668 yypvars*. No longer cast to void* on return.
7669 (struct yypvars): Remove yylen since it need not be remembered between
7670 yypushparse invocations.
7671 (yypushparse): Don't copy between yylen and pv->yylen.
7672
55a30bda
JD
76732006-12-05 Bob Rossi <bob@brasko.net>
7674
7675 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
7676 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
7677 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
7678 (struct yypvars): Remove b4_declare_parser_variables.
7679 (yypvarsinit): Remove init code for removed variables.
7680 (global scope): Do not declare b4_declare_parser_variables if
7681 push or pure mode.
7682 (yypushparse): Add b4_declare_parser_variables.
7683 Init new local variables, and remove init code for removed
7684 yypvars variables.
7685 (yyparse): Delete.
7686 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
7687 and yyparse for other modes.
7688 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
7689 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
7690 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
7691 (AT_PURE_LEX_IF): True if pure or push parser.
7692
85894313
JD
76932006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
7694
7695 Document Yacc prologue alternatives and default %destructor's and
7696 %printer's as experimental. Don't mention Java yet. Discussed at
7697 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
7698 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
7699 (2.3a): Annotate this entry to say the old forms of these features were
7700 also experimental.
7701 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 7702 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
7703 of Java (we'll want this back eventually).
7704
02975b9a
JD
77052006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
7706
7707 Support a file name argument to %defines. Deprecate `=' in
7708 %file-prefix, %name-prefix, and %output. Discussed at
7709 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
7710 * NEWS (2.3a+): Mention.
148d66d8 7711 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
7712 form of %defines, and remove `=' from entries for %file-prefix,
7713 %name-prefix, and %output.
7714 * src/parse-gram.y (prologue_declaration): Implement.
7715 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
7716 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
7717 all but one occurrence of %name-prefix.
7718 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
7719 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
7720 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
7721 occurrence of each of %file-prefix and %output. Add check for %defines
7722 with argument.
7723 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
7724 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
7725 Remove the `=' from %output.
7726
287b314e
JD
77272006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
7728
7729 Don't escape $ in test case titles since Autoconf 2.61 now does that
7730 correctly.
7731 * tests/actions.at (Default %printer and %destructor are not for error
7732 or $undefined): Here.
7733 (Default %printer and %destructor are not for $accept): Here.
7734 * tests/input.at (Invalid $n and @n): Here.
7735
3ebecc24
JD
77362006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
7737
7738 Rename <!> to <>. Discussed starting at
7739 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
7740 * NEWS (2.3a+): Update.
148d66d8 7741 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
7742 Update.
7743 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
7744 * src/scan-gram.l (INITIAL): Implement.
7745 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
7746 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
7747 comment.
7748 * tests/actions.at (Default tagless %printer and %destructor,
7749 Default tagged and per-type %printer and %destructor,
7750 Default %printer and %destructor are not for error or $undefined,
7751 Default %printer and %destructor are not for $accept,
7752 Default %printer and %destructor for mid-rule values): Update.
7753 * tests/input.at (Default %printer and %destructor redeclared,
7754 Unused values with default %destructor): Update.
7755
26b8a438
JD
77562006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
7757
7758 Don't let %prec take a nonterminal.
7759 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
7760 token.
7761 * tests/input.at (%prec takes a token): New test checking that %prec
7762 won't take a nonterminal.
7763
07c39ae9
JD
77642006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7765
405d53b7
JD
7766 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
7767 it was double-quoted.
07c39ae9
JD
7768 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
7769 grammar is maintained with Bison's highest standards.
7770 * src/getargs.c: Fix some typos in Doxygen comments.
7771
580b8926
JD
77722006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7773
7774 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
7775 later. Reported by Paul Eggert in
7776 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
7777 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
7778 * src/scan-code.l (translate_action): Don't bother invoking
7779 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
7780 (code_scanner_free): Instead of invoking
7781 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
7782 which frees more.
7783 * src/scan-gram.l (gram_scanner_free): Likewise.
7784 * src/scan-skel.l (scan_skel): Likewise.
7785
4502eadc
JD
77862006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
7787
7788 * src/files.c (tr): Change return type to void.
7789 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
7790 has been called previously for the same key.
7791 (muscle_find): Return storage instead of value so that
7792 --enable-gcc-warnings doesn't produce warnings that the return discards
7793 const. aver that the value and storage are the same since storage
7794 could potentially be NULL when value is not.
7795 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
7796 same as 0.
7797
7746c8f6
PE
77982006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7799
7800 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
7801 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
7802 us a slightly cleaner distribution, and also works.
7803 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
7804 gnulib changes.
7805
eb095650
PE
78062006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
7807 and Paul Eggert <eggert@cs.ucla.edu>
7808
7809 Don't let Bison leak memory except when it complains.
7810 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
7811 (spec_defines_file, dir_prefix): Now char *, not const char *,
7812 since they are freed.
7813 * src/files.c: Likewise.
7814 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
7815 Likewise.
7816 (tr): Now operates in-place. All uses changed.
7817 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
7818 values.
7819 (compute_file_name_parts, compute_output_file_names): Don't store
7820 read-only data in variables that will be freed.
7821 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
7822 src_extension, and header_extension.
7823 (output_file_names_free): New public function to free
7824 spec_verbose_file, spec_graph_file, spec_defines_file,
7825 parser_file_name, and dir_prefix.
7826 * src/getargs.c (getargs): Don't store read-only data in variables that
7827 will be freed.
7828 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
7829 (which previously existed but was unused), and quotearg_free.
7830 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
7831 * src/muscle_tab.c: Likewise.
7832 (muscle_entry): Make the value char const *,
7833 and add a new storage member that is char * and can be freed.
7834 (muscle_entry_free): New private function.
7835 (muscle_init): Use it instead of free.
7836 (muscle_insert, muscle_grow): Update and use new storage member.
7837 (muscle_code_grow): Free the string passed to muscle_grow
7838 since it's not needed anymore.
7839 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
7840 add a new `char *code' member.
7841 ("{...}"): Declare semantic type as code.
7842 * src/scan-code.h (translate_rule_action):
7843 (translate_symbol_action, translate_code, translate_action): Return
7844 `char const *' rather than `char *' since external code should not free
7845 these strings.
7846 * src/scan-code.l: Likewise.
7847 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
7848 which is "{...}" in the parser.
7849 * tests/Makefile.am (maintainer-check-valgrind): Set
7850 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
7851 Valgrind.
7852 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
7853 complain.
7854 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
7855 expecting a non-zero exit status sets --leak-check=summary and
7856 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
7857 this case, and we don't want to hear about it.
7858
ac564be4
PE
78592006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7860
7861 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
7862 instead of from the template, to simplify configuration a bit.
7863 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
7864 and m4/wint_t.m4, as they are needed with the latest gnulib.
7865
17bd8a73
JD
78662006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7867
7868 Disable unset/unused mid-rule value warnings by default, and recognize
7869 --warnings=midrule-values to enable them. Discussed starting at
7870 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
7871 * NEWS (2.3a+): Mention.
7872 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
7873 warnings): Add entry for midrule-values subargument.
7874 * src/reader.c (symbol_should_be_used): Don't return true just because
7875 the value is a set/used mid-rule value unless
7876 --warnings=midrule-values was specified.
7877 * tests/input.at (Unused values, Unused values before symbol
7878 declarations): Run tests with and without --warnings=midrule-values.
7879
7880 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
7881 than LIST_FREE directly.
7882
89eb3c76
JD
78832006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7884
7885 Finish implementing --warnings=error, which should not be implied by
7886 --warnings=all (or by its synonyms -W and --warnings without
7887 subarguments).
7888 * src/complain.c (set_warning_issued): New function to report that
7889 warnings are being treated as errors and to record an error if so.
7890 Invoke...
7891 (warn_at, warn): ... here.
7892 * src/getargs.c (warnings_args, warnings_types): Reorder so that
7893 "error - warnings are errors" does not appear above "all - all of the
7894 above".
7895 (getargs): For -W and --warnings without subarguments, don't let
7896 FLAGS_ARGMATCH set warnings_error in warnings_flag.
7897 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
7898
ba7560e2
JD
78992006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7900
7901 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
7902 empty subargument list. For example: `bison --warnings= parser.y'.
7903
31283fc3
JD
79042006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7905
7906 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
7907 the parser header file so that gcc doesn't warn.
7908
12e35840
JD
79092006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7910
7911 Split the default %destructor/%printer into two kinds: <*> and <!>.
7912 Discussed starting at
7913 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
7914 * NEWS (2.3a+): Mention.
7915 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
7916 previous change today related to mid-rules.
148d66d8 7917 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 7918 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
7919 (TYPE_TAG_ANY): Add as <*>.
7920 (TYPE_TAG_NONE): Add as <!>.
7921 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
7922 for <*> and <!>.
7923 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
7924 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
7925 * src/symlist.c (symbol_list_default_new): Split into tagged and
7926 tagless versions.
7927 (symbol_list_destructor_set, symbol_list_printer_set): Split
7928 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
7929 SYMLIST_DEFAULT_TAGLESS.
7930 * src/symlist.h: Update symbol_list_default*_new prototypes.
7931 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
7932 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
7933 * src/symtab.c (default_destructor, default_destructor_location,
7934 default_printer, default_printer_location): Split each into tagged and
7935 tagless versions.
7936 (symbol_destructor_get, symbol_destructor_location_get,
7937 symbol_printer_get, symbol_printer_location_get): Implement tagged
7938 default and tagless default cases.
7939 (default_destructor_set, default_printer_set): Split each into tagged
7940 and tagless versions.
7941 * src/symtab.h: Update prototypes.
7942 * tests/actions.at (Default %printer and %destructor): Rename to...
7943 (Default tagless %printer and %destructor): ... this, and extend.
7944 (Per-type %printer and %destructor): Rename to...
7945 (Default tagged and per-type %printer and %destructor): ... this, and
7946 extend.
7947 (Default %printer and %destructor for user-defined end token): Extend.
7948 (Default %printer and %destructor are not for error or $undefined):
7949 Update.
7950 (Default %printer and %destructor are not for $accept): Update.
7951 (Default %printer and %destructor for mid-rule values): Extend.
7952 * tests/input.at (Default %printer and %destructor redeclared): Extend.
7953 (Unused values with default %destructor): Extend.
7954
f91b1629
JD
79552006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7956
7957 Don't apply the default %destructor/%printer to an unreferenced midrule
7958 value. Mentioned at
7959 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
7960 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
7961 like $@n instead of just @n so that the default %destructor/%printer
7962 logic doesn't see them as user-defined symbols.
7963 (symbol_is_dummy): Check for both forms of the name.
7964 * src/reader.c (packgram): Remove the `$' from each midrule symbol
7965 name for which the midrule value is referenced in any action.
7966 * tests/actions.at (Default %printer and %destructor for mid-rule
7967 values): New test.
7968 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
7969 for change to dummy symbol names.
7970
519d0004
JD
79712006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7972
7973 Warn about unset midrule $$ if the corresponding $n is used.
7974 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
7975 $n usage.
7976 (packgram): Before invoking grammar_rule_check on any rule, make sure
7977 all actions have already been scanned in order to set `used' flags.
7978 Otherwise, checking that a midrule's $$ is set will not always work
7979 properly because the midrule check must forward-reference the midrule's
7980 parent rule.
7981 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
7982 warning.
7983
a501eca9
JD
79842006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7985
7986 More improvements to the documentation of the prologue alternatives:
7987 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
7988 Bison manual.
7989 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
7990 some text to clarify the relative importance of the new directives and
7991 to show how these directives may be viewed as code labels.
7992
2cbe6b7f
JD
79932006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
7994
7995 Similar to the recently removed %before-header, add %code-top as the
7996 alternative to the pre-prologue. Mentioned at
7997 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
7998 Also, let the prologue alternatives appear in the grammar section.
7999 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
8000 (prologue_declaration): Move the existing prologue alternatives to...
8001 (grammar_declaration): ... here and add %code-top.
8002 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
8003
8004 Clean up and extend documentation for the prologue alternatives.
8005 * NEWS (2.3a+): Describe prologue alternatives.
8006 * doc/bison.texinfo (Prologue): Move discussion of prologue
8007 alternatives to...
8008 (Prologue Alternatives): ... this new section, and extend it to discuss
8009 all 4 directives in detail.
148d66d8
JD
8010 (Table of Symbols): Clean up discussion of prologue alternatives and
8011 add %code-top.
2cbe6b7f 8012
e557d3ea
JMG
80132006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8014
8015 DJGPP specific issues.
8016
8017 * djgpp/config.bat: config.hin has been moved to lib. Adjust
8018 config.bat accordingly.
8019 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
8020 * djgpp/config.site: Likewise.
8021
136a0f76
PB
80222006-10-16 Paolo Bonzini <bonzini@gnu.org>
8023
27bd5d67
PB
8024 Replace %*-header with %provides, %requires, %code. See discussion at
8025 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
8026
136a0f76
PB
8027 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
8028 (b4_user_start_header): Remove.
8029 * data/glr.c: Use new macros instead of b4_*start_header
8030 and b4_*end_header.
8031 * data/glr.cc: Likewise.
8032 * data/lalr1.cc: Likewise.
8033 * data/push.c: Likewise.
8034 * data/yacc.c: Likewise.
8035
8036 * doc/bison.texinfo: Remove %before-header, rename
8037 %{start,end,after}-header to %requires, %provides, %code.
8038
8039 * src/parse-gram.y: Likewise (also rename token names accordingly).
8040 * src/scan-gram.l: Likewise.
8041 * tests/actions.at: Likewise.
8042
10f429ef
PE
80432006-10-14 Paul Eggert <eggert@cs.ucla.edu>
8044
8045 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
8046 Problem reported by Joel E. Denny.
8047
80482006-10-14 Jim Meyering <jim@meyering.net>
8049
8050 (Sync from coreutils.)
8051 Work also when the working directory (with e.g. coreutils sources)
8052 is version controlled with git, rather than CVS.
8053 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
8054 rather than CVS.
8055 In messages and comments, say e.g., "checked-out sources",
8056 rather than "CVS sources".
8057 (version_controlled_file): New function. Work for git as well as
8058 for CVS. Don't use grep's -q option.
8059 (slurp): Call it here, in place of CVS-specific code.
8060
c4bd5bf7
JD
80612006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
8062
8063 Fix testsuite for ./configure --enable-gcc-warnings:
8064 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
8065 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
8066 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
8067 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
8068 * test/regression.at (Diagnostic that expects two alternatives):
8069 Likewise.
8070
46356ea4
PE
80712006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8072
231ed89a
PE
8073 * bootstrap.conf (gnulib_modules): Add config-h.
8074 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
8075 worry about HAVE_CONFIG_H.
8076 * lib/abitset.c: Likewise.
8077 * lib/bitset.c: Likewise.
8078 * lib/bitset_stats.c: Likewise.
8079 * lib/bitsetv-print.c: Likewise.
8080 * lib/bitsetv.c: Likewise.
8081 * lib/ebitset.c: Likewise.
8082 * lib/get-errno.c: Likewise.
8083 * lib/lbitset.c: Likewise.
8084 * lib/subpipe.c: Likewise.
8085 * lib/timevar.c: Likewise.
8086 * lib/vbitset.c: Likewise.
8087 * lib/bitset.c: Include "bitset.h" first, to test interface.
8088 * lib/bitset_stats.c: Include "bitset_stats.h" first.
8089 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
8090 * lib/bitsetv.c: Include "bitsetv.h" first.
8091 * lib/get-errno.c: Include "get-errno.h" first.
8092 * m4/.cvsignore: Add config-h.m4.
8093 * tests/actions.at (Default %printer and %destructor for ...):
8094 Adjust expected line numbers in output to reflect removal of #if
8095 HAVE_CONFIG_H lines.
8096 * tests/glr-regression.at (Missed %merge type warnings when ...):
8097 Likewise.
8098 * tests/regression.at (Braced code in declaration in rules section):
8099 Likewise.
8100 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
8101 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
8102 Include <config.h> unconditionally.
8103
46356ea4
PE
8104 * bootstrap: Sync from coreutils, as follows:
8105
8106 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8107
8108 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
8109 variable was sometimes used without being initialized. This
8110 messed up the installation of the INSTALL file in some cases.
8111
8112 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8113
8114 * bootstrap (usage, main program, symlink_to_gnulib): Add option
8115 --copy. Inspired by a suggestion from Bruno Haible.
8116
8117 2006-10-03 Jim Meyering <jim@meyering.net>
8118
8119 * bootstrap: Undo last change to this file, since now gnulib-tool
8120 sticks with the automake default in generating dependencies.
8121
dd4bf078
PE
81222006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8123
cf2a5f7c
PE
8124 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
8125 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
8126
8127 * doc/bison.1: Add copyright notice.
8128
8129 * data/glr.c: Don't include <stdarg.h>; not used.
8130
35fe0834
PE
8131 * NEWS: The -g and --graph options now output graphs in Graphviz
8132 DOT format, not VCG format.
8133 * doc/bison.1: Likewise.
8134 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
8135 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
8136 of this change in
8137 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
8138 * TODO: Remove Graphviz entry.
8139 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
8140 remove vcg.c, vcg.h, vcg_defaults.h.
8141 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
8142 * src/graphviz.c, src/graphviz.h: New files.
8143 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
8144 * src/files.h: Make comment more generic.
8145 * src/main.c (main): Likewise.
8146 * src/print_graph.h: Likewise.
8147 * src/getargs.c (usage): Make usage description more generic.
8148 * src/print_graph.c: Include graphviz.h rather than vcg.h.
8149 (static_graph, fgraph): Remove. All uses changed to pass
8150 arguments instead of sharing a static var.
8151 (print_core, print_actions, print_state, print_graph):
8152 Output graphviz format rather than VCG format.
8153 * tests/.cvsignore: Remove *.vcg; add *.dot.
8154 * tests/output.at: Expect *.dot files, not *.vcg files.
8155
dd4bf078
PE
8156 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
8157 accommodates the 2006-10-08 change.
8158
efdd7421
PE
81592006-10-11 Bob Rossi <bob@brasko.net>
8160
8161 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
8162 (b4_yyssa, b4_yyerror_range): New macros.
8163 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
8164 (yypvarsinit): Remove init of removed fields.
8165 (yypushparse): Remove use of removed fields; use new macros instead.
8166
96a1981a
PE
81672006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8168
8169 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
8170 in a push parser. Reindent slightly to match yacc.c better.
8171
81722006-10-11 Bob Rossi <bob@brasko.net>
8173
46356ea4
PE
8174 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
8175 yymsg_alloc fields.
8176 (yypvarsinit, yypushparse): Remove init of removed fields.
8177 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 8178
c1630a8b
PE
81792006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8180
8181 * THANKS: Add Paolo Bonzini and Bob Rossi.
8182
90b9908d
PB
81832006-10-08 Paolo Bonzini <bonzini@gnu.org>
8184
8185 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
8186 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
8187 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
8188 b4_define_user_cde and uses): Remove.
8189 (b4_comment, b4_prefix, b4_sync_start): New.
8190 * data/bison.m4: New file, with most of the content removed from c.m4.
8191 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
8192 * src/output.c (output_skeleton): Pass bison.m4.
8193 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
8194 only if specified.
8195
cf806753
PE
81962006-10-05 Paul Eggert <eggert@cs.ucla.edu>
8197
8198 Fix test failure reported by Tom Lane in
8199 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
8200 and try to make such failures easier to catch in the future.
8201 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
8202 that's now the caller's responsibility.
8203 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
8204 Set yychar = YYEOF if it's negative.
8205 * tests/actions.at (yylex): Abort if asked to read past EOF.
8206 * tests/conflicts.at (yylex): Likewise.
8207 * tests/cxx-type.at (yylex): Likewise.
8208 * tests/glr-regression.at (yylex): Likewise.
8209 * tests/input.at (yylex): Likewise.
8210 * tests/regression.at (yylex): Likewise.
8211 * tests/torture.at (yylex): Likewise.
8212
0e2f006a
PE
82132006-10-01 Paul Eggert <eggert@cs.ucla.edu>
8214
8215 Fix problems with translating English-language diagnostics.
8216 * bootstrap: Fix bug introduced in recent bootstrap changes, with
8217 respect to bison-runtime pot generation. The YY_ stuff
8218 wasn't being captured.
8219 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
8220 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
8221 * runtime-po/POTFILES.in: Add data/push.c.
8222
e3ddc1e3
PE
82232006-09-29 Paul Eggert <eggert@cs.ucla.edu>
8224
8225 Merge bootstrap changes from coreutils.
8226
8227 2006-09-28 Jim Meyering <jim@meyering.net>
8228
8229 Automatically generated dependencies are important even
8230 when all of the sources in a directory come from gnulib.
8231 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
8232 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
8233
8234 2006-09-23 Jim Meyering <jim@meyering.net>
8235
8236 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
8237
8238 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8239
8240 * bootstrap: Add support for --force.
8241 (usage): New function. Describe usage less tersely.
8242 (CVS_only_file): New var.
8243
01e972b3
PE
82442006-09-21 Paul Eggert <eggert@cs.ucla.edu>
8245
8246 * data/push.c (YYPUSH_MORE): Make it an enum instead.
8247 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
8248 Adjust white space and comments to match GNU style better.
8249
c63d3e90
PE
82502006-09-20 Bob Rossi <bob@brasko.net>
8251
8252 * data/push.c (yyresult_get): Remove function.
8253 (YYPUSH_MORE): Add #define.
8254 (yypushparse): Modify return value.
8255
e70f46d1
PE
82562006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8257
8258 * stamp-h.in: Remove; no longer needed.
8259 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
8260 Remove config.h, config.hin, intl (no longer created).
8261 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
8262 stamp-h1.
8263
8264 Sync bootstrap from coreutils, as follows:
8265
8266 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
8267
8268 * bootstrap (symlink_to_gnulib): New function.
8269 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
8270 to copies-of-gnulib.
8271 (cp_mark_as_generated, slurp, gnulib_files):
8272 Avoid making a copy if it's the same as the old version.
8273 (gnulib_files): Add support for this variable (used by Bison).
8274
a92be413
PE
82752006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8276
8277 * src/getargs.c (usage): Rework to use conventions similar to
8278 coreutils, to make translation a bit easier and the code a bit
8279 smaller. Problem reported by Tim Van Holder.
8280
4f82b42a
PE
82812006-09-15 Paul Eggert <eggert@cs.ucla.edu>
8282
3b2942e6
PE
8283 Use some of gnulib's new modules, taken from coreutils.
8284
8285 * bootstrap: Sync from coreutils, except add support for gnulib_files.
8286 * bootstrap.conf: New file.
8287 (gnulib_modules): Add configmake, inttypes, unistd.
8288 (XGETTEXT_OPTIONS): Add complain, complain_at,
8289 fatal, fatal_at, warn, warn_at, unexpected_end.
8290 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
8291 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
8292 (gl_EARLY): Add.
8293 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
8294 (gl_INIT): Add
8295 (GNULIB_AUTOCONF_SNIPPET): Remove.
8296 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
8297 the pickiest.
8298 * lib/.cvsignore: Add inttypes_.h.
8299 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
8300 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
8301 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
8302 no-longer-necessary initializations.
8303 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
8304 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
8305 use the unistd module.
8306 * src/system.h: Likewise.
8307 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
8308 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
8309 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
8310 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
8311 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
8312 * src/system.h: Include inttypes.h unconditionally, now that we
8313 use the inttypes module. Don't bother to include stdint.h, since
8314 inttypes.h now does that for us.
8315 (LOCALEDIR): Remove, now that we use the configmake module.
8316 * src/getargs.c: Include configmake.h.
8317 * src/main.c: Likewise.
8318 * src/output.c: Likewise.
8319 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
8320 not from $abs_top_builddir, since config.h moved.
8321
8322
4f82b42a
PE
8323 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
8324 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
8325
8326 * src/parse-gram.y (symbol_declaration): Don't put statements
8327 before declarations; it's not portable to C89.
8328 * src/scan-code.l (handle_action_at): Likewise.
8329
8330 * src/scan-code.l: Always initialize braces_level; the old code
8331 left it uninitialized and therefore had undefined behavior.
8332
8333 Don't attempt to redefine 'assert', since it runs afoul of
8334 systems where standard headers (mistakenly) include <assert.h>.
8335 Instead, define and use our own alternative, called 'aver'.
8336 * src/reader.c: Don't include assert.h, since we no longer
8337 use assert.
8338 * src/scan-code.l: Likewise.
8339 * src/system.h (assert): Remove, replacing with....
8340 (aver): New function, taking a bool arg. All uses changed.
8341 * src/tables.c (pack_vector): Ensure that aver arg is bool,
8342 not merely an integer.
8343
31c10e38
PE
83442006-09-15 Bob Rossi <bob@brasko.net>
8345
d6bdb90a
JD
8346 Add support for push parsing. Based on the original work of
8347 Odd Arild Olsen <oao@fibula.no>.
31c10e38
PE
8348 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
8349 * data/c.m4 (YYPUSH): New.
8350 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
d6bdb90a 8351 * data/push.c: New file.
31c10e38
PE
8352 * src/getargs.c (push_parser): New var.
8353 * src/getargs.h (push_parser): New declaration.
8354 * src/output.c (prepare): Add macro insertion of `push_flag'.
8355 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
8356 (prologue_declaration): Parse %push-parser.
8357 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
8358 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
8359 list of removed lines from the traces observed.
8360 (AT_CHECK_CALC_LALR): Added push parser tests.
8361
fa7b79c0
PE
83622006-09-13 Paul Eggert <eggert@cs.ucla.edu>
8363
21fe08ca
PE
8364 * NEWS: Version 2.3a.
8365 * configure.ac (AC_INIT): Likewise.
8366
e8ec4d9b
PE
8367 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
8368 "#define YYSTYPE int" that caused "make maintainer-check" to fail
8369 due to header ordering dependencies. I don't know why the #define
8370 was there.
8371
fa7b79c0
PE
8372 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
8373 runtime cost when YYDEBUG is not defined, and so that some tests
8374 that used to fail now work. Problem and initial suggestion by
8375 Paolo Bonzini.
8376 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
8377 * data/glr.cc (b4_parser_class_name):
8378 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
8379 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
8380 (yydebug_) [YYDEBUG]: New member.
8381 (yycdebug_): Now defined only if YYDEBUG.
8382 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
8383 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
8384 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
8385 if YYYDEBUG.
8386 (debug_stream, set_debug_stream, debug_level, set_debug_level):
8387 Define only if YYDEBUG.
8388 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
8389 set_debug_level.
8390 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
8391 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
8392 AT_CHECK_CALC_GLR_CC that are working now.
8393
4ec13d60
PE
83942006-09-12 Paul Eggert <eggert@cs.ucla.edu>
8395
8396 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
8397 We don't need them in glr.cc, and glr.c defines them.
8398 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
8399 assumes that defining it to anything is the same as defining
8400 it to 1. Problem reported by Paolo Bonzini.
8401
8e1687ae
PE
84022006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
8403
8404 * data/c.m4 (b4_null, b4_case): Define.
8405 * src/output.c (prepare_symbols): Use b4_null.
8406 (user_actions_output): Use b4_case.
8407
3dc5e96b
PE
84082006-09-11 Paul Eggert <eggert@cs.ucla.edu>
8409
aef3da86
PE
8410 * data/glr.c (b4_shared_declarations): Put start-header first,
8411 before any #includes that we generate, so that feature-test
8412 macros work. Problem reported by Michael Deutschmann in
8413 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
8414 * data/lalr1.cc: Likewise.
8415 * doc/bison.texinfo (Prologue): Document that feature-test macros
8416 should be defined before any Bison declarations.
8417 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
8418 that depend on location.hh after, not before, Bison decls, since
8419 we now include location.hh after the first user prologue.
8420
3dc5e96b
PE
8421 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
8422 Sander Brandenburg in
8423 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
8424 Also, fix minor white space and comment issues.
aef3da86
PE
8425 (Prologue): Mention that it's better to define feature-test macros
8426 before Bison declarations. Problem reported by Michael Deutschmann.
8427
8428 * README-cvs: Fix typo: "&" should be "&&". Problem reported
8429 by Jim Meyering.
8430 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
8431 This adjusts to recent gnulib changes.
3dc5e96b 8432
b2a0b7ca
JD
84332006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8434
8435 Finish implementation of per-type %destructor/%printer. Discussed
8436 starting at
8437 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
8438 and
8439 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
8440 * NEWS (2.3+): Add a description of this feature to the default
8441 %destructor/%printer description.
8442 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
8443 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
8444 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
8445 list node contains a semantic type.
8446 * src/symtab.c, src/symtab.h: Extend with a table that associates
8447 semantic types with their %destructor's and %printer's.
8448 (semantic_type_from_uniqstr, semantic_type_get,
8449 semantic_type_destructor_set, semantic_type_printer_set): New functions
8450 composing the public interface of that table.
8451 (symbol_destructor_get, symbol_destructor_location_get,
8452 symbol_printer_get, symbol_printer_location_get): If there's no
8453 per-symbol %destructor/%printer, look up the per-type before trying
8454 the default.
8455 * tests/actions.at (Per-type %printer and %destructor): New test case.
8456 * tests/input.at (Default %printer and %destructor redeclared):
8457 Extend to check that multiple occurrences of %symbol-default in a
8458 single %destructor/%printer declaration is an error.
8459 (Per-type %printer and %destructor redeclared, Unused values with
8460 per-type %destructor): New test cases.
8461
3be03b13
JD
84622006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8463
8464 Require default %destructor/%printer to be declared using
8465 %symbol-default instead of an empty symbol list, and start working on
8466 new per-type %destructor/%printer. Discussed at
8467 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
8468 * NEWS (2.3+): Add %symbol-default to example.
8469 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 8470 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
8471 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
8472 (generic_symlist, generic_symlist_item): New nonterminals for creating
8473 a list in which each item is a symbol, semantic type, or
8474 %symbol-default.
8475 (grammar_declaration): Use generic_symlist in %destructor and %printer
8476 declarations instead of symbols.1 or an empty list.
8477 (symbol_declaration, precedence_declaration, symbols.1): Update actions
8478 for changes to symbol_list.
8479 * src/reader.c: Update for changes to symbol_list.
8480 * src/scan-code.l: Likewise.
8481 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
8482 * src/symlist.c, src/symlist.h: Extend such that a list node may
8483 represent a semantic type or a %symbol-default in addition to just an
8484 ordinary symbol. Add switched functions for setting %destructor's and
8485 %printer's.
8486 * tests/actions.at, tests/input.at: Add %symbol-default to all default
8487 %destructor/%printer declarations.
8488
3508ce36
JD
84892006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
8490
8491 Whether the default %destructor/%printer applies to a particular symbol
8492 isn't a question of whether the user *declares* that symbol (in %token,
8493 for example). It's a question of whether the user by any means
8494 *defines* the symbol at all (by simply using a char token, for
8495 example). $end is defined by Bison whereas any other token with token
8496 number 0 is defined by the user. The error token is always defined by
8497 Bison regardless of whether the user declares it with %token, but we
8498 may one day let the user define error as a nonterminal instead.
8499 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
8500 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
8501 the meaning of "user-defined".
8502 * tests/actions.at (Default %printer and %destructor for user-declared
8503 end token): Rename to...
8504 (Default %printer and %destructor for user-defined end token): ...
8505 this.
8506
8507 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
8508 computation of whether to apply the default, don't maintain a list of
8509 every Bison-defined symbol. Instead, just check for a first character
8510 of '$', which a user symbol cannot have, and check for the error token.
8511
9350499c
JD
85122006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
8513
8514 Don't apply the default %destructor or %printer to the error token,
8515 $undefined, or $accept. This change fits the general rule that the
8516 default %destructor and %printer are only for user-declared symbols,
8517 and it solves several difficulties that are described in the new test
8518 cases listed below.
8519 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
8520 * tests/actions.at (Default %printer and %destructor are not for error
8521 or $undefined, Default %printer and %destructor are not for $accept):
8522 New test cases.
8523
4d7370cb
JD
85242006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
8525
8526 Allow %start after the first rule.
8527 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
8528 when parsing the first rule.
8529 (check_and_convert_grammar): Search for it here after all grammar
8530 declarations have been parsed. Skip midrules, which have dummy LHS
8531 nonterminals.
8532 * src/symtab.c (symbol_is_dummy): New function.
8533 * src/symtab.h (symbol_is_dummy): Declare it.
8534 * tests/input.at (%start after first rule): New test.
8535
6d0ef4ec
JD
85362006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8537
8538 Redo some of the previous commit: add back the ability to use
8539 non-aliased/undeclared string literals since it might be useful to
8540 those declaring %token-table.
8541 * src/reader.c (check_and_convert_grammar): Undo changes in previous
8542 commit: don't worry about complaints from symbols_pack.
8543 * src/symtab.c (symbol_new, symbol_class_set,
8544 symbol_check_alias_consistency): Undo changes in previous commit: count
8545 each string literal as a new symbol and token, assign it a symbol
8546 number, and don't complain about non-aliased string literals.
8547 (symbols_pack): Since symbol_make_alias still does not decrement symbol
8548 and token counts but does still set aliased tokens to the same number,
8549 symbol_pack_processor now leaves empty slots in the symbols array.
8550 Remove those slots.
8551 * tests/regression.at (Undeclared string literal): Remove test case
8552 added in previous commit since non-aliased string literals are allowed
8553 again.
8554 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
8555 remove unnecessary string literal declarations.
8556 * tests/sets.at (Firsts): Likewise.
8557
965537bc
JD
85582006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8559
8560 Don't allow an undeclared string literal, but allow a string literal to
8561 be used before its declaration.
8562 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
8563 symbols_pack complained.
8564 * src/symtab.c (symbol_new): Don't count a string literal as a new
8565 symbol.
8566 (symbol_class_set): Don't count a string literal as a new token, and
8567 don't assign it a symbol number since symbol_make_alias does that.
8568 (symbol_make_alias): It's not necessary to decrement the symbol and
8569 token counts anymore. Don't assume that an alias declaration occurs
8570 before any uses of the identifier or string, and thus don't assert that
8571 one of them has the highest symbol number so far.
8572 (symbol_check_alias_consistency): Complain if there's a string literal
8573 that wasn't declared as an alias.
8574 (symbols_pack): Bail if symbol_check_alias_consistency failed since
8575 symbol_pack asserts that every token has been assigned a symbol number
8576 although undeclared string literals have not.
8577 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 8578 string literal): New test cases.
965537bc
JD
8579 (Characters Escapes, Web2c Actions): Declare string literals as
8580 aliases.
8581 * tests/sets.at (Firsts): Likewise.
8582
47aee066
JD
85832006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
8584
8585 In the grammar scanner, STRING_FINISH unclosed constructs and return
8586 them to the parser in order to improve error messages.
8587 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
8588 SC_BRACED_CODE, SC_PROLOGUE): Implement.
8589 * tests/input.at (Unclosed constructs): New test case.
8590 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
8591 seen.
8592
8593 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
8594 unused global.
8595
1f6b3679
JD
85962006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
8597
8598 Handle string aliases for character tokens correctly.
8599 * src/symtab.c (symbol_user_token_number_set): If the token has an
8600 alias, check and set its alias's user token number instead of its own,
8601 which is set to indicate the alias. Previously, every occurrence of
8602 the character token in the grammar overwrote that alias indicator with
8603 the character code.
8604 * tests/input.at (String aliases for character tokens): New test.
8605
219741d8
JD
86062006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
8607
8608 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
8609
11daa4e7
PE
86102006-08-11 Paul Eggert <eggert@cs.ucla.edu>
8611
8612 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
8613 to prevent failures when building on older platforms.
8614 Check for autopoint failure.
8615 Set XGETTEXT_OPTIONS to values that check for C format strings,
8616 so that translators are warned about them (this also helps
8617 prevent core dumps).
8618
8619 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
8620 function, since it simplifies our code a bit.
8621
8622 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
8623 rather than -W, so we don't get bogus warnings about sign comparisons.
8624 Add -Wpointer-arith, since that warning is useful (it reports code
8625 that does not conform to C89 and that some compilers reject).
8626 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
8627 since it's no longer needed.
8628
f9bfc42a
JD
86292006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
8630
8631 Clean up scanners a bit.
8632 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
8633 definitions so gcc won't warn when obstack_for_string is unused.
8634 * src/scan-code.l: config.h and system.h are already #include'd by
8635 scan-code-c.c, so get rid of them here.
8636 * src/scan-gram.l: Likewise.
8637 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
8638 definitions rather than duplicating the rest of it.
8639 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
8640
06e8700a
JD
86412006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
8642
8643 Suppress signed/unsigned comparison warnings for yycheck.
8644 * data/c.m4 (b4_safest_int_type): New macro.
8645 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
8646 a signed int type, cast it to b4_safest_int_type first.
8647 * data/yacc.c: Likewise.
8648 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
8649 also overwritten.
8650
9c437126
PE
86512006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
8652
8653 * doc/bison.texinfo: Fix some typos.
8654
284d8a13
PE
86552006-08-02 Paul Eggert <eggert@cs.ucla.edu>
8656
8657 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
8658 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
8659
8660 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
8661 the latest gnulib does this a different way.
8662 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
8663 translation was patched, so stop omitting it.
8664
ec5479ce
JD
86652006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8666
8667 Enable declaration of default %printer/%destructor. Make the parser
8668 use these for all user-declared grammar symbols for which the user does
8669 not declare a specific %printer/%destructor. Thus, the parser uses it
8670 for token 0 if the user declares it but not if Bison generates it as
8671 $end. Discussed starting at
8672 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
8673 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
8674 and
8675 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
8676 * NEWS (2.3+): Mention.
8677 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
8678 declare a %destructor for a mid-rule's semantic value. It's just
8679 impossible to declare one specific to it.
8680 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
8681 code. Describe default %destructor form.
8682 * src/parse-gram.y (grammar_declaration): Parse default
8683 %printer/%destructor declarations.
8684 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
8685 and symbol_destructor_location_get rather than accessing the destructor
8686 and destructor_location members of struct symbol.
8687 (symbol_printers_output): Likewise but for %printer's.
8688 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
8689 again.
8690 * src/symtab.c (default_destructor, default_destructor_location,
8691 default_printer, default_printer_location): New static global
8692 variables to record the default %destructor and %printer.
8693 (symbol_destructor_get, symbol_destructor_location_get,
8694 symbol_printer_get, symbol_printer_location_get): New functions to
8695 compute the appropriate %destructor and %printer for a symbol.
8696 (default_destructor_set, default_printer_set): New functions to set the
8697 default %destructor and %printer.
8698 * src/symtab.h: Prototype all those new functions.
8699 * tests/actions.at (Default %printer and %destructor): New test to
8700 check that the right %printer and %destructor are called, that they're
8701 not called for $end, and that $$ and @$ work correctly.
8702 (Default %printer and %destructor for user-declared end token): New
8703 test to check that the default %printer and %destructor are called for
8704 a user-declared end token.
8705 * tests/input.at (Default %printer and %destructor redeclared, Unused
8706 values with default %destructor): New tests to check related grammar
8707 warnings and errors.
8708
868d2d96
JD
87092006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8710
8711 Clean up handling of %destructor for the end token (token 0).
8712 Discussed starting at
8713 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
8714 and
8715 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
8716
8717 Make the skeletons consistent in how they pop the end token and invoke
8718 its %destructor.
8719 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
8720 state, which has token number 0, since this would invoke the
8721 %destructor for the end token.
8722 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
8723 until after shifting the end token, or else it won't be popped.
8724 * data/yacc.c (yyparse): Likewise.
8725
8726 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
8727 it's the end token. Upon termination, destroy an unshifted lookahead
8728 even when it's the end token.
8729 * data/lalr1.cc (yy::parser::parse): Likewise.
8730 * data/yacc.c (yyparse): Likewise.
8731
8732 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
8733 value warnings for the end token when the user gives the end token a
8734 %destructor.
8735
8736 * tests/actions.at (Printers and Destructors): Test all the above.
8737
62a9592d
PE
87382006-07-24 Paul Eggert <eggert@cs.ucla.edu>
8739
8740 Update to latest gnulib and gettext versions.
8741 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
8742 Add fopen-safer.
8743 (gnulib_files): Add m4/warning.m4. Don't worry about files
8744 overwritten by autopoint.
8745 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
8746 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
8747 rejects them.
8748 Don't use autoreconf; instead, invoke autopoint etc. by hand,
8749 so that we can remove the intl files at a better time.
8750 (intl_files_to_remove): Remove aclocal.m4, since it gets
8751 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
8752 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
8753 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
8754 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
8755 Remove datarootdir hack; no longer needed.
8756 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
8757 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
8758 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
8759 strdup.h.
8760 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
8761 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
8762
10d6970f
PE
87632006-07-20 Paul Eggert <eggert@cs.ucla.edu>
8764
8765 * bootstrap: Adjust to today's change to gnulib-tool by invoking
8766 it with --assume-autoconf='latest-stable'.
8767
50a33993
JD
87682006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
8769
8770 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
8771 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
8772 YYSTYPE' and `{'.
8773 * src/muscle_tab.h (muscle_grow): Replace the header comments with
8774 those from muscle_tab.c since the old ones are misleading.
8775
2ce4ed68
AD
87762006-07-13 Akim Demaille <akim@epita.fr>
8777
8778 Support %define "KEY" {VALUE}.
8779 * src/scan-code.h, src/scan-code.l (translate_action)
8780 (translate_rule_action, translate_symbol_action, translate_code):
8781 Return char *, not const char *.
8782 * src/parse-gram.y (declaration): Rename as...
8783 (prologue_declaration): this.
8784 (string_content): Remove this nonterminal, use STRING.
8785 (braceless, content, content.opt): New nonterminal.
8786 Use them.
8787 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
8788 as value.
8789 * src/scan-gram.l (getargs.h): Don't include it.
8790
db7e5eb5
PE
87912006-07-12 Paul Eggert <eggert@cs.ucla.edu>
8792
8793 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
8794 rather than a for-loop that declares a local bool variable. This
8795 should work around a compatibility problem with a Cray x1e C++
8796 compiler reported by Hung Nguyen in
8797 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
8798 The for-loop was introduced in the 2004-11-17 change but I don't
8799 know why it was needed.
8800
a5d80ba5
AD
88012006-07-12 Akim Demaille <akim@epita.fr>
8802
8803 * data/c.m4: Comment changes.
8804
23eb2a69
AD
88052006-07-10 Akim Demaille <akim@lrde.epita.fr>
8806
8807 * src/complain.c (error_message, ERROR_MESSAGE): New.
8808 To factor...
8809 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
8810 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
8811
ddc8ede1
PE
88122006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8813
8814 * NEWS: Instead of %union, you can define and use your own union type
8815 YYSTYPE if your grammar contains at least one <type> tag.
8816 Your YYSTYPE need not be a macro; it can be a typedef.
8817 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
8818 (Union Decl, Decl Summary): Document this.
8819 * data/glr.c (YYSTYPE): Implement this.
8820 * data/glr.cc (YYSTYPE): Likewise.
8821 * data/lalr1.cc (YYSTYPE): Likewise.
8822 * data/yacc.c (YYSTYPE): Likewise.
8823 * src/output.c (prepare): Output tag_seen_flag.
8824 * src/parse-gram.y (declaration, grammar_declaration):
8825 Use 'union_seen' rather than 'typed' to determine whether
8826 %union has been seen, since grammars can now be typed without
8827 %union.
8828 (symbol_declaration, type.opt, symbol_def):
8829 Keep track of whether a tag has been seen.
8830 * src/reader.c (union_seen, tag_seen): New vars.
8831 (typed): remove.
8832 * src/reader.h (union_seen, tag_seen, typed): Likewise.
8833 * src/scan-code.l (untyped_var_seen): New variable.
8834 (handle_action_dollar): Adjust to above changes.
8835 (handle_action_dollar, handle_action_at):
8836 Improve overflow checking for outlandish numbers.
8837 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
8838 avoid new diagnostics generated by above changes.
8839 * tests/regression.at (YYSTYPE typedef): Add test to check
8840 for type tags without %union.
8841
8842 * src/symlist.c (symbol_list_length): Return int, not unsigned
8843 int, since callers expect int. This may need to get revisited
8844 once we have proper integer overflow checking.
8845
8846 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
8847 object is now static.
8848
8849 * src/getargs.c (flags_argmatch): Return void, not int,
8850 to pacify ./configure --enable-gcc-warnings.
8851
8852 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
8853 since last_string is already defined to FLEX_PREFIX (last_string).
8854
7b42569e
AD
88552006-07-09 Akim Demaille <akim@lrde.epita.fr>
8856
8857 Implement --warnings/-W.
8858 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
8859 replaced by...
8860 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
8861 Adjust callers.
8862 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
8863 (warnings_args, warnings_types): New.
8864 (getargs, short_options, long_options): Accept -W/--warnings.
8865 Sort the options by alphabetical order, upper case letter right
8866 before its lower case.
8867
3b452f4e
JD
88682006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
8869
8870 Change %merge result type clash warnings to errors. Discussed at
8871 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
8872 * src/reader.c (record_merge_function_type): Use complain_at.
8873 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8874 declared later): Update test case results.
8875
b8a41559
AD
88762006-07-09 Akim Demaille <akim@lrde.epita.fr>
8877
8878 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
8879 to be in alphabetical order.
8880 (trace_args): Spelling fixes.
8881
cd9e1ba2
PE
88822006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8883
8884 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
8885 so they don't collide with user-defined macros.
8886 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
8887 this was never guaranteed, and now that we're using gnulib stdint,
8888 which defines int_fast16_t to long int, the problem is exposed.
8889
cb48f191
PE
88902006-07-08 Paul Eggert <eggert@cs.ucla.edu>
8891
b8445a15
PE
8892 * data/c.m4 (b4_basename): Simplify a bit, since we don't
8893 need the full POSIX semantics (and weren't implementing them
8894 anyway).
8895
cb48f191
PE
8896 Adjust to Autoconf 2.60 and today's gnulib.
8897 * bootstrap (gnulib_modules): Add stdint.
8898 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
8899 no longer copies it.
8900 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
8901 since stdint needs the former and wcwidth (which is now required
8902 by mbswidth) needs the latter.
8903 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
8904 work around a compatibility glitch between gettext 0.14.6 and
8905 Autoconf 2.60.
8906 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
8907 Do not check for uintptr_t, since new stdint module does the right
8908 thing.
8909 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
8910 Add stdint.h, stdint_.h, wcwidth.h.
8911 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
8912 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
8913 stdint.m4, wchar_t.m4, wcwidth.m4.
8914 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
8915 usual order for ../lib/*.h files.
8916 (file_name_split): Use last_component, not base_name, to adjust
8917 to gnulib changes.
8918 * src/parse-gram.h: Include <strverscmp.h> in the usual order
8919 for ../lib/*.h files.
8920 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
8921 Define unconditionally, since we now assume the stdint module.
8922 * src/scan-skel.l: Include <dirname.h>.
8923 (BASE_QPUTS): Use last_component, not base_name.
8924 * src/system.h: Include <unlocked-io.h> in the usual order
8925 for ../lib/*.h files. Include <stdint.h> unconditionally,
8926 since we now use the stdint module.
8927 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
8928 HAVE_UINTPTR_T, since we now use the stdint module.
8929 (base_name): Remove decl, since files now include <dirname.h>
8930 to get the decl.
8931
cd48d21d
AD
89322006-07-08 Akim Demaille <akim@lrde.epita.fr>
8933
8934 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
8935 New, default to 1.
8936 * data/yacc.c, data/glr.c, data/location.cc: Use them.
8937 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
8938 default.
8939 * tests/calc.at: Adjust.
8940
8ec0a172
AD
89412006-07-08 Akim Demaille <akim@lrde.epita.fr>
8942
b8445a15 8943 * data/c.m4 (b4_basename): New.
8ec0a172
AD
8944 (b4_syncline): Also output the location of its invocation (from
8945 the skeleton).
8946 (b4_user_action, b4_define_user_action, b4_user_actions)
8947 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
8948 (b4_user_stype): New.
8949 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
8950
4a678af8
JD
89512006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8952
8953 In the grammar file, the first column is 1 not 0 on the first line as
8954 on every other line.
8955 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
8956 * tests/input.at (Torturing the Scanner): Update output.
8957
8958 * src/scan-gram.l (scanner_cursor): Declare it static.
8959
dd60572a
JD
89602006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8961
8962 In warnings, say "previous declaration" rather than "first
8963 declaration".
8964 * src/symtab.c (redeclaration): Do that here.
8965 * src/reader.c (record_merge_function_type): In the case of a result
8966 type clash, report the previous declaration rather than the very first
8967 one in the grammar file.
8968 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8969 declared later): Add a third declaration to check this behavior.
8970 * tests/input.at (Incompatible Aliases): Update output.
8971
2073e1b6
AD
89722006-06-27 Akim Demaille <akim@epita.fr>
8973
8974 * doc/Doxyfile.in: New.
8975 * doc/Makefile.am: Use it.
8976 * src/lalr.h, src/symtab.h: Initial doxygenation.
8977
8ee5b538
JD
89782006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8979
8980 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
8981 declared after the %merge. This continues the effort of the previous
8982 patch.
8ee5b538
JD
8983 * src/reader.c (get_merge_function): Don't set the merger type yet.
8984 (record_merge_function_type): New function for setting the merger type
8985 and checking for clashes.
8986 (grammar_current_rule_merge_set): Set the location of the %merge for
8987 the current rule.
8988 (packgram): Invoke record_merge_function_type for each rule now that
8989 all symbol type declarations have been parsed.
8990 * src/reader.h (merger_list.type_declaration_location): New member
8991 storing the location of the first %merge from which the type for this
8992 merging function was derived.
8993 * src/symlist.h (symbol_list.merger_declaration_location): New member
8994 storing the location of a rule's %merge, if any.
8995 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8996 declared later): New test to catch the error fixed by the above patch.
8997
ffa4ba3a
JD
89982006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8999
9000 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
9001 declarations appear after the rules. Discussed at
9002 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
9003 and
9004 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
9005 Don't mistake the type of $$ in a midrule to be that of its parent
9006 rule's $$.
ffa4ba3a
JD
9007 * src/reader.c (grammar_current_rule_end): Don't invoke
9008 grammar_rule_check yet since not all symbol declarations may have been
9009 parsed yet.
9010 (grammar_midrule_action): Likewise.
9011 Don't record whether the midrule's $$ has been used yet since actions
9012 haven't been translated yet.
9013 Record the midrule's parent rule and its RHS index within the parent
9014 rule.
9015 (grammar_current_rule_action_append): Don't translate the action yet
9016 since not all symbol declarations may have been parsed yet and, thus,
9017 warnings about types for $$, $n, @$, and @n can't be reported yet.
9018 (packgram): Translate the action and invoke grammar_rule_check now that
9019 all symbol declarations have been parsed.
9020 * src/scan-code.l (handle_action_dollar): Now that this is invoked
9021 after parsing the entire grammar file, the symbol list here in the case
9022 of a midrule is actually the midrule's empty RHS, so reference its
9023 parent rule's RHS where necessary.
9024 On the other hand, now that you can already know it's a midrule, you
9025 aren't forced to think $$ has the same type as its parent rule's $$.
9026 (handle_action_at): In the case of a midrule, reference the parent rule
9027 where necessary.
9028 * src/symlist.c (symbol_list_new): Initialize new midrule-related
9029 members.
9030 (symbol_list_length): Now that this is invoked after all rules have
9031 been parsed, a NULL symbol (rather than a NULL symbol list node)
9032 terminates a rule. symbol_list_print already does this correctly.
9033 * src/symlist.h (symbol_list.midrule_parent_rule,
9034 symbol_list.midrule_parent_rhs_index): New members so that midrules can
9035 remember their relationships with their parents.
9036 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
9037 fixed by the above patch.
9038 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
9039 implementing...
9040 (Unused values): ... this old test case and...
9041 (Unused values before symbol declarations): ... this new test case.
9042 This one is the same as `Unused values' except that all symbol
9043 declarations appear after the rules in order to catch the rest of the
9044 errors fixed by the above patch.
9045
e256e17f
JD
90462006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9047
300a1930
JD
9048 More cleanup.
9049 * src/reader.c (current_rule): Declare it static since it's no longer
9050 used outside this file.
9051 (grammar_current_rule_action_append): Remove redundant arguments from
9052 translate_rule_action invocation.
9053 * src/reader.h (current_rule): Remove this unused extern.
9054 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
9055 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 9056
381ecb06
JD
90572006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
9058
9059 Clean up yesterday's patch.
9060 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
9061 to...
9062 * src/reader.c (grammar_current_rule_action_append): ... here for
9063 consistency with grammar_current_rule_symbol_append.
9064 * tests/regression.at (Braced code in declaration in rules section):
9065 Make yyerror and yylex static as usual.
9066
4210cd0b
JD
90672006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
9068
9069 Fix bug that mistakes braced code in a declaration in the rules section
9070 to be a rule action. Mentioned at
9071 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
9072 * src/scan-gram.l: Move midrule action detection from the start of the
9073 scanning of any braced code to...
9074 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
9075 action. For readability, use $2 and @2 rather than the equivalent
9076 global variables.
9077 * tests/regression.at (Braced code in declaration in rules section):
9078 New test to catch the error fixed by the above patch.
9079
9080 Work on code readability some.
9081 * src/scan-code.l (current_rule): Get rid of this misleading and
9082 redundant declaration: it's actually extern'ed in reader.h.
9083 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
9084 translate_action): Add a rule argument and use it instead of the global
9085 current_rule.
9086 (translate_rule_action): This already receives current_rule through an
9087 argument, so pass it on to translate_action instead of assigning
9088 current_rule to current_rule.
9089 (translate_symbol_action, translate_code): Pass rule = NULL to
9090 translate_action.
9091
34f98f46
JD
90922006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
9093
9094 Rename %before-definitions to %start-header and %after-definitions to
9095 %end-header. Don't use these declarations to separate pre-prologue
9096 blocks from post-prologue blocks. Add new order-independent
9097 declarations %before-header and %after-header as alternatives to the
9098 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
9099 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
9100 * NEWS (2.3+): Update for these changes.
9101 * data/glr.c (b4_before_definitions): Update to...
9102 (b4_start_header): ... this.
9103 (b4_after_definitions): Update to...
9104 (b4_end_header): ... this.
9105 * data/glr.cc: Likewise.
9106 * data/lalr1.cc: Likewise.
9107 * data/yacc.c: Likewise.
9108 * doc/bison.texinfo (The prologue): Update names, and replace remaining
9109 prologue blocks with %*-header declarations.
9110 (Calc++ Parser): Likewise.
91661ebb 9111 (Decl Summary): Update names.
148d66d8 9112 (Table of Symbols): Update description.
34f98f46
JD
9113 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
9114 (PERCENT_END_HEADER): ... this.
9115 (PERCENT_BEFORE_DEFINITIONS): Update to...
9116 (PERCENT_START_HEADER): ... this.
9117 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9118 (declaration): Update token names and m4 macro names.
9119 When parsing %end-header and %start-header, invoke translate_code
9120 before muscle_code_grow, and no longer set global booleans to remember
9121 whether these declarations have been seen.
9122 Parse new %after-header and %before-header.
9123 * src/reader.c (before_definitions, after_definitions): Remove.
9124 (prologue_augment): Accept a new bool argument to specify whether to
9125 augment the pre-prologue or post-prologue.
9126 * src/reader.h (before_definitions, after_definitions): Remove these
9127 extern's.
9128 (prologue_augment): Add new bool argument.
9129 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
9130 (PERCENT_END_HEADER): ... this.
9131 (PERCENT_BEFORE_DEFINITIONS): Update to...
9132 (PERCENT_START_HEADER): ... this.
9133 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9134 * tests/actions.at (Printers and Destructors): Update names.
9135
31b2b07e
JD
91362006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
9137
9138 Add comparison operators for C++ location classes. Discussed at
9139 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
9140 * data/c++.m4 (b4_define_location_comparison): New boolean %define
9141 declaration indicating whether filename_type has an operator==. If
9142 filename_type is `std::string', it defaults to `1', `0' otherwise.
9143 * data/location.cc: Iff b4_define_location_comparison is `1', add
9144 operator== and operator!= for class position and for class location.
9145
9146 Some minor fixes.
9147 * src/scan-action.l: Remove unused file.
9148 * src/symtab.c (symbol_printer_set): Use printer_location not
9149 destructor_location.
9150 * src/symtab.h (struct symbol): Replace incorrect source comment for
9151 printer members.
9152 * tests/input.at (Incompatible Aliases): Update output with correct
9153 printer location.
9154
9bc0dd67
JD
91552006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
9156
9157 Don't put the pre-prologue in the header file. For the yacc.c code
9158 file and the glr.c header and code files, move the pre-prologue before
9159 the token definitions. Add new %before-definitions and
9160 %after-definitions to declare code that will go in both the header file
9161 and code file. Discussed at
9162 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
9163 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
9164 and
9165 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
9166 * NEWS (2.3+): Describe these changes.
9167 * data/glr.c (b4_pre_prologue): Move from within to before...
9168 (b4_shared_declarations): ... this.
9169 Add new b4_before_definitions before b4_token_enums.
9170 Add new b4_after_definitions at the end.
9171 * data/glr.cc (b4_pre_prologue): Replace with...
9172 (b4_before_definitions): ... this in the header file.
9173 (b4_after_definitions): New near the end of the header file.
9174 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
9175 code file right before including the header file.
9176 (b4_before_definitions): New in the previous position of
9177 b4_pre_prologue in the header file.
9178 (b4_after_definitions): New near the end of the header file.
9179 * data/yacc.c: Clean up some m4 quoting especially in the header file.
9180 (b4_token_enums_defines): In the code file, move to right before
9181 YYSTYPE for consistency with the header file.
9182 (b4_before_definitions): New right before b4_token_enums_defines in
9183 both the header and code file.
9184 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
9185 header and code file.
9186 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
9187 of prologues for %union dependencies.
91661ebb
JD
9188 (Decl Summary): In %defines description, mention the effect of
9189 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
9190 (Calc++ Parser): Forward declare driver in a %before-definitions rather
9191 than in the pre-prologue so that make check succeeds.
148d66d8 9192 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
9193 %after-definitions.
9194 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
9195 %before-definitions.
9196 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
9197 (declaration): Parse those declarations and append to
9198 b4_before_definitions and b4_after_definitions, respectively.
9199 * src/reader.c (before_definitions, after_definitions): New bools to
9200 track whether those declarations have been seen.
9201 (prologue_augment): Add to the post-prologue if %union,
9202 %before-definitions, or %after-definitions has been seen.
9203 * src/reader.h (before_definitions, after_definitions): New extern's.
9204 * src/scan-gram.l: Scan the new declarations.
9205 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
9206 prologue block in a %before-definitions or a %after-definitions based
9207 on whether the %union is declared.
9208 * tests/regression.at (Early token definitions with --yacc, Early token
9209 definitions without --yacc): Move tests for token definitions into the
9210 post-prologue since token names are no longer defined in the
9211 pre-prologue.
9212
203b9274
AD
92132006-06-20 Akim Demaille <akim@epita.fr>
9214
9215 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
9216 (symbol_get): Use it.
9217 * src/parse-gram.y: Use it.
9218
a7ee59cf
JD
92192006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
9220
9221 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
9222 build succeeds when configured with --enable-gcc-warnings.
9223
5a2baae7
PE
92242006-06-19 Paul Eggert <eggert@cs.ucla.edu>
9225
33ad1a9c
PE
9226 * src/parse-gram.y (char_name): New function.
9227 (CHAR, STRING, string_content): For %printer, properly escape.
9228 (ID): Prefer fputs to fprintf.
9229 (id): Reindent to be consistent with other rules.
9230 Properly quote char.
9231
5a2baae7
PE
9232 The Translation Project changed its way of publishing translations
9233 to maintainers. I haven't received any responses to my request
9234 for supporting the old way, or for documenting the new way. I
9235 have modified 'bootstrap' to use screen scraping
9236 (in this case, HTML scraping). This is unreliable and inelegant,
9237 but I don't see any better way. Yuck.
9238 * bootstrap (TP_URL, WGET_COMMAND): New vars.
9239 (get_translations): New function, which uses HTML scraping to
9240 deduce locations of latest translations.
9241 Use this function to grab both bison and bison-runtime .po files.
9242 Don't bother priming the pump for the runtime-po domain any more,
9243 as it's now translated better than bison is.
9244
58d7a1a1
AD
92452006-06-19 Akim Demaille <akim@epita.fr>
9246
9247 * src/scan-gram.l: No longer "parse" things after `%union' until
9248 `{'. Rather, return a single "%union" token.
9249 No longer make symbols: return strings, and leave the conversion
9250 to symbols to the parser.
9251 (SC_PRE_CODE, token_type): Remove.
9252 * src/parse-gram.y (%union): New field `character'.
9253 Sort tokens.
9254 (CHAR): New token.
9255 (ID, ID_COLON): Now that the scanner no longer makes them
9256 identifiers, adjust all uses to invoke symbol_get.
9257 (id_colon): New, wraps the conversion from string to symbol.
9258 (%union): Accept a possible union_name.
9259 (symbol): Now can be a char.
9260 * data/c.m4 (b4_union_name): Leave a default value.
9261 * data/glr.c, data/yacc.c: Use it.
9262
b931235e
JD
92632006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
9264
9265 For associating token numbers with token names for "yacc.c", don't use
9266 #define statements unless `--yacc' is specified; always use enum
9267 yytokentype. Most important discussions start at:
9268 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
9269 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
9270 and
9271 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
9272 * NEWS (2.3+): Mention.
9273 * data/c.m4 (b4_yacc_if): New.
9274 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
9275 token #define's.
9276 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
9277 on token name definitions.
9278 * src/getargs.c (usage): Capitalize `Yacc' in English.
9279 * src/output.c (prepare): Define b4_yacc_flag.
9280 * tests/regression.at (Early token definitions): Test that tokens names
9281 are defined before the pre-prologue not just before the post-prologue.
9282 Remove this test case and copy to...
9283 (Early token definitions with --yacc): ... this to test #define's.
9284 (Early token definitions without --yacc): ... and this to test enums.
9285
9e6e7ed2
PE
92862006-06-11 Paul Eggert <eggert@cs.ucla.edu>
9287
9288 * NEWS: Reword the post-2.3 change to not be so optimistic about
9289 removing the old "look-ahead" spelling.
9290 Update previous look-ahead/lookahead change reports.
9291 * REFERENCES: look-ahead -> lookahead (since that's
9292 what he actually wrote).
9293 * doc/refcard.tex: look ahead -> lookahead,
9294 look-ahead -> lookahead
9295
742e4900
JD
92962006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
9297
9298 For consistency, use `lookahead' instead of `look-ahead' or
9299 `look_ahead'. Discussed starting at
9300 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
9301 and then at
9302 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
9303 * NEWS: For the next release, note the change to `--report'.
9304 * TODO, doc/bison.1: Update English.
9305 * doc/bison.texinfo: Update English.
9306 (Understanding Your Parser, Bison Options): Document as
9307 `--report=lookahead' rather than `--report=look-ahead'.
9308 * src/conflicts.c: Update English in comments.
9309 (lookahead_set): Rename from look_ahead_set.
9310 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
9311 (resolve_sr_conflict): Rename local look_ahead_tokens to
9312 lookahead_tokens, and update other uses.
9313 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
9314 count_rr_conflicts, conflicts_free): Update uses.
9315 * src/getargs.c (report_args): Move "lookahead" before alternate
9316 spellings.
9317 (report_types): Update uses.
9318 (usage): For `--report' usage description, state `lookahead' spelling
9319 rather than `look-ahead'.
9320 * src/getargs.h (report.report_lookahead_tokens): Rename from
9321 report_look_ahead_tokens.
9322 * src/lalr.c: Update English in comments.
9323 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
9324 (state_lookahead_tokens_count): Rename from
9325 state_look_ahead_tokens_count.
9326 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9327 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
9328 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9329 Update other uses.
9330 Update English in output.
9331 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
9332 * src/print.c: Update English in comments.
9333 (lookahead_set): Rename from look_ahead_set.
9334 (print_reduction): Rename argument lookahead_token from
9335 look_ahead_token.
9336 (print_core, state_default_rule, print_reductions, print_results):
9337 Update uses.
9338 * src/print_graph.c: Update English in comments.
9339 (print_core): Update uses.
9340 * src/state.c: Update English in comments.
9341 (reductions_new): Update uses.
9342 (state_rule_lookahead_tokens_print): Rename from
9343 state_rule_look_ahead_tokens_print, and update other uses.
9344 * src/state.h: Update English in comments.
9345 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
9346 (state_rule_lookahead_tokens_print): Rename from
9347 state_rule_look_ahead_tokens_print.
9348 * src/tables.c: Update English in comments.
9349 (conflict_row, action_row): Update uses.
9350 * tests/glr-regression.at
9351 (Incorrect lookahead during deterministic GLR,
9352 Incorrect lookahead during nondeterministic GLR): Rename
9353 print_look_ahead to print_lookahead.
9354 * tests/torture.at: Update English in comments.
9355 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
9356 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
9357 (Many lookahead tokens): Update uses.
9358 * data/glr.c: Update English in comments.
9359 * lalr1.cc: Likewise.
9360 * yacc.c: Likewise.
9361 * src/conflicts.h: Likewise.
9362 * src/lalr.h: Likewise.
9363 * src/main.c: Likewise.
9364 * src/output.c: Likewise.
9365 * src/parse-gram.c: Likewise.
9366 * src/tables.h: Likewise.
9367 * tests/calc.at: Likewise.
9368
3c40d0b5
JD
93692006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
9370
9371 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
9372
5d278082
PE
93732006-06-07 Paul Eggert <eggert@cs.ucla.edu>
9374
9375 * TODO: Add request from Nelson H. F. Beebe to be able to install
9376 Bison without installing the yacc script.
9377
9e668899
JD
93782006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9379
9380 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
9381 and yytext if they're already #define'd.
9382 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
9383 * src/scan-code-c.c: ... here.
9384 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
9385 <config.h>.
9386
0c8e079f
JD
93872006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9388
9389 Get Bison to build again when configured with --enable-gcc-warnings.
9390 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
9391 missing #include's.
9392 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
9393 loc argument as it shadows a global.
9394 * src/scan-gram.l: Remove stray comma that prevents boundary_set
9395 invocation.
9396
9397 * src/.cvsignore: Add scan-code.c.
9398
2346344a
AD
93992006-06-07 Akim Demaille <akim@epita.fr>
9400
9401 * src/scan-gram.l: Move the "add a trailing ; to actions" code
9402 to...
9403 * src/scan-code.l: here.
9404 * tests/input.at (Torturing the Scanner): Fix another location
9405 error.
9406
4862bdfd
AD
94072006-06-07 Akim Demaille <akim@epita.fr>
9408
9409 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
9410
e9071366
AD
94112006-06-06 Akim Demaille <akim@epita.fr>
9412
9413 Extract the parsing of user actions from the grammar scanner.
9414 As a consequence, the relation between the grammar scanner and
9415 parser is much simpler. We can also split "composite tokens" back
9416 into simple tokens.
9417 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
9418 * src/scan-gram.l (add_column_width, adjust_location): Move to and
9419 rename as...
9420 * src/location.h, src/location.c (add_column_width)
9421 (location_compute): these.
9422 Fix the column count: the initial column is 0.
9423 (location_print): Be robust to ending column being 0.
9424 * src/location.h (boundary_set): New.
9425 * src/main.c: Adjust to scanner_free being renamed as
9426 gram_scanner_free.
9427 * src/output.c: Include scan-code.h.
9428 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
9429 Use boundary_set.
9430 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
9431 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
9432 which is now, again, a separate token.
9433 Adjust all dependencies.
9434 Whereever actions with $ and @ are used, use translate_code.
9435 (action): Remove this nonterminal which is now useless.
9436 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
9437 (grammar_current_rule_action_append): Use translate_code.
9438 (packgram): Bound check ruleno, itemno, and rule_length.
9439 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
9440 (last_string, last_braced_code_loc, max_left_semantic_context)
9441 (scanner_initialize, scanner_free, scanner_last_string_free)
9442 (gram_out, gram_lineno, YY_DECL_): Move to...
9443 * src/scan-gram.h: this new file.
9444 (YY_DECL): Rename as...
9445 (GRAM_DECL): this.
9446 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
9447 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9448 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9449 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9450 Move these declarations, and...
9451 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
9452 these to...
9453 * src/flex-scanner.h: this new file.
9454 * src/scan-gram.l (rule_length, rule_length_overflow)
9455 (increment_rule_length): Remove.
9456 (last_braced_code_loc): Rename as...
9457 (gram_last_braced_code_loc): this.
9458 Adjust to the changes of the parser.
9459 Move all the handling of $ and @ into...
9460 * src/scan-code.l: here.
9461 * src/scan-gram.l (handle_dollar, handle_at): Remove.
9462 (handle_action_dollar, handle_action_at): Move to...
9463 * src/scan-code.l: here.
9464 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
9465 scan-code.h, scan-code-c.c, scan-gram.h.
9466 (EXTRA_bison_SOURCES): Add scan-code.l.
9467 (BUILT_SOURCES): Add scan-code.c.
9468 (yacc): Be robust to white spaces.
9469
9470 * tests/conflicts.at, tests/input.at, tests/reduce.at,
9471 * tests/regression.at: Adjust the column numbers.
9472 * tests/regression.at: Adjust the error message.
7891a7c4 9473
184e42f0
JD
94742006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9475
9476 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9477 Use Akim's wording from
9478 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
9479
7891a7c4
JD
94802006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9481
9482 Between Bison releases, manually append `+' to the previous Bison
9483 release number, and use that as a signal to automatically print the
9484 ChangeLog's CVS Id keyword from --version. Discussed starting at
9485 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
9486 * ChangeLog: Add Id header.
9487 * configure.ac (AC_INIT): Append `+' to `2.3'.
9488 * src/.cvsignore: Add revision.c.
9489 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
9490 (BUILT_SOURCES): Add revision.c.
9491 (revision.c): New target rule. This file defines a new global variable
9492 named revision. It initializes it with either the Id from ChangeLog
9493 or, if VERSION doesn't contain `+', with the empty string.
9494 * src/getargs.c (version): Print the value of revision.
9495 * src/revision.h: Extern revision.
9496
4ad3ed84
PE
94972006-06-05 Paul Eggert <eggert@cs.ucla.edu>
9498
9499 * NEWS: Version 2.3.
9500 * configure.ac (AC_INIT): Likewise.
9501
02103984
PE
95022006-05-30 Paul Eggert <eggert@cs.ucla.edu>
9503
9504 * data/glr.c (YYRECOVERING): Define to be a function-like macro
9505 with no arguments, not as an object-like macro. This is for
9506 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
9507 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
9508 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
9509 Document this.
9510
2c08afa5
JD
95112006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
9512
9513 * src/getargs.c (usage): Back out yesterday's modification of the
9514 --help output so that we don't have to wait for translation before
9515 releasing 2.3.
9516
6077da58
PE
95172006-05-29 Paul Eggert <eggert@cs.ucla.edu>
9518
9519 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
9520 Problem reported by Akim Demaille.
9521
2a26b6c2
JD
95222006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
9523
9524 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9525
aefef0d6
PE
95262006-05-26 Paul Eggert <eggert@cs.ucla.edu>
9527
9528 * data/yacc.c (yy_reduce_print): Omit trailing white space in
9529 generated source code. Problem reported by Frans Englich in
9530 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
9531
fcd8e201
PE
95322006-05-22 Paul Eggert <eggert@cs.ucla.edu>
9533
9534 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
9535 shell, not within 'make', so that 'make' by an ordinary builder
9536 (using GNU make) does not worry about configuring gzip. This also
9537 works around a bug reported independently by Keith Thompson and by
9538 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
9539 stderr rather than stdout, messing up the build logs.
9540
7b5cdcbd
JD
95412006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9542
9543 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
9544 to make sure that YYID will never be unused. This fixes a 'make
9545 maintainer-check' failure caused by the recent changes to the 'Trivial
9546 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
9547 not used.
9548 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
9549
5ad0a449
JD
95502006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9551
9552 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
9553 state before an empty RHS is always resolved here. Only the location
9554 of that state is guaranteed to be resolved, and that's enough. This
9555 fixes the remaining bug reported by Derek M. Jones in
9556 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9557 * tests/glr-regression.at (Uninitialized location when reporting
9558 ambiguity): Test the above case.
9559 Also, the embedded comments in this test case claim it checks the case
9560 of an empty RHS that has inherited the initial location. However, the
9561 corresponding LHS was already resolved, so yyresolveLocations didn't
9562 actually have reason to modify it. Fix this by forcing
9563 nondeterministic operation at the beginning of the parse.
9564
50cce58e
PE
95652006-05-20 Paul Eggert <eggert@cs.ucla.edu>
9566
9567 * data/c.m4 (b4_yy_symbol_print_generate):
9568 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
9569 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
9570 of the bugs reported today by Derek M Jones in
9571 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9572 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
9573 defined to be a type name without parens or brackets.
9574 (Location Type): Similarly for YYLTYPE.
9575 * tests/regression.at (Trivial grammars): Put in a test for this
9576 bug that will be caught by 'make maintainer-check' (though not,
9577 alas, by 'make check' unless your compiler is picky).
9578
ab8d9dc5
PE
95792006-05-19 Paul Eggert <eggert@cs.ucla.edu>
9580
0d2c8934 9581 * NEWS: Version 2.2.
ab8d9dc5
PE
9582 * configure.ac (AC_INIT): Likewise.
9583
9138c575
JD
95842006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
9585
9586 * data/glr.c (yyreportTree): Make room in yystates for the state
9587 preceding the RHS. This fixes the segmentation fault reported by Derek
9588 M. Jones in
9589 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
9590 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
9591 to the user. Reported for yyreportTree by Derek M. Jones later in the
9592 same thread.
9593 * THANKS: Add Derek M. Jones.
9594 Update my email address.
9595 Fix typo in Steve Murphy's name.
9596
276f48df
PE
95972006-05-14 Paul Eggert <eggert@cs.ucla.edu>
9598
d6645148
PE
9599 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
9600 checking against YYLAST that caused the parser to miss a potential
9601 alternative in its diagnostic.
9602 Problem reported by Maria Jose Moron Fernandez in
9603 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
9604 * data/lalr1.cc (yysyntax_error_): Likewise.
9605 * data/yacc.c (yysyntax_error): Likewise.
9606 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
9607 tokens, in case we run into an older C compiler.
9608 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
9609 Use them to check for the off-by-one error fixed above.
9610
276f48df
PE
9611 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
9612 YYSIZE_T, not size_t.
9613 * tests/regression.at (Trivial grammars): New test, to catch
9614 the error fixed by the above patch.
9615
cd8b5791
AD
96162006-05-14 Akim Demaille <akim@lrde.epita.fr>
9617
9618 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
9619 scheme.
9620 Reported by Steve Murphy.
9621
34376418
AD
96222006-05-14 Akim Demaille <akim@lrde.epita.fr>
9623
9624 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
9625 * data/glr.cc: b4_location_flag is now b4_locations_flag.
9626
327afc7c
AD
96272006-05-14 Akim Demaille <akim@lrde.epita.fr>
9628
9629 Implement --trace=m4.
9630 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
9631 * src/output.c (output_skeleton): When set, pass -dV to m4.
9632
9633 Factor the handling of flags in m4.
9634 * src/output.c (prepare): Rename the muscle names debug, defines,
9635 error_verbose to debug_flag, defines_flag, error_verbose_flag.
9636 * data/c.m4: Adjust.
9637 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
9638 Use b4_define_flag_if to define other b4_FLAG_if macros.
9639 (b4_location_if): As a consequence, rename as...
9640 (b4_locations_if): this, for consistency.
9641 Adjust all the skeletons.
9642
ba9ecd19
AD
96432006-05-14 Akim Demaille <akim@lrde.epita.fr>
9644
9645 * etc/bench.pm: Shorten bench names.
9646
4e83ea15
AD
96472006-05-14 Akim Demaille <akim@lrde.epita.fr>
9648
9649 * src/output.h, src/output.c (error_verbose): Move to...
9650 * src/getargs.h, src/getargs.c: here.
9651 Sort the flags.
9652 Adjust dependencies.
9653
6e93d810
PE
96542006-05-13 Paul Eggert <eggert@cs.ucla.edu>
9655
9656 * data/c.m4 (b4_copyright): Put the special exception for Bison
9657 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
9658 uses changed. Suggested by Akim Demaille. Also, wrap the
9659 copyright notice, in case it is longer than 80 columns. Replace
9660 comma by newline after title.
6e93d810 9661
eaea13f5
PE
96622006-05-11 Paul Eggert <eggert@cs.ucla.edu>
9663
9664 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
9665 incompatibility, not a bug. Mention that it wasn't fixed as of
9666 flex 2.5.33.
9667
3cf084ec
AD
96682006-05-11 Akim Demaille <akim@lrde.epita.fr>
9669
9670 * examples/extexi: Enforce the precedence of concatenation over
9671 >>.
0a9f1c7d 9672 Reported by Tommy Nordgren.
3cf084ec 9673
32c96bd7
AD
96742006-05-11 Akim Demaille <akim@lrde.epita.fr>
9675
9676 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
9677 with the member "token".
f94705b2 9678 Reported by Martin Nylin.
32c96bd7 9679
eaea13f5
PE
96802006-05-08 Paul Eggert <eggert@cs.ucla.edu>
9681
9682 * data/glr.c: Switch to Bison 2.2 special-exception language in
9683 the copyright notice. Use more-regular format for titles and
9684 copyright notices.
9685 * data/glr.cc: Likewise.
9686 * data/location.cc: Likewise.
9687 * data/yacc.cc: Likewise.
9688 * doc/bison.texinfo (Conditions): Document this.
9689 * NEWS: likewise. Upgrade version to 2.2.
9690
6e2d1146
AD
96912006-04-27 Akim Demaille <akim@lrde.epita.fr>
9692
9693 * data/glr.cc: Remove dead code.
9694
47671055
PE
96952006-04-25 Paul Eggert <eggert@cs.ucla.edu>
9696
9697 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
9698 that variable and the line breaks the bootstrap. Problem reported
9699 by Juan M. Guerrero.
9700
ed2e6384
AD
97012006-04-24 Akim Demaille <akim@lrde.epita.fr>
9702
9703 * doc/bison.texinfo (Multiple start-symbols): New.
9704
3cedc2dc
AD
97052006-04-24 Akim Demaille <akim@lrde.epita.fr>
9706
9707 * etc/README, etc/bench.pl: New.
9708
b2ddc3f3
AD
97092006-04-03 Akim Demaille <akim@lrde.epita.fr>
9710
9711 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
9712 rule.
9713 Reported by Mickael Labau.
9714 * tests/input.at (Torturing the Scanner): Test it.
9715
91e3ac9a
PE
97162006-03-16 Paul Eggert <eggert@cs.ucla.edu>
9717
9718 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
9719 Problem reported by Bob Rossi.
9720
97212006-03-13 Paul Eggert <eggert@cs.ucla.edu>
9722
9723 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
9724 and didn't really work.
9725 For the index, use @ifnotinfo, not @iftex.
9726 Minor cleanups of spacing and terminology.
9727
5cf61e93
AD
97282006-03-12 Akim Demaille <akim@lrde.epita.fr>
9729
9730 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
9731 of AT_NAME_PREFIX when %name-prefix is not used.
9732
aa08666d
AD
97332006-03-12 Akim Demaille <akim@lrde.epita.fr>
9734
9735 Apply --prefix to C++ skeletons too: they change the namespace.
9736 The test suite already exercize these cases.
9737 * data/c++.m4 (b4_namespace): New.
9738 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
9739 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
9740 * data/yacc.c, data/glr.c: Remove a useless `[]'.
9741 * doc/bison.texinfo: Document it.
9742 (Option Cross Key): Use @multitable in all formats. It looks
9743 nicer, even in TeX outputs.
9744 (Rules): Use the same code whatever the output type is.
9745 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
9746 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
9747 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 9748
45567173
AD
97492006-03-10 Akim Demaille <akim@lrde.epita.fr>
9750
9751 * TODO: Remove dead items.
9752
e9d8f881 97532006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
9754
9755 * doc/FAQ: Remove, merged into...
9756 * doc/bison.texinfo (FAQ): this.
9757 * doc/Makefile.am (EXTRA_DIST): Adjust.
9758
c095d689
AD
97592006-03-10 Akim Demaille <akim@lrde.epita.fr>
9760
9761 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
9762 even if empty.
9763 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
9764 * doc/bison.texinfo (Calc++ Scanner): Use it.
9765
6e0f8287
PE
97662006-03-09 Paul Eggert <eggert@cs.ucla.edu>
9767
9768 Fix two nits reported by twlevo, plus one more that I discovered.
9769
9770 * src/assoc.h (assoc_to_string): Give a name to the arg, as
9771 this is the usual Bison style.
9772 * src/location.h (location_print): Likewise.
9773
9774 * src/reader.h (token_name): Likewise.
9775
d6b771c3
PE
97762006-03-08 Paul Eggert <eggert@cs.ucla.edu>
9777
9778 Fix some nits reported by twlevo.
9779 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
9780 and "POSIX". Use more-modern syntax for URLs. Mention C++
9781 and ask for Java. Don't hardwire OS version numbers. Add
9782 copyright notice.
9783 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
9784 * src/conflicts.c (solved_conflicts_obstack): Now static.
9785
1e137b71
JD
97862006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
9787
9788 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
9789 page. Say "you can use it" not "you may use it" as on the web page;
9790 we're describing capabilities not granting permission.
9791
73f2e47e
PE
97922006-03-06 Paul Eggert <eggert@cs.ucla.edu>
9793
6d05403d
PE
9794 * data/glr.c (yyresolveLocations): Rename local variables to avoid
9795 shadowing warnings. Use usual patter for iterating through RHS.
9796 * tests/glr-regression.at
9797 (Uninitialized location when reporting ambiguity):
9798 Modify yylex so that it uses its argument, rather than trying
9799 to rely on ARGSUSED (which doesn't work for gcc with warnings).
9800 const char -> char const.
9801
73f2e47e
PE
9802 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
9803 Don't use tabs inside commands; it messes up 'ps'.
9804 Problem reported by twlevo.
9805
8710fc41
JD
98062006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
9807
9808 * tests/glr-regression.at (Uninitialized location when reporting
9809 ambiguity): New test case.
9810 * data/glr.c (yyresolveLocations): New function, which uses
9811 YYLLOC_DEFAULT.
9812 (yyresolveValue): Invoke yyresolveLocations before reporting an
9813 ambiguity.
9814 * doc/bison.texinfo (Default Action for Locations): Note
9815 YYLLOC_DEFAULT's usage for ambiguity locations.
9816 (GLR Semantic Actions): Cross-reference those notes.
9817
ae952af2
JD
98182006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
9819
9820 * tests/glr-regression.at (Leaked semantic values when reporting
9821 ambiguity): Remove unnecessary union and type declarations.
9822 (Leaked lookahead after nondeterministic parse syntax error): New test
9823 case.
9824 * data/glr.c (yyparse): Check for zero stacks remaining before
9825 attempting to shift the lookahead so that you don't lose it.
9826
35ee866a
JD
98272006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9828
9829 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
9830 * tests/glr-regression.at (Leaked semantic values when reporting
9831 ambiguity): New test case.
9832 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
9833 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
9834 now unnecessary yystackp parameter.
9835 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
9836 destructors can be called.
9837
9838 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
9839 in existing testcases.
9840
520181ab
JD
98412006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9842
9843 Don't leak semantic values for parent RHS when a user action cuts the
9844 parser, and clean up related code a bit.
9845 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
9846 cuts parse): Rename to...
9847 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
9848 for leaked parent RHS values.
9849 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
9850 between an unresolved state (non-empty chain of semantic options) and
9851 an incomplete one (signaled by an empty chain).
ae952af2 9852 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
9853 successfully or unsuccessfully resolved yyGLRState to...
9854 (yyresolveValue): ... here so that yyresolveValue always leaves a
9855 yyGLRState with consistent data and thus is easier to understand.
9856 Remove the yyvalp and yylocp parameters since they are always just
9857 taken from the yys parameter. When reporting a discarded merged value
9858 in debugging output, note that it is incompletely merged. Document the
9859 interface.
9860 (yyresolveAction): If resolving any of the RHS states fails, destroy
9861 them all rather than leaking them. Thus, as long as user actions are
9862 written to clean up the RHS correctly, yyresolveAction always cleans up
9863 the RHS of a semantic option. Document the interface.
9864
18d9185c
PE
98652006-02-27 Paul Eggert <eggert@cs.ucla.edu>
9866
9867 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
9868 led to a segmentation fault in GNU Pascal. Problem reported
9869 by Waldek Hebisch.
9870
841a7737
JD
98712006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
9872
9873 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
9874 mid-rule action inside a nonterminal symbol in order to declare a
9875 destructor for its semantic value.
9876
fc3f467f
PE
98772006-02-16 Paul Eggert <eggert@cs.ucla.edu>
9878
9879 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
9880 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
9881 __cplusplus && ! defined _STDLIB_H && !
9882 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
9883 defined free))]: Include <stdlib.h> rather than rolling our own
9884 declarations of malloc and free, to avoid problems with
9885 incompatible declarations (using 'throw') C++'s stdlib.h. This
9886 should fix Debian bug 340012
9887 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
9888 reported by Guillaume Melquiond.
9889
a3af26dd
PE
98902006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9891
4d7bc38c
PE
9892 * NEWS: Clarify symbols versus types in unused-value warnings.
9893
a3af26dd
PE
9894 * configure.ac (AC_INIT): Bump version number.
9895
4e26c69e
PE
98962006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9897
9898 * NEWS: Version 2.1a.
9899 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
9900 since C99 requires this.
9901
498e897c
PE
99022006-02-11 Paul Eggert <eggert@cs.ucla.edu>
9903
9904 * m4/c-working.m4: New file.
9905 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
9906
57bb17ca
PE
99072006-02-10 Paul Eggert <eggert@cs.ucla.edu>
9908
9909 * Makefile.maint: Merge from coreutils.
9910
0be105dc
PE
99112006-02-09 Paul Eggert <eggert@cs.ucla.edu>
9912
9913 More portability fixes for problems summarized by Nelson H. F. Beebe.
9914
9915 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
9916 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
9917 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
9918 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
9919 messes up because C++ code is compiled in 32-bit mode but linked
9920 in 64-bit mode.
9921
6fc0c024
PE
99222006-02-08 Paul Eggert <eggert@cs.ucla.edu>
9923
9924 More portability fixes for problems summarized by Nelson H. F. Beebe.
9925
7870f699
PE
9926 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
9927 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
9928
6fc0c024
PE
9929 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
9930 nodist_PROGRAMS, since we don't need to actually compile the
9931 example if we're just doing a plain 'make'. This avoids bothering
9932 the installer unnecessarily about problems due to weird C++
9933 compilers.
9934
fe6c2fde
PE
99352006-02-06 Paul Eggert <eggert@cs.ucla.edu>
9936
9937 More portability fixes for problems summarized by Nelson H. F. Beebe.
9938
9939 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
9940 than #include "...", and compile with -I'.'. The old method was
9941 not portable, according to Posix and the C standard, and it does
9942 not work with Sun C 5.7, where previous #line directives affect
9943 the working directory used in later #include "..." directives.
9944
927b425b
JMG
99452006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9946
9947 Various DJGGP specific issues in /djgpp
9948
d9735e9e
PE
99492006-02-02 Paul Eggert <eggert@cs.ucla.edu>
9950
9951 More portability fixes for problems summarized by Nelson H. F. Beebe.
9952
9953 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
9954 '#include <map>' works and that you can apply ++ to iterators.
9955
5a6755af
PE
99562006-02-01 Paul Eggert <eggert@cs.ucla.edu>
9957
67a0dc4f
PE
9958 Work around portability problems summarized by Nelson H. F. Beebe in
9959 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
9960
8c86f0ef
PE
9961 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9962 that '#include <string>' works.
9963
de35dd59
PE
9964 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
9965 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
9966 "warning: sorry: semantics of inline function static data `const
9967 unsigned char translate_table[262]' are wrong (you'll wind up with
9968 multiple copies)".
9969
67a0dc4f
PE
9970 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
9971 or, xor to not_, and_, or_, and xor_, respectively. This works
9972 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
9973 random system header somewhere that includes the equivalent of
9974 <iso646.h>.
9975
5a6755af
PE
9976 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
9977 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 9978 Suite Version 2.0.
5a6755af 9979
3f001415
JD
99802006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
9981
9982 During deterministic GLR operation, user actions should be able to
9983 influence the parse by changing yychar. To make this easier to fix and
9984 to make glr.c easier to evolve in general, don't maintain yytoken in
9985 parallel with yychar; just compute yytoken when needed.
9986 * tests/glr-regression.at (Incorrect lookahead during deterministic
9987 GLR): Check that setting yychar in a user action has the intended
9988 effect.
9989 * data/glr.c (yyGLRStack): Remove yytokenp member.
9990 (yyclearin): Don't set *yytokenp.
9991 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
9992 yychar rather than *yytokenp to determine the current lookahead.
9993 Compute yytoken locally when needed.
9994 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
9995 point to.
9996
9997 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
9998 after `--report' documentation.
9999
e2a8c0f5
PE
100002006-01-30 Paul Eggert <eggert@cs.ucla.edu>
10001
10002 * src/parse-gram.y (grammar_declaration): Location of printer
10003 symbol is @1, not list->location. Bug reported by twlevo.
10004 * tests/input.at (Incompatible Aliases): Adjust to above change.
10005
6b702268
PE
100062006-01-29 Paul Eggert <eggert@cs.ucla.edu>
10007
27622431
PE
10008 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
10009 all the test at once. This makes the output easier to read in the
10010 normal case.
10011
6b702268
PE
10012 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
10013 got from <http://bro-ids.org/download.html>. The bug is that
10014 when two actions appeared in succession, the second one was
10015 scanned before the first one was added to the grammar rule
10016 as a midrule action. Bison then output the incorrect warning
10017 "parse.y:905.17-906.36: warning: unused value: $3".
10018 * src/parse-gram.y (BRACED_CODE, action): These are no longer
10019 associated with a value.
10020 (rhs): Don't invoke grammar_current_rule_action_append.
10021 (action): Invoke it here instead.
10022 * src/reader.c (grammar_midrule_action): Now extern.
10023 (grammar_current_rule_action_append): Don't invoke
10024 grammar_midrule_action; that is now the scanner's job.
10025 * src/reader.h (last_string, last_braced_code_loc):
10026 (grammar_midrule_action): New decls.
10027 * src/scan-gram.l (last_string): Now extern, sigh.
10028 (last_braced_code_loc): New extern variable.
10029 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
10030 rule already has an action.
10031 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
10032 * tests/input.at (AT_CHECK_UNUSED_VALUES):
10033 Add some tests to check that the above changes fixed the bug.
10034
d40ba6c2
PE
100352006-01-27 Paul Eggert <eggert@cs.ucla.edu>
10036
10037 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
10038 All used changed. Check whether the symbol has a destructor,
10039 not whether it is typed.
10040 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
10041 that the values are still reported as unused. All line numbers
10042 adjusted.
10043
401aace6
PE
100442006-01-23 Paul Eggert <eggert@cs.ucla.edu>
10045
10046 Work around a bug in bro 0.8, which underparenthesizes its
10047 definition of YYLLOC_DEFAULT.
10048 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
10049 their arguments.
10050 * data/lalr1.cc: Likewise.
10051 * data/yacc.cc: Likewise.
10052
06f01bc4
PE
100532006-01-22 Paul Eggert <eggert@cs.ucla.edu>
10054
401aace6
PE
10055 Work around a bug in Pike 7.0, and give the Pike folks a
10056 better way to override the usual int widths.
10057 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
10058 user can override the types.
10059 (short): #undef, to work around a bug in Pike 7.0.
10060 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
10061 (union yyalloc.yyss): Use yytype_int16 rather than short.
10062 All uses changed.
10063 (yysigned_char): Remove.
10064 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
10065 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
10066 * tests/regression.at (Web2c Actions): Adjust to above changes.
10067
10068 * src/reader.c (check_and_convert_grammar): New function.
10069 (reader): Close the input file even if something went wrong during
10070 parsing. Minor file descriptor leak reported by twlevo.
10071
06f01bc4
PE
10072 * src/assoc.c (assoc_to_string): Use a default: abort (); case
10073 to pacify gcc -Wswitch-default.
10074 * src/scan-gram.l (adjust_location): Use a default: break; case
10075 to pacify gcc -Wswitch-default.
10076 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
10077 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10078 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10079 Move these decls to scan-skel.l, since they don't need to be
10080 visible elsewhere.
10081 * src/scan-skel.l: Accept the above decls.
10082 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
10083 is used.
10084
02650b7f
PE
100852006-01-21 Paul Eggert <eggert@cs.ucla.edu>
10086
10087 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
10088 since we don't want to insist on a version number at the start
10089 of the changelog every time.
10090 * Makefile.maint: Sync from coreutils a bit better.
10091 (sc_trailing_blank): Renamed from sc_trailing_space.
10092 All uses changed.
10093 (sc_no_if_have_config_h, sc_require_config_h):
10094 (sc_prohibit_assert_without_use): New rules.
10095 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
10096 (sc_dd_max_sym_length): Fix leading spaces in rule.
10097 (sc_system_h_headers): Prefix with @.
10098 (sc_useless_cpp_parens, m4-check): Output line numbers.
10099 (changelog-check): Allow version only in head.
10100 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
10101 satisfy new Makefile.maint rule.
10102 * data/glr.c: Likewise.
10103 * data/glr.cc: Likewise.
10104 * data/lalr1.cc: Likewise.
10105 * data/yacc.c: Likewise.
10106 * lib/ebitsetv.c: Likewise.
10107 * lib/lbitset.c: Likewise.
10108 * lib/subpipe.c: Likewise.
10109 * lib/timevar.c: Likewise.
10110 * src/system.h: Likewise.
10111 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
10112 * djgpp/Makefile.maint: Add copyright notice.
10113 * djgpp/README.in: Likewise.
10114 * djgpp/config.bat: Likewise.
10115 * djgpp/config.site: Likewise.
10116 * djgpp/config_h.sed: Likewise.
10117 * djgpp/djunpack.bat: Likewise.
10118 * djgpp/config.sed: Fix copyright notice to match standard format.
10119 * djgpp/subpipe.h: Likewise.
10120 * lib/bitsetv-print.c: Likewise.
10121 * lib/bitsetv.c: Likewise.
10122 * lib/subpipe.h: Likewise.
10123 * lib/timevar.c: Likewise.
10124 * lib/timevar.h: Likewise.
10125 * djgpp/subpipe.c: Use standard recipe for config.h.
10126 * lib/abitset.c: Likewise.
10127 * lib/bitset.c: Likewise.
10128 * lib/bitset_stats.c: Likewise.
10129 * lib/bitsetv-print.c: Likewise.
10130 * lib/bitsetv.c: Likewise.
10131 * lib/ebitsetv.c: Likewise.
10132 * lib/get-errno.c: Likewise.
10133 * lib/lbitset.c: Likewise.
10134 * lib/subpipe.c: Likewise.
10135 * lib/timevar.c: Likewise.
10136 * lib/vbitset.c: Likewise.
10137 * tests/local.at: Likewise.
10138 * src/scan-gram.l: Don't include verify.h, since system.h does
10139 that for us.
10140 * .x-sc_require_config_h: New file.
10141 * .x-sc_unmarked_diagnostics: New file.
10142
287c78f6
PE
101432006-01-20 Paul Eggert <eggert@cs.ucla.edu>
10144
287c78f6
PE
10145 Be a bit more systematic about using 'abort'.
10146 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
10147 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
10148 Put 'default: abort ();' before some other case, to satisfy older
10149 pedantic compilers.
10150 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10151 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
10152 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
10153 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
10154 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
10155 (get_decision_str, get_orientation_str, get_node_alignment_str):
10156 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
10157 (get_linestyle_str, get_arrowstyle_str): Likewise.
10158 * src/conflicts.c (resolve_sr_conflict):
10159 Use a default case rather than one for the one remaining enum
10160 value, to catch invalid enum values as well.
10161 * src/lalr.c (set_goto_map, map_goto):
10162 Prefer "assert (FOO);" to "if (!FOO) abort ();".
10163 * src/nullable.c (nullable_compute, token_definitions_output):
10164 Likewise.
10165 * src/reader.c (packgram, reader): Likewise.
10166 * src/state.c (transitions_to, state_new, state_reduction_find):
10167 Likewise.
10168 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
10169 (symbol_pack): Likewise.
10170 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
10171 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
10172 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
10173 * src/system.h: Don't include <assert.h>.
10174 (assert): New macro.
10175
10176 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
10177 (Destructor Decl, Parser Function, Pure Calling):
10178 Describe rules for braces inside C code more carefully.
287c78f6 10179
c66dfadd
PE
101802006-01-19 Paul Eggert <eggert@cs.ucla.edu>
10181
c21493b8
PE
10182 Fix some porting glitches found by Nelson H. F. Beebe.
10183 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
10184 compilers that don't understand that abort () does not return.
10185 * src/state.c (transitions_to): Likewise.
10186 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10187 that '#include <cstdlib>' works.
10188 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
10189 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
10190 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
10191 for the benefit of some pre-C99 compilers.
10192
b6e3facf
PE
10193 * bootstrap: Undo changes to gnulib files that autoreconf made.
10194
c66dfadd
PE
10195 Minor fixups to get 'make maintainer-check' to work.
10196 * configure.ac: Don't use -Wnested-externs, as it's incompatible
10197 with the new verify.h implementation.
10198 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
10199 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
10200 * data/yacc.c (YYUSE): Likewise.
10201 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
10202 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
10203 * src/parse-gram.y (declaration): Don't pass a string constant
10204 to a function that expects char *, since GCC might complain
10205 about the constant value.
10206 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
10207 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
10208 before #defining them.
10209 * tests/glr-regression.at
10210 (Incorrectly initialized location for empty right-hand side in GLR):
10211 In yyerror, use the msg arg.
10212 (Corrupted semantic options if user action cuts parse):
10213 (Incorrect lookahead during deterministic GLR):
10214 (Incorrect lookahead during nondeterministic GLR):
10215 Don't name a local var 'index'; it shadows string.h's 'index'.
10216
ed94ef2a
AD
102172006-01-19 Akim Demaille <akim@epita.fr>
10218
10219 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
10220 location, not just parts of it.
10221
e9ad4aec
PE
102222006-01-18 Paul Eggert <eggert@cs.ucla.edu>
10223
d6ca7905
PE
10224 * NEWS: Document the fact that multiple %unions are now allowed.
10225 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
10226 * TODO: This feature is now implemented, so remove it from
10227 the wishlist.
d6ca7905 10228
ef1b70e0
PE
10229 * Makefile.maint: Merge with coreutils Makefile.maint.
10230 (CVS_LIST): Use build-aux version if available.
10231 (VERSION_REGEXP): New macro.
10232 (syntax-check-rules): Add sc_no_if_have_config_h,
10233 sc_prohibit_assert_without_use, sc_require_config_h,
10234 sc_useless_cpp_parens.
10235 (sc_obsolete_symbols): Check for O_NDELAY.
10236 (sc_dd_max_sym_length): Track coreutils.
10237 (sc_unmarked_diagnostics): Look in all files, not just *.c.
10238 (sc_useless_cpp_parens): New rule.
10239 (news-date-check): Look for version or today's date.
10240 (changelog-check): Don't require version number near head.
10241 (copyright-check): Use current year instead of hardwiring 2005.
10242 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
10243 (announcement): Add --gpg-key-ID.
10244
10245 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
10246 with "file system".
10247
2073ce56 10248 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
10249 array. Problem reported by twlevo.
10250 * src/reader.c (packgram): Prepend a new sentinel before ritem.
10251 * src/lalr.c (build_relations): Rely on new sentinel.
10252 * src/gram.c (gram_free): Adjust to new sentinel.
10253
b7691f15
JD
102542006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
10255
10256 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
10257 yylookaheadNeeds. All uses updated.
10258 (yysplitStack): Rename local yynewLookaheadStatuses to
10259 yynewLookaheadNeeds.
10260 * data/glr-regression.at (Incorrect lookahead during nondeterministic
10261 GLR): In comments, change `lookahead status' to `lookahead need'.
10262
ddee1b06
PH
102632006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10264
10265 * data/glr.c (yysplitStack): A little stylistic rewrite.
10266
12f4614d
PH
102672006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10268
10269 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
10270
32c29292
JD
102712006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
10272
10273 * doc/bison.texinfo: Fix some typos.
10274 (GLR Semantic Actions): New subsection discussing special
10275 considerations because GLR semantic actions might be deferred.
10276 (Actions): Mention look-ahead usage of yylval.
10277 (Actions and Locations): Mention look-ahead usage of yylloc.
10278 (Special Features for Use in Actions): Add YYEOF entry and mention it
10279 in the yychar entry.
10280 In the yychar entry, remove mention of the local yychar case (pure
10281 parser) since this is irrelevant information when writing semantic
148d66d8 10282 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
10283 yychar is otherwise described as an external variable.
10284 In the yychar entry, don't call it the `current' look-ahead since it
10285 isn't when semantic actions are deferred.
10286 In the yychar and yyclearin entries, add note about deferred semantic
10287 actions.
10288 Add yylloc and yylval entries discussing look-ahead usage.
10289 (Look-Ahead Tokens): When discussing yychar, don't call it the
10290 `current' look-ahead, and do mention yylval and yylloc.
10291 (Error Recovery): Cross-reference `Action Features' when mentioning
10292 yyclearin.
148d66d8 10293 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
10294 look-ahead.
10295 In the yylloc and yylval entries, mention look-ahead usage.
10296
de366a2f 102972006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
10298
10299 * tests/glr-regression.at: Update copyright year to 2006.
10300
bf70fa87
JD
103012006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10302
10303 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
10304 use during nondeterministic operation to track which stacks have
10305 actually needed the current lookahead.
10306 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
10307 Allocate, deallocate, resize, and otherwise shuffle space for
10308 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
10309 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
10310 appropriately during nondeterministic operation.
10311 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
10312 members to store the current lookahead to be used by the deferred
10313 user action.
10314 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
10315 from which the RHS is taken. Set the lookahead members of the new
10316 yySemanticOption according to the lookahead status for stack yyk.
10317 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
10318 yyaddDeferredAction.
10319 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
10320 members of yySemanticOption before invoking yyuserAction, and then set
10321 them back to their current values afterward.
10322 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
10323 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
10324 * tests/glr-regression.at: Remove `.' from the ends of recent test case
10325 titles for consistency.
10326 (Leaked merged semantic value if user action cuts parse): In order to
10327 suppress lint warnings, use arguments in merge function, and assign
10328 char value < 128 in main.
10329 (Incorrect lookahead during deterministic GLR): New test case.
10330 (Incorrect lookahead during nondeterministic GLR): New test case.
10331
05449a2c
JD
103322006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10333
de366a2f 10334 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
10335 !yyvaluep as signal that no semantic value is available to print.
10336 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
10337 to print a semantic value.
10338
4158e0a1 103392006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 10340
4158e0a1
JD
10341 * tests/glr-regression.at: For consistency with my newer test cases,
10342 don't thank myself.
10343
d659304d
JD
103442006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
10345
10346 * data/glr.c (yyresolveValue): When merging semantic options, if at
10347 least one user action succeeds but a later one cuts the parse, then
10348 destroy the semantic value before returning rather than leaking it.
10349 (yyresolveStates): If a user action cuts the parse and thus
10350 yyresolveValue fails, ignore the (unset) semantic value rather than
10351 corrupting the yyGLRState, and empty the semantic options list since
10352 the user actions should have called all necessary destructors.
10353 Simplify code with YYCHK.
10354 * tests/glr-regression.at (Corrupted semantic options if user action
10355 cuts parse): New test case.
10356 (Undesirable destructors if user action cuts parse): New test case.
10357 Before applying any of this patch, this test case never actually failed
10358 for me... but only because the corrupted semantic options usually
10359 masked this bug.
10360 (Leaked merged semantic value if user action cuts parse): New test
10361 case.
10362
6ec2c0f2
AD
103632006-01-05 Akim Demaille <akim@epita.fr>
10364
10365 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
10366
1b9c21fb
PE
103672006-01-04 Paul Eggert <eggert@cs.ucla.edu>
10368
10369 * data/c.m4 (b4_c_modern): New macro, with a new provision for
10370 _MSC_VER. Problem reported by Cenzato Marco.
10371 (b4_c_function_def): Use it.
10372 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
10373 b4_c_modern.
10374 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
10375 than rolling our own.
10376
84866159
AD
103772006-01-04 Akim Demaille <akim@epita.fr>
10378
10379 Also warn about non-used mid-rule values.
10380 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
10381 member.
10382 (symbol_list_new): Adjust.
10383 * src/reader.c (symbol_typed_p): New.
10384 (grammar_rule_check): Use it.
10385 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
10386 Check its rule.
10387 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
10388 Use it.
10389 * tests/actions.at (Exotic Dollars): Adjust.
10390
378f4bd8
AD
103912006-01-04 Akim Demaille <akim@epita.fr>
10392
10393 * src/reader.c (grammar_midrule_action): If $$ is set in a
10394 mid-rule, move the `used' bit to its lhs.
10395 * tests/input.at (Unused values): New.
10396 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
10397
e2a21b6f
PE
103982006-01-03 Paul Eggert <eggert@cs.ucla.edu>
10399
54662697
PE
10400 * doc/bison.texinfo (Bison Options): Say more accurately what
10401 --yacc does.
10402 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
10403 about declarations in the grammar when in Yacc mode, as POSIX does
10404 not require a diagnostic when the grammar uses extensions.
10405
10406 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
10407
073f9288
PE
10408 Warn about dubious constructions like "%token T T".
10409 Reported by twlevo.
10410 * src/symtab.h (struct symbol.declared): New member.
10411 * src/symtab.c (symbol_new): Initialize it to false.
10412 (symbol_class_set): New arg DECLARING, specifying whether
10413 this is a declaration that we want to warn about, if there
10414 is more than one of them. All uses changed.
10415
1221b78a
PE
10416 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
10417 Allow multiple %union directives, whose contents concatenate.
10418 * src/parse-gram.y (grammar_declaration): Likewise.
10419 Use muscle_code_grow, so that we don't need stype_line any more.
10420 All uses changed.
10421
10422 * src/muscle_tab.c (muscle_grow): Fix comment.
10423
e2a21b6f
PE
10424 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
10425 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
10426 Update copyright year to 2006.
10427
8f7e3cf9
AD
104282006-01-03 Akim Demaille <akim@epita.fr>
10429
10430 Have glr.cc pass (some of) the calc.at tests.
10431 * data/glr.cc (b4_parse_param_orig): New.
10432 (b4_parse_param): Improve its definition, and bound it more
10433 clearly in the skeleton.
10434 (b4_epilogue): Append, instead of prepending, in order to keep
10435 #line consistency.
10436 Simplify the generation of auxiliary functions: locations and
10437 purity are mandated.
10438 (b4_global_tokens_and_yystype): Honor it.
10439 * data/location.cc (c++.m4): Don't include it.
10440 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
10441 and AT_SKEL_CC_IF.
10442 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
10443 AT_LALR1_CC_IF.
10444 Be sure to initialize the first position's filename.
10445 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
10446 mandated anyway.
10447 (AT_CHECK_CALC_GLR_CC): New.
10448 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
10449
3953ed88
AD
104502006-01-02 Akim Demaille <akim@epita.fr>
10451
10452 * src/output.c (output_skeleton): Don't hard wire the inclusion of
10453 c.m4.
0a96ba81 10454 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
10455 * data/glr.cc: Do not include stack.hh.
10456
9ecafbbf
AD
104572006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
10458
10459 * data/glr.c: Reformat whitespace with tabs.
10460 (b4_lpure_formals): Remove this unused m4 macro.
10461 * tests/cxx-type.at: Reformat whitespace with tabs.
10462 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
10463 since it's a member. Rename type to isNterm for clarity.
10464
c4d497a0
AD
104652005-12-29 Akim <akim@sulaco.local>
10466
10467 Let glr.cc catch up with symbol_value_print.
10468 * data/glr.cc (b4_yysymprint_generate): Replace by...
10469 (b4_yy_symbol_print_generate): this.
10470 (yy_symbol_print, yy_symbol_value_print): Declare them.
10471
4517da37
PE
104722005-12-28 Paul Eggert <eggert@cs.ucla.edu>
10473
10474 * src/location.h (boundary): Note that a line or column equal
10475 to INT_MAX indicates an overflow.
10476 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
10477 (rule_length_overflow, increment_rule_length, add_column_width):
10478 New functions.
10479 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
10480 (<SC_BRACED_CODE>"}"):
10481 Use increment_rule_length rather than incrementing it by hand.
10482 (adjust_location, handle_syncline): Diagnose overflow.
10483 (handle_action_dollar, handle_action_at):
10484 Fix bug with monstrosities like $-2147483648.
10485 Remove now-unnecessary checks.
10486 (scan_integer): Verify assumptions and remove now-unnecessary checks.
10487 (convert_ucn_to_byte): Verify assumptions.
10488 (handle_syncline): New arg LOC. All callers changed.
10489 Don't store through a value derived from char const * pointer.
10490
10491 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
10492 GCC warnings.
10493
e3233bf6
PE
104942005-12-27 Paul Eggert <eggert@cs.ucla.edu>
10495
10496 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
10497 Remove unnecessary forward static decls.
10498
8f3596a6
AD
104992005-12-27 Akim Demaille <akim@epita.fr>
10500
10501 * src/reader.c (grammar_current_rule_check): Also check that $$
10502 is used.
10503 Take the rule to check as argument, hence rename as...
10504 (grammar_rule_check): this.
10505 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
10506 Rename as...
10507 (grammar_rule_begin, grammar_rule_end): these, for consistency.
10508 (grammar_midrule_action, grammar_symbol_append): Now static.
10509 * tests/torture.at (input): Don't rely on the default action
10510 being always performed.
10511 * tests/calc.at: "Set" $$ even when the action is "cut" with
10512 YYERROR or other.
10513 * tests/actions.at (Exotic Dollars): Instead of using unused
10514 values, check that the warning is issued.
10515
721be13c
PE
105162005-12-22 Paul Eggert <eggert@cs.ucla.edu>
10517
10518 * NEWS: Improve wording for unused-value warnings.
10519
a0af42fc
AD
105202005-12-22 Akim Demaille <akim@epita.fr>
10521
10522 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
10523 (b4_yysymprint_generate): Rename as...
10524 (b4_yy_symbol_print_generate): this.
10525 Generate yy_symbol_print instead of yysymprint.
10526 Generate also yy_symbol_value_print, and use it.
10527
affac613
AD
105282005-12-22 Akim Demaille <akim@epita.fr>
10529
721be13c 10530 * NEWS: Warn about unused values.
affac613
AD
10531 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
10532 a `used' member.
10533 (symbol_list_n_get, symbol_list_n_used_set): New.
10534 (symbol_list_n_type_name_get): Use symbol_list_n_get.
10535 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
10536 * src/reader.c (grammar_current_rule_check): Check that values are
10537 used.
10538 * src/symtab.c (symbol_print): Accept 0.
10539 * tests/existing.at: Remove the type information.
10540 Empty the actions.
10541 Remove useless actions (beware of mid-rule actions: perl -000
10542 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
10543 * tests/actions.at (Exotic Dollars): Use unused values.
10544 * tests/calc.at: Likewise.
10545 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10546 Likewise.
10547
10548 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
10549 rule_useful_p.
10550
9d9b8b70
PE
105512005-12-21 Paul Eggert <eggert@cs.ucla.edu>
10552
8bb4c753
PE
10553 Undo 2005-12-01 tentative license wording change. The wording is
10554 still being reviewed by the lawyers, and we don't want to wait for
10555 them before publishing a test release. For now, revert to the
10556 previous wording.
10557 * NEWS: Undo 2005-12-01 change.
10558 * data/glr.c: Revert to previous license wording.
10559 * data/glr.cc: Likewise.
10560 * data/lalr1.cc: Likewise.
10561 * data/location.cc: Likewise.
10562 * data/yacc.c: Likewise.
10563
9d9b8b70
PE
10564 * NEWS: Reword %destructor vs YYABORT etc.
10565 * data/glr.c: Use American spacing, for consistency.
10566 * data/glr.cc: Likewise.
10567 * data/lalr1.cc: Likewise.
10568 * data/yacc.c: Likewise.
10569 * data/yacc.c: Reformat comments slightly.
10570 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
10571 for consistency. Fix some spelling errors and reword recently-included
10572 text slightly.
10573 * tests/cxx-type.at: Cast results of malloc, for C++.
10574
2c3b392a
AD
105752005-12-21 Joel E. Denny <address@hidden>
10576
10577 * tests/cxx-type.at: Construct a tree, count the parents of shared
10578 nodes, and free each node once and only once. Previously, the memory
10579 for semantic values was leaked instead.
10580
d6cff4dc
AD
105812005-12-21 Joel E. Denny <address@hidden>
10582
10583 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
10584 (yylval, yylloc): If pure, #define to yystackp->yyval and
10585 yystackp->yyloc similar to yychar and yynerrs.
10586 (yyparse): If pure, remove local yylval and yylloc. Add local
10587 yystackp to accommodate pure definitions of yylval and yylloc.
10588 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
10589 yylvalp and yyllocp to &yylval and &yylloc.
10590 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
10591 namespace. Previously, nerrs and char were missing, but lval and lloc
10592 weren't necessary.
10593 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
10594 yylvalp and yyllocp parameters since, if pure, these are now always
10595 accessible through yystackp. If not pure, they are still accessible
10596 globally.
10597 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
10598 `if (YYID (N))' to pacify lint.
10599
a85284cf
AD
106002005-12-21 Akim Demaille <akim@epita.fr>
10601
10602 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
10603 destroy the RHS symbols of a rule.
10604 * data/yacc.c (yylen): Initialize to 0.
10605 Keep its value to the number of items to possibly shift.
10606 In particular, a regular successful parse that ends on YYFINAL by
10607 a (internal) YYACCEPT must not have yylen != 0.
10608 (yyerrorlab, yyreturn): Pop the RHS.
10609 Reorder a bit to emphasize the `shifting' bits of code.
10610 (YYPOPSTACK): Now accept a number of items to pop.
10611 * data/lalr1.cc: Likewise.
10612 * data/glr.c: Formatting changes.
10613 Use goto instead of fall through.
10614 * doc/bison.texinfo (Destructor Decl): Complete.
10615
d508c281
JMG
106162005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10617
10618 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10619 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
10620 * djgpp/config.bat: Replace every occurence of the file name
10621 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10622 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10623 * djgpp/config.sed: Replace every occurence of the file name
10624 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10625 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10626 * djgpp/djunpack.bat: DJGPP specific file.
10627 * djgpp/fnchange.lst: DJGPP specific file.
10628 * djgpp/README.in: Add new information about how to unpack the bison
10629 source on MSDOS and other systems which have 8.3 file name restrictions
10630 using djunpack.bat and fnchange.lst.
10631
3e7a2cd9
PE
106322005-12-12 Paul Eggert <eggert@cs.ucla.edu>
10633
10634 * bootstrap (build_cvs_prefix): Remove; unused.
10635 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
10636 when getting gnulib.
10637
106382005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
10639
10640 * data/glr.c: Reorder typedef declarations for structs to match order
10641 of struct declarations.
10642 Rename yystack everywhere to yystackp except in yyparse where it's not
10643 a pointer.
10644 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
10645 consistency.
10646 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
10647 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
10648 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
10649 lint.
10650
877519f8
PE
106512005-12-09 Paul Eggert <eggert@cs.ucla.edu>
10652
0eca5a39
PE
10653 * tests/sets.at (Accept): Fix typos in regular expression used to
10654 sed out the final state number.
10655
2cec9080
PE
10656 Work around portability problem on Solaris 10: flex-generated
10657 files include <stdio.h> before <config.h>, which messes up
10658 because the latter defines __EXTENSIONS__. Address the problem
10659 by creating two new little files that include <config.h> first,
10660 then include the flex-generated files. Rewrite everyone else
10661 to include <config.h> first, as well.
10662 * lib/timevar.c: Always include "config.h".
10663 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
10664 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
10665 (EXTRA_bison_SOURCES): New macro.
10666 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
10667 * src/system.h: Don't include config.h.
10668 * src/LR0.c: Include <config.h> first.
10669 * src/assoc.c: Likewise.
10670 * src/closure.c: Likewise.
10671 * src/complain.c: Likewise.
10672 * src/conflicts.c: Likewise.
10673 * src/derives.c: Likewise.
10674 * src/files.c: Likewise.
10675 * src/getargs.c: Likewise.
10676 * src/gram.c: Likewise.
10677 * src/lalr.c: Likewise.
10678 * src/location.c: Likewise.
10679 * src/main.c: Likewise.
10680 * src/muscle_tab.c: Likewise.
10681 * src/nullable.c: Likewise.
10682 * src/output.c: Likewise.
10683 * src/parse-gram.y: Likewise.
10684 * src/print.c: Likewise.
10685 * src/print_graph.c: Likewise.
10686 * src/reader.c: Likewise.
10687 * src/reduce.c: Likewise.
10688 * src/relation.c: Likewise.
10689 * src/state.c: Likewise.
10690 * src/symlist.c: Likewise.
10691 * src/symtab.c: Likewise.
10692 * src/tables.c: Likewise.
10693 * src/uniqstr.c: Likewise.
10694 * src/vcg.c: Likewise.
10695
877519f8
PE
10696 * src/parse-gram.y: Fix minor problems uncovered by lint.
10697 (current_lhs, current_lhs_location): Now static.
10698 (current_assoc): Remove unused variable.
10699
10700 Cleanups so that Bison-generated parsers have less lint.
10701 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
10702 Prepend /*ARGSUSED*/, for lint's sake.
10703 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
10704 definition if 'lint' is defined.
10705 (YYID): New macro (or function, if lint).
10706 All uses of /*CONSTCOND*/0 replaced by YYID(0).
10707 * data/yacc.c: Likewise.
10708 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
10709 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
10710 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
10711 is C++ only.
10712 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
10713 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
10714 Use YYID(0) rather than 0, for lint.
10715 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
10716 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
10717
f5228370
PE
107182005-12-07 Paul Eggert <eggert@cs.ucla.edu>
10719
10720 * tests/glr-regression.at
10721 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10722 Close memory leak reported by twlevo.
10723
69ce078b
PE
107242005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
10725
6ff99711
PE
10726 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
10727 all stacks.
10728 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
10729 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10730 New test case.
10731 (Duplicated user destructor for lookahead): This test now is expected
10732 to succeed.
10733
af3412cd
PE
107342005-12-01 Paul Eggert <eggert@cs.ucla.edu>
10735
32b5b719 10736 * NEWS: Document the following change.
af3412cd
PE
10737 * data/yacc.c: Say "parser skeleton" rather than "file", since
10738 it's no longer just a file.
10739 * data/glr.c: Grant a special exception for C GLR parsers, that
10740 reads like the already-existing exception for C LALR(1) parsers.
10741 * data/glr.cc: Likewise.
10742 * data/lalr1.cc: Likewise.
10743 * data/location.cc: Likewise.
10744 * data/yacc.c: Reword the "written by" statement to clarify that
10745 it was the parser skeleton, not the entire output file.
10746 * data/glr.c: Written by Paul Hilfinger.
10747 * data/glr.cc: Written by Akim Demaille.
10748 * data/lalr1.cc: Likewise.
10749
035aa4a0
PE
107502005-11-18 Paul Eggert <eggert@cs.ucla.edu>
10751
d9963c85
PE
10752 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
10753 Fix typos in previous change that broke 'make check'.
10754 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
10755 supported in C.
10756 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
10757 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
10758 We can revert this once things settle down.
10759
035aa4a0
PE
10760 * src/conflicts.c (conflicts_print): Don't print file name twice
10761 when %expect fails because there were no conflicts.
10762 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
10763 change.
10764 * tests/conflicts.at (%expect not enough, %expect too much):
10765 (%expect with reduce conflicts): Adjust to new behavior.
10766
107672005-11-18 Akim Demaille <akim@epita.fr>
10768
10769 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
10770 errors.
10771 * NEWS: Document this.
10772 * doc/bison.texinfo (Expect Decl): Likewise.
10773
d1ff7a7c
AD
107742005-11-16 Akim Demaille <akim@epita.fr>
10775
10776 Generalize the display of semantic values and locations in traces.
10777 * data/glr.c (yy_reduce_print): Fix indices (again).
10778 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
10779 literal integers.
10780 * data/lalr1.cc (yyreduce_print): Rename as...
10781 (yy_reduce_print): this.
10782 Display values and locations.
10783 * data/yacc.c (yy_reduce_print): Likewise.
10784 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
10785 (yysymprint): Move higher to be visible from yy_reduce_print).
10786 (yyparse): Adjust.
10787 * tests/calc.at: Adjust the expected length of the traces.
10788
6de5398d
AD
107892005-11-14 Akim Demaille <akim@epita.fr>
10790
10791 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
10792 from 1 to N, while values and location start at 0.
10793 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
10794
a1373f55
AD
107952005-11-14 Akim Demaille <akim@epita.fr>
10796
10797 * data/glr.c (yy_reduce_print): Fix the $ number.
10798
613d8952
AD
107992005-11-14 Akim Demaille <akim@epita.fr>
10800
10801 "Use" parse parameters.
10802 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
10803 * data/glr.c, data/glr.cc: Use them.
10804 * data/glr.c (YYUSE): Have a C++ definition that supports
10805 non-pointer types.
10806
b2741627
AD
108072005-11-14 Akim Demaille <akim@epita.fr>
10808
10809 * data/glr.c (yyexpandGLRStack): Declare only if defined.
10810
5059b5c8
AD
108112005-11-14 Akim Demaille <akim@epita.fr>
10812
42249483
AD
10813 * data/glr.cc: New.
10814 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 10815
4626a15d
AD
108162005-11-12 Akim Demaille <akim@epita.fr>
10817
10818 Let position and location be PODs.
10819 * data/location.cc (position::initialize, location::initialize): New.
10820 (position::position, location::location): Define only if
10821 b4_location_constructors is defined.
10822 * data/lalr1.cc (b4_location_constructors): Define it for backward
10823 compatibility.
10824 * doc/bison.texinfo (Initial Action Decl): Use initialize.
10825
108262005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
10827
10828 * data/lalr1.cc: Move the body of the ctor and dtor into the
10829 parser file (instead of the header).
10830 Wrap the implementations in a "namespace yy".
10831
108322005-11-12 Akim Demaille <akim@epita.fr>
10833
10834 Have glr.c include its header file when created.
10835 * data/glr.c (b4_shared_declarations): New.
10836 Output them verbatim in the parser if !%defines, otherwise
10837 output then in the header file, and include it instead.
10838
1989d947
AD
108392005-11-11 Akim Demaille <akim@epita.fr>
10840
10841 * data/glr.c: Comment changes.
10842
108432005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
10844
10845 When yydebug, report semantic and location values for reductions.
10846 * data/glr.c (yy_reduce_print): Report the semantic values and the
10847 locations.
10848 (YY_REDUCE_PRINT): Adjust.
10849 (yyglrReduce): Use them.
10850 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
10851 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
10852 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
10853 traces.
10854
02998094
AD
108552005-11-10 Akim Demaille <akim@epita.fr>
10856
10857 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
10858 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
10859 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
10860
5210672f
PE
108612005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
10862
10863 * m4/cxx.m4, examples/Makefile.am: Don't build
10864 examples/calc++ if no C++ compiler is available. (trivial change)
10865
a8991a1d
AD
108662005-11-09 Akim Demaille <akim@epita.fr>
10867
10868 * src/scan-skel.l: Use a couple of asserts.
10869
36b5e963
AD
108702005-11-03 Akim Demaille <akim@epita.fr>
10871
10872 In some (weird) cases, the final state number is incorrect.
10873 Reported by Alexandre Duret-Lutz.
10874 * src/LR0.c (state_list_append): Remove the computation of
10875 final_state.
10876 (save_reductions): Do it here.
10877 (get_state): Alpha conversion.
10878 (generate_states): Use a for loop.
10879 * src/gram.h (item_number_is_rule_number)
10880 (item_number_is_symbol_number): New.
10881 * src/state.c: Use assert.
10882 * src/system.h: Include assert.h.
10883 * tests/sets.at (Accept): New.
10884
44e7ead1
PH
108852005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10886
10887 * data/glr.c (yyfill): Adjust comment.
36b5e963 10888 (yyresolveAction): Initialize default location properly
44e7ead1
PH
10889 for empty right-hand sides.
10890 (yydoAction): Ditto.
10891 Add comment explaining apparently dead code.
36b5e963
AD
10892 * tests/glr-regression.at
10893 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 10894 New test.
36b5e963 10895
e10a80ee
PE
108962005-10-30 Paul Eggert <eggert@cs.ucla.edu>
10897
10898 * bootstrap (cleanup_gnulib): New function. Use it to clean up
10899 gnulib when interrupted. This fixes some race conditions and
10900 works around some portability problems (one noted by Paul
10901 Hilfinger).
10902
067b32ee
AD
109032005-10-22 Akim <akim@epita.fr>
10904
10905 * Makefile.cfg: Adjust to config -> build-aux.
10906 Reported by twledo.
10907
4b367315
AD
109082005-10-21 Akim Demaille <akim@epita.fr>
10909
10910 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
10911 the %parse-params.
10912 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
10913 * data/yacc.c (b4_Pure_if): Rename as...
10914 (b4_yacc_pure_if): this.
10915 (YY_SYMBOL_PRINT, yyparse): Adjust.
10916 * doc/bison.texinfo: Formatting changes.
10917
24cc23d9
AD
109182005-10-21 Akim Demaille <akim@epita.fr>
10919
10920 Finish the transition config -> build-aux.
10921 * configure.ac, Makefile.am: Use build-aux.
10922 * config/prev-version, config/announce-gen, config/Makefile.am:
10923 Move to...
10924 * build-aux/prev-version, build-aux/announce-gen,
10925 * build-aux/Makefile.am: here.
10926
d4476375
AD
109272005-10-14 Akim Demaille <akim@epita.fr>
10928
10929 * examples/calc++/test: Use set -x only when VERBOSE.
10930
302c0aee
PE
109312005-10-13 Paul Eggert <eggert@cs.ucla.edu>
10932
10933 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
10934 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
10935
7625ec2c
AD
109362005-10-13 Akim Demaille <akim@epita.fr>
10937
10938 * src/scan-skel.l: Output the base name parts of the parser and
10939 header file names.
302c0aee 10940 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
10941 additional checks.
10942 Use this to exercise C++ outputs in subdirs.
10943 Reported by Oleg Smolsky.
10944
ba0fe3c7
PE
109452005-10-12 Paul Eggert <eggert@cs.ucla.edu>
10946
10947 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
10948 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
10949 Problem reported by John P. Hartmann.
10950 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
10951 already defined it.
10952
9b8a5ce0
AD
109532005-10-12 Akim Demaille <akim@epita.fr>
10954
10955 * src/parse-gram.y (version_check): Exit 63 to please missing
10956 (stands for "version mismatch).
10957 * tests/input.at, doc/bison.texinfo: Adjust.
10958
4f6e011e
PE
109592005-10-10 Paul Eggert <eggert@cs.ucla.edu>
10960
10961 Work around portability problems with Visual Age C compiler
10962 (xlc and xlC_r) reported by John P. Hartmann.
10963 * data/location.cc (initial_column, initial_line): Remove.
10964 All uses replaced by 0 and 1.
10965 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
10966 that xlc complains about.
10967 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 10968 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 10969 as __STDC__.
4d7aa45e
PE
10970 * data/yacc.c (YYMODERN_C): New macro, which also looks at
10971 __STDC_VERSION__. Use it everywhere instead of looking at
10972 __STDC__ and __cplusplus.
4f6e011e 10973
a1b3bf8c
AD
109742005-10-10 Akim Demaille <akim@epita.fr>
10975
10976 * examples/calc++/test: Be quiet unless VERBOSE.
10977
412e44aa
PE
109782005-10-05 Paul Eggert <eggert@cs.ucla.edu>
10979
2a4647a3
PE
10980 * data/c.m4 (yydestruct, yysymprint):
10981 Use YYUSE instead of casting to void.
10982 * data/glr.c (YYUSE): New macro.
10983 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10984 Use it instead of rolling our own.
10985 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10986 (YYCHK1):
10987 Use /*CONSTCOND*/ to suppress lint warnings.
10988 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10989 (YY_STACK_PRINT): Use 'false' not '0'.
10990 (YYUSE): New macro.
10991 (yysymprint_, yydestruct_): Use it instead of rolling our own.
10992 * data/yacc.c (YYUSE): New macro.
10993 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
10994 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
10995 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
10996
10997
412e44aa
PE
10998 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
10999 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
11000
88c6637f
PE
110012005-10-04 Paul Eggert <eggert@cs.ucla.edu>
11002
2f4f028d
PE
11003 Undo the parts of the unlocked-I/O change that substituted
11004 putc or puts for printf. This might hurt performance a bit,
11005 but some people prefer the printf style.
11006 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
11007 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
11008 All uses replaced by YYFPRINTF and YYDPRINTF.
11009 * data/yacc.c: Likewise.
11010 * lib/bitset.c (bitset_print): Likewise.
11011 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
11012 putc and puts.
11013 * lib/lbitset.c (debug_lbitset): Likewise.
11014 * src/closure.c (print_firsts, print_fderives): Likewise.
11015 * src/gram.c (grammar_dump): Likewise.
11016 * src/lalr.c (look_ahead_tokens_print): Likewise.
11017 * src/output.c (escaped_output): Likewise.
11018 (user_actions_output): Break apart two printfs.
11019 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
11020 * src/reduce.c (reduce_print): Likewise.
11021 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
11022 * src/system.h: Include unlocked-io.h rathe than stdio.h.
11023
88c6637f
PE
11024 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11025 Use assignments rather than casts-to-void to suppress
11026 unused-variable warnings. This pacifies 'lint'.
11027 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
11028 unused-variable warnings.
11029
fb32e373
JMG
110302005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11031
11032 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11033
edb8f44f
PE
110342005-10-02 Paul Eggert <eggert@cs.ucla.edu>
11035
fb9c0b33
PE
11036 Use unlocked I/O for a minor performance improvement on hosts like
11037 GNU/Linux and Solaris that support unlocked I/O. The basic idea
11038 is to use the gnlib unlocked-io module, and to prefer putc and
11039 puts to printf when either will work (since the latter doesn't
11040 come in an unlocked flavor).
11041 * bootstrap (gnulib_modules): Add unlocked-io.
11042 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
11043 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
11044 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
11045 and similarly for puts and putc and printf.
11046 * data/yacc.c: Likewise.
11047 * lib/bitset.c (bitset_print): Likewise.
11048 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
11049 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
11050 to printf.
11051 * lib/lbitset.c (debug_lbitset): Likewise.
11052 * src/closure.c (print_firsts, print_fderives): Likewise.
11053 * src/gram.c (grammar_dump): Likewise.
11054 * src/lalr.c (look_ahead_tokens_print): Likewise.
11055 * src/output.c (escaped_output): Likewise.
11056 (user_actions_output): Coalesce two printfs.
2f4f028d 11057 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
11058 * src/reduce.c (reduce_print): Likewise.
11059 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 11060 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 11061
edb8f44f
PE
11062 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
11063 this confuses xgettext.
11064
b50d2359
AD
110652005-10-02 Akim Demaille <akim@epita.fr>
11066
11067 * bootstrap (gnulib_modules): Add strverscmp.
11068 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
11069 * m4/.cvsignore: Add strverscmp.m4.
11070 * src/parse-gram.y (%require): New token, new rule.
11071 (version_check): New.
11072 * src/scan-gram.l (%require): Adjust.
11073 * tests/input.at (AT_REQUIRE): New.
11074 Use it.
11075 * doc/bison.texinfo (Require Decl): New.
11076 (Calc++ Parser): Use %require.
11077
21667f64
AD
110782005-10-02 Akim Demaille <akim@epita.fr>
11079
11080 * data/location.cc: New.
11081
2b81e969
AD
110822005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
11083 Akim Demaille <akim@epita.fr>
11084
11085 Make sure -odir/foo.cc creates dir/location.hh etc.
11086 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
11087 (spec_file_prefix, spec_verbose_file, spec_graph_file)
11088 (spec_defines_file): Now const.
11089 (dir_prefix): New.
11090 (short_base_name): Remove.
11091 * src/files.c: Adjust.
11092 (dirname.h): Include.
11093 (base_name): Don't prototype it.
11094 (finput): Remove, duplicates gram_in.
11095 (full_base_name, short_base_name): Replace by...
11096 (all_but_ext, all_but_tab_ext): these.
11097 (compute_base_names): Rename as...
11098 (compute_file_name_parts): this.
11099 Update to compute the new variables, including dir_prefix.
11100 Adjust dependencies.
11101 * src/output.c (prepare): Output them.
11102 * src/reader.c: Adjust to use gram_in, not finput.
11103 * src/scan-skel.l (@dir_prefix@): New.
11104
ad6a9b97
JMG
111052005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11106
11107 * lib/subpipe.c: New function end_of_output_subpipe() added
11108 to allow support for non-posix systems. This is a no-op function
11109 for posix systems.
11110
11111 * lib/subpipe.h: New function end_of_output_subpipe() added
11112 to allow support for non-posix systems. This is a no-op function
11113 for posix systems.
11114
11115 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
11116 handle the lack of pipe/fork functionality on non-posix systems.
11117
11118 * djgpp/Makefile.maint: DJGPP specific file.
11119
11120 * djgpp/README.in: DJGPP specific file.
11121
11122 * djgpp/config.bat: DJGPP specific configuration file.
11123
11124 * djgpp/config.sed: DJGPP specific configuration file.
11125
11126 * djgpp/config.site: DJGPP specific configuration file.
11127
11128 * djgpp/config_h.sed: DJGPP specific configuration file.
11129
11130 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
11131
11132 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
11133
fc695704
AD
111342005-10-02 Akim Demaille <akim@epita.fr>
11135
11136 * data/location.cc: New, extract from...
11137 * data/lalr1.cc: here.
11138 (location.hh): Include it after the user prologue, in case the
11139 filename type is defined by the user.
11140 Forward declation location and position before the pre-prologue.
11141 (yyresult_): Rename as...
11142 (yyresult): this, it's a local variable, not an attribute.
11143 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
11144
111452005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
11146
11147 * examples/extexi: Restore the #line generation.
11148
fb9712a9
AD
111492005-09-30 Akim Demaille <akim@epita.fr>,
11150 Alexandre Duret-Lutz <adl@gnu.org>
11151
11152 Move the token type and YYSTYPE in the parser class.
11153 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
11154 (parser::token): New, from the moved free definition of tokens.
11155 (parser::semantic_value): Now a full definition instead of an
11156 indirection to YYSTYPE.
11157 (b4_post_prologue): No longer included in the header file, but
11158 in the implementation file.
11159 * doc/bison.texi (C+ Language Interface): Update.
11160 * src/parse-gram.y: Support unary %define.
11161 * tests/actions.at: Define global_tokens_and_yystype for backward
11162 compatibility until we update the tests.
11163 * tests/calc.at: Idem.
11164 (first_line, first_column, last_line, last_column): Define for lalr1.cc
11165 to simplify the code.
11166
55f0c7b1
PE
111672005-09-29 Paul Eggert <eggert@cs.ucla.edu>
11168
11169 Port to SunOS 4.1.4, which lacks strtoul and strerror.
11170 Ah, the good old days! Problem reported by Peter Klein.
11171 * bootstrap (gnulib_modules): Add strerror, strtoul.
11172 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
11173 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
11174
fb9712a9 111752005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
11176
11177 * data/c.m4 (b4_error_verbose_if): New.
11178 * data/lalr1.cc: Use it.
11179 (YYERROR_VERBOSE_IF): Remove.
11180 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
11181 parser members, replaced by...
11182 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
11183 local variables.
11184 (yysyntax_error_): Takes the state number as argument.
11185 (yyreduce_print_): Use the argument yyrule, not the former
11186 attribute yyn_.
11187
8a6f72f3
PE
111882005-09-26 Paul Eggert <eggert@cs.ucla.edu>
11189
11190 * bootstrap (gnulib_modules): Add verify.
11191 * lib/.cvsignore: Add verify.h.
11192 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
11193 * src/system.h (verify): Remove.
11194 Include verify.h instead.
11195 * src/tables.c (tables_generate): Use new API for 'verify'.
11196
0d50976f
PE
111972005-09-21 Paul Eggert <eggert@cs.ucla.edu>
11198
ebc3737e
PE
11199 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
11200 local variables whose names begin with 'yy'.
11201 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11202 Trivial changes from Joel E. Denny.
11203
0d50976f
PE
11204 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
11205 it itself.
11206 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
11207 don't use alloca any more.
11208
11209 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
11210 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 11211 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
11212 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
11213 to match yacc.c, to test more hosts.
11214
a05b79df
PE
112152005-09-20 Paul Eggert <eggert@cs.ucla.edu>
11216
55289366
PE
11217 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
11218 doesn't affect behavior.
11219 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
11220 Solaris, AIX, MSC.
11221 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
11222 This works a bit better with glibc, if user code has already included
11223 stdlib.h.
11224 * doc/bison.texinfo (Bison Parser): Document that users can't
11225 arbitrarily use malloc and free for other purposes. Document
11226 that <alloca.h> and <malloc.h> might be included.
11227 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
11228 user must declare alloca.
11229
a05b79df
PE
11230 * HACKING (release): Forwarn the Translation Project about
11231 stable releses.
11232
3ab2ca22
AD
112332005-09-20 Akim Demaille <akim@epita.fr>
11234
11235 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
11236
a9739e7c
PE
112372005-09-19 Paul Eggert <eggert@cs.ucla.edu>
11238
a702593e
PE
11239 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
11240 (YYSTACK_ALLOC_MAXIMUM): Use it.
11241 (yysyntax_error): New function.
11242 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
11243 multiple syntax errors are reported, and alloca is being used.
11244 Instead, reallocate buffers twice as big each time, so that
11245 we waste at most half the allocated memory. Start with a small
11246 (128-byte) buffer that will suffice in most cases anyway.
11247 Use yysyntax_error to do most of the work.
11248
11249 * doc/bison.texinfo (Error Reporting, Table of Symbols):
11250 yynerrs is the number of errors reported, not the number of
11251 errors encountered.
11252
a9739e7c
PE
11253 * tests/glr-regression.at (Duplicated user destructor for lookahead):
11254 Mark it as expected to fail.
11255 Cast result of malloc; problem reported by twlevo@xs4all.nl.
11256 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
11257 Don't start user-code symbols with "yy", to avoid name space problems.
11258
f479c6c6
AD
112592005-09-19 Akim Demaille <akim@epita.fr>
11260
11261 Remove the traits, failed experiment.
11262 It never proved useful, and anyway because of the current
11263 definition, it was not possible to have several specialization of
11264 this traits, making it useless.
11265 * data/lalr1.cc (yy:traits): Remove.
11266 Inline its definitions in the parser class.
11267
e2586f82
AD
112682005-09-19 Akim Demaille <akim@epita.fr>
11269
11270 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
11271 least Mac OSX with a /usr/local install of gettext.
11272
2e8cf949
AD
112732005-09-19 Akim Demaille <akim@epita.fr>
11274
11275 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
11276 and yytoken for similarity with the other skeletons.
11277
c7fb0b90
AD
112782005-09-19 Akim Demaille <akim@epita.fr>
11279
4e26c69e 11280 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 11281
1bd0deda
PE
112822005-09-16 Paul Eggert <eggert@cs.ucla.edu>
11283
11284 * NEWS: Version 2.1.
11285
11286 * NEWS: Remove notice of yytname change, since it was never in an
11287 official release.
11288 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
11289 diagnostic.
11290 * src/output.c (prepare): Likewise.
11291 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
11292 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
11293 is not defined. This is an awful hack, but it's enough for now.
11294 All callers changed.
11295 * tests/glr-regression-at (make_value): Args are const pointers now,
11296 to avoid GCC warning.
11297 (Duplicated user destructor for lookahead): New test. Currently
11298 skipped. It fails on my host but I'm not sure it'll always fail.
11299
113002005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
11301
11302 * src/symtab.h (struct symbol): Declare the printer and destructor
11303 as const, to avoid accidental calls to free.
11304 (symbol_destructor_set, symbol_printer_set): Adjust.
11305 * src/symtab.c: Adjust.
11306
1bd0deda 113072005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
11308
11309 * data/c.m4 (b4_token_enums): New.
11310 (b4_token_defines): Rename as...
11311 (b4_token_enums_defines): this.
11312 (b4_token_defines): New, output only the #defines.
11313 * data/yacc.c, data/glr.c: Adjust.
11314 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
11315 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
11316 as default values.
11317
dbcdae2d
AD
113182005-09-16 Akim Demaille <akim@epita.fr>
11319
11320 * data/lalr1.cc (yylex_): Remove, inline its code.
11321 (yyreport_syntax_error_): Remove, replaced by...
11322 (yysyntax_error_): this which returns a string and leaves to the
11323 caller the call to the users' error function.
11324 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
11325 Move from members of the parser object...
11326 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
11327 to local variables of the parse function.
11328
70d8f291
AD
113292005-09-16 Akim Demaille <akim@epita.fr>
11330
11331 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
11332 since it's in Bison's name space.
11333
b47dbebe
PE
113342005-09-15 Paul Eggert <eggert@cs.ucla.edu>
11335
ae199bf1
PE
11336 * data/glr.c (yyresolveValue): Add default case to pacify
11337 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
11338
b47dbebe
PE
11339 * NEWS: Document when yyparse started to return 2.
11340 * doc/bison.texinfo (Parser Function): Document when yyparse
11341 returns 2.
11342
11343 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
11344 (b4_filename_type): Renamed back from b4_file_name_type. All uses
11345 changed.
11346 (class position): file_name -> filename (reverting). All uses changed.
11347
113482005-09-14 Paul Eggert <eggert@cs.ucla.edu>
11349
11350 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
11351 do anything if $@ exists. This reverts part of the 2005-07-07
11352 patch.
11353
00292f66
PE
113542005-09-11 Paul Eggert <eggert@cs.ucla.edu>
11355
11356 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
11357 contains obsolete information and isn't worth distributing as a
11358 separate file anyway.
11359 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
11360 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
11361 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
11362 (yyparse): Abort if user code uses longjmp to throw an unexpected
11363 value.
11364
a420f962
PE
113652005-09-09 Paul Eggert <eggert@cs.ucla.edu>
11366
00292f66
PE
11367 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
11368 Suggested by twlevo@xs4all.nl.
11369
127287e9
PE
11370 * data/glr.c (YYCHK1): Do not assume YYE is in range.
11371 This avoids a diagnostic from gcc -Wswitch-enum.
11372 Problem reported by twlevo@xs4all.nl.
11373
a420f962
PE
11374 * doc/bison.texinfo: Don't use "filename", as per GNU coding
11375 standards. Use "file name" or "file" or "name", depending on
11376 the context.
11377 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
11378 not to hack/foo.tab.c.
11379 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
11380 * data/glr.c: b4_filename -> b4_file_name.
11381 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
11382 All uses changed.
11383 (class position): filename -> file_name. All uses changed.
11384 * data/yacc.c: b4_filename -> b4_file_name.
11385 * lib/bitset.h: filename -> file_name in local vars.
11386 * lib/bitset_stats.c: Likewise.
11387 * src/files.c: Likewise.
11388 * src/scan-skel.l ("@output ".*\n): Likewise.
11389 * src/files.c (file_name_split): Renamed from filename_split.
11390 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
11391
113922005-09-08 Paul Eggert <eggert@cs.ucla.edu>
11393
11394 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
11395 to accommodate latest gnulib.
11396
11397 * tests/glr-regression.at (Duplicate representation of merged trees):
11398 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
11399
11400 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
11401 needed.
11402
42a6501d
PE
114032005-08-26 Paul Eggert <eggert@cs.ucla.edu>
11404
11405 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
11406 All uses changed. Invoke user destructor after an error during a
11407 split parse (trivial change from Joel E. Denny).
11408
11409 * tests/glr-regression.at
11410 (User destructor after an error during a split parse): New test case.
11411 Problem reported by Joel E. Denny in:
11412 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
11413
ef9a1faf
PE
114142005-08-25 Paul Eggert <eggert@cs.ucla.edu>
11415
5b4aaf78
PE
11416 * README-cvs: Give URLs for recommended tools.
11417 Mention Gzip version problem, and bootstrapping issues.
11418 Remove troubleshooting section, as it's somewhat obsolete.
11419
b5240ba5
PE
11420 * bootstrap (no_cache): New var, to accommodate different wget
11421 variants. Use it instead of '-C off'. Problem reported by
11422 twlevo@xs4all.nl.
11423
ef9a1faf
PE
11424 * data/glr.c (yydestroyStackItem): New function.
11425 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
11426 debugging information. Problem reported by Joel E. Denny.
11427
e6efa9da
AD
114282005-08-25 Akim Demaille <akim@epita.fr>
11429
11430 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
11431
adc90f13
PE
114322005-08-24 Paul Eggert <eggert@cs.ucla.edu>
11433
11434 * data/glr.c (yyrecoverSyntaxError, yyreturn):
11435 Don't invoke destructor on unresolved entries.
11436 * tests/glr-regression.at
11437 (User destructor for unresolved GLR semantic value): New test case.
11438 Problem reported by Joel E. Denny in:
11439 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
11440
f9315de5
PE
114412005-08-21 Paul Eggert <eggert@cs.ucla.edu>
11442
15d29c1f
PE
11443 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
11444 Add strnlen.c.
11445 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
11446 lib-prefix.m4, po.m4.
11447
dd5f2af2
PE
11448 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
11449 in yydestruct diagnostic, since it might not be an error.
11450 Problem reported by Joel Denny near end of
11451 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 11452 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
11453 * data/yacc.c (yyreturn): Likewise.
11454 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
11455
11456 * src/files.c: Remove obsolete FIXME comment.
11457
11458 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
11459 with the other templates, and to fix bogus run-on messages such
11460 as the one reported at the end of
11461 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11462 All callers changed to avoid the newline.
11463 (yyprocessOneStack): Output two lines rather than one, to accommodate
11464 the above change. This changes the debug output format slightly.
11465
f9315de5
PE
11466 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
11467 reported by Joel E. Denny in
11468 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
11469 (trivial change).
11470 * tests/glr-regression.at (Duplicate representation of merged trees):
11471 New test, from Joel E. Denny in:
11472 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
11473 * THANKS: Add Joel E. Denny.
11474
11475 * configure.ac (AC_INIT): Bump to 2.0c.
11476
04098407
PE
114772005-07-24 Paul Eggert <eggert@cs.ucla.edu>
11478
11479 * NEWS: Version 2.0b.
11480
ca5d2013
PE
11481 * Makefile.am (SUBDIRS): Put examples before tests, so that
11482 "make check" doesn't finish with "All 1 tests passed".
11483
3d54b576
PE
11484 * tests/regression.at (Token definitions): Don't rely on
11485 AT_PARSER_CHECK for data that contains backslashes. It currently
11486 uses 'echo', and 'echo' isn't portable if its argument contains
11487 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
11488 that the byte '\0xff' is not printable in the C locale; it is,
11489 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
11490 not printable, so use '\0x81' to test.
11491
d53ae497
PE
11492 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
11493 version of GCC, since the macro is used with non-GCC compilers.
11494
fc01665e
PE
11495 Fix core dump reported by Pablo De Napoli in
11496 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
11497 * tests/regression.at (Invalid inputs with {}): New test.
11498 * src/parse-gram.y (token_name): Translate type before using
11499 it as an index.
11500
04098407
PE
11501 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
11502 the user's name space. All uses changed to __attribute__
11503 ((__unused__)).
11504 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
11505 Add __attribute__ ((__noreturn__)).
11506
11507 * etc/clcommit: Remove. We weren't using it, and it failed
11508 "make maintainer-distcheck".
11509 * Makefile.maint: Merge from coreutils.
11510 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
11511 (syntax-check-rules): Change list of rules as described below.
11512 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
11513 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
11514 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
11515 (sc_trailing_space): New rules.
11516 (sc_xalloc_h_in_src): Remove.
11517 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
11518 (sc_space_tab, sc_error_exit_success, sc_changelog):
11519 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
11520 (makefile-check, po-check, author_mark_check):
11521 (makefile_path_separator_check, copyright-check):
11522 Use grep -n, to make it easier to find violations.
11523 Use CVS_LIST and CVS_LIST_EXCEPT.
11524 (header_regexp, h_re): Remove.
11525 (dd_c): New macro.
11526 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
11527 (my-distcheck): Use more-modern GCC flags.
11528 (signatures, %.asc): Remove.
11529 (rel-files, announcement): Remove signatures.
11530 Restore old updating code, even though we don't use it, so
11531 that we're the same as coreutils.
11532 (alpha, beta, major): Depend on news-date-check.
11533 Make the upload commands.
11534
11535 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
11536 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
11537 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
11538 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
11539 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
11540 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
11541 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
11542 * tests/sets.at: Likewise.
11543
11544 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
11545 we comment out the Autoconf version number.
11546 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
11547 it's error-prone and "make maintainer-distcheck" rejects it.
11548
11549 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
11550 Indent calls to "error" to pacify "make maintainer-distcheck",
11551 when the calls are not intended to be translated.
11552 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
11553
11554 * src/Makefile.am (DEFS): Use +=, to pacify
11555 "make maintainer-distcheck".
11556 (bison_SOURCES): Add scan-skel.h.
11557 (sc_tight_scope): New rule, from coreutils.
11558
11559 * src/files.c (src_extension, header_extension):
11560 Now static, not extern.
11561 * src/getargs.c (short_options): Likewise.
11562 * src/muscle_tab.c (muscle_table): Likewise.
11563 * src/parse-gram.y (current_class, current_type, current_prec):
11564 Likewise.
11565 * src/reader.c (grammar_end, previous_rule_end): Likewise.
11566 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
11567 * src/main.c (main): Cast bindtextdomain and textdomain calls to
11568 void, to avoid warning when NLS is disabled.
11569 * src/output.c: Include scan-skel.h.
11570 (scan_skel): Remove decl, since scan-skel.h does this.
11571 (output_skeleton):
11572 Indent calls to "error" to pacify "make maintainer-distcheck".
11573 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
11574 * src/reader.h (gram_end, gram_lineno): New decls to pacify
11575 "make maintainer-distcheck".
11576 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
11577 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
11578 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
11579 (skel_lex_destroy, scan_skel): Move these decls to...
11580 * src/scan-skel.h: New file.
11581 * src/uniqstr.c (uniqstr_assert):
11582 Indent calls to "error" to pacify "make maintainer-distcheck".
11583
11584 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
11585 not @VAR@.
11586
11587 * tests/torture.at: Revamp to avoid misuse of atoi that
11588 "make maintainer-distcheck" complained about.
11589
11590 * examples/extexi (message): Don't print a message more than once,
11591 and omit line-number decoration that makes Emacs compile think
11592 that informative messages are worth worrying about.
11593
115942005-07-22 Paul Eggert <eggert@cs.ucla.edu>
11595
11596 * configure.ac: Update version number.
11597
11598 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
11599 accidentally.
11600 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
11601 autogenerated by the maintainer.
11602 * examples/calc++/.cvsignore: Add *.yy.
11603
11604 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
11605 * lib/bitset_stats.c (bitset_stats_init): Likewise.
11606 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11607
11608 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
11609
11610 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
11611 from maintainer-distcheck about casting the argument of 'free'.
11612
11613 * NEWS: Mention recent yytname changes.
11614 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
11615
11616 * bootstrap: For translations that have not yet been upgraded to
11617 the new runtime-po domain, prime the pump by extracting the
11618 relevant strings from the obsolete translations. This code can be
11619 removed once the bison-runtime domain has been translated by each
11620 team.
11621
11622 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
11623 now that token names are already quoted.
11624
11625 Fix problem reported by Anthony Heading.
11626 * data/glr.c (YYTOKEN_TABLE): New macro.
11627 (yytname): Define if YYTOKEN_TABLE.
11628 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
11629 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
11630 (YYERROR_VERBOSE): Define the same way the other skeletons do.
11631 * src/output.c (prepare_symbols): Output token_table_flag.
11632
0ffda363
PE
116332005-07-21 Paul Eggert <eggert@cs.ucla.edu>
11634
11635 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
11636 again if the first call fails.
11637
11638 * data/glr.c (yytnamerr): New function.
11639 (yyreportSyntaxError): Use it to dequote most string literals.
11640 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
11641 with other skeletons. All uses changed.
11642 (yytnameerr_): New function.
11643 (yyreport_syntax_error): Use it to dequote most string literals.
11644 * data/yacc.c (yytnamerr): New function.
11645 (yyerrlab): Use it to decode most string literals.
11646 * doc/bison.texinfo (Decl Summary, Calling Convention):
11647 Clarify quoting convention of yytname.
11648 * src/output.c (prepare_symbols): Quote all names. This undoes
11649 the 2005-04-17 change, which is now accomplished (mostly) via
11650 changes in the parsers as described above.
11651 * tests/regression.at (Token definitions, Web2c Actions):
11652 Undo most 2005-04-17 change here, too.
11653
116542005-07-20 Paul Eggert <eggert@cs.ucla.edu>
11655
11656 Fix more problems reported by twlevo@xs4all.nl.
11657 * tests/cxx-type.at: Don't pipe output of ./types through sed to
11658 remove trailing spaces. This loses the exit status of ./types,
11659 and isn't needed since ./types shouldn't be emitting trailing
11660 spaces.
11661 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
11662 as the stack isn't valid in that case.
11663
11664 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
11665 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
11666 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
11667 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
11668 is used.
11669 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
11670 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
11671 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
11672 Likewise.
11673
11674 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
11675 overly-picky compilers that reject 'char *foo = "bar";'.
11676
11677 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
11678 to FILE * parameter, not to stderr. This fixes a typo introduced
11679 in the 2005-07-12 change.
11680
11681 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
11682 warnings from GCC 4.
11683
11684 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
11685 (yyglrShiftDefer, yysplitStack):
11686 Remove unused parameters b4_pure_formals. All uses changed.
11687 (yyglrShift): Remove unused parameters b4_user_formals.
11688 All uses changed.
11689 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
11690
6100a9aa
PE
116912005-07-18 Paul Eggert <eggert@cs.ucla.edu>
11692
258b75ca
PE
11693 Destructor cleanups and regularization among the three skeletons.
11694 * NEWS: Document the behavior changes.
11695 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
11696 stack before failing, as the cleanup code will do it for us now.
11697 * data/lalr1.cc (yyerrlab): Likewise.
11698 * data/glr.c (yyparse): Pop everything off the stack before
11699 freeing it, so that destructors get called properly.
11700 * data/lalr1.cc (yyreturn): Likewise.
11701 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
11702 This is more consistent.
11703 * doc/bison.texinfo (Destructor Decl): Mention more reasons
11704 why destructors might be called. 1.875 -> 2.1.
11705 (Destructor Decl, Decl Summary, Table of Symbols):
11706 Some English-language cleanups for %destructor.
11707 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11708 Add output line for destructor of start symbol.
11709 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
11710 because of that same extra output line.
11711
1a059451
PE
11712 * NEWS: Document minor wording changes in diagnostics of
11713 Bison-generated parsers.
11714 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
11715 Remove unused formals. All uses changed.
11716 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
11717 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
11718 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
11719 Rename yyoverflowab to yyexhaustedlab.
11720 When memory exhaustion occurs during syntax-error reporting,
11721 report it separately rather than in a single diagnostic; this
11722 eases translation.
11723 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
11724 (Memory Exhausted): Renamed from Parser Stack Overflow.
11725 Revamp wording slightly to prefer "memory exhaustion".
11726 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
11727
97460c78
PE
11728 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
11729
30757c8c
PE
11730 Add i18n support to the GLR skeleton. Partially fix the C++
11731 skeleton; a C++ expert needs to finish this. Remove debugging
11732 msgids; there's little point to having them translated, since they
11733 can be understood only by someone who can read the
11734 (English-language) source code.
11735
11736 Generate runtime-po/bison-runtime.pot automatically, so that we
11737 don't have to worry about garbage getting in that file. We'll
11738 make sure after the next official release that old msgids don't
11739 get lost. See
11740 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
11741
11742 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
11743 Now auto-generated.
11744 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
11745 Fix typos in explanations of the runtime file.
11746 * bootstrap: Change gettext keyword from YYI18N to YY_.
11747 Use standard Makefile.in.in in runtime-po, since we'll arrange
11748 for backward-compatible bison-runtime.po files in a different way.
11749 * data/glr.c (YY_): New macro, from yacc.c.
11750 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
11751 Translate messages intended for users.
11752 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
11753 the wording in the other skeletons. We don't know that the memory
11754 is virtual.
11755 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
11756 Use same method that yacc.c uses.
11757 Don't translate debugging messages.
11758 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
11759 it doesn't work (yet), and requires C++ expertise to fix.
11760 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
11761 Move defn to a more logical place, to be consistent with other
11762 skeletons.
11763 Don't translate debugging messages.
11764 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
11765 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
11766 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
11767 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
11768
ac8c5689
PE
11769 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
11770 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
11771 void, not int.
11772 * tests/glr-regression.at (Badly Collapsed GLR States):
11773 Likewise.
11774 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11775 yylex should return 0 at EOF rather than aborting.
11776
6100a9aa
PE
11777 Improve tests for stack overflow in GLR parser.
11778 Problem reported by twlevo@xs4all.nl.
11779 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
11780 All uses removed.
11781 (yyStackOverflow): Just longjmp, but with value 2 so that caller
11782 can handle the problem.
11783 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
11784 (yyparse): New local variable yyresult to record the result.
11785 Use result of setjmp to set it, rather than storing itinto
11786 struct.
11787 (yyDone): Remove label.
11788 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
11789 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
11790 if YYABORT is used).
11791 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
11792 yyparse status; put status > 1 into diagnostic.
11793 Check that status==2 works.
11794 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
11795 Use exit status 3 for failure to open (which shouldn't happen).
11796
15f40952
PE
117972005-07-17 Paul Eggert <eggert@cs.ucla.edu>
11798
67fd79c4
PE
11799 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
11800 1 on syntax error; just let yyparse do its thing.
11801 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
11802 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
11803 (Exploding the Stack Size with Alloca):
11804 (Exploding the Stack Size with Malloc):
11805 Expect exit status 2, not 1, since the parser is supposed to blow
11806 its stack. Problem reported by twlevo@xs4all.nl.
11807
15f40952
PE
11808 * data/glr.c (yyparse): Don't assume that the initial calls
11809 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
11810 Print a stack-overflow message and fail instead.
11811 Initialize the line-number information before creating the stack,
11812 so that the stack-overflow message can report line zero safely.
11813
f32c66b5
PE
118142005-07-14 Paul Eggert <eggert@cs.ucla.edu>
11815
a22ff96f 11816 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
11817 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
11818 (yyuserMerge): Provide a default case if b4_mergers is empty.
11819 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
11820 * tests/glr-regression.at
11821 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 11822 Add casts to pacify C++ compilers.
1beb0b24
PE
11823 * tests/glr-regression.at (Improper merging of GLR delayed action
11824 sets): Declare yylex before using it.
f32c66b5 11825 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
11826 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
11827 test for valgrind; valgrind is independent of g++.
11828 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
11829 for compatibility with POSIX 1003.1-2001 (if running coreutils).
11830 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
11831 Use a destructor, so that we can expand the stack. Change
11832 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 11833
d741bd1b
PE
118342005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11835
11836 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
11837 a valgrind failure. Problem reported by twlevo@xs4all.nl.
11838
0410a6e0
PE
118392005-07-13 Paul Eggert <eggert@cs.ucla.edu>
11840
11841 * PACKAGING: New file, suggested by Bruno Haible and taken from
11842 similar wording in gettext's PACKAGING file.
11843 * NEWS: Mention PACKAGING.
11844 * Makefile.am (EXTRA_DIST): Add PACKAGING.
11845
f7ab6a50
PE
118462005-07-12 Paul Eggert <eggert@cs.ucla.edu>
11847
baf785db 11848 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
11849 * bootstrap: Get runtime translations into runtime-po.
11850 Create runtime-po files automatically, if possible.
11851 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
11852 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
11853 does not infringe on the user's name space.
11854 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
11855 * doc/bison.texinfo (Internationalization): Revamp the English
11856 and Texinfo syntax a bit, to try to make it clearer.
11857 (Bison Options, Option Cross Key): Mention --print-localedir.
11858 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
11859 YYENABLE_NLS. Quote a bit more.
11860 * runtime-po/.cvsignore: New file.
11861 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
11862 * runtime-po/Rules-quot: Remove; now created by bootstrap.
11863 * runtime-po/quot.sed: Likewise.
11864 * runtime-po/boldquot.sed: Likewise.
11865 * runtime-po/en@quot.header: Likewise.
11866 * runtime-po/en@boldquot.header: Likewise.
11867 * runtime-po/insert-header.sin: Likewise.
11868 * runtime-po/remove-potcdate.sin: Likewise.
11869 * runtime-po/Makevars: Likewise.
11870 * runtime-po/LINGUAS: Likewise.
11871 * runtime-po/de.po: Likewise; we will rely on the translation project
11872 to maintain this, so "bootstrap" should get it.
0410a6e0 11873 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
11874 its value.
11875 * src/main.c (main): Bind the bison-runtime domain, too.
11876
118772005-07-12 Bruno Haible <bruno@clisp.org>
11878
11879 * data/yacc.c: Include <libintl.h> when NLS is enabled.
11880 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
11881 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
11882 * runtime-po: New directory.
11883 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
11884 $(DOMAIN).pot-update rule, so that old messages are never dropped.
11885 * runtime-po/Rules-quot: New file, copied from po/.
11886 * runtime-po/quot.sed: Likewise.
11887 * runtime-po/boldquot.sed: Likewise.
11888 * runtime-po/en@quot.header: Likewise.
11889 * runtime-po/en@boldquot.header: Likewise.
11890 * runtime-po/insert-header.sin: Likewise.
11891 * runtime-po/remove-potcdate.sin: Likewise.
11892 * runtime-po/Makevars: New file.
11893 * runtime-po/POTFILES.in: New file.
11894 * runtime-po/LINGUAS: New file.
11895 * runtime-po/bison-runtime.pot: New file.
11896 * runtime-po/de.po: New file.
11897 * m4/bison.m4: New file.
11898 * Makefile.am (SUBDIRS): Add runtime-po.
11899 (aclocaldir, aclocal_DATA): New variables.
11900 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
11901 Define aclocaldir.
11902 * src/getargs.c (usage): Document --print-localedir option.
11903 (PRINT_LOCALEDIR_OPTION): New enum item.
11904 (long_options): Add --print-localedir option.
11905 (getargs): Handle --print-localedir option.
11906 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
11907 (Internationalization): New section.
11908
22dda0f0
AD
119092005-07-12 Akim Demaille <akim@epita.fr>
11910
11911 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
11912 for consistency with the rest of the code.
11913 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
11914 Add separators.
11915
82b248ad
AD
119162005-07-12 Akim Demaille <akim@epita.fr>
11917
11918 * src/parse-gram.y: Use %printer instead of YYPRINT.
11919
fa0e9314
AD
119202005-07-12 Akim Demaille <akim@epita.fr>
11921
867a3e00
AD
11922 * src/symtab.h, src/symtab.c (symbol_print): New.
11923 * src/symlist.h, src/symlist.c (symbol_list_print): New.
11924 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
11925
119262005-07-12 Akim Demaille <akim@epita.fr>
11927
11928 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
11929 b4_at_dollar and b4_dollar_dollar.
11930
e054b190
PE
119312005-07-11 Paul Eggert <eggert@cs.ucla.edu>
11932
11933 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
11934 and Pennello's paper.
11935
34160ec4
PE
119362005-07-09 Paul Eggert <eggert@cs.ucla.edu>
11937
407d4a75
PE
11938 * data/yacc.c (yyparse): Undo previous patch. Instead,
11939 set yylsp[0] and yyvsp[0] only if the initial action
11940 sets yylloc and yylval, respectively.
11941
34160ec4
PE
11942 * data/yacc.c (yyparse): In the initial action, set
11943 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
11944 This avoids the use of undefined variables if the initial
11945 action does not set yylloc and/or yylval.
11946
c3d5a4a7
PE
119472005-07-07 Paul Eggert <eggert@cs.ucla.edu>
11948
b34d96c1
PE
11949 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
11950 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
11951 Remove from CVS. These files are automatically generated.
11952 * examples/extexi: Clarify that this file is now part of Bison,
11953 not GNU M4, and that it works with any POSIX-compatible Awk.
11954 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
11955 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
11956 so that we also get calc++-parser.yy. Geneate it.
11957 Use $(AWK), not gawk, since any conforming Awk will do.
11958 Put comment before action, since older 'make' can't handle comment
11959 in action.
11960 $(BUILT_SOURCES): List all built sources, not just some of them.
11961 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
11962 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
11963 $($(calc_sources_generated)): Remove unnecessary test for existence
11964 of target. (This had a shell syntax error anyway; a stray "x".)
11965 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
11966 calc++-parser.yy.
11967 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
11968
c3d5a4a7
PE
11969 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
11970 implied by the other modules.
11971
828c373b
AD
119722005-07-06 Akim Demaille <akim@epita.fr>
11973
11974 Bind examples/calc++ to the package.
11975 * examples/calc++/Makefile: Remove, replaced by...
11976 * examples/calc++/Makefile.am: ... this new file.
11977 * examples/calc++/test: Remove input.
11978 * examples/calc++/compile: Remove.
11979 * examples/Makefile.am: New.
11980 * configure.ac, Makefile.am: Adjust.
11981 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
11982
63cb01d6
PE
119832005-07-05 Paul Eggert <eggert@cs.ucla.edu>
11984
fd2df2ed
PE
11985 * data/glr.c (yyFail): Drastically simplify; since the format argument
11986 never had any % directives, we can simply pass it to yyerror.
11987 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
11988 be modified later, as that is the usual style in glr.c.
11989 Problems reported by Paul Hilfinger.
11990
63cb01d6
PE
11991 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
11992 and size overflow errors.
11993 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
11994 in case the user prolog sets feature-test macros like _GNU_SOURCE.
11995 (YYSIZEMAX): New macro.
11996 (yystpcpy): New function, taken from yacc.c.
11997 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
11998 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
11999 so that we don't have to maintain their signatures.
12000 (yyFail): Check for buffer overflow, by using vsnprintf rather
12001 than vsprintf. Allocate a bigger buffer if possible.
12002 Report an error if buffer allocation fails.
12003 (yyStackOverflow): New function.
12004 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
12005 the initialization was successful. It might fail if storage was
12006 exhausted.
12007 (yyexpandGLRStack): Add more checks for storage allocation failure.
12008 Use yyStackOverflow to report failures.
12009 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
12010 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
12011 Don't assume stack number fits in int.
12012 (yysplitStack): Check for storage allocation failure.
12013 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
12014 can print diagnostics on storage allocation failure. All callers
12015 changed.
12016 (yyresolveValue): Use yybool for boolean.
12017 (yyreportSyntaxError): Check for size-calculation overflow.
12018 This code is taken from yacc.c.
12019 (yyparse): Check for storage allocation errors when allocating
12020 the initial stack.
12021
1c59e0a1
AD
120222005-07-05 Akim Demaille <akim@epita.fr>
12023
12024 Extract calc++ from the documentation.
12025 * doc/bison.texinfo (Calc++): Add the extraction marks.
12026 * examples/extexi: New, from the aborted GNU Programming 2E.
12027 Separate the different paragraph of a file with empty lines.
12028 * examples/Makefile: Use it to extract the whole calc++ example.
12029
8a0adb01
AD
120302005-06-24 Akim Demaille <akim@epita.fr>
12031
12032 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
12033 class typedefs.
12034
12545799
AD
120352005-06-22 Akim Demaille <akim@epita.fr>
12036
12037 * doc/bison.texinfo (C++ Language Interface): First stab.
12038 (C++ Parsers): Remove.
12039
99be0235
AD
120402005-06-22 Akim Demaille <akim@epita.fr>
12041
12042 * data/lalr1.cc (yylex_): Honor %lex-param.
12043
0ffd4fd1
AD
120442005-06-22 Akim Demaille <akim@epita.fr>
12045
12046 Start a set of simple examples.
12047 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
12048 * examples/calc++/calc++-driver.hh,
12049 * examples/calc++/calc++-parser.yy,
12050 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
12051 * examples/calc++/compile, examples/calc++/test: New.
12052
0925ebb4
PE
120532005-06-09 Paul Eggert <eggert@cs.ucla.edu>
12054
12055 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
12056 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
12057 which stems from the 2005-05-27 patch.
12058
43d3b664
PH
120592005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12060
12061 * data/glr.c: Modify treatment of unused parameters to permit use
12062 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
12063
3062864d
PE
120642005-05-30 Paul Eggert <eggert@cs.ucla.edu>
12065
12066 Fix infringement on user name space reported by Janos Zoltan Szabo.
12067 * data/yacc.c (yyparse): strlen -> yystrlen.
12068
989b5b8e
AD
120692005-05-30 Akim Demaille <akim@epita.fr>
12070
12071 * data/lalr1.cc (_): New.
12072 Translate the various messages.
12073
bedf57f5
PE
120742005-05-27 Paul Eggert <eggert@cs.ucla.edu>
12075
12076 Fix infringement on user name space reported by Bruno Haible.
12077 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
12078 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
12079 the user's name space.
12080 (alloca): Include <stdlib.h> to get it, if it's not built in.
12081 (YYMALLOC, YYFREE): Define only if needed.
12082 (malloc, free): Declare, but only if needed, as this infringes on
12083 the user name space.
12084
4d1801f1
PE
120852005-05-25 Paul Eggert <eggert@cs.ucla.edu>
12086
12087 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
12088 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
12089 with %d format.
12090 * lib/ebitset.c (min, max): Undef before defining.
12091 * lib/vbitset.c (min, max): Likewise.
12092 * lib/subpipe.c (create_subpipe): Save local variables in case
12093 vfork clobbers them.
12094
120952005-05-24 Bruno Haible <bruno@clisp.org>
12096
12097 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
12098 error message syntax used by gcc-4.0.
12099
b94a9e1e
PE
121002005-05-23 Paul Eggert <eggert@cs.ucla.edu>
12101
85ac3861
PE
12102 * README: Mention m4 1.4.3. Remove obsolete advice about
12103 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
12104
b94a9e1e
PE
12105 * bootstrap: Remove workaround for problem I encountered with
12106 gettext 0.14.1; it seems to be fixed now.
12107
51c30d21
PE
121082005-05-22 Paul Eggert <eggert@cs.ucla.edu>
12109
009ce67d
PE
12110 * NEWS: Version 2.0a.
12111
f2a97c62
PE
12112 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
12113 the previous change.
12114
c8775f93
PE
12115 Various maintainer cleanups.
12116 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
12117 conftest*, for benefit of CVS commands run at the same time as
12118 "configure". Add build-aux, since "bootstrap" now creates it and
12119 its subfiles.
12120 * Makefile.cfg (move_if_change): Remove.
12121 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
12122 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
12123 (po_repo, do-po-update, po-update, wget_files, get-targets):
12124 (config.guess-url_prefix, config.sub-url_prefix):
12125 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
12126 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
12127 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
12128 Remove.
12129 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
12130 this is now the recommended name.
12131 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
12132 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
12133 ylwrap. These files now go into build-aux.
12134 * config/move-if-change: Remove.
12135 * config/prev-version.txt: Bump from 1.75 to 2.0.
12136
3ea5f0ec
PE
12137 * bootstrap: Add stdio-safer, unistd-safer modules.
12138 Remove m4/glibc2.m4 (introduced by latest gnulib, but
12139 we don't need it).
12140 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
12141 fopen-safer.c, stdio-safer.h, unistd-safer.h.
12142 * lib/subpipe.c: Include "unistd-safer.h".
12143 (create_subpipe): Make sure all the newly-created
12144 file descriptors are > 2, so that diagnostics don't
12145 get sent down them (which might cause Bison to hang, in theory).
12146 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
12147 * src/files.c (xfopen): Use fopen_safer, not fopen.
12148
51c30d21
PE
12149 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
12150 yesterday's yacc.c fix.
12151
cea1469d
PE
121522005-05-21 Paul Eggert <eggert@cs.ucla.edu>
12153
3ea5f0ec
PE
12154 * data/glr.c, data/lalr1.cc: Update copyright date.
12155
cea1469d
PE
12156 Fix a destructor bug reported by Wolfgang Spraul in
12157 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
12158 * data/yacc.c (yyabortlab): Don't call destructor, and
12159 don't set yychar to EMPTY.
12160 (yyoverflowlab): Don't call destructor.
12161 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
12162 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
12163 since we no longer output the message "discarding lookahead token
12164 end of input ()".
12165
5e6f62f2
PH
121662005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12167
12168 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
12169 fix a small glitch in debugging output.
12170 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
12171 after YY_SYMBOL_PRINT where needed.
12172
12173 (struct yyGLRState): Add some comments.
12174 (struct yySemanticOption): Add some comments.
12175 (union yyGLRStackItem): Add comment.
12176
12177 (yymergeOptionSets): Correct this to properly perform the union,
12178 avoiding infinite reported by Michael Rosien.
12179 Update comment.
12180
12181 * tests/glr-regression.at: Add test for GLR merging error reported
12182 by M. Rosien.
cea1469d 12183
0fb669f9
PE
121842005-05-13 Paul Eggert <eggert@cs.ucla.edu>
12185
12186 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
12187 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
12188 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
12189 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
12190 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
12191 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
12192 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
12193 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
12194 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
12195 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
12196 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
12197 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
12198 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
12199 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
12200 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
12201 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
12202 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
12203 src/derives.h, src/files.c, src/files.h, src/getargs.c,
12204 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
12205 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
12206 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
12207 src/output.h, src/parse-gram.c, src/parse-gram.h,
12208 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
12209 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
12210 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
12211 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
12212 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
12213 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
12214 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
12215 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
12216 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
12217 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
12218 tests/reduce.at, tests/regression.at, tests/sets.at,
12219 tests/synclines.at, tests/testsuite.at, tests/torture.at:
12220 Update FSF postal mail address.
12221
51f4735e
PE
122222005-05-11 Paul Eggert <eggert@cs.ucla.edu>
12223
12224 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
12225 Problem reported by Ralf Menzel.
12226
80ce3401
PE
122272005-05-01 Paul Eggert <eggert@cs.ucla.edu>
12228
12229 * tests/actions.at: Test that stack overflow invokes destructors.
12230 From Marcus Holland-Moritz.
12231 * data/yacc.c (yyerrlab): Move the code that destroys the stack
12232 from here....
12233 (yyreturn): to here. That way, destructors are called properly
12234 even if the stack overflows, or the user calls YYACCEPT or
12235 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
12236 (yyoverflowlab): Destroy the lookahead.
12237
122382005-04-24 Paul Eggert <eggert@cs.ucla.edu>
12239
12240 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
12241
72f000b0
PE
122422005-04-17 Paul Eggert <eggert@cs.ucla.edu>
12243
12244 * NEWS: Bison-generated C parsers no longer quote literal strings
12245 associated with tokens.
12246 * src/output.c (prepare_symbols): Don't escape strings,
12247 since users don't want to see C escapes.
12248 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
12249 in diagnostics.
c19683bb 12250 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
12251 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
12252
1094323f
PE
122532005-04-16 Paul Eggert <eggert@cs.ucla.edu>
12254
12255 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
12256 the data size is known to be too small and we can't increase it.
12257 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
12258
ca407bdf
PE
122592005-04-15 Paul Eggert <eggert@cs.ucla.edu>
12260
12261 * src/parse-gram.y: Include quotearg.h.
12262 (string_as_id): Quote $1 before using it as a key, since the
12263 lexer no longer quotes it for us.
12264 (string_content): Don't strip quotes, since lexer no longer
12265 quotes it for us.
12266 * src/scan-gram.l: Include quotearg.h.
12267 ("\""): Omit quote.
12268 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
12269 a key, since the rest of the lexer doesn't quote it.
12270 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
12271 * tests/regression.at (Token definitions): Check for backslashes
12272 in token strings.
12273
12274 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
12275 (YYSIZE_T): Define to unsigned long int when using an older compiler.
12276 (yyparse): Revamp code to generate long syntax error message, to
12277 make it easier to translate, and to avoid problems with arithmetic
12278 overflow. Change "virtual memory" to "memory" in diagnostic, since
12279 we don't know whether the memory is virtual.
12280
1ce59070
PE
122812005-04-13 Paul Eggert <eggert@cs.ucla.edu>
12282
12283 * NEWS: Bison-generated C parsers now use the _ macro to
12284 translate strings.
12285 * data/yacc.c (_) [!defined _]: New macro.
12286 All English strings wrapped inside this macro.
12287 * doc/bison.texinfo (Bison Parser): Document _.
12288 * po/POTFILES.in: Include src/parse-gram.c, since it now
12289 includes translateable strings that parse-gram.y doesn't.
12290
a749a695
PE
122912005-04-12 Paul Eggert <eggert@cs.ucla.edu>
12292
12293 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
12294 reverting the 2004-10-11 change to this function.
12295 (symbol_check_alias_consistency): Don't call symbol_type_set
12296 if the type name is already correct.
12297 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
12298
8fb1053b
PE
122992005-03-25 Paul Eggert <eggert@cs.ucla.edu>
12300
12301 * tests/regression.at (Token definitions): Don't use a token named
12302 c, as that generates a "#define c ..." that runs afoul of buggy
12303 stdlib.h that uses the identifier c as a member of struct
12304 drand48_data. Problem reported by Horst Wente.
12305
ff498c4a
PE
123062005-03-21 Paul Eggert <eggert@cs.ucla.edu>
12307
12308 * bootstrap: Change translation URL from
12309 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
12310 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
12311 redirection glitches. Problem reported by twlevo@xs4all.nl.
12312
65211d70
PE
123132005-03-20 Paul Eggert <eggert@cs.ucla.edu>
12314
12315 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
12316 after operands; POSIX says this isn't portable for the c99 command.
12317
9577fb1f
PE
123182005-03-18 Paul Eggert <eggert@cs.ucla.edu>
12319
12320 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
12321 immediately if a data overrun has occurred; this may help us track
12322 down what may be a spurious failure on MacOS.
12323
78b178f7
PE
123242005-03-17 Paul Eggert <eggert@cs.ucla.edu>
12325
a2599d0f
PE
12326 Respond to problems reported by twlevo@xs4all.nl.
12327
12328 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
12329
78b178f7
PE
12330 * src/vcg.h: Comment fix.
12331 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
12332 (G_CMAX): Change to -1 instead of INT_MAX.
12333
12334 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 12335
7296e729
PE
123362005-03-15 Paul Eggert <eggert@cs.ucla.edu>
12337
12338 * src/tables.c (state_number_to_vector_number): Put it inside an
12339 "#if 0", since it's not currently used. Problem reported by
12340 Roland McGrath.
12341
05ac60f3
PE
123422005-03-06 Paul Eggert <eggert@cs.ucla.edu>
12343
12344 * src/output.c (escaped_output): Renamed from
12345 escaped_file_name_output, since we now use it for symbol tags as
12346 well. All uses changed.
12347 (symbol_destructors_output, symbol_printers_output):
12348 Escape symbol tags too.
12349 Problem reported by Matyas Forstner in
12350 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
12351
12352 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
12353 not needed.
12354 * src/output.c (user_actions_output, token_definitions_output,
12355 symbol_destructors_output, symbol_printers_output): Likewise.
12356 * src/reader.c (prologue_augment): Likewise.
12357 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
12358
12359 * src/vcg.c (output_edge): Don't quote linestyle arg.
12360 Problem reported by twlevo@xs4all.nl.
12361
7eb453ac
PE
123622005-02-28 Paul Eggert <eggert@cs.ucla.edu>
12363
12364 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
12365 example, reported by Derek M Jones. Also, make the example even
12366 more outrageous, to better illustrate how bad the problem is.
12367
4c04c52a
PE
123682005-02-24 Paul Eggert <eggert@cs.ucla.edu>
12369
12370 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
12371 putsym. Typo reported by Sebastian Piping.
12372
a61e1620
PE
123732005-02-23 Paul Eggert <eggert@cs.ucla.edu>
12374
12375 * doc/bison.texinfo (Language and Grammar): some -> same
12376 (Epilogue): int he -> in the
12377 Typos reported by Sebastian Piping via Justin Pence.
12378
9ec93868
PE
123792005-02-07 Paul Eggert <eggert@cs.ucla.edu>
12380
12381 * tests/glr-regression.at (Improper handling of embedded actions
12382 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
12383 embedded actions and $-N in GLR parsers", work around an Autoconf bug
12384 with dollar signs in test names.
12385 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
12386 for a similar reason.
12387
73ce7e7e
PE
123882005-01-28 Paul Eggert <eggert@cs.ucla.edu>
12389
12390 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
12391 wants to redefine G_VIEW.
12392
2e72b98e
PE
123932005-01-27 Paul Eggert <eggert@cs.ucla.edu>
12394
12395 * src/vcg.c (get_view_str): Remove case for normal_view.
12396 Problem reported by twlevo@xs4all.nl.
12397
e0d634e5
PE
123982005-01-24 Paul Eggert <eggert@cs.ucla.edu>
12399
ccf830a4
PE
12400 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
12401 Problem reported by twlevo@xs4all.nl.
12402
e0d634e5
PE
12403 * doc/bison.texinfo: Change @dircategory from "GNU programming
12404 tools" to "Software development". Requested by Richard Stallman
12405 via Karl Berry.
12406
7bbc8cb0
PE
124072005-01-23 Paul Eggert <eggert@cs.ucla.edu>
12408
12409 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
12410 Problem reported by twlevo@xs4all.nl.
12411
08b770bc
PE
124122005-01-21 Paul Eggert <eggert@cs.ucla.edu>
12413
12414 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
12415 keyword; it's not needed with modern compilers, and it doesn't
12416 affect correctness with older compilers. Suggested by
12417 twlevo@xs4all.nl.
12418
95f22ad2
PE
124192005-01-17 Paul Eggert <eggert@cs.ucla.edu>
12420
12421 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
12422 gcc -Wswitch-default.
12423 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12424 * data/yacc.c (yyparse): Likewise.
12425
d229d15c
PE
124262005-01-12 Paul Eggert <eggert@cs.ucla.edu>
12427
12428 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
12429 already. Let config.h define any nonstandard values.
12430
ecadd90f
PE
124312005-01-10 Paul Eggert <eggert@cs.ucla.edu>
12432
12433 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
12434 for the benefit of slower hosts. Problem reported by
12435 Nelson H. F. Beebe.
12436
213744b5
PE
124372005-01-07 Paul Eggert <eggert@cs.ucla.edu>
12438
12439 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
12440 being defined and not used.
12441 * data/lalr1.cc (yyparse): Likewise.
12442 Use "if (false)" rather than "if (0)".
12443
249d3236
PE
124442005-01-05 Paul Eggert <eggert@cs.ucla.edu>
12445
12446 * TODO: Mention that we should allow NUL bytes in tokens.
12447
987cc1fb
PE
124482005-01-02 Paul Eggert <eggert@cs.ucla.edu>
12449
12450 * src/scan-skel.l (<<EOF>>): Don't close standard output.
12451 Problem reported by Hans Aberg.
12452
08fe02d9
PE
124532005-01-01 Paul Eggert <eggert@cs.ucla.edu>
12454
12455 * src/getargs.c (version): Happy new year; update overall
12456 program copyright date from 2004 to 2005.
12457
12458 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
12459 Problem reported by Hans Aberg.
12460 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
12461 (Output file names.): Add a test for the case when standard output
12462 is closed.
12463
010c0266
PE
124642004-12-26 Paul Eggert <eggert@cs.ucla.edu>
12465
12466 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
12467 to fix an oversight in the Bison 2.0 manual.
12468
da12206a
PE
124692004-12-25 Paul Eggert <eggert@cs.ucla.edu>
12470
12471 * NEWS: Version 2.0. Reformat the existing news items since
12472 1.875, so that related items are grouped together.
3a4734aa 12473 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
12474 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
12475
c935d934
PE
12476 * tests/torture.at (Exploding the Stack Size with Alloca): Set
12477 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
12478 otherwise, we're not testing alloca. Unfortunately there's no
12479 simple way to consult HAVE_ALLOCA here.
12480
da12206a
PE
12481 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
12482 for yymsg, too.
12483
12484 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
12485 hand. This avoids a warning about comparing int to size_t when
12486 GCC warnings are enabled.
12487
0a2c5137
PE
124882004-12-22 Paul Eggert <eggert@cs.ucla.edu>
12489
d7e14fc0
PE
12490 * NEWS: Bison-generated parsers no longer default to using the
12491 alloca function (when available) to extend the parser stack, due
12492 to widespread problems in unchecked stack-overflow detection.
12493 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
12494 responsibility to set it to a positive value. This lets the user
12495 specify a value that is not a preprocessor constant.
12496 * data/yacc.c (YYMAXDEPTH): Likewise.
12497 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
12498 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
12499 to be a compile-time constant. However, explain the constraints on it.
12500 Also, explain the constraints on YYINITDEPTH.
12501 (Table of Symbols): Explain that alloca is no longer the default.
12502 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
12503 to 1.
12504
0a2c5137
PE
12505 * doc/bison.texinfo (Location Default Action): Mention that n must
12506 be zero when k is zero. Suggested by Frank Heckenbach.
12507
e019c247
AD
125082004-12-22 Akim Demaille <akim@epita.fr>
12509
12510 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
12511 (parser::state_type, parser::semantic_type, parser::location_type):
12512 Private, not public.
12513 (parser::parse): Return ints, not bool.
12514 Returning a bool introduces a problem: 0 corresponds to false, and
12515 it seems weird to return false on success. Returning true changes
12516 the conventions for yyparse.
12517 Alternatively we could return void and send an exception.
12518 There is no clear consensus (yet?).
12519 (state_stack, semantic_stack, location_stack): Rename as...
12520 (state_stack_type, semantic_stack_type, location_stack_type): these.
12521 Private, not public.
12522 * tests/c++.at: New.
12523 * tests/testsuite.at, tests/Makefile.am: Adjust.
12524
72731bb7
AD
125252004-12-21 Akim Demaille <akim@epita.fr>
12526
12527 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
12528
9a0d8bec
AD
125292004-12-21 Akim Demaille <akim@epita.fr>
12530
12531 Don't impose std::string for filenames.
12532
12533 * data/lalr1.cc (b4_filename_type): New.
12534 (position::filename): Use it.
12535 (parser.hh): Move the inclusion of stack.hh and location.hh below
12536 the user code, so that needed headers for the filename type can be
12537 included first.
72731bb7
AD
12538 Forward declare them before the user code.
12539 * tests/Makefile.am (check-local, installcheck-local): Pass
12540 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 12541
99880de5
AD
125422004-12-20 Akim Demaille <akim@epita.fr>
12543
12544 Use more STL like names: my_class instead of MyClass.
12545
12546 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
12547 (SemanticStack, SemanticType, StateStack, StateType)
12548 (TokenNumberType, Stack, Slice, Traits, Parser::location)
12549 (Parser::value): Rename as...
12550 (location_stack, location_type, rhs_number_type, semantic_stack)
12551 (semantic_type, state_stack, state_type, token_number_type, stack)
12552 (slice, traits, parser::yylloc, parser::yylval): these.
12553
12554 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
12555
9bec482e
PE
125562004-12-19 Paul Eggert <eggert@cs.ucla.edu>
12557
12558 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
12559 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12560
f6fbd3da
PE
125612004-12-17 Paul Eggert <eggert@cs.ucla.edu>
12562
12563 Remove uses of 'short int' and 'unsigned short int'. This raises
12564 some arbitrary limits. It uses more memory but nowadays that's
12565 not much of an issue.
12566
12567 This change does not affect the generated parsers; that's a different
12568 task, as some users will want to conserve memory there.
12569
12570 Ideally we should use size_t to represent all object counts, and
12571 something like ptrdiff_t to represent signed differences of object
12572 counts; but that will require more code-cleanup than I have the
12573 time to do right now.
12574
12575 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
12576 Use size_t, not int or short int, to count objects.
12577 * src/closure.c (nritemset, closure): Likewise.
12578 * src/closure.h (nritemset, closure): Likewise.
12579 * src/nullable.c (nullable_compute): Likewise.
12580 * src/print.c (print_core): Likewise.
12581 * src/print_graph.c (print_core): Likewise.
12582 * src/state.c (state_compare, state_hash): Likewise.
12583 * src/state.h (struct state): Likewise.
12584 * src/tables.c (default_goto, goto_actions): Likewise.
12585
12586 * src/gram.h (rule_number, rule): Use int, not short int.
12587 * src/output.c (prepare_rules): Likewise.
12588 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
12589 errs, reductions): Likewise.
12590 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
12591 Likewise.
12592 * src/tables.c (vector_number, tally, action_number,
12593 ACTION_NUMBER_MINIMUM): Likewise.
12594 * src/output.c (muscle_insert_short_int_table): Remove.
12595
efeed023
AD
125962004-12-17 Akim Demaille <akim@epita.fr>
12597
12598 * data/lalr1.cc: Extensive Doxygenation.
12599 (error_): Rename as...
12600 (error): this, since it is visible to the user.
12601 Adjust callers.
12602 (Parser::message): Now an automatic variable from...
12603 (Parser::yyreport_syntax_error_): here.
12604 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
12605 Parser::error.
12606 * tests/input.at: Escape $.
12607
bc82c5a5
PE
126082004-12-16 Paul Eggert <eggert@cs.ucla.edu>
12609
12610 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
12611 Parenthesize rhs to avoid obscure problems with mistakes like
12612 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
12613 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12614 b4_rhs_location): Likewise.
12615 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12616 b4_rhs_location): Likewise.
12617
fd19f271
AD
126182004-12-16 Akim Demaille <akim@epita.fr>
12619
12620 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
12621 yacc.c: be sure to stay within yycheck_.
12622 * tests/actions.at: Re-enable C++ tests.
12623
10454ea4
AD
126242004-12-16 Akim Demaille <akim@epita.fr>
12625
12626 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
12627 real.
12628
c5b95ccf
AD
126292004-12-16 Akim Demaille <akim@epita.fr>
12630
12631 Use #define to handle the %name-prefix.
12632
12633 * data/glr.c, data/yacc.c: Comment changes.
12634 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
12635 so that one can refer to yylex in the parser file, and have it
12636 renamed, as is the case with other skeletons.
12637
617a8f12
AD
126382004-12-16 Akim Demaille <akim@epita.fr>
12639
12640 Move lalr1.cc internals into yy*.
12641
12642 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
12643 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
12644 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
12645 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
12646 (empty_, final_, terror_, errcode_, ntokens_)
12647 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
12648 (looka_, ilooka_, error_range_, nerrs_):
12649 Rename as...
12650 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
12651 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
12652 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
12653 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
12654 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
12655 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
12656 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
12657 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
12658 these.
12659
1e547e6e
PE
126602004-12-15 Paul Eggert <eggert@cs.ucla.edu>
12661
12662 Fix some problems reported by twlevo at xs4all.
12663 * src/symtab.c (symbol_new): Report an error if the input grammar
12664 contains too many symbols. This is better than calling abort() later.
12665 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
12666 (struct node, struct graph):
12667 Rename member expand to stretch. All uses changed.
12668 (struct graph): Remove member layoutalgorithm. All uses removed.
12669 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
12670 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
12671 All uses changed.
12672 (N_STRETCH): Rename from N_EXPAND. All uses changed.
12673
735d6bd4
AD
126742004-12-15 Akim Demaille <akim@epita.fr>
12675
12676 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
12677 Add more Doxygen comments.
12678 (symprint_, stack_print_, reduce_print_, destruct_, pop)
12679 (report_syntax_error_, translate_): Rename as...
12680 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
12681 (yypop_, yyreport_syntax_error_, yytranslate_): this.
12682
2e1f5829
AD
126832004-12-15 Akim Demaille <akim@epita.fr>
12684
12685 * data/lalr1.cc (lex_): Rename as...
12686 (yylex_): this.
12687 Move the trace here.
12688 Take the %name-prefix into account.
12689 Reported by Alexandre Duret-Lutz.
12690
a3cb6248
AD
126912004-12-15 Akim Demaille <akim@epita.fr>
12692
12693 Simplify the C++ parser constructor.
12694
12695 * data/lalr1.cc (debug_): Rename as...
12696 (yydebug_): so that the parser's internals are always in the yy*
12697 pseudo namespace.
12698 Adjust uses.
12699 (b4_parse_param_decl): Remove the leading comma as it is now only
12700 called as unique argument list.
12701 (Parser::Parser): Remove the constructor accepting a location and
12702 an initial debugging level.
12703 Remove from the other ctor the argument for the debugging level.
12704 (debug_level_type, debug_level, set_debug_level): New.
12705
12706 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
12707 constructor calls.
12708
07fed891
AD
127092004-12-15 Akim Demaille <akim@epita.fr>
12710
12711 Remove b4_root related material: failure experiment
a3cb6248 12712 (which goal was to allow to derive from a class).
07fed891
AD
12713
12714 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
12715 definitions and uses.
12716
e603eaa5
PE
127172004-12-14 Paul Eggert <eggert@cs.ucla.edu>
12718
12719 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
12720 not 2, since it's not portable to subtract 1 from the start of an
12721 array. The new item 0 is never set or used. All uses changed.
12722
12723 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
12724 the default definition of YYLLOC_DEFAULT. Problem reported
12725 by Frank Heckenbach.
12726
fafb007d
PE
127272004-12-12 Paul Eggert <eggert@cs.ucla.edu>
12728
12729 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
12730 the normal case and one for the error case. Just use the
12731 first one uniformly. Problem reported by Frank Heckenbach.
12732 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
12733 use exactly the same macro in both places.
12734 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
12735 so that the normal-case YYRHSLOC works for the error case too.
12736 All uses changed.
12737 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
12738 (YYLLOC_DEFAULT): Use the same macro as glr.c.
12739 * doc/bison.texinfo (Location Default Action): Don't claim that
12740 we have an array of locations. Use the same macro for both glr
12741 and lalr parsers. Mention YYRHSLOC. Mention what happens when
12742 the index is 0.
12743
48814dcd
PE
127442004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12745
a4e1a53b
PE
12746 * HACKING: Update email addresses to send announcements to.
12747
48814dcd
PE
12748 * configure.ac (AC_INIT): Bump version to 1.875f.
12749
337116ba
PE
127502004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12751
12752 * NEWS: Version 1.875e.
12753 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
12754
12755 * src/scan-skel.l: Include "complain.h", for "fatal".
12756
12757 * src/relation.h (relation_print, relation_digraph):
12758 Relation sizes are of type relation_node, not size_t (this is
12759 merely a doc fix, since the two types are equivalent).
12760 (relation_transpose): Relation sizes are of type relation_node,
12761 not int.
12762 * src/relation.c: Likewise.
12763 (top, infinity): Now of type relation_node, not int.
12764 (traverse, relation_transpose): Use relation_node, not int.
12765
12766 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
12767 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
12768 (yyparse): Remove unused local introduced in 2004-10-25 patch.
12769
12770 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 12771 specifying whether the test should be skipped. Use it tp
337116ba 12772 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 12773 fail on some hosts, and should be skipped.
337116ba 12774
da2a7671
PE
127752004-12-08 Paul Eggert <eggert@cs.ucla.edu>
12776
12777 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
12778 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
12779 unless otherwise specified below.
12780
12781 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
12782 to allocate kernel_base, kernel_items, kernel_size, since
12783 they needn't be initialized to 0.
12784 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
12785 * src/closure.c (new_closure): Likewise, for itemset.
12786 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
12787 * src/lalr.c (set_goto_map): Likewise, for temp_map.
12788 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
12789 (build_relations): Likewise for edge, states1, includes.
12790 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
12791 * src/reader.c (packgram): Likewise, for ritem, rules.
12792 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
12793 * src/relation.c (relation_digraph): Likewise for VERTICES.
12794 (relation_transpose): Likewise for new_R, end_R.
12795 * src/symtab.c (symbols_token_translations_init): Likewise for
12796 token_translations.
12797 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
12798 (token_actions): Likewise for yydefact, actrow, conflrow,
12799 conflict_list.
12800 (save_column): Likewise for froms[symno], tos[symno].
12801 (goto_actions): Likewise for state_count.
12802 (pack_table): Likewise for base, pos, check.
12803 (tables_generate): Likewise for width.
12804
12805 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
12806 for initial core. Just have a separate core, so we needn't worry
12807 about whether kernel_size and kernel_base are initialized.
12808
12809 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
12810 kernel_size, kernel_items): Remove unnecessary initialization.
12811 * src/conflicts.c (conflicts): Likewise.
12812 * src/derives.c (derives): Likewise.
12813 * src/muscle_tablc (muscle_insert): Likewise.
12814 * src/relation.c (relation_digraph): Likewise.
12815 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
12816 conflrow, conflict_table, conflict_list, table, check):
12817 Likewise.
12818
12819 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
12820 This is because all callers pass unsigned int.
12821 * src/closure.h (new_closure): Likewise.
12822
12823 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
12824 (build_relations): Initialize includes[i] in all cases.
12825 * src/reader.c (packgram): Always initialize rules[ruleno].prec
12826 and rules[ruleno].precsym. Initialize members in order.
12827 * src/relation.c (relation_transpose): Always initialize new_R[i]
12828 and end_R[i].
12829 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
12830
12831 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
12832 conflict_list[0] was always 0, but now it isn't initialized.
12833
12834 * src/table.c (table_grow): When conflict_table grew, the grown
12835 area wasn't cleared. Fix this.
12836
12837 * lib/.cvsignore: Add strdup.c, strdup.h.
12838 * m4/.cvsignore: Add strdup.m4.
12839
00baeeac
PE
128402004-12-07 Paul Eggert <eggert@cs.ucla.edu>
12841
12842 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
12843 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
12844 GOTO_NUMBER_MAXIMUM, since we occasionally compute
12845 ngotos + 1 without checking for overflow.
12846 (build_relations): Use END_NODE, not -1, to denote end of edges.
12847 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
12848 build_relations): Use goto_number, not int, for goto numbers.
12849 * src/tables.c (save_column, default_goto): Likewise.
12850
be3d9d42
AD
128512004-11-23 Akim Demaille <akim@epita.fr>
12852
12853 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
12854 of #defining from yystype.
12855 Don't typedef yystype, C++ does not need it.
12856 This lets it possible to forward declare it as union.
12857
78e526d5
PE
128582004-11-23 Paul Eggert <eggert@cs.ucla.edu>
12859
12860 * bootstrap (gnulib_modules): Add extensions.
12861 Problem reported by Jim Meyering.
12862
afbb696d
PE
128632004-11-22 Paul Eggert <eggert@cs.ucla.edu>
12864
12865 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
12866 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
12867 src/system.h, src/tables.c: XFREE -> free, to accommodate
12868 recent change to gnulib xalloc.h.
78e526d5 12869 Problem reported by Jim Meyering.
afbb696d 12870
c1f8f16a
AD
128712004-11-17 Akim Demaille <akim@epita.fr>
12872
12873 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
12874
db7e5eb5 128752004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
12876 Alexandre Duret-Lutz <adl@gnu.org>
12877
12878 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
12879 changes.
12880 (YYCDEBUG): Adjust.
12881 Use it instead of cdebug_.
12882 (Parser::debug_stream, Parser::set_debug_stream): New.
12883 (Parser::symprint_): Define cdebug_ for temporary backward
12884 compatibility.
12885 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
12886 debug_stream ().
12887
68e11668
AD
128882004-11-17 Akim Demaille <akim@epita.fr>
12889
12890 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
12891 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
12892 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
12893 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12894
97cbc73e
PE
128952004-10-27 Paul Eggert <eggert@cs.ucla.edu>
12896
12897 * data/glr.c (yyloc_default): Remove; not used.
12898 Problem reported by Frank Heckenbach.
12899
e342c3be
AD
129002004-10-25 Akim Demaille <akim@epita.fr>
12901
12902 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
12903 Introduce another definition to address simple location arrays.
12904 (yyGLRStack): New member: yyerror_range.
12905 (yyrecoverSyntaxError, yyparse): Update it.
12906 (yyrecoverSyntaxError): Use it when shifting the error token to
12907 have an accurate range, equivalent to the one computed by both
12908 yacc.c and lalr1.cc.
12909 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
12910 that column numbers start at column 0, as per GNU Coding
12911 Standards, the others tests, and the doc.
12912 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
12913 Adjust to the above change (first column is 0).
12914 And adjust the location of the "<error>", now covering the whole
12915 line.
12916
93602feb 129172004-10-22 Akim Demaille <akim@epita.fr>
04098407 12918 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
12919
12920 Remove some arbitrary limits on goto numbers and relations.
12921 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
12922 initial values, since they're never used.
12923 (set_goto_map): ngotos is now unsigned, so test for overflow
12924 by seeing whether it wraps around to zero.
12925 * src/lalr.h (goto_number): Now size_t, not short int.
12926 (GOTO_NUMBER_MAXIMUM): Remove.
12927 * src/relation.c (relation_print, traverse, relation_transpose):
12928 Check for END_NODE rather than looking at sign.
12929 * src/relation.h (END_NODE): New macro.
12930 (relation_node): Now size_t, not short int.
12931
dba08b04
PE
129322004-10-22 Paul Eggert <eggert@cs.ucla.edu>
12933
12934 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
12935 keyword, not an identifier. Problem reported by Baron Schwartz in
12936 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
12937
df09ef2e
AD
129382004-10-11 Akim Demaille <akim@epita.fr>
12939
12940 * src/symtab.c (symbol_check_alias_consistency): Also check
12941 type names, destructors, and printers.
12942 Reported by Alexandre Duret-Lutz.
12943 Recode the handling of associativity and precedence in terms
12944 of symbol_precedence_set.
12945 Accept no redeclaration at all, not even equal to the previous
12946 value.
12947 (redeclaration): New.
12948 Use it to factor redeclaration complaints.
12949 (symbol_make_alias): Don't set the type of the alias, let
12950 symbol_check_alias_consistency do it as for other features.
12951 * src/symtab.h (symbol): Add new member prec_location, and
12952 type_location.
12953 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
12954 * tests/input.at (Incompatible Aliases): New.
12955
146bc99d
PE
129562004-10-09 Paul Eggert <eggert@cs.ucla.edu>
12957
12958 .cvsignore fixes to accommodate gnulib changes,
12959 and the practice of naming build directories "_build".
12960 * .cvsignore: Add "_*". Sort.
12961 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
12962 * m4/.cvsignore: Add "*_gl.m4".
12963
e503aa60
AD
129642004-10-06 Akim Demaille <akim@epita.fr>
12965
12966 * src/parse-gram.y (add_param): Fix the truncation of trailing
12967 spaces.
12968
b4a20338
AD
129692004-10-05 Akim Demaille <akim@epita.fr>
12970
12971 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
12972 whether the reducion was empty or not. This leaves room to
12973 improve the use of YYLLOC_DEFAULT in such a case.
12974 lalr1.cc is still experimental, so changing this is acceptable.
12975 And finally, there are probably not many users who changed the
12976 handling of locations in GLR, so changing is admissible too.
12977
12978 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
12979 empty reduction, set @$ to an empty location ending the previously
12980 stacked symbol.
12981 Adjust uses to make sure the code is triggered on empty
12982 reductions.
12983 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
12984 expected output: empty reductions have empty locations.
12985
f85a5e6f
AD
129862004-09-29 Akim Demaille <akim@epita.fr>
12987
12988 * data/lalr1.cc: Move towards a more standard C++ coding style
12989 for templates: Class < T > -> Class<T>.
12990
b203fc2c
AD
129912004-09-29 Akim Demaille <akim@epita.fr>
12992
12993 * data/lalr1.cc: Reinstall the former ctor, for sake of
12994 compatibility, but warn it will be removed.
12995 Move towards a more standard C++ coding style (i.e., type *var ->
12996 type* var).
12997
5b7e1e73
PE
129982004-09-27 Paul Eggert <eggert@cs.ucla.edu>
12999
3fee967f
PE
13000 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
13001 since it's less likely to work if NULs are involved in the future.
5b7e1e73 13002
0dcca5c2
AD
130032004-09-27 Akim Demaille <akim@epita.fr>
13004
13005 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
13006
6dde1c82
AD
130072004-09-27 Akim Demaille <akim@epita.fr>
13008
13009 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 13010 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
13011 and argument names.
13012 (b4_cc_constructor_call): Likewise.
13013
b233d555
AD
130142004-09-24 Akim Demaille <akim@epita.fr>
13015
13016 * src/parse-gram.y (add_param): Strip the leading and trailing
13017 blanks from a formal argument declaration.
13018 (YY_LOCATION_PRINT): New.
13019
619404e3
AD
130202004-09-24 Akim Demaille <akim@epita.fr>
13021
13022 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
13023 after the location.
13024
dd8d9022
AD
130252004-09-24 Akim Demaille <akim@epita.fr>
13026
13027 * doc/bison.texinfo (Table of Symbols): Sort.
13028
0092f063
AD
130292004-09-21 Akim Demaille <akim@epita.fr>
13030
13031 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
13032 the useless parentheses.
13033 Suggested by Paul Eggert.
13034
451364ed
AD
130352004-09-20 Akim Demaille <akim@epita.fr>
13036
13037 Let the initial-action act on the look-ahead, and use it for the
13038 "initial push" (corresponding to an hypothetical beginning-of-file).
13039 And let lalr1.cc honor %initial-action.
13040
13041 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
13042 example.
13043 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
13044 (Parser::Parser): Remove the ctor that used to initialize it.
13045 (Parser::parse): Like in the other skeletons, issue the "starting
13046 parse" message before any action.
13047 Honor %initial-action.
13048 Initialize the stacks with the lookahead.
13049 * data/yacc.c: Let $$ and @$ in %initial-action designate the
13050 look-ahead.
13051 Push them in the stacks.
13052 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
13053
18d192f0
AD
130542004-09-20 Akim Demaille <akim@epita.fr>
13055
13056 * doc/bison.texinfo (Initial Action Decl): New.
13057
b8458aa5
AD
130582004-09-20 Akim Demaille <akim@epita.fr>
13059
13060 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
13061 clearer criterion to define it.
13062 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
13063 When reducing on an empty RHS, use the latest stacked location as
13064 location.
13065 yylloc is not always available.
13066 * data/glr.c: Likewise.
13067 Also, honor initial-actions.
13068
3fc16193
AD
130692004-09-20 Akim Demaille <akim@epita.fr>
13070
13071 * data/yacc.c (YY_LOCATION_PRINT): New.
13072 Define when we know YYLTYPE's structure, i.e., when the default
13073 YYLLOC_DEFAULT is used.
13074 * data/c.m4 (b4_yysymprint_generate): Use it.
13075 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
13076 value of the result.
13077 (error_start_): Replace with...
13078 (error_range_): this location array.
13079 This allows to replace code relying on the implementation of
13080 locations by portable code.
13081 * data/yacc.c (yylerrsp): Replace with...
13082 (yyerror_range): this.
13083 Every time a token is popped, update yyerror_range[0], to have an
13084 accurate location for the error token.
13085 * data/glr.c (YY_LOCATION_PRINT): New.
13086 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
13087 deference a pointer.
13088 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
13089 report the location in %printers.
13090
13091 * src/scan-skel.l: Instead of abort, report error messages to ease
13092 understanding skeleton scanning failures.
13093
ecfe33e7
AD
130942004-09-16 Akim Demaille <akim@epita.fr>
13095
13096 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
13097 (iterator, const_iterator): these, to be more in the C++ spirit.
13098 Also, return reverse iterators so that when displaying the stack
13099 we display its bottom first.
13100 (Parser::stack_print_, Parser::reduce_print_): Match the messages
13101 from yacc.c.
13102 We should probably use vector here though.
13103
1576d44d
AD
131042004-09-16 Akim Demaille <akim@epita.fr>
13105
13106 Have more complete shift traces.
13107
13108 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
13109 to report Shifts instead of ad hoc YYDPRINTF invocations,
13110 including for the error token.
13111 * data/lalr1.cc (symprint_): Output the location.
13112 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
13113 output the location within the %printer.
13114 Activate GLR tests, at least to make sure they compile properly.
13115 They still don't pass though.
13116 * tests/calc.at: Adjust expect verbose output, since now "Entering
13117 state..." is on a different line than the "Shifting" message.
13118
9c66f418
AD
131192004-09-08 Akim Demaille <akim@epita.fr>
13120
13121 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
13122 Bison directive from the Bison file to the invocation of this
13123 macro, so that these directives are passed to
13124 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
13125 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
13126 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
13127 the extra Bison directives instead of the whole series.
13128 Change the grammar so that there are recoverable errors, and
13129 unrecoverable errors. Now we can have the parser give up before
13130 consuming the whole input. As a result we now can observe that
13131 the lookahead is freed when needed.
13132 Change the parser source to parse argv[1] instead of a hard coded
13133 string.
13134 Simplify yylex, and give a value and location to EOF.
13135 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
13136 passed directives already coded in the file.
13137 Add some tests to check the location of "error".
13138 For some tests, the C++ parser is correct, and not yacc.c.
13139 For other tests, they provide different, but unsatisfying, values,
13140 so keep the C++ value so that at least one parser is "correct"
13141 according to the test suite.
13142 (Actions after errors): Remove, this is subsumed by the
13143 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
13144
52d5733f
AD
131452004-09-06 Akim Demaille <akim@epita.fr>
13146
13147 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 13148 (Parser::pop): New.
52d5733f
AD
13149 Use it.
13150
a0e68930
AD
131512004-09-06 Akim Demaille <akim@epita.fr>
13152
13153 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
13154 argument, an informative message.
13155 Call YY_SYMBOL_PRINT.
13156 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
13157 * data/lalr1.cc (destruct_): Likewise.
13158 In addition, no longer depend on b4_yysymprint_generate and
13159 b4_yydestruct_generate to generate these functions, do it "by
13160 hand".
13161
e757bb10
AD
131622004-09-03 Akim Demaille <akim@epita.fr>
13163
13164 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
13165 invoked, yydestruct the lookahead.
13166 * tests/calc.at (Calculator $1): Update the expected lengths of
13167 traces: there is an added line for the discarded lookahead.
13168 * doc/bison.texinfo (Destructor Decl): Some rewording.
13169 Define "discarded" symbols.
13170
0fe1f06d
AD
131712004-09-02 Akim Demaille <akim@epita.fr>
13172
13173 * data/lalr1.cc (translate_, destruct_): No reason to be static.
13174
284acc8b
AD
131752004-09-02 Akim Demaille <akim@epita.fr>
13176
13177 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
13178 (YYDSYMPRINTF): Rename as...
13179 (YY_SYMBOL_PRINT): this.
13180 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
13181 two.
13182 Use it instead of direct symprint_ calls.
13183 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
13184 one.
13185
a5eb1ed2
AD
131862004-09-02 Akim Demaille <akim@epita.fr>
13187
b7c72fe1
AD
13188 * data/lalr1.cc (b4_yysymprint_generate): New.
13189 (symprint_): New member function, defined when YYDEBUG.
13190 Use it consistently instead of token/nterm debugging output by
13191 hand.
a5eb1ed2
AD
13192 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
13193 %printer calls to use cdebug_ when using lalr1.cc.
13194
417141dd
AD
131952004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
13196
13197 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
13198 with #ifdef YYDEBUG.
13199
2fa09258
AD
132002004-08-26 Akim Demaille <akim@epita.fr>
13201
13202 * doc/bison.texinfo (Implementing Loops): Rename as...
13203 (Implementing Gotos/Loops): this.
13204
9378b508
PE
132052004-08-13 Paul Eggert <eggert@cs.ucla.edu>
13206
13207 Adjust to latest gnulib.
13208 * bootstrap (gnulib_modules): Add xalloc-die.
13209 Set LC_ALL=C so that file names sort consistently.
13210 Prefer the gnulib copies of gettext.m4, glibc21.m4,
13211 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
13212 uintmax_t.m4, ulonglong.m4.
13213 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
13214 po.m4 since we are now using _gl.m4 instead.
13215
87a8ad5c
PE
132162004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
13217
13218 * src/scan-action.l: Remove. Scanning of semantic actions is
13219 handled in scan-gram.l.
13220
dca81a78
PE
132212004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
13222
13223 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
13224
13225 * src/location.h (struct): The file member is a uniqstr.
13226 (equal_boundaries): Use UNIQSTR_EQ for comparison.
13227
c9cbf7c5
PE
132282004-07-22 Paul Eggert <eggert@cs.ucla.edu>
13229
13230 Fix bug with non-%union parsers that have printers or destructors,
13231 which led to a Bison core dump. Reported by Peter Fales in
13232 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 13233
c9cbf7c5
PE
13234 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
13235 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
13236 not to our own type.
13237 * src/output.c (symbol_destructors_output, symbol_printers_output):
13238 Don't assume %union.
13239 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
13240 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
13241 UNION-FLAG. All callers changed.
13242 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
13243 Use type char, not unsigned int, when declaring an array of char;
13244 this lets us remove a cast.
13245 (Printers and Destructors): Add non-%union test cases.
13246
fa7e68c3
PE
132472004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13248
13249 * doc/bison.texinfo: Minor editorial changes, mostly to the new
13250 GLR writeups. E.g., avoid frenchspacing and the future tense,
13251 change "lookahead" to "look-ahead", and change "wrt" to "with
13252 respect to".
2fa09258 13253
fa7e68c3
PE
132542004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13255
13256 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
13257 New sections, split off from the GLR Parsers section. Put the new
13258 Simple GLR Parser near the start of the GLR section, for clarity.
13259 Rewrite connective text.
13260
99a9344e
PE
132612004-06-21 Frank Heckenbach <frank@g-n-u.de>
13262
13263 * doc/bison.texinfo (Simple GLR Parsers): New section.
13264
8dd162d3
PE
132652004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13266
13267 * NEWS, TODO, doc/bison.texinfo:
13268 Use "look-ahead" instead of "lookahead", to be consistent.
13269 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
13270 while we're fixing "look-ahead".
13271 * src/conflicts.c (shift_set): Renamed from shiftset.
13272 (look_ahead_set): Renamed from lookaheadset.
13273 * src/print.c: Likewise.
13274 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
13275 name for "lookahead".
13276 (report_types, usage): Likewise.
13277 * src/getargs.h (report_look_ahead_tokens): Renamed from
13278 report_lookaheads.
13279 * src/lalr.c (compute_look_ahead_tokens): Renamed from
13280 compute_lookaheads.
13281 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
13282 (look_ahead_tokens_print): Renamed from lookaheads_print.
13283 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
13284 state_rule_lookaheads_print.
13285 * src/state.h: Likewise.
13286 (reductions.look_ahead_tokens): Renamed from lookaheads.
13287 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
13288 AT_DATA_LOOKAHEADS_GRAMMAR.
13289
57a90331
PE
132902004-06-03 Paul Eggert <eggert@cs.ucla.edu>
13291
13292 * README: Update location of patched M4 distribution.
13293
8ed3234a
PE
132942004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
13295
13296 Don't assume the C++ compiler takes the same arguments as the C compiler
13297 (trivial change).
13298 * configure.ac (O0CXXFLAGS): New var.
13299 * tests/atlocal.in (CXXFLAGS): Use it.
13300
07971983
PE
133012004-05-29 Paul Eggert <eggert@cs.ucla.edu>
13302
13303 Fix some "make check" problems with C++ reported by
13304 Albert Chin-A-Young for Tru64 C++ in this thread:
13305 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
13306
13307 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
13308 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13309 Output to a .cc file for C++, not to a .c file.
13310 * tests/calc.at (AT_CHECK_CALC): Likewise.
13311 * tests/regression.at (AT_CHECK_DANCER): Likewise.
13312 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
13313
29058652
PE
133142004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
13315
13316 * tests/calc.at, tests/actions.at: Workaround for SGI
13317 C++ compiler. (trivial change)
13318
62cb8a99
PE
133192004-05-27 Paul Eggert <eggert@cs.ucla.edu>
13320
fd418816
PE
13321 Spent a few hours checking out which prerequisite versions the
13322 current sources actually require. I went all the way back to
13323 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
13324 a seemingly endless set of combinations of versions more recent
13325 than that. The bottom line is that the current sources require
13326 fairly recent versions of the build tools, and it'll be some work
13327 to change this.
13328 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
13329 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
13330 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
13331 Add comments explaining why those particular versions are
13332 currently needed.
2fa09258 13333
62cb8a99
PE
13334 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
13335 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 13336 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
13337
13338 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
13339 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
13340
caa52c10
PE
133412004-05-26 Paul Eggert <eggert@cs.ucla.edu>
13342
13343 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
13344 0.11.5. Suggested by Bruno Haible.
13345 * bootstrap: Remove gettext version checking.
13346
13347 * doc/bison.texinfo (Decl Summary): Also mention that %union
13348 can depend on prerequisite types. Problem reported by Tim
13349 Van Holder.
13350
4bfd5e4e
PE
133512004-05-25 Paul Eggert <eggert@cs.ucla.edu>
13352
2cef3017
PE
13353 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
13354 * README-alpha: Don't tell people not to package this.
13355
b9c85d5c
PE
13356 * bootstrap: Don't assume $(...) works; use `...` instead.
13357 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
13358 gettext better.
13359
4bfd5e4e
PE
13360 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
13361 put into the -d output file, and mention what to do if YYSTYPE is
13362 defined as a macro.
13363
6a36ff94
PE
133642004-05-24 Paul Eggert <eggert@cs.ucla.edu>
13365
6712933e
PE
13366 Undo change made earlier today: it caused autopoint to not bring
13367 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
13368 autopoint's.
13369
13370 * bootstrap: Check that gettext version matches what's in
13371 configure.ac. Warn users to ignore robots.txt ERROR 404.
13372 * bootstrap: Undo today's earlier change (logged below).
13373 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 13374
6a36ff94
PE
13375 The gettext version checking is causing more trouble than it's
13376 curing; remove it. Problem reported by Paul Hilfinger.
13377
13378 * bootstrap: Issue a warning that one can expect a message
13379 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
13380 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
13381
209ea708
PE
133822004-05-23 Paul Eggert <eggert@cs.ucla.edu>
13383
13384 Ensure that the C++ compiler used for testing actually works on a
13385 simple test program; if not, skip the C++-related tests. Problem
13386 reported by Vin Shelton in:
161a71f3 13387 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
13388
13389 * m4/cxx.m4: New file.
13390 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
13391 * tests/atlocal.in (BISON_CXX_WORKS): Add.
13392 * tests/local.at (AT_COMPILE_CXX): Use it.
13393
41ca2549
PE
133942004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13395
383e69dc
PE
13396 * data/glr.c (yylloc): Output this macro even if locations are not
13397 being generated, as the GLR parser needs it even in that case.
13398 Problem reported by Troy A. Johnson
13399 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
13400
41ca2549
PE
13401 * configure.ac (AC_INIT): Update to 1.875e.
13402
e476c87d
PE
134032004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13404
13405 * NEWS: Version 1.875d.
13406 * configure.ac (AC_INIT): Likewise.
13407 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
13408
13409 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
13410 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
13411 lalr1.cc runs afoul of the first, and the last two are no longer
13412 supported by GCC 3.4.0.
13413 * README: Mention GNU m4 1.4 or later; mention m4 patches.
13414 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
13415
233a88ad
PE
134162004-05-06 Paul Eggert <eggert@cs.ucla.edu>
13417
13418 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
13419 unsigned int, for compatibility with latest gnulib hash module.
13420 * src/state.c (state_hash, state_hasher): Likewise.
13421 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
13422 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 13423
12ffdd28
PE
134242004-05-03 Paul Eggert <eggert@cs.ucla.edu>
13425
13426 * NEWS: Unescaped newlines are no longer allowed in char & strings.
13427
13428 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
13429 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
13430 character and string literals.
13431 (unexpected_end): New function.
13432 (unexpected_eof): Use it.
13433 (unexpected_newline): New function.
13434 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
13435 actions.
e476c87d 13436
12ffdd28
PE
13437 * NEWS: Document %expect-rr.
13438
13439 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
13440 Fix typo by replacing $1 with $option.
13441 Remove more 'intl'-related files.
9668e2be 13442 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
13443
13444 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
13445 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
13446 strtoul.c.
13447 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
13448 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
13449 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
13450 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
13451 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
13452 * src/.cvsignore: Add *.output.
13453
13454 * src/parse-gram.y: Put copyright notice inside %{ %} so it
13455 gets copied to the output file.
e476c87d 13456
1f65350a
PE
134572004-04-28 Paul Eggert <eggert@twinsun.com>
13458
13459 Get files from the gnulib and po repositories, instead of relying
13460 on them being in our CVS. Upgrade to latest versions of gnulib
13461 and Automake.
13462
13463 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
13464 * bootstrap: Bootstrap from gnulib and po repositories.
13465 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
13466 * README-cvs: Document these changes. Remove version numbers from
13467 mentions of build tools, since they change so often. Mention Flex.
13468
13469 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
13470 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
13471 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
13472 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 13473 does this for us.
12ffdd28
PE
13474 (AC_ISC_POSIX): Remove; we no longer support this
13475 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
13476 (AC_HEADER_STDC): Remove: we now assume C89 or better.
13477 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
13478 Do not check for C89 headers, except for locale.h which is used
13479 by the Yacc library and must port to K&R hosts.
13480 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
13481 Do not check for C89 functions, except for setlocale which is
13482 used by the Yacc library.
13483 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
13484 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
13485 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
13486 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
13487 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
13488 AM_GNU_GETTEXT): Remove; now done by:
13489 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
13490 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
13491 for us.
13492
13493 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
13494 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
13495 Define to empty, as gnulib.mk will do the rest for us.
13496 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
13497 for us.
13498 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
13499 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
13500
13501 * src/files.c: Include gnulib's xstrndup.h.
13502
13503 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
13504 (REALLOC): Use xnrealloc, for likewise.
13505 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
13506 (strnlen, memrchr): Remove decls; functions no longer used.
13507 Include <stpcpy.h>.
13508
13509 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
13510 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13511 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
13512 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
13513 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
13514 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
13515 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
13516 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
13517 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
13518 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
13519 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
13520 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13521 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
13522 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
13523 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
13524 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
13525 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
13526 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
13527 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
13528 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
13529 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
13530 Remove, as these files are now generated automatically
13531 by bootstrap or automake.
13532
13533 * po/ChangeLog: Remove: all but one entry was a duplicate
13534 of this file, and I moved that 2000-11-02 entry here.
13535
13536 * config/.cvsignore: Add Makefile, depcomp, install-sh.
13537 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
13538 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
13539 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
13540 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
13541 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
13542 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
13543 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
13544 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
13545 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
13546 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
13547 xstrndup.h.
13548 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
13549 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
13550 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
13551 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
13552 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
13553 * src/.cvsignore: Remove *_.c.
13554
13555
13556 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
13557 support it. (The latest stable gzip doesn't.)
13558
135592004-04-27 Paul Eggert <eggert@twinsun.com>
13560
13561 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
13562 case, as stos_ is now used by destructors due to the 2004-02-09
13563 change.
13564
13565 Remove more K&R C support.
13566 * lib/libiberty.y (PARAMS): Remove. All uses removed.
13567 * lib/subpipe.c (errno): Remove decl.
13568 Include <stdlib.h> unconditionally.
13569 (EXIT_FAILURE): Remove macro.
13570 * src/complain.c (vfprintf, strerror): Remove.
13571 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
13572 unconditionally.
13573 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
13574 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
13575 (strchr, strspn, memchr): Remove decls.
13576 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
13577 unconditionally. Do not declare perror.
13578 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
13579 unconditionally.
13580
13581 * src/complain.c (_): Remove useless defn, as system.h defines this.
13582
13583 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
13584 with latest obstack.h.
13585 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
13586 to procedure types, as obstack.h now does that for us.
13587 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
13588
13589 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
13590 so that this include file can stand alone.
13591 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
13592 does this now. Include subpipe.h first after config.h, to
13593 test whether it can stand alone.
13594
13595 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
13596 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
13597 unused declaration.
13598
13599 * tests/synclines.at (%union synch line): Put a dummy member in
13600 the union, because empty unions aren't allowed in C. Caught
13601 by GCC 3.4.0.
13602
4f16766c
PE
136032004-04-13 Jim Meyering <jim@meyering.net>
13604
13605 * src/conflicts.c (conflicts_print): Correct format string typo:
13606 use `%%' to produce literal `%'. (trivial change)
13607
779e7ceb
PE
136082004-03-30 Paul Eggert <eggert@twinsun.com>
13609
13610 * src/getargs.c (version): Update copyright year to 2004.
13611
13612 * data/c.m4 (b4_int_type): Use 'short int' rather than
13613 'short', and similarly for 'long', 'unsigned', etc.
13614 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13615 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
13616 yy_yypstack, yydumpstack): Likewise.
13617 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
13618 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
13619 Likewise.
13620 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
13621 yy_stack_print, yyparse): Likewise.
13622 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
13623 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
13624 * lib/bitset.c (bitset_print): Likewise.
13625 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
13626 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13627 * lib/bitsetv.c (bitsetv_dump): Likewise.
13628 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
13629 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
13630 Likewise.
13631 * src/LR0.c (allocate_itemsets): Likewise.
13632 * src/gram.h (rule_number, rule): Likewise.
13633 * src/lalr.h (goto_number): Likewise.
13634 * src/nullable.c (nullable_compute): Likewise.
13635 * src/output.c (prepare_rules): Likewise.
13636 * src/relation.c (relation_print, relation_digraph): Likewise.
13637 * src/relation.h (relation_node): Likewise.
13638 * src/state.h (state_number, transitions, errs, reductions,
13639 struct state): Likewise.
13640 * src/symtab.h (symbol_number, struct symbol): Likewise.
13641 * src/tables.c (vector_number, tally, action_number,
13642 default_goto, goto_actions): Likewise.
13643 * tests/existing.at (GNU Cim Grammar): Likewise.
13644 * tests/regression.at (Web2c Actions): Likewise.
13645
13646 * src/output.c (muscle_insert_short_int_table): Renamed from
13647 muscle_insert_short_table. All uses changed.
13648
d6328241
PH
136492004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
13650
13651 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
13652 (declaration): Replace expected_conflicts with expected_sr_conflicts.
13653 Add %expect-rr rule.
4f16766c 13654
d6328241
PH
13655 * src/scan-gram.l: Recognize %expect-rr.
13656
4f16766c 13657 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 13658 expected_conflicts.
4f16766c 13659 (expected_rr_conflicts): Declare.
d6328241
PH
13660
13661 * src/conflicts.c (expected_sr_conflicts): Rename from
13662 expected_conflicts.
13663 (expected_rr_conflicts): Define.
13664 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
13665 for GLR parsers.
13666 Use expected_sr_conflicts in place of expected_conflicts.
13667 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 13668
d6328241 13669 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 13670
1452af69
PE
136712004-03-08 Paul Eggert <eggert@gnu.org>
13672
13673 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 13674 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
13675
13676 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
13677 in lalr1.cc.
13678 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
13679 * src/scan-gram.l (scan_integer): New function.
13680 ({int}): Use it.
13681 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
13682 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
13683 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
13684 Say "long int", not "long", for uniformity with GNU style.
13685
006d217d
PE
136862004-02-25 Paul Eggert <eggert@twinsun.com>
13687
13688 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
13689 compilers. This fixes a problem with Intel's C++ compiler being
13690 chatty, reported by Guido Trentalancia in
161a71f3 13691 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 13692
c2729758
ADL
136932004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
13694
13695 Support %destructor and merge error locations in lalr1.cc.
13696
13697 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
13698 (Parser::stos_): Define unconditionally.
13699 (Parser::destruct_): New method. Generate its body with
13700 b4_yydestruct_generate.
13701 (Parser::error_start_): New attribute.
13702 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
13703 token which are discarded.
13704 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
13705 error_start_ when erroneous token are discarded.
13706 (Parser::parse) <yyerrlab1>: Compute the location of the error
13707 token so that it covers all the discarded tokens.
13708 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
13709 it can be called with `%skeleton "lalr1.cc"', and do that.
13710
dd0e0635
PE
137112004-02-02 Paul Eggert <eggert@twinsun.com>
13712
13713 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
13714 $(top_srcdir)/lib and ../lib. This fixes a bug reported
13715 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
13716 There's no need to mention top_builddir since Automake does that
13717 for us.
13718 (INCLUDES): Remove, as Automake says it's obsolescent.
13719 Contents migrated into AM_CPPFLAGS as described above.
13720 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
13721
137222004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13723
13724 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
13725 (yyreportSyntaxError): Handle case where lookahead token is
13726 YYEMPTY.
13727
be16239b
PH
137282004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13729
13730 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
13731 resulting parsers are compilable with C++.
13732
5fa90832
PE
137332003-12-23 Paul Eggert <eggert@twinsun.com>
13734
13735 * config/depcomp, config/install-sh: Sync with Automake 1.8.
13736 * src/output.c (output_skeleton): Rename local var.
13737 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
13738 Bison tokens, as this runs afoul of the 2003-10-07 change that
13739 disallowed NUL bytes in character constants or string literals.
13740
13741 * tests/local.at: Require Autoconf 2.59's Autotest.
13742 * tests/testsuite.at: Don't include local.at, since we now assume
13743 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
13744 including it.
13745 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
13746 multiple inclusion warnings.
dd0e0635 13747
b165c324
AD
137482003-12-02 Akim Demaille <akim@epita.fr>
13749
13750 * doc/bison.texinfo (How Can I Reset the Parser): More about start
13751 conditions.
13752 From Bruno Haible.
13753
26e06a21
ADL
137542003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
13755
13756 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
13757
92ac3705
PE
137582003-10-07 Paul Eggert <eggert@twinsun.com>
13759
6a5ecb38
PE
13760 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
13761 if testsuite doesn't exist.
13762
92ac3705
PE
13763 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
13764 literals, unfortunately.
13765 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
13766 Complain about NUL bytes in character constants or string literals.
13767
91d2c560
PE
137682003-10-05 Paul Eggert <eggert@twinsun.com>
13769
13770 * NEWS: Don't document %no-default-prec, as it's still
13771 too experimental.
13772 * doc/bison.texinfo: Document %no-default-prec only if
13773 the defaultprec flag is set. Normally it's not.
13774
0cc3da3a
PE
137752003-10-04 Paul Eggert <eggert@twinsun.com>
13776
13777 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
13778 non-modifiable lvalue, instead of a modifiable one.
13779 * doc/bison.texinfo (Actions): Document that $$ can
13780 be assigned to. Do not claim that $$ and $N are
13781 array element references: user code should not rely on this.
13782
22fccf95
PE
137832003-10-01 Paul Eggert <eggert@twinsun.com>
13784
13785 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
13786 (grammar_declaration): Use it.
13787 * src/scan-gram.l: New token %no-default-prec.
13788 * tests/conflicts.at: Revamp tests to use %no-default-prec.
13789 * NEWS, doc/bison.texinfo: Document the above.
13790
fc8f2965
AD
137912003-10-01 Akim Demaille <akim@epita.fr>
13792
13793 VCG no longer supports long_straight_phase.
13794
13795 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
13796 * src/print_graph.c (print_graph): Adjust.
13797
39a06c25
PE
137982003-09-30 Frank Heckenbach <frank@g-n-u.de>
13799 and Paul Eggert <eggert@twinsun.com>
13800
13801 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
13802 Table of Symbols): Document %default-prec.
13803 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
13804 (grammar_declaration): Set default_prec on %default-prec.
13805 * src/scan-gram.l (%default-prec): New token.
13806 * src/reader.h (default_prec): New flag.
13807 * src/reader.c: Likewise.
13808 (packgram): Handle it.
13809 * tests/conflicts.at (%default-prec without %prec,
13810 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 13811
39a06c25
PE
138122003-09-30 Paul Eggert <eggert@twinsun.com>
13813
13814 * tests/testsuite.at: Include local.at, not input.at, fixing
13815 a typo in the 2003-08-25 patch.
13816
62b6aef9
AD
138172003-08-27 Akim Demaille <akim@epita.fr>
13818
13819 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
13820 GCC warnings.
13821
89e1cc61
AD
138222003-08-26 Akim Demaille <akim@epita.fr>
13823
13824 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
13825 "<\#" to avoid magic from Gnus when posting parts of this script.
13826
a08460b0
AD
138272003-08-26 Akim Demaille <akim@epita.fr>
13828
13829 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
13830 (Parser::parse): here.
13831 Adjust: nerrs and errstatus is now replaced by...
13832 (Parser::nerrs_, Parser::errstatus_): New.
13833
603f1cfd
AD
138342003-08-25 Akim Demaille <akim@epita.fr>
13835
13836 * config/announce-gen, Makefile.cfg: New.
13837 * Makefile.am: Adjust.
13838 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
13839 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
13840
cd3684cf
AD
138412003-08-25 Akim Demaille <akim@epita.fr>
13842
13843 When reducing initial empty rules, Bison parser read an initial
13844 location that is not defined. This results in garbage, and that
13845 affects Bison's own parser. Therefore we need (i) to extend Bison
13846 to support a means to initialize this location, and (ii) to use
13847 this CVS Bison to fix CVS Bison's parser.
13848
13849 * src/reader.h, reader.c (epilogue_augment): Remove, replace
13850 with...
13851 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
13852 * src/parse-gram.y: Adjust.
13853 (%initial-action): New.
13854 (%error-verbose): Since we require CVS Bison, there is no reason
13855 not to use it.
13856 * src/scan-gram.l: Adjust.
13857 * src/Makefile.am (YACC): New, to make sure we use our own parser.
13858 * data/yacc.c (yyparse): Use b4_initial_action.
13859
4e03e201
AD
138602003-08-25 Akim Demaille <akim@epita.fr>
13861
13862 * doc/bison.texinfo: Don't promote stdout for error messages.
13863
8c182d05
AD
138642003-08-25 Akim Demaille <akim@epita.fr>
13865
13866 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
13867 From Alexandre Duret-Lutz.
13868
6a60c4cf
PE
138692003-08-25 Akim Demaille <akim@epita.fr>
13870
13871 Version 1.875c.
13872
25f66e1a
AD
138732003-08-25 Akim Demaille <akim@epita.fr>
13874
13875 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
13876 Use them.
13877
5348bfbe
AD
138782003-08-25 Akim Demaille <akim@epita.fr>
13879
13880 * data/lalr1.cc (Parser::reduce_print_): New.
13881 Use it.
13882
47301314
AD
138832003-08-25 Akim Demaille <akim@epita.fr>
13884
13885 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
13886 error recovery loops. This patch is based on
161a71f3 13887 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
13888 Also, augment the similarity between lalr1.cc and yacc.c.
13889 Note: the locations of error recovery rules are not correct yet.
13890
13891 * data/lalr1.cc: Comment changes to augment the similarity between
13892 lalr1.cc and yacc.c.
13893 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
13894 (yyerrlab1): Remove, but where it used to be (now the bottom part of
13895 yyerrlab), when hitting EOF, pop the whole stack here instead of
13896 merely falling thru the default error handling mechanism.
13897 (yyerrorlab): New label, with the old contents of YYERROR,
13898 plus the following change: pop the stack of rhs corresponding
13899 to the production that invoked YYERROR. That is how Yacc
13900 behaves (required by POSIX).
13901 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
13902 fail.
13903
1f7a61ff
AD
139042003-08-25 Akim Demaille <akim@epita.fr>
13905
13906 Tune local.at so that people can "autom4te -l autotest calc.at -o
13907 calc" for instance, to extract a sub test suite.
13908
13909 * tests/testsuite.at: Move the initialization, Autotest version
13910 requirement, and AT_TESTED invocation into...
13911 * tests/local.at: here.
13912 * tests/testsuite.at: Include it for compatibility with Autoconf
13913 2.57.
13914 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
13915 be ignore.
13916
327b5b56
PE
139172003-08-04 Paul Eggert <eggert@twinsun.com>
13918
13919 Rework code slightly to avoid gcc -Wtraditional warnings.
13920 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
13921 The returned value is now stored in *YY0. All callers changed.
13922 * src/output.c (merge_output): Adjust to the above change.
13923
0051e3ed
PE
139242003-07-26 Paul Eggert <eggert@twinsun.com>
13925
13926 * data/glr.c (YYASSERT): New macro.
13927 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
13928 yyresolveStates, yyprocessOneStack):
13929 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
13930 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 13931
137437c6
PE
139322003-07-25 Paul Eggert <eggert@twinsun.com>
13933
5b620e06
PE
13934 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
13935 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 13936 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
13937 by Frank Heckenbach, though I have omitted the structure-initialization
13938 part of his glr-knr.diff patch since I recall that the Portable
13939 C Compiler didn't require that change.
13940
137437c6
PE
13941 Let the user specify how to allocate and free memory.
13942 Derived from a suggestion by Frank Heckenbach in
161a71f3 13943 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
13944 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
13945 All uses of free, malloc, realloc changed to use these macros,
13946 and unnecessary casts removed.
13947 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
13948
ddb85ca5
PE
139492003-07-06 Matthias Mann <MatthiasMann@gmx.de>
13950
13951 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
13952 use s.empty() rather than s == "" to test for empty string; see
161a71f3 13953 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
13954 (trivial change)
13955
39910e09
AD
139562003-06-25 Akim Demaille <akim@epita.fr>
13957
13958 * config/depcomp, config/install-sh: Update from masters.
13959
0ae99356
PE
139602003-06-20 Paul Eggert <eggert@twinsun.com>
13961
13962 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
13963 and return properly parenthesized result.
13964 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
13965 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13966 Remove unnecessary parentheses from uses.
13967 * doc/bison.texinfo (Location Default Action): Describe the
13968 conventions for parentheses.
13969
cd05d13c
PE
139702003-06-19 Paul Eggert <eggert@twinsun.com>
13971
81fd08ca
PE
13972 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
13973 yyreportTree): Do not assume that size_t is the same width as int,
13974 when printing sizes. Print sizes using an unsigned format.
13975 Problem reported by Frank Heckenbach in
161a71f3 13976 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 13977
cd05d13c
PE
13978 Port to Forte Developer 7 C compiler.
13979 * data/glr.c (struct YYLTYPE): If locations are not being used,
13980 declare a single dummy member, as empty structs do not conform
13981 to the C standard.
13982 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
13983 the Forte Developer 7 C compiler complains that end-of-loop
13984 code is not reached.
13985
4dcf140b
PE
139862003-06-17 Paul Eggert <eggert@twinsun.com>
13987
13988 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
13989 avoid warnings from picky compilers about redefinition of PARAMS.
13990
8dd76bee
PE
139912003-06-17 Paul Eggert <eggert@twinsun.com>
13992
13993 Version 1.875b.
13994
13995 * NEWS: Document 1.875b.
13996
13997 * lib/bbitset.h: Do not include config.h; that's the includer's job.
13998 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
13999 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
14000 Don't use 'index' in comments, as it's a builtin fn on some hosts.
14001 * lib/bitset_stats.c: Include gettext.h unconditionally, as
14002 per recent gettext manual's suggestion.
14003 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
14004 Use prototypes, not old-style definitions.
14005 * lib/lbitset.c (lbitset_unused_clear): Likewise.
14006 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
14007 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
14008 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
14009 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
14010 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
14011 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
14012 vbitset_or_and_cmp, vbitset_copy): Likewise.
14013
14014 * lib/libiberty.h: Do not include config.h; that's the includer's job.
14015 Do not include <stdlib.h>.
14016 (PARAMS): Define unconditionally for C89.
14017 (ATTRIBUTE_NORETURN): Remove.
14018 (ATTRIBUTE_UNUSED): Define unconditionally.
14019
14020 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 14021 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
14022 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
14023 * lib/vbitset.c, lib/vbitset.h: New files.
14024 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14025 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
14026 from libbitset.
14027
14028 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
14029 `How Can I Reset @code{yyparse}', since texinfo does not allow
14030 arbitrary @ in node names.
14031
14032 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
14033 shouldn't be needed according to the gettext 0.12.1 documentation
14034 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 14035 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 14036 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 14037 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 14038
8dd76bee
PE
14039 * lib/.cvsignore: Add stdbool.h.
14040 * m4/.cvsignore: Add nls.m4, po.m4.
14041
14042 Upgrade to CVS gnulib.
14043 * stdbool_.h: File renamed from stdbool.h.in.
14044 * configure.ac (AM_STDBOOL_H): Invoke this instead of
14045 AC_HEADER_STDBOOL.
14046 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
14047 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
14048 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
14049 (MOSTLYCLEANFILES): New var.
14050 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
14051 (stdbool.h): New rule.
14052 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
14053 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
14054 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
14055 m4/quote.m4: Upgrade to today's gnulib.
14056
14057 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
14058 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
14059 the tests right now.
14060 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
14061 yyerror are declared before use; C99 requires this.
14062
25005f6a
PH
140632003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14064
14065 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
14066 first.
14067 (yyrecoverSyntaxError): Correct the logic for setting and testing
14068 yyerrState.
14069 Correct comment on handling EOF.
14070 Allow states with only a default reduction, rather than failing
8dd76bee 14071 (I can't quite reconstruct why these were not allowed before).
25005f6a 14072
137437c6 14073 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 14074 buffer overruns, corrupting state.
8dd76bee
PE
14075
14076 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
14077 definition.
14078 * src/reader.h (max_left_semantic_context): New variable declaration.
14079 * src/scan-gram.l (max_left_semantic_context): Define.
14080 (handle_action_dollar): Update max_left_semantic_context.
14081 * data/glr.c (YYMAXLEFT): New definition.
14082 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
14083 (yyresolveAction): Ditto.
14084
14085 Fixes to problems with location handling in GLR parsers reported by
14086 Frank Heckenbach (2003/06/05).
14087
14088 * data/glr.c (YYLTYPE): Make trivial if locations not used.
14089 (YYRHSLOC): Add parentheses, and define only if locations used.
14090 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
14091 locations not used.
14092 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
14093 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 14094
25005f6a
PH
14095 * tests/cxx-type.at: Exercise location information; update tests
14096 to differentiate output with and without locations.
8dd76bee 14097 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
14098 because default YYLTYPE not yet defined.
14099 Change semantic actions to compute strings, rather than printing
14100 them directly (to test proper passing of semantics values). Change
14101 output to prefix notation and update test data and expected results.
14102 (yylex): Track locations.
14103 (stmtMerge): Return value rather than printing, and include arguments
14104 in value.
8dd76bee 14105
711f40b7
PE
141062003-06-03 Paul Eggert <eggert@twinsun.com>
14107
14108 Avoid warnings generated by GCC 2.95.4 when Bison is
14109 configured with --enable-gcc-warnings.
14110 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
14111 yy::]b4_parser_class_name[::translate_,
14112 yy::Stack::operator[] (unsigned),
14113 yy::Stack::operator[] (unsigned) const,
14114 yy::Slice::operator[] (unsigned),
14115 yy::Slice::operator[] (unsigned) const):
14116 Rename local vars to avoid warnings.
14117 * tests/glr-regression.at (Improper handling of embedded actions
14118 and $-N in GLR parsers): Remove unused local variable from yylex.
14119 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
14120 (void) as arg when not pure, since we now assume C89 when building
14121 Bison. Pacify GCC by using parameter.
14122
ac695f7d
PE
141232003-06-02 Paul Eggert <eggert@twinsun.com>
14124
14125 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
14126 yy::Location::lines, yy::Location::columns): Rename arguments
14127 to avoid shadowing; this removes a warning generated by GCC 3.3.
14128
26ec81e0
PE
141292003-06-01 Paul Eggert <eggert@twinsun.com>
14130
14131 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
14132 to g++, as GCC 3.3 complains if you do it.
14133 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
14134 everything that WARNING_CFLAGS has, except omit warnings
14135 not suitable for C++.
14136 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
14137 * tests/atlocal.in (CXXFLAGS): New var.
14138 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
14139
14140 Fix a GLR parser bug I reported in February; see
161a71f3 14141 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
14142 The problem was that GLR parsers did not conform to the C standard,
14143 because actions like { $1 = $2 + $3; } expanded to expressions
14144 that invoked YYFILL in separate subexpressions, and YYFILL assigned
14145 to a local variable. The C standard says that expressions
14146 like (var = f ()) + (var = f ()) have undefined behavior.
14147 Another problem was that GCC sometimes issues warnings that
14148 yyfill and its parameters are unused.
14149
14150 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
14151 as possibly unused.
14152 (yyfill): New function.
14153 (YYFILL): Use it.
14154 (yyuserAction): Change type of yynormal to bool, so that it matches
14155 the new yyfill signature. Mark it as possibly unused.
14156
14157
14158 Follow up on a bug I reported in February, where a Bison-generated
14159 parser can loop. Provide a test case and a fix for yacc.c. I
14160 don't have a fix for lalr1.cc or for glr.c, unfortunately.
14161 The original bug report is in:
161a71f3 14162 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
14163
14164 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
14165 macro's size was becoming unwieldy.
14166 (yyerrlab): Do not discard an empty lookahead symbol, as this
14167 might destroy garbage.
14168 (yyerrorlab): New label, with the old contents of YYERROR,
14169 plus the following change: pop the stack of rhs corresponding
14170 to the production that invoked YYERROR. That is how Yacc
14171 behaves, and POSIX requires this behavior.
14172 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
14173 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
14174 Define 'alarm' to do nothing if unistd.h is not available.
14175 Add a new rule "exp: '-' error;" to test the above change to
14176 data/yacc.c. Use 'alarm' to abort any test taking longer than
14177 10 seconds, as it's probably looping.
14178 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
14179 Also, the new yacc.c generates two fewer diagnostics for an
14180 existing test.
14181
d0829076
PE
141822003-05-24 Paul Eggert <eggert@twinsun.com>
14183
c6ae27df
PE
14184 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
14185 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
14186 This fixes a problem reported by John Bowman when the Compaq/HP
14187 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
14188 -ansi -Wall -gall).
14189 * data/yacc.c (union yyalloc): Likewise.
14190 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 14191
d0829076
PE
14192 Switch from 'int' to 'bool' where that makes sense.
14193
14194 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
14195 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
14196 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
14197 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
14198 Return or accept bool, not int. All callers changed.
14199 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
14200 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
14201 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
14202 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
14203 bitset_or_and_cmp_): Likewise.
14204 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
14205 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
14206 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
14207 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
14208 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
14209 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
14210 bitset_stats_or_and_cmp): Likewise.
14211 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
14212 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
14213 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
14214 ebitset_xor_cmp): Likewise.
14215 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
14216 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
14217 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
14218 lbitset_xor_cmp): Likewise.
14219 * lib/bbitset.h: Include <stdbool.h>.
14220 (struct bitset_vtable): The following members now return bool, not
14221 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
14222 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
14223 or_and_cmp).
14224 * src/conflicts.c (count_rr_conflicts): Likewise.
14225 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
14226 All uses changed.
14227 * lib/ebitset.c (ebitset_obstack_init): Likewise.
14228 * lib/lbitset.c (lbitset_obstack_init): Likewise.
14229 * src/getargs.c (debug_flag, defines_flag, locations_flag,
14230 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14231 graph_flag): Likewise.
14232 * src/getargs.h (debug_flag, defines_flag, locations_flag,
14233 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14234 graph_flag): Likewise.
14235 * src/output.c (error_verbose): Likewise.
14236 * src/output.h (error_verbose): Likewise.
14237 * src/reader.c (start_flag, typed): Likewise.
14238 * src/reader.h (typed): Likewise.
14239 * src/getargs.c (LOCATIONS_OPTION): New constant.
14240 (long_options, getargs): Use it.
14241 * src/lalr.c (build_relations): Use bool, not int.
14242 * src/nullable.c (nullable_compute): Likewise.
14243 * src/print.c (print_reductions): Likewise.
14244 * src/tables.c (action_row, pack_vector): Likewise.
14245 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
14246 * src/output.c (prepare): Use it.
14247 * src/output.c (token_definitions_output,
14248 symbol_destructors_output, symbol_destructors_output): Use string,
14249 not boolean integer, to keep track of whether to output separator.
14250 * src/print_graph.c (print_core): Likewise.
14251 * src/state.c (state_rule_lookaheads_print): Likewise.
14252
14253 * config/install-sh: Sync from automake 1.7.5.
14254
6b2584b7
PE
142552003-05-14 Paul Eggert <eggert@twinsun.com>
14256
14257 * src/parse-gram.y (rules_or_grammar_declaration): Require a
14258 semicolon after a grammar declaration, in the interest of possible
14259 future changes to the Bison input language.
14260 Do not allow a stray semicolon at the start of the grammar.
14261 (rhses.1): Allow one or more semicolons after any rule, including
14262 just before "|" as required by POSIX.
14263 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
14264 grammar.
14265
caf37a36
ADL
142662003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
14267
14268 %parse-param support for lalr1.cc.
14269
14270 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
14271 b4_cc_constructor_calls, b4_cc_constructor_call,
14272 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
14273 definitions.
14274 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
14275 parse-param arguments.
14276 (yy::b4_parser_class_name): Declare instance variables to
14277 hold parse-param arguments.
14278 * tests/calc.at: s/value/semantic_value/ because value clashes
14279 with a member of yy::b4_parser_class_name. Adjust C++ code
14280 to handle %parse-param. Enable %parse-param test in C++.
14281
3ab37077
PE
142822003-05-12 Paul Eggert <eggert@twinsun.com>
14283
14284 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
14285 English a bit. Fix fclose typo. Change "const char" to "char
14286 const", and use ANSI C rather than K&R for "main". Suggest
14287 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
14288 and suggest yy_switch_to_buffer.
14289
142902003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
14291
14292 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
14293 C89. This avoids a diagnostic on compilers that define __STDC__
14294 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 14295 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 14296
e743727f
PE
142972003-05-03 Paul Eggert <eggert@twinsun.com>
14298
14299 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
14300 Do not overrun array bounds.
14301 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 14302 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 14303
916708d5
AD
143042003-04-29 Akim Demaille <akim@epita.fr>
14305
14306 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
14307 * src/getargs.c, src/getargs.h: here, as bool, not int.
14308 (nondeterministic_parser): New.
14309 * src/parse-gram.y, src/scan-gram.l: Support
14310 %nondeterministic-parser.
14311 * src/output.c (prepare): Use nondeterministic_parser instead
14312 of glr_parser where appropriate.
14313 * src/tables.c (conflict_row, action_row, save_row)
14314 (token_actions, token_actions, pack_vector): Ditto.
14315
a06ea4aa
AD
143162003-04-29 Akim Demaille <akim@epita.fr>
14317
14318 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
14319
211074ca
AD
143202003-04-29 Akim Demaille <akim@epita.fr>
14321
14322 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
14323 with %pure-parser and %locations to exercise the patch from Yakov
14324 Markovitch below.
14325
6175ffe3
PE
143262003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
14327
14328 * data/yacc.c: (b4_lex_param): Corrected for the case where
14329 %lex-param is provided and %pure-parser isn't.
14330
b1e95857
PE
143312003-04-27 Paul Eggert <eggert@twinsun.com>
14332
14333 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 14334 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
14335 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
14336 if it is not defined.
14337 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
14338
acda9df6
PE
143392003-04-26 Paul Eggert <eggert@twinsun.com>
14340
3470c57b
PE
14341 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
14342 Declare to be of type suitable for the ninf value itself, not of
14343 type suitable for the corresponding table, since the latter might
14344 be unsigned but the ninf value might be negative. This fixes a
14345 bug reported by Alexandre Duret-Lutz in
161a71f3 14346 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 14347
acda9df6
PE
14348 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
14349 invokes it. We shouldn't invoke it twice because it will attempt
14350 to put error.o in the archive twice. This fixes a glitch reported
14351 by Martin Mokrejs in
161a71f3 14352 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 14353
b5250f26
PE
143542003-04-21 Paul Eggert <eggert@twinsun.com>
14355
14356 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
14357 to gnulib.
14358
089ac0f1
PE
143592003-04-21 Yakov Markovitch <Markovitch@iso.ru>
14360
14361 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
14362 Fix obvious typo that results in uncompilable GLR parsers
14363 when both %pure-parser and %locations are used. (trivial change)
14364
5ededac6
PE
143652003-04-17 Paul Eggert <eggert@twinsun.com>
14366
1b8f2fff
PE
14367 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
14368 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
14369 Do not insert the expected token via unput, as this runs afoul
14370 of a POSIX-compatibility bug in flex 2.5.31.
14371 All uses changed to BEGIN the parent state,
14372 since we no longer insert the expected token via unput.
14373 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
14374 that is no longer emitted after the above change.
14375
5ededac6
PE
14376 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
14377 the first one. This change is from Paul Hilfinger, and it fixes
14378 regression reported by Werner Lemberg in
161a71f3 14379 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
14380
14381 (resolve_sr_conflict): Don't invoke state_errs_set
14382 unless one or more tokens have been explicitly made errors.
14383 Otherwise, the above change causes Bison to abort.
14384
14385 * tests/existing.at (GNU pic Grammar): New test case, taken from
14386 Lemberg's email.
14387
b8be9132
AD
143882003-03-31 Akim Demaille <akim@epita.fr>
14389
14390 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
14391
d423d460
AD
143922003-03-31 Akim Demaille <akim@epita.fr>
14393
14394 * src/output.c (prepare_symbols): Avoid trailing spaces in the
14395 output.
14396
c7e441b4
AD
143972003-03-31 Akim Demaille <akim@epita.fr>
14398
14399 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
14400 From Paul Hilfinger.
14401
231897ad
AD
144022003-03-29 Akim Demaille <akim@epita.fr>
14403
14404 * m4/error.m4: Do not put under dynamic conditions some code which
14405 expansion is under static control.
14406
5b066063
AD
144072003-03-29 Akim Demaille <akim@epita.fr>
14408
14409 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
14410
22a74fec
AD
144112003-03-29 Akim Demaille <akim@epita.fr>
14412
14413 * doc/bison.texinfo (Strings are Destroyed): New.
14414
0eee27e7
PE
144152003-03-13 Paul Eggert <eggert@twinsun.com>
14416
14417 * .cvsignore: Add configure.lineno.
14418 * src/.cvsignore: Add yacc.
14419 * tests/.cvsignore: Add testsuite.log.
14420 * doc/fdl.texi: Sync with latest FSF version.
14421
f61aad93
PE
144222003-03-12 Paul Eggert <eggert@twinsun.com>
14423
537636c7
PE
14424 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
14425 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
14426 cursor, instead of leaving it undefined. This fixes a bug
14427 reported by Tim Van Holder in
161a71f3 14428 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
14429 * tests/input.at (Torturing the Scanner): Test the scanner on
14430 an empty input file, which was Tim Van Holder's test case.
14431
14432 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
14433 <sys/resource.h> can be included, include sys/time.h and
14434 sys/times.h first, if available. This works around the SunOS
14435 4.1.4 porting bug reported by Bruce Becker in
161a71f3 14436 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
14437
14438 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
14439 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
14440 AC_HEADER_SYS_WAIT.
14441
f61aad93
PE
14442 Merge changes from gnulib. This was prompted because the CVS
14443 snapshot didn't build on Solaris 7 due to strnlen problems.
14444
14445 These changes need to be merged back into gnulib:
14446 * lib/hash.c: Include <stdbool.h> unconditionally.
14447 * m4/onceonly.m4 (m4_quote): New macro.
14448 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
14449 Quote AC_FOREACH variable-expansions properly.
14450 The 2003-01-03 obstack.h change also needs merging.
14451 {end of changes requiring merging}
5b066063 14452
f61aad93
PE
14453 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14454 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
14455 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
14456 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
14457 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
14458 New files, imported from gnulib.
14459 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
14460 above.
14461
14462 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
14463 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
14464 gnulib sources.
14465
14466 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
14467 Add.
14468 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
14469 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
14470 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
14471 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
14472 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
14473 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
14474 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
14475 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
14476 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
14477 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
14478 (jm_PREREQ_ARGMATCH): Remove.
14479 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
14480 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
14481
14482 * src/system.h: Include <stdbool.h> unconditionally.
14483
14484 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
14485 assuming at least C89 in the bitset code for some time now.
14486
d2ffe116
AD
144872003-03-03 Akim Demaille <akim@epita.fr>
14488
14489 * ro.po: New.
14490
052826fd
AD
144912003-03-02 Akim Demaille <akim@epita.fr>
14492
14493 * doc/bison.texinfo (Table of Symbols): Reactivate the
14494 documentation for %lex-param, and %parse-param.
14495
c4749565
AD
144962003-03-02 Akim Demaille <akim@epita.fr>
14497
14498 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
14499 generate verbose error messages.
14500 Use the number of tokens as an upper bound in yytname, as it
14501 cannot be a non terminal.
14502
d5286af1
AD
145032003-03-02 Akim Demaille <akim@epita.fr>
14504
14505 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
14506 message.
14507
22e304a6
AD
145082003-03-02 Akim Demaille <akim@epita.fr>
14509
22e304a6
AD
14510 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
14511 Use them to exercise yycheck overrun.
14512 Based on Andrew Suffield's grammar.
14513
67a25fed
AD
145142003-03-02 Akim Demaille <akim@epita.fr>
14515
14516 Create tests/local.at for Bison generic testing macros.
14517
14518 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
14519 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
14520 This new file.
14521 * tests/calc.at (AT_CHECK_CALC): Adjust.
14522 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
14523 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
14524 * tests/local.at: here.
14525 (AT_COMPILE_CXX): Tags the tests using it as c++.
14526 Ignore the test if CXX is not functional.
14527
9c2b381f
PE
145282003-03-01 Paul Eggert <eggert@twinsun.com>
14529
14530 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
14531 not loc->end, since loc->end might contain garbage and this leads
14532 to undefined behavior on some platforms.
14533 (id_loc, token_start): Use (IF_LINTed) initial values that do not
14534 depend on *loc, so that the reader doesn't give the the false
14535 impression that *loc is initialized.
14536 (<INITIAL>"%%"): Do not bother setting code_start, since its value
14537 does not survive the return.
14538
0433ba88
AD
145392003-03-01 Akim Demaille <akim@epita.fr>
14540
14541 * src/scan-gram.l (code_start): Always initialize it when entering
14542 into yylex, as SC_EPILOGUE is activated *before* the corresponding
14543 yylex invocation. An alternative would be making it static, but
14544 then it starts with the second %%'s beginning, instead of its end.
14545
b305ea69
PE
145462003-02-28 Paul Eggert <eggert@twinsun.com>
14547
14548 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
14549 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 14550 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 14551
c3d25e01
PE
145522003-02-26 Paul Eggert <eggert@twinsun.com>
14553
14554 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
14555 Remove Sequent/Pyramid discussion (nobody uses them any more).
14556 Merge VMS and MS-DOS discussion; these ports may well be dead
14557 but let's keep mentioning them for now. Put <> around email
14558 addresses. Add copyright notice.
14559
c267ffbc
PE
145602003-02-24 Paul Eggert <eggert@twinsun.com>
14561
14562 * data/glr.c (yy_reduce_print): yylineno -> yylno,
14563 to avoid collision with flex use of yylineno.
14564 Problem reported by Bruce Lilly in
161a71f3 14565 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
14566 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
14567 * data/yacc.c (yy_reduce_print): Likewise.
14568
14569 * config/depcomp: Sync with Automake 1.7.3.
14570
f939fc12
AD
145712003-02-21 Akim Demaille <akim@epita.fr>
14572
14573 * data/lalr1.cc: Use temporary variables instead of casts to
14574 change integer types.
14575 Suggested by Paul Eggert.
14576
95923bd6
AD
145772003-02-21 Akim Demaille <akim@epita.fr>
14578
14579 * doc/bison.texinfo: Use "location" consistently to refer to @n,
14580 to avoid confusions with lalr1.cc's notion of Position.
14581 Suggested by Paul Eggert.
14582
2cdc240e
AD
145832003-02-20 Akim Demaille <akim@epita.fr>
14584
14585 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
14586 before initial_columns.
14587 (location.hh): Use consistent variable names when defining the
14588 operator<<.
14589 Use "last" so that we subtract from Positions, not from unsigned.
14590
5d003116
AD
145912003-02-20 Akim Demaille <akim@epita.fr>
14592
14593 * data/lalr1.cc (position.hh): New subfile, including the extended
14594 and Doxygen'ed documentation of class Position.
14595 (location.hh): Use it.
14596 Document a` la Doxygen.
ba1ecc07 14597 With the help of Benoit Perrot.
5d003116 14598
d02b25f9
AD
145992003-02-20 Akim Demaille <akim@epita.fr>
14600
14601 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
14602 AT_YACC_IF.
14603 Redefine AT_YYERROR_SEES_LOC_IF using it.
14604 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
14605 not defined.
14606 Don't use the location in yy::Parser::error_ and
14607 yy::Parser::print_ when not %locations.
14608 Activate more lalr1.cc tests.
14609
0d1c3a04
AD
146102003-02-19 Akim Demaille <akim@epita.fr>
14611
14612 * data/lalr1.cc: When displaying a line number, be sure to make it
14613 an int.
14614
60a777aa
AD
146152003-02-19 Akim Demaille <akim@epita.fr>
14616
14617 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
14618 Remove, useless.
14619 (YYABORT, YYACCEPT, YYERROR): New.
14620 * tests/calc.at: Renable the lalr1.cc test.
14621
0b86fc41
AD
146222003-02-19 Akim Demaille <akim@epita.fr>
14623
14624 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
14625 error recovery, mixing with/without pops and discarding of the
14626 lookahead.
14627 Exercise YYERROR.
14628 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
14629
da99a5dc
PE
146302003-02-17 Paul Eggert <eggert@twinsun.com>
14631
14632 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
14633 * tests/testsuite.at (AT_COMPILE): Use them.
14634 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 14635 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 14636
93b8c255
PE
146372003-02-12 Paul Eggert <eggert@twinsun.com>
14638
14639 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
14640 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 14641 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
14642 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
14643 Check for malloc failure, for consistency with yacc.c.
14644 (yytname_size): Remove, for consistency with yacc.c.
14645
14646 The bug still remains in data/lalr1.cc, as I didn't have time
14647 to fix it there.
14648
7548fed2
AD
146492003-02-06 Akim Demaille <akim@epita.fr>
14650
14651 * configure.ac (GXX): Rename as...
14652 (CXX): this, to keep the original Autoconf semantics.
14653 Require 2.57.
14654 * data/lalr1.cc: Fix b4_copyright invocations.
14655 If YYDEBUG is not defined, don't depend upon name_ being defined.
14656 (location.hh): Include string and iostream.
14657 (Position::filename): New member.
14658 (Position::Position ()): New.
14659 (operator<< (Position)): New.
14660 (operator- (Position, int)): New.
14661 (Location::first, Location::last): Rename as...
14662 (Location::begin, Location::end): these, to mock the conventional
14663 iterator names.
14664 (operator<< (Location)): New.
14665 * tests/atlocal.in (CXX): New.
14666 * tests/testsuite.at (AT_COMPILE_CXX): New.
14667 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
14668 locations in a more synthetic way.
14669 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
14670 lalr1.cc is used.
14671 Adjust the C locations to match those from Emacs: first column is
14672 column 0.
14673 Change all the expected results.
14674 Conform to the GCS: simplify the locations when applicable.
14675 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
14676 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
14677 these CPP macros with the m4 macros new defined by...
14678 (AT_CHECK_PUSHDEFS): this, i.e.:
14679 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 14680 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
14681 New macros.
14682 (AT_CHECK_POPDEFS): Undefine them.
14683 (AT_CHECK_CALC_LALR1_CC): New.
14684 Use it for the first lalr1.cc test.
14685
43a176ef
AD
146862003-02-04 Akim Demaille <akim@epita.fr>
14687
14688 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
14689 Location as is defined.
14690
fc049e9c
AD
146912003-02-04 Akim Demaille <akim@epita.fr>
14692
14693 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
14694 name_ being defined.
14695
a737b216
PE
146962003-02-03 Paul Eggert <eggert@twinsun.com>
14697
14698 * src/gram.h (start_symbol): Remove unused decl.
14699
14700 Use more-consistent naming conventions for local vars.
14701
14702 * src/derives.c (derives_compute): Change type of local var from
14703 int to rule_number.
14704 * src/gram.c (grammar_rules_partial_print): Likewise.
14705 * src/print.c (print_core): Likewise.
14706 * src/reduce.c (reduce_grammar_tables): Likewise.
14707
14708 * src/gram.c (grammar_dump): Change name of item_number *
14709 local var from r to rp.
14710 * src/nullable.c (nullable_compute): Likewise.
14711
14712 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
14713
14714 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
14715 for symbol or symbol_number var.
14716 * src/reader.c (grammar_start_symbol_set): Likewise.
14717 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
14718 Likewise.
14719 * src/state.c (transitions_to): Likewise.
14720 * src/state.h: Likewise.
14721 * src/tables.c (symbol_number_to_vector_number): Likewise.
14722
14723 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
14724 char * var.
14725
14726 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
14727 var.
14728
14729 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
14730 var.
14731
14732 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
14733 Use str, not s, for char * var. Use ch, not c, for character var.
14734 Use size for size var.
14735
14736 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
14737 char * var.
14738 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
14739 uniqstr var.
14740 * src/uniqstr.h: Likewise.
14741
14742 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14743 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14744 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
14745 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
14746 param to have same name as that of enum, so that we don't use
14747 "s" to stand for a non-state.
14748
68e93ad5
AD
147492003-02-02 Akim Demaille <akim@epita.fr>
14750
14751 * src/scan-skel.l: Scan more than one inert character per yylex
14752 invocation.
14753
92898986
PE
147542003-02-01 Paul Eggert <eggert@twinsun.com>
14755
14756 Version 1.875a.
14757
1d9d5d71
PE
14758 * po/LINGUAS: Add ms.
14759
0435d061
AD
147602003-01-30 Akim Demaille <akim@epita.fr>
14761
14762 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
14763
6029a57f
PH
147642003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14765
14766 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
14767 of $1.
0435d061
AD
14768
14769 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 14770 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 14771 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 14772
6029a57f
PH
14773 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
14774 (b4_rhs_location): Ditto.
0435d061 14775 (yyfill): New function to copy from stack tree into array
6029a57f 14776 incrementally.
0435d061
AD
14777 (yyuserAction): Modify to allow incremental move of semantic values
14778 to rhs array when in GLR mode.
14779 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
14780 as needed.
14781 Remove dummy use of yystack, as there is now a guaranteed use.
14782 (yydoAction): Modify to allow incremental move of semantic values
14783 to rhs array when in GLR mode.
14784 (yyresolveAction): Ditto.
14785 (yyglrShiftDefer): Update comment.
0435d061 14786 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
14787 (yyglrReduce): Ditto.
14788 (yydoAction): Ditto
0435d061 14789
6029a57f
PH
14790 * tests/glr-regr1.at: Rename to ...
14791 * tests/glr-regression.at: Add new regression test for the problems
14792 described above (adapted from S. Eken).
14793 Update copyright notice.
14794 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
14795 * tests/Makefile.am: Ditto.
14796
6cee6297
PE
147972003-01-28 Paul Eggert <eggert@twinsun.com>
14798
14799 * data/lalr1.cc: Do not use @output_header_name@ unless
14800 b4_defines_flag is set. This fixes two bugs reported by
14801 Tim Van Holder in
161a71f3
PE
14802 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
14803 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 14804
b2a836b5
PE
148052003-01-21 Paul Eggert <eggert@twinsun.com>
14806
14807 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
14808 we don't need to worry about yyerrlab1 being reported as an
14809 "unused label" by non-GCC C compilers. The downside is that if
14810 locations are used then a couple of statements are duplicated each
14811 time YYERROR is invoked, but the upside is that the warnings
14812 should vanish.
14813 (yyerrlab1): Move code to YERROR.
14814 (yyerrlab2): Remove. Change uses back to yyerrlab1.
14815 This reverts some of the 2002-12-27 change.
14816
4196b931
PE
148172003-01-17 Paul Eggert <eggert@twinsun.com>
14818
14819 * src/output.c (symbol_printers_output): Fix typo that led
14820 to core dump. Problem reported by Antonio Rus in
161a71f3 14821 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 14822
3ae831b4
AD
148232003-01-13 Akim Demaille <akim@epita.fr>,
14824 Quoc Peyrot <chojin@lrde.epita.fr>,
14825 Robert Anisko <anisko_r@lrde.epita.fr>
14826
14827 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
14828 when the stacks contain one element, as the loop would otherwise
14829 free the last state, and then use the top state (the one we just
14830 popped). This means that the initial elements will not be freed
14831 explicitly, as is the case in yacc.c; it is not a problem, as
14832 these elements have fake values.
14833
e3aa65c5
PE
148342003-01-11 Paul Eggert <eggert@twinsun.com>
14835
14836 * NEWS: %expect-violations are now just warnings, reverting
14837 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
14838 bootstrapping problem reported by Matthias Klose; see
161a71f3 14839 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
14840 * src/conflicts.c (conflicts_print): Likewise.
14841 * tests/conflicts.at (%expect not enough, %expect too much,
14842 %expect with reduce conflicts): Likewise.
14843 * doc/bison.texinfo (Expect Decl): Document this. Also mention
14844 that the warning is enabled if the number of conflicts changes
14845 (not necessarily increases).
14846
14847 * src/getargs.c (version): Update copyright year.
14848
f0057011
AD
148492003-01-09 Akim Demaille <akim@epita.fr>
14850
14851 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
14852
1ee6d2a0
PE
148532003-01-08 Paul Eggert <eggert@twinsun.com>
14854
14855 * Makefile.maint (WGETFLAGS):
14856 New macro, containing "-C off" to disable proxy caches.
14857 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
14858 (rel-check): Use $(WGET) instead of wget.
14859
d4fd77c4
PE
148602003-01-06 Paul Eggert <eggert@twinsun.com>
14861
14862 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
14863 the GLR paper of Scott, Johnstone and Hussain.
14864
464c6927
PE
148652003-01-04 Paul Eggert <eggert@twinsun.com>
14866
d600ee67
PE
14867 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
14868 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
14869 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
14870 (EXTRA_LIBRARIES): New var, for liby.a.
14871 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
14872 (EXTRA_SCRIPTS): New var, for yacc.
14873
464c6927
PE
14874 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
14875 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
14876 Problem reported by Nelson H. F. Beebe.
14877
148782003-01-03 Paul Eggert <eggert@twinsun.com>
14879
14880 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
14881 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
14882 when compiling Bison 1.875's `bitset bset = obstack_alloc
14883 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
14884
14885 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
14886 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
14887 grow to a huge size with typical invocation.
d600ee67 14888
464c6927
PE
14889 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
14890 Use the pattern recommended by Autoconf 2.57, except also protect
14891 against double-definition.
14892 * src/system.h: Likewise.
14893 Portability issues reported by Nelson H. F. Beebe.
d600ee67 14894
464c6927
PE
14895 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
14896 All uses changed. Provide a definition in both C and C++.
14897 (yytrue, yyfalse): Define even if defined (__cplusplus).
14898
14899 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
14900 Reported by Nelson H. F. Beebe.
d600ee67 14901
464c6927
PE
14902 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
14903
0f42c7d5
PE
149042003-01-02 Paul Eggert <eggert@twinsun.com>
14905
14906 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
14907 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
14908 Bug reported by Nelson H. F. Beebe.
14909
dc546b0f
PE
149102003-01-01 Paul Eggert <eggert@twinsun.com>
14911
14912 * Version 1.875.
14913
2c09b6a7
PE
149142002-12-30 Paul Eggert <eggert@twinsun.com>
14915
14916 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
14917 Moved here from...
14918 (<INITIAL>","): Here. This causes stray "," to be treated
14919 more uniformly.
14920
dc546b0f 14921 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
14922 last brace in braced code when not in Yacc mode, for compatibility
14923 with Bison 1.35. This resurrects the 2001-12-15 patch to
14924 src/reader.c.
14925
14926 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
14927 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
14928
535c0f63
PE
149292002-12-28 Paul Eggert <eggert@twinsun.com>
14930
14931 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
14932 that of SYM's type. This fixes Debian bug 168069, reported by
14933 Thomas Olsson.
d600ee67 14934
963fcc17
PE
149352002-12-28 Paul Eggert <eggert@twinsun.com>
14936
14937 Version 1.75f.
14938
14939 Switch back to the Yacc style of conflict reports, undoing some
14940 of the 2002-07-30 change.
14941 * doc/bison.texinfo (Understanding): Use Yacc style for
14942 conflict reports. Also, use new way of locating rules.
14943 * src/conflicts.c (conflict_report):
14944 Renamed from conflict_report_yacc, removing the old
14945 'conflict_report'. Translate the entire conflict report at once,
14946 so that we don't assume that "," has the same interpretation in
14947 all languages.
14948 (conflicts_output): Use Yacc-style conflict report for each state,
14949 instead of our more-complicated style.
14950 (conflicts_print): Use Yacc-style conflict report, except print
14951 the input file name when not emulating Yacc.
14952 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
14953 Conflicted Reduction, %expect not enough, %expect too much,
14954 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
14955 * tests/existing.at (GNU Cim Grammar): Likewise.
14956 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
14957
14958 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
14959 fatal): Don't invoke fflush; it's not needed and it might even be
14960 harmful for stdout, as stdout might not be open.
14961 * src/reduce.c (reduce_print): Likewise.
14962
b1efe548
PE
149632002-12-27 Paul Eggert <eggert@twinsun.com>
14964
14965 Fix a bug where error locations were not being recorded correctly.
14966 This problem was originally reported by Paul Hilfinger in
161a71f3 14967 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
14968
14969 * data/yacc.c (yyparse): New local var yylerrsp, to record the
14970 top of the location stack's error locations.
14971 (yyerrlab): Set it. When discarding a token, push its location
14972 onto yylerrsp so that we don't lose track of the error's end.
14973 (yyerrlab1): Now is only the target of YYERROR, so that we can
14974 properly record the location of the action that failed. For GCC
14975 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
14976 GCC warning about yyerrlab1 being unused if YYERROR is unused.
14977 (yyerrlab2): New label, which yyerrlab now falls through to.
14978 Compute the error's location by applying YYLLOC_DEFAULT to
14979 the locations of all the symbols that went into the error.
14980 * doc/bison.texinfo (Location Default Action): Mention that
14981 YYLLOC_DEFAULT is also invoked for syntax errors.
14982 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14983 Error locations include the locations of all the tokens that were
14984 discarded, not just the last token.
d600ee67 14985
983c5c2c
PE
149862002-12-26 Paul Eggert <eggert@twinsun.com>
14987
b1efe548
PE
14988 * src/files.c: Include quote.h.
14989 (compute_output_file_names): Warn if we detect conflicting
14990 outputs to the same file. This should catch the misunderstanding
14991 exemplified by Debian Bug 165349, reported by Bruce Stephens..
14992
14993 * src/conflicts.c (conflicts_print): If the user specifies
14994 "%expect N", report an error if there are any reduce/reduce
14995 conflicts. This is what the manual says should happen.
14996 This fixes Debian bug 130890, reported by Anthony DeRobertis.
14997 * tests/conflicts.at (%expect with reduce conflicts): New test.
14998
983c5c2c
PE
14999 Don't use m4_include on relative file names, as it doesn't work as
15000 desired if there happens to be a file with that name under ".".
d600ee67 15001
983c5c2c
PE
15002 * m4sugar/version.m4: Remove; it was included but it wasn't used.
15003 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
15004 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
15005 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
15006 * src/output.c (output_skeleton): Use full path names when
15007 specifying a file to include; don't rely on include path, as
15008 it's unreliable when the working file contains a file with
15009 that name.
d600ee67 15010
983c5c2c
PE
150112002-12-25 Paul Eggert <eggert@twinsun.com>
15012
15013 Remove obsolete references to bison.simple and bison.hairy.
15014 Problem mentioned by Aubin Mahe in
161a71f3 15015 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
15016 * data/glr.c: Comment fix.
15017 * doc/bison.1: Remove references. Also, mention "yacc".
15018
15019 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
15020 with -g option.
15021
15022 * src/parse-gram.y (declaration): Use enum "report_states" rather
15023 than its numeric value 1.
15024
15025 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
15026 opening a new one. This fixes Debian bug 165349, reported by
15027 Bruce Stephens.
15028
23f2d9dc
PE
150292002-12-24 Paul Eggert <eggert@twinsun.com>
15030
15031 Version 1.75e.
15032
15033 * Makefile.maint (cvs-update): Don't assume that the shell
15034 supports $(...), as Solaris sh doesn't.
15035
15036 * src/parse-gram.y (lloc_default): Remove test for empty
15037 nonterminals at the end, since it didn't change the result.
15038
150392002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
15040
15041 If the user does not define YYSTYPE as a macro, Bison now declares it
15042 using typedef instead of defining it as a macro. POSIX requires this.
15043 For consistency, YYLTYPE is also declared instead of defined.
15044
15045 %union directives can now have a tag before the `{', e.g., the
15046 directive `%union foo {...}' now generates the C code
15047 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
15048 The default union tag is `YYSTYPE', for compatibility with Solaris 9
15049 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
15050 instead of `yyltype'.
15051
15052 `yystype' and `yyltype' are now obsolescent macros instead of being
15053 typedefs or tags; they are no longer documented and will be
15054 withdrawn in a future release.
15055
15056 * data/glr.c (b4_location_type): Remove.
15057 (YYSTYPE): Renamed from yystype.
15058 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
15059 (struct YYLTYPE): Renamed from struct yyltype.
15060 (YYLTYPE): Renamed from yyltype.
15061 (yyltype, yystype): New (and obsolescent) macros,
15062 for backward compatibility.
15063 * data/yacc.c: Likewise.
15064
15065 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
15066 does not specify a union tag. This is for compatibility with
15067 Solaris 9 yacc.
15068
15069 * src/parse-gram.y (add_param): 2nd arg is now char * not char
15070 const *, since it is now modified by stripping surrounding { }.
15071 (current_braced_code): Remove.
15072 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
15073 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
15074 trailing " {...}". Now of type <chars>.
15075 (grammar_declaration): Adjust to bundled tokens.
15076 (code_content): Remove; stripping is now done by add_param.
15077 (print_token_value): Print contents of bundled tokens.
15078 (token_name): New function.
15079
15080 * src/reader.h (braced_code, current_braced_code): Remove.
15081 (token_name): New decl.
15082
15083 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
15084 token_type, not braced_code code_kind. All uses changed.
15085 (SC_PRE_CODE): New state, for scanning after a keyword that
15086 has (or usually has) an immediately-following braced code.
15087 (token_type): New local var, to keep track of which token type
15088 to return when scanning braced code.
15089 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 15090 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
15091 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
15092 instead of returning a token type immediately.
15093 (<INITIAL>"{"): Set token type.
15094 (<SC_BRACED_CODE>"}"): Use it.
15095 (handle_action_dollar, handle_action_at): Now returns bool
15096 indicating success. Fail if ! current_rule; this prevents a core dump.
15097 (handle_symbol_code_dollar, handle_symbol_code_at):
15098 Remove; merge body into caller.
15099 (handle_dollar, handle_at): Complain in invalid contexts.
15100
15101 * NEWS, doc/bison.texinfo: Document the above.
15102 * NEWS: Fix years and program names in copyright notice.
15103
879ca4f8
PE
151042002-12-17 Paul Eggert <eggert@twinsun.com>
15105
15106 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
15107 Reporting, Table of Symbols): Omit mentions of %lex-param and
15108 %parse-param from the documentation for now.
15109
1c5fe69d
PE
151102002-12-15 Paul Eggert <eggert@twinsun.com>
15111
15112 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
15113 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
15114 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
15115 disagreed with the Bison documentation. Bug
15116 reported by Andrew Walrond.
d600ee67 15117
1c5fe69d
PE
15118 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
15119 as the caller now does that.
15120 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
15121 (YYEMPTY): Parenthesize right hand side, since others use it.
15122 (yyparse): Don't assume that our generated code is the only code
15123 that sets yychar.
15124
d1de5372
PE
151252002-12-13 Paul Eggert <eggert@twinsun.com>
15126
15127 Version 1.75d.
15128
15129 POSIX requires a "yacc" command.
15130 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
15131 (MOSTLYCLEANFILES): Add yacc.
15132 (yacc): New rule.
1c5fe69d 15133 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
15134 as an alias for bison y.
15135
15136 * po/LINGUAS: Add da.
d600ee67 15137
d1de5372
PE
15138 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
15139 problem with latest <getopt.h>.
15140 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
15141
15142 * doc/fdl.texi: Upgrade to 1.2.
15143 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
15144 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
15145 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
15146 gnulib.
15147 * config/install-sh: Sync with autotools.
15148
15149 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 15150 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
15151 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
15152 locations are requested.
15153 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
15154 locations are requested.
15155
d0f3fe23
PE
151562002-12-12 Paul Eggert <eggert@twinsun.com>
15157
15158 Remove unportable casts and storage allocation tricks.
15159 While we're at it, remove almost all casts, since they
15160 usually aren't needed and are a sign of trouble.
15161
15162 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
15163
15164 * src/derives.c (derives_compute): Do not subtract NTOKENS from
15165 the pointer DSET returned by malloc; this isn't portable.
15166 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
15167 Similarly for DERIVES.
15168 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
15169 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
15170 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
15171
15172 * src/derives.c (derives_compute): Do not bother invoking
15173 int_of_rule_number, since rule numbers are integers.
15174
15175 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
15176 rather than XMALLOC (char, N).
15177
15178 * src/files.c (filename_split): Rewrite to avoid cast.
15179
15180 * src/gram.h (symbol_number_as_item_number,
15181 item_number_as_symbol_number, rule_number_as_item_number,
15182 item_number_as_rule_number):
15183 Now inline functions rather than macros, to avoid casts.
15184 * src/state.h (state_number_as_int): Likewise.
15185 * src/tables.c (state_number_to_vector_number,
15186 symbol_number_to_vector_number): Likewise.
15187
15188 * src/gram.h (int_of_rule_number): Remove; no longer used.
15189
15190 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
15191 since the resulting storage is always stored into.
15192
15193 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
15194 where it's needed.
15195
15196 * src/muscle_tab.c (muscle_m4_output):
15197 Now inline. Return bool, not int.
15198 * src/state.c (state_compare): Likewise.
15199 * src/symtab.c (symbol_check_defined,
15200 symbol_check_alias_consistency, symbol_pack, symbol_translation,
15201 hash_compare_symbol, hash_symbol):
15202 Likewise.
15203 * src/uniqstr.c (uniqstr_print): Likewise.
15204 * src/muscle_tab.c (muscle_m4_output_processor):
15205 New function, to avoid casts.
15206 * src/state.c (state_comparator, stage_hasher): Likewise.
15207 * src/symtab.c (symbol_check_defined_processor,
15208 symbol_check_alias_consistency_processor, symbol_pack_processor,
15209 symbol_translation_processor, hash_symbol_comparator,
15210 hash_symbol_hasher): Likewise.
15211 * src/uniqstr.c (uniqstr_print_processor): Likewise.
15212 * src/muscle_tab.c (muscles_m4_output):
15213 Use new functions instead of casting old functions unportably.
15214 * src/state.c (state_hash_new): Likewise.
15215 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
15216 symbols_token_translations_init):
15217 Likewise.
15218 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
15219
15220 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
15221 var instead of casting to long, to avoid casts.
15222 (prepare_states): Use MALLOC rather than alloca, so that we don't
15223 have to worry about alloca.
15224 * src/state.c (state_hash_lookup): Likewise.
15225
15226 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
15227 local var instead of casting to unsigned char, to avoid casts.
15228
15229 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
15230 STATE_ALLOC): Remove.
15231 (transitions_new, errs_new, reductions_new, state_new): Use malloc
15232 rather than calloc, and use offsetof to avoid allocating slightly
15233 too much storage.
15234 (state_new): Initialize all members.
15235
15236 * src/state.c (state_hash): Use unsigned accumulator, not signed.
15237
15238 * src/symtab.c (symbol_free): Remove; unused.
15239 (symbol_get): Remove cast in lhs of assignment.
15240 (symbols_do): Now static. Accept generic arguments, not
15241 hashing-related ones.
15242
15243 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
15244 (symbol_processor): Remove.
15245 (symbols_do): Remove decl; now static.
15246
15247 * src/system.h (alloca): Remove; decl no longer needed.
15248 (<stddef.h>): Include, for offsetof.
15249 (<inttypes.>, <stdint.h>): Include if available.
15250 (uintptr_t): New type, if system lacks it.
15251 (CALLOC, MALLOC, REALLOC): New macros.
15252 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
15253 new macros.
15254
15255 * src/tables.c (table_size): Now int, to pacify GCC.
15256 (table_grow, table_ninf_remap): Use signed table size.
15257 (save_row): Don't bother initializing locals when not needed.
15258 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
15259 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
15260
15261 * src/vcg.h: Correct misspellings.
15262
15263 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
15264
15265
15266 * src/getargs.c (getargs): Don't assume EOF == -1.
15267
26b4a969
PE
152682002-12-09 Paul Eggert <eggert@twinsun.com>
15269
15270 Change identifier spellings to avoid collisions with names
15271 that are reserved by POSIX.
15272
15273 Don't use names ending in _t, since POSIX reserves them.
15274 For consistency, remove _e and _s endings -- they're weren't
15275 needed to remove ambiguity. All uses changed.
15276 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
15277 turn was just renamed from struniq_t.
15278 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
15279 which in turn was just renamed from struniq_processor_t.
15280 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
15281 in turn was renamed from hash_compare_struniq_t.
15282 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
15283 (state_list): Renamed from state_list_t.
15284 * src/assoc.h (assoc): Renamed from assoc_t.
15285 * src/conflicts.c (enum conflict_resolution): Renamed from
15286 enum conflict_resolution_e.
15287 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
15288 (rule_list): Renamed from rule_list_t.
15289 * src/getargs.h (enum trace): Renamed from enum trace_e.
15290 (enum report): Renamed from enum report_e.
15291 * src/gram.h (item_number): Renamed from item_number_t.
15292 (rule_number): Renamed from rule_number_t.
15293 (struct rule_s): Remove the "rule_s" part; not used.
15294 (rule): Renamed from rule_t.
15295 (rule_filter): Renamed from rule_filter_t.
15296 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
15297 (goto_list): Renamed from goto_list_t.
15298 * src/lalr.h (goto_number): Renamed from goto_number_t.
15299 * src/location.h (location): Renamed from location_t.
15300 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
15301 and moved here from:
15302 * src/muscle_tab.h (muscle_entry_t): here.
15303 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
15304 (rule_list): Renamed from rule_list_t.
15305 * src/print_graph.c (static_graph): Renamed from graph.
15306 * src/reader.h (braced_code): Renamed from braced_code_t.
15307 Remove brace_code_e tag.
15308 * src/relation.h (relation_node): Renamed from relation_node_t.
15309 (relation_nodes): Renamed from relation_nodes_t.
15310 (relation): Renamed from relation_t.
15311 * src/state.h (state_number): Renamed from state_number_t.
15312 (struct state): Renamed from struct state_s.
15313 (state): Renamed from state_t.
15314 (transitions): Renamed from transitions_t. Unused (and
15315 misspelled) transtion_s tag removed.
15316 (errs): Renamed from errs_t. Unused errs_s tag removed.
15317 (reductions): Renamed from reductions_t. Unused tag
15318 reductions_s removed.
15319 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
15320 (struct symbol_list): Renamed from struct symbol_list_s.
15321 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
15322 (struct symbol): Renamed from struct symbol_s.
15323 (symbol): Renamed from symbol_t.
15324 * src/tables.c (vector_number): Renamed from vector_number_t.
15325 (action_number): Renamed from action_t.
15326 * src/tables.h (base_number): Renamed from base_t.
15327 * src/vcg.h (enum color): Renamed from enum color_e.
15328 (enum textmode): Renamed from enum textmode_e.
15329 (enum shape): Renamed from enum shape_e.
15330 (struct colorentry): Renamed from struct colorentry_s.
15331 (struct classname): Renamed from struct classname_s.
15332 (struct infoname): Renamed from struct infoname_s.
15333 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
15334 (enum decision): Renamed from enum decision_e.
15335 (enum orientation): Renamed from enum orientation_e.
15336 (enum alignment): Renamed from enum alignment_e.
15337 (enum arrow_mode): Renamed from enum arrow_mode_e.
15338 (enum crossing_type): Renamed from enum crossing_type_e.
15339 (enum view): Renamed from enum view_e.
15340 (struct node): Renamed from struct node_s.
15341 (node): Renamed from node_t.
15342 (enum linestyle): Renamed from enum linestyle_e.
15343 (enum arrowstyle): Renamed from enum arrowstyle_e.
15344 (struct edge): Renamed from struct edge.
15345 (edge): Renamed from edge_t.
15346 (struct graph): Renamed from struct graph_s.
15347 (graph): Renamed from graph_t.
15348 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
15349 Rename value_t -> value.
15350 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
15351 value_t_as_yystype -> value_as_yystype.
15352
15353 Don't include <errno.h> in the mainstream code, since it
15354 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
15355 * lib/get-errno.c, lib/get-errno.h: New files.
15356 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
15357 get-errno.c.
15358 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
15359 * src/output.c (output_skeleton): Likewise.
15360 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
15361 instead of errno.
15362 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
15363 Likewise.
15364 (handle_action_dollar, handle_action_at): Likewise.
15365 * src/system.h: Do not include <errno.h>.
15366 (TAB_EXT): Renamed from EXT_TAB.
15367 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
15368
15369 Avoid str[a-z]*, since <string.h> reserves that name space.
15370 Change all instances of "struniq" in names to "uniqstr", and
15371 likewise for "STRUNIQ" and "UNIQSTR".
15372 * src/uniqstr.c: Renamed from src/struniq.c.
15373 * src/uniqstr.h: Renamed from src/struniq.h.
15374 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
15375 * src/files.c (strsuffix): Remove; unused.
15376 (concat2): Renamed from stringappend. Now static.
15377 * src/files.h (strsuffix, stringappend): Remove; unused.
15378 * src/parse-gram.y (<chars>): Renamed from <string>.
15379 (<uniqstr>): Renamed from <struniq>.
15380 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
15381 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
15382 (struct graph_s.expand): Renamed from struct graph_s.stretch.
15383 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
15384 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
15385 (N_EXPAND): Renamed from N_STRETCH.
15386
15387 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
15388 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
15389 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
15390 Remove; unused.
15391 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
15392 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
15393 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
15394 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
15395 (BASE_MAXIMUM): Renamed from BASE_MAX.
15396 (BASE_MINIMUM): Renamed from BASE_MIN.
15397 (ACTION_MAX): Remove; unused.
15398 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
15399 Unnecessary casts removed from above defines.
15400
15401
15402 Fix misspelling in names.
15403 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
15404 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
15405 G_NODE_ALIGNEMENT.
15406
15407
15408 * lib/timevar.c (timevar_report): Renamed from time_report,
15409 for consistency with other names.
15410 * lib/timevar.h (timevar_report): New decl.
15411 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
15412
15413
15414 Sort include-file uses.
15415
15416 Reorder all include files under src to be in the order "system.h".
15417 then the ../lib include files in angle brackets (alphabetized),
15418 then the . include files in double-quotes (alphabetized). Fix
15419 dependency breakages encountered in this process, as follows:
15420 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
15421 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
15422 * src/state.h: Include "symtab.h".
15423
996b1c7e
PE
154242002-12-08 Paul Eggert <eggert@twinsun.com>
15425
15426 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
15427 since this causes problems when __file__ contains character
15428 sequences like "@" that are treated specially by src/scan-skel.l.
15429 Instead, just use the file's basename. This fixes the bug
15430 reported by Martin Mokrejs in
161a71f3 15431 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 15432
e19c4e5d
PE
154332002-12-06 Paul Eggert <eggert@twinsun.com>
15434
15435 Add support for rules that do not have trailing semicolons, as
15436 POSIX requires. Improve the quality of locations in Bison
15437 diagnostics.
26b4a969 15438
e19c4e5d
PE
15439 * src/location.c: Include <quotearg.h>.
15440 (empty_location): Now const.
15441 (location_print): New function. Follow the recommendation of the
15442 GNU Coding Standards for locations that span file boundaries.
15443 * src/location.h: Do not include <quotearg.h>; no longer needed.
15444 (boundary): New type.
15445 (location_t): Use it. This allows locations to span file boundaries.
15446 All member uses changed: file -> start.file or end.file (as needed),
15447 first_line -> start.line, first_column -> start.column,
15448 last_line -> end.line, last_column -> end.column.
15449 (equal_boundaries): New function.
15450 (LOCATION_RESET, LOCATION_STEP): Remove.
15451 (LOCATION_PRINT): Remove. All callers changed to use location_print.
15452 (empty_location): Now const.
15453 (location_print): New decl.
15454 * src/parse-gram.y (lloc_default): New function, which handles
15455 empty locations more accurately.
15456 (YYLLOC_DEFAULT): Use it.
15457 (%token COLON): Remove.
15458 (%token ID_COLON): New token.
26b4a969 15459 (rules): Use it.
e19c4e5d
PE
15460 (declarations, rules): Remove trailing semicolon.
15461 (declaration, rules_or_grammar_declaration):
15462 Allow empty (";") declaration.
15463 (symbol_def): Remove empty actions; no longer needed.
15464 (rules_or_grammar_declaration): Remove trailing semicolon.
15465 (semi_colon.opt): Remove.
15466 * src/reader.h: Include location.h.
15467 (scanner_cursor): New decl.
15468 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
15469 rolling our own.
15470 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
15471 of *loc.
15472 (STEP): Remove. No longer needed, now that adjust_location does
15473 the work. All uses removed.
15474 (scanner_cursor): New var.
15475 (adjust_location): Renamed from extend_location. It now sets
15476 *loc and adjusts the scanner cursor. All uses changed.
15477 Don't bother testing for CR.
15478 (handle_syncline): Remove location arg; now updates scanner cursor.
15479 All callers changed.
15480 (unexpected_end_of_file): Now accepts start boundary of token or
15481 comment, not location. All callers changed. Update scanner cursor,
15482 not the location.
15483 (SC_AFTER_IDENTIFIER): New state.
15484 (context_state): Renamed from c_context. All uses changed.
15485 (id_loc, code_start, token_start): New local vars.
15486 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
15487 processing of Yacc white space and equivalents here.
15488 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
15489 instead of returning ID immediately, since we need to search for
15490 a subsequent colon.
15491 (<INITIAL>"'", "\""): Save token_start.
15492 (<INITIAL>"%{", "{", "%%"): Save code_start.
15493 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
15494 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
15495 BEGIN context_state at end, not INITIAL.
15496 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
15497 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
15498 Return correct token start.
15499 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
15500 the start of a character, string or multiline comment is found.
15501 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
15502 Reduction): Adjust reported locations to match the more-precise
15503 results now expected.
15504 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
15505 * tests/reduce.at (Useless Rules, Reduced Automaton,
15506 Underivable Rules): Likewise.
15507 * tests/regression.at (Invalid inputs): No longer `expecting ";"
15508 or "|"' now that so many other tokens are allowed by the new grammar.
15509
15510 * src/complain.h (current_file): Remove duplicate decl;
15511 current_file is now owned by files.h.
15512 * src/complain.c, src/scan-gram.l: Include files.h.
15513
155142002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 15515
e19c4e5d
PE
15516 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
15517 promotes to int; it might be unsigned int.
15518 * data/yacc.c (yy_reduce_print): Likewise.
15519
15520 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
15521 be #defined in the prologue, not in the Bison declarations.
15522 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 15523
b64755e3
PE
155242002-12-02 Paul Eggert <eggert@twinsun.com>
15525
15526 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
15527 * lib/strtoul.c: New file, from gnulib.
15528 This fixes a porting bug reported by Peter Klein in
161a71f3 15529 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 15530
6e746484
PE
155312002-11-30 Paul Eggert <eggert@twinsun.com>
15532
b64755e3
PE
15533 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
15534 and put only a forward declaration in the prologue. This is for
15535 consistency with the other scanner helper functions.
15536
6ba55592
PE
15537 Type clashes now generate warnings, not errors, since it
15538 appears that POSIX may allow some grammars with type clashes.
15539 * src/reader.c (grammar_current_rule_check): Warn about
15540 type clashes instead of complaining.
15541 * tests/input.at (Type Clashes): Expect warnings, not complaints.
15542
6e746484
PE
15543 Add Yacc library, since POSIX requires it.
15544 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
15545 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
15546 * lib/main.c, lib/yyerror.c: New files.
15547
15548 gram_error can be static; it need not be extern.
15549 * src/reader.h (gram_error): Remove decl.
15550 * src/parse-gram.y (gram_error): Now static. Add static decl.
15551 (print_token_value): Omit parameter names from forward decl,
15552 for consistency.
15553
88510f9c
PE
155542002-11-29 Paul Eggert <eggert@twinsun.com>
15555
6e746484
PE
15556 * doc/bison.texinfo: Emphasize that yylex and yyerror must
15557 be declared before being used. E.g., one should typically
15558 declare them in the prologue. Use GNU coding style in examples.
15559 Put "const" consistently after the type it modifies. Mention
15560 that C99 supports "inline". Mention that yyerror traditionally
15561 returns "int".
15562
88510f9c
PE
15563 %parse-param and %lex-param now take just one argument, the
15564 declaration; the argument name is deduced from the declaration.
15565
15566 * doc/bison.texinfo (Parser Function, Pure Calling, Error
15567 Reporting, Table of Symbols): Document this.
15568 * src/parse-gram.y (add_param): New function.
15569 (COMMA): Remove.
15570 (declaration): Implement new rule for %parse-param and %lex-param.
15571 * src/scan-gram.l: "," now elicits a warning, rather than being
15572 a token; this is more compatible with byacc.
15573 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
15574
bb92250c
PE
155752002-11-27 Paul Eggert <eggert@twinsun.com>
15576
15577 Rename identifiers to avoid real and potential collisions.
15578
15579 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
15580 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 15581 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
15582 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
15583 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
15584 * src/parse-gram.y (print_token_value): Renamed from yyprint.
15585 All uses changed.
15586 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
15587 The name "yycontrol" violates the name space rules, and this stuff
15588 wasn't being used anyway.
15589 (input): Remove action; this stuff wasn't being used.
15590 (gram_error): Rename local variable yylloc -> loc.
15591 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
15592 (YY_DECL): Don't use "yy" at start of local variables.
15593 All uses changed, e.g., yylloc -> loc.
15594 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
15595 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
15596 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
15597 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
15598
15599 * src/parse-gram.y (gram_error): loc is now const *.
15600 * src/reader.h (gram_error): Likewise.
15601
3af4feb2
PE
156022002-11-24 Paul Eggert <eggert@twinsun.com>
15603
15604 Version 1.75c.
15605
15606 * tests/actions.at (Actions after errors): Use an output format
15607 more similar to that of the Printers and Destructors test.
15608 Test the position of the ';' token too.
15609 (Printers and Destructors): Likewise.
15610 (Printers and Destructors: %glr-parser): Remove for now, to avoid
15611 unnecessarily alarming people when the test fails.
15612
15613 * data/yacc.c (yyerrlab1): Move this label down, so that the
15614 parser does not discard the lookahead token if the user code
15615 invokes YYERROR. This change is required for POSIX conformance.
15616
15617 * lib/error.c: Sync with gnulib.
15618
156192002-11-22 Paul Eggert <eggert@twinsun.com>
15620
15621 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
15622 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
15623 * lib/xmalloc.c: Likewise.
26b4a969 15624
58004308
PE
156252002-11-20 Paul Eggert <eggert@twinsun.com>
15626
15627 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
15628
156292002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 15630
58004308
PE
15631 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
15632 should use `if (! x) abort ();' rather than `assert (x);', and
15633 anyway it's one less thing to worry about configuring.
15634
15635 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
15636 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
15637 and replace all instances of assert with abort.
15638 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
15639 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
15640
15641 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
15642 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
15643 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
15644 hash_find_entry, hash_rehash, hash_insert): Likewise.
15645 * src/conflicts.c (resolve_sr_conflict): Likewise.
15646 * src/lalr.c (set_goto_map, map_goto): Likewise.
15647 * src/nullable.c (nullable_compute): Likewise.
15648 * src/output.c (prepare_rules, token_definitions_output): Likewise.
15649 * src/reader.c (packgram, reader): Likewise.
15650 * src/state.c (state_new, state_free, state_transitions_set,
15651 state_reduction_find): Likewise.
15652 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
15653 symbol_pack): Likewise.
15654 * src/tables.c (conflict_row, pack_vector): Likewise.
15655 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15656 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15657 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
15658 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
15659
15660 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
15661 (ARGMATCH_CONSTRAINT): New macro.
15662 (ARGMATCH_ASSERT): Use it.
15663
15664 * src/system.h (verify): New macro.
15665 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
15666 rather than assert.
15667 * src/tables.c (tables_generate): Likewise.
15668
15669 * src/struniq.c (struniq_assert): Now returns void, and aborts
15670 if the assertion is false.
15671 (struniq_assert_p): Remove.
15672 * src/struniq.h: Likewise.
15673
76ae8198
PE
156742002-11-18 Paul Eggert <eggert@twinsun.com>
15675
15676 * data/glr.c (yygetLRActions): Replace `yyindex' with
15677 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
15678 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 15679 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 15680
d3c4e709
AD
156812002-11-18 Akim Demaille <akim@epita.fr>
15682
15683 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
15684 space.
15685 From Tim Van Holder.
15686
8d8a7238
PE
156872002-11-17 Paul Eggert <eggert@twinsun.com>
15688
15689 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
15690 to "SyntaxError" for consistency with my 2002-11-15 change.
15691
15692 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
15693 not define to {}, since this breaks the common use of `YYDPRINTF
15694 ((...));' if a single statement is desired (e.g. before `else').
15695 Work around GCC warnings by surrounding corresponding calls with
15696 {} if needed.
15697 (yyhasResolvedValue): Remove unused function.
15698 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
15699 loop body.
15700 (yyreportSyntaxError): Renamed from yyreportParseError.
15701 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
15702 All uses changed.
15703 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
15704 extern when possible. Remove unused initializations.
15705
b0937b22
AD
157062002-11-16 Akim Demaille <akim@epita.fr>
15707
15708 Augment the similarity between GLR and LALR traces.
15709
15710 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
15711 (YY_REDUCE_PRINT): New.
15712 (yyparse): Use them.
15713 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
15714 YYDPRINT here.
15715 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
15716 state reached after the reduction/recovery, since...
15717 (yyparse, yyprocessOneStack): Report the state we are entering in.
15718
c5e3e510
AD
157192002-11-16 Akim Demaille <akim@epita.fr>
15720
15721 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
15722 Add support for --trace=skeleton.
15723 * src/scan-skel.l: %option debug.
15724 Scan strings of non-@ or \n instead of character by character.
15725 (scan_skel): Handle trace_skeleton.
15726 (QPUTS): New.
15727 (@output_parser_name@, @output_header_name@): ``Restore'' their
15728 support (used to be M4 macros).
15729 * data/yacc.c: Quote larger chunks, a la glr.c.
15730 * data/lalr1.cc: Likewise.
15731 The header guards are no longer available, so use some other
15732 string than `YYLSP_NEEDED'.
15733
4c6cc1db
AD
157342002-11-16 Akim Demaille <akim@epita.fr>
15735
15736 Make the ``Printers and Destructors'' test more verbose, taking
15737 `yacc.c''s behavior as (possibly wrong) reference.
15738
15739 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
15740 instead of fprint on stdout.
15741 Set and report the last_line of the symbols.
15742 Consistently display values and locations.
15743
6d9e8019
PE
157442002-11-16 Paul Eggert <eggert@twinsun.com>
15745
15746 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
15747
6e649e65
PE
157482002-11-15 Paul Eggert <eggert@twinsun.com>
15749
b25d88f6
PE
15750 * tests/actions.at (Actions after errors): New test case.
15751
6e649e65
PE
15752 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
15753 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
15754 tests/action.at, tests/calc.at, tests/conflicts.at,
15755 tests/cxx-type.at, tests/regression.at:
15756 "parse error" -> "syntax error" for POSIX compatibility.
15757 "parsing stack overflow..." -> "parser stack overflow" so
15758 that code matches Bison documentation.
15759
0f39aab9
AD
157602002-11-15 Akim Demaille <akim@epita.fr>
15761
15762 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
15763 take two BRACED_CODE, not two string_content.
15764 Free the scanner's obstack when we are done.
15765 (code_content): New.
15766 * tests/calc.at: Adjust.
15767 * doc/bison.texinfo: Adjust.
15768 Also, make sure to include the `,' for these declarations.
15769
761c1926
AD
157702002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
15771
15772 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
15773 definition; avoids potential autoreconf problems.
15774
b0f98b10
AD
157752002-11-15 Akim Demaille <akim@epita.fr>
15776
15777 Always check the value returned by yyparse.
15778
15779 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
15780 returned by yyparse.
15781 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
15782 Adjust calls.
15783 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
15784 returned by yyparse.
15785
970785f1
PH
157862002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15787
15788 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
15789 on input.at test.
15790
8fcc7db1
PE
157912002-11-14 Paul Eggert <eggert@twinsun.com>
15792
7ec1b48e
PE
15793 * src/output.c (output_skeleton): Call xfopen instead of
15794 duplicating xfopen's body.
15795
cfff7583 15796 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 15797 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 15798
8fcc7db1
PE
15799 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
15800 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
15801 Group compiler. Instead, use "$CC -E bar.c". Include the .h
15802 file twice in the grammar, as an extra check.
15803
15804 * tests/input.at (Torturing the Scanner): Surround the
15805 backslash-newline tests with "#if 0", to make it less likely that
15806 we'll run into compiler bugs. Bring back solitary \ inside
15807 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 15808 test backslash-newline in C character constant.
8fcc7db1 15809
4e8d992c
AD
158102002-11-14 Akim Demaille <akim@epita.fr>
15811
15812 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
15813 status of the compiler.
f32b346d 15814 Calling `exit 1' is no longer needed.
4e8d992c
AD
15815 Reported by Nelson H. F. Beebe.
15816
9501dc6e
AD
158172002-11-14 Akim Demaille <akim@epita.fr>
15818
15819 * tests/atlocal.in (CPPFLAGS): We have config.h.
15820 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
15821 New.
15822 * tests/actions.at, tests/calc.at, tests/conflicts.at,
15823 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
15824 * tests/regression.at, tests/torture.at: Use them for all the
15825 grammars that are to be compiled.
15826 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
15827 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
15828 * doc/bison.texinfo (GLR Parsers): Document `inline'.
15829
18b519c0
AD
158302002-11-14 Akim Demaille <akim@epita.fr>
15831
15832 * doc/bison.texinfo: Various formatting changes (alignments in
15833 samples, additional @group/@end group, GCS in samples.
15834 Use @deffn instead of simple @table to define the directives,
15835 macros, variables etc.
15836
9a86cdb9
PE
158372002-11-13 Paul Eggert <eggert@twinsun.com>
15838
daa33def 15839 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 15840 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 15841
daa33def 15842 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 15843 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
15844 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
15845 * tests/headers.at (export YYLTYPE): Likewise.
15846
15847 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 15848 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 15849
9a86cdb9
PE
15850 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
15851 comments, since they're not portable. Use GNU coding style.
15852
9c1e26bd
AD
158532002-11-13 Akim Demaille <akim@epita.fr>
15854
15855 * data/yacc.c: Leave bigger chunks of quoted text.
15856 (YYDSYMPRINTF): New.
15857 Use it to report symbol activities.
15858 * data/glr.c (YYDSYMPRINTF): New.
15859 Use it.
15860
87f721cc
PE
158612002-11-12 Paul Eggert <eggert@twinsun.com>
15862
15863 Version 1.75b.
15864
15865 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
15866 (yyglrReduce): Return yyok, not 0.
15867 This should avoid the enumerated-type warnings reported
464c6927 15868 by Nelson H. F. Beebe in
161a71f3 15869 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
15870
15871 * lib/bbitset.h (BITSET_INLINE): Remove.
15872 * lib/bitset.h [! BITSET_INLINE]: Remove.
15873 (bitset_set, bitset_reset, bitset_test): Rename local vars
15874 to avoid shadowing warnings by GCC.
15875
15876 * data/glr.c (inline): Remove #define. It's the user's
15877 responsibility to #define it away, just like 'const'.
464c6927 15878 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 15879 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 15880
87f721cc
PE
15881 * Makefile.maint (po-check): Scan .l and .y files instead of the
15882 .c and the .h files that they generate. This fixes the bug
15883 reported by Tim Van Holder in:
161a71f3 15884 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
15885 Look for N_ as well as for _. Try to avoid matching #define for
15886 N_ and _.
15887 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
15888 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
15889 * src/scan-gram.l: Revamp regular expressions so that " and '
15890 do not confuse xgettext.
15891
15892 * src/struniq.h (struniq_new): Do not declare the return type
15893 to be 'const'; this violates the C standard.
15894 * src/struniq.c (struniq_new): Likewise.
15895
be14ade5
AD
158962002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
15897
15898 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
15899 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
15900 linker.
15901
05291fbc
AD
159022002-11-12 Akim Demaille <akim@epita.fr>
15903
15904 * Makefile.maint: Sync with Autoconf:
15905 (local_updates): New.
15906
1f5fd52e
AD
159072002-11-12 Akim Demaille <akim@epita.fr>
15908
15909 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
15910
283f1e64
AD
159112002-11-12 Akim Demaille <akim@epita.fr>
15912
15913 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
15914 locations.
15915
886b69d1
AD
159162002-11-12 Akim Demaille <akim@epita.fr>
15917
15918 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
15919 not yyvalue.
15920
3df37415
AD
159212002-11-12 Akim Demaille <akim@epita.fr>
15922
15923 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
15924 Use it to test the GLR parser.
15925
7bd6c77e
AD
159262002-11-12 Akim Demaille <akim@epita.fr>
15927
15928 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
15929 defines it.
15930 * data/glr.c (yystos): New.
15931 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
15932 (YYDSYMPRINT): New.
15933 (yyval): Don't define it, it is handled via M4.
15934 (yyrecoverParseError): Free verbosely the discarded symbols.
15935 * data/yacc.c (yysymprint): Remove, rather...
15936 (b4_yysymprint_generate): invoke.
15937 * data/c.m4 (b4_yysymprint_generate): New.
15938 Accept pointers as arguments, as opposed to the version from
15939 yacc.c.
15940 (b4_yydestruct_generate): Likewise.
15941 * tests/cations.at (Printers and Destructors): Use Bison directives
15942 instead of CPP macros.
15943 Don't rely on internal details.
15944
b0400cc6
AD
159452002-11-12 Akim Demaille <akim@epita.fr>
15946
15947 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
15948 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
15949 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
15950 it against YYEMPTY and so forth), work on yytoken (i.e., set
15951 it to YYEMPTY etc.).
15952 (yydestruct): Replace with a b4_yydestruct_generate invocation.
15953 (b4_symbol_actions): Remove.
15954 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
15955 for 0, end-of-input.
15956
72f889cc
AD
159572002-11-12 Akim Demaille <akim@epita.fr>
15958
15959 * doc/bison.texinfo (Destructor Decl): New.
15960
b1ae9233
AD
159612002-11-12 Akim Demaille <akim@epita.fr>
15962
15963 * src/tables.c (tables_generate): Use free for pointers that
15964 cannot be NULL, not XFREE.
15965 (pack_vector): Use assert, not fatal, for bound violations.
15966 * src/state.c (state_new): Likewise.
15967 * src/reader.c (reader): Likewise.
15968 * src/lalr.c (set_goto_map): Likewise.
72f889cc 15969 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
15970 the file name.
15971
7ec2d4cd
AD
159722002-11-12 Akim Demaille <akim@epita.fr>
15973
15974 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
15975 Restore.
15976 * src/scan-gram.l (last_string): Is global to the file, not to
15977 yylex.
15978 * src/parse-gram.y (input): Don't append the epilogue here,
15979 (epilogue.opt): do it here, and free the scanner's obstack.
15980 * src/reader.c (epilogue_set): Rename as...
15981 (epilogue_augment): this.
15982 * data/c.m4 (b4_epilogue): Defaults to empty.
15983
573a6cd3
AD
159842002-11-12 Akim Demaille <akim@epita.fr>
15985
15986 * src/getargs.c (long_options): Remove duplicates.
15987 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
15988 Remove.
15989 * doc/bison.rnh: Remove.
15990 * doc/bison.texinfo (VMS Invocation): Remove.
15991
95612cfa
AD
159922002-11-12 Akim Demaille <akim@epita.fr>
15993
15994 * src/struniq.h, src/struniq.c (struniq_t): Is const.
15995 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
15996
15997 Use struniq for symbols.
15998
15999 * src/symtab.h (symbol_t): The tag member is a struniq.
16000 (symbol_type_set): Adjust.
16001 * src/symtab.c (symbol_new): Takes a struniq.
16002 (symbol_free): Don't free the tag member.
16003 (hash_compare_symbol_t, hash_symbol_t): Rename as...
16004 (hash_compare_symbol, hash_symbol): these.
16005 Use the fact that tags as struniqs.
16006 (symbol_get): Use struniq_new.
16007 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
16008 Returns a strniq.
16009 * src/reader.h (merger_list, grammar_currentmerge_set): The name
16010 and type members are struniqs.
16011 * src/reader.c (get_merge_function)
16012 (grammar_current_rule_merge_set): Adjust.
16013 (TYPE, current_type): Are struniq.
16014
16015 Use struniq for file names.
16016
16017 * src/files.h, src/files.c (infile): Split into...
16018 (grammar_file, current_file): these.
16019 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
16020 * src/reduce.c (reduce_print): Likewise.
16021 * src/getargs.c (getargs): Likewise.
16022 * src/complain.h, src/complain.c: Likewise.
16023 * src/main.c (main): Call struniqs_new early enough to use it for
16024 file names.
16025 Don't free the input file name.
16026
3e6656f9
AD
160272002-11-12 Akim Demaille <akim@epita.fr>
16028
16029 * src/symtab.c (symbol_free): Remove dead deactivated code:
16030 type_name are properly removed.
16031 Don't use XFREE to free items that cannot be NULL.
16032 * src/struniq.h, src/struniq.c: New.
16033 * src/main.c (main): Initialize/free struniqs.
16034 * src/parse-gram.y (%union): Add astruniq member.
16035 (yyprint): Adjust.
16036 * src/scan-gram.l (<{tag}>): Return a struniq.
16037 Free the obstack bit that used to store it.
16038 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
16039
7672019c
PE
160402002-11-11 Paul Eggert <eggert@twinsun.com>
16041
16042 Revamp to fix many (but not all) of the C- and M4-related quoting
16043 problems. Among other things, this fixes the Bison bug reported
16044 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 16045 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
16046
16047 Use new @ escapes consistently. Represent brackets with @{ and @}
16048 rather than @<:@ and @:>@, since this works a bit better with dumb
16049 editors like vi. Represent @ with @@, since @ is now consistently
16050 an escape. Use @oline@ and @ofile@ rather than __oline__ and
16051 __ofile__, to avoid unexpected expansions. Similarly, use @output
16052 rather than #output.
16053
16054 * data/c.m4 (b4_copyright): Omit file name from comment, since
16055 the file name could contain "*/".
16056 (b4_synclines_flag): Don't quote the 2nd argument; it should already
16057 be quoted. All uses changed.
16058
16059 * data/glr.c: Use new @ escapes consistently.
16060 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
16061 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
16062 Remove, since they couldn't handle arbitrary characters in file
16063 names.
16064 * data/lalr1.cc: Likewise.
16065 * data/yacc.c: Likewise.
16066
16067 * src/files.c (output_infix): Remove; all uses removed.
16068 * src/files.h: Likewise.
16069
16070 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
16071 mishandled funny characters in file names, and anyway it isn't
16072 needed any more.
16073 * data/yacc.c: Likewise.
16074 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
16075
16076 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
16077 * data/yacc.c: Likewise.
16078
16079 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
16080 strings now.
16081 (muscle_init): Quote filename as a C string.
16082 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
16083 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
16084 * src/output.c (escaped_file_name_output): New function.
16085 (prepare_symbols): Quote tokens for M4.
16086 (prepare): Don't insert output_infix, output_prefix,
16087 output_parser_name, output_header_name; this is now down by scan-skel.
16088 Insert skeleton as a C string.
16089
16090 * src/output.c (user_actions_output, symbol_destructors_output,
16091 symbol_printers_output): Quote filenames for C and M4.
16092 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16093
16094 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
16095 escapes other than \\ and \'; this simplifies the code.
16096 (<SC_STRING>): Likewise, for \\ and \".
16097 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
16098 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
16099 Use new escapes @{ and @} for [ and ].
16100
16101 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
16102 them with auto vars.
16103 Switch to new escape scheme, where @ is the escape character uniformly.
16104 Abort if a stray escape character is found. Avoid unbounded input
16105 buffer when parsing non-escaped text.
16106
16107 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
16108 __oline__, #output, $@, and @{ do not have unintended meanings.
16109
acea4f3b
PE
161102002-11-09 Paul Eggert <eggert@twinsun.com>
16111
16112 Fix the test failure due to GCC warnings described in
161a71f3 16113 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
16114 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
16115 evaluate to 0 if it's impossible for NINF to be in the respective
16116 table.
16117 (yygetLRActions, yyrecoverParseError): Use them.
16118
16119 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
16120 counted in the token inserted at end of file. Now takes
16121 location_t *, not location_t, so that the location can be
16122 adjusted. All uses changed.
16123
16124 * tests/regression.at (Invalid inputs): Adjust wording in
16125 diagnostic to match the new behavior.
16126
16127 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
16128 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
16129 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
16130 abort ();'. This reduces the runtime of the "Many lookaheads"
16131 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
16132 GCC 3.2.
16133
20ef1ad5
PE
161342002-11-07 Paul Eggert <eggert@twinsun.com>
16135
16136 * src/parse-gram.y (CHARACTER): Remove unused token.
16137 All uses removed.
16138
16139 * src/scan-gram.l: Remove stack option. We no longer use the
16140 stack, since the stack was never deeper than 1; instead, use the
16141 new auto var c_context to record the stacked value.
16142
16143 Remove nounput option. At an unexpected end of file, we now unput
16144 the minimal input necessary to end cleanly; this simplifies the
16145 code.
16146
16147 Avoid unbounded token sizes where this is easy.
16148
16149 (unexpected_end_of_file): New function.
16150 Use it to systematize the error message on unexpected EOF.
16151 (last-string): Now auto, not static.
16152 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
16153 (scanner_last_string_free): Remove; not used.
16154 (percent_percent_count): Move decl to just before use.
16155 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
16156 not the (never otherwised-used) CHARACTER.
16157
93724f13
AD
161582002-11-07 Akim Demaille <akim@epita.fr>
16159
16160 Let yyerror always receive the msg as last argument, so that
16161 yyerror can be variadic.
16162
16163 * data/yacc.c (b4_yyerror_args): New.
16164 Use it when calling yyerror.
16165 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
16166 Use it when calling yyerror.
16167 * doc/bison.texinfo (Error Reporting): Adjust.
16168 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
16169 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
16170
6e40b4eb
AD
161712002-11-06 Akim Demaille <akim@epita.fr>
16172
16173 #line should have quoted strings.
16174 Ideally, this should be done by m4_quotearg.
16175
16176 * src/scan-skel.l: Include quotearg.h.
16177 Quote __ofile__.
16178 * src/output.c (symbol_printers_output)
16179 (symbol_destructors_output): Quote the file name.
16180
2dfbfc12
AD
161812002-11-06 Akim Demaille <akim@epita.fr>
16182
16183 * tests/regression.at (Invalid inputs): Adjust to the recent
16184 messages.
16185
437c2d80
AD
161862002-11-06 Akim Demaille <akim@epita.fr>
16187
16188 Restore --no-lines.
16189 Reported by Jim Kent.
16190
16191 * data/c.m4 (b4_syncline): New.
16192 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
16193 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
16194 * src/output.c (user_actions_output): Likewise.
16195 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 16196 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 16197
900c5db5
AD
161982002-11-06 Akim Demaille <akim@epita.fr>
16199
16200 * src/main.c (main): Free `infile'.
16201 * src/scan-gram.l (handle_syncline): New.
16202 Recognize `#line'.
16203 * src/output.c (user_actions_output, symbol_destructors_output)
16204 (symbol_printers_output): Use the location's file name, not
16205 infile.
16206 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16207
e183b123 162082002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 16209
e183b123 16210 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 16211 either has GLR conflict entries.
e183b123 16212
193eb6b7
PE
162132002-11-05 Paul Eggert <eggert@twinsun.com>
16214
e183b123
PE
16215 * src/scan-gram.l: Use more accurate diagnostics, e.g.
16216 "integer out of range" rather than "invalid value".
16217 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
16218 accordingly.
16219
193eb6b7
PE
16220 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
16221 Also, remove one static variable in the scanner.
16222
16223 * src/scan-gram.l (braces_level): Now auto, not static.
16224 Initialize to zero if the compiler is being picky.
16225 (INITIAL): Clear braces_level instead of incrementing it.
16226 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
16227 as POSIX 1003.1-2001 requires.
16228 * src/system.h (IF_LINT): New macro, taken from coreutils.
16229 * configure.ac: Define "lint" if --enable-gcc-warnings.
16230
29c01725
AD
162312002-11-05 Akim Demaille <akim@epita.fr>
16232
16233 * src/scan-gram.l: When it starts with `%', complain about the
16234 whole directive, not just that `invalid character: %'.
16235
8aeac3ca
AD
162362002-11-04 Akim Demaille <akim@epita.fr>
16237
16238 * Makefile.maint: Update from Autoconf.
16239 (update, cvs-update, po-update, do-po-update): New.
16240
793a58bb
AD
162412002-11-04 Akim Demaille <akim@epita.fr>
16242
16243 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
16244 and yyerror.
16245 Have yyerror `use' its arguments.
16246 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
16247 returns true when location & yacc & pure & parse-param.
16248 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
16249
c4d720cd
AD
162502002-11-04 Akim Demaille <akim@epita.fr>
16251
16252 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
16253 clashes.
16254 * src/scan-gram.l: Use [\'] instead of ['] to pacify
16255 font-lock-mode.
16256 Use complain_at.
16257 Use quote, not quote_n since LOCATION_PRINT no longer uses the
16258 slot 0.
16259
613a0dc5
PE
162602002-11-03 Paul Eggert <eggert@twinsun.com>
16261
16262 * src/reader.c (get_merge_function, grammar_current_rule_check):
16263 Use consistent diagnostics for reporting type name clashes.
16264 Quote the types with <>, for consistency with Yacc.
16265 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
16266
2a8d363a
AD
162672002-11-03 Akim Demaille <akim@epita.fr>
16268
16269 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
16270 New.
16271 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
16272 (b4_parse_param): Remove.
16273 Use b4_identification.
16274 Propagate b4_pure_args where needed to pass them to yyerror.
16275 * data/glr.m4 (b4_parse_param): Remove.
16276 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
16277 (b4_lpure_formals): New.
16278 Use b4_identification.
16279 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
16280 b4_user_formals and b4_user_args.
16281 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
16282 (yyreportAmbiguity): When using a pure parser, also need
16283 the location, and the parse-params.
16284 Adjust callers.
16285 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
16286 When using a pure parser, also need the parse-params.
16287 Adjust callers.
16288 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
16289 (%pure-parser + %parse-param) LALR and GLR parsers.
16290 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
16291 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
16292 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
16293 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
16294 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
16295 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
16296 * doc/bison.texinfo: Untabify the whole file.
16297 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
16298 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
16299 (Error Reporting): Adjust to these new directives.
16300 Document %error-verbose, deprecate YYERROR_VERBOSE.
16301
9e32add8
AD
163022002-11-03 Akim Demaille <akim@epita.fr>
16303
16304 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
16305 AT_CHECK_CALC_GLR invocations to use % directives, instead of
16306 command line options.
16307 * tests/cxx-type.at: Formatting changes.
16308
b02d90a5
PE
163092002-11-03 Paul Eggert <eggert@twinsun.com>
16310
16311 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
16312 to count columns correctly, and to check for invalid inputs.
9e32add8 16313
b02d90a5
PE
16314 Use mbsnwidth to count columns correctly. Account for tabs, too.
16315 Include mbswidth.h.
16316 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
16317 (extend_location): New function.
16318 (YY_LINES): Remove.
16319
16320 Handle CRLF in C code rather than in Lex code.
16321 (YY_INPUT): New macro.
16322 (no_cr_read): New function.
16323
16324 Scan UCNs, even though we don't fully handle them yet.
16325 (convert_ucn_to_byte): New function.
16326
16327 Handle backslash-newline correctly in C code.
16328 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
16329 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
16330 all uses changed.
16331 (tag, splice): New EREs. Do not allow NUL or newline in tags.
16332 Use {splice} wherever C allows backslash-newline.
16333 YY_STEP after space, newline, vertical-tab.
16334 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 16335
b02d90a5
PE
16336 (letter, id): Don't assume ASCII; e.g., spell out a-z.
16337
16338 ({int}, handle_action_dollar, handle_action_at): Check for integer
16339 overflow.
9e32add8 16340
b02d90a5
PE
16341 (YY_STEP): Omit trailing semicolon, so that it's more like C.
16342
16343 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
16344 as well as \000. Check for UCHAR_MAX, not 255.
16345 Allow \x with an arbitrary positive number of digits, as in C.
16346 Check for overflow here.
16347 Allow \? and UCNs, for compatibility with C.
16348
16349 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
16350 with quote slot used by complain_at.
16351
16352 * tests/input.at: Add tests for backslash-newline, m4 quotes
16353 in symbols, long literals, and funny escapes in strings.
16354
16355 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
16356 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
16357 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
16358 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
16359 * m4/mbswidth.m4: New file, from GNU coreutils.
16360
16361 * doc/bison.texinfo (Grammar Outline): Document // comments.
16362 (Symbols): Document that trigraphs have no special meaning in Bison,
16363 nor is backslash-newline allowed.
16364 (Actions): Document that trigraphs have no special meaning.
16365
16366 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
16367 no longer used.
16368
163692002-11-02 Paul Eggert <eggert@twinsun.com>
16370
16371 * src/reader.c: Don't include quote.h; not needed.
16372 (get_merge_function): Reword warning to be consistent with
16373 type clash diagnostic in grammar_current_rule_check.
16374
16375 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
16376 bug in trigraph handling.
16377
16378 * src/output.c (prepare_symbols): When printing token names,
16379 escape "[" as "@<:@" and likewise for "]".
16380
16381 * src/system.h (errno): Remove declaration, as we are now
16382 assuming C89 or better, and C89 guarantees errno.
16383
762b212b
PE
163842002-10-30 Paul Eggert <eggert@twinsun.com>
16385
16386 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
16387 Check for close failures.
16388 * src/files.h (xfclose): Return void, not int, since it always
16389 returned zero.
16390 * src/files.c (xfclose): Likewise. Report I/O error if ferror
16391 indicates one.
16392 * src/output.c (output_skeleton): Use xfclose rather than fclose
16393 and ferror. xfclose now checks ferror.
16394
16395 * data/glr.c (YYLEFTMOST_STATE): Remove.
16396 (yyreportTree): Use a stack-based leftmost state. This avoids
16397 our continuing battles with bogus warnings about initializers.
16398
56100c60
AD
163992002-10-30 Akim Demaille <akim@epita.fr>
16400
16401 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
16402 #if.
16403
51b4a04c
PH
164042002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16405
16406 * tests/glr-regr1.at: New test for reported regressions.
16407 * tests/testsuite.at: Add glr-regr1.at test.
16408 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 16409
bf1ebda2
PE
164102002-10-24 Paul Eggert <eggert@twinsun.com>
16411
5c16c6b1
PE
16412 Version 1.75a.
16413
bf1ebda2
PE
16414 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
16415 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
16416 we use malloc. Don't assume 'A' through 'Z' are contiguous.
16417 Don't assume strdup exists; POSIX says its an XSI extension.
16418 Check for buffer overflow on input.
16419
b526ee61
AD
164202002-10-24 Akim Demaille <akim@epita.fr>
16421
16422 * src/output.c (output_skeleton): Don't disable M4sugar comments
16423 too soon: it results in comments being expanded.
16424 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
16425 first output.
16426
f1886bb2
AD
164272002-10-24 Akim Demaille <akim@epita.fr>
16428
16429 * data/yacc.c (m4_int_type): New.
16430 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
16431 char' as only yacc.c wants K&R portability.
16432 * data/glr.c (yysigned_char): Remove.
16433 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
16434 Reported by Quoc Peyrot.
16435
c5576256
PE
164362002-10-23 Paul Eggert <eggert@twinsun.com>
16437
16438 * src/main.c (main): With --trace=time, report times even if a
16439 non-fatal error occurs. Formerly, the times were reported in some
16440 such cases but not in others.
16441 * src/reader.c (reader): Just return if a complaint has been issued,
16442 instead of exiting, so that 'main' can report times.
16443
27b0ffea
AD
164442002-10-22 Akim Demaille <akim@epita.fr>
16445
16446 * src/system.h: Include sys/types.
16447 Reported by Bert Deknuydt.
16448
223a7883
PE
164492002-10-23 Paul Eggert <eggert@twinsun.com>
16450
16451 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
16452 Suggested by Art Haas.
16453
164542002-10-22 Paul Eggert <eggert@twinsun.com>
16455
16456 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
16457 decl; not needed any more.
16458 * src/main.c (main): Use return to exit, undoing yesterday's change.
16459 The last OS that we could find where this wouldn't work is
16460 SunOS 3.5, and that's too old to worry about now.
16461
16462 * data/glr.c (struct yyltype): Define members even when not
16463 doing locations. This is more consistent with yacc.c, and it
16464 works around the following bug reports:
161a71f3
PE
16465 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
16466 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 16467
223a7883
PE
16468 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
16469 @acronym consistently. Standardize on "Yacc" instead of "YACC",
16470 "Algol" instead of "ALGOL". Give a bit more history about BNF.
16471
8b76775a
AD
164722002-10-22 Akim Demaille <akim@epita.fr>
16473
16474 * data/README: New.
16475
6db10d14
PE
164762002-10-21 Paul Eggert <eggert@twinsun.com>
16477
16478 Be consistent about 'bool'; the old code used an enum in one
16479 module and an int in another, and this violates the C standard.
16480 * m4/stdbool.m4: New file, from coreutils 4.5.3.
16481 * configure.ac (AC_HEADER_STDBOOL): Add.
16482 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
16483 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
16484 * src/symtab.c (hash_compare_symbol_t): Likewise.
16485 * src/system.h (bool, false, true): Use a definition consistent
16486 with ../lib/hash.c. All uses changed.
16487
16488 * src/complain.c (warning_issued): Renamed from warn_message_count,
16489 so that we needn't worry about integer overflow (!).
16490 Now of type bool. All uses changed.
16491 (complaint_issued): Renamed from complain_message_count; likewise.
16492
16493 * src/main.c (main): Use exit to exit with failure.
27b0ffea 16494
6db10d14
PE
16495 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
16496 rather than 1 and 0.
16497 * src/main.c (main): Likewise.
16498 * src/getargs.c (getargs): Likewise.
16499 * src/reader.c (reader): Likewise.
16500
16501 * src/getarg.c (getargs): Remove duplicate code for
16502 "Try `bison --help'".
16503
16504 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
16505 What was that "2" for?
16506
16507 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
16508 * src/getargs.c (usage): Likewise.
16509
16510 * src/getargs.c (getargs): When there are too few operands, report
16511 the last one. When there are too many, report the first extra
16512 one. This is how diffutils does it.
16513
92a060fd
PE
165142002-10-20 Paul Eggert <eggert@twinsun.com>
16515
16516 Remove K&R vestiges.
16517 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
16518 * src/complain.c (VA_START): Remove. Assume prototypes.
16519 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
16520 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
16521 fatal): Assume prototypes.
16522 * src/complain.h: Assume prototypes.
16523 * src/system.h (PARAMS): Remove.
16524 Include <limits.h> unconditionally, since it's guaranteeed even
16525 for a freestanding C89 compiler.
16526 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
16527 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 16528
e7cb57c0
AD
165292002-10-20 Akim Demaille <akim@epita.fr>
16530
16531 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
16532 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
16533 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
16534 (yyresolveStates, yyresolveAction, yyresolveStack)
16535 (yyprocessOneStack): Use them.
16536 (yy_reduce_print): New.
16537 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
16538
0245f82d
AD
165392002-10-20 Akim Demaille <akim@epita.fr>
16540
16541 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
16542 arguments and output `void'.
16543 (b4_c_function): Rename as...
16544 (b4_c_function_def): this.
16545 (b4_c_function_decl, b4_c_ansi_function_def)
16546 (b4_c_ansi_function_decl): New.
16547 Change the interpretation of the arguments: before `int, foo', now
16548 `int foo, foo'.
16549 * data/yacc.c (yyparse): Prototype and define thanks to these.
16550 Adjust b4_c_function_def uses.
16551 * data/glr.c (yyparse): Likewise, but ANSI only.
16552
39912f52
AD
165532002-10-20 Akim Demaille <akim@epita.fr>
16554
16555 * src/output.c (prepare): Move the definition of `tokens_number',
16556 `nterms_number', `undef_token_number', `user_token_number_max'
16557 to...
16558 (prepare_tokens): Here.
16559 (prepare_tokens): Rename as...
16560 (prepare_symbols): this.
16561 (prepare): Move the definition of `rules_number' to...
16562 (prepare_rules): here.
16563 (prepare): Move the definition of `last', `final_state_number',
16564 `states_number' to...
16565 (prepare_states): here.
16566 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
16567
20c1e2ad
AD
165682002-10-20 Akim Demaille <akim@epita.fr>
16569
16570 * src/tables.h, src/tables.c, src/output.c: Comment changes.
16571
21964f43
AD
165722002-10-20 Akim Demaille <akim@epita.fr>
16573
16574 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
16575 * data/c.m4: here.
16576
66d30cd4
AD
165772002-10-20 Akim Demaille <akim@epita.fr>
16578
16579 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
16580 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
16581 `pair'.
16582 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
16583 `name' to...
16584 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
16585 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
16586 These.
16587
95f2c9fe
PE
165882002-10-19 Paul Eggert <eggert@twinsun.com>
16589
16590 Do not create a temporary file, as that involves security and
16591 cleanup headaches. Instead, use a pair of pipes.
16592 Derived from a suggestion by Florian Krohm.
16593 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
16594 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
16595 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
16596 (BISON_PREREQ_SUBPIPE): Add.
16597 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
16598 Add subpipe.h, subpipe.c.
16599 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
16600 * po/POTFILES.in: Add lib/subpipe.c.
16601 * src/output.c: Include "subpipe.h".
16602 (m4_invoke): Remove decl.
16603 (scan_skel): New decl.
16604 (output_skeleton): Use pipe rather than temporary file for m4 input.
16605 Check that m4sugar.m4 is readable, to avoid deadlock.
16606 Check for pipe I/O error.
16607 * src/scan-skel.l (readpipe): Remove decl.
16608 (scan_skel): New function, to be used in place of m4_invoke.
16609 Read from stream rather than file.
66d30cd4 16610
95f2c9fe
PE
16611 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
16612 float, as this generates a warning on Solaris 8 + GCC 3.2 with
16613 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
16614 this generates a more-accurate value anyway.
16615
16616 * lib/timevar.c (timervar_accumulate): Rename locals to
16617 avoid confusion with similarly-named more-global.
16618 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
16619
16620 * src/output.c (prepare): Use xstrdup to convert char const *
16621 to char *, to avoid GCC warning.
16622
c19988b7
AD
166232002-10-19 Akim Demaille <akim@epita.fr>
16624
16625 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
16626 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
16627 Use them to have `calc.y' ready for %pure-parser.
16628 * data/yacc.c (YYLEX): Pass a yylex return type to
16629 b4_c_function_call.
16630
ae7453f2
AD
166312002-10-19 Akim Demaille <akim@epita.fr>
16632
16633 Prototype support of %lex-param and %parse-param.
16634
16635 * src/parse-gram.y: Add the definition of the %lex-param and
16636 %parse-param tokens, plus their rules.
16637 Drop the `_' version of %glr-parser.
16638 Add the "," token.
16639 * src/scan-gram.l (INITIAL): Scan them.
16640 * src/muscle_tab.c: Comment changes.
16641 (muscle_insert, muscle_find): Rename `pair' as `probe'.
16642 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
16643 (muscle_entry_s): The `value' member is no longer const.
16644 Adjust all dependencies.
16645 * src/muscle_tab.c (muscle_init): Adjust: use
16646 MUSCLE_INSERT_STRING.
16647 Initialize the obstack earlier.
16648 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
16649 (muscle_pair_list_grow): New.
16650 * data/c.m4 (b4_c_function_call, b4_c_args): New.
16651 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
16652 * tests/calc.at: Use %locations, not --locations.
16653 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
16654
0e575721
AD
166552002-10-19 Akim Demaille <akim@epita.fr>
16656
16657 * src/getargs.c (usage): Take status as argument and exit
16658 accordingly.
16659 Report the traditional `Try ... --help' message when status != 0.
16660 (usage, version): Don't take a FILE * as arg, it is pointless.
16661 (getargs): When there is an incorrect number of arguments, make it
16662 an error, and report it GNUlically thanks to `usage ()'.
16663
724ce7f5
PE
166642002-10-18 Paul Eggert <eggert@twinsun.com>
16665
3a781eb2
PE
16666 * data/glr.c (yyreportParseError): Don't assume that sprintf
16667 yields the length of the printed string, as this is not true
16668 on SunOS 4.1.4. Reported by Peter Klein.
16669
724ce7f5
PE
16670 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
16671 * tests/conflicts.at (%nonassoc and eof): Likewise.
16672 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
16673
473d0a75
AD
166742002-10-17 Akim Demaille <akim@epita.fr>
16675
16676 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
16677 * src/getargs.c (trace_types, trace_args): Adjust.
16678 * src/reader.c (grammar_current_rule_prec_set)
16679 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
16680 Standardize error messages.
16681 And s/@prec/%prec/!
16682 (reader): Use trace_flag to enable scanner/parser debugging,
16683 instead of an adhoc scheme.
16684 * src/scan-gram.l: Remove trailing debugging code.
16685
e76d2469
PE
166862002-10-16 Paul Eggert <eggert@twinsun.com>
16687
93e2236a
PE
16688 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
16689 MUSCLE_TAB_H.
16690
e76d2469
PE
16691 * NEWS: Officially drop support for building Bison with K&R C,
16692 since it didn't work anyway and it's not worth worrying about.
16693 * Makefile.maint (wget_files): Remove ansi2knr.c.
16694 (ansi2knr.c-url_prefix): Remove.
16695 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
16696 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16697 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16698
5bd1c419
PE
166992002-10-15 Paul Eggert <eggert@twinsun.com>
16700
16701 Stop using the "enum_" trick for K&R-style function definitions;
16702 it confused me, and I was the author! Instead, assume that people
16703 who want to use K&R C compilers (when using these modules in GCC,
16704 perhaps?) will run ansi2knr.
16705
16706 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
16707 All uses of "enum_" changed to "enum ".
16708 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16709 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 16710
5bd1c419
PE
16711 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
16712 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
16713 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
16714 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
16715 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
16716 abitset_not, abitset_ones, abitset_or, abitset_or_and,
16717 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
16718 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
16719 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
16720 Use function prototypes; this removes the need for declaring
16721 static functions simply to provide their prototypes.
16722 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
16723 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
16724 bitset_count_, bitset_create, bitset_dump, bitset_first,
16725 bitset_free, bitset_init, bitset_last, bitset_next,
16726 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
16727 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
16728 bitset_print, bitset_release_memory, bitset_toggle_,
16729 bitset_type_choose, bitset_type_get, bitset_type_name_get,
16730 debug_bitset): Likewise.
16731 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
16732 * lib/bitset_stats.c (bitset_log_histogram_print,
16733 bitset_percent_histogram_print, bitset_stats_and,
16734 bitset_stats_and_cmp, bitset_stats_and_or,
16735 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
16736 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
16737 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
16738 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
16739 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
16740 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
16741 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
16742 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
16743 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
16744 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
16745 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
16746 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
16747 bitset_stats_zero): Likewise.
16748 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16749 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16750 bitsetv_dump, debug_bitsetv): Likewise.
16751 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
16752 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
16753 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
16754 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
16755 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
16756 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
16757 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
16758 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
16759 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
16760 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
16761 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
16762 Likewise.
16763 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
16764 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
16765 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
16766 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
16767 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
16768 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
16769 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
16770 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
16771 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
16772 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
16773 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 16774
ae26e1f0
AD
167752002-10-14 Akim Demaille <akim@epita.fr>
16776
16777 Version 1.75.
16778
d43baf71
AD
167792002-10-14 Akim Demaille <akim@epita.fr>
16780
16781 * tests/Makefile.am (maintainer-check-posix): New.
16782
7ebc83e3
AD
167832002-10-14 Akim Demaille <akim@epita.fr>
16784
16785 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
16786 member.
16787
05846dae
AD
167882002-10-14 Akim Demaille <akim@epita.fr>
16789
16790 * src/tables.c (table_ninf_remap): base -> tab.
16791 Reported by Matt Rosing.
16792
1318e37d
PE
167932002-10-14 Paul Eggert <eggert@twinsun.com>
16794
447fbb17
PE
16795 * tests/action.at, tests/calc.at, tests/conflicts.at,
16796 tests/cxx-type.at, tests/headers.at, tests/input.at,
16797 tests/regression.at, tests/synclines.at, tests/torture.at:
16798 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
16799 so that the tests still work even if POSIXLY_CORRECT is set.
16800 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 16801
1318e37d
PE
16802 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
16803 for portability to K&R hosts. Fix typo: signed char is guaranteed
16804 only to 127, not to 128.
16805 * data/glr.c (yysigned_char): New type.
16806 * data/yacc.c (yysigned_char): Likewise.
16807 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
16808
cc0f0794
PE
168092002-10-13 Paul Eggert <eggert@twinsun.com>
16810
5038f418
PE
16811 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
16812 true due to limited range of data type" warning from GCC.
16813
cc0f0794
PE
16814 * data/c.m4 (b4_token_defines): Protect against double-inclusion
16815 by wrapping enum yytokentype's definition inside #ifndef
16816 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
16817
6fed0802
AD
168182002-10-13 Akim Demaille <akim@epita.fr>
16819
16820 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
16821 Un yy- yyrhs to avoid the name clash with the global YYRHS.
16822
32f0598d
AD
168232002-10-13 Akim Demaille <akim@epita.fr>
16824
16825 * Makefile.maint: Update from Autoconf 2.54.
16826 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
16827
7ea9a33f
AD
168282002-10-13 Akim Demaille <akim@epita.fr>
16829
16830 * src/print.c (print_state): Separate the list of solved conflicts
16831 from the other items.
16832 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
16833
ea99527d
AD
168342002-10-13 Akim Demaille <akim@epita.fr>
16835
16836 Let nondeterministic skeletons be usable with deterministic
16837 tables.
16838
16839 With the patch, GAWK compiled by GCC without -O2 passes its test
16840 suite using a GLR parser driven by LALR tables. It fails with -O2
16841 because `struct stat' gives two different answers on my machine:
16842 88 (definition of an auto var) and later 96 (memset on this var).
16843 Hence the stack is badly corrumpted. The headers inclusion is to
16844 blame: if I move the awk.h inclusion before GLR's system header
16845 inclusion, the two struct stat have the same size.
16846
16847 * src/tables.c (pack_table): Always create conflict_table.
16848 (token_actions): Always create conflict_list.
16849 * data/glr.c (YYFLAG): Remove, unused.
16850
f377f69f
AD
168512002-10-13 Akim Demaille <akim@epita.fr>
16852
16853 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
16854 (O0FLAGS): New.
16855 (VALGRIND, GXX): New.
16856 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
16857 * tests/bison.in: Run $PREBISON a pre-command.
16858 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
16859 (maintainer-check-g++): New.
16860 * Makefile.am (maintainer-check): New.
16861
2a1fe6ed
AD
168622002-10-13 Akim Demaille <akim@epita.fr>
16863
16864 * data/glr.c: Formatting changes.
16865 Tweak some trace messages to match yacc.c's.
16866
f50adbbd
AD
168672002-10-13 Akim Demaille <akim@epita.fr>
16868
16869 GLR parsers sometimes raise parse errors instead of performing the
16870 default reduction.
16871 Reported by Charles-Henry de Boysson.
16872
16873 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 16874 check the length of the traces when %glr.
f50adbbd
AD
16875 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
16876 GLR's traces.
16877 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
16878 Test GLR parsers.
16879 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
16880 (yyltype): Remove the yy prefix from the member names.
16881 (yytable): Complete its comment.
16882 (yygetLRActions): Map error action number from YYTABLE from
16883 YYTABLE_NINF to 0.
16884 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
16885 (which was a bug: it should have been YYTABEL_NINF, and yet it was
16886 not satisfying as we could compare an YYACTION computed from
16887 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
16888 only value for error actions.
16889 (yyreportParseError): In verbose parse error messages, don't issue
16890 `error' in the list of expected tokens.
16891 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
16892 next action to perform to match glr.c's decoding.
16893 (yytable): Complete its comment.
16894
bcbad5b9
PE
168952002-10-13 Paul Eggert <eggert@twinsun.com>
16896
16897 Fix problem reported by Henrik Grubbstroem in
161a71f3 16898 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
16899 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
16900 because the Bison parser reads the second action before reducing
16901 the first one.
16902 * src/scan-gram.l (rule_length): New static var.
16903 Use it to keep track of the rule length in the scanner, since
16904 we can't expect the parser to be in lock-step sync with the scanner.
16905 (handle_action_dollar, handle_action_at): Use this var.
16906 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 16907
14904b89
PE
169082002-10-12 Paul Eggert <eggert@twinsun.com>
16909
1fe611e5
PE
16910 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
16911 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
16912 Include <sys/time.h> when checking for clock_t and struct tms.
16913 Use same include order as source.
16914 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 16915 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 16916
1fe611e5
PE
16917 * lib/timevar.c: Update copyright date and clarify comments.
16918 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 16919
1fe611e5
PE
16920 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
16921 GCC version as of today, then merge Bison's changes.
16922 Change "GCC" to "Bison" in copyright notice. timevar.def's
16923 author is Akim, so change that too.
16924
98194095
PE
16925 * src/reader.c (grammar_current_rule_check):
16926 Don't worry about the default action if $$ is untyped.
16927 Prevents bogus warnings reported by Jim Gifford in
161a71f3 16928 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 16929
14904b89
PE
16930 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
16931 * data/glr.c, data/lalr1.cc, data/yacc.c:
16932 Output token definitions before the first part of user declarations.
16933 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 16934 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 16935
ff6dca18
PE
169362002-10-11 Paul Eggert <eggert@twinsun.com>
16937
16938 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
16939 (yyparse): here. This undoes some of the 2002-07-25 change.
16940 Compatibility problem reported by Ralf S. Engelschall with
16941 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
16942
eb714592
AD
169432002-10-11 Akim Demaille <akim@epita.fr>
16944
16945 * tests/regression.at Characters Escapes): New.
16946 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
16947 characters.
16948 Reported by Jan Nieuwenhuizen.
16949
b7195100
AD
169502002-10-11 Akim Demaille <akim@epita.fr>
16951
16952 * po/id.po: New.
16953
f28a0f2d
PE
169542002-10-10 Paul Eggert <eggert@twinsun.com>
16955
16956 Portability fixes for bitsets; this also avoids several GCC
16957 warnings.
16958
16959 * lib/abitset.c: Include <stddef.h>, for offsetof.
16960 * lib/lbitset.c: Likewise.
16961
16962 * lib/abitset.c (abitset_bytes): Return a size that is aligned
16963 properly for vectors of objects. Do not assume that adding a
16964 header size to a multiple of a word size yields a value that is
16965 properly aligned for the whole union.
16966 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16967
16968 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16969 unique names for structures.
16970 * lib/ebitset.c (ebitset_bytes): Likewise.
16971 * lib/lbitset.c (lbitset_bytes): Likewise.
16972
16973 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
16974 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
16975 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
16976 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
16977 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
16978 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
16979 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
16980 to improve the type-checking that GCC can do.
16981 * lib/bitset.c (bitset_op4_cmp): Likewise.
16982 * lib/bitset_stats.c (bitset_stats_count,
16983 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
16984 bitset_stats_copy, bitset_stats_disjoint_p,
16985 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
16986 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
16987 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
16988 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
16989 bitset_stats_and_or_cmp, bitset_stats_andn_or,
16990 bitset_stats_andn_or_cmp, bitset_stats_or_and,
16991 bitset_stats_or_and_cmp): Likewise.
16992 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
16993 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
16994 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
16995 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
16996
16997 * lib/abitset.h: Include bitset.h, not bbitset.h.
16998 * lib/ebitset.h: Likewise.
16999 * lib/lbitset.h: Likewise.
17000
17001 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
17002 All instances of parameters of type enum bitset_opts are now of
17003 type enum_bitset_opts, to conform to the C Standard, and similarly
17004 for enum_bitset_type.
17005 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17006 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
17007
17008 Do not use "struct bitset_struct" to mean different things in
17009 different modules. Not only is this confusing, it violates
17010 the C Standard, which requires that structure types in different
17011 modules must be compatible if one is to be passed to the other.
17012 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
17013 All instances of "struct bitset_struct *" replaced with "bitset".
17014 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
17015 (union bitset_union, struct abitset_struct, struct ebitset_struct,
17016 struct lbitset_struct, struct bitset_stats_struct): New types.
17017 All uses of struct bitset_struct changed to union bitset_union,
17018 etc.
ba0fe3c7 17019 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
17020 struct bitset_struct): Remove.
17021 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
17022 struct bitset_struct): Remove.
17023 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
17024 bitset_struct): Remove.
17025 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
17026 Likewise.
17027
17028 Do not call a function of type T using a call that assumes the
17029 function is of a different type U. Standard C requires that a
17030 function must be called with a type that is compatible with its
17031 definition.
17032 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17033 New decls.
17034 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17035 New functions.
17036 * lib/ebitset.c (PFV): Remove.
17037 * lib/lbitset.c (PFV): Likewise.
17038 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
17039 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
17040 decls.
17041 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
17042 (ebitset_vtable): Use them.
17043 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
17044 lbitset_xor): New functions.
17045 (lbitset_vtable): Use them.
17046
17047 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
17048 Declare.
17049
17050 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
17051 GCC warning.
17052 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
17053 Use offsetof, for simplicity.
17054
6fbe4984
PE
170552002-10-06 Paul Eggert <eggert@twinsun.com>
17056
17057 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
17058 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 17059 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
17060 which was inadvertently undone by the 2002-09-30 patch.
17061 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
17062 the same width as int.
17063
420f93c8
PE
170642002-10-04 Paul Eggert <eggert@twinsun.com>
17065
17066 Version 1.50.
17067
17068 * configure.ac (AC_INIT), NEWS: Increment version number.
17069
17070 * doc/bison.texinfo: Minor spelling, grammar, and white space
17071 fixes.
17072 (Symbols): Mention that any negative value returned from yylex
17073 signifies end-of-input. Warn about negative chars. Mention
17074 the portable Standard C character set.
17075
17076 The GNU coding standard says CFLAGS and YFLAGS are reserved
17077 for the installer to set.
17078 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
17079 * src/Makefile.am (AM_CFLAGS): Likewise.
17080 (AM_YFLAGS): Renamed from YFLAGS.
17081
17082 Fix some MAX and MIN problems.
17083 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
17084 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
17085 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
17086 * src/reader.c (reader): Use it.
17087
17088 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
17089 POSIX 1003.1-2001 has removed fgrep.
17090
170912002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
17092
17093 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
17094 interpreted as signed.
17095 * lib/ebitset.c (ebitset_list): Fix bug.
17096
ff68026d
PE
170972002-10-01 Paul Eggert <eggert@twinsun.com>
17098
17099 More fixes for 64-bit hosts and large bitsets.
17100
17101 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
17102 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
17103 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
17104 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
17105 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
17106 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
17107 bitset_count_): Likewise.
17108 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
17109 bitset_first, bitset_last): Likewise.
17110 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
17111 bitset_stats_list_reverse, bitset_stats_size,
17112 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
17113 Likewise.
17114 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17115 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17116 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17117 bitsetv_reflexive_transitive_closure): Likewise.
17118 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
17119 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
17120 Likewise.
17121 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
17122 Likewise.
420f93c8 17123
ff68026d
PE
17124 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
17125 Use size_t, not unsigned int, to count bytes.
17126 * lib/abitset.h (abitset_bytes): Likewise.
17127 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
17128 Likewise.
17129 * lib/bitset.h (bitset_bytes): Likewise.
17130 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
17131 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
17132 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17133 * lib/ebitset.c (ebitset_bytes): Likewise.
17134 * lib/ebitset.h (ebitset_bytes): Likewise.
17135 * lib/lbitset.c (lbitset_bytes): Likewise.
17136 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 17137
ff68026d
PE
17138 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
17139 abitset_subset_p, abitset_disjoint_p, abitset_and,
17140 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
17141 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
17142 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
17143 abitset_or_and, abitset_or_and_cmp):
17144 Use bitset_windex instead of unsigned int.
17145 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17146 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
17147 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
17148 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
17149 Likewise.
17150 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 17151
ff68026d
PE
17152 * lib/bitset.c (bitset_print):
17153 Use proper printf formats for widths of integer types.
17154 * lib/bitset_stats.c (bitset_percent_histogram_print,
17155 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
17156 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17157 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17158 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 17159
ff68026d
PE
17160 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
17161 BITSET_SIZE_MAX): New macros.
17162 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
17163 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
17164 to BITSET_WINDEX_MAX.
17165
17166 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
17167 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
17168 since we now return the bitset_bindex type (not int).
17169
17170 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
17171 when computing sizes.
17172 * lib/ebitset.c (ebitset_elts_grow): Likewise.
17173
17174 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
17175 and avoid cast to unsigned.
17176
6aa452a6
AD
171772002-09-30 Akim Demaille <akim@epita.fr>
17178
17179 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
17180 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
17181 Updates from Michael Hayes.
17182
927f7817
AD
171832002-09-30 Art Haas <ahaas@neosoft.com>
17184
17185 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
17186 invocations.
17187 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
17188 defined.
17189
9738f41e
AD
171902002-09-27 Akim Demaille <akim@epita.fr>
17191
17192 Version 1.49c.
17193
a5c75d7f
AD
171942002-09-27 Akim Demaille <akim@epita.fr>
17195
17196 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
17197 (Because of AC_LIBSOURCE).
17198
8280e179
AD
171992002-09-27 Akim Demaille <akim@epita.fr>
17200
17201 Playing with Autoscan.
17202
17203 * configure.ac: Remove the old LIBOBJ tweaks.
17204 (AC_REPLACE_FUNCS): Add strrchr and strtol.
17205 * lib/strrchr.c: New.
17206 * lib/strtol.c: New, from the Coreutils 4.5.1.
17207
ae64af35
AD
172082002-09-27 Akim Demaille <akim@epita.fr>
17209
17210 Playing with Autoscan.
17211
17212 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
17213 * lib/Makefile.am (libbison_a_SOURCES): No longer include
17214 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
17215 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
17216 Coreutils 4.5.1.
17217
d1a1114f
AD
172182002-09-24 Akim Demaille <akim@epita.fr>
17219
17220 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
17221 (Frequently Asked Questions, Parser Stack Overflow): New.
17222
b906441c
AD
172232002-09-13 Akim Demaille <akim@epita.fr>
17224
17225 Playing with autoscan.
17226
17227 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
17228 * src/files.c (skeleton_find): Remove, unused.
17229 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
17230 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
17231
bd701811
AD
172322002-09-13 Akim Demaille <akim@epita.fr>
17233
17234 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
17235 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
17236
e0a13e7b
AD
172372002-09-13 Akim Demaille <akim@epita.fr>
17238
17239 * configure.ac: Require 2.54.
17240 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
17241 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
17242 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
17243 Remove, provided by Autoconf macros.
17244
c97011bf
AD
172452002-09-12 Akim Demaille <akim@epita.fr>
17246
17247 * m4/prereq.m4: Update, from Coreutils 4.5.1.
17248
d862b1be
AD
172492002-09-12 Akim Demaille <akim@epita.fr>
17250
17251 * m4/prereq.m4: Update, from Fileutils 4.1.5.
17252 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
17253 Reported by Martin Mokrejs.
17254
3d38c03a
AD
172552002-09-10 Akim Demaille <akim@epita.fr>
17256
17257 * src/parse-gram.y: Associate a human readable string to each
17258 token type.
17259 * tests/regression.at (Invalid inputs): Adjust.
17260
b6347355
AD
172612002-09-10 Gary V. Vaughan <gary@gnu.org>
17262
17263 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
17264 with an Autoconf-2.5x style configure.ac.
17265
09ba4ab2
PE
172662002-09-06 Paul Eggert <eggert@twinsun.com>
17267
17268 * doc/bison.texinfo (Conditions): Make explicit that the GPL
17269 exception applies only to yacc.c. This is a modification of a
17270 patch originally suggested by Akim Demaille.
17271
21846f69
AD
172722002-09-06 Akim Demaille <akim@epita.fr>
17273
09ba4ab2
PE
17274 * data/c.m4 (b4_copyright): Move the GPL exception comment from
17275 here to...
17276 * data/yacc.c: here.
17277
21846f69
AD
17278 * data/lalr1.cc (struct yyltype): Don't define it, since we use
17279 LocationType.
17280 (b4_ltype): Default to yy::Location from location.hh.
17281
c0ad8bf3
AD
172822002-09-04 Jim Meyering <jim@meyering.net>
17283
17284 * data/yacc.c: Guard the declaration of yytoknum also with
17285 `#ifdef YYPRINT', so it is declared only when used.
17286
3a93251e
AD
172872002-09-04 Akim Demaille <akim@epita.fr>
17288
17289 * configure.in: Rename as...
17290 * configure.ac: this.
17291 Bump to 1.49c.
17292
427c0dda
AD
172932002-09-04 Akim Demaille <akim@epita.fr>
17294
17295 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
17296 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
17297 translate maintainer only messages.
17298
6a254321
PE
172992002-08-12 Paul Eggert <eggert@twinsun.com>
17300
645e30d1
PE
17301 Version 1.49b.
17302
6a254321
PE
17303 * Makefile.am (SUBDIRS): Remove intl.
17304 (DISTCLEANFILES): Remove.
17305 * NEWS: Mention that GNU M4 is now required. Clarify what is
17306 meant by "larger grammars". Mention the pt_BR translation.
17307 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
17308 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
17309 Bump version from 0.11.2 to 0.11.5.
17310 (BISON_PREREQ_STAGE): Remove.
17311 (AM_GNU_GETTEXT): Use external gettext.
17312 (AC_OUTPUT): Remove intl/Makefile.
17313
17314 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
17315
17316 * data/glr.c: Include string.h, for strlen.
17317 (yyreportParseError): Use size_t for yysize.
17318 (yy_yypstack): No longer nested inside yypstates, as nested
17319 functions are not portable. Do not assume size_t is the
17320 same width as int.
17321 (yypstates): Do not assume that ptrdiff_t is the same width
17322 as int, and similarly for yyposn and YYINDEX.
17323
17324 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
17325
17326 * lib/Makefile.am (INCLUDES): Do not include from the intl
17327 directory, which has been removed.
17328 * src/Makefile.am (INCLUDES): Likewise.
17329
17330 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
17331 (bitsets_sources, additional_bitsets_sources, timevars_sources):
17332 New vars.
17333
17334 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
17335 * tests/Makefile.am (EXTRA_DIST): Likewise.
17336
17337 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
17338 Do not assume that bitset_windex is the same width as unsigned.
17339
17340 * lib/abitset.c (abitset_unused_clear): Do not assume that
17341 bitset_word is the same width as int.
17342 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
17343 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
17344 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
17345 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
17346 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
17347
17348 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
17349 portability to one's complement hosts!).
17350 * lib/ebitset.c (ebitset_op1): Likewise.
17351 * lib/lbitset.c (lbitset_op1): Likewise.
17352
17353 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
17354 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
17355 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
17356 Sync with fileutils.
17357 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
17358 lib/gettext.h: Sync with diffutils.
17359
17360 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
17361 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
17362
17363 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
17364 PROTOTYPES to check for prototypes, and "defined __STDC__" to
17365 check for void *.
17366
17367 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
17368 size_t; the old version tried to do this but casted improperly.
17369 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
17370 (bitset_test): Now returns int, not unsigned long.
17371
17372 * lib/bitset_stats.c: Include "gettext.h".
17373 (_): New macro.
17374 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
17375 name locals "index", as it generates unnecessary warnings on some
17376 hosts that have an "index" function.
17377
17378 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
17379 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
17380 they need translation.
17381 * src/LR0.c (state_list_append, new_itemsets, get_state,
17382 append_states, generate_states): Likewise.
17383 * src/assoc.c (assoc_to_string): Likewise.
17384 * src/closure.c (print_closure, set_firsts, closure): Likewise.
17385 * src/gram.c (grammar_dump): Likewise.
17386 * src/injections.c (injections_compute): Likewise.
17387 * src/lalr.c (lookaheads_print): Likewise.
17388 * src/relation.c (relation_transpose): Likewise.
17389 * src/scan-gram.l: Likewise.
17390 * src/tables.c (table_grow, pack_vector): Likewise.
17391
17392 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
17393 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
17394 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
17395 * m4/mbstate_t.m4: Sync with fileutils.
17396 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
17397
17398 * po/LINGUAS: Add pt_BR.
17399 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
17400 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
17401 lib/timevar.c.
17402 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
17403 manual recommends.
17404 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
17405
17406 * src/complain.c (strerror_r): Remove decl; not needed.
17407 (strerror): Use same pattern as ../lib/error.c.
17408
17409 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
17410
17411 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
17412
17413 * src/main.c (main): Cast result of bindtextdomain and textdomain
17414 to void, to avoid a GCC warning when --disable-nls is in effect.
17415
17416 * src/scan-gram.l: Use strings rather than escapes when possible,
17417 to minimize the number of warnings from xgettext.
17418 (handle_action_dollar, handle_action_at): Don't use isdigit,
17419 as it mishandles negative chars and it may not work as expected
17420 outside the C locale.
17421
17422 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
17423 this is a GCC extension and is not portable to other compilers.
17424
17425 * src/system.h (alloca): Use same pattern as ../lib/error.c.
17426 Do not include <ctype.h>; no longer needed.
17427 Do not include <malloc.h>; no longer needed (and generates
17428 warnings on OpenBSD 3.0).
17429
17430 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
17431 it's not portable.
17432
17433 * tests/regression.at: Do not use 'cc -c input.c -o input';
17434 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
17435
17436 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
17437 exit status as failure, not just exit status 1. Sun C exits
17438 with status 2 sometimes.
17439
17440 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
17441 Use it for the two large tests.
17442
c8f002c7
AD
174432002-08-02 Akim Demaille <akim@epita.fr>
17444
17445 * src/conflicts.c (conflicts_output): Don't output rules never
17446 reduced here, since anyway that computation doesn't work.
17447 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
17448 (rule_useless_p, rule_never_reduced_p): New.
17449 (grammar_rules_partial_print): Use a filter instead of a range.
17450 Display the title only if needed.
17451 (grammar_rules_print): Adjust.
17452 (grammar_rules_never_reduced_report): New.
17453 * src/tables.c (action_row): Move the computation of rules never
17454 reduced to...
17455 (token_actions): here.
17456 * src/main.c (main): Make the parser before making the report, so
17457 that rules never reduced are computed.
17458 Call grammar_rules_never_reduced_report.
17459 * src/print.c (print_results): Report rules never reduced.
17460 * tests/conflicts.at, tests/reduce.at: Adjust.
17461
cd08e51e
AD
174622002-08-01 Akim Demaille <akim@epita.fr>
17463
17464 Instead of attaching lookaheads and duplicating the rules being
17465 reduced by a state, attach the lookaheads to the reductions.
17466
17467 * src/state.h (state_t): Remove the `lookaheads',
17468 `lookaheads_rule' member.
17469 (reductions_t): Add a `lookaheads' member.
17470 Use a regular array for the `rules'.
17471 * src/state.c (reductions_new): Initialize the lookaheads member
17472 to 0.
17473 (state_rule_lookaheads_print): Adjust.
17474 * src/state.h, src/state.c (state_reductions_find): New.
17475 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
17476 (count_rr_conflicts): Adjust.
17477 * src/lalr.c (LArule): Remove.
17478 (add_lookback_edge): Adjust.
17479 (state_lookaheads_count): New.
17480 (states_lookaheads_initialize): Merge into...
17481 (initialize_LA): this.
17482 (lalr_free): Adjust.
17483 * src/main.c (main): Don't free nullable and derives too early: it
17484 is used by --verbose.
17485 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
17486
bb0027a9
AD
174872002-08-01 Akim Demaille <akim@epita.fr>
17488
17489 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
17490 `rule_number_t**'.
17491 (set_derives, free_derives): Rename as...
17492 (derives_compute, derives_free): this.
17493 Adjust all dependencies.
17494 * src/nullable.c (set_nullable, free_nullable): Rename as...
17495 (nullable_compute, nullable_free): these.
17496 (rule_list_t): Store rule_t *, not rule_number_t.
17497 * src/state.c (state_rule_lookaheads_print): Directly compare rule
17498 pointers, instead of their numbers.
17499 * src/main.c (main): Call nullable_free, and derives_free earlier,
17500 as they were lo longer used.
17501
3325ddc4
AD
175022002-08-01 Akim Demaille <akim@epita.fr>
17503
17504 * lib/timevar.c (get_time): Include children time.
17505 * src/lalr.h (LA, LArule): Don't export them: used with the
17506 state_t.
17507 * src/lalr.c (LA, LArule): Static.
17508 * src/lalr.h, src/lalr.c (lalr_free): New.
17509 * src/main.c (main): Call it.
17510 * src/tables.c (pack_vector): Check whether loc is >= to the
17511 table_size, not >.
17512 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
17513 (tables_generate): do it, since that's also it which allocates
17514 them.
17515 Don't free LA and LArule, main does.
17516
c6f1a33c
AD
175172002-07-31 Akim Demaille <akim@epita.fr>
17518
17519 Separate parser tables computation and output.
17520
17521 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
17522 (conflict_list, conflict_list_cnt, table, check, table_ninf)
17523 (yydefgoto, yydefact, high): Move to...
17524 * src/tables.h, src/tables.c: here.
17525 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17526 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17527 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
17528 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
17529 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
17530 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
17531 (action_row, save_row, token_actions, save_column, default_goto)
17532 (goto_actions, sort_actions, matching_state, pack_vector)
17533 (table_ninf_remap, pack_table, prepare_actions): Move to...
17534 * src/tables.c: here.
17535 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
17536 * src/output.c (token_actions, output_base, output_conflicts)
17537 (output_check): Merge into...
17538 (prepare_actions): this.
17539 (actions_output): Rename as...
17540 (user_actions_output): this.
17541 * src/main.c (main): Call tables_generate and tables_free.
17542
1509d42f
AD
175432002-07-31 Akim Demaille <akim@epita.fr>
17544
17545 Steal GCC's --time-report support.
17546
17547 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
17548 stolen/adjusted from GCC.
17549 * m4/stage.m4: Remove time related checks.
17550 * m4/timevar.m4: New.
17551 * configure.in: Adjust.
17552 * src/system.h: Adjust to using timevar.h.
17553 * src/getargs.h, src/getargs.c: Support trace_time for
17554 --trace=time.
17555 * src/main.c (stage): Remove.
17556 (main): Replace `stage' invocations with timevar calls.
17557 * src/output.c: Insert pertinent timevar calls.
17558
273a74fa
AD
175592002-07-31 Akim Demaille <akim@epita.fr>
17560
17561 Let --trace have arguments.
17562
17563 * src/getargs.h (enum trace_e): New.
17564 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
17565 (long_options, short_options): --trace/-T takes an optional
17566 argument.
17567 Change all the uses of trace_flag to reflect the new flags.
17568 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
17569
17570 Strengthen `stage' portability.
17571
17572 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
17573 * configure.in: Use it.
17574 Don't check for malloc.h and sys/times.h.
17575 * src/system.h: Include them when appropriate.
17576 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
17577 times and struct tms are available.
17578
217598da
AD
175792002-07-30 Akim Demaille <akim@epita.fr>
17580
17581 In verbose parse error message, don't report `error' as an
17582 expected token.
17583 * tests/actions.at (Printers and Destructors): Adjust.
17584 * tests/calc.at (Calculator $1): Adjust.
17585 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
17586 error message, do not report the parser accepts the error token in
17587 that state.
17588
52489d44
AD
175892002-07-30 Akim Demaille <akim@epita.fr>
17590
17591 Normalize conflict related messages.
17592
17593 * src/complain.h, src/complain.c (warn, complain): New.
17594 * src/conflicts.c (conflicts_print): Use them.
17595 (conflict_report_yacc): New, extracted from...
17596 (conflicts_print): here.
17597 * tests/conflicts.at, tests/existing.at: Adjust.
17598
e8832397
AD
175992002-07-30 Akim Demaille <akim@epita.fr>
17600
17601 Report rules which are never reduced by the parser: those hidden
17602 by conflicts.
17603
17604 * src/LR0.c (save_reductions): Don't make the final state too
17605 different: save its reduction (accept) instead of having a state
17606 without any action (no shift or goto, no reduce).
17607 Note: the final state is now a ``regular'' state, i.e., the
17608 parsers now contain `reduce 0' as default reduction.
17609 Nevertheless, since they decide to `accept' when yystate =
17610 final_state, they still will not reduce rule 0.
17611 * src/print.c (print_actions, print_reduction): Adjust.
17612 * src/output.c (action_row): Track reduced rules.
17613 (token_actions): Report rules never reduced.
17614 * tests/conflicts.at, tests/regression.at: Adjust.
17615
caf23d24
AD
176162002-07-30 Akim Demaille <akim@epita.fr>
17617
17618 `stage' was accidently included in a previous patch.
17619 Initiate its autoconfiscation.
17620
17621 * configure.in: Look for malloc.h and sys/times.h.
17622 * src/main.c (stage): Adjust.
17623 Report only when trace_flag.
17624
640748ee
AD
176252002-07-29 Akim Demaille <akim@epita.fr>
17626
17627 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
17628 state_number_t.
17629 (errs_t): symbol_t*, not symbol_number_t.
17630 (reductions_t): rule_t*, not rule_number_t.
17631 (FOR_EACH_SHIFT): New.
17632 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
17633 * src/print.c, src/print_graph.c: Adjust.
17634
88bce5a2
AD
176352002-07-29 Akim Demaille <akim@epita.fr>
17636
17637 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
17638
17639 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
17640 (endtoken, accept): these.
17641 * src/reader.c (reader): Set endtoken's default tag to "$end".
17642 Set undeftoken's tag to "$undefined" instead of "$undefined.".
17643 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
17644 Adjust.
17645
1bfb97db
AD
176462002-07-29 Akim Demaille <akim@epita.fr>
17647
17648 * src/reduce.c (reduce_grammar): When the language is empty,
17649 complain about the start symbol, not the axiom.
17650 Use its location.
17651 * tests/reduce.at (Empty Language): New.
17652
fc5734fe
AD
176532002-07-26 Akim Demaille <akim@epita.fr>
17654
17655 * src/reader.h, src/reader.c (gram_error): ... can't get
17656 yycontrol without making too strong assumptions on the parser
17657 itself.
17658 * src/output.c (prepare_tokens): Use the real 0th value of
17659 token_translations instead of `0'.
17660 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
17661 visible here.
17662 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
17663 for the time being: %locations ought to provide it to yyerror.
17664
3650b4b8
AD
176652002-07-25 Akim Demaille <akim@epita.fr>
17666
17667 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
17668 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
17669 * tests/regression.at (Web2c Actions): Adjust.
17670
4b3d3a8e
AD
176712002-07-25 Akim Demaille <akim@epita.fr>
17672
17673 Stop storing rules from 1 to nrules + 1.
17674
17675 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
17676 * src/nullable.c, src/output.c, src/print.c, src/reader.c
17677 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
17678 Iterate from 0 to nrules.
17679 Use rule_number_as_item_number and item_number_as_rule_number.
17680 Adjust to `derive' now containing possibly 0.
17681 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
17682 Handle the `- 1' part in rule numbers from/to item numbers.
17683 * src/conflicts.c (log_resolution): Fix the message which reversed
17684 shift and reduce.
17685 * src/output.c (action_row): Initialize default_rule to -1.
17686 (token_actions): Adjust.
17687 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
17688 expected output.
17689 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
17690
4a2a22f4
AD
176912002-07-25 Akim Demaille <akim@epita.fr>
17692
17693 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
17694 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
17695 (b4_c_knr_arg_decl): New.
17696 * data/yacc.c: Use it to define yysymprint, yydestruct, and
17697 yyreport_parse_error.
17698
b8df3223
AD
176992002-07-25 Akim Demaille <akim@epita.fr>
17700
17701 * data/yacc.c (yyreport_parse_error): New, extracted from...
17702 (yyparse): here.
17703 (yydestruct, yysymprint): Move above yyparse.
17704 Be K&R compliant.
17705
a762e609
AD
177062002-07-25 Akim Demaille <akim@epita.fr>
17707
17708 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
17709 replace...
17710 (b4_sint_type, b4_uint_type): these.
17711 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
17712 * tests/regression.at (Web2c Actions): Adjust.
17713
12b0043a
AD
177142002-07-25 Akim Demaille <akim@epita.fr>
17715
17716 * src/gram.h (TIEM_NUMBER_MAX): New.
17717 (item_number_of_rule_number, rule_number_of_item_number): Rename
17718 as...
17719 (rule_number_as_item_number, item_number_as_rule_number): these.
17720 Adjust dependencies.
17721 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17722 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17723 (symbol_number_to_vector_number): New.
17724 (order): Of vector_number_t* type.
17725 (base_t, BASE_MAX, BASE_MIN): New.
17726 (froms, tos, width, pos, check): Of base_t type.
17727 (action_number_t, ACTION_MIN, ACTION_MAX): New.
17728 (actrow): Of action_number_t type.
17729 (conflrow): Of unsigned int type.
17730 (table_ninf, base_ninf): New.
17731 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
17732 (muscle_insert_int_table, muscle_insert_base_table)
17733 (muscle_insert_rule_number_table): New.
17734 (prepare_tokens): Output `toknum' as int_table.
17735 (action_row): Returns a rule_number_t.
17736 Use ACTION_MIN, not SHRT_MIN.
17737 (token_actions): yydefact is rule_number_t*.
17738 (table_ninf_remap): New.
17739 (pack_table): Use it for `base' and `table'.
17740 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
17741 replaced with...
17742 (YYPACT_NINF, YYTABLE_NINF): these.
17743 (yypact, yytable): Compute their types instead of hard-coded
17744 `short'.
17745 * tests/regression.at (Web2c Actions): Adjust.
17746
5dde258a
AD
177472002-07-19 Akim Demaille <akim@epita.fr>
17748
17749 * src/scan-gram.l (id): Can start with an underscore.
17750
a945ec39
AD
177512002-07-16 Akim Demaille <akim@epita.fr>
17752
17753 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
17754 Adjust all former `associativity' dependencies.
17755 * src/symtab.c (symbol_new): Default associativity is `undef', not
17756 `right'.
17757 (symbol_check_alias_consistence): Adjust.
17758
fae437e8
AD
177592002-07-09 Akim Demaille <akim@epita.fr>
17760
17761 * doc/bison.texinfo: Properly set the ``header'' part.
17762 Use @dircategory ``GNU programming tools'' as per Texinfo's
17763 documentation.
17764 Use @copying.
17765
1a715ef2
AD
177662002-07-09 Akim Demaille <akim@epita.fr>
17767
17768 * lib/quotearg.h: Protect against multiple inclusions.
17769 * src/location.h (location_t): Add a `file' member.
17770 (LOCATION_RESET, LOCATION_PRINT): Adjust.
17771 * src/complain.c (warn_at, complain_at, fatal_at): Drop
17772 `error_one_per_line' support.
17773
a5d50994
AD
177742002-07-09 Akim Demaille <akim@epita.fr>
17775
17776 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
17777 * src/reader.c (lineno): Remove.
17778 Adjust all dependencies.
17779 (get_merge_function): Take a location and use complain_at.
17780 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
17781 * tests/regression.at (Invalid inputs, Mixing %token styles):
17782 Adjust.
17783
b275314e
AD
177842002-07-09 Akim Demaille <akim@epita.fr>
17785
17786 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
17787 recovery rule, and forbid extensions when --yacc.
17788 (gram_error): Use complain_at.
17789 * src/reader.c (reader): Exit if there were parse errors.
17790
865b9df1
AD
177912002-07-09 Akim Demaille <akim@epita.fr>
17792
17793 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
17794 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
17795 Reported by R Blake <blakers@mac.com>.
17796
c76e14da
AD
177972002-07-09 Akim Demaille <akim@epita.fr>
17798
17799 * data/yacc.c: Output the copyright notive in the header.
17800
7db2ed2d
AD
178012002-07-03 Akim Demaille <akim@epita.fr>
17802
17803 * src/output.c (froms, tos): Are state_number_t.
17804 (save_column): sp, sp1, and sp2 are state_number_t.
17805 (prepare): Rename `final' as `final_state_number', `nnts' as
17806 `nterms_number', `nrules' as `rules_number', `nstates' as
17807 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
17808 unused.
17809 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
17810 * data/lalr1.cc (nsym_): Remove, unused.
17811
e68e0410
AD
178122002-07-03 Akim Demaille <akim@epita.fr>
17813
17814 * src/lalr.h, src/lalr.c (goto_number_t): New.
17815 * src/lalr.c (goto_list_t): New.
17816 Propagate them.
17817 * src/nullable.c (rule_list_t): New.
17818 Propagate.
17819 * src/types.h: Remove.
17820
e1a4f3a4
AD
178212002-07-03 Akim Demaille <akim@epita.fr>
17822
17823 * src/closure.c (print_fderives): Use rule_rhs_print.
17824 * src/derives.c (print_derives): Use rule_rhs_print.
17825 (rule_list_t): New, replaces `shorts'.
17826 (set_derives): Add comments.
17827 * tests/sets.at (Nullable, Firsts): Adjust.
17828
536545f3
AD
178292002-07-03 Akim Demaille <akim@epita.fr>
17830
17831 * src/output.c (prepare_actions): Free `tally' and `width'.
17832 (prepare_actions): Allocate and free `order'.
17833 * src/symtab.c (symbols_free): Free `symbols'.
17834 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
17835 * src/output.c (m4_invoke): Move to...
17836 * src/scan-skel.l: here.
17837 (<<EOF>>): Close yyout, and free its name.
17838
8b752b00
AD
178392002-07-03 Akim Demaille <akim@epita.fr>
17840
17841 Fix some memory leaks, and fix a bug: state 0 was examined twice.
17842
17843 * src/LR0.c (new_state): Merge into...
17844 (state_list_append): this.
17845 (new_states): Merge into...
17846 (generate_states): here.
17847 (set_states): Don't ensure a proper `errs' state member here, do it...
17848 * src/conflicts.c (conflicts_solve): here.
17849 * src/state.h, src/state.c: Comment changes.
17850 (state_t): Rename member `shifts' as `transitions'.
17851 Adjust all dependencies.
17852 (errs_new): For consistency, also take the values as argument.
17853 (errs_dup): Remove.
17854 (state_errs_set): New.
17855 (state_reductions_set, state_transitions_set): Assert that no
17856 previous value was assigned.
17857 (state_free): New.
17858 (states_free): Use it.
17859 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
17860 temporary storage: use `errs' and `nerrs' as elsewhere.
17861 (set_conflicts): Allocate and free this `errs'.
17862
613f5e1a
AD
178632002-07-02 Akim Demaille <akim@epita.fr>
17864
17865 * lib/libiberty.h: New.
17866 * lib: Update the bitset implementation from upstream.
17867 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
17868 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
17869 * src/main.c: Adjust bitset stats calls.
17870
26e0cadc
PE
178712002-07-01 Paul Eggert <eggert@twinsun.com>
17872
17873 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
17874 char, so that negative chars don't collide with $.
17875
1154cced
AD
178762002-06-30 Akim Demaille <akim@epita.fr>
17877
17878 Have the GLR tests be `warning' checked, and fix the warnings.
17879
17880 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
17881 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
17882 (yyremoveDeletes): `yyi' and `yyj' are size_t.
17883 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
17884 (yyaddDeferredAction): static.
17885 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
17886 (yyreportParseError): yyprefix is const.
17887 yytokenp is used only when verbose.
17888 (yy__GNUC__): Replace with __GNUC__.
17889 (yypdumpstack): yyi is size_t.
17890 (yypreference): Un-yy local variables and arguments, to avoid
17891 clashes with `yyr1'. Anyway, we are not in the user name space.
17892 (yytname_size): be an int, as is compared with ints.
17893 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
17894 Use them.
17895 * tests/cxx-gram.at: Use quotation to protect $1.
17896 Use AT_COMPILE to enable warnings hunts.
17897 Prototype yylex and yyerror.
17898 `Use' argc.
17899 Include `string.h', not `strings.h'.
17900 Produce and prototype stmtMerge only when used.
17901 yylex takes a location.
17902
97650f4e
AD
179032002-06-30 Akim Demaille <akim@epita.fr>
17904
17905 We spend a lot of time in quotearg, in particular when --verbose.
17906
17907 * src/symtab.c (symbol_get): Store a quoted version of the key.
17908 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
17909 Adjust all callers.
17910
d2576365
AD
179112002-06-30 Akim Demaille <akim@epita.fr>
17912
17913 * src/state.h (reductions_t): Rename member `nreds' as num.
17914 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
17915 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
17916
ccaf65bc
AD
179172002-06-30 Akim Demaille <akim@epita.fr>
17918
17919 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
17920 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
17921 (shifts_to): Rename as...
17922 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
17923 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
17924 (TRANSITION_IS_DISABLED, transitions_to): these.
17925
87675353
AD
179262002-06-30 Akim Demaille <akim@epita.fr>
17927
17928 * src/print.c (print_shifts, print_gotos): Merge into...
17929 (print_transitions): this.
17930 (print_transitions, print_errs, print_reductions): Align the
17931 lookaheads columns.
17932 (print_core, print_transitions, print_errs, print_state,
17933 print_grammar): Output empty lines separator before, not after.
17934 (state_default_rule_compute): Rename as...
17935 (state_default_rule): this.
17936 * tests/conflicts.at (Defaulted Conflicted Reduction),
17937 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
17938 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
17939
ce4ccb4b
AD
179402002-06-30 Akim Demaille <akim@epita.fr>
17941
17942 Display items as we display rules.
17943
17944 * src/gram.h, src/gram.c (rule_lhs_print): New.
17945 * src/gram.c (grammar_rules_partial_print): Use it.
17946 * src/print.c (print_core): Likewise.
17947 * tests/conflicts.at (Defaulted Conflicted Reduction),
17948 (Unresolved SR Conflicts): Adjust.
17949 (Unresolved SR Conflicts): Adjust and rename as...
17950 (Resolved SR Conflicts): this, as was meant.
17951 * tests/regression.at (Web2c Report): Adjust.
17952
bc933ef1
AD
179532002-06-30 Akim Demaille <akim@epita.fr>
17954
17955 * src/print.c (state_default_rule_compute): New, extracted from...
17956 (print_reductions): here.
17957 Pessimize, but clarify the code.
17958 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
17959
53d4308d
AD
179602002-06-30 Akim Demaille <akim@epita.fr>
17961
17962 * src/output.c (action_row): Let default_rule be always a rule
17963 number.
17964
574fb2d5
AD
179652002-06-30 Akim Demaille <akim@epita.fr>
17966
17967 * src/closure.c (print_firsts, print_fderives, closure):
17968 Use BITSET_EXECUTE.
17969 * src/lalr.c (lookaheads_print): Likewise.
17970 * src/state.c (state_rule_lookaheads_print): Likewise.
17971 * src/print_graph.c (print_core): Likewise.
17972 * src/print.c (print_reductions): Likewise.
17973 * src/output.c (action_row): Likewise.
17974 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
17975
05811fd7
AD
179762002-06-30 Akim Demaille <akim@epita.fr>
17977
17978 * src/print_graph.c: Use report_flag.
17979
0e4d5753
AD
179802002-06-30 Akim Demaille <akim@epita.fr>
17981
17982 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
17983 to...
17984 * src/relation.h, src/relation.c (traverse, relation_digraph)
17985 (relation_print, relation_transpose): New.
17986
24c7d800
AD
179872002-06-30 Akim Demaille <akim@epita.fr>
17988
17989 * src/state.h, src/state.c (shifts_to): New.
17990 * src/lalr.c (build_relations): Use it.
17991
9222837b
AD
179922002-06-30 Akim Demaille <akim@epita.fr>
17993
17994 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
17995 (item_number_of_rule_number, rule_number_of_item_number): New.
17996 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
17997 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17998 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
17999 Propagate their use.
18000 Much remains to be done, in particular wrt `shorts' from types.h.
18001
260008e5
AD
180022002-06-30 Akim Demaille <akim@epita.fr>
18003
18004 * src/symtab.c (symbol_new): Initialize the `printer' member.
18005
8a731ca8
AD
180062002-06-30 Akim Demaille <akim@epita.fr>
18007
18008 * src/LR0.c (save_reductions): Remove, replaced by...
18009 * src/state.h, src/state.c (state_reductions_set): New.
18010 (reductions, errs): Rename as...
18011 (reductions_t, errs_t): these.
18012 Adjust all dependencies.
18013
32e1e0a4
AD
180142002-06-30 Akim Demaille <akim@epita.fr>
18015
18016 * src/LR0.c (state_list_t, state_list_append): New.
18017 (first_state, last_state): Now symbol_list_t.
18018 (this_state): Remove.
18019 (new_itemsets, append_states, save_reductions): Take a state_t as
18020 argument.
18021 (set_states, generate_states): Adjust.
18022 (save_shifts): Remove, replaced by...
18023 * src/state.h, src/state.c (state_shifts_set): New.
18024 (shifts): Rename as...
18025 (shifts_t): this.
18026 Adjust all dependencies.
18027 * src/state.h (state_t): Remove the `next' member.
18028
e5fb6710
AD
180292002-06-30 Akim Demaille <akim@epita.fr>
18030
18031 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
18032 escaped in slot 0.
18033
c7ca99d4
AD
180342002-06-30 Akim Demaille <akim@epita.fr>
18035
18036 Use hash.h for the state hash table.
18037
18038 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
18039 (allocate_storage): Use state_hash_new.
18040 (free_storage): Use state_hash_free.
18041 (new_state, get_state): Adjust.
18042 * src/lalr.h, src/lalr.c (states): Move to...
18043 * src/states.h (state_t): Remove the `link' member, no longer
18044 used.
18045 * src/states.h, src/states.c: here.
18046 (state_hash_new, state_hash_free, state_hash_lookup)
18047 (state_hash_insert, states_free): New.
18048 * src/states.c (state_table, state_compare, state_hash): New.
18049 * src/output.c (output_actions): Do not free states now, since we
18050 still need to know the final_state number in `prepare', called
18051 afterwards. Do it...
18052 * src/main.c (main): here: call states_free after `output'.
18053
df0e7316
AD
180542002-06-30 Akim Demaille <akim@epita.fr>
18055
18056 * src/state.h, src/state.c (state_new): New, extracted from...
18057 * src/LR0.c (new_state): here.
18058 * src/state.h (STATE_ALLOC): Move to...
18059 * src/state.c: here.
18060 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
18061 * src/state.h, src/state.c: here.
18062
39f41916
AD
180632002-06-30 Akim Demaille <akim@epita.fr>
18064
18065 * src/reader.c (gensym): Rename as...
18066 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
18067 (getsym): Rename as...
18068 (symbol_get): this.
18069
d57650a5
AD
180702002-06-30 Akim Demaille <akim@epita.fr>
18071
18072 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
18073 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
18074 * src/output.c, src/print.c, src/print_graph.c: Propagate.
18075 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
18076
5a08f1ce
AD
180772002-06-30 Akim Demaille <akim@epita.fr>
18078
18079 Make the test suite pass with warnings checked.
18080
18081 * tests/actions.at (Printers and Destructors): Improve.
18082 Avoid unsigned vs. signed issues.
18083 * tests/calc.at: Don't exercise the scanner here, do it...
18084 * tests/input.at (Torturing the Scanner): here.
18085
720623af
PH
180862002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18087
88e7e941 18088 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
18089 reorganize first lines parallel to yacc.c.
18090
fb8135fa
AD
180912002-06-28 Akim Demaille <akim@epita.fr>
18092
18093 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
18094 (b4_token_enum, b4_token_defines): New, factored from...
18095 * data/lalr1.cc, data/yacc.c, glr.c: here.
18096
41442480
AD
180972002-06-28 Akim Demaille <akim@epita.fr>
18098
18099 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
18100 unused variables.
18101 * src/output.c (merger_output): static.
18102
e0e5bf84
AD
181032002-06-28 Akim Demaille <akim@epita.fr>
18104
ba0fe3c7 18105 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
18106 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
18107 pacify GCC.
18108 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 18109
676385e2
PH
181102002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18111
18112 Accumulated changelog for new GLR parsing features.
18113
6a254321 18114 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
18115 conflicts_total_count.
18116 * src/conflicts.h: Ditto.
18117 * src/output.c (token_actions): Use the new name.
18118 (output_conflicts): Change conflp => conflict_list_heads, and
18119 confl => conflict_list for better readability.
18120 * data/glr.c: Use the new names.
18121 * NEWS: Add self to GLR announcement.
e0e5bf84 18122
676385e2
PH
18123 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
18124
18125 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
18126 Akim Demaille.
18127
18128 * data/bison.glr: Change name to glr.c
18129 * data/glr.c: Renamed from bison.glr.
18130 * data/Makefile.am: Add glr.c
e0e5bf84
AD
18131
18132 * src/getargs.c:
18133
676385e2 18134 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 18135 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 18136
676385e2
PH
18137 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18138
18139 * data/bison.glr: Be sure to restore the
18140 current #line when returning to the skeleton contents after having
18141 exposed the input file's #line.
18142
18143 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18144
18145 * data/bison.glr: Bring up to date with changes to bison.simple.
18146
18147 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18148
18149 * data/bison.glr: Correct definitions that use b4_prefix.
18150 Various reformatting.
18151 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
18152 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
18153 yytokenp argument; now part of stack.
18154 (yychar): Define to behave as documented.
18155 (yyclearin): Ditto.
e0e5bf84 18156
676385e2
PH
18157 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18158
18159 * src/reader.h: Add declaration for free_merger_functions.
18160
18161 * src/reader.c (merge_functions): New variable.
18162 (get_merge_function): New function.
18163 (free_merger_functions): New function.
18164 (readgram): Check for %prec that is not followed by a symbol.
18165 Handle %dprec and %merge declarations.
18166 (packgram): Initialize dprec and merger fields in rules array.
18167
18168 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
18169 conflict_list_cnt, conflict_list_free): New variables.
18170 (table_grow): Also grow conflict_table.
e0e5bf84 18171 (prepare_rules): Output dprec and merger tables.
676385e2 18172 (conflict_row): New function.
e0e5bf84 18173 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
18174 default reduction in conflicted states for GLR parser so that there
18175 are spaces for the conflict lists.
18176 (save_row): Also save conflict information.
18177 (token_actions): Allocate conflict list.
18178 (merger_output): New function.
18179 (pack_vector): Pack conflict table, too.
18180 (output_conflicts): New function to output yyconflp and yyconfl.
18181 (output_check): Allocate conflict_tos.
18182 (output_actions): Output conflict tables, also.
18183 (output_skeleton): Output b4_mergers definition.
18184 (prepare): Output b4_max_rhs_length definition.
18185 Use 'bison.glr' as default skeleton for GLR parsers.
18186
18187 * src/gram.c (glr_parser): New flag.
18188 (grammar_free): Call free_merger_functions.
18189
18190 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
18191 all pairs of conflicting reductions, rather than just all tokens
18192 causing conflicts. Needed to size conflict tables.
e0e5bf84 18193 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
18194 interface.
18195 (conflicts_print): Ditto.
18196 (count_total_conflicts): New function.
18197
18198 * src/reader.h (merger_list): New type.
18199 (merge_functions): New variable.
18200
18201 * src/lex.h (tok_dprec, tok_merge): New token types.
18202
18203 * src/gram.h (rule_s): Add dprec and merger fields.
18204 (glr_parser): New flag.
18205
18206 * src/conflicts.h (count_total_conflicts): New function.
18207
18208 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
18209
18210 * doc/bison.texinfo (Generalized LR Parsing): New section.
18211 (GLR Parsers): New section.
18212 (Language and Grammar): Mention GLR parsing.
18213 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
18214 Correct typo ("tge" -> "the").
18215
18216 * data/bison.glr: New skeleton for GLR parsing.
18217
18218 * tests/cxx-gram.at: New tests for GLR parsing.
18219
18220 * tests/testsuite.at: Include cxx-gram.at.
18221
18222 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 18223
676385e2
PH
18224 * src/parse-gram.y:
18225
18226 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
18227
18228 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 18229
b5480d74 182302002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
18231
18232 * src/options.h, src/options.c: Remove.
18233 * src/getargs.c (short_options, long_options): New.
18234
60491a94
AD
182352002-06-27 Akim Demaille <akim@epita.fr>
18236
18237 * data/bison.simple, data/bison.c++: Rename as...
18238 * data/yacc.c, data/lalr1.cc: these.
18239 * doc/bison.texinfo (Environment Variables): Remove.
18240
9be0c25b
AD
182412002-06-25 Raja R Harinath <harinath@cs.umn.edu>
18242
18243 * src/getargs.c (report_argmatch): Initialize strtok().
18244
1ae72863
AD
182452002-06-20 Akim Demaille <akim@epita.fr>
18246
18247 * data/bison.simple (b4_symbol_actions): New, replaces...
18248 (b4_symbol_destructor, b4_symbol_printer): these.
18249 (yysymprint): Be sure to call YYPRINT only for tokens, and using
18250 user token numbers.
18251
87542d29
AD
182522002-06-20 Akim Demaille <akim@epita.fr>
18253
18254 * data/bison.simple (yydestructor): Rename as...
18255 (yydestruct): this.
18256
1a31ed21
AD
182572002-06-20 Akim Demaille <akim@epita.fr>
18258
18259 * src/symtab.h, src/symtab.c (symbol_type_set)
18260 (symbol_destructor_set, symbol_precedence_set): The location is
18261 the last argument.
18262 Adjust all callers.
18263
e776192e
AD
182642002-06-20 Akim Demaille <akim@epita.fr>
18265
18266 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
18267 internals.
18268 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
18269 Takes a location.
18270 * src/symtab.h, src/symtab.c (symbol_class_set)
18271 (symbol_user_token_number_set): Likewise.
18272 Adjust all callers.
18273 Promote complain_at.
18274 * tests/input.at (Type Clashes): Adjust.
18275
5c1180b3
AD
182762002-06-20 Akim Demaille <akim@epita.fr>
18277
18278 * data/bison.simple (YYLEX): Fix the declaration when
18279 %pure-parser.
18280
e3170060
AD
182812002-06-20 Akim Demaille <akim@epita.fr>
18282
18283 * data/bison.simple (yysymprint): Don't print the token number,
18284 just its name.
18285 * tests/actions.at (Destructors): Rename as...
18286 (Printers and Destructors): this.
18287 Also exercise %printer.
18288
253862fd
AD
182892002-06-20 Akim Demaille <akim@epita.fr>
18290
18291 * data/bison.simple (YYDSYMPRINT): New.
18292 Use it to remove many of the #if YYDEBUG/if (yydebug).
18293
366eea36
AD
182942002-06-20 Akim Demaille <akim@epita.fr>
18295
18296 * src/symtab.h, src/symtab.c (symbol_t): printer and
18297 printer_location are new members.
18298 (symbol_printer_set): New.
18299 * src/parse-gram.y (PERCENT_PRINTER): New token.
18300 Handle its associated rule.
18301 * src/scan-gram.l: Adjust.
18302 (handle_destructor_at, handle_destructor_dollar): Rename as...
18303 (handle_symbol_code_at, handle_symbol_code_dollar): these.
18304 * src/output.c (symbol_printers_output): New.
18305 (output_skeleton): Call it.
18306 * data/bison.simple (yysymprint): New. Cannot be named yyprint
18307 since there are already many grammar files with a user `yyprint'.
18308 Replace the calls to YYPRINT to calls to yysymprint.
18309 * tests/calc.at: Adjust.
18310 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
18311 taking advantage of parser very internal details (stack size!).
18312
4f25ebb0
AD
183132002-06-20 Akim Demaille <akim@epita.fr>
18314
18315 * src/scan-gram.l: Complete the scanner with the missing patterns
18316 to pacify Flex.
18317 Use `quote' and `symbol_tag_get' where appropriate.
18318
93b68a0e
AD
183192002-06-19 Akim Demaille <akim@epita.fr>
18320
18321 * tests/actions.at (Destructors): Augment to test locations.
18322 * data/bison.simple (yydestructor): Pass it the current location
18323 if locations are enabled.
18324 Prototype only when __STDC__ or C++.
18325 Change the argument names to move into the yy name space: there is
18326 user code here.
18327
58612f1d
AD
183282002-06-19 Akim Demaille <akim@epita.fr>
18329
74310291
AD
18330 * data/bison.simple (b4_pure_if): New.
18331 Use it instead of #ifdef YYPURE.
18332
183332002-06-19 Akim Demaille <akim@epita.fr>
18334
18335 * data/bison.simple (b4_location_if): New.
58612f1d
AD
18336 Use it instead of #ifdef YYLSP_NEEDED.
18337
f25bfb75
AD
183382002-06-19 Akim Demaille <akim@epita.fr>
18339
18340 Prepare @$ in %destructor, but currently don't bind it in the
18341 skeleton, as %location use is not cleaned up yet.
18342
18343 * src/scan-gram.l (handle_dollar, handle_destructor_at)
18344 (handle_action_at): New.
18345 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
18346 a braced_code_t and a location as additional arguments.
18347 (handle_destructor_dollar): Instead of requiring `b4_eval', just
18348 unquote one when outputting `b4_dollar_dollar'.
18349 Adjust callers.
18350 * data/bison.simple (b4_eval): Remove.
18351 (b4_symbol_destructor): Adjust.
18352 * tests/input.at (Invalid @n): Adjust.
18353
c732d2c6
AD
183542002-06-19 Zack Weinberg <zack@codesourcery.com>
18355
18356 * doc/bison.texinfo: Document ability to have multiple
18357 prologue sections.
18358
8c165d89
AD
183592002-06-18 Akim Demaille <akim@epita.fr>
18360
18361 * src/files.c (compute_base_names): When computing the output file
18362 names from the input file name, strip the directory part.
18363
ca98bf57
AD
183642002-06-18 Akim Demaille <akim@epita.fr>
18365
18366 * data/bison.simple.new: Comment changes.
18367 Reported by Andreas Schwab.
18368
0bfb02ff
AD
183692002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
18370
18371 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
18372 there are no `label `yyoverflowlab' defined but not used' warnings
18373 when yyoverflow is defined.
18374
24c0aad7
AD
183752002-06-18 Akim Demaille <akim@epita.fr>
18376
18377 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
18378 new member.
18379 (symbol_destructor_set): Adjust.
18380 * src/output.c (symbol_destructors_output): Output the destructor
18381 locations.
18382 Output the symbol name.
18383 * data/bison.simple (b4_symbol_destructor): Adjust.
18384
5719c109
AD
183852002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
18386 and Akim Demaille <akim@epita.fr>
18387
18388 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
18389 what's left on the stack when the error recovery hits EOF.
18390 * tests/actions.at (Destructors): Complete to exercise this case.
18391
9280d3ef
AD
183922002-06-17 Akim Demaille <akim@epita.fr>
18393
18394 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
18395 arguments is really empty, not only equal to `[]'.
18396 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
18397 member.
18398 (symbol_destructor_set): New.
18399 * src/output.c (symbol_destructors_output): New.
18400 * src/reader.h (brace_code_t, current_braced_code): New.
18401 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
18402 (handle_dollar): Rename as...
18403 (handle_action_dollar): this.
18404 (handle_destructor_dollar): New.
18405 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
18406 (grammar_declaration): Use it.
18407 * data/bison.simple (yystos): Is always defined.
18408 (yydestructor): New.
18409 * tests/actions.at (Destructors): New.
18410 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
18411
dafdc66f
AD
184122002-06-17 Akim Demaille <akim@epita.fr>
18413
18414 * src/symlist.h, src/symlist.c (symbol_list_length): New.
18415 * src/scan-gram.l (handle_dollar, handle_at): Compute the
18416 rule_length only when needed.
18417 * src/output.c (actions_output, token_definitions_output): Output
18418 the full M4 block.
18419 * src/symtab.c: Don't access directly to the symbol tag, use
18420 symbol_tag_get.
18421 * src/parse-gram.y: Use symbol_list_free.
18422
56c47203
AD
184232002-06-17 Akim Demaille <akim@epita.fr>
18424
18425 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
18426 (symbol_list_prepend, get_type_name): Move to...
18427 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
18428 (symbol_list_prepend, symbol_list_n_type_name_get): here.
18429 Adjust all callers.
18430 (symbol_list_free): New.
18431 * src/scan-gram.l (handle_dollar): Takes a location.
18432 * tests/input.at (Invalid $n): Adjust.
18433
1e0bab92
AD
184342002-06-17 Akim Demaille <akim@epita.fr>
18435
18436 * src/reader.h, src/reader.c (symbol_list_new): Export it.
18437 (symbol_list_prepend): New.
18438 * src/parse-gram.y (%union): `list' is a new member.
18439 (symbols.1): New, replaces...
18440 (terms_to_prec.1, nterms_to_type.1): these.
18441 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
18442 Take a location as additional argument.
18443 Adjust all callers.
18444
04e60654
AD
184452002-06-15 Akim Demaille <akim@epita.fr>
18446
18447 * src/parse-gram.y: Move %token in the declaration section so that
18448 we don't depend upon CVS Bison.
18449
10e5b8bd
AD
184502002-06-15 Akim Demaille <akim@epita.fr>
18451
18452 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
18453 * src/print.c (print_core): Use it.
18454
9801d40c
AD
184552002-06-15 Akim Demaille <akim@epita.fr>
18456
18457 * src/conflicts.c (log_resolution): Accept the rule involved in
18458 the sr conflicts instead of the lookahead number that points to
18459 that rule.
18460 (flush_reduce): Accept the current lookahead vector as argument,
18461 instead of the index in LA.
18462 (resolve_sr_conflict): Accept the current number of lookahead
18463 bitset to consider for the STATE, instead of the index in LA.
18464 (set_conflicts): Adjust.
18465 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
18466
c0263492
AD
184672002-06-15 Akim Demaille <akim@epita.fr>
18468
18469 * src/state.h (state_t): Replace the `lookaheadsp' member, a
18470 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
18471 Adjust all dependencies.
18472 * src/lalr.c (initialize_lookaheads): Split into...
18473 (states_lookaheads_count, states_lookaheads_initialize): these.
18474 (lalr): Adjust.
18475
9757c359
AD
184762002-06-15 Akim Demaille <akim@epita.fr>
18477
18478 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
18479 out of...
18480 (grammar_rules_print): here.
18481 * src/reduce.c (reduce_output): Use it.
18482 * tests/reduce.at (Useless Rules, Reduced Automaton)
18483 (Underivable Rules): Adjust.
18484
6b98e4b5
AD
184852002-06-15 Akim Demaille <akim@epita.fr>
18486
18487 Copy BYacc's nice way to report the grammar.
18488
18489 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
18490 New.
18491 Don't print the rules' location, it is confusing and useless.
18492 (rule_print): Use grammar_rhs_print.
18493 * src/print.c (print_grammar): Use grammar_rules_print.
18494
6b98e4b5
AD
184952002-06-15 Akim Demaille <akim@epita.fr>
18496
18497 Complete and rationalize `useless thing' warnings.
18498
18499 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
18500 (symbol_tag_print): New.
18501 Use them everywhere in place of accessing directly the tag member.
18502 * src/gram.h, src/gram.c (rule_print): New.
18503 Use it where a rule used to be printed `by hand'.
18504 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
18505 (reduce_grammar_tables): Report the useless rules.
18506 (reduce_print): Useless things are a warning, not an error.
18507 Report it as such.
18508 * tests/reduce.at (Useless Nonterminals, Useless Rules):
18509 (Reduced Automaton, Underivable Rules): Adjust.
18510 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
18511 * tests/conflicts.at (Unresolved SR Conflicts)
18512 (Solved SR Conflicts): Adjust.
18513
ee000ba4
AD
185142002-06-15 Akim Demaille <akim@epita.fr>
18515
18516 Let symbols have a location.
18517
18518 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
18519 (getsym): Adjust.
18520 Adjust all callers.
18521 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
18522 Use location_t, not int.
18523 * src/symtab.c (symbol_check_defined): Take advantage of the
18524 location.
18525 * tests/regression.at (Invalid inputs): Adjust.
18526
8efe435c
AD
185272002-06-15 Akim Demaille <akim@epita.fr>
18528
18529 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
18530 (input): Don't try to initialize yylloc here, do it in the
18531 scanner.
18532 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
18533 * src/gram.h (rule_t): Change line and action_line into location
18534 and action_location, of location_t type.
18535 Adjust all dependencies.
18536 * src/location.h, src/location.c (empty_location): New.
18537 * src/reader.h, src/reader.c (grammar_start_symbol_set)
18538 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
18539 (grammar_current_rule_symbol_append)
18540 (grammar_current_rule_action_append): Expect a location as argument.
18541 * src/reader.c (grammar_midrule_action): Adjust to attach an
18542 action's location as dummy symbol location.
18543 * src/symtab.h, src/symtab.c (startsymbol_location): New.
18544 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
18545 the line numbers.
18546
1921f1d7
AD
185472002-06-14 Akim Demaille <akim@epita.fr>
18548
18549 Grammar declarations may be found in the grammar section.
18550
18551 * src/parse-gram.y (rules_or_grammar_declaration): New.
18552 (declarations): Each declaration may end with a semicolon, not
18553 just...
18554 (grammar_declaration): `"%union"'.
18555 (grammar): Branch to rules_or_grammar_declaration.
18556
4515534c
AD
185572002-06-14 Akim Demaille <akim@epita.fr>
18558
18559 * src/main.c (main): Invoke scanner_free.
18560
f958596b
AD
185612002-06-14 Akim Demaille <akim@epita.fr>
18562
18563 * src/output.c (m4_invoke): Extracted from...
18564 (output_skeleton): here.
18565 Free tempfile.
18566
2c569025
AD
185672002-06-14 Akim Demaille <akim@epita.fr>
18568
18569 * src/parse-gram.y (directives, directive, gram)
18570 (grammar_directives, precedence_directives, precedence_directive):
18571 Rename as...
18572 (declarations, declaration, grammar, grammar_declaration)
18573 (precedence_declaration, precedence_declarator): these.
18574 (symbol_declaration): New.
18575
592e8d4d
AD
185762002-06-14 Akim Demaille <akim@epita.fr>
18577
18578 * src/files.c (action_obstack): Remove, unused.
18579 (output_obstack): Remove it, and all its dependencies, as it is no
18580 longer needed.
18581 * src/reader.c (epilogue_set): Build the epilogue in the
18582 muscle_obstack.
18583 * src/output.h, src/output.c (muscle_obstack): Move to...
18584 * src/muscle_tab.h, src/muscle_tab.h: here.
18585 (muscle_init): Initialize muscle_obstack.
18586 (muscle_free): New.
18587 * src/main.c (main): Call it.
18588
0c15323d
AD
185892002-06-14 Akim Demaille <akim@epita.fr>
18590
18591 * src/location.h: New, extracted from...
18592 * src/reader.h: here.
18593 * src/Makefile.am (noinst_HEADERS): Merge into
18594 (bison_SOURCES): this.
18595 Add location.h.
18596 * src/parse-gram.y: Use location_t instead of Bison's.
18597 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
18598 Use location_t instead of ints.
18599
e96c9728
AD
186002002-06-14 Akim Demaille <akim@epita.fr>
18601
18602 * data/bison.simple, data/bison.c++: Be sure to restore the
18603 current #line when returning to the skeleton contents after having
18604 exposed the input file's #line.
18605
75d1fe16
AD
186062002-06-12 Akim Demaille <akim@epita.fr>
18607
18608 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
18609 eager.
18610 * tests/actions.at (Exotic Dollars): New.
18611
6c35d22c
AD
186122002-06-12 Akim Demaille <akim@epita.fr>
18613
18614 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
18615 ['"/] too eagerly.
18616 * tests/input.at (Torturing the Scanner): New.
18617
1d6412ad
AD
186182002-06-11 Akim Demaille <akim@epita.fr>
18619
18620 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
18621 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
18622 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
18623 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
18624 * src/reader.c (reader): Use it.
18625
4cdb01db
AD
186262002-06-11 Akim Demaille <akim@epita.fr>
18627
18628 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
18629 Adjust all callers.
18630 (scanner_last_string_free): New.
18631
44995b2e
AD
186322002-06-11 Akim Demaille <akim@epita.fr>
18633
18634 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
18635 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
18636 (last_string, YY_OBS_FREE): New.
18637 Use them when returning an ID.
18638
e9955c83
AD
186392002-06-11 Akim Demaille <akim@epita.fr>
18640
18641 Have Bison grammars parsed by a Bison grammar.
18642
18643 * src/reader.c, src/reader.h (prologue_augment): New.
18644 * src/reader.c (copy_definition): Remove.
18645
18646 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
18647 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
18648 (grammar_current_rule_prec_set, grammar_current_rule_check)
18649 (grammar_current_rule_symbol_append)
18650 (grammar_current_rule_action_append): Export.
18651 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
18652 (symbol_list_action_append): Remove.
18653 Hook the routines from reader.
18654 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
18655 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18656
18657 * src/reader.c (read_declarations): Remove, unused.
18658
18659 * src/parse-gram.y: Handle the epilogue.
18660 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
18661 (grammar_start_symbol_set): this.
18662 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
18663 * src/reader.c (readgram): Remove, unused.
18664 (reader): Adjust to insert eoftoken and axiom where appropriate.
18665
18666 * src/reader.c (copy_dollar): Replace with...
18667 * src/scan-gram.h (handle_dollar): this.
18668 * src/parse-gram.y: Remove `%thong'.
18669
18670 * src/reader.c (copy_at): Replace with...
18671 * src/scan-gram.h (handle_at): this.
18672
18673 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
18674 New.
18675
18676 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
18677 time being.
18678
18679 * src/reader.h, src/reader.c (grammar_rule_end): New.
18680
18681 * src/parse.y (current_type, current_class): New.
18682 Implement `%nterm', `%token' support.
18683 Merge `%term' into `%token'.
18684 (string_as_id): New.
18685 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
18686 type name.
18687
18688 * src/parse-gram.y: Be sure to handle properly the beginning of
18689 rules.
18690
18691 * src/parse-gram.y: Handle %type.
18692 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
18693
18694 * src/parse-gram.y: More directives support.
18695 * src/options.c: No longer handle source directives.
18696
18697 * src/parse-gram.y: Fix %output.
18698
18699 * src/parse-gram.y: Handle %union.
18700 Use the prologue locations.
18701 * src/reader.c (parse_union_decl): Remove.
18702
18703 * src/reader.h, src/reader.c (epilogue_set): New.
18704 * src/parse-gram.y: Use it.
18705
18706 * data/bison.simple, data/bison.c++: b4_stype is now either not
18707 defined, then default to int, or to the contents of %union,
18708 without `union' itself.
18709 Adjust.
18710 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
18711
18712 * src/output.c (actions_output): Don't output braces, as they are
18713 already handled by the scanner.
18714
18715 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
18716 characters to themselves.
18717
18718 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
18719 that the epilogue has a proper #line.
18720
18721 * src/parse-gram.y: Handle precedence/associativity.
18722
18723 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
18724 a terminal.
18725 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
18726 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
18727 at all to define terminals that cannot be emitted.
18728
18729 * src/scan-gram.l: Escape M4 characters.
18730
18731 * src/scan-gram.l: Working properly with escapes in user
18732 strings/characters.
18733
18734 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
18735 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
18736 grammar.
18737 Use more modest sizes, as for the time being the parser does not
18738 release memory, and therefore the process swallows a huge amount
18739 of memory.
18740
18741 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
18742 stricter %token grammar.
18743
18744 * src/symtab.h (associativity): Add `undef_assoc'.
18745 (symbol_precedence_set): Do nothing when passed an undef_assoc.
18746 * src/symtab.c (symbol_check_alias_consistence): Adjust.
18747
18748 * tests/regression.at (Invalid %directive): Remove, as it is now
18749 meaningless.
18750 (Invalid inputs): Adjust to the new error messages.
18751 (Token definitions): The new grammar doesn't allow too many
18752 eccentricities.
18753
18754 * src/lex.h, src/lex.c: Remove.
18755 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
18756 (copy_character, copy_string2, copy_string, copy_identifier)
18757 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
18758 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
18759 (parse_action): Remove.
18760 * po/POTFILES.in: Adjust.
18761
2e047461
AD
187622002-06-11 Akim Demaille <akim@epita.fr>
18763
cd05d13c 18764 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
18765 rule's action member: return the action as a string.
18766 Don't require `rule_length' as an argument: compute it.
18767 (grammar_current_rule_symbol_append)
18768 (grammar_current_rule_action_append): New, eved out from
18769 (readgram): here.
18770 Remove `action_flag', `rulelength', unused now.
18771
9af3fbce
AD
187722002-06-11 Akim Demaille <akim@epita.fr>
18773
18774 * src/reader.c (grammar_current_rule_prec_set).
18775 (grammar_current_rule_check): New, eved out from...
18776 (readgram): here.
18777 Remove `xaction', `first_rhs': useless.
18778 * tests/input.at (Type clashes): New.
18779 * tests/existing.at (GNU Cim Grammar): Adjust.
18780
1485e106
AD
187812002-06-11 Akim Demaille <akim@epita.fr>
18782
18783 * src/reader.c (grammar_midrule_action): New, Eved out from
18784 (readgram): here.
18785
da4160c3
AD
187862002-06-11 Akim Demaille <akim@epita.fr>
18787
18788 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
18789 New.
18790 (readgram): Use them as replacement of inlined code, crule and
18791 crule1.
18792
f6d0f937
AD
187932002-06-11 Akim Demaille <akim@epita.fr>
18794
18795 * src/reader.c (grammar_end, grammar_symbol_append): New.
18796 (readgram): Use them.
18797 Make the use of `p' as local as possible.
18798
69078d4b
AD
187992002-06-10 Akim Demaille <akim@epita.fr>
18800
18801 GCJ's parser requires the tokens to be defined before the prologue.
18802
18803 * data/bison.simple: Output the token definition before the user's
18804 prologue.
18805 * tests/regression.at (Braces parsing, Duplicate string)
18806 (Mixing %token styles): Check the output from bison.
18807 (Early token definitions): New.
18808
5e424082
AD
188092002-06-10 Akim Demaille <akim@epita.fr>
18810
18811 * src/symtab.c (symbol_user_token_number_set): Don't complain when
18812 assigning twice the same user number to a token, so that we can
18813 use it in...
18814 * src/lex.c (lex): here.
18815 Also use `symbol_class_set' instead of hand written code.
18816 * src/reader.c (parse_assoc_decl): Likewise.
18817
44536b35
AD
188182002-06-10 Akim Demaille <akim@epita.fr>
18819
18820 * src/symtab.c, src/symtab.c (symbol_class_set)
18821 (symbol_user_token_number_set): New.
18822 * src/reader.c (parse_token_decl): Use them.
18823 Use a switch instead of ifs.
18824 Use a single argument.
18825
8b9f2372
AD
188262002-06-10 Akim Demaille <akim@epita.fr>
18827
18828 Remove `%thong' support as it is undocumented, unused, duplicates
18829 `%token's job, and creates useless e-mail traffic with people who
18830 want to know what it is, why it is undocumented, unused, and
18831 duplicates `%token's job.
18832
18833 * src/reader.c (parse_thong_decl): Remove.
18834 * src/options.c (option_table): Remove "thong".
18835 * src/lex.h (tok_thong): Remove.
18836
3ae2b51f
AD
188372002-06-10 Akim Demaille <akim@epita.fr>
18838
18839 * src/symtab.c, src/symtab.c (symbol_type_set)
18840 (symbol_precedence_set): New.
18841 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
18842 (value_components_used): Remove, unused.
18843
2f1afb73
AD
188442002-06-09 Akim Demaille <akim@epita.fr>
18845
18846 Move symbols handling code out of the reader.
18847
18848 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
18849 (axiom): Move to...
18850 * src/symtab.h, src/symtab.c: here.
18851
18852 * src/gram.c (start_symbol): Remove: use startsymbol->number.
18853 * src/reader.c (startval): Rename as...
18854 * src/symtab.h, src/symtab.c (startsymbol): this.
18855 * src/reader.c: Adjust.
18856
18857 * src/reader.c (symbol_check_defined, symbol_make_alias)
18858 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18859 (token_translations_init)
18860 Move to...
18861 * src/symtab.c: here.
18862 * src/reader.c (packsymbols): Move to...
18863 * src/symtab.h, src/symtab.c (symbols_pack): here.
18864 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
18865 argument.
18866
e9bca3ad
AD
188672002-06-03 Akim Demaille <akim@epita.fr>
18868
18869 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
18870 then statements.
18871
86eff183
AD
188722002-06-03 Akim Demaille <akim@epita.fr>
18873
18874 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
18875 structs with non literals.
18876 * src/scan-skel.l: never-interactive.
18877 * src/conflicts.c (enum conflict_resolution_e): No trailing
18878 comma.
18879 * src/getargs.c (usage): Split long literal strings.
18880 Reported by Hans Aberg.
18881
717be197
AD
188822002-05-28 Akim Demaille <akim@epita.fr>
18883
18884 * data/bison.c++: Use C++ ostreams.
18885 (cdebug_): New member.
18886
670ddffd
AD
188872002-05-28 Akim Demaille <akim@epita.fr>
18888
18889 * src/output.c (output_skeleton): Be sure to allocate enough room
18890 for `/' _and_ for `\0' in full_skeleton.
18891
769b430f
AD
188922002-05-28 Akim Demaille <akim@epita.fr>
18893
18894 * data/bison.c++: Catch up with bison.simple:
18895 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18896 and Paul Eggert <eggert@twinsun.com>: `error' handing.
18897 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
18898 and popping traces.
18899
7067cb36
PH
189002002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18901
18902 * src/output.c (output_skeleton): Put an explicit path in front of
18903 the skeleton file name, rather than relying on the -I directory,
18904 to partially alleviate effects of having a skeleton file lying around
18905 in the current directory.
769b430f 18906
4a713ec2
PH
189072002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18908
769b430f 18909 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
18910 obstack_printf should be obstack_fgrow1.
18911
b408954b
AD
189122002-05-26 Akim Demaille <akim@epita.fr>
18913
18914 * src/state.h (state_t): `solved_conflicts' is a new member.
18915 * src/LR0.c (new_state): Set it to 0.
18916 * src/conflicts.h, src/conflicts.c (print_conflicts)
18917 (free_conflicts, solve_conflicts): Rename as...
18918 (conflicts_print, conflicts_free, conflicts_solve): these.
18919 Adjust callers.
18920 * src/conflicts.c (enum conflict_resolution_e)
18921 (solved_conflicts_obstack): New, used by...
18922 (log_resolution): this.
18923 Adjust to attach the conflict resolution to each state.
18924 Complete the description with the precedence/associativity
18925 information.
18926 (resolve_sr_conflict): Adjust.
18927 * src/print.c (print_state): Output its solved_conflicts.
18928 * tests/conflicts.at (Unresolved SR Conflicts)
18929 (Solved SR Conflicts): Exercise --report=all.
18930
a49aecd5
AD
189312002-05-26 Akim Demaille <akim@epita.fr>
18932
18933 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18934 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18935 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
18936 (token_number_t, item_number_as_token_number)
18937 (token_number_as_item_number, muscle_insert_token_number_table):
18938 Rename as...
18939 (symbol_number_t, item_number_as_symbol_number)
18940 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
18941 these, since it is more appropriate.
18942
5504898e
AD
189432002-05-26 Akim Demaille <akim@epita.fr>
18944
18945 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
18946 `Error:' lines.
18947 * data/bison.simple (yystos) [YYDEBUG]: New.
18948 (yyparse) [YYDEBUG]: Display the symbols which are popped during
18949 error recovery.
18950 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
18951
ec3bc396
AD
189522002-05-25 Akim Demaille <akim@epita.fr>
18953
18954 * doc/bison.texinfo (Debugging): Split into...
18955 (Tracing): this new section, its former contents, and...
18956 (Understanding): this new section.
18957 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
18958 by...
18959 (report_flag): this.
18960 Adjust all dependencies.
18961 (report_args, report_types, report_argmatch): New.
18962 (usage, getargs): Report/support -r, --report.
18963 * src/options.h
18964 (struct option_table_struct): Rename as..,
18965 (struct option_table_s): this.
18966 Rename the `set_flag' member to `flag' to match with getopt_long's
18967 struct.
18968 * src/options.c (option_table): Split verbose into an entry for
18969 %verbose, and another for --verbose.
18970 Support --report/-r, so remove -r from the obsolete --raw.
18971 * src/print.c: Attach full item sets and lookaheads reports to
18972 report_flag instead of trace_flag.
18973 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
18974
78df8250
PE
189752002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18976 and Paul Eggert <eggert@twinsun.com>
769b430f 18977
78df8250
PE
18978 * data/bison.simple (yyparse): Correct error handling to conform to
18979 POSIX and yacc. Specifically, after syntax error is discovered,
18980 do not reduce further before shifting the error token.
18981 Clean up the code a bit by removing the labels yyerrdefault,
18982 yyerrhandle, yyerrpop.
18983 * NEWS: Document the above.
18984
c0c9ea05
PH
189852002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18986
18987 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
18988 type; it isn't always big enough, since it doesn't necessarily
18989 include non-terminals.
769b430f 18990 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
18991 the latter can be removed.
18992 (yy_token_number_type): Remove, only one use.
18993 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
18994 don't use TokenNumberType as element type.
769b430f 18995
c0c9ea05
PH
18996 * tests/regression.at: Modify expected output to agree with change
18997 to yyr1 and yytranslate.
769b430f 18998
6390a83f
FK
189992002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
19000
19001 * src/reader.c (parse_action): Use copy_character instead of
19002 obstack_1grow.
19003
db7c8e9a
AD
190042002-05-13 Akim Demaille <akim@epita.fr>
19005
19006 * tests/regression.at (Token definitions): Prototype yylex and
19007 yyerror.
19008
fcc61800
PH
190092002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19010
158c687b 19011 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
19012 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
19013 32-bit arithmetic.
19014 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
19015
5683e9b2
AD
190162002-05-07 Akim Demaille <akim@epita.fr>
19017
19018 * tests/synclines.at: Be sure to prototype yylex and yyerror to
19019 avoid GCC warnings.
19020
0c2d3f4c
AD
190212002-05-07 Akim Demaille <akim@epita.fr>
19022
19023 Kill GCC warnings.
19024
19025 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
19026 over the RHS of each rule.
19027 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
19028 * src/state.h (state_t): Member `nitems' is unsigned short.
19029 * src/LR0.c (get_state): Adjust.
19030 * src/reader.c (packgram): Likewise.
19031 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
19032 `Type'.
19033 (muscle_insert_int_table): Remove, unused.
19034 (prepare_rules): Remove `max'.
19035
1565b720
AD
190362002-05-06 Akim Demaille <akim@epita.fr>
19037
19038 * src/closure.c (print_firsts): Display of the symbol tags.
19039 (bitmatrix_print): Move to...
19040 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
19041 here.
19042 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
19043
cfaee611
AD
190442002-05-06 Akim Demaille <akim@epita.fr>
19045
19046 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
19047 hash_do_for_each.
19048
458be8e0
AD
190492002-05-06 Akim Demaille <akim@epita.fr>
19050
19051 * src/LR0.c (new_state, get_state): Instead of using the global
19052 `kernel_size' and `kernel_base', have two new arguments:
19053 `core_size' and `core'.
19054 Adjust callers.
19055
a900a624
AD
190562002-05-06 Akim Demaille <akim@epita.fr>
19057
19058 * src/reader.c (packgram): No longer end `ritem' with a 0
19059 sentinel: it is not used.
19060
d4e7d3a1
AD
190612002-05-05 Akim Demaille <akim@epita.fr>
19062
19063 New experimental feature: display the lookaheads in the report and
19064 graph.
19065
19066 * src/print (print_core): When --trace-flag, display the rules
19067 lookaheads.
19068 * src/print_graph.c (print_core): Likewise.
19069 Swap the arguments.
19070 Adjust caller.
19071
39ceb25b
AD
190722002-05-05 Akim Demaille <akim@epita.fr>
19073
19074 * tests/torture.at (Many lookaheads): New test.
19075
5372019f
AD
190762002-05-05 Akim Demaille <akim@epita.fr>
19077
19078 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
19079 (GENERATE_MUSCLE_INSERT_TABLE): this.
19080 (output_int_table, output_unsigned_int_table, output_short_table)
19081 (output_token_number_table, output_item_number_table): Replace with...
19082 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
19083 (muscle_insert_short_table, muscle_insert_token_number_table)
19084 (muscle_insert_item_number_table): these.
19085 Adjust all callers.
19086 (prepare_tokens): Don't free `translations', since...
19087 * src/reader.h, src/reader.c (grammar_free): do it.
19088 Move to...
19089 * src/gram.h, src/gram.c (grammar_free): here.
19090 * data/bison.simple, data/bison.c++: b4_token_number_max is now
19091 b4_translate_max.
19092
5df5f6d5
AD
190932002-05-05 Akim Demaille <akim@epita.fr>
19094
19095 * src/output.c (output_unsigned_int_table): New.
19096 (prepare_rules): `i' is unsigned.
19097 `prhs', `rline', `r2' are unsigned int.
19098 Rename muscle `rhs_number_max' as `rhs_max'.
19099 Output muscles `prhs_max', `rline_max', and `r2_max'.
19100 Free rline and r1.
19101 * data/bison.simple, data/bison.c++: Adjust to use these muscles
19102 to compute types instead of constant types.
19103 * tests/regression.at (Web2c Actions): Adjust.
19104
b87f8b21
AD
191052002-05-04 Akim Demaille <akim@epita.fr>
19106
19107 * src/symtab.h (SALIAS, SUNDEF): Rename as...
19108 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
19109 Adjust dependencies.
19110 * src/output.c (token_definitions_output): Be sure not to output a
19111 `#define 'a'' when fed with `%token 'a' "a"'.
19112 * tests/regression.at (Token definitions): New.
19113
8bb936e4
PE
191142002-05-03 Paul Eggert <eggert@twinsun.com>
19115
19116 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
19117 for K&R C.
19118
191192002-05-03 gettextize <bug-gnu-gettext@gnu.org>
19120
19121 * Makefile.am (SUBDIRS): Remove intl.
19122 (EXTRA_DIST): Add config/config.rpath.
19123
53c71a12
AD
191242002-05-03 Akim Demaille <akim@epita.fr>
19125
19126 * data/bison.simple (m4_if): Don't output empty enums.
19127 And actually, output valid enum definitions :(.
19128
289dd0cf
AD
191292002-05-03 Akim Demaille <akim@epita.fr>
19130
19131 * configure.bat: Remove, completely obsolete.
19132 * Makefile.am (EXTRA_DIST): Adjust.
19133 Don't distribute config.rpath...
19134 * config/Makefile.am (EXTRA_DIST): Do it.
19135
db85e524
AD
191362002-05-03 Akim Demaille <akim@epita.fr>
19137
19138 * configure.in (GETTEXT_VERSION): New.
19139 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
19140
83ccf991
AD
191412002-05-03 Akim Demaille <akim@epita.fr>
19142
19143 * data/bison.simple (b4_token_enum): New.
19144 (b4_token_defines): Use it to output tokens both as #define and
19145 enums.
19146 Suggested by Paul Eggert.
19147 * src/output.c (token_definitions_output): Don't output spurious
19148 white spaces.
19149
1f418995
AD
191502002-05-03 Akim Demaille <akim@epita.fr>
19151
19152 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19153
45119f04
RA
191542002-05-02 Robert Anisko <robert@lrde.epita.fr>
19155
19156 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
19157 Update the stack class, give a try to deque as the default container.
19158
b2d52318
AD
191592002-05-02 Akim Demaille <akim@epita.fr>
19160
19161 * data/bison.simple (yyparse): Do not implement @$ = @1.
19162 (YYLLOC_DEFAULT): Adjust to do it.
19163 * doc/bison.texinfo (Location Default Action): Fix.
19164
3a8b4109
AD
191652002-05-02 Akim Demaille <akim@epita.fr>
19166
19167 * src/reader.c (parse_braces): Merge into...
19168 (parse_action): this.
19169
84614e13
AD
191702002-05-02 Akim Demaille <akim@epita.fr>
19171
19172 * configure.in (ALL_LINGUAS): Remove.
19173 * po/LINGUAS, hr.po: New.
19174
fdbcd8e2
AD
191752002-05-02 Akim Demaille <akim@epita.fr>
19176
19177 Remove the so called hairy (semantic) parsers.
19178
19179 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
19180 * src/gram.h, src/gram.c (semantic_parser): Remove.
19181 (rule_t): Remove the guard and guard_line members.
19182 * src/lex.h (token_t): remove tok_guard.
19183 * src/options.c (option_table): Remove %guard and %semantic_parser
19184 support.
19185 * src/output.c, src/output.h (guards_output): Remove.
19186 (prepare): Adjust.
19187 (token_definitions_output): Don't output the `T'
19188 tokens (???).
19189 (output_skeleton): Don't output the guards.
19190 * src/files.c, src/files.c (attrsfile): Remove.
19191 * src/reader.c (symbol_list): Remove the guard and guard_line
19192 members.
19193 Adjust dependencies.
19194 (parse_guard): Remove.
19195 * data/bison.hairy: Remove.
19196 * doc/bison.texinfo (Environment Variables): Remove occurrences of
19197 BISON_HAIRY.
19198
82b6cb3f
AD
191992002-05-02 Akim Demaille <akim@epita.fr>
19200
19201 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
19202 (parse_guard): Rename the formal argument `stack_offset' as
19203 `rule_length', which is more readable.
19204 Adjust callers.
19205 (copy_at, copy_dollar): Instead of outputting the hard coded
19206 values of $$, $n and so forth, output invocation to b4_lhs_value,
19207 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
19208 Note: this patch partially drops `semantic-parser' support: it
19209 always does `rule_length - n', where semantic parsers ought to
19210 always use `-n'.
82b6cb3f
AD
19211 * data/bison.simple, data/bison.c++ (b4_lhs_value)
19212 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
19213
6cbfbcc5
AD
192142002-05-02 Akim Demaille <akim@epita.fr>
19215
19216 * configure.in (AC_INIT): Bump to 1.49b.
19217 (AM_INIT_AUTOMAKE): Short invocation.
19218
b8548114
AD
192192002-05-02 Akim Demaille <akim@epita.fr>
19220
19221 Version 1.49a.
19222
c20cd1fa
AD
192232002-05-01 Akim Demaille <akim@epita.fr>
19224
19225 * src/skeleton.h: Remove.
19226
8a9566d4
AD
192272002-05-01 Akim Demaille <akim@epita.fr>
19228
19229 * src/skeleton.h: Fix the #endif.
19230 Reported by Magnus Fromreide.
19231
8c6d399a
PE
192322002-04-26 Paul Eggert <eggert@twinsun.com>
19233
19234 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
19235 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 19236 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 19237
2b7ed18a
RA
192382002-04-25 Robert Anisko <robert@lrde.epita.fr>
19239
19240 * src/scan-skel.l: Postprocess quadrigraphs.
19241
19242 * src/reader.c (copy_character): New function, used to output
19243 single characters while replacing `[' and `]' with quadrigraphs, to
19244 avoid troubles with M4 quotes.
19245 (copy_comment): Output characters with copy_character.
19246 (read_additionnal_code): Likewise.
19247 (copy_string2): Likewise.
19248 (copy_definition): Likewise.
19249
19250 * tests/calc.at: Exercise M4 quoting.
19251
34a89c50
AD
192522002-04-25 Akim Demaille <akim@epita.fr>
19253
19254 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
19255 between `!' and the command.
19256 Reported by Paul Eggert.
19257
0dd1580a
RA
192582002-04-24 Robert Anisko <robert@lrde.epita.fr>
19259
19260 * tests/calc.at: Exercise prologue splitting.
19261
19262 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
19263 `b4_post_prologue' instead of `b4_prologue'.
19264
19265 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
19266 muscles.
19267 (output): Free pre_prologue_obstack and post_prologue_obstack.
19268 * src/files.h, src/files.c (attrs_obstack): Remove.
19269 (pre_prologue_obstack, post_prologue_obstack): New.
19270 * src/reader.c (copy_definition): Add a parameter to specify the
19271 obstack to fill, instead of using attrs_obstack unconditionally.
19272 (read_declarations): Pass pre_prologue_obstack to copy_definition if
19273 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
19274
83c1796f
PE
192752002-04-23 Paul Eggert <eggert@twinsun.com>
19276
19277 * data/bison.simple: Remove unnecessary commentary and white
19278 space differences from 1_29-branch.
19279 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
19280
19281 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
19282 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
19283 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
19284 constructors or destructors.
19285
19286 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
19287
1207eeac
AD
192882002-04-23 Akim Demaille <akim@epita.fr>
19289
19290 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
19291 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
19292 location with columns.
19293 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
19294 All reported by Paul Eggert.
19295
78ab8f67
AD
192962002-04-22 Akim Demaille <akim@epita.fr>
19297
19298 * src/reduce.c (dump_grammar): Move to...
19299 * src/gram.h, src/gram.c (grammar_dump): here.
19300 Be sure to separate long item numbers.
19301 Don't read the members of a rule's prec if its nil.
19302
133c20e2
AD
193032002-04-22 Akim Demaille <akim@epita.fr>
19304
19305 * src/output.c (table_size, table_grow): New.
19306 (MAXTABLE): Remove, replace uses with table_size.
19307 (pack_vector): Instead of dying when the table is too big, grow it.
19308
9515e8a7
AD
193092002-04-22 Akim Demaille <akim@epita.fr>
19310
19311 * data/bison.simple (yyr1): Its type is that of a token number.
19312 * data/bison.c++ (r1_): Likewise.
19313 * tests/regression.at (Web2c Actions): Adjust.
19314
23c5a174
AD
193152002-04-22 Akim Demaille <akim@epita.fr>
19316
19317 * src/reader.c (token_translations_init): 256 is now the default
19318 value for the error token, i.e., it will be assigned another
19319 number if the user assigned 256 to one of her tokens.
19320 (reader): Don't force 256 to error.
19321 * doc/bison.texinfo (Symbols): Adjust.
19322 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
19323 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
19324 etc. instead of 10, 20, 30 (which was used to `jump' over error
19325 (256) and undefined (2)).
19326
5fbb0954
AD
193272002-04-22 Akim Demaille <akim@epita.fr>
19328
19329 Propagate more token_number_t.
19330
19331 * src/gram.h (token_number_as_item_number)
19332 (item_number_as_token_number): New.
19333 * src/output.c (GENERATE_OUTPUT_TABLE): New.
19334 Use it to create output_item_number_table and
19335 output_token_number_table.
19336 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19337 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
19338 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
19339 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
19340
4f940944
AD
193412002-04-22 Akim Demaille <akim@epita.fr>
19342
19343 * src/output.h, src/output.c (get_lines_number): Remove.
19344
3ded9a63
AD
193452002-04-19 Akim Demaille <akim@epita.fr>
19346
19347 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
19348 as Lex/Flex'.
19349 (Debugging): More details about enabling the debugging features.
19350 (Table of Symbols): Describe $$, $n, @$, and @n.
19351 Suggested by Tim Josling.
19352
e0c471a9
AD
193532002-04-19 Akim Demaille <akim@epita.fr>
19354
19355 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
19356
fecc10cd
AD
193572002-04-10 Akim Demaille <akim@epita.fr>
19358
19359 * src/system.h: Rely on HAVE_LIMITS_H.
19360 Suggested by Paul Eggert.
19361
51dec47b
AD
193622002-04-09 Akim Demaille <akim@epita.fr>
19363
19364 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
19365 full stderr, and strip it according to the bison options, instead
19366 of composing the error message from different bits.
19367 This makes it easier to check for several error messages.
19368 Adjust all the invocations.
19369 Add an invocation exercising the error token.
19370 Add an invocation demonstrating a stupid error message.
19371 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
19372 Adjust the tests.
19373 Error message are for stderr, not stdout.
19374
007a50a4
AD
193752002-04-09 Akim Demaille <akim@epita.fr>
19376
19377 * src/gram.h, src/gram.c (error_token_number): Remove, use
19378 errtoken->number.
19379 * src/reader.c (reader): Don't specify the user token number (2)
19380 for $undefined, as it uselessly prevents using it.
19381 * src/gram.h (token_number_t): Move to...
19382 * src/symtab.h: here.
19383 (state_t.number): Is a token_number_t.
19384 * src/print.c, src/reader.c: Use undeftoken->number instead of
19385 hard coded 2.
19386 (Even though this 2 is not the same as above: the number of the
19387 undeftoken remains being 2, it is its user token number which
19388 might not be 2).
19389 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
19390 `user_token_number_max'.
19391 Output `undef_token_number'.
19392 * data/bison.simple, data/bison.c++: Use them.
19393 Be sure to map invalid yylex return values to
19394 `undef_token_number'. This saves us from gratuitous SEGV.
19395
19396 * tests/conflicts.at (Solved SR Conflicts)
19397 (Unresolved SR Conflicts): Adjust.
19398 * tests/regression.at (Web2c Actions): Adjust.
19399
06446ccf
AD
194002002-04-08 Akim Demaille <akim@epita.fr>
19401
19402 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
19403 Adding #line.
19404 Remove the duplicate `typedefs'.
19405 (RhsNumberType): Fix the declaration and various other typos.
19406 Use __ofile__.
19407 * data/bison.simple: Use __ofile__.
19408 * src/scan-skel.l: Handle __ofile__.
19409
62a3e4f0
AD
194102002-04-08 Akim Demaille <akim@epita.fr>
19411
19412 * src/gram.h (item_number_t): New, the type of item numbers in
19413 RITEM. Note that it must be able to code symbol numbers as
19414 positive number, and the negation of rule numbers as negative
19415 numbers.
19416 Adjust all dependencies (pretty many).
19417 * src/reduce.c (rule): Remove this `short *' pointer: use
19418 item_number_t.
19419 * src/system.h (MINSHORT, MAXSHORT): Remove.
19420 Include `limits.h'.
19421 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
19422 (shortcpy): Remove.
19423 (MAXTABLE): Move to...
19424 * src/output.c (MAXTABLE): here.
19425 (prepare_rules): Use output_int_table to output rhs.
19426 * data/bison.simple, data/bison.c++: Adjust.
19427 * tests/torture.at (Big triangle): Move the limit from 254 to
19428 500.
19429 * tests/regression.at (Web2c Actions): Ajust.
19430
19431 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
19432 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
19433 passes, but produces negative #line number, once fixed, GCC is
19434 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
19435 C), it passes.
19436 * src/state.h (state_h): Code input lines on ints, not shorts.
19437
bb88b0fc
AD
194382002-04-08 Akim Demaille <akim@epita.fr>
19439
19440 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
19441 and then the grammar.
19442
9a636f47
AD
194432002-04-08 Akim Demaille <akim@epita.fr>
19444
19445 * src/system.h: No longer using strndup.
19446
680e8701
AD
194472002-04-07 Akim Demaille <akim@epita.fr>
19448
19449 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
19450 * src/output.c (output_table_data): Return the longest number.
19451 (prepare_tokens): Output `token_number_max').
19452 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
19453 New.
19454 Use them to define yy_token_number_type/TokenNumberType.
19455 Use this type for yytranslate.
19456 * tests/torture.at (Big triangle): Push the limit from 124 to
19457 253.
19458 * tests/regression.at (Web2c Actions): Adjust.
19459
817e9f41
AD
194602002-04-07 Akim Demaille <akim@epita.fr>
19461
19462 * tests/torture.at (Big triangle): New.
19463 (GNU AWK Grammar, GNU Cim Grammar): Move to...
19464 * tests/existing.at: here.
19465
5123689b
AD
194662002-04-07 Akim Demaille <akim@epita.fr>
19467
19468 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
19469 nritems.
19470 Adjust dependencies.
19471
f3849179
AD
194722002-04-07 Akim Demaille <akim@epita.fr>
19473
19474 * src/reader.c: Normalize increments to prefix form.
19475
bd02036a
AD
194762002-04-07 Akim Demaille <akim@epita.fr>
19477
19478 * src/reader.c, symtab.c: Remove debugging code.
19479
db8837cb
AD
194802002-04-07 Akim Demaille <akim@epita.fr>
19481
19482 Rename all the `bucket's as `symbol_t'.
19483
19484 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
19485 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
19486 * src/symtab.c, src/symtab.h (bucket): Rename as...
19487 (symbol_t): this.
19488 (symbol_list_new, bucket_check_defined, bucket_make_alias)
19489 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
19490 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19491 (buckets_new, buckets_free, buckets_do): Rename as...
19492 (symbol_list_new, symbol_check_defined, symbol_make_alias)
19493 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19494 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
19495 (symbols_new, symbols_free, symbols_do): these.
19496
72a23c97
AD
194972002-04-07 Akim Demaille <akim@epita.fr>
19498
19499 Use lib/hash for the symbol table.
19500
19501 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
19502 EOF.
19503 * src/lex.c (lex): Set the `number' member of new terminals.
19504 * src/reader.c (bucket_check_defined, bucket_make_alias)
19505 (bucket_check_alias_consistence, bucket_translation): New.
19506 (reader, grammar_free, readgram, token_translations_init)
19507 (packsymbols): Adjust.
19508 (reader): Number the predefined tokens.
19509 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
19510 for predefined tokens.
19511 * src/symtab.h (bucket): Remove all the hash table related
19512 members.
19513 * src/symtab.c (symtab): Replace by...
19514 (bucket_table): this.
19515 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19516 (buckets_new, buckets_do): New.
19517
280a38c3
AD
195182002-04-07 Akim Demaille <akim@epita.fr>
19519
19520 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
19521 (start_symbol, max_user_token_number, semantic_parser)
19522 (error_token_number): Initialize.
19523 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
19524 Initialize.
19525 (reader): Don't.
19526 (errtoken, eoftoken, undeftoken, axiom): Extern.
19527
03b31c0c
AD
195282002-04-07 Akim Demaille <akim@epita.fr>
19529
19530 * src/gram.h (rule_s): prec and precsym are now pointers
19531 to the bucket giving the priority/associativity.
19532 Member `associativity' removed: useless.
19533 * src/reduce.c, src/conflicts.c: Adjust.
19534
8b3df748
AD
195352002-04-07 Akim Demaille <akim@epita.fr>
19536
19537 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
19538 Properly escape the symbols' TAG when outputting them.
19539
e601aa1d
AD
195402002-04-07 Akim Demaille <akim@epita.fr>
19541
19542 * src/lalr.h (LA): Is a bitsetv, not bitset*.
19543
b0299a2e
AD
195442002-04-07 Akim Demaille <akim@epita.fr>
19545
19546 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
19547 (LArule): this, which is an array to rule_t*.
19548 * src/print.c, src/conflicts.c: Adjust.
19549
d7e1f00c
AD
195502002-04-07 Akim Demaille <akim@epita.fr>
19551
19552 * src/gram.h (rule_t): Rename `number' as `user_number'.
19553 `number' is a new member.
19554 Adjust dependencies.
19555 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
19556
cc9305dd
AD
195572002-04-07 Akim Demaille <akim@epita.fr>
19558
19559 As a result of the previous patch, it is no longer needed
19560 to reorder ritem itself.
19561
19562 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
19563
b0940840
AD
195642002-04-07 Akim Demaille <akim@epita.fr>
19565
19566 Be sure never to walk through RITEMS, but use only data related to
19567 the rules themselves. RITEMS should be banished.
19568
19569 * src/output.c (output_token_translations): Rename as...
19570 (prepare_tokens): this.
19571 In addition to `translate', prepare the muscles `tname' and
19572 `toknum', which were handled by...
19573 (output_rule_data): this.
19574 Remove, and move the remainder of its outputs into...
19575 (prepare_rules): this new routines, which also merges content from
19576 (output_gram): this.
19577 (prepare_rules): Be sure never to walk through RITEMS.
19578 (output_stos): Rename as...
19579 (prepare_stos): this.
19580 (output): Always invoke prepare_states, after all, just don't use it
19581 in the output if you don't need it.
19582
643a5994
AD
195832002-04-07 Akim Demaille <akim@epita.fr>
19584
19585 * src/LR0.c (new_state): Display `nstates' as the name of the
19586 newly created state.
19587 Adjust to initialize first_state and last_state if needed.
19588 Be sure to distinguish the initial from the final state.
19589 (new_states): Create the itemset of the initial state, and use
19590 new_state.
19591 * src/closure.c (closure): Now that the initial state has its
19592 items properly set, there is no need for a special case when
19593 creating `ruleset'.
19594
19595 As a result, now the rule 0, reducing to $axiom, is visible in the
19596 outputs. Adjust the test suite.
19597
19598 * tests/conflicts.at (Solved SR Conflicts)
19599 (Unresolved SR Conflicts): Adjust.
19600 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
19601 * tests/conflicts.at (S/R in initial): New.
19602
b4c4ccc2
AD
196032002-04-07 Akim Demaille <akim@epita.fr>
19604
19605 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
19606 the RHS of the rules.
19607 * src/output.c (output_gram): Likewise.
19608
bba97eb2
AD
196092002-04-07 Akim Demaille <akim@epita.fr>
19610
19611 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
19612 bucket.
19613 Adjust all dependencies.
19614 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
19615 `number' of the buckets too.
19616 * src/gram.h: Include `symtab.h'.
19617 (associativity): Move to...
19618 * src/symtab.h: here.
19619 No longer include `gram.h'.
19620
c3b407f4
AD
196212002-04-07 Akim Demaille <akim@epita.fr>
19622
19623 * src/gram.h, src/gram.c (rules_rhs_length): New.
19624 (ritem_longest_rhs): Use it.
19625 * src/gram.h (rule_t): `number' is a new member.
19626 * src/reader.c (packgram): Set it.
19627 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
19628 the end of `rules', and count them out of `nrules'.
19629 (reduce_output, dump_grammar): Adjust.
19630 * src/print.c (print_grammar): It is no longer needed to check for
19631 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
19632 * tests/reduce.at (Reduced Automaton): New test.
19633
11652ab3
AD
196342002-04-07 Akim Demaille <akim@epita.fr>
19635
19636 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
19637 lacking `+ 1' to nrules, Bison reported as useless a token if it
19638 was used solely to set the precedence of the last rule...
19639
26b23c1a
AD
196402002-04-07 Akim Demaille <akim@epita.fr>
19641
19642 * data/bison.c++, data/bison.simple: Don't output the current file
19643 name in #line, to avoid useless diffs between two identical
19644 outputs under different names.
19645
18bcecb0
AD
196462002-04-07 Akim Demaille <akim@epita.fr>
19647
19648 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
19649 Normalize loops to using `< nrules + 1', not `<= nrules'.
19650
fa770c86
AD
196512002-04-07 Akim Demaille <akim@epita.fr>
19652
19653 * TODO: Update.
19654
d9b739c3
AD
196552002-04-07 Akim Demaille <akim@epita.fr>
19656
19657 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
19658 bucket.value as bucket.number.
19659
99013900
AD
196602002-04-07 Akim Demaille <akim@epita.fr>
19661
19662 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
19663 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19664 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
19665 RHS, instead of being an index in RITEMS.
19666
e966383b
PE
196672002-04-04 Paul Eggert <eggert@twinsun.com>
19668
19669 * doc/bison.texinfo: Update copyright date.
19670 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
19671 (Symbols): Warn about running Bison in one character set,
19672 but compiling and/or running in an incompatible one.
19673 Warn about character code 256, too.
19674
196752002-04-03 Paul Eggert <eggert@twinsun.com>
19676
19677 * src/bison.data (YYSTACK_ALLOC): Depend on whether
19678 YYERROR_VERBOSE is nonzero, not whether it is defined.
19679
19680 Merge changes from bison-1_29-branch.
c307773e 19681
8d6c48b9
PE
196822002-03-20 Paul Eggert <eggert@twinsun.com>
19683
19684 Merge fixes from Debian bison_1.34-1.diff.
19685
19686 * configure.in (AC_PREREQ): 2.53.
19687
e53c6322
AD
196882002-03-20 Akim Demaille <akim@epita.fr>
19689
19690 * src/conflicts.c (log_resolution): Argument `resolution' is const.
19691
9ffbeca7
PE
196922002-03-19 Paul Eggert <eggert@twinsun.com>
19693
21db0b2a
PE
19694 * src/bison.simple (YYCOPY): New macro.
19695 (YYSTACK_RELOCATE): Use it.
19696 Remove Type arg; no longer needed. All callers changed.
19697 (yymemcpy): Remove; no longer needed.
19698
9ffbeca7
PE
19699 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
19700 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
19701
642cb8f8
AD
197022002-03-19 Akim Demaille <akim@epita.fr>
19703
19704 Test and fix the #line outputs.
19705
19706 * tests/atlocal.at (GCC): New.
19707 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 19708 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
19709 (Action synch line, Epilogue synch line): New tests.
19710 * src/reader.c (parse_union_decl): Define the muscle stype_line.
19711 * data/bison.simple, data/bison.c++: Use it.
19712
3c31a486
AD
197132002-03-19 Akim Demaille <akim@epita.fr>
19714
19715 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
19716 (Solved SR Conflicts, %expect not enough, %expect right)
19717 (%expect too much): Move to...
19718 * tests/conflicts.at: this new file.
19719
0d8bed56
AD
197202002-03-19 Akim Demaille <akim@epita.fr>
19721
19722 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19723 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
19724 that we can move to enums for instance.
19725 * src/output.c (token_definitions_output): Output a list of
19726 `token-name, token-number' instead of the #define.
19727 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
19728
9208d17f
AD
197292002-03-14 Akim Demaille <akim@epita.fr>
19730
19731 Use Gettext 0.11.1.
19732
af27eacb
RA
197332002-03-09 Robert Anisko <robert@lrde.epita.fr>
19734
19735 * data/bison.c++: Make the user able to add members to the generated
19736 parser by subclassing.
19737
9101a310
RA
197382002-03-05 Robert Anisko <robert@lrde.epita.fr>
19739
19740 * src/reader.c (read_additionnal_code): `c' should be an integer, not
19741 a character.
19742 Reported by Nicolas Tisserand and Nicolas Burrus.
19743
fff9bf0b
RA
197442002-03-04 Robert Anisko <robert@lrde.epita.fr>
19745
19746 * src/reader.c: Warn about lacking semi-colons, do not complain.
19747
64dba31e
RA
197482002-03-04 Robert Anisko <robert@lrde.epita.fr>
19749
19750 * data/bison.c++: Remove a debug line.
19751
374f5a14
RA
197522002-03-04 Robert Anisko <robert@lrde.epita.fr>
19753
19754 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
19755 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
19756 provide a default implementation.
19757
bfcf1f3a
AD
197582002-03-04 Akim Demaille <akim@epita.fr>
19759
19760 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
19761 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
19762 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
19763 * tests/semantic.at (Parsing Guards): Similarly.
19764 * src/reader.at (readgram): Complain if the last rule is not ended
19765 with a semi-colon.
19766
65ccf9fc
AD
197672002-03-04 Akim Demaille <akim@epita.fr>
19768
19769 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
19770 * src/closure.c: here.
19771 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
19772 RTC.
19773 * src/warshall.h, src/warshall.c: Remove.
19774 * tests/sets.at (Broken Closure): Adjust.
19775
d0039cbc
AD
197762002-03-04 Akim Demaille <akim@epita.fr>
19777
19778 * src/output.c (output_skeleton): tempdir is const.
19779 bytes_read is unused.
19780
345cea78
AD
197812002-03-04 Akim Demaille <akim@epita.fr>
19782
19783 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19784 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
19785 Update.
19786 From Michael Hayes.
19787
564801f7
AD
197882002-03-04 Akim Demaille <akim@epita.fr>
19789
19790 * src/closure.c (closure): `r' is unused.
19791
e5352bc7
AD
197922002-03-04 Akim Demaille <akim@epita.fr>
19793
19794 * tests/sets.at (Broken Closure): Add the ending `;'.
19795 * src/reader.at (readgram): Complain if a rule is not ended with a
19796 semi-colon.
19797
914feea9
AD
197982002-03-04 Akim Demaille <akim@epita.fr>
19799
19800 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
19801 (count_sr_conflicts): Use bitset_count.
19802 * src/reduce.c (inaccessable_symbols): Ditto.
19803 (bits_size): Remove.
19804 * src/warshall.h, src/warshall.c: Convert to bitsetv.
19805
f0250de6
AD
198062002-03-04 Akim Demaille <akim@epita.fr>
19807
19808 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
19809 * src/reduce.c: Remove the `bitset_zero's following the
19810 `bitset_create's, as now it is performed by the latter.
19811
ef017502
AD
198122002-03-04 Akim Demaille <akim@epita.fr>
19813
19814 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
19815 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
19816 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
19817 latest sources from Michael.
19818
76514394
AD
198192002-03-04 Akim Demaille <akim@epita.fr>
19820
19821 * src/output.c (output): Don't free the grammar.
19822 * src/reader.c (grammar_free): New.
19823 * src/main.c (main): Call it and don't free symtab here.
19824
55024580
AD
198252002-03-04 Akim Demaille <akim@epita.fr>
19826
19827 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
19828 before returning.
19829 Reported by Benoit Perrot.
19830
f9abaa2c
AD
198312002-03-04 Akim Demaille <akim@epita.fr>
19832
19833 Use bitset operations when possible, not loops over bits.
19834
19835 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
19836 bitset_or.
19837 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
19838 * src/reduce.c (useless_nonterminals): Formatting changes.
19839 * src/warshall.c (TC): Use bitset_or.
19840
0e721e75
AD
198412002-03-04 Akim Demaille <akim@epita.fr>
19842
19843 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
19844 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
19845 Ditto.
19846
0fb1ffb1
AD
198472002-03-04 Akim Demaille <akim@epita.fr>
19848
19849 * src/lalr.c (F): Now a bitset*.
19850 Adjust all dependencies.
19851
b86796bf
AD
198522002-03-04 Akim Demaille <akim@epita.fr>
19853
19854 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
19855 Adjust all dependencies.
19856
602bbf31
AD
198572002-03-04 Akim Demaille <akim@epita.fr>
19858
19859 * src/L0.c, src/LR0.h (nstates): Be size_t.
19860 Adjust comparisons (signed vs unsigned).
19861 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
19862 bitset*.
19863 Adjust all dependencies.
19864
d8a0245c
AD
198652002-03-04 Akim Demaille <akim@epita.fr>
19866
19867 * src/closure.c (firsts): Now, also a bitset.
19868 Adjust all dependencies.
19869 (varsetsize): Remove, now unused.
19870 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
19871
34ba9743
AD
198722002-03-04 Akim Demaille <akim@epita.fr>
19873
19874 * src/print.c: Convert to use bitset.h, not hand coded iterations
19875 over ints.
19876
ed86e78c
AD
198772002-03-04 Akim Demaille <akim@epita.fr>
19878
19879 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
19880
dfdb1797
AD
198812002-03-04 Akim Demaille <akim@epita.fr>
19882
19883 * src/closure.c (ruleset): Be a bitset.
19884 (rulesetsize): Remove.
19885
7086e707
AD
198862002-03-04 Akim Demaille <akim@epita.fr>
19887
19888 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19889 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
19890 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
19891 * src/closure.c (fderives): Be an array of bitsets.
19892
98254360
RA
198932002-02-28 Robert Anisko <robert@lrde.epita.fr>
19894
19895 * data/bison.c++: Merge the two generated headers. Insert a copyright
19896 notice in each output file.
19897
a75c057f
AD
198982002-02-28 Akim Demaille <akim@epita.fr>
19899
19900 * data/bison.c++: Copy the prologue of bison.simple to fetch
19901 useful M4 definitions, such as b4_header_guard.
19902
06b00abc
AD
199032002-02-25 Akim Demaille <akim@epita.fr>
19904
19905 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
19906 translator friendly scheme for the bgr
19907 copyright notice.
06b00abc 19908
70e7d534
AD
199092002-02-25 Akim Demaille <akim@epita.fr>
19910
19911 * src/output.c (header_output): Remove, now handled completely via
19912 M4.
19913
abe017f6
AD
199142002-02-25 Akim Demaille <akim@epita.fr>
19915
19916 * m4/m4.m4: New, from CVS Autoconf.
19917 * configure.in: Invoke it.
19918 * src/output.c (output_skeleton): Use its result instead of the
19919 hard coded name.
19920
381fb12e
AD
199212002-02-25 Akim Demaille <akim@epita.fr>
19922
19923 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
19924 Fileutils 4.1.5.
19925 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
19926 * src/output.c (output_skeleton): Use mkstemp to create a real
19927 temporary file.
19928 Move the filling of `skeleton' and its muscle to...
19929 (prepare): here.
19930 (output): Move the definition of the prologue muscle to...
19931 (prepare): here.
19932 * src/system.h (DEFAULT_TMPDIR): New.
19933
6f38107f
PE
199342002-02-14 Paul Eggert <eggert@twinsun.com>
19935
19936 Remove the support for C++ namespace cleanliness; it was
19937 causing more problems than it was curing, since it didn't work
19938 properly on some nonstandard C++ compilers. This can wait
19939 for a proper C++ parser.
19940
19941 * NEWS: Document this.
19942 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
19943 of C++, as it's treated like C now.
19944 * src/bison.simple (YYSTD): Remove.
19945 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
19946 Treat C++ just like Standard C instead of trying to support
19947 namespace cleanliness.
19948
80cce3da
AD
199492002-02-14 Akim Demaille <akim@epita.fr>
19950
19951 * tests/regression.at (else): Adjust to Andreas' change.
19952
842e8679
AD
199532002-02-14 Akim Demaille <akim@epita.fr>
19954
19955 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
19956
4bda3f10
AD
199572002-02-13 Andreas Schwab <schwab@suse.de>
19958
19959 * src/output.c (output_rule_data): Don't output NULL, it might
19960 not be defined yet.
19961
4162fa07 199622002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 19963
4162fa07
RA
19964 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
19965 (Copyright notice): Update.
b418ecd8 19966
bd16a5dc
AD
199672002-02-11 Akim Demaille <akim@epita.fr>
19968
19969 * tests/regression.at (%nonassoc and eof): Don't include
19970 nonportable headers.
19971
8d69a1a3
RA
199722002-02-08 Robert Anisko <robert@lrde.epita.fr>
19973
19974 * data/bison.c++: Correct error recovery. Make the user able to
19975 initialize the starting location.
19976
9b2d0677
AD
199772002-02-07 Akim Demaille <akim@epita.fr>
19978
19979 * tests/input.at: New.
19980
69e2658b
RA
199812002-02-07 Robert Anisko <robert@lrde.epita.fr>
19982
19983 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 19984 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
19985 directives around tables only needed for debugging.
19986
4aacc3a7
RA
199872002-02-07 Robert Anisko <robert@lrde.epita.fr>
19988
19989 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
19990 C++ parsers.
19991 (yy::b4_name::parse): Use print_.
19992
762a801e
RA
199932002-02-07 Robert Anisko <robert@lrde.epita.fr>
19994
19995 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
19996
4bb2bc3f
RA
199972002-02-07 Robert Anisko <robert@lrde.epita.fr>
19998
19999 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
20000 C++ parsers.
20001 (yy::b4_name::parse): Build verbose error messages, and use error_.
20002
6b45a3ca
RA
200032002-02-06 Robert Anisko <robert@lrde.epita.fr>
20004
20005 * data/bison.c++: Fix m4 quoting in comments.
20006
50997c6e
RA
200072002-02-06 Robert Anisko <robert@lrde.epita.fr>
20008
20009 * data/bison.c++: Adjust the parser code. Fix some muscles that were
20010 not expanded by m4.
20011
3f3eed27
AD
200122002-02-05 Akim Demaille <akim@epita.fr>
20013
20014 * data/bison.c++: Adjust to the M4 back end.
20015 More is certainly needed.
20016
be2a1a68
AD
200172002-02-05 Akim Demaille <akim@epita.fr>
20018
20019 Give a try to M4 as a back end.
20020
20021 * lib/readpipe.c: New, from wdiff.
20022 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
20023 BISON_HAIRY.
20024 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
20025 specific values. Now it is m4 that performs the lookup.
20026 * src/parse-skel.y: Remove.
20027 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
20028 * src/output.c (actions_output, guards_output)
20029 (token_definitions_output): No longer keeps track of the output
20030 line number, hence remove the second argument.
20031 (guards_output): Check against the guard member of a rule, not the
20032 action member.
20033 Adjust callers.
20034 (output_skeleton): Don't look for the skeleton location, let m4 do
20035 that.
20036 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
20037 file will be used.
20038 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
20039 (prepare): Given that for the time being changesyntax is not
20040 usable in M4, rename the muscles using `-' to `_'.
20041 Define `defines_flag', `output_parser_name' and `output_header_name'.
20042 * src/output.h (actions_output, guards_output)
20043 (token_definitions_output): Adjust prototypes.
20044 * src/scan-skel.l: Instead of scanning the skeletons, it now
20045 processes the output of m4: `__oline__' and `#output'.
20046 * data/bison.simple: Adjust to be used by M4(sugar).
20047 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
20048 to date.
20049 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
20050 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
20051 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
20052 shamelessly stolen from CVS Autoconf.
20053
beda758b
AD
200542002-02-05 Akim Demaille <akim@epita.fr>
20055
20056 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
20057 * configure.in: Check for the declarations of free and malloc.
20058 * src/muscle_tab.c: Adjust.
20059
5ece6d43
AD
200602002-02-05 Akim Demaille <akim@epita.fr>
20061
20062 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
20063 which have no values.
20064
5bb18f9a
AD
200652002-02-05 Akim Demaille <akim@epita.fr>
20066
20067 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
20068 * data/: here.
20069
894dd62e
PE
200702002-01-29 Paul Eggert <eggert@twinsun.com>
20071
20072 * src/bison.simple (YYSIZE_T): Do not define merely because
20073 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
20074 On some platforms, <alloca.h> does not declare YYSTD (size_t).
20075
82841af7
AD
200762002-01-27 Akim Demaille <akim@epita.fr>
20077
20078 Fix `%nonassoc and eof'.
20079
20080 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
20081 which were not properly copied! Replace
20082 memcpy (res->errs, src->errs, src->nerrs);
20083 with
20084 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
20085 !!!
20086 * tests/regression.at (%nonassoc and eof): Adjust to newest
20087 Autotest: `.' is not in the PATH.
20088
318b76e9
AD
200892002-01-27 Akim Demaille <akim@epita.fr>
20090
20091 * tests/sets.at (AT_EXTRACT_SETS): New.
20092 (Nullable): Use it.
20093 (Firsts): New.
20094
30d2f3d5
AD
200952002-01-26 Akim Demaille <akim@epita.fr>
20096
20097 * tests/actions.at, tests/calc.at, tests/headers.at,
20098 * tests/torture.at: Adjust to the newest Autotest which no longer
20099 forces `.' in the PATH.
20100
30f8c395
AD
201012002-01-25 Akim Demaille <akim@epita.fr>
20102
20103 * tests/regression.at (%nonassoc and eof): New.
20104 Suggested by Robert Anisko.
20105
29ae55f1
AD
201062002-01-24 Akim Demaille <akim@epita.fr>
20107
20108 Bison dumps core when trying to complain about broken input files.
20109 Reported by Cris van Pelt.
20110
20111 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
20112 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
20113 into...
20114 (Invalid inputs): Strengthen: exercise parse_percent_token.
20115
2b548aa6
RA
201162002-01-24 Robert Anisko <robert.anisko@epita.fr>
20117
20118 * src/Makefile.am: Add bison.c++.
20119 * src/bison.c++: New skeleton.
20120
bb0146c2
AD
201212002-01-21 Paolo Bonzini <bonzini@gnu.org>
20122
20123 * po/it.po: New.
20124
bec30531
AD
201252002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
20126
20127 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
20128
fc6edc45
MA
201292002-01-20 Marc Autret <marc@gnu.org>
20130
20131 * src/files.c (compute_output_file_names): Fix
20132
5e5d5415
MA
201332002-01-20 Marc Autret <marc@gnu.org>
20134
20135 * tests/output.at: New test.
20136 * src/files.c (compute_base_names): Don't map extensions when
20137 the YACC flag is set, use defaults.
20138 Reported by Evgeny Stambulchik.
20139
44ea3fbd
MA
201402002-01-20 Marc Autret <marc@gnu.org>
20141
ba0fe3c7
PE
20142 * src/system.h: Need to define __attribute__ away for non-GCC
20143 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
20144 Suggested by Albert Chin-A-Young.
20145
338963d1
TVH
201462002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
20147
20148 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
20149 canonical definition.
20150 * src/system.h: Use the canonical definition for PARAMS (avoids
20151 a conflict with the macro from lib/hash.h).
20152
c57b2479
AD
201532002-01-11 Akim Demaille <akim@epita.fr>
20154
20155 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 20156 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 20157
b85810ae
AD
201582002-01-09 Akim Demaille <akim@epita.fr>
20159
20160 * src/files.c, src/files.h (output_infix): New.
20161 (tab_extension): Remove.
20162 (compute_base_names): Compute the former, drop the latter.
20163 * src/output.c (prepare): Insert the muscles `output-infix', and
20164 `output-suffix'.
20165 * src/parse-skel.y (string, string.1): New.
20166 (section.header): Use it.
20167 (section.yacc): Remove.
20168 (prefix): Remove too.
20169 * src/scan-skel.l: Adjust.
20170 * src/bison.simple, src/bison.hairy: Adjust.
20171
cae60122
AD
201722002-01-09 Akim Demaille <akim@epita.fr>
20173
20174 * configure.in (WERROR_CFLAGS): Compute it.
20175 * src/Makefile.am (CFLAGS): Pass it.
20176 * tests/atlocal.in (CFLAGS): Idem.
20177 * src/files.c: Fix a few warnings.
20178 (get_extension_index): Remove, unused.
20179
ae404801
AD
201802002-01-08 Akim Demaille <akim@epita.fr>
20181
20182 * src/getargs.c (AS_FILE_NAME): New.
20183 (getargs): Use it to convert DOSish file names.
20184 * src/files.c (base_name): Rename as full_base_name to avoid
20185 clashes with `base_name ()'.
20186 (filename_split): New.
20187 (compute_base_names): N-th rewrite, using filename_split.
20188
22312b71
AD
201892002-01-08 Akim Demaille <akim@epita.fr>
20190
20191 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
20192 New, stolen from the Fileutils 4.1.
20193 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20194 * configure.in: Check for the presence of memrchr, and of its
20195 prototype.
20196
a67cef01
TVH
201972002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
20198
20199 * lib/hash.h (__P): Added definition for this macro.
20200 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
20201 BUILT_SOURCES, to ensure they are generated first.
20202 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
20203 %error-verbose to allow bootstrapping with bison 1.30x.
20204
2b25d624
AD
202052002-01-06 Akim Demaille <akim@epita.fr>
20206
20207 * src/reader.c (parse_braces): Don't fetch the next char, the
20208 convention is to fetch on entry.
20209 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
20210 'switch' without a following semicolon.
20211 * tests/regression.at (braces parsing): New.
20212
3460813b
AD
202132002-01-06 Akim Demaille <akim@epita.fr>
20214
20215 Bison is dead wrong in its RR conflict reports.
20216
20217 * tests/torture.at (GNU Cim Grammar): New.
20218 * src/conflicts.c (count_rr_conflicts): Fix.
20219
73784c64
AD
202202002-01-06 Akim Demaille <akim@epita.fr>
20221
20222 Creating package.m4 from configure.ac causes too many problems.
20223
20224 * tests/Makefile.am (package.m4): Create it by hand,
20225 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
20226
25d81090
AD
202272002-01-06 Akim Demaille <akim@epita.fr>
20228
20229 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
20230 skeleton.h.
20231
a9b8959e
PE
202322002-01-04 Paul Eggert <eggert@twinsun.com>
20233
20234 * doc/bison.texinfo (Debugging):
20235 Remove YYSTDERR; it's no longer defined or used.
20236 Also, s/cstdio.h/cstdio/.
20237
25d81090
AD
202382002-01-03 Akim Demaille <akim@epita.fr>
20239
20240 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
20241
1109455c
AD
202422002-01-03 Akim Demaille <akim@epita.fr>
20243
20244 * src/parse-skel.y (process_skeleton): Don't bind the parser's
20245 tracing code to --trace, wait for a better --trace option, with
20246 args.
20247
7ea5e977
AD
202482002-01-03 Akim Demaille <akim@epita.fr>
20249
20250 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
20251 The ISO C++ standard is extremely clear about it: stderr is
20252 considered a macro, not a regular symbol (see table 94 `Header
20253 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
20254 Therefore std:: does not apply to it. It still does with fprintf.
20255 Also, s/cstdio.h/cstdio/.
20256
fab5b110
AD
202572002-01-03 Akim Demaille <akim@epita.fr>
20258
20259 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
20260 for non system headers.
20261
aed7fd9b
AD
202622002-01-02 Akim Demaille <akim@epita.fr>
20263
20264 Equip the skeleton chain with location tracking, runtime trace,
20265 pure parser and scanner.
20266
20267 * src/parse-skel.y: Request a pure parser, locations, and prefix
20268 renaming.
20269 (%union): Having several members with the same type does not help
20270 type mismatches, simplify.
20271 (YYPRINT, yyprint): New.
20272 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
20273 (skel_error): this.
20274 Handle locations.
20275 * src/scan-skel.l: Adjust to these changes.
20276 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
20277 (LOCATION_PRINT, skel_control_t): New.
20278
24fad99e
AD
202792001-12-30 Akim Demaille <akim@epita.fr>
20280
20281 * src/parse-skel.y: Get rid of the shift/reduce conflict:
20282 replace `gb' with BLANKS.
20283 * src/scan-skel.l: Adjust.
20284
a4b36db4
AD
202852001-12-30 Akim Demaille <akim@epita.fr>
20286
20287 * src/system.h: We don't need nor want bcopy.
20288 Throw away MS-DOS crap: we don't need getpid.
20289 * configure.in: We don't need strndup. It was even causing
20290 problems: because Flex includes the headers *before* us,
20291 _GNU_SOURCE is not defined by config.h, and therefore strndup was
20292 not visible.
20293 * lib/xstrndup.c: New.
20294 * src/scan-skel.l: Use it.
20295 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
20296 * src/parse-skel.y: Use %directives instead of #defines.
20297
1239777d
AD
202982001-12-30 Akim Demaille <akim@epita.fr>
20299
20300 * src/skeleton.h: New.
20301 * src/output.c (output_parser, output_master_parser): Remove, dead
20302 code.
20303 * src/output.h (get_lines_number, actions_output, guards_output)
20304 (token_definitions_output): Prototype them.
20305 * src/parse-skel.y: Add the license notice.
20306 Include output.h and skeleton.h.
20307 (process_skeleton): Returns void, and takes a single parameter.
20308 * src/scan-skel.l: Add the license notice.
20309 Include skeleton.h.
20310 Don't use %option yylineno: it seems that then Flex imagines
20311 REJECT has been used, and therefore it won't reallocate its
20312 buffers (which makes no other sense to me than a bug). It results
20313 in warnings for `unused: yy_flex_realloc'.
20314
9b3add5b
RA
203152001-12-30 Robert Anisko <robert.anisko@epita.fr>
20316
20317 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20318 (MUSCLE_INSERT_PREFIX): ...to there.
20319 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20320 (MUSCLE_INSERT_PREFIX): Move from here...
20321
20322 * src/bison.hairy: Add a section directive. Put braces around muscle
20323 names. This parser skeleton is still broken, but Bison should not
20324 choke on a bad muscle 'syntax'.
20325 * src/bison.simple: Add a section directive. Put braces around muscle
20326 names.
20327
20328 * src/files.h (strsuffix, stringappend): Add declarations.
20329 (tab_extension): Add declaration.
20330 (short_base_name): Add declaration.
20331
20332 * src/files.c (strsuffix, stringappend): No longer static. These
20333 functions are used in the skeleton parser.
20334 (tab_extension): New.
20335 (compute_base_names): Use the computations done in this function
fab5b110 20336 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
20337 names.
20338 (short_base_name): No longer static.
20339
20340 * src/output.c (output_skeleton): New.
20341 (output): Disable call to output_master_parser, and give a try to
20342 a new skeleton handling system.
20343 (guards_output, actions_output): No longer static.
20344 (token_definitions_output, get_lines_number): No longer static.
20345
20346 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
20347
fab5b110 20348 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
20349 parse-skel.y.
20350
20351 * src/parse-skel.y: New file.
20352 * src/scan-skel.l: New file.
20353
b5b61c61
AD
203542001-12-29 Akim Demaille <akim@epita.fr>
20355
20356 %name-prefix is broken.
20357
20358 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
20359 Adjust all dependencies.
20360 * tests/headers.at (export YYLTYPE): Strengthen this test: use
20361 %name-prefix.
20362
20363 Renaming yylval but not yylloc is not consistent. Now we do.
20364
20365 * src/bison.simple: Prefix yylloc if used.
20366 * doc/bison.texinfo (Decl Summary): Document that.
20367
8c9a50be
AD
203682001-12-29 Akim Demaille <akim@epita.fr>
20369
20370 * doc/bison.texinfo: Promote `%long-directive' over
20371 `%long_directive'.
20372 Remove all references to fixed-output-files, yacc is enough.
20373
d99361e6
AD
203742001-12-29 Akim Demaille <akim@epita.fr>
20375
20376 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
20377 user prologue. These are defaults.
20378 * tests/actions.at (Mid-rule actions): Make sure the user can
20379 define YYDEBUG and YYERROR_VERBOSE.
20380
b9cecb91
AD
203812001-12-29 Akim Demaille <akim@epita.fr>
20382
20383 * src/output.c (header_output): Don't forget to export YYLTYPE and
20384 yylloc.
20385 * tests/headers.at (export YYLTYPE): New, make sure it does.
20386 * tests/regression.at (%union and --defines, Invalid CPP headers):
20387 Move to...
20388 * tests/headers.at: here.
20389
aea13e97
AD
203902001-12-29 Akim Demaille <akim@epita.fr>
20391
20392 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
20393
931394cb
AD
203942001-12-29 Akim Demaille <akim@epita.fr>
20395
20396 * tests/actions.at (Mid-rule actions): Output on a single line
20397 instead of several.
20398
704a47c4
AD
203992001-12-29 Akim Demaille <akim@epita.fr>
20400
20401 * doc/bison.texinfo: Formatting changes.
20402
091e20bb
AD
204032001-12-29 Akim Demaille <akim@epita.fr>
20404
20405 Don't store the token defs in a muscle, just be ready to output it
20406 on command. Now possible via `symbols'. Fixes a memory leak.
20407
20408 * src/output.c (token_definitions_output): New.
20409 (output_parser, header_output): Use it.
20410 * src/reader.c (symbols_save): Remove.
20411
cce71710
AD
204122001-12-29 Akim Demaille <akim@epita.fr>
20413
20414 * src/bison.simple: Do not provide a default for YYSTYPE and
20415 YYLTYPE before the user's prologue. Otherwise it's hardly... a
20416 default.
20417
82c035a8
AD
204182001-12-29 Akim Demaille <akim@epita.fr>
20419
20420 Mid-rule actions are simply... ignored!
20421
20422 * src/reader.c (readgram): Be sure to attach mid-rule actions to
20423 the empty-rule associated to the dummy symbol, not to the host
20424 rule.
20425 * tests/actions.at (Mid-rule actions): New.
20426
8419d367
AD
204272001-12-29 Akim Demaille <akim@epita.fr>
20428
20429 Memory leak.
20430
20431 * src/reader.c (reader): Free grammar.
20432
375d5806
AD
204332001-12-29 Akim Demaille <akim@epita.fr>
20434
20435 Memory leak.
20436
20437 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
20438 since it allocates it for each state, although only one is needed.
20439 (allocate_storage): Do it here.
20440
f51cb8ff
AD
204412001-12-29 Akim Demaille <akim@epita.fr>
20442
20443 * src/options.h, src/options.c (create_long_option_table): Rename
20444 as...
20445 (long_option_table_new): this, with a clearer prototype.
20446 (percent_table): Remove, unused,
20447 * src/getargs.c (getargs): Adjust.
20448
29e88316
AD
204492001-12-29 Akim Demaille <akim@epita.fr>
20450
20451 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
20452 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
20453 as states.
20454
b9f71f19
AD
204552001-12-29 Akim Demaille <akim@epita.fr>
20456
20457 * src/lalr.c (build_relations): Rename `states' as `states1'.
20458 Sorry, I don't understand exactly what it is, no better name...
20459
1a2b5d37
AD
204602001-12-29 Akim Demaille <akim@epita.fr>
20461
20462 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
20463 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
20464 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
20465 as rules.
20466
1cca533e
AD
204672001-12-29 Akim Demaille <akim@epita.fr>
20468
20469 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
20470 ago.
20471
c03ae966
AD
204722001-12-29 Akim Demaille <akim@epita.fr>
20473
20474 * src/reader.c, src/reader.h (user_toknums): Remove.
20475 Adjust all users to use symbols[i]->user_token_number.
20476
5a670b1e
AD
204772001-12-29 Akim Demaille <akim@epita.fr>
20478
20479 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
20480 Adjust all users to use symbols[i]->prec or ->assoc.
20481
ad949da9
AD
204822001-12-29 Akim Demaille <akim@epita.fr>
20483
20484 * src/reader.c, src/reader.h (tags): Remove.
20485 Adjust all users to use symbols[i]->tag.
20486
0e78e603
AD
204872001-12-29 Akim Demaille <akim@epita.fr>
20488
20489 * src/gram.h, src/gram.c (symbols): New, similar to state_table
20490 and rule_table.
20491 * src/reader.c (packsymbols): Fill this table.
20492 Drop sprec.
20493 * src/conflicts.c (resolve_sr_conflict): Adjust.
20494 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
20495 single table.
20496 Use symbols[i]->tag instead of tags[i].
20497
213e640e
AD
204982001-12-29 Akim Demaille <akim@epita.fr>
20499
20500 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
20501 In addition, put a comment in there, to replace...
20502 * tests/regression.at (%union and C comments): Remove.
20503
e7b8bef1
AD
205042001-12-29 Akim Demaille <akim@epita.fr>
20505
20506 * tests/regression.at (Web2c Actions): Blindly move the actual
20507 output as expected output. The contents *seem* right to me, but I
20508 can't pretend reading perfectly parser tables... Nonetheless, all
20509 the other tests pass correctly, the table look OK, even though the
20510 presence of `$axiom' is to be noted: AFAICS it is useless (but
20511 harmless).
20512
b68e7744
AD
205132001-12-29 Akim Demaille <akim@epita.fr>
20514
20515 * src/reader.c (readgram): Don't add the rule 0 if there were no
20516 rules read. In other words, add it _after_ having performed
20517 grammar sanity checks.
20518 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
20519
78d5bae9
AD
205202001-12-29 Akim Demaille <akim@epita.fr>
20521
20522 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
20523 visible, and some states have now a different number.
20524
ff442794
AD
205252001-12-29 Akim Demaille <akim@epita.fr>
20526
20527 * src/reader.c (readgram): Bind the initial rule's lineno to that
20528 of the first rule.
20529 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20530 (Solved SR Conflicts): Adjust rule 0's line number.
20531
610ab194
AD
205322001-12-29 Akim Demaille <akim@epita.fr>
20533
20534 Fix the `GAWK Grammar' failure.
20535
20536 * src/LR0.c (final_state): Initialize to -1 so that we do compute
20537 the reductions of the first state which was mistakenly confused
20538 with the final state because precisely final_state was initialized
20539 to 0.
20540 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
20541 now noticed by Bison.
20542 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
20543 have a reduction on $default.
20544
29d29c8f
AD
205452001-12-29 Akim Demaille <akim@epita.fr>
20546
20547 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
20548 rule line numbers.
20549 * src/closure.c (print_closure): Likewise.
20550 * src/derives.c (print_derives): Likewise.
20551 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
20552 now.
20553
7c6b64d0
AD
205542001-12-29 Akim Demaille <akim@epita.fr>
20555
20556 * src/lalr.c (lookaheads_print): New.
20557 (lalr): Call it when --trace-flag.
20558 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
20559 are dumped.
20560
3d4daee3
AD
205612001-12-29 Akim Demaille <akim@epita.fr>
20562
20563 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
20564 when walking through ritem, even via rule->rhs.
20565 * src/reduce.c (dump_grammar, useful_production, reduce_output)
20566 (useful_production, useless_nonterminals): Likewise.
20567 (reduce_grammar_tables): Likewise, plus update nritems.
20568 * src/nullable.c (set_nullable): Likewise.
20569 * src/lalr.c (build_relations): Likewise.
20570 * tests/sets.at (Nullable): Adjust.
20571 Fortunately, now, the $axiom is no longer nullable.
20572
9e7f6bbd
AD
205732001-12-29 Akim Demaille <akim@epita.fr>
20574
20575 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
20576 the 0-sentinel.
20577 * src/gram.c (ritem_longest_rhs): Likewise.
20578 * src/reduce.c (nonterminals_reduce): Likewise.
20579 * src/print_graph.c (print_graph): Likewise.
20580 * src/output.c (output_rule_data): Likewise.
20581 * src/nullable.c (set_nullable): Likewise.
20582
255ef638
AD
205832001-12-29 Akim Demaille <akim@epita.fr>
20584
20585 * src/output.c: Comment changes.
20586
0d8a7363
AD
205872001-12-27 Paul Eggert <eggert@twinsun.com>
20588
20589 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
20590 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
20591 Sparc, as they were causing more porting problems than the
20592 (minor) performance improvement was worth.
20593
20594 Also, catch up with 1.31's YYSTD.
20595
3db472b9
AD
205962001-12-27 Akim Demaille <akim@epita.fr>
20597
20598 * src/output.c (output_gram): Rely on nritems, not the
20599 0-sentinel. See below.
20600 Use -1 as separator, not 0.
20601 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
20602 Rely on -1 as separator in yyrhs, instead of 0.
20603 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
20604 twice `Now at end of input', therefore there are two lines less to
20605 expect.
20606
b365aa05
AD
206072001-12-27 Akim Demaille <akim@epita.fr>
20608
20609 * tests/regression.at (Unresolved SR Conflicts):
20610 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
20611 below.
20612
30171f79
AD
206132001-12-27 Akim Demaille <akim@epita.fr>
20614
20615 * src/LR0.c (new_state): Recognize the final state by the fact it
20616 is reached by eoftoken.
20617 (insert_start_shifting_state, insert_eof_shifting_state)
20618 (insert_accepting_state, augment_automaton): Remove, since now
20619 these states are automatically computed from the initial state.
20620 (generate_states): Adjust.
20621 * src/print.c: When reporting a rule number to the user, substract
20622 1, so that the axiom rule is rule 0, and the first user rule is 1.
20623 * src/reduce.c: Likewise.
20624 * src/print_graph.c (print_core): For the time being, just as for
20625 the report, depend upon --trace-flags to dump the full set of
20626 items.
20627 * src/reader.c (readgram): Once the grammar read, insert the rule
20628 0: `$axiom: START-SYMBOL $'.
20629 * tests/set.at: Adjust: rule 0 is now displayed, and since the
20630 number of the states has changed (the final state is no longer
20631 necessarily the last), catch up.
20632
75142d45
AD
206332001-12-27 Akim Demaille <akim@epita.fr>
20634
20635 Try to make the use of the eoftoken valid. Given that its value
20636 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
20637 is used instead of > 0 where appropriate, (ii), depend upon nritems
20638 instead of the 0-sentinel.
20639
20640 * src/gram.h, src/gram.c (nritems): New.
20641 Expected to be duplication of nitems, but for the time being...
20642 * src/reader.c (packgram): Assert nritems and nitems are equal.
20643 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
20644 * src/closure.c (print_closure, print_fderives): Likewise.
20645 * src/gram.c (ritem_print): Likewise.
20646 * src/print.c (print_core, print_grammar): Likewise.
20647 * src/print_graph.c: Likewise.
20648
b7c49edf
AD
206492001-12-27 Akim Demaille <akim@epita.fr>
20650
20651 * src/main.c (main): If there are complains after grammar
20652 reductions, then output the report anyway if requested, then die.
20653 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
20654 * src/reader.c (eoftoken): New.
20655 (parse_token_decl): If the token being defined has value `0', it
20656 is the eoftoken.
20657 (packsymbols): No longer hack `tags' to insert `$' by hand.
20658 Be sure to preserve the value of the eoftoken.
20659 (reader): Make sure eoftoken is defined.
20660 Initialize nsyms to 0: now eoftoken is created just like the others.
20661 * src/print.c (print_grammar): Don't special case the eof token.
20662 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
20663 lie anyway, albeit pleasant.
20664 * tests/calc.at: Exercise error messages with eoftoken.
20665 Change the grammar so that empty input is invalid.
20666 Adjust expectations.
20667 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
20668
ec2da99f
AD
206692001-12-27 Akim Demaille <akim@epita.fr>
20670
20671 * configure.in: Check the protos of strchr ans strspn.
20672 Replace strchr if needed.
20673 * src/system.h: Provide the protos of strchr, strspn and memchr if
20674 missing.
20675 * lib/strchr.c: New.
20676 * src/reader.c (symbols_save): Use strchr.
20677
8adfa272
AD
206782001-12-27 Akim Demaille <akim@epita.fr>
20679
20680 * src/print.c, src/print_graph.c (escape): New.
20681 Use it to quote the TAGS outputs.
20682 * src/print_graph.c (print_state): Now errors are in red, and
20683 reductions in green.
20684 Prefer high to wide: output the state number on a line of its own.
20685
80dac38c
AD
206862001-12-27 Akim Demaille <akim@epita.fr>
20687
20688 * src/state.h, src/state.c (reductions_new): New.
20689 * src/LR0.c (set_state_table): Let all the states have a
20690 `reductions', even if reduced to 0.
20691 (save_reductions): Adjust.
20692 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
20693 * src/print.c (print_reductions, print_actions): Adjust.
20694 * src/output.c (action_row): Adjust.
20695
2cec70b9
AD
206962001-12-27 Akim Demaille <akim@epita.fr>
20697
20698 * src/state.h, src/state.c (errs_new, errs_dup): New.
20699 * src/LR0.c (set_state_table): Let all the states have an errs,
20700 even if reduced to 0.
20701 * src/print.c (print_errs, print_reductions): Adjust.
20702 * src/output.c (output_actions, action_row): Adjust.
20703 * src/conflicts.c (resolve_sr_conflict): Adjust.
20704
13ca549a
AD
207052001-12-27 Akim Demaille <akim@epita.fr>
20706
20707 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
20708
5092aba5
AD
207092001-12-27 Akim Demaille <akim@epita.fr>
20710
20711 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
20712 * src/print.c: here.
20713 (lookaheadset, shiftset): New, used as additional storage by
20714 print_reductions.
20715 (print_results): Adjust.
20716 (print_shifts, print_gotos, print_errs): New, extracted from...
20717 (print_actions): here.
20718 * src/print_graph.c (print_actions): Remove dead code.
20719
11e2beca
AD
207202001-12-27 Akim Demaille <akim@epita.fr>
20721
20722 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
20723 `$n' and `@n'.
20724
dac3c910
AD
207252001-12-27 Akim Demaille <akim@epita.fr>
20726
20727 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
20728 (build_relations): Adjust.
20729
d0b0fefa
AD
207302001-12-27 Akim Demaille <akim@epita.fr>
20731
20732 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
20733 duplication.
20734
adc8c848
AD
207352001-12-27 Akim Demaille <akim@epita.fr>
20736
20737 * src/reader.c (packgram): Catch nitems overflows.
20738
14d293ac
AD
207392001-12-27 Akim Demaille <akim@epita.fr>
20740
20741 * src/files.c, src/files.h (guard_obstack): Remove.
20742 * src/output.c (output): Adjust.
20743 * src/reader.c (parse_braces): New, factoring...
20744 (copy_action, copy_guard): these two which are renamed as...
20745 (parse_action, parse_guard): these.
20746 As a voluntary consequence, using braces around guards is now
20747 mandatory.
20748
f499b062
AD
207492001-12-27 Akim Demaille <akim@epita.fr>
20750
20751 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
20752 * src/reader.c (symbol_list): `guard' and `guard_line' are new
20753 members.
20754 (symbol_list_new): Adjust.
20755 (copy_action): action_line is the first line, not the last.
20756 (copy_guard): Just as for actions, store the `action' only, not
20757 the switch/case/break flesh.
20758 Don't parse the user action that might follow the guard, let...
20759 (readgram): do it, i.e., now, there can be an action after a
20760 guard.
20761 In other words the guard is just explicitly optional.
20762 (packgram): Adjust.
20763 * src/output.c (guards_output): New.
20764 (output_parser): Call it when needed.
20765 (output): Also free the guard and attrs obstacks.
20766 * src/files.c, src/files.h (obstack_save): Remove.
20767 (output_files): Remove.
20768 As a result, if one needs the former `.act' file, using an
20769 appropriate skeleton which requires actions and guards is now
20770 required.
20771 * src/main.c (main): Adjust.
20772 * tests/semantic.at: New.
20773 * tests/regression.at: Use `input.y' as input file name.
20774 Avoid 8+3 problems by requiring input.c when the test needs the
20775 parser.
20776
d945f5cd
AD
207772001-12-27 Akim Demaille <akim@epita.fr>
20778
20779 * src/reader.c (symbol_list_new): Be sure to initialize all the
20780 fields.
20781
d200e455
AD
207822001-12-27 Akim Demaille <akim@epita.fr>
20783
20784 All the hacks using a final pseudo state are now useless.
20785
20786 * src/LR0.c (set_state_table): state_table holds exactly nstates.
20787 * src/lalr.c (nLA): New.
20788 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
20789 instead of lookaheadsp from the pseudo state (nstate + 1).
20790
f9507c28
AD
207912001-12-27 Akim Demaille <akim@epita.fr>
20792
20793 * src/output.c (action_row, token_actions): Use a state_t instead
20794 of a integer, and nlookaheads instead of the following state's
20795 lookaheadsp.
20796
065fbd27
AD
207972001-12-27 Akim Demaille <akim@epita.fr>
20798
20799 * src/conflicts.c (log_resolution, flush_shift)
20800 (resolve_sr_conflict, set_conflicts, solve_conflicts)
20801 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
20802 (conflicts_print, print_reductions): Use a state_t instead of an
20803 integer when referring to a state.
20804 As much as possible, depend upon nlookaheads, instead of the
20805 `lookaheadsp' member of the following state (since lookaheads of
20806 successive states are successive, the difference between state n + 1
20807 and n served as the number of lookaheads for state n).
20808 * src/lalr.c (add_lookback_edge): Likewise.
20809 * src/print.c (print_core, print_actions, print_state)
20810 (print_results): Likewise.
20811 * src/print_graph.c (print_core, print_actions, print_state)
20812 (print_graph): Likewise.
20813 * src/conflicts.h: Adjust.
20814
1b177bd7
AD
208152001-12-27 Akim Demaille <akim@epita.fr>
20816
20817 * src/bison.hairy: Formatting/comment changes.
20818 ANSIfy.
20819 Remove `register' indications.
20820 Add plenty of `static'.
20821
7742ddeb
AD
208222001-12-27 Akim Demaille <akim@epita.fr>
20823
20824 * src/output.c (prepare): Drop the muscle `ntbase' which
20825 duplicates ntokens.
20826 * src/bison.simple: Formatting/comment changes.
20827 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
20828 is an undocumented synonym.
20829
1fa14068
AD
208302001-12-22 Akim Demaille <akim@epita.fr>
20831
20832 * src/output.c (output_table_data): Change the prototype to use
20833 `int' for array ranges: some invocations do pass an int, not a
20834 short.
20835 Reported by Wayne Green.
20836
b9752825
AD
208372001-12-22 Akim Demaille <akim@epita.fr>
20838
20839 Some actions of web2c.y are improperly triggered.
20840 Reported by Mike Castle.
20841
20842 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
20843 * tests/regression.at (Web2c): Rename as...
20844 (Web2c Report): this.
20845 (Web2c Actions): New.
20846
776209d6
AD
208472001-12-22 Akim Demaille <akim@epita.fr>
20848
20849 Reductions in web2c.y are improperly reported.
20850 Reported by Mike Castle.
20851
20852 * src/conflicts.c (print_reductions): Fix.
20853 * tests/regression.at (Web2c): New.
20854
275fc3ad
AD
208552001-12-18 Akim Demaille <akim@epita.fr>
20856
20857 Some host fail on `assert (!"foo")', which expands to
20858 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
20859 Reported by Nelson Beebee.
20860
20861 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
20862 `#define it_succeeded 0' and `assert (it_succeeded)'.
20863
897668ee
MA
208642001-12-17 Marc Autret <autret_m@epita.fr>
20865
20866 * src/bison.simple: Don't hard code the skeleton line and filename.
20867 * src/output.c (output_parser): Rename 'line' as 'output_line'.
20868 New line counter 'skeleton_line' (skeleton-line muscle).
20869
ab3399e0
PE
208702001-12-17 Paul Eggert <eggert@twinsun.com>
20871
20872 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
20873 YYDEBUG must be defined to a nonzero value.
20874
20875 * src/bison.simple (yytname): Do not assume that the user defines
20876 YYDEBUG to a properly parenthesized expression.
20877
3877f72b
AD
208782001-12-17 Akim Demaille <akim@epita.fr>
20879
20880 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
20881 nlookaheads is a new member.
20882 Adjust all users.
20883 * src/lalr.h (nlookaheads): Remove this orphan declaration.
20884 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
20885 state.
776209d6 20886
331dbc1b
AD
208872001-12-17 Akim Demaille <akim@epita.fr>
20888
20889 * src/files.h, src/files.c (open_files, close_files): Remove.
20890 * src/main.c (main): Don't open/close files, nor invoke lex_free,
20891 let...
20892 * src/reader.c (reader): Do it.
776209d6 20893
be750e4c
AD
208942001-12-17 Akim Demaille <akim@epita.fr>
20895
20896 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 20897
709ae8c6
AD
208982001-12-17 Akim Demaille <akim@epita.fr>
20899
20900 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
20901 (flush_reduce): New.
20902 (resolve_sr_conflict): Adjust.
776209d6 20903
f87685c3
AD
209042001-12-17 Akim Demaille <akim@epita.fr>
20905
20906 * src/output.c (output_obstack): Be static and rename as...
20907 (format_obstack): this, to avoid any confusion with files.c's
20908 output_obstack.
20909 * src/reader.h (muscle_obstack): Move to...
20910 * src/output.h: here, since it's defined in output.c.
20911
837491d8
AD
209122001-12-17 Akim Demaille <akim@epita.fr>
20913
20914 * src/output.c (action_row, save_column, default_goto)
20915 (sort_actions, matching_state, pack_vector): Better variable
20916 locality.
20917
796d61fb
AD
209182001-12-17 Akim Demaille <akim@epita.fr>
20919
20920 * src/output.c: Various formatting changes.
776209d6 20921
64d15509
AD
209222001-12-17 Akim Demaille <akim@epita.fr>
20923
20924 * src/files.c (output_files): Free the output_obstack.
20925 * src/main.c (main): Call print and print_graph conditionally.
20926 * src/print.c (print): Work unconditionally.
20927 * src/print_graph.c (print_graph): Work unconditionally.
20928 * src/conflicts.c (log_resolution): Output only if verbose_flag.
20929
fbc8ecb7
MA
209302001-12-16 Marc Autret <autret_m@epita.fr>
20931
20932 * src/output.c (actions_output): Fix. When we use %no-lines,
20933 there is one less line per action.
20934
f0440388
MA
209352001-12-16 Marc Autret <autret_m@epita.fr>
20936
20937 * src/bison.simple: Remove a useless #line directive.
20938 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
20939 * src/output.c (get_lines_number): New.
776209d6 20940 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
20941 output muscles.
20942 Fix line numbering.
20943 (actions_output): Computes the number of lines taken by actions.
20944 (output_master_parser): Insert new skeleton which is the name of
20945 the output parser file name.
20946
a79986b8
MA
209472001-12-15 Marc Autret <autret_m@epita.fr>
20948
20949 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
20950
4ec8e00f
MA
209512001-12-15 Marc Autret <autret_m@epita.fr>
20952
20953 * src/output.c (output_gram): Keep track of the hairy one.
20954
1a4648ff
AD
209552001-12-15 Akim Demaille <akim@epita.fr>
20956
20957 Make `make distcheck' work.
20958
20959 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
20960 system.h which uses libgettext.h.
20961
9c2c67e6
AD
209622001-12-15 Akim Demaille <akim@epita.fr>
20963
20964 * src/nullable.c (set_nullable): Useless rules must be skipped,
20965 otherwise, since we range over their symbols, we might look at a
20966 nonterminal which no longer ``exists'', i.e., it is not counted in
20967 `nvars', hence we overflow our arrays.
20968
93ede233
AD
209692001-12-15 Akim Demaille <akim@epita.fr>
20970
20971 The header can also be produced directly, without any obstack!
20972 Yahoo!
20973
20974 * src/files.c, src/files.h (defines_obstack): Remove.
20975 (compute_header_macro): Global.
20976 (defines_obstack_save): Remove.
20977 * src/reader.c (parse_union_decl): No longer output to
20978 defines_obstack: its content can be found in the `stype' muscle
20979 anyway.
20980 (output_token_translations): Merge into...
20981 (symbols_output): this.
20982 Rename as...
20983 (symbols_save): this.
20984 (reader): Adjust.
20985 * src/output.c (header_output): New.
20986 (output): Call it.
20987
2666f928
AD
209882001-12-15 Akim Demaille <akim@epita.fr>
20989
20990 * src/reader.c (parse_union_decl): Instead of handling two obstack
20991 simultaneously, use one to define the `stype' muscle, and use the
20992 value of the latter to fill defines_obstack.
20993 (copy_comment): Remove.
20994 (copy_comment2): Work for a single obstack.
20995 Rename as...
20996 (copy_comment): this.
20997
428046f8
AD
209982001-12-15 Akim Demaille <akim@epita.fr>
20999
21000 * src/lex.c, src/lex.h (xgetc): No longer static.
21001 * src/reader.c (parse_union_decl): Revamp.
21002
ea52d706
AD
210032001-12-15 Akim Demaille <akim@epita.fr>
21004
21005 Still making progress in separating Bison into (i) input, (ii)
21006 process, (iii) output: now we can directly output the parser file
21007 without using table_obstack at all.
21008
21009 * src/files.c, src/files.h (table_obstack): Bye bye.
21010 (parser_file_name): New.
21011 * src/files.c (compute_output_file_names): Compute it.
21012 * src/output.c (actions_output, output_parser)
21013 (output_master_parser): To a file instead of an obstack.
21014
3f96f4dc
AD
210152001-12-15 Akim Demaille <akim@epita.fr>
21016
21017 Attach actions to rules, instead of pre-outputting them to
21018 actions_obstack.
21019
21020 * src/gram.h (rule_t): action and action_line are new members.
21021 * src/reader.c (symbol_list): Likewise.
21022 (copy_action): Save the actions within the rule.
21023 (packgram): Save them in rule_table.
21024 * src/output.c (actions_output): New.
21025 (output_parser): Use it on `%%actions'.
21026 (output_rule_data): Don't free rule_table.
21027 (output): Do it.
21028 (prepare): Don't save the `action' muscle.
21029 * src/bison.simple: s/%%action/%%actions/.
21030
51576fb3
AD
210312001-12-15 Akim Demaille <akim@epita.fr>
21032
21033 * src/reader.c (copy_action): When --yacc, don't append a `;'
21034 to the user action: let it fail if lacking.
dee049eb 21035 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 21036
2648a72d
AD
210372001-12-14 Akim Demaille <akim@epita.fr>
21038
21039 * src/lex.c (literalchar): Simply return the char you decoded, non
21040 longer mess around with obstacks and int pointers.
21041 Adjust all callers.
21042
92790e5b
AD
210432001-12-14 Akim Demaille <akim@epita.fr>
21044
21045 * src/lex.c (literalchar): Don't escape the special characters,
21046 just decode them, and keep them as char (before, eol was output as
21047 the 2 char string `\n' etc.).
21048 * src/output.c (output_rule_data): Use quotearg to output the
21049 token strings.
21050
927c1557
PE
210512001-12-13 Paul Eggert <eggert@twinsun.com>
21052
21053 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
21054 Do not infringe on the global user namespace when using C++.
21055 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
21056 All uses of `fprintf' and `stderr' changed.
21057
21058 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
21059
ed8e1f68
AD
210602001-12-13 Akim Demaille <akim@epita.fr>
21061
21062 The computation of nullable is broken: it doesn't handle empty
21063 RHS's properly.
21064
21065 * tests/torture.at (GNU AWK Grammar): New.
21066 * tests/sets.at (Nullable): New.
21067 * src/nullable.c (set_nullable): Instead of blindly looping over
21068 `ritems', loop over the rules, and then over their rhs's.
21069
21070 Work around Autotest bugs.
21071
21072 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
21073 frame, because Autotest understand lines starting with a `+' as
21074 traces from the shell. Then, they are not processed properly.
21075 Admittedly an Autotest bug, but we don't have time to wait for
21076 Autotest to catch up.
21077 * tests/regression.at (Broken Closure): Adjust to the new table
21078 frames.
21079 Move to...
21080 * tests/sets.at: here.
21081
cb581495
AD
210822001-12-13 Akim Demaille <akim@epita.fr>
21083
21084 * src/closure.c (closure): Use nrules instead of playing tricks
21085 with BITS_PER_WORD.
21086
2e729273
AD
210872001-12-13 Akim Demaille <akim@epita.fr>
21088
21089 * src/print.c (print_actions): Output the handling of `$' as the
21090 traces do: shifting the token EOF. Before EOF was treated as a
21091 nonterminal.
21092 * tests/regression.at: Adjust some tests.
21093 * src/print_graph.c (print_core): Complete the set of items via
21094 closure. The next-to-final and final states are still unsatisfying,
21095 but that's to be addressed elsewhere.
21096 No longer output the rule numbers, but do output the state number.
21097 A single loop for the shifts + gotos is enough, but picked a
21098 distinct color for each.
21099 (print_graph): Initialize and finalize closure.
21100
107f7dfb
AD
211012001-12-13 Akim Demaille <akim@epita.fr>
21102
21103 * src/reader.c (readgram): Remove dead code, an strip useless
21104 braces.
21105 (get_type): Remove, unused.
21106
9b53a24f
AD
211072001-12-12 Akim Demaille <akim@epita.fr>
21108
21109 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
21110 on that of lib/error.c.
21111
dbfb6dcd
AD
211122001-12-12 Akim Demaille <akim@epita.fr>
21113
21114 Some hosts don't like `/' in includes.
21115
21116 * src/system.h: Include libgettext.h without qualifying the path.
21117 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
21118 $(top_srcdir).
21119
c25fb648
MA
211202001-12-11 Marc Autret <autret_m@epita.fr>
21121
21122 * src/output.c (output_parser): Remove useless muscle.
21123
710ddc4f
MA
211242001-12-11 Marc Autret <autret_m@epita.fr>
21125
21126 * src/bison.simple: Remove #line just before %%epilogue. It
21127 is now handled in ...
21128 * src/reader.c (read_additionnal_code): Add the output of a
21129 #line for the epilogue.
21130
e83d80b8
MA
211312001-12-10 Marc Autret <autret_m@epita.fr>
21132
927c1557 21133 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
21134 replace precedent remove.
21135 * src/bison.simple: Remove #line before %%prologue because
21136 %%input-line is wrong at this time.
21137
971d5158
MA
211382001-12-10 Marc Autret <autret_m@epita.fr>
21139
21140 * src/reader.c (symbols_output): Clean up.
927c1557 21141 * src/output.c (output_gram, output): Clean up.
971d5158 21142
5edafffd
AD
211432001-12-10 Akim Demaille <akim@epita.fr>
21144
21145 * src/lalr.c (initialize_lookaheads): New. Extracted from...
21146 * src/LR0.c (set_state_table): here.
21147 * src/lalr.c (lalr): Call it.
21148
0279f8e9
AD
211492001-12-10 Akim Demaille <akim@epita.fr>
21150
21151 * src/state.h (shifts): Remove the `number' member: shifts are
21152 attached to state, hence no longer need to be labelled with a
21153 state number.
21154
190c4f5f
AD
211552001-12-10 Akim Demaille <akim@epita.fr>
21156
21157 Now that states have a complete set of members, the linked list of
21158 shifts is useless: just fill directly the state's shifts member.
21159
21160 * src/state.h (shifts): Remove the `next' member.
21161 * src/LR0.c (first_state, last_state): Remove.
21162 Adjust the callers.
21163 (augment_automaton): Don't look for the shifts that must be added
21164 a shift on EOF: it is those of the state we looked for! But now,
21165 since shifts are attached, it is no longer needed to looking
21166 merely by its id: its number.
21167
2a73b93d
AD
211682001-12-10 Akim Demaille <akim@epita.fr>
21169
21170 * src/LR0.c (augment_automaton): Better variable locality.
21171 Remove an impossible branch: if there is a state corresponding to
21172 the start symbol being shifted, then there is shift for the start
21173 symbol from the initial state.
21174
74392f6a
AD
211752001-12-10 Akim Demaille <akim@epita.fr>
21176
21177 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
21178 only when appropriate: when insert_start_shifting_state' is not
21179 invoked.
21180 * tests/regression.at (Rule Line Numbers): Adjust.
21181
37c82725
AD
211822001-12-10 Akim Demaille <akim@epita.fr>
21183
21184 * src/LR0.c (augment_automaton): Now that all states have shifts,
21185 merge the two cases addition shifts to the initial state.
21186
6a164e0c
AD
211872001-12-10 Akim Demaille <akim@epita.fr>
21188
21189 * src/lalr.c (set_state_table): Move to...
21190 * src/LR0.c: here.
21191 * src/lalr.c (lalr): Don't call it...
21192 * src/LR0.c (generate_states): do it.
21193 * src/LR0.h (first_state): Remove, only the table is used.
21194
7215de24
AD
211952001-12-10 Akim Demaille <akim@epita.fr>
21196
21197 * src/LR0.h (first_shift, first_reduction): Remove.
21198 * src/lalr.c: Don't use first_shift: find shifts through the
21199 states.
21200
80e25d4d
AD
212012001-12-10 Akim Demaille <akim@epita.fr>
21202
21203 * src/LR0.c: Attach shifts to states as soon as they are
21204 computed.
21205 * src/lalr.c (set_state_table): Instead of assigning shifts to
21206 state, just assert that the mapping was properly done.
21207
0ab3728b
AD
212082001-12-10 Akim Demaille <akim@epita.fr>
21209
21210 * src/LR0.c (insert_start_shift): Rename as...
21211 (insert_start_shifting_state): this.
21212 (insert_eof_shifting_state, insert_accepting_state): New.
21213 (augment_automaton): Adjust.
21214 Better locality of the variables.
21215 When looking if the start_symbol is shifted from the initial
21216 state, using `while (... symbol != start_symbol ...)' sounds
21217 better than `while (... symbol < start_symbol ...)': If fail
21218 to see how the order between symbols could be relevant!
21219
78af9bbc
AD
212202001-12-10 Akim Demaille <akim@epita.fr>
21221
21222 * src/getargs.h: Don't declare `spec_name_prefix' and
21223 `spec_file_prefix', declared by src/files.h.
21224 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
21225 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
21226 * src/output.c (prepare): Adjust.
21227 * src/reader.c (symbols_output): Likewise.
21228 * src/vmsgetargs.c: Vaguely adjust, but who cares?
21229
bdef2a41
AD
212302001-12-10 Akim Demaille <akim@epita.fr>
21231
21232 * src/muscle_tab.c (muscle_init): NULL is a better default than
21233 `"0"'.
21234
3735969c
AD
212352001-12-10 Akim Demaille <akim@epita.fr>
21236
21237 * src/reader.c (reader): Calling symbols_output once is enough.
21238
49701457
AD
212392001-12-10 Akim Demaille <akim@epita.fr>
21240
21241 Now that states have a complete set of members, the linked list of
21242 reductions is useless: just fill directly the state's reductions
21243 member.
21244
21245 * src/state.h (struct reductions): Remove member `number' and
21246 `next'.
21247 * src/LR0.c (first_reduction, last_reduction): Remove.
21248 (save_reductions): Don't link the new reductions, store them in
21249 this_state.
21250 * src/lalr.c (set_state_table): No need to attach reductions to
21251 states, it's already done.
21252 * src/output.c (output_actions): No longer free the shifts, then
21253 the reductions, then the states: free all the states and their
21254 members.
21255
0edad749
AD
212562001-12-10 Akim Demaille <akim@epita.fr>
21257
21258 * src/options.c (OPTN, DRTV, BOTH): New.
21259 (option_table): Use them.
21260
0edad749
AD
21261 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
21262 the job of system.h.
21263 * src/options.c: Don't include stdio.h and xalloc.h for the same
21264 reasons.
21265
5449dd0f
AD
212662001-12-10 Akim Demaille <akim@epita.fr>
21267
21268 * src/output.c (output, prepare): Make sure the values of the
21269 muscles `action' and `prologue' are 0-terminated.
21270
a870c567
AD
212712001-12-10 Akim Demaille <akim@epita.fr>
21272
21273 Clean up GCC warnings.
21274
21275 * src/reader.c (copy_action): `buf' is not used.
21276 (parse_skel_decl): Be static.
21277 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
21278 * src/options.h (create_long_option_table): Have a real prototype.
21279 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
21280 (hash_delete_at): Return const void *.
21281 Adjust casts to preserve the const.
21282
80df8768
AD
212832001-12-10 Akim Demaille <akim@epita.fr>
21284
21285 * configure.in: Require 2.52g.
21286 M4 is not needed, but AUTOM4TE is.
21287 * m4/m4.m4: Remove.
21288 * tests/Makefile.am: Adjust.
21289
f693ad14
AD
212902001-12-10 Akim Demaille <akim@epita.fr>
21291
21292 One structure for states is enough, even though theoretically
21293 there are LR(0) states and LALR(1) states.
21294
21295 * src/lalr.h (state_t): Remove.
21296 (state_table): Be state_t **, not state_t *.
21297 * src/state.h (core, CORE_ALLOC): Rename as...
21298 (state_t, STATE_ALLOC): this.
21299 Add the LALR(1) members: shifts, reductions, errs.
21300 * src/LR0.c (state_table): Rename as...
21301 (state_hash): this, to avoid name clashes with the global
21302 `state_table'.
21303 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
21304 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
21305
74ffbcb6
AD
213062001-12-10 Akim Demaille <akim@epita.fr>
21307
21308 Bison dumps core on bash.y.
21309 Reported by Pascal Bart.
21310
21311 * src/warshall.c (bitmatrix_print): New.
21312 (TC): Use it.
ba0fe3c7 21313 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
21314 j must be the outer loop.
21315 * tests/regression.at (Broken Closure): New.
21316
07708e19
AD
213172001-12-05 Akim Demaille <akim@epita.fr>
21318
21319 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
21320 its argument.
ba1ecc07 21321 Reported by Peter Hamorsky.
07708e19 21322
92b16366
AD
213232001-12-05 Akim Demaille <akim@epita.fr>
21324
21325 * src/conflicts.c (err_table): Remove.
21326 (resolve_sr_conflict): Adjust.
21327 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
21328 Rename as...
21329 (state_t.reductions, state_t.shifts): this.
21330
076ab033
AD
213312001-12-05 Akim Demaille <akim@epita.fr>
21332
21333 * src/reduce.c (reduce_grammar_tables): No longer disable the
21334 removal of useless rules via CPP but via `if (0)', so that the
21335 compiler still check the code is valid.
21336 For instance, it should have noticed `rline' no longer exists: use
21337 the `line' member of rule_t.
21338 * src/gram.c (dummy, rline): Remove, unused.
21339
3843c413
AD
213402001-12-05 Akim Demaille <akim@epita.fr>
21341
21342 * src/output.c (pack_vector): Use assert, not berror.
21343 * src/main.c (berror): Remove, unused.
21344
43168960
AD
213452001-12-05 Akim Demaille <akim@epita.fr>
21346
21347 New experimental feature: if --verbose --trace output all the
21348 items of a state, not only its kernel.
21349
21350 * src/print.c (print_core): If `trace_flag', then invoke closure
21351 before outputting the items of the state (print_core is no longer
21352 a correct name them).
21353 (print_results): Invoke new_closure/free_closure if needed.
21354
b2872512
AD
213552001-12-05 Akim Demaille <akim@epita.fr>
21356
21357 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
21358 * src/closure.c, src/closure.h (itemsetsize): Rename as...
21359 (nitemset): for consistency with the rest of the project.
21360
23cbcc6c
AD
213612001-12-05 Akim Demaille <akim@epita.fr>
21362
21363 * src/closure.c (print_closure): Improve.
21364 (closure): Use it for printing input and output.
21365
03ec521c
AD
213662001-12-05 Akim Demaille <akim@epita.fr>
21367
21368 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
21369 indexed by nonterminals.
21370
3a7456dd
AD
213712001-12-05 Akim Demaille <akim@epita.fr>
21372
21373 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
21374 what it was!).
21375 * src/warshall.h: Remove accidental duplication of the content.
21376
1cbcf2e7
AD
213772001-12-05 Akim Demaille <akim@epita.fr>
21378
21379 * src/closure.c (set_fderives): De-obfuscate.
21380
84182270
AD
213812001-12-05 Akim Demaille <akim@epita.fr>
21382
21383 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
21384
3f6f053c
AD
213852001-12-05 Akim Demaille <akim@epita.fr>
21386
21387 * src/closure.c (set_firsts): De-obfuscate.
21388
7a5350ba
AD
213892001-12-05 Akim Demaille <akim@epita.fr>
21390
21391 * src/output.c (action_row): De-obfuscate
21392 using the good o' techniques: arrays not pointers, variable
21393 locality, BITISSET, RESETBIT etc.
21394
d954473d
AD
213952001-12-05 Akim Demaille <akim@epita.fr>
21396
21397 Pessimize the code to simplify it: from now on, all the states
21398 have a valid SHIFTS, which NSHIFTS is possibly 0.
21399
21400 * src/LR0.c (shifts_new): Be global and move to..
21401 * src/state.c, src/state.h: here.
21402 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
21403 * src/print_graph: Adjust.
21404
9839bbe5
AD
214052001-12-05 Akim Demaille <akim@epita.fr>
21406
21407 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
21408 * src/conflicts.c: Use it.
21409 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
21410 incorrectly ``simplified''.
21411
9f136c07
AD
214122001-12-05 Akim Demaille <akim@epita.fr>
21413
21414 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
21415 using the good o' techniques: arrays not pointers, variable
21416 locality, BITISSET, RESETBIT etc.
21417
b608206e
AD
214182001-12-05 Akim Demaille <akim@epita.fr>
21419
21420 * src/state.h (SHIFT_SYMBOL): New.
21421 * src/conflicts.c: Use it to deobfuscate.
21422
52afa962
AD
214232001-12-05 Akim Demaille <akim@epita.fr>
21424
21425 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
21426 (print_reductions): De-obfuscate using the good o' techniques:
21427 arrays not pointers, variable locality, BITISSET.
21428
e74dc321
AD
214292001-12-05 Akim Demaille <akim@epita.fr>
21430
21431 * src/conflicts.c (print_reductions): Arrays, not pointers.
21432 Use BITISSET.
21433
768fca83
AD
214342001-12-05 Akim Demaille <akim@epita.fr>
21435
21436 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21437
a17e599f
AD
214382001-12-05 Akim Demaille <akim@epita.fr>
21439
21440 * src/conflicts.c (print_reductions): Improve variable locality.
21441
a04bc341
AD
214422001-12-05 Akim Demaille <akim@epita.fr>
21443
21444 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21445
c8ea038e
AD
214462001-12-05 Akim Demaille <akim@epita.fr>
21447
21448 * src/conflicts.c (print_reductions): Improve variable locality.
21449
aa2aab3c
AD
214502001-12-05 Akim Demaille <akim@epita.fr>
21451
21452 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
21453 * src/lalr.c: Use them.
21454
b178c8cc
AD
214552001-12-05 Akim Demaille <akim@epita.fr>
21456
21457 * src/LR0.c (augment_automaton): Formatting changes.
21458 Better variable locality.
21459
f67d13aa
AD
214602001-12-05 Akim Demaille <akim@epita.fr>
21461
21462 * src/lalr.c (matrix_print): New.
21463 (transpose): Use it.
21464 Use arrays instead of pointers.
21465
c2713865
AD
214662001-12-05 Akim Demaille <akim@epita.fr>
21467
21468 * src/lalr.c (maxrhs): Move to...
21469 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
21470 * src/lalr.c (build_relations): Adjust.
21471
9887c18a
AD
214722001-12-05 Akim Demaille <akim@epita.fr>
21473
21474 * src/lalr.c (transpose): Free the memory allocated to the
21475 argument, as it is replaced by the results by the unique caller.
21476 (build_relations): Merely invoke transpose: it handles the memory
21477 deallocation.
21478 Improve variable locality.
21479 Avoid variables used as mere abbreviations.
21480 (compute_lookaheads): Use arrays instead of pointers.
21481
4d4f699c
AD
214822001-12-05 Akim Demaille <akim@epita.fr>
21483
21484 * src/lalr.c (initialize_F): Improve variable locality.
21485 Avoid variables used as mere abbreviations.
21486
80a69750
AD
214872001-12-05 Akim Demaille <akim@epita.fr>
21488
21489 * src/derives.c (print_derives): Display the ruleno.
21490 * src/lalr.c (initialize_F, transpose): Better variable locality
21491 to improve readability.
21492 Avoid variables used as mere abbreviations.
21493
fe961097
AD
214942001-12-05 Akim Demaille <akim@epita.fr>
21495
21496 * src/lalr.c (traverse): Use arrays instead of pointers.
21497
e3e4e814
AD
214982001-12-05 Akim Demaille <akim@epita.fr>
21499
21500 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
21501 the handling of squeue.
21502 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21503
630e182b
AD
215042001-12-05 Akim Demaille <akim@epita.fr>
21505
21506 Because useless nonterminals are now kept alive (instead of being
21507 `destroyed'), we now sometimes examine them, and store information
21508 related to them. Hence we need to know their number, and adjust
21509 memory allocations.
21510
21511 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
21512 static.
21513 * src/LR0.c (allocate_itemsets): The memory allocated to
21514 `symbol_count' was used for two different purpose: once to count
21515 the number of occurrences of each symbol, and later reassigned to
21516 `shift_symbol', containing the symbol that can be shifted from a
21517 given state.
21518 Deobfuscate, i.e., allocate, use and free `symbol_count' here
21519 only, and...
21520 (new_itemsets): Allocate `shift_symbol' here.
21521 (allocate_itemsets): symbol_count includes useless nonterminals.
21522 Make room for them.
21523 (free_storage): Use `free', not `XFREE', for pointers that cannot
21524 be null.
21525
81b51460
AD
215262001-12-05 Akim Demaille <akim@epita.fr>
21527
21528 * src/nullable.c (set_nullable): Deobfuscate the handling of
21529 ritem.
21530 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21531
3067fbef
AD
215322001-12-05 Akim Demaille <akim@epita.fr>
21533
21534 * src/gram.c, src/gram.h (ritem_print): New.
21535 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
21536 (This useless function was defined only to work around VMS linkers
21537 that can't handle compilation units with variables only).
21538 * src/reduce.c (dump_grammar): Use it to trace the construction of
21539 ritem.
21540
c2bea5f9
PE
215412001-12-04 Paul Eggert <eggert@twinsun.com>
21542
7d27c823
PE
21543 * src/bison.simple (union yyalloc): Change member names
21544 to be the same as the stack names.
21545 (yyparse): yyptr is now union yyalloc *, not char *.
21546 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
21547 and may generate better code on some machines.
c2bea5f9
PE
21548 (yystpcpy): Use prototype if __STDC__ is defined, not just
21549 if __cplusplus is defined.
35687a9d 21550
2c8a9dfa
AD
215512001-11-30 Akim Demaille <akim@epita.fr>
21552
21553 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
21554 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
21555 Gettext doesn't compile cleanly, and dies with -Werror.
21556 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
21557 Include WARNING_CFLAGS here.
21558 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
21559 before being defined.
21560
f4e421e6
AD
215612001-11-27 Paul Eggert <eggert@twinsun.com>
21562
21563 * lib/quotearg.h (quotearg_n, quotearg_n_style):
21564 First arg is int, not unsigned.
21565 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
21566 (SIZE_MAX, UINT_MAX): New macros.
21567 (quotearg_n_options): Abort if N is negative.
21568 Avoid overflow check on hosts where size_t is 64 bits and int
21569 is 32 bits, as overflow is impossible there.
21570 Fix off-by-one typo that caused unnecessary reallocation.
21571
7093d0f5
AD
215722001-11-29 Paul Eggert <eggert@twinsun.com>
21573
21574 Name space cleanup in generated parser.
21575
21576 * doc/bison.texinfo (Bison Parser): Discuss system headers
21577 and their effect on the user name space.
21578
21579 * src/bison.simple:
21580 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
21581 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
21582 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
21583
21584 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
21585 on user names when possible.
21586
21587 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
21588 Simplify test for whather <alloca.h> exists.
21589
21590 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
21591
21592 (<stdio.h>): Include if YYDEBUG.
21593
21594 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
21595 ! defined (yyoverflow) && ! defined (yymemcpy).
21596
21597 (yymemcpy, yyparse): Rename local variables as needed so that
21598 they all begin with 'yy'.
21599
21600 (yystrlen, yystpcpy): New functions.
21601
21602 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
21603 All uses changed.
21604
21605 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
21606 instead of relying on string.h functions. Use YYSTACK_ALLOC
21607 and YYSTACK_FREE instead of malloc and free.
21608
fd51e5ff
AD
216092001-11-30 Akim Demaille <akim@epita.fr>
21610
21611 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
21612 before their first uses.
21613 (YYBISON, YYPURE): Move to the top of the output.
21614
7d13ff5f
AD
216152001-11-30 Akim Demaille <akim@epita.fr>
21616
21617 * tests/reduce.at (Useless Nonterminals): Fix.
21618
892a3995
AD
216192001-11-30 Akim Demaille <akim@epita.fr>
21620
21621 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
21622 if body instead of `;' to pacify GCC's warnings.
21623
68f1e3ed
AD
216242001-11-30 Akim Demaille <akim@epita.fr>
21625
21626 Instead of mapping the LHS of unused rules to -1, keep the LHS
21627 valid, but flag the rules as invalid.
21628
21629 * src/gram.h (rule_t): `useful' is a new member.
21630 * src/print.c (print_grammar): Adjust.
21631 * src/derives.c (set_derives): Likewise.
21632 * src/reader.c (packgram, reduce_output): Likewise.
21633 * src/reduce.c (reduce_grammar_tables): Likewise.
21634 * tests/reduce.at (Underivable Rules, Useless Rules): New.
21635
d2d1b42b
AD
216362001-11-30 Akim Demaille <akim@epita.fr>
21637
21638 * src/reduce.c (reduce_output): Formatting changes.
21639 * src/print.c (print_results, print_grammar): Likewise.
21640 * tests/regression.at (Rule Line Numbers)
21641 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
21642
760b53a8
AD
216432001-11-30 Akim Demaille <akim@epita.fr>
21644
21645 * src/reduce.c (nonterminals_reduce): Instead of throwing away
21646 useless nonterminals, move them at the end of the symbol arrays.
21647 (reduce_output): Adjust.
21648 * tests/reduce.at (Useless Nonterminals): Adjust.
21649
00238958
AD
216502001-11-30 Akim Demaille <akim@epita.fr>
21651
21652 * src/reduce.c: Various comment/formatting changes.
21653 (nonterminals_reduce): New, extracted from...
21654 (reduce_grammar_tables): here.
21655 (reduce_grammar): Call nonterminals_reduce.
21656
396452de
PE
216572001-11-29 Paul Eggert <eggert@twinsun.com>
21658
21659 * src/bison.simple (YYSTACK_REALLOC): Remove.
21660 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
21661 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
21662 New macros.
21663 (union yyalloc): New type.
21664 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
21665 an arbitrary restriction on hosts where size_t is wider than int.
21666
21667 (yyparse): Don't dump core if alloca or malloc fails; instead, report
21668 a parser stack overflow. Allocate just one block of memory for all
21669 three stacks, instead of allocating three blocks; this typically is
21670 faster and reduces fragmentation.
21671
21672 Do not limit the number of items in the stack to a value that fits
21673 in 'int', as this is an arbitrary limit on hosts with 64-bit
21674 size_t and 32-bit int.
21675
147e184c
MA
216762001-11-29 Marc Autret <autret_m@epita.fr>
21677
21678 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
21679 of defining YYERROR_VERBOSE.
21680 [AT_DATA]: $4 is now out of C declarations in the prologue.
21681
426cf563
MA
216822001-11-28 Marc Autret <autret_m@epita.fr>
21683
21684 * src/reader.c (parse_dquoted_param): New.
21685 (parse_skel_decl): Use it.
21686 * src/lex.h: Add its prototype.
21687 * src/lex.c (literalchar): Become not static.
21688
c7925b99
MA
216892001-11-28 Marc Autret <autret_m@epita.fr>
21690
21691 * src/output.h: And put its extern declaration here.
21692 * src/output.c (error_verbose): Define here.
21693 (prepare): Echo name modification.
21694 * src/getargs.h: Clean its extern declaration.
21695 * src/getargs.c (error_verbose_flag): Remove.
21696 (getargs): Remove case 'e'.
21697 * src/options.c (option_table): 'error-verbose' is now seen as simple
21698 percent option.
21699 Include output.h.
21700
21701 * src/reader.c (read_declarations): Remove case tok_include.
21702 (parse_include_decl): Remove.
21703 * src/lex.h (token_t): Remove tok_include.
21704 * src/options.c (option_table): 'include' is now a simple command line
21705 option.
21706
5b5d1929
MA
217072001-11-28 Marc Autret <autret_m@epita.fr>
21708
21709 * src/bison.simple: Adjust muscle names.
21710 * src/muscle_tab.c (muscle_init): Also rename the muscles.
21711 * src/output.c (prepare): s/_/-/ for the muscles names.
21712 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
21713
8850be4b
MA
217142001-11-28 Marc Autret <autret_m@epita.fr>
21715
21716 * src/bison.simple: Fix debug.
21717 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
21718
4a38e613
AD
217192001-11-28 Akim Demaille <akim@epita.fr>
21720
21721 * src/LR0.c (shifts_new): New.
21722 (save_shifts, insert_start_shift, augment_automaton): Use it.
21723
4b35e1c1
AD
217242001-11-28 Akim Demaille <akim@epita.fr>
21725
21726 * src/closure.c (closure): `b' and `ruleno' denote the same value:
21727 keep ruleno only.
21728
d2b04478
AD
217292001-11-28 Akim Demaille <akim@epita.fr>
21730
21731 * src/closure.c (closure): Instead of looping over word in array
21732 then bits in words, loop over bits in array.
21733
2c4c30aa
AD
217342001-11-28 Akim Demaille <akim@epita.fr>
21735
21736 * src/closure.c (closure): No longer optimize the special case
21737 where all the bits of `ruleset[r]' are set to 0, to make the code
21738 clearer.
21739
576890b7
AD
217402001-11-28 Akim Demaille <akim@epita.fr>
21741
21742 * src/closure.c (closure): `r' and `c' are new variables, used to
21743 de-obfuscate accesses to RULESET and CORE.
21744
cb487d7d
AD
217452001-11-28 Akim Demaille <akim@epita.fr>
21746
21747 * src/reduce.c (reduce_print): Use ngettext.
21748 (dump_grammar): Improve the trace accuracy.
21749
6013d43f
AD
217502001-11-28 Akim Demaille <akim@epita.fr>
21751
21752 * src/reduce.c (dump_grammar): Don't translate trace messages.
21753
cb4956ee
AD
217542001-11-28 Akim Demaille <akim@epita.fr>
21755
21756 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
21757 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
21758 as all tags are free'ed afterwards.
21759 From Enrico Scholz.
21760
648185ab
PE
217612001-11-27 Paul Eggert <eggert@twinsun.com>
21762
21763 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
21764 use alloca when we didn't want to, and vice versa.
21765
68254a03
MA
217662001-11-27 Marc Autret <autret_m@epita.fr>
21767
9113b58f
AD
21768 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
21769 initialization.
68254a03
MA
21770 * src/output.c (prepare): Remove its update.
21771
04d843a2
MA
217722001-11-27 Marc Autret <autret_m@epita.fr>
21773
21774 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
21775 Use %error-verbose.
21776
d2079671 217772001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
21778
21779 * src/bison.simple: Remove YYERROR_VERBOSE using.
21780 Use %%error_verbose.
21781 (yyparse): Likewise.
21782 * src/output.c (prepare): Give its final value.
21783 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
21784 * src/getargs.h: Add its extern declaration.
21785 * src/getargs.c (error_verbose_flag): New int.
21786 (getargs): Update to catch new case.
21787 * src/options.c (option_table): 'error-verbose' is a new option.
21788 (shortopts): Update.
21789
e0327bc8
AD
217902001-11-27 Akim Demaille <akim@epita.fr>
21791
21792 * src/system.h: Use intl/libgettext.h.
21793 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
21794
000f1a3c
AD
217952001-11-27 Akim Demaille <akim@epita.fr>
21796
21797 * tests/torture.at (Exploding the Stack Size with Malloc):
21798 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
21799
26cfe0be
AD
218002001-11-27 Akim Demaille <akim@epita.fr>
21801
21802 * src/files.c: Include error.h.
21803 Reported by Hans Aberg.
21804
f6bd5427
MA
218052001-11-26 Marc Autret <autret_m@epita.fr>
21806
d2079671 21807 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
21808 (read_declarations): Add case tok_include.
21809 * src/getargs.h (include): Add its extern definition.
21810 * src/getargs.c (include): New const char *.
21811 (getargs): Add case '-I'.
21812 * src/options.c (option_table): Add include as command line and
21813 percent option.
21814 * src/lex.h (token_t): Add tok_include.
21815
2ca209c1
AD
218162001-11-26 Akim Demaille <akim@epita.fr>
21817
21818 * src/reader.c (readgram): Make sure rules for mid-rule actions
21819 have a lineno equal to that of their host rule.
21820 Reported by Hans Aberg.
21821 * tests/regression.at (Rule Line Numbers): New.
21822
0e41b407
AD
218232001-11-26 Akim Demaille <akim@epita.fr>
21824
21825 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
21826 size_ts.
21827
218282001-11-26 Akim Demaille <akim@epita.fr>
21829
21830 * src/complain.c, src/complain.h (error): Remove, provided by
21831 lib/error.[ch].
21832
e0c40012
AD
218332001-11-26 Akim Demaille <akim@epita.fr>
21834
21835 * src/reader.c (read_declarations): Don't abort on tok_illegal,
21836 issue an error message.
21837 * tests/regression.at (Invalid %directive): New.
21838 Reported by Hans Aberg.
21839
5e147124
AD
218402001-11-26 Akim Demaille <akim@epita.fr>
21841
21842 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
21843 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
21844
a034c8b8
AD
218452001-11-26 Akim Demaille <akim@epita.fr>
21846
21847 * src/conflicts.c (conflicts_print): Don't complain at all when
21848 there are no reduce/reduce conflicts, and as many shift/reduce
21849 conflicts as expected.
21850 * tests/regression.at (%expect right): Adjust.
21851
c64a20f3
AD
218522001-11-23 Akim Demaille <akim@epita.fr>
21853
21854 * lib/alloca.c: Update, from fileutils.
21855
5b0d29bb
AD
218562001-11-23 Akim Demaille <akim@epita.fr>
21857
21858 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
21859
722c4bfe
AD
218602001-11-23 Akim Demaille <akim@epita.fr>
21861
21862 * src/system.h: Include alloca.h.
21863 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
21864
6255b435
AD
218652001-11-23 Akim Demaille <akim@epita.fr>
21866
21867 * src/print_graph.c (print_actions): Remove `rule', unused.
21868 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
21869 pacify GCC's signed < unsigned warnings.
21870 * src/closure.c (itemsetsize): Likewise.
21871 * src/reader.c (symbol_list_new): Static.
21872
b29b2ed5
AD
218732001-11-23 Akim Demaille <akim@epita.fr>
21874
21875 Attaching lineno to buckets is stupid, since only one copy of each
21876 symbol is kept, only the line of the first occurrence is kept too.
21877
21878 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
21879 * src/reader.c (rline_allocated): Remove, unused.
21880 (symbol_list): Have a `line' member.
21881 (symbol_list_new): New.
21882 (readgram): Use it.
21883 * src/print.c (print_grammar): Output the rule line numbers.
21884 * tests/regression.at (Solved SR Conflicts)
21885 (Unresolved SR Conflicts): Adjust.
21886 Reported by Hans Aberg.
21887
a81b1d4a
MA
218882001-11-22 Marc Autret <autret_m@epita.fr>
21889
21890 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
21891
c1ecb3c1
MA
218922001-11-22 Marc Autret <autret_m@epita.fr>
21893
21894 * src/muscle_tab.c (muscle_init): Remove initialization of
21895 skeleton muscle.
21896 * src/output.c (output_master_parser): Do it here.
21897
fbe01355
AD
218982001-11-20 Akim Demaille <akim@epita.fr>
21899
21900 * po/sv.po: New.
21901 * configure.in (ALL_LINGUAS): Adjust.
21902 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
21903 longer contains strings to translate.
21904
81e895c0
AD
219052001-11-19 Akim Demaille <akim@epita.fr>
21906
21907 * src/conflicts.c (conflicts_print): Add a missing \n.
21908
6bb1878b
AD
219092001-11-19 Akim Demaille <akim@epita.fr>
21910
21911 * src/nullable.c (nullable_print): New.
21912 (set_nullable): Call it when tracing.
21913 Better locality of variables.
21914
d9ec2d07
AD
219152001-11-19 Akim Demaille <akim@epita.fr>
21916
21917 * src/print.c (print_actions): Better locality of variables.
21918
720e5c1b
AD
219192001-11-19 Akim Demaille <akim@epita.fr>
21920
21921 * src/derives.c (print_derives): Fix and enrich.
21922 * src/closure.c (print_fderives): Likewise.
21923
fb908786
AD
219242001-11-19 Akim Demaille <akim@epita.fr>
21925
21926 * src/closure.c (itemsetend): Remove, replaced with...
21927 (itemsetsize): new.
21928
125ecb56
AD
219292001-11-19 Akim Demaille <akim@epita.fr>
21930
21931 * src/LR0.c (kernel_end): Remove, replaced with...
21932 (kernel_size): new.
21933
d8cf039f
AD
219342001-11-19 Akim Demaille <akim@epita.fr>
21935
21936 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
21937 to clarify.
21938
7bec0760
AD
219392001-11-19 Akim Demaille <akim@epita.fr>
21940
21941 * src/closure.c (closure): Use arrays instead of pointers to clarify.
21942
c87d4863
AD
219432001-11-19 Akim Demaille <akim@epita.fr>
21944
21945 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
21946 trace messages.
21947 * src/LR0.c: Likewise.
21948 (allocate_itemsets): Use arrays instead of pointers to clarify.
21949
9bfe901c
AD
219502001-11-19 Akim Demaille <akim@epita.fr>
21951
21952 * src/getargs.c (statistics_flag): Replace with...
21953 (trace_flag): New.
21954 (longopts): Accept --trace instead of --statistics.
21955 * src/getargs.h, src/options.c: Adjust.
21956 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
21957 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
21958
97db7bd4
AD
219592001-11-19 Akim Demaille <akim@epita.fr>
21960
cc72668c 21961 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
21962 pointers to clarify the code.
21963 (save_reductions, save_shifts): Factor common parts of alternatives.
21964
2c5f66ed
AD
219652001-11-19 Akim Demaille <akim@epita.fr>
21966
21967 * src/LR0.c (new_state, get_state): Complete TRACE code.
21968 * src/closure.c: Include `reader.h' to get `tags', needed by the
21969 trace code.
21970 Rename the conditional DEBUG as TRACE.
21971 Output consistently TRACEs to stderr, not stdout.
21972 * src/derives.c: Likewise.
21973 * src/reduce.c: (inaccessable_symbols): Using if is better style
21974 than goto.
21975 Use `#if TRACE' instead of `#if 0' for tracing code.
21976
300f275f
AD
219772001-11-19 Akim Demaille <akim@epita.fr>
21978
21979 * src/system.h (LIST_FREE, shortcpy): New.
21980 * src/LR0.c: Use them.
21981 * src/output.c (free_itemsets, free_reductions, free_shifts):
21982 Remove, replaced by LIST_FREE.
21983
f59c437a
AD
219842001-11-19 Akim Demaille <akim@epita.fr>
21985
21986 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
21987 (REDUCTIONS_ALLOC): New.
21988 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
21989 allocation.
21990
6986fd9e
AD
219912001-11-19 Akim Demaille <akim@epita.fr>
21992
21993 * src/LR0.c (new_state): Complete trace code.
21994 * src/nullable.c (set_nullable): Don't translate traces.
21995
4bc30f78
AD
219962001-11-19 Akim Demaille <akim@epita.fr>
21997
21998 * src/print_graph.c (print_core): Better locality of variables.
21999 * src/print.c (print_core): Likewise.
22000
08a946e0
AD
220012001-11-19 Akim Demaille <akim@epita.fr>
22002
22003 * src/vcg.c: You do the output, so you are responsible of the
22004 handling of VCG syntax, in particular: use quotearg.
22005 * src/print_graph.c: Don't.
22006 (print_actions): Don't output the actions as part of the nodes,
22007 since that's the job of the edges.
22008 (print_state): Don't output by hand: fill the node description,
9bfe901c 22009 and ask for its output.
08a946e0 22010
f0473484
AD
220112001-11-19 Akim Demaille <akim@epita.fr>
22012
cc72668c
AD
22013 * src/bison.simple (yyparse): When verbosely reporting an error,
22014 no longer put additional quotes around token names.
f0473484
AD
22015 * tests/calc.at: Adjust.
22016
e41dc700
AD
220172001-11-19 Akim Demaille <akim@epita.fr>
22018
22019 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
22020 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
22021 * src/output.c: Adjust.
22022
652a871c
AD
220232001-11-19 Akim Demaille <akim@epita.fr>
22024
22025 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
22026 (rule_t): this.
22027 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
22028
b2ed6e58
AD
220292001-11-19 Akim Demaille <akim@epita.fr>
22030
22031 * src/gram.h (rule_t): New.
22032 (rule_table): New.
22033 (rrhs, rlhs): Remove, part of state_t.
22034 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
22035 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
22036 * src/reader.c, src/reduce.c: Adjust.
22037
edad7067
AD
220382001-11-19 Akim Demaille <akim@epita.fr>
22039
22040 * src/reader.c (symbols_output): New, extracted from...
22041 (packsymbols): Here.
22042 (reader): Call it.
22043
3feec034
AD
220442001-11-19 Akim Demaille <akim@epita.fr>
22045
22046 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
22047 (maxrhs): this new function.
22048
ddcd5fdf
AD
220492001-11-19 Akim Demaille <akim@epita.fr>
22050
cc72668c 22051 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
22052 Adjust.
22053
bb527fc2
AD
220542001-11-19 Akim Demaille <akim@epita.fr>
22055
cc72668c 22056 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
22057 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22058 * src/lalr.c: Adjust.
22059
a845a697
AD
220602001-11-19 Akim Demaille <akim@epita.fr>
22061
22062 * src/lalr.c (initialize_LA): Only initialize LA. Let...
22063 (set_state_table): handle the `lookaheads' members.
22064
f004bf6a
AD
220652001-11-19 Akim Demaille <akim@epita.fr>
22066
cc72668c
AD
22067 * src/lalr.h (lookaheads): Removed array, whose contents is now
22068 a member of...
f004bf6a
AD
22069 (state_t): this structure.
22070 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22071 Adjust.
22072
de326cc0
AD
220732001-11-19 Akim Demaille <akim@epita.fr>
22074
cc72668c
AD
22075 * src/lalr.h (consistent): Removed array, whose contents is now
22076 a member of...
de326cc0
AD
22077 (state_t): this structure.
22078 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22079 Adjust.
22080
90b4416b
AD
220812001-11-19 Akim Demaille <akim@epita.fr>
22082
cc72668c
AD
22083 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
22084 contents are now members of...
90b4416b
AD
22085 (state_t): this structure.
22086 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22087 Adjust.
22088
9703cc49
AD
220892001-11-19 Akim Demaille <akim@epita.fr>
22090
22091 * src/lalr.h (state_t): New.
22092 (state_table): Be a state_t * instead of a core **.
22093 (accessing_symbol): Remove, part of state_t.
22094 * src/lalr.c: Adjust.
22095 (set_accessing_symbol): Merge into...
22096 (set_state_table): this.
22097 * src/print_graph.c, src/conflicts.c: Adjust.
22098
d803322e
AD
220992001-11-14 Akim Demaille <akim@epita.fr>
22100
22101 * tests/calc.at, tests/output.at, tests/regression.at,
22102 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
22103 now the tests are run in private dirs, therefore AC_CLEANUP and
22104 family can be simplified to 0-ary.
22105 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
22106 use abs. path to find config.h.
22107 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
22108 stderr, there can be way too much random noise.
22109 Instead pass -Werror to GCC and rely on the exit status.
22110 Reported by Wolfram Wagner.
22111
3d76b07d
AD
221122001-11-14 Akim Demaille <akim@epita.fr>
22113
22114 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
22115 defined only if yyoverflow is defined, to avoid `warning: unused
22116 variable `yyvs1''.
22117 Reported by The Test Suite.
22118
09b503c8
AD
221192001-11-14 Akim Demaille <akim@epita.fr>
22120
22121 * src/print.c: Include reduce.h.
22122 Reported by Hans Aberg.
22123
221242001-11-14 Akim Demaille <akim@epita.fr>
22125
22126 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
22127 Revert a previous patch: these are really const.
22128 * src/conflicts.c (conflict_report): Additional useless pair of
22129 braces to pacify GCC's warnings for `if () if () {} else {}'.
22130 * src/lex.c (parse_percent_token): Replace equal_offset with
22131 arg_offset.
22132 arg is const.
22133 Be sure to strdup `arg' when used, since there is no reason for
22134 token_buffer not to change.
22135
0f37a994
AD
221362001-11-14 Akim Demaille <akim@epita.fr>
22137
22138 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
22139 definition.
22140 * src/main.c (main): Use them.
22141 Suggested by Hans Aberg.
22142
d39d93b8
AD
221432001-11-12 Akim Demaille <akim@epita.fr>
22144
22145 * src/system.h (ngettext): Now that we use ngettext, be sure to
22146 provide a default definition when NLS are not used.
22147
9edcd895
AD
221482001-11-12 Akim Demaille <akim@epita.fr>
22149
22150 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
22151 Use @kbd to denote user input.
22152 (Language and Grammar): ANSIfy the example.
22153 Adjust its layout for info/notinfo.
22154 (Location Tracking Calc): Output error messages to stderr.
22155 Output locations in a more GNUtically correct way.
22156 Fix a couple of Englishos.
22157 Adjust @group/@end group pairs.
22158
7da99ede
AD
221592001-11-12 Akim Demaille <akim@epita.fr>
22160
e3aa65c5 22161 %expect was not functioning at all.
7da99ede
AD
22162
22163 * src/conflicts.c (expected_conflicts): Set to -1.
22164 (conflict_report): Use ngettext.
22165 (conflicts_print): Check %expect and make its violation an error.
22166 * doc/bison.texinfo (Expect Decl): Adjust.
22167 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
22168 * tests/regression.at (%expect not enough, %expect right)
22169 (%expect too much): New.
22170
ba9dda1a
AD
221712001-11-12 Akim Demaille <akim@epita.fr>
22172
22173 * tests/regression.at (Conflicts): Rename as...
22174 (Unresolved SR Conflicts): this.
22175 (Solved SR Conflicts): New.
22176
337c5bd1
AD
221772001-11-12 Akim Demaille <akim@epita.fr>
22178
22179 * src/reduce.c (print_results): Rename as...
22180 (reduce_output): This.
22181 Output to OUT, passed as argument, instead of output_obstack.
22182 (dump_grammar): Likewise.
22183 (reduce_free): New.
22184 Also free V1.
22185 (reduce_grammar): No longer call reduce_output, since...
22186 * src/print.c (print_results): do it.
22187 * src/main.c (main): Call reduce_free;
22188
c73a41af
AD
221892001-11-12 Akim Demaille <akim@epita.fr>
22190
22191 * src/conflicts.c (print_reductions): Accept OUT as argument.
22192 Output to it, not to output_obstack.
22193 * src/print.c (print_actions): Adjust.
22194
0df87bb6
AD
221952001-11-12 Akim Demaille <akim@epita.fr>
22196
22197 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
22198 the result instead of using...
22199 (src_total, rrc_total, src_count, rrc_count): Remove.
22200 (any_conflicts): Remove.
22201 (print_conflicts): Split into...
22202 (conflicts_print, conflicts_output): New.
22203 * src/conflicts.h: Adjust.
22204 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 22205 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
22206 * tests/regression.at (Conflicts): New.
22207 Reported by Tom Lane.
22208
e4d3d4de
AD
222092001-11-12 Akim Demaille <akim@epita.fr>
22210
22211 * tests/regression.at (Invalid input): Remove, duplicate with
22212 ``Invalid input: 1''.
22213
6d7d248e
AD
222142001-11-12 Akim Demaille <akim@epita.fr>
22215
22216 * tests/torture.at (AT_DATA_STACK_TORTURE)
22217 (Exploding the Stack Size with Alloca)
22218 (Exploding the Stack Size with Malloc): New.
22219
e9e4c321
AD
222202001-11-12 Akim Demaille <akim@epita.fr>
22221
22222 * src/bison.simple (YYSTACK_REALLOC): New.
22223 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 22224 Reported by Per Allansson.
e9e4c321 22225
5f7e0832
AD
222262001-11-12 Pascal Bart <pascal.bart@epita.fr>
22227
22228 * src/bison.simple: Define type yystype instead of YYSTYPE, and
22229 define CPP macro, which substitute YYSTYPE by yystype.
22230 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
22231 with yyltype/YYLTYPE. This allows inclusion of the generated
22232 header within the parser if the compiler, such as GGC, accepts
22233 multiple equivalent #defines.
22234 From Akim.
22235
e3f1699f
AD
222362001-11-05 Akim Demaille <akim@epita.fr>
22237
22238 * src/reader.c (symbols_output): New, extracted from...
22239 (packsymbols): here.
22240 (reader): Adjust.
22241
65be0866
AD
222422001-11-05 Akim Demaille <akim@epita.fr>
22243
22244 * src/lex.c (parse_percent_token): s/quotearg/quote/.
22245
e4d910bf
AD
222462001-11-05 Akim Demaille <akim@epita.fr>
22247
22248 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
22249 pattern.
22250
951366c1
AD
222512001-11-05 Akim Demaille <akim@epita.fr>
22252
22253 * src/options.h (struct option_table_struct): set_flags is void*.
22254 * src/options.c (longopts): Support `--output' and `%output'.
22255 (usage): Adjust.
22256 * src/lex.h (tok_setopt): Remove, replaced with...
22257 (tok_intopt, tok_stropt): these new guys.
22258 * src/lex.c (getopt.h): Not needed.
22259 (token_buffer, unlexed_token_buffer): Not const.
22260 (percent_table): Promote `-' over `_' in directive names.
22261 Active `%name-prefix', `file-prefix', and `output'.
22262 (parse_percent_token): Accept possible arguments to directives.
22263 Promote `-' over `_' in directive names.
22264
d8988b2f
AD
222652001-11-04 Akim Demaille <akim@epita.fr>
22266
22267 * doc/bison.texinfo (Decl Summary): Split the list into
22268 `directives for grammars' and `directives for bison'.
22269 Sort'em.
22270 Add description of `%name-prefix', `file-prefix', and `output'.
22271 Promote `-' over `_' in directive names.
22272 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
22273 Simplify the description of `--name-prefix'.
22274 Promote `-' over `_' in directive names.
22275 Promote `--output' over `--output-file'.
22276 Fix the description of `--defines'.
22277 * tests/output.at: Exercise %file-prefix and %output.
22278
6468d18e
AD
222792001-11-02 Akim Demaille <akim@epita.fr>
22280
22281 * doc/refcard.tex: Update.
22282
6b7e85b9
AD
222832001-11-02 Akim Demaille <akim@epita.fr>
22284
22285 * src/symtab.h (SUNDEF): New.
22286 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
22287 stand for `uninitialized', instead of 0.
22288 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
22289 * src/lex.c (lex): Adjust.
22290
22291 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
22292 Number it 0.
22293 Let yylex return it instead of a plain 0.
22294 Reported by Dick Streefland.
22295
cd5aafcf
AD
222962001-11-02 Akim Demaille <akim@epita.fr>
22297
22298 * tests/regression.at (Mixing %token styles): New test.
22299
037ca2f1
AD
223002001-11-02 Akim Demaille <akim@epita.fr>
22301
22302 * src/reader.c (parse_thong_decl): Formatting changes.
22303 (token_translations_init): New, extracted from...
22304 (packsymbols): Here.
22305 Adjust.
22306
270a173c
AD
223072001-11-01 Akim Demaille <akim@epita.fr>
22308
22309 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
22310 Check that `9foo.y' produces correct cpp guards.
22311 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
22312 guards.
22313 Reported by Wwp.
22314
561f9a30
AD
223152001-11-01 Akim Demaille <akim@epita.fr>
22316
22317 * tests/regression.at (Invalid input: 2): New.
22318 * src/lex.c (unlexed_token_buffer): New.
22319 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
22320 too.
22321 Reported by Wwp.
22322
f987e9d2
AD
223232001-11-01 Akim Demaille <akim@epita.fr>
22324
22325 * tests/calc.at: Catch up with 1.30.
22326 * configure.in: Bump to 1.49a.
22327 Adjust to newer Autotest.
22328
0846f581
PB
223292001-10-19 Pascal Bart <pascal.bart@epita.fr>
22330
22331 * src/conflicts.c: Move global variables rrc_total and src_total ...
22332 (print_conflicts): here.
22333 * src/output.c (output): Free global variable user_toknums.
22334 * src/lex.c (token_obstack): Become static.
22335
3c1a79b3
AD
223362001-10-18 Akim Demaille <akim@epita.fr>
22337
22338 * tests/atlocal.in (GCC): Add.
22339 * tests/calc.at: s/m4_match/m4_bmatch/.
22340 s/m4_patsubst/m4_bpatsubst/.
22341 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
22342 * configure.in: AC_SUBST(GCC).
22343
5d52e7d0
MA
223442001-10-14 Marc Autret <autret_m@epita.fr>
22345
22346 * src/options.c (create_long_option_table): Fix.
22347
631aa1d3
AD
223482001-10-10 Akim Demaille <akim@epita.fr>
22349
22350 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
22351
f6ec6d13
AD
223522001-10-04 Akim Demaille <akim@epita.fr>
22353
22354 * src/reader.c (parse_union_decl): Push the caracters in
22355 union_obstack, not attrs_obstack.
22356
342b8b6e
AD
223572001-10-04 Akim Demaille <akim@epita.fr>
22358
22359 Merge in the branch 1.29.
22360
22361 * src/reader.c (packsymbols): Use a temporary obstack for
22362 `%%tokendef', since output_stack is already used elsewhere.
22363
22364 2001-10-02 Akim Demaille <akim@epita.fr>
22365
22366 Bump 1.29d.
22367
22368 2001-10-02 Akim Demaille <akim@epita.fr>
22369
22370 Version 1.29c.
22371
22372 2001-10-02 Akim Demaille <akim@epita.fr>
22373
22374 * tests/regression.at (Invalid CPP headers): New.
22375 From Alexander Belopolsky.
22376 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
22377
22378 2001-10-02 Akim Demaille <akim@epita.fr>
22379
22380 * tests/regression.at (Invalid input): New.
22381 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
22382 Reported by Shura.
22383
22384 2001-10-02 Akim Demaille <akim@epita.fr>
22385
22386 * tests/calc.at: Now that --debug works, the tests must be adjusted.
22387
22388 2001-10-02 Akim Demaille <akim@epita.fr>
22389
22390 * src/output.c (output_parser): Assert `skeleton'.
22391 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
22392 systems.
22393 From Shura.
22394
22395 2001-10-01 Marc Autret <autret_m@epita.fr>
22396
22397 * src/lex.h: Echo modifications.
22398 * src/lex.c (unlex): Parameter is now token_t.
22399 From Hans Aberg.
22400
22401 2001-10-01 Marc Autret <autret_m@epita.fr>
22402
22403 * src/main.c: Include lex.h.
22404 From Hans Aberg.
22405
22406 2001-09-29 Akim Demaille <akim@epita.fr>
22407
22408 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
22409
22410 2001-09-28 Akim Demaille <akim@epita.fr>
22411
22412 * tests/testsuite.at: Update to newer Autotest.
22413 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
22414
22415 2001-09-27 Akim Demaille <akim@epita.fr>
22416
22417 Position independent wrapper.
22418
22419 * tests/bison: Remove.
22420 * tests/bison.in: New.
22421 * configure.in: Adjust.
22422
22423 2001-09-27 Paul Eggert <eggert@twinsun.com>
22424
22425 Port quotearg fixes from tar 1.13.24.
22426
22427 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
22428 tm to be declared.
22429 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
22430 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
22431
22432 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
22433 * m4/mbrtowc.m4: New file.
22434 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
22435 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
22436
22437 2001-09-27 Akim Demaille <akim@epita.fr>
22438
22439 Bump to 1.29c.
22440
22441 2001-09-27 Akim Demaille <akim@epita.fr>
22442
22443 Version 1.29b.
22444
22445 2001-09-25 Akim Demaille <akim@epita.fr>
22446
22447 * src/system.h: Include `xalloc.h'.
22448 Remove it from the C files.
22449 * src/files.c (output_files): Free the obstacks.
22450 * src/lex.c (init_lex): Rename as...
22451 (lex_init): this.
22452 (lex_free): New.
22453 * src/main.c (main): Use it.
22454
22455 2001-09-24 Marc Autret <autret_m@epita.fr>
22456
22457 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
22458 to output informations in fout (FILE*).
22459 (open_graph, close_graph): Likewise.
22460 (output_graph, output_edge, output_node): Likewise.
22461 * src/vcg.h: Update function prototypes.
22462 * src/print_graph.c (print_graph): Open output graph file.
22463 (print_actions): Adjust.
22464 * src/files.h: Remove extern declaration.
22465 * src/files.c: Remove graph_obstack declaration.
22466 (open_files): Remove graph_obstack initialization.
22467 (output_files): Remove graph_obstack saving.
22468
22469 2001-09-24 Marc Autret <autret_m@epita.fr>
22470
22471 * src/files.c (compute_output_file_names): Fix.
22472
22473 2001-09-24 Marc Autret <autret_m@epita.fr>,
22474 Akim Demaille <akim@epita.fr>
22475
22476 * src/reader.c (reader): Remove call to free_symtab ().
22477 * src/main.c (main): Call it here.
22478 Include symtab.h.
22479 * src/conflicts.c (initialize_conflicts): Rename as...
22480 (solve_conflicts): this.
22481 * src/print.c (print_core, print_actions, print_state)
22482 (print_grammar): Dump to a file instead a `output_obstack'.
22483 (print_results): Dump `output_obstack', and then proceed with the
22484 FILE *.
22485 * src/files.c (compute_output_file_names, close_files): New.
22486 (output_files): Adjust.
22487 * src/main.c (main): Adjust.
22488
22489 2001-09-23 Marc Autret <autret_m@epita.fr>
22490
22491 * src/files.c (compute_header_macro): Computes header macro name
22492 from spec_defines_file when given.
22493
22494 2001-09-23 Marc Autret <autret_m@epita.fr>
22495
22496 * src/files.c (output_files): Add default extensions.
22497
22498 2001-09-22 Akim Demaille <akim@epita.fr>
22499
22500 * src/conflicts.c (finalize_conflicts): Rename as...
22501 (free_conflicts): this.
22502
22503 2001-09-22 Akim Demaille <akim@epita.fr>
22504
22505 * src/gram.c (gram_free): Rename back as...
22506 (dummy): this.
22507 (output_token_translations): Free `token_translations'.
22508 * src/symtab.c (free_symtab): Free the tag field.
22509
22510 2001-09-22 Akim Demaille <akim@epita.fr>
22511
22512 Remove `translations' as it is always set to true.
22513
22514 * src/gram.h: Adjust.
22515 * src/reader.c (packsymbols, parse_token_decl): Adjust
22516 * src/print.c (print_grammar): Adjust.
22517 * src/output.c (output_token_translations): Adjust.
22518 * src/lex.c (lex): Adjust.
22519 * src/gram.c: Be sure the set pointers to NULL.
22520 (dummy): Rename as...
22521 (gram_free): this.
22522
22523 2001-09-22 Akim Demaille <akim@epita.fr>
22524
22525 * configure.in: Invoke AM_LIB_DMALLOC.
22526 * src/system.h: Use dmalloc.
22527 * src/LR0.c: Be sure to have pointers initialized to NULL.
22528 (allocate_itemsets): Allocate kernel_items only if needed.
22529
22530 2001-09-22 Akim Demaille <akim@epita.fr>
22531
22532 * configure.in: Bump to 1.29b.
22533 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
22534 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
22535 need xmalloc.c in calc.y.
22536 From Pascal Bart.
22537
22538 2001-09-21 Akim Demaille <akim@epita.fr>
22539
22540 Version 1.29a.
22541 * Makefile.maint, config/config.guess, config/config.sub,
22542 * config/missing: Update from masters.
22543 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
22544 upon package.m4.
22545 * configure.in (ALL_LINGUAS): Add `tr'.
22546
22547 2001-09-21 Akim Demaille <akim@epita.fr>
22548
22549 * tests/Makefile.am (package.m4): Move to...
22550 ($(srcdir)/$(TESTSUITE)): here.
22551
22552 2001-09-20 Akim Demaille <akim@epita.fr>
22553
22554 * src/complain.c: No longer try to be standalone: use system.h.
22555 Don't assume __STDC__ is defined to 1. Just test if it is defined.
22556 * src/complain.h: Likewise.
22557 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
22558 Remove the unused variable `n'.
22559 From Albert Chin-A-Young.
22560
22561 2001-09-18 Marc Autret <autret_m@epita.fr>
22562
22563 * doc/bison.1: Update.
22564 * doc/bison.texinfo (Bison Options): Update --defines and --graph
22565 descriptions.
22566 (Option Cross Key): Update.
22567 Add --graph.
22568
22569 2001-09-18 Marc Autret <autret_m@epita.fr>
22570
22571 * tests/regression.at: New test (comment in %union).
22572
22573 2001-09-18 Marc Autret <autret_m@epita.fr>
22574
22575 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
22576 do that.
22577 Reported by Keith Browne.
22578
22579 2001-09-18 Marc Autret <autret_m@epita.fr>
22580
22581 * tests/output.at: Add tests for --defines and --graph.
22582
22583 2001-09-18 Marc Autret <autret_m@epita.fr>
22584
22585 * tests/output.at: Removes tests of %{header,src}_extension features.
22586
22587 2001-09-18 Akim Demaille <akim@epita.fr>
22588
22589 * tests/Makefile.am (package.m4): New.
22590 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
22591 (_AT_CHECK_CALC_ERROR): Likewise.
22592 Factor the `, ' part of verbose error messages.
22593
22594 2001-09-18 Marc Autret <autret_m@epita.fr>
22595
22596 * src/getargs.c (longopts): Declare --defines and --graph as options
22597 with optional arguments.
22598 * src/files.h: Add extern declarations.
22599 * src/files.c (spec_graph_file, spec_defines_file): New.
22600 (output_files): Update.
22601 Remove CPP-outed code.
22602
22603 2001-09-18 Marc Autret <autret_m@epita.fr>
22604
22605 Turn off %{source,header}_extension feature.
22606
22607 * src/files.c (compute_exts_from_gf): Update.
22608 (compute_exts_from_src): Update.
22609 (output_files): CPP-out useless code.
22610 * src/files.h: Remove {header,source}_extension extern declarations.
22611 * src/reader.c (parse_dquoted_param): CPP-out.
22612 (parse_header_extension_decl): Remove.
22613 (parse_source_extension_decl): Remove.
22614 (read_declarations): Remove cases tok_{hdrext,srcext}.
22615 * src/lex.c (percent_table): Remove {header,source}_extension entries.
22616 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
22617
22618 2001-09-10 Akim Demaille <akim@epita.fr>
22619
22620 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
22621 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
22622 (AT_CHECK_OUTPUT): this.
22623 Merely check ls' exit status, its output is useless.
22624
22625 2001-09-10 Akim Demaille <akim@epita.fr>
22626
22627 * tests/calc.at: Use m4_match.
22628 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
22629
22630 2001-09-10 Marc Autret <autret_m@epita.fr>,
22631 Akim Demaille <akim@epita.fr>
22632
22633 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
22634 enum color_e.
22635 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
22636 to `normal'.
22637 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
22638 * src/lex.h: Adjust prototype.
22639 (token_t): Add `tok_undef'.
22640 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
22641 (parse_percent_token): Now returns token_t.
22642 Add default statement in switch.
22643 (lex): Separate `c' as an input variable, from the token_t result
22644 part.
22645 (unlexed): Is a token_t.
22646
22647 2001-09-10 Akim Demaille <akim@epita.fr>
22648
22649 * configure.in: Bump to 1.29a.
22650
22651 2001-09-07 Akim Demaille <akim@epita.fr>
22652
22653 Version 1.29.
22654
22655 2001-08-30 Akim Demaille <akim@epita.fr>
22656
22657 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
22658 * m4/atconfig.m4: Remove.
22659 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
22660 * tests/bison: New.
22661 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
22662 m4_if, m4_patsubst, and m4_regexp.
22663 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
22664 `input' file instead of echo.
22665
22666 2001-08-29 Akim Demaille <akim@epita.fr>
22667
22668 Bump to 1.28e.
22669
22670 2001-08-29 Akim Demaille <akim@epita.fr>
22671
22672 Version 1.28d.
22673
22674 2001-08-29 Paul Eggert <eggert@twinsun.com>
22675
22676 * src/bison.simple (yyparse): Don't take the address of an
22677 item before the start of an array, as that doesn't conform to
22678 the C Standard.
22679
22680 2001-08-29 Robert Anisko <anisko_r@epita.fr>
22681
22682 * doc/bison.texinfo (Location Tracking Calc): New node.
22683
22684 2001-08-29 Paul Eggert <eggert@twinsun.com>
22685
22686 * src/output.c (output): Do not define const, as this now
22687 causes more problems than it cures.
22688
22689 2001-08-29 Akim Demaille <akim@epita.fr>
22690
22691 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
22692 the nodes.
22693 Be sure to tag the `detailmenu'.
22694
22695 2001-08-29 Akim Demaille <akim@epita.fr>
22696
22697 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
22698 download in a tmp dir.
22699
22700 2001-08-28 Marc Autret <autret_m@epita.fr>
22701
22702 * config/depcomp: New file.
22703
22704 2001-08-28 Marc Autret <autret_m@epita.fr>
22705
22706 * doc/bison.1 (mandoc): Adjust.
22707 From Juan Manuel Guerrero.
22708
22709 2001-08-28 Marc Autret <autret_m@epita.fr>
22710
22711 * src/print_graph.c (print_state): Fix.
22712
22713 2001-08-27 Marc Autret <autret_m@epita.fr>
22714
22715 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
22716 char * members.
22717 Echo modifications to the functions prototypes.
22718 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
22719
22720 2001-08-27 Marc Autret <autret_m@epita.fr>
22721
22722 * src/vcg.c: Include `xalloc.h'.
22723 (add_colorentry): New.
22724 (add_classname): New.
22725 (add_infoname): New.
22726 * src/vcg.h: Add new prototypes.
22727
22728 2001-08-27 Akim Demaille <akim@epita.fr>
22729
22730 * Makefile.maint: Sync. again with CVS Autoconf.
22731
22732 2001-08-27 Akim Demaille <akim@epita.fr>
22733
22734 * Makefile.maint: Formatting changes.
22735 (po-update, cvs-update, update): New targets.
22736 (AMTAR): Remove.
22737
22738 2001-08-27 Akim Demaille <akim@epita.fr>
22739
22740 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22741 * Makefile.maint: Sync. with CVS Autoconf.
22742
22743 2001-08-27 Marc Autret <autret_m@epita.fr>
22744
22745 * src/vcg.h (struct infoname_s): New.
22746 (struct colorentry_s): New.
22747 (graph_s): New fields {vertical,horizontal}_order in structure.
22748 Add `infoname' field.
22749 Add `colorentry' field;
22750 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
22751 (G_HORIZONTAL_ORDER): New.
22752 (G_INFONAME): New.
22753 (G_COLORENTRY): New.
22754 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
22755 Add output of `infoname'.
22756 Add output of `colorentry'.
22757
22758 2001-08-27 Marc Autret <autret_m@epita.fr>
22759
22760 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
22761 This one shadowed a global parameter.
22762
22763 2001-08-24 Marc Autret <autret_m@epita.fr>
22764
22765 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
22766 instead of `unsigned'.
22767 (print_state): Do not call obstack_object_size () in obstack_grow ()
22768 to avoid macro variables shadowing.
22769
22770 2001-08-23 Marc Autret <autret_m@epita.fr>
22771
22772 * src/lex.c (percent_table): Typo: s/naem/name/.
22773 Add graph option.
22774 Normalize new options declarations.
22775
22776 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
22777
22778 * tests/suite.at: Exercise %header_extension and %source_extension.
22779
22780 2001-08-16 Marc Autret <autret_m@epita.fr>
22781
22782 * src/reader.c (parse_dquoted_param): New.
22783 (parse_header_extension_decl): Use it.
22784 (parse_source_extension_decl): Likewise.
22785
22786 2001-08-16 Marc Autret <autret_m@epita.fr>
22787
22788 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
22789 (get_xxxx_str): Use assert () instead of complain ().
22790 Remove return invokations in default cases.
22791 (get_decision_str): Modify default behaviour. Remove second argument.
22792 Echo modifications on calls.
22793 (output_graph): Fix.
22794
22795 2001-08-16 Marc Autret <autret_m@epita.fr>
22796
22797 * src/getargs.c (usage): Update with ``-g, --graph''.
22798
22799 2001-08-16 Marc Autret <autret_m@epita.fr>
22800
22801 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
22802 (Option Cross Key): Likewise.
22803 * doc/bison.1: Update.
22804
1c8c2190
PB
228052001-09-25 Pascal Bart <pascal.bart@epita.fr>
22806
22807 * src/output.c (output_master_parser): Don't finish action_obstack.
22808 (output_parser): Don't care about the muscle action, here.
22809 (prepare): Copy the action_obstack in the action muscle.
22810 (output): Free action_obstack.
22811
180d45ba
PB
228122001-09-23 Pascal Bart <pascal.bart@epita.fr>
22813
22814 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
22815 will contain `%union' declaration.
22816 (parse_union_decl): Delete #line directive output.
22817 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
22818 informations about %union.
22819 (parse_union_decl): Copy the union_obstack in the muscle stype.
22820 * src/bison.simple: Add new #line directive.
22821 Add typdef %%stype YYSTYPE.
22822
c51d1a19
PB
228232001-09-23 Pascal Bart <pascal.bart@epita.fr>
22824
22825 * src/bison.simple: Add new `#line' directive.
22826
6f9344da
PB
228272001-09-22 Pascal Bart <pascal.bart@epita.fr>
22828
22829 * src/bison.simple: New `#line' directive.
22830 * src/output.c (output_parser): Support new dynamic muscle input_line.
22831
652def80
MA
228322001-09-22 Marc Autret <autret_m@epita.fr>
22833
22834 * src/output.c (output_master_parser): New.
22835 (output_parser): Be more re-entrant.
22836
25b222fa
MA
228372001-09-21 Marc Autret <autret_m@epita.fr>
22838
22839 * src/reader.c (copy_definition, parse_union_decl): Update and use
22840 `linef' muscle.
22841 (copy_action): Likewise.
22842 Use obstack_1grow ().
22843 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
22844
6bc35ae5
MA
228452001-09-21 Marc Autret <autret_m@epita.fr>
22846
22847 * src/options.c (option_table): Adjust.
22848 * src/lex.c (parse_percent_token): Fix.
22849
c0629aa1
PB
228502001-09-20 Pascal Bart <pascal.bart@epita.fr>
22851
22852 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 22853
82b6d266
PB
228542001-09-20 Pascal Bart <pascal.bart@epita.fr>
22855
22856 * src/lex.c (parse_percent_token): Change type of variable `tx', which
22857 is now an option_table_struct*.
22858 (option_strcmp): New function option_strcmp.
22859 (parse_percent_token): Call option_strcmp.
22860 * src/getargs.c (xalloc.h, options.h): Include it.
22861 (getargs): Call create_long_option_table.
22862 (getargs): Free longopts at the end of the function.
22863 (shortopts): Move in options.c.
22864 * src/options.c (create_long_option_table): New function. Convert
22865 information from option_table to option structure.
22866 * src/reader.c (options.h): Include it.
22867
22868 * src/Makefile.am: Adjust.
22869 * src/options.c (option_table): Create from longopts and percent_table.
22870 * src/getargs.c (longopts): Delete.
22871 * src/lex.c (struct percent_table_struct): Delete.
22872 (percent_table): Delete.
22873 (options.h): Include it.
22874 * src/options.c: Create.
22875 * src/options.h: Create.
22876 Declare enum opt_access_e.
22877 Define struct option_table_struct.
22878
75f5aaea
MA
228792001-09-20 Marc Autret <autret_m@epita.fr>
22880
22881 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
22882 sections of Bison.
22883
f508cb0a
PB
228842001-09-19 Pascal Bart <pascal.bart@epita.fr>
22885
22886 * src/bison.simple: s/%%filename/%%skeleton.
22887 * src/muscle_tab.c (getargs.h): Include it.
22888 (muscle_init): Insert new muscle skeleton.
22889
13105fc1
PB
228902001-09-18 Pascal Bart <pascal.bart@epita.fr>
22891
22892 * src/output.c (output_parser): Delete unused variable actions_dumped.
22893
b0c4483e
PB
228942001-09-07 Pascal Bart <pascal.bart@epita.fr>
22895
22896 * src/output.c (output): Delete call to reader_output_yylsp.
22897 * src/reader.c (reader): Likewise.
ba0fe3c7 22898 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 22899
11d82f03
MA
229002001-09-02 Marc Autret <autret_m@epita.fr>
22901
22902 * src/reader.c: Include muscle_tab.h.
22903 (parse_union_decl): Update.
22904 (parse_macro_decl): Rename parse_muscle_decl.
22905 Update to use renamed functions and variable.
22906 (read_declarations, copy_action, read_additionnal_code, : Updated
22907 with correct variables and functions names.
22908 (packsymbols, reader): Likewise.
342b8b6e 22909
11d82f03 22910 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 22911
11d82f03
MA
22912 * src/output.c: Include muscle_tab.h
22913 In all functions using macro_insert, change by using muscle_insert ().
22914 (macro_obstack): Rename muscle_obstack.
22915 Echo modifications in the whole file.
22916 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
22917 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
22918 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
22919
22920 * src/muscle_tab.h: Update double inclusion macros.
22921 (macro_entry_s): Rename muscle_entry_s.
22922 Update prototypes.
342b8b6e 22923
11d82f03
MA
22924 * src/muscle_tab.c: Include muscle_tab.h.
22925 Rename macro_tabble to muscle_table.
22926 (mhash1, mhash2, mcmp): Use muscle_entry.
22927 (macro_init): Rename muscle_init. Update.
22928 (macro_insert): Rename muscle_insert. Update.
22929 (macro_find): Rename muscle_find. Update.
22930
22931 * src/main.c: Include muscle_tab.h.
22932 (main): Call muscle_init ().
22933 * src/Makefile.am (bison_SOURCES): Echo modifications.
22934
93a37297
MA
229352001-09-02 Marc Autret <autret_m@epita.fr>
22936
f753cd62 22937 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 22938
f753cd62
MA
22939 * src/muscle_tab.c, src/muscle_tab.h: Add files.
22940
229412001-09-02 Marc Autret <autret_m@epita.fr>
22942
22943 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 22944
682d48cd
PB
229452001-09-01 Pascal Bart <pascal.bart@epita.fr>
22946
342b8b6e 22947 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
22948 filename.
22949
087c8fda
MA
229502001-09-01 Marc Autret <autret_m@epita.fr>
22951
22952 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
22953 to an explicit value to activate the feature. We do it here.
22954
dda680cb
PB
229552001-08-31 Pascal Bart <pascal.bart@epita.fr>
22956
22957 * src/output.c (prepare): Delete the `filename' muscule insertion.
22958 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
22959 (parse_union_decl): Likewise.
22960 * src/macrotab.c (macro_init): Initialize filename by infile.
22961
9e644e64
MA
229622001-08-31 Marc Autret <autret_m@epita.fr>
22963
22964 * src/bison.simple (YYLSP_NEEDED): New definition.
22965 * src/output.c (prepare): Add macro insertion of `locations_flag'
22966
17da6427
PB
229672001-08-31 Pascal Bart <pascal.bart@epita.fr>
22968
22969 * src/output.c (prepare): Delete insertion of previous muscles,
22970 and insert the `prefix' muscles.
22971 * src/macrotab.c (macro_init): Likewise.
22972 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 22973 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
22974 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
22975 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 22976 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
22977 name_prefix.
22978
e8cb70b9
PB
229792001-08-31 Pascal Bart <pascal.bart@epita.fr>
22980
22981 * src/main.c (main): Standardize.
22982 * src/output.c (output_table_data, output_parser): Likewise.
22983 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
22984
63c2d5de
MA
229852001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
22986
342b8b6e 22987 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
22988 %%epilogue.
22989 * src/output.c (output): Rename %%declarations to %%prologue.
22990 * src/bison.simple: Echo modifications.
342b8b6e 22991
d8cb5183
MA
229922001-08-31 Marc Autret <autret_m@epita.fr>
22993
22994 * src/reader.c (readgram): CleanUp.
22995 (output_token_defines): Likewise.
22996 (packsymbols): Likewise.
22997 (reader): Likewise.
22998 * src/output.c (output): CPP-out useless code.
22999
6c686258
PB
230002001-08-31 Pascal Bart <pascal.bart@epita.fr>
23001
342b8b6e 23002 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
23003 output_trailers and output_headers.
23004 * src/output.h: Remove obsolete functions prototypes of output_headers
23005 and output_trailers.
23006
8f451ef7
PB
230072001-08-30 Pascal Bart <pascal.bart@epita.fr>
23008
23009 * src/main.c: Include macrotab.h.
342b8b6e 23010 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
23011 Adjust functions prototypes.
23012 * src/macrotab.c (macro_insert): Constify key and value.
23013 (macro_find): Constify key.
23014 (macro_insert): Include 'xalloc.h'
23015 (macro_insert): Use XMALLOC.
23016 (macro_find): Constify return value.
23017 * src/output.c (output_table_data): Rename table to table_data.
23018 (output_parser): Constify macro_key, macro_value.
23019
997b6fd0 230202001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
23021
23022 * src/reader.c (parse_skel_decl): New.
342b8b6e 23023 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
23024 * src/lex.h (token_t): New token `tok_skel'.
23025 * src/lex.c (percent_table): Add skeleton option entry.
23026 Standardize.
23027
ff48177d
MA
230282001-08-29 Marc Autret <autret_m@epita.fr>
23029
23030 * src/bison.simple: Add %%user_code directive at the end.
23031 * src/reader.c (read_additionnal_code): New.
23032 (reader): Use it.
23033 * src/output.c (output_program): Remove.
23034 (output): Update.
23035
b33160bf
MA
230362001-08-28 Marc Autret <autret_m@epita.fr>
23037
23038 * src/output.c (output_actions): Clean up.
4e5caae2 23039 (output_gram): CPP-out useless code.
b33160bf
MA
23040 * src/reader.c (reader): Clean up, CPP-out useless code.
23041
d1a2daf7
PB
230422001-08-28 Pascal Bart <pascal.bart@epita.fr>
23043
342b8b6e 23044 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 23045 directive.
d1a2daf7
PB
23046 * src/bison.simple: Add `%%definitions'.
23047
2b763dfe
MA
230482001-08-28 Marc Autret <autret_m@epita.fr>
23049
23050 * config/depcomp: New file.
23051
f1a87ef6
PE
230522001-08-27 Paul Eggert <eggert@twinsun.com>
23053
23054 * src/bison.simple (yyparse): Don't take the address of an
23055 item before the start of an array, as that doesn't conform to
23056 the C Standard.
23057
82e236e2
RA
230582001-08-27 Robert Anisko <robert.anisko@epita.fr>
23059
f1a87ef6 23060 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
23061 obstack. It was done too late here.
23062
23063 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
23064 completely wrong.
23065 (reader): Initialize the macro obstack here, since we need it to grow
23066 '%define' directives.
23067
23068 * src/reader.h: Declare the macro obstack as extern.
23069
b0cfa28a
RA
230702001-08-27 Robert Anisko <robert.anisko@epita.fr>
23071
23072 * src/output.c (output_parser): Fix. Store single '%' characters in
23073 the output obstack instead of throwing them away.
23074
6fc74234
AD
230752001-08-27 Akim Demaille <akim@epita.fr>
23076
23077 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23078
9c76d118
RA
230792001-08-25 Robert Anisko <robert.anisko@epita.fr>
23080
23081 * lib/Makefile.am: Adjust.
23082
a8289c62
RA
230832001-08-25 Robert Anisko <robert.anisko@epita.fr>
23084
23085 * src/bison.simple: Update and add '%%' directives.
23086
b6610515
RA
230872001-08-25 Robert Anisko <robert.anisko@epita.fr>
23088
23089 * src/reader.c (reader): Remove calls to 'output_headers' and
23090 'output_trailers'. Remove some C output.
23091 (readgram): Disable a piece of code that was writing a default
23092 definition for 'YYSTYPE'.
23093 (reader_output_yylsp): Remove.
23094 (packsymbols): Output token defintions to a macro.
23095 (copy_definition): Disable C output.
6fc74234 23096
b6610515
RA
23097 * src/reader.c (parse_macro_decl): New function used to parse macro
23098 declarations.
23099 (copy_string2): Put the body of copy_string into this new function.
23100 Add a parameter to let the caller choose whether he wants to copy the
23101 string delimiters or not.
23102 (copy_string): Be a simple call to copy_string2 with the last argument
23103 bound to true.
23104 (read_declarations): Add case for macro definition.
23105 (copy_identifier): New.
6fc74234 23106 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
23107 rather than lex.
23108
26f609ff
RA
231092001-08-25 Robert Anisko <robert.anisko@epita.fr>
23110
23111 * src/output.c (prepare): Add prefixed names.
23112 (output_parser): Output semantic actions.
23113 (output_parser): Fix bug on '%%line' directives.
6fc74234 23114
26f609ff
RA
23115 * src/output.c (output_headers): Remove. The C code printed by this
23116 function should now be in the skeletons.
23117 (output_trailers): Remove.
23118 (output): Disable call to 'reader_output_yylsp'.
23119 (output_rule_data): Do not output tables to the table obstack.
23120
23121 * src/output.c: Remove some C dedicated output.
23122 Improve the use of macro and output obstacks.
23123 (output_defines): Remove.
6fc74234 23124
26f609ff
RA
23125 * src/output.c (output_token_translations): Associate 'translate'
23126 table with a macro. No output to the table obstack.
23127 (output_gram): Same for 'rhs' and 'prhs'.
23128 (output_stos): Same for 'stos'.
23129 (output_rule_data): Same for 'r1' and 'r2'.
23130 (token_actions): Same for 'defact'.
23131 (goto_actions): Same for 'defgoto'.
23132 (output_base): Same for 'pact' and 'pgoto'.
23133 (output_table): Same for 'table'.
23134 (output_check): Same for 'check'.
6fc74234 23135
26f609ff
RA
23136 * src/output.c (output_table_data): New function.
23137 (output_short_table): Remove.
23138 (output_short_or_char_table): Remove.
6fc74234 23139
26f609ff
RA
23140 * src/output.c (output_parser): Replace most of the skeleton copy code
23141 with something new. Skeletons are now processed character by character
23142 rather than line by line, and Bison looks for '%%' macros. This is the
23143 first step in making Bison's output process (a lot) more flexible.
23144 (output_parser): Use the macro table.
23145
6f43b113
RA
231462001-08-25 Robert Anisko <robert.anisko@epita.fr>
23147
23148 * src/main.c (main): Initialize the macro table.
23149
dd3127cf
RA
231502001-08-25 Robert Anisko <robert.anisko@epita.fr>
23151
23152 * src/lex.c (percent_table): Add tok_define.
23153 * src/lex.h: Add tok_define.
23154
aa321494
RA
231552001-08-25 Robert Anisko <robert.anisko@epita.fr>
23156
23157 * src/macrotab.c: New file.
23158 * src/macrotab.h: New file.
23159 * src/Makefile.am: Update.
23160
68bd3b6b
RA
231612001-08-25 Robert Anisko <robert.anisko@epita.fr>
23162
23163 * lib/hash.c: New file.
23164 * lib/hash.h: New file.
23165 * lib/Makefile.am: Update.
23166
45f8dd1e
AD
231672001-08-15 Akim Demaille <akim@epita.fr>
23168
23169 Version 1.28c.
23170
40a64a7a 231712001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
23172
23173 * src/reader.c (readgram): Indent output macro YYSTYPE.
23174 (packsymbols): Likewise.
23175 (output_token_defines): Likewise.
23176 * src/files.c: Standardize.
23177 (compute_header_macro): New.
23178 (defines_obstack_save): New. Use compute_header_macro.
23179 (output_files): Update. Use defines_obstack_save.
23180
f9a8293a
AD
231812001-08-15 Akim Demaille <akim@epita.fr>
23182
23183 * doc/bison.texinfo (Table of Symbols): Document
23184 YYSTACK_USE_ALLOCA.
23185
150ca7a7
AD
231862001-08-15 Akim Demaille <akim@epita.fr>
23187
23188 * missing: Update from CVS Automake.
23189 * config/config.guess, config/config.sub, config/texinfo.tex:
23190 Update from gnu.org.
23191
69b5cec4
AD
231922001-08-15 Akim Demaille <akim@epita.fr>
23193
23194 * Makefile.maint: Sync with CVS Autoconf.
23195
f2b5126e
PB
231962001-08-14 Pascal Bart <pascal.bart@epita.fr>
23197
69b5cec4 23198 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
23199 `fdl.texi'.
23200 * doc/fdl.texi: Add to package.
23201
4ecbf796
MA
232022001-08-14 Marc Autret <autret_m@epita.fr>
23203
23204 Turn on %{source,header}_extension features.
23205
69b5cec4 23206 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
23207 source_extension.
23208 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 23209 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
23210 between options.
23211
95fb5662
MA
232122001-08-14 Marc Autret <autret_m@epita.fr>
23213
23214 * src/files.c (compute_base_names): Add extensions computing when
23215 `--file-prefix' used.
23216 Standardize function calls.
23217
78d09da9
MA
232182001-08-13 Marc Autret <autret_m@epita.fr>
23219
69b5cec4 23220 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
23221 defining it (defined but null disables alloca).
23222
5a009f2c
MA
232232001-08-13 Marc Autret <autret_m@epita.fr>
23224
23225 * src/bison.simple (_yy_memcpy): CPP reformat.
23226
1e41465a
PB
232272001-08-13 Pascal Bart <pascal.bart@epita.fr>
23228
23229 * tests/atconfig.in (CPPFLAGS): Fix.
23230
c67a198d
PB
232312001-08-10 Pascal Bart <pascal.bart@epita.fr>
23232
79282c6c 23233 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
23234 `gpl.texi'.
23235 * doc/gpl.texi: Add to package.
23236
09a6de7e
MA
232372001-08-10 Marc Autret <autret_m@epita.fr>
23238
23239 * src/print_graph.h: Fix.
23240 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
23241
b77b9ee0
AD
232422001-08-10 Akim Demaille <akim@epita.fr>
23243
23244 * src/system.h: Provide default declarations for stpcpy, strndup,
23245 and strnlen.
23246
3e259915
MA
232472001-08-10 Robert Anisko <anisko_r@epita.fr>
23248
23249 * doc/bison.texinfo (Locations): Update @$ stuff.
23250
ca96bc2d
MA
232512001-08-09 Robert Anisko <anisko_r@epita.fr>
23252
23253 * src/bison.simple (YYLLOC_DEFAULT): Update.
23254 (yyparse): Adjust.
23255
fdc6758b
MA
232562001-08-08 Marc Autret <autret_m@epita.fr>
23257
b77b9ee0 23258 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
23259 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
23260 Reported by Fabrice Bauzac.
957d4dbf 23261
600cad3b
MA
232622001-08-08 Marc Autret <autret_m@epita.fr>
23263
23264 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
23265 * src/vcg.c (output_node): Fix.
23266 * src/vcg.h: Cleanup.
23267 * src/print_graph.c: Add comments.
b77b9ee0 23268 (node_output_size): New global variable. Simplify the formatting of
600cad3b 23269 the VCG graph output.
b77b9ee0 23270 (print_actions): Unused code is now used. It notifies the final state
600cad3b 23271 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 23272 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
23273 blue.
23274 Get the current node name and node_obstack by argument.
23275 (node_obstack): New variable.
23276 (print_state): Manage node_obstack.
23277 (print_core): Use node_obstack given by argument.
23278 A node is not only computed here but in print_actions also.
23279 (print_graph): CPP out useless code instead of commenting it.
23280
976e528f
AD
232812001-08-07 Pascal Bart <pascal.bart@epita.fr>
23282
23283 * tests/atconfig.in (CPPFLAGS): Fix.
23284
20e8e5ca
AD
232852001-08-07 Akim Demaille <akim@epita.fr>
23286
23287 * src/print_graph.c (quote): New.
23288 (print_core): Use it.
23289
957d4dbf 232902001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 23291
3e3da797
AD
23292 * src/vcg.c (complain.h): Include it.
23293 Unepitaize `return' invocations.
c4b66126 23294 [NDEBUG] (main): Remove.
79282c6c 23295 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
23296 * src/files.c (open_files): Initialize graph_obstack.
23297 * src/print_graph.c (print_actions): CPP out useless code.
23298 (print_core): Don't output the last `\n' in labels.
23299 Use `quote'.
23300 * src/files.c (output_files): Output the VCG file.
23301 * src/main.c (main): Invoke print_graph ();
3e3da797 23302
957d4dbf 233032001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
23304
23305 Automaton VCG graph output.
23306 Using option ``-g'' or long option ``--graph'', you can generate
23307 a gram_filename.vcg file containing a VCG description of the LALR (1)
23308 automaton of your grammar.
23309
23310 * src/main.c: Call to print_graph() function.
23311 * src/getargs.h: Update.
23312 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
23313 (graph_flag): New flag.
23314 (longopts): Update.
23315 (getargs): Add case `g'.
23316 * src/files.c (graph_obstack): New obstack struct.
23317 (open_files): Initialize new obstack.
23318 (output_files): Saves graph_obstack if required.
23319 * src/files.h (graph_obstack): New extern declaration.
23320 * src/Makefile.am: Add new source files.
23321
927c1557 233222001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
23323
23324 * src/print_graph.c, src/print_graph.h (graph): New.
23325 * src/vcg.h: New file.
23326 * src/vcg.c: New file, VCG graph handling.
23327
7333d403
AD
233282001-08-06 Marc Autret <autret_m@epita.fr>
23329
23330 Add of %source_extension and %header_extension which specify
23331 the source or/and the header output file extension.
23332
23333 * src/files.c (compute_base_names): Remove initialisation of
23334 src_extension and header_extension.
23335 (compute_exts_from_gf): Update.
23336 (compute_exts_from_src): Update.
23337 (output_files): Update.
23338 * src/reader.c (parse_header_extension_decl): New.
23339 (parse_source_extension_decl): New.
23340 (read_declarations): New case statements for the new tokens.
23341 * src/lex.c (percent_table): Add entries for %source_extension
23342 and %header_extension.
23343 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
23344
84163231
AD
233452001-08-06 Marc Autret <autret_m@epita.fr>
23346
23347 * configure.in: Bump to 1.28c.
23348 * doc/bison.texinfo: Texinfo thingies.
23349
8303fc42
AD
233502001-08-04 Pascal Bart <pascal.bart@epita.fr>
23351
23352 * tests/atconfig.in (CPPFLAGS): Add.
23353 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
23354
70a84437
AD
233552001-08-03 Akim Demaille <akim@epita.fr>
23356
23357 Version 1.28b.
23358
2ce10144
AD
233592001-08-03 Akim Demaille <akim@epita.fr>
23360
23361 * tests/Makefile.am (check-local): Ship testsuite.
23362 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
23363 Include `string.h'.
23364
1e3e4bc1
AD
233652001-08-03 Akim Demaille <akim@epita.fr>
23366
23367 * configure.in: Try using -Wformat when compiling.
23368
42b45b7f
AD
233692001-08-03 Akim Demaille <akim@epita.fr>
23370
23371 * configure.in: Bump to 1.28b.
23372
8f13fe33
AD
233732001-08-03 Akim Demaille <akim@epita.fr>
23374
23375 * src/complain.c: Adjust strerror_r portability issues.
23376
b37ba92c
AD
233772001-08-03 Akim Demaille <akim@epita.fr>
23378
23379 Version 1.28a.
23380
b0ce6046
AD
233812001-08-03 Akim Demaille <akim@epita.fr>
23382
23383 * src/getargs.c, src/getarg.h (skeleton)): Constify.
23384 * src/lex.c (literalchar): Avoid name clashes on `buf'.
23385 * src/getargs.c: Include complain.h.
23386 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
23387 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
23388
d01c415b
AD
233892001-08-03 Akim Demaille <akim@epita.fr>
23390
23391 * src/reader.c (readgram): Display hidden chars in error messages.
23392
459dd1a6
AD
233932001-08-03 Akim Demaille <akim@epita.fr>
23394
23395 Update to gettext 0.10.39.
23396
53b74c0c
AD
233972001-08-03 Akim Demaille <akim@epita.fr>
23398
23399 * lib/strspn.c: New.
23400
234a3be3
AD
234012001-08-01 Marc Autret <autret_m@epita.fr>
23402
23403 * doc/bison.texinfo: Update.
23404 * doc/bison.1 (mandoc): Update.
23405 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
23406 * src/files.c: Support output files extensions computing.
23407 (src_extension): New static variable.
23408 (header_extension): New static variable.
23409 (tr): New function.
23410 (get_extension_index): New function, gets the index of an extension
23411 filename in a string.
23412 (compute_exts_from_gf): New function, computes extensions from the
23413 grammar file extension.
23414 (compute_exts_from_src): New functions, computes extensions from the
23415 C source file extension, file given by ``-o'' option.
23416 (compute_base_names): Update.
23417 (output_files): Update.
23418
847bf1f5
AD
234192001-08-01 Robert Anisko <anisko_r@epita.fr>
23420
d995fee7 23421 * doc/bison.texi: Document @$.
847bf1f5
AD
23422 (Locations): New section.
23423
d074a105
AD
234242001-07-18 Akim Demaille <akim@epita.fr>
23425
23426 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
23427 * config/prev-version.txt, config/move-if-change: New.
23428 * Makefile.am: Adjust.
23429
3419715d
AD
234302001-07-08 Pascal Bart <pascal.bart@epita.fr>
23431
23432 * src/bison.simple (yyparse): Suppress warning `comparaison
23433 between signed and unsigned'.
23434
62ab6972
AD
234352001-07-05 Pascal Bart <pascal.bart@epita.fr>
23436
23437 * src/getargs.h (raw_flag): Remove.
23438 * src/getargs.c: Die on `-r'/`--raw'.
23439 * src/lex.c (parse_percent_token): Die on `%raw'.
23440 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
23441 * tests/calc.at: Suppress test with option `--raw'.
23442
1e24cc5b
AD
234432001-07-14 Akim Demaille <akim@epita.fr>
23444
23445 * config/: New.
23446 * configure.in: Require Autoconf 2.50.
23447 Update to gettext 0.10.38.
23448
32dfccf8
AD
234492001-03-16 Akim Demaille <akim@epita.fr>
23450
23451 * doc/bison.texinfo: ANSIfy the examples.
23452
cd5bd6ac
AD
234532001-03-16 Akim Demaille <akim@epita.fr>
23454
23455 * getargs.c (skeleton): New variable.
23456 (longopts): --skeleton is a new option.
23457 (shortopts, getargs): -S is a new option.
23458 * getargs.h: Declare skeleton.
23459 * output.c (output_parser): Use it.
23460
5141b016
AD
234612001-03-16 Akim Demaille <akim@epita.fr>
23462
23463 * m4/strerror_r.m4: New.
23464 * m4/error.m4: Run AC_FUNC_STRERROR_R.
23465 * lib/error.h, lib/error.c: Update.
23466
447992b9
AD
234672001-03-16 Akim Demaille <akim@epita.fr>
23468
23469 * src/getargs.c (longopts): Clean up.
23470
274d42ce
AD
234712001-02-21 Akim Demaille <akim@epita.fr>
23472
23473 * src/reader.c (gensym): `gensym_count' is your own.
23474 Use a static buf to create the symbol name, as token_buffer is no
23475 longer a buffer.
23476
22c821f3
AD
234772001-02-08 Akim Demaille <akim@epita.fr>
23478
23479 * src/conflicts.c (conflict_report): Be sure not to append to res
23480 between two calls, which could happen if both first sprintf were
23481 skipped, but not the first cp += strlen.
23482
18569462
AD
234832001-02-08 Akim Demaille <akim@epita.fr>
23484
23485 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
23486 New, from fileutils 4.0.37.
23487 * configure.in: Require Autoconf 2.49c. I took some time before
23488 making this decision. This is the only way out for portability
23489 issues in Bison, it would mean way too much duplicate effort to
23490 import in Bison features implemented in 2.49c since 2.13.
23491 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
23492
0d8f3c8a
AD
234932001-02-02 Akim Demaille <akim@epita.fr>
23494
23495 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 23496 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 23497
f17bcd1f
AD
234982001-01-19 Akim Demaille <akim@epita.fr>
23499
23500 Get rid of the ad hoc handling of token_buffer in the scanner: use
23501 the obstacks.
23502
23503 * src/lex.c (token_obstack): New.
23504 (init_lex): Initialize it. No longer call...
23505 (grow_token_buffer): this. Remove it.
23506 Adjust all the places which used it to use the obstack.
23507
511e79b3
AD
235082001-01-19 Akim Demaille <akim@epita.fr>
23509
23510 * src/lex.h: Rename all the tokens:
23511 s/\bENDFILE\b/tok_eof/g;
23512 s/\bIDENTIFIER\b/tok_identifier/g;
23513 etc.
23514 Let them be enums, not #define, to ease debugging.
23515 Adjust all the code.
23516
0d6508ef
AD
235172001-01-18 Akim Demaille <akim@epita.fr>
23518
23519 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
23520 * src/lex.c (maxtoken, grow_token_buffer): Static.
23521
6deb4447
AD
235222001-01-18 Akim Demaille <akim@epita.fr>
23523
23524 Since we now use obstacks, more % directives can be enabled.
23525
23526 * src/lex.c (percent_table): Also accept `%yacc',
23527 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
23528 `%debug'.
23529 Handle the actions for `%semantic_parser' and `%pure_parser' here,
23530 instead of returning a token.
23531 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
23532 * src/reader.c (read_declarations): Adjust.
23533 * src/files.c (open_files): Don't call `compute_base_names', don't
23534 compute `attrsfile' since they depend upon data which might be
23535 *in* the input file now.
23536 (output_files): Do it here.
23537 * src/output.c (output_headers): Document the fact that this patch
23538 introduces a guaranteed SEGV for semantic parsers.
23539 * doc/bison.texinfo: Document them.
23540 * tests/suite.at: Exercise these %options.
23541
ff4423cc
AD
235422000-12-20 Akim Demaille <akim@epita.fr>
23543
23544 Also handle the output file (--verbose) with obstacks.
23545
23546 * files.c (foutput): Remove.
23547 (output_obstack): New.
23548 Adjust all dependencies.
23549 * src/conflicts.c: Return a string.
23550 * src/system.h (obstack_grow_string): Rename as...
23551 (obstack_sgrow): this. Be ready to work with non literals.
23552 (obstack_fgrow4): New.
23553
956dba3a
AD
235542000-12-20 Akim Demaille <akim@epita.fr>
23555
23556 * src/files.c (open_files): Fix the computation of short_base_name
23557 in the case of `-o foo.tab.c'.
23558
337bab46
AD
235592000-12-20 Akim Demaille <akim@epita.fr>
23560
23561 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
23562 (copy_dollar): Now that everything uses obstacks, get rid of the
23563 FILE * parameters.
23564
5d3214b8
AD
235652000-12-20 Akim Demaille <akim@epita.fr>
23566
23567 * src/files.c (open_files): Actually the `.output' file is based
23568 on the short_base_name, not base_name.
23569 * tests/suite.at (Checking output file names): Adjust.
23570
29092a57
AD
235712000-12-20 Akim Demaille <akim@epita.fr>
23572
23573 * src/bison.s1: Remove, we now use directly...
23574 * src/bison.simple: this.
23575 * src/Makefile.am: Use pkgdata instead of data.
23576
ea5607fd
AD
235772000-12-20 Akim Demaille <akim@epita.fr>
23578
23579 * src/files.c (guard_obstack): New.
23580 (open_files): Initialize it.
23581 (output_files): Dump it...
23582 * src/files.h: Export it.
23583 * src/reader.c (copy_guard): Use it.
23584
27110317
AD
235852000-12-19 Akim Demaille <akim@epita.fr>
23586
23587 * src/files.c (outfile, defsfile, actfile): Removed as global
23588 vars.
23589 (open_files): Don't compute them.
23590 (output_files): Adjust.
23591 (base_name, short_base_name): Be global.
23592 Adjust dependencies.
23593
19c50364
AD
235942000-12-19 Akim Demaille <akim@epita.fr>
23595
23596 * src/files.c (strsuffix): New.
23597 (stringappend): Be just like strcat but allocate.
23598 (base_names): Eve out from open_files.
23599 Try to simplify the rather hairy computation of base_name and
23600 short_base_name.
23601 (open_files): Use it.
23602 * tests/suite.at (Checking output file names): New test.
23603
573c1d9f
AD
236042000-12-19 Akim Demaille <akim@epita.fr>
23605
23606 * src/system.h (obstack_grow_literal_string): Rename as...
23607 (obstack_grow_string): this.
23608 * src/output.c (output_parser): Recognize `%% actions' instead of
23609 `$'.
23610 * src/bison.s1: s/$/%% actions/.
23611 * src/bison.hairy: Likewise.
23612
ef7ddedd
AD
236132000-12-19 Akim Demaille <akim@epita.fr>
23614
23615 * src/output.c (output_parser): Compute the `#line' lines when
23616 there are.
23617 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
23618 Suggested by Hans Aberg.
23619
ff61dabd
AD
236202000-12-19 Akim Demaille <akim@epita.fr>
23621
23622 Let the handling of the skeleton files be local to the procedures
23623 that use it.
23624
23625 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
23626 longer static.
23627 (fparser, open_extra_files): Remove.
23628 (open_files, output_files): Don't take care of fparser.
23629 * src/files.h: Adjust.
23630 * src/output.c (output_parser): Open and close the file to the
23631 skeleton.
23632 * src/reader.c (read_declarations): When %semantic_parser, open
23633 fguard.
23634
55b96341
AD
236352000-12-19 Akim Demaille <akim@epita.fr>
23636
23637 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
23638 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
23639
358c15b7
AD
236402000-12-19 Akim Demaille <akim@epita.fr>
23641
23642 * src/files.c (open_files): Yipee! We no longer need all the code
23643 looking for `/tmp' since we have no tmp file.
23644
7de3329e
AD
236452000-12-19 Akim Demaille <akim@epita.fr>
23646
23647 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
23648 New macros.
23649 * src/files.c (open_files): Less dependency on MSDOS etc.
23650
3abcd459
AD
236512000-12-14 Akim Demaille <akim@epita.fr>
23652
23653 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
23654 Provide a default definition.
23655 Use it when executing the default @ action.
23656 * src/reader.c (reader_output_yylsp): No longer include
23657 `timestamp' and `text' in the default YYLTYPE.
23658
2a91a95e
AD
236592000-12-12 Akim Demaille <akim@epita.fr>
23660
23661 * src/reader.c (copy_definition, parse_union_decl, copy_action)
23662 (copy_guard): Quote the file names.
23663 Reported by Laurent Mascherpa.
23664
14d3eb9b
AD
236652000-12-12 Akim Demaille <akim@epita.fr>
23666
23667 * src/output.c (output_headers, output_program, output): Be sure
23668 to escape special characters when outputting filenames.
23669 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
23670 (output_headers): Don't depend on them, Use ACTSTR.
23671
d7045ec6
AD
236722000-11-17 Akim Demaille <akim@epita.fr>
23673
23674 * lib/obstack.h: Formatting changes.
23675 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
23676 prevents type checking.
23677 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
23678 cast the value to (void *): assigning a `foo *' to a `void *'
23679 variable is valid.
23680 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
23681 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
23682 append characters.
23683
6fd54b73
AD
236842000-11-17 Akim Demaille <akim@epita.fr>
23685
23686 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
23687 as...
23688 (suite.m4, regression.m4, calc.m4): these.
23689 * tests/atgeneral.m4: Update from CVS Autoconf.
23690
4c50eae6
AD
236912000-11-17 Akim Demaille <akim@epita.fr>
23692
23693 * tests/regression.m4 (%union and --defines): New test,
23694 demonstrating a current bug in the obstack implementation.
23695
a35f64ea
AD
236962000-11-17 Akim Demaille <akim@epita.fr>
23697
23698 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
23699 macros.
23700 Use them to declare the variables which are global or local to
23701 `yyparse'.
23702
7de23534
AD
237032000-11-17 Akim Demaille <akim@epita.fr>
23704
23705 * acconfig.h: Remove, no longer used.
23706
aa7815f5
AD
237072000-11-07 Akim Demaille <akim@epita.fr>
23708
23709 * src: s/Copyright (C)/Copyright/g.
23710
5af1f549
AD
237112000-11-07 Akim Demaille <akim@epita.fr>
23712
23713 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
23714 defining.
23715 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
23716
553e2b22
AD
237172000-11-07 Akim Demaille <akim@epita.fr>
23718
23719 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
23720 Merge in a single CPP if/else.
23721
8a4f41d6
AD
237222000-11-07 Akim Demaille <akim@epita.fr>
23723
23724 * src/output.c (output): Remove useless variables.
23725 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
23726 argument `data' for consistency with the prototypes.
23727 Qualify it `const'.
23728 (obstack_copy, obstack_copy0): Rename the second argument as
23729 `address' for consistency. Qualify it `const'.
23730 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
23731 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
23732 `const' their input argument (`data' or `address').
23733 Adjust the corresponding macros to include `const' in casts.
23734
095a3fb5
AD
237352000-11-03 Akim Demaille <akim@epita.fr>
23736
23737 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
23738 s/PFILE1/BISON_HAIRY/.
23739 Adjust dependencies.
23740
d1cdce7c
AD
237412000-11-03 Akim Demaille <akim@epita.fr>
23742
090c5ebf 23743 For some reason, this was not applied.
d1cdce7c
AD
23744
23745 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23746 `unlink': it's no longer used.
23747
9311529b
AD
237482000-11-03 Akim Demaille <akim@epita.fr>
23749
23750 * src/files.c (skeleton_find): New function, eved out of...
23751 (open_files, open_extra_files): here.
23752
d8880f69
AD
237532000-11-03 Akim Demaille <akim@epita.fr>
23754
23755 Don't use `atexit'.
23756
23757 * src/files.c (obstack_save): New function.
23758 (done): Rename as...
23759 (output_files): this.
23760 Use `obstack_save'.
23761 * src/main.c (main): Don't use `atexit' to register `done', since
23762 it no longer has to remove tmp files, just call `output_files'
23763 when there are no errors.
23764
0dbb648e
AD
237652000-11-02 Akim Demaille <akim@epita.fr>
23766
23767 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23768 `unlink': it's no longer used.
23769 * src/files.h: Formatting changes.
23770
896fe5c1
AD
237712000-11-02 Akim Demaille <akim@epita.fr>
23772
23773 Remove the last uses of mktemp and unlink/delete.
23774
23775 * src/files.c (fdefines, ftable): Removed.
23776 (defines_ostack, table_obstack): New.
23777 Adjust dependencies of the former into uses of the latter.
23778 * src/output.c (output_short_or_char_table, output_short_table):
23779 Convert to using obstacks.
23780 * src/reader.c (copy_comment2): Accept one FILE * and two
23781 obstacks.
23782 (output_token_defines, reader_output_yylsp): Use obstacks.
23783 * src/system.h (obstack_fgrow3): New.
1f65350a 23784 * po/POTFILES.in: Adjust.
896fe5c1 23785
dd60faec
AD
237862000-11-01 Akim Demaille <akim@epita.fr>
23787
23788 Change each use of `fattrs' into a use of `attrs_obstack'.
23789
23790 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
23791 * src/files.c (fattrs): Remove.
23792 (attrs_obstack): New.
23793 Adjust all dependencies.
23794 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
23795
8c7ebe49
AD
237962000-11-01 Akim Demaille <akim@epita.fr>
23797
23798 Introduce obstacks.
23799 Change each use of `faction' into a use of `action_obstack'.
23800
23801 * lib/obstack.h, lib/obstack.c: New files.
23802 * src/files.c (faction): Remove.
23803 (action_obstack): New.
23804 Adjust all dependencies.
23805
77aee789
AD
238062000-10-20 Akim Demaille <akim@epita.fr>
23807
23808 * lib/quote.h (PARAMS): New macro. Use it.
23809
43591cec
AD
238102000-10-16 Akim Demaille <akim@epita.fr>
23811
23812 * src/output.c (output_short_or_char_table): New function.
23813 (output_short_table, output_token_translations): Use it.
23814 (goto_actions): Use output_short_table.
23815
1e9798d5
AD
238162000-10-16 Akim Demaille <akim@epita.fr>
23817
23818 * src/symtab.c (bucket_new): New function.
23819 (getsym): Use it.
23820
23821 * src/output.c (output_short_table): New argument to display the
23822 comment associated with the table.
23823 Adjust dependencies.
23824 (output_gram): Use it.
23825 (output_rule_data): Nicer output layout for YYTNAME.
23826
f282676b
AD
238272000-10-16 Akim Demaille <akim@epita.fr>
23828
23829 * src/lex.c (read_typename): New function.
23830 (lex): Use it.
23831 * src/reader.c (copy_dollar): Likewise.
23832
550a72a3
AD
238332000-10-16 Akim Demaille <akim@epita.fr>
23834
23835 * src/reader.c (copy_comment2): Expect the input stream to be on
23836 the `/' which is suspected to open a comment, instead of being
23837 called after `//' or `/*' was read.
23838 (copy_comment, copy_definition, parse_union_decl, copy_action)
23839 (copy_guard): Adjust.
23840
131e2fef
AD
238412000-10-16 Akim Demaille <akim@epita.fr>
23842
23843 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
23844 `read_signed_integer'.
23845
79282c5a
AD
238462000-10-16 Akim Demaille <akim@epita.fr>
23847
23848 * src/reader.c (copy_dollar): New function.
23849 (copy_guard, copy_action): Use it.
23850
ff4a34be
AD
238512000-10-16 Akim Demaille <akim@epita.fr>
23852
23853 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
23854 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
23855 New files, from Fileutils 4.0.27.
23856 * src/main.c (printable_version): Remove.
23857 * src/lex.c, src/reader.c: Use `quote'.
23858
238592000-10-04 Akim Demaille <akim@epita.fr>
23860
23861 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
23862
14ded682
AD
238632000-10-04 Akim Demaille <akim@epita.fr>
23864
23865 * doc/bison.texinfo: Various typos spotted by Neil Booth.
23866
8e03724b
AD
238672000-10-04 Akim Demaille <akim@epita.fr>
23868
23869 When a literal string is used to define two different tokens,
23870 `bison -v' segfaults.
23871 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
23872
23873 * tests/regression.m4: New file.
23874 Include the core of the sample provided by Piotr Gackiewicz.
23875 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
23876 properly.
23877
a9e64249
AD
238782000-10-04 Akim Demaille <akim@epita.fr>
23879
23880 * src/reader.c (parse_expect_decl): Keep `count' within the size
23881 of `buffer'.
23882 From Neil Booth.
23883
da9abf43
AD
238842000-10-02 Paul Eggert <eggert@twinsun.com>
23885
23886 * bison.s1 (yyparse): Assign the default value
23887 unconditionally, to avoid a GCC warning and make the parser a
23888 tad smaller.
23889
c33638bb
AD
238902000-10-02 Akim Demaille <akim@epita.fr>
23891
23892 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
23893 options.
23894
444c570a
AD
238952000-10-02 Akim Demaille <akim@epita.fr>
23896
23897 * src/derives.c, src/print.c, src/reduce.c: To ease the
23898 translation, move some `\n' out of the translated strings.
23899
89cab50d
AD
239002000-10-02 Akim Demaille <akim@epita.fr>
23901
23902 The location tracking mechanism is precious for parse error
23903 messages. Nevertheless, it is enabled only when `@n' is used in
23904 the grammar, which is a different issue (you can use it in error
23905 message, but not in the grammar per se). Therefore, there should
23906 be another means to enable it.
23907
23908 * src/getargs.c (getargs): Support `--locations'.
23909 (usage): Report it.
23910 * src/getargs.h (locationsflag): Export it.
23911 * src/lex.c (percent_table): Support `%locations'.
23912 * src/reader.c (yylsp_needed): Remove this variable, now replaced
23913 with `locationsflag'.
23914 * doc/bison.texinfo: Document `--locations' and `%locations'.
23915 Sort the options.
23916 * tests/calc.m4: Test it.
23917
23918 For regularity of the names, replace each
23919 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
23920 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
23921 In addition replace each `flag' with `_flag'.
23922
d6c2cba0
AD
239232000-10-02 Akim Demaille <akim@epita.fr>
23924
23925 Also test parse error messages, including with YYERROR_VERBOSE.
23926
23927 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
23928 associative).
23929 Use it to check the computations.
23930 Use it to check `nonassoc' is honored.
23931 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
23932 `--yyerror-verbose'.
23933 (_AT_CHECK_CALC): Adjust to this option.
23934 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
23935
5a35a6cb
AD
239362000-10-02 Akim Demaille <akim@epita.fr>
23937
23938 Test also `--verbose', `--defines' and `--name-prefix'. Testing
23939 the latter demonstrates a flaw in the handling of non debugging
23940 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
23941 was used in order to simplify:
23942
23943 #if YYDEBUG
23944 if (yydebug)
23945 {
23946 ...
23947 }
23948 #endif
23949
23950 into
23951
23952 if (yydebug)
23953 {
23954 ...
23955 }
23956
23957 unfortunately this leads to a CPP conflict when
23958 `--name-prefix=foo' is used since it produces `#define yydebug
23959 foodebug'.
23960
23961 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
23962 (YYDPRINTF): New macro.
23963 Spread its use.
23964 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
23965 the bison options.
23966 Also test `--verbose', `--defines' and `--name-prefix'.
23967
71da9eea
AD
239682000-10-02 Akim Demaille <akim@epita.fr>
23969
23970 Improve the readability of the produced parsers.
23971
23972 * src/bison.s1: Formatting changes.
23973 Improve the comment related to the `$' mark.
23974 (yydefault): Don't fall through to `yyresume': `goto' there.
23975 * src/output.c (output_parser): When the `$' is met, skip the end
23976 of its line.
23977 New variable, `number_of_dollar_signs', to check there's exactly
23978 one `$' in the parser skeleton.
23979
95e36146
AD
239802000-10-02 Akim Demaille <akim@epita.fr>
23981
23982 * lib/xstrdup.c: New file, from the fileutils.
23983 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
23984 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
23985 instead of strlen + xmalloc + strcpy.
23986 * src/symtab.c (copys): Remove, use xstrdup instead.
23987
d7020c20
AD
239882000-10-02 Akim Demaille <akim@epita.fr>
23989
23990 * src/gram.h (associativity): New enum type which replaces the
23991 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
23992 `right_assoc', `left_assoc' and `non_assoc'.
23993 Adjust all dependencies.
23994 * src/reader.c: Formatting changes.
23995 (LTYPESTR): Don't define it, use it as a literal in
23996 `reader_output_yylsp'.
23997 * src/symtab.h (symbol_class): New enum type which replaces the
23998 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
23999 `sunknown', `stoken and `snterm'.
24000
1916f98e
AD
240012000-10-02 Akim Demaille <akim@epita.fr>
24002
24003 * src/getargs.c (fixed_outfiles): Rename as...
24004 (yaccflag): for consistency and accuracy.
24005 Adjust dependencies.
24006
d7913476
AD
240072000-10-02 Akim Demaille <akim@epita.fr>
24008
24009 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
24010 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
24011 difficult and introduced a lot of core dump. It turns out that
24012 Bison used an implementation of `xmalloc' based on `calloc', and
24013 at various places it does depend upon the initialization to 0. I
24014 have not tried to isolate the pertinent places, and all the former
24015 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
24016 someone should address this issue.
24017
24018 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
24019 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
24020 files.
24021 Adjust dependencies.
24022 * src/warshall.h: New file.
24023 Propagate.
24024
340ef489
AD
240252000-10-02 Akim Demaille <akim@epita.fr>
24026
24027 Various anti-`extern in *.c' changes.
24028
24029 * src/system.h: Include `assert.h'.
24030
b2ca4022
AD
240312000-10-02 Akim Demaille <akim@epita.fr>
24032
24033 * src/state.h (nstates, final_state, first_state, first_shift)
24034 (first_reduction): Move their exportation from here...
24035 * src/LR0.h: to here.
24036 Adjust dependencies.
24037 * src/getargs.c (statisticsflag): New variable.
24038 Add support for `--statistics'.
24039 Adjust dependencies.
24040
24041 Remove a lot of now useless `extern' statements in most files.
24042
403b315b
AD
240432000-10-02 Akim Demaille <akim@epita.fr>
24044
24045 * src/LR0.h: New file.
24046 Propagate its use.
24047
07a58c13
AD
240482000-10-02 Akim Demaille <akim@epita.fr>
24049
24050 * src/print.h: New file.
24051 Propagate its use.
24052 * src/print.c: Formatting and ordering changes.
24053 (verbose, terse): Replace with...
24054 (print_results): this new function.
24055 Adjust dependencies.
24056
0619caf0
AD
240572000-10-02 Akim Demaille <akim@epita.fr>
24058
24059 * src/conflicts.c (conflict_report): New function.
24060 (conflict_log, verbose_conflict_log): Replace with...
24061 (print_conflicts): this function.
24062 Adjust dependencies.
24063 * src/conflicts.h: New file.
24064 Propagate its inclusion.
24065
3519ec76
AD
240662000-10-02 Akim Demaille <akim@epita.fr>
24067
24068 * src/nullable.h: New file.
24069 Propagate its inclusion.
24070 * src/nullable.c: Formatting changes.
24071
015acc48
AD
240722000-10-02 Akim Demaille <akim@epita.fr>
24073
24074 * src/reduce.h: New file.
24075 Propagate its inclusion.
24076 * src/reduce.c: Topological sort and other formatting changes.
24077 (bool, TRUE, FALSE): Move their definition to...
24078 * src/system.h: here.
24079
8963a27b
AD
240802000-10-02 Akim Demaille <akim@epita.fr>
24081
24082 * src/files.c: Formatting changes.
24083 (tryopen, tryclose, openfiles): Rename as...
24084 (xfopen, xfclose, open_files): this.
24085 (stringappend): static.
24086 * src/files.h: Complete the list of exported symbols.
24087 Propagate its use.
24088
a70083a3
AD
240892000-10-02 Akim Demaille <akim@epita.fr>
24090
24091 * src/reader.h: New file.
24092 Propagate its use instead of tedious list of `extern' and
24093 prototypes.
24094 * src/reader.c: Formatting changes, topological sort,
24095 s/register//.
24096
abadc117
AD
240972000-10-02 Akim Demaille <akim@epita.fr>
24098
24099 * src/lex.h: Prototype `lex.c' exported functions.
24100 * src/reader.c: Adjust.
24101 * src/lex.c: Formatting changes.
24102 (safegetc): Rename as...
24103 (xgetc): this.
24104
720d742f
AD
241052000-10-02 Akim Demaille <akim@epita.fr>
24106
24107 * src/lalr.h: New file.
24108 Propagate its inclusion instead of prototypes and `extern'.
24109 * src/lalr.c: Formatting changes, topological sorting etc.
24110
f2acea59
AD
241112000-10-02 Akim Demaille <akim@epita.fr>
24112
24113 * src/output.c (token_actions): Introduce a temporary array,
24114 YYDEFACT, that makes it possible for this function to use
24115 output_short_table.
24116
d019d655
AD
241172000-10-02 Akim Demaille <akim@epita.fr>
24118
24119 `user_toknums' is output as a `short[]' in `output.c', while it is
24120 defined as a `int[]' in `reader.c'. For consistency with the
24121 other output tables, `user_toknums' is now defined as a table of
24122 shorts.
24123
24124 * src/reader.c (user_toknums): Be a short table instead of an int
24125 table.
24126 Adjust dependencies.
24127
24128 Factor the short table outputs.
24129
24130 * src/output.c (output_short_table): New function.
24131 * src/output.c (output_gram, output_stos, output_rule_data)
24132 (output_base, output_table, output_check): Use it.
24133
6c89f1c1
AD
241342000-10-02 Akim Demaille <akim@epita.fr>
24135
24136 * src/output.c (output): Topological sort of the functions, in
24137 order to get rid of the `static' prototypes.
24138 No longer use `register'.
24139 * src/output.h: New file.
24140 Propagate its inclusion in files explicitly prototyping functions
24141 from output.c.
24142
d9efd181
AD
241432000-09-21 Akim Demaille <akim@epita.fr>
24144
24145 * src/atgeneral.m4: Update from Autoconf.
24146
c29240e7 241472000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
24148
24149 * src/closure.h: New file.
24150 * src/closure.c: Formatting changes, topological sort over the
24151 functions, use of closure.h.
24152 (initialize_closure, finalize_closure): Rename as...
24153 (new_closure, free_closure): these. Adjust dependencies.
24154 * src/LR0.c: Formatting changes, topological sort, use of
24155 cloture.h.
24156 (initialize_states): Rename as...
24157 (new_states): this.
24158 * src/Makefile.am (noinst_HEADERS): Adjust.
24159
499daa50
AD
241602000-09-20 Akim Demaille <akim@epita.fr>
24161
24162 * src/acconfig.h: Don't protect config.h against multiple
24163 inclusion.
24164 Don't define PARAMS.
24165 * src/system.h: Define PARAMS.
24166 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
24167 purpose of config.h. system.h must not try to fix wrong
24168 definitions in config.h.
24169
cc84fd5d
AD
241702000-09-20 Akim Demaille <akim@epita.fr>
24171
24172 * src/derives.h: New file.
24173 * src/main.c, src/derives.h: Use it.
24174 Formatting changes.
24175 * src/Makefile.am (noinst_HEADERS): Adjust.
24176
db5b3a89
AD
241772000-09-20 Akim Demaille <akim@epita.fr>
24178
24179 * tests/atgeneral.m4: Update from Autoconf.
24180 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
24181 (AT_CHECK_CALC): New macros.
24182 Use these macros to test bison with options `', `--raw',
24183 `--debug', `--yacc', `--yacc --debug'.
24184
ceed8467
AD
241852000-09-19 Akim Demaille <akim@epita.fr>
24186
24187 * src/output.c: Formatting changes.
24188 * src/machine.h: Remove, leaving its contents in...
24189 * src/system.h: here.
24190 Include stdio.h.
24191 Adjust all dependencies on stdio.h and machine.h.
24192 * src/getargs.h: New file.
24193 Let all `extern' declarations about getargs.c be replaced with
24194 inclusion of `getargs.h'.
24195 * src/Makefile.am (noinst_HEADERS): Adjust.
24196
24197 * tests/calc.m4 (yyin): Be initialized in main, not on the global
24198 scope.
24199 (yyerror): Returns void, not int.
24200 * doc/bison.texinfo: Formatting changes.
24201
05a1d24b
AD
242022000-09-19 Akim Demaille <akim@epita.fr>
24203
24204 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
24205 portable.
24206
cbd25751
AD
242072000-09-18 Akim Demaille <akim@epita.fr>
24208
24209 * configure.in: Append WARNING_CFLAGS to CFLAGS.
24210 * src/Makefile.am (INCLUDES): Don't.
24211 Be ready to fetch headers in lib/.
24212
13863333
AD
242132000-09-18 Akim Demaille <akim@epita.fr>
24214
24215 * doc/bison.texinfo: Update the copyright.
24216 ANSIfy and GNUify the examples.
24217 Remove the old menu.
24218
0d533154
AD
242192000-09-18 Akim Demaille <akim@epita.fr>
24220
24221 First set of tests: use the `calc' example from the documentation.
24222
24223 * src/bison.s1 (yyparse): Condition the code using `yytname' which
24224 is defined only when YYDEBUG is.
24225 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
24226 * src/files.c (tryopen, tryclose): Formatting changes.
24227 Move to the top and be static.
24228 * src/reader.c (read_signed_integer): Likewise.
24229 * tests/calc.m4: New file.
24230 * Makefile.am, suite.m4: Adjust.
24231 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
24232
e79137ac
AD
242332000-09-18 Akim Demaille <akim@epita.fr>
24234
24235 Add support for an Autotest test suite for Bison.
24236
24237 * m4/m4.m4, m4/atconfig.m4: New files.
24238 * m4/Makefile.am (EXTRA_DIST): Adjust.
24239 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
24240 files.
24241 * src/getargs.c: Display a more standard --version message.
24242 * src/reader.c (reader): Formatting changes.
24243 No longer depend upon VERSION_STRING.
24244 * configure.in: No longer use `dnl'.
24245 Set up the test suite and the new directory `tests/.
24246 (VERSION_STRING): Remove.
24247
27821bff
AD
242482000-04-14 Akim Demaille <akim@epita.fr>
24249
24250 * src/reader.c (copy_comment2): New function, same as former
24251 `copy_comment', but outputs into two FILE *.
24252 (copy_comment): Use it.
24253 (parse_union_decl): Use it.
24254 (get_type, parse_start_decl): Use the same `invalid' message.
24255 (parse_start_decl, parse_union_decl): Use the same `multiple'
24256 message.
24257 (parse_union_decl, copy_guard, copy_action): Use the same
24258 `unmatched' message.
24259 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
24260
cfe5fbc0
AD
242612000-03-31 Akim Demaille <akim@epita.fr>
24262
24263 * src/files.c (tryopen, tryclose): Move to the top.
24264 Be static.
24265
cb7db13e
AD
242662000-03-31 Akim Demaille <akim@epita.fr>
24267
24268 * src/main.c (main): Don't call `done', exit does it.
24269
a0f6b076
AD
242702000-03-31 Akim Demaille <akim@epita.fr>
24271
36281465
AD
24272 * allocate.c: s/return (foo)/return foo/.
24273 * lalr.c: Likewise.
24274 * LR0.c: Likewise.
24275 * output.c: Likewise.
24276 * reader.c: Likewise.
24277 * symtab.c: Likewise.
24278 * vmsgetargs.c: Likewise.
24279
242802000-03-31 Akim Demaille <akim@epita.fr>
24281
24282 Clean up the error reporting functions.
a0f6b076
AD
24283
24284 * src/report.c: New file.
24285 * src/report.h: Likewise.
24286 * src/Makefile.am: Adjust.
24287 * m4/error.m4: New file.
24288 * m4/Makefile.am: Adjust.
24289 * configure.in (jm_PREREQ_ERROR): Call it.
24290 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
24291 Remove.
24292 (fatal, fatals): Remove. All callers use complain.c::fatal.
24293 (warn, warni, warns, warnss, warnss): Remove. All callers use
24294 complain.c::complain.
24295 (toomany): Remove, use fatal instead.
24296 * src/files.c (done): No argument, use complain_message_count.
24297 * src/main.c (main): Register `done' to `atexit'.
24298
24299 * src/getargs.c (usage): More `fputs', less `fprintf'.
24300
18539825
AD
243012000-03-28 Akim Demaille <akim@epita.fr>
24302
24303 * lib/: New directory.
24304 * Makefile.am (SUBDIRS): Adjust.
24305 * configure.in: Adjust.
24306 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
24307 useless.
24308 * src/alloca.c: Moved to lib/.
24309 * src/getopt.c: Likewise.
24310 * src/getopt1.c: Likewise.
24311 * src/getopt.h: Likewise.
24312 * src/ansi2knr.c: Likewise.
24313 * src/ansi2knr.1: Likewise.
24314 * src/Makefile.am: Adjust.
24315 * lib/Makefile.am: New file.
24316
9f306f2a
AD
243172000-03-28 Akim Demaille <akim@epita.fr>
24318
24319 * src/getargs.c (usage): Refresh the help message.
24320
0ba347b6
AD
243212000-03-17 Akim Demaille <akim@epita.fr>
24322
24323 * src/getopt1.c: Updated from textutils 2.0e
24324 * src/getopt.c: Likewise.
24325 * src/getopt.h: Likewise.
24326
dbe7f271
AD
243272000-03-17 Akim Demaille <akim@epita.fr>
24328
24329 * src/Makefile.am (bison.simple): Fix the awk program: quote only
24330 the file name, not the whole `#line LINE FILE'.
24331
75bbe78d
AD
243322000-03-17 Akim Demaille <akim@epita.fr>
24333
24334 On syntax errors, report the token on which we choked.
24335
aa5fd0ee
AD
24336 * src/bison.s1 (yyparse): In the label yyerrlab, when
24337 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 24338
7b306f52
AD
243392000-03-17 Akim Demaille <akim@epita.fr>
24340
aa5fd0ee 24341 * src/reader.c (copy_at): New function.
7b306f52
AD
24342 (copy_guard): Use it.
24343 (copy_action): Use it.
24344
e87b5700
AD
243452000-03-17 Akim Demaille <akim@epita.fr>
24346
24347 Be kind to translators, save some useless translations.
24348
aa5fd0ee 24349 * src/main.c (banner): New function.
e87b5700
AD
24350 (fatal_banner): Use it.
24351 (warn_banner): Use it.
24352
ae3c3164
AD
243532000-03-17 Akim Demaille <akim@epita.fr>
24354
aa5fd0ee
AD
24355 * src/reader.c (copy_definition): Use copy_string and
24356 copy_comment. Removed now unused `match', `ended',
24357 `cplus_comment'.
ae3c3164
AD
24358 (copy_comment, copy_string): Moved, to be visible from
24359 copy_definition.
24360
4dc58e7c
AD
243612000-03-17 Akim Demaille <akim@epita.fr>
24362
aa5fd0ee
AD
24363 * src/reader.c (copy_string): Declare `static inline'. No
24364 problems with inline, since it is checked by configure.
4dc58e7c
AD
24365 (copy_comment): Likewise.
24366
0a6384c4
AD
243672000-03-17 Akim Demaille <akim@epita.fr>
24368
aa5fd0ee 24369 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 24370
3cef001a
AD
243712000-03-17 Akim Demaille <akim@epita.fr>
24372
aa5fd0ee 24373 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
24374 (copy_action): Use it. Removed now unused `match', `ended',
24375 `cplus_comment'.
24376 (copy_guard): Likewise.
24377
ca36d2ef
AD
243782000-03-17 Akim Demaille <akim@epita.fr>
24379
aa5fd0ee 24380 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
24381 (copy_action): Use it.
24382 (copy_guard): Likewise.
24383
6666f98f
AD
243842000-03-17 Akim Demaille <akim@epita.fr>
24385
24386 Change the handling of @s so that they behave exactly like $s.
24387 There is now a pseudo variable @$ (readble and writable), location
24388 of the lhs of the rule (by default ranging from the location of
24389 the first symbol of the rhs, to the location of the last symbol,
24390 or, if the rhs is empty, YYLLOC).
24391
24392 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
24393 yyval.
24394 (yyparse): When providing a default semantic action, provide a
24395 default location action.
24396 (after the $): No longer change `*YYLSP', just stack YYLOC the
24397 same way you stack YYVAL.
24398 * src/reader.c (read_declarations): Use warns.
24399 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
24400 (copy_action, case '@'): Likewise.
24401 Use a standard error message, to save useless work from
24402 translators.
24403
41aca2e0
AD
244042000-03-17 Akim Demaille <akim@epita.fr>
24405
aa5fd0ee
AD
24406 * src/bison.s1: Formatting and cosmetics changes.
24407 * src/reader.c: Likewise.
41aca2e0
AD
24408 Update the Copyright notice.
24409
dc08c1d5
AD
244102000-03-17 Akim Demaille <akim@epita.fr>
24411
aa5fd0ee
AD
24412 * src/bison.s1 (#line): All set to `#line' only, since the
24413 Makefile now handles them.
dc08c1d5 24414
9ee3c97b
AD
244152000-03-16 Akim Demaille <akim@epita.fr>
24416
24417 * src/output.c (output_rule_data): Output the documentation of
24418 some of the tables.
24419 (Copyright notice): Update.
24420 Formatting changes.
24421
0de741ca
AD
244222000-03-16 Akim Demaille <akim@epita.fr>
24423
24424 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
24425 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
24426 One `#if YYDEBUG' remains, since it uses variables which are
24427 defined only if `YYDEBUG != 0'.
24428
bb10be54
AD
244292000-03-16 Akim Demaille <akim@epita.fr>
24430
24431 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
24432 and related variables so that the similarities are highlighted.
24433
b07b484a
AD
244342000-03-16 Akim Demaille <akim@epita.fr>
24435
24436 * src/bison.s1: Properly indent CPP directives.
24437
361f60b3
AD
244382000-03-16 Akim Demaille <akim@epita.fr>
24439
24440 * src/bison.s1: Properly indent the `alloca' CPP section.
24441
8c44d3ec
AD
244422000-03-16 Akim Demaille <akim@epita.fr>
24443
24444 Do not hard code values of directories in `configure.in'.
24445 Update the `configure' tool chain.
24446
24447 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
24448 src/makefile.am.
24449 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
24450 (AC_OUTPUT): Add m4/Makefile.
24451 Bump to bison 1.28a, 1.29 has never been released.
24452 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
24453 handled via src/Makefile.am.
24454 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
24455 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
24456 autoheader.
24457 * Makefile.am (SUBDIRS): Add m4.
24458 (ACLOCAL_AM_FLAGS): New variable.
24459 (AUTOMAKE_OPTIONS): Add check-news.
24460 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
24461 the proper line number and file name.
24462 (DEFS): Propagate the location of bison library files and of the
24463 locale files.
24464 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
24465 builddir.
24466 * acinclude.m4: Remove, replaced by the directory m4.
24467 * m4/Makefile.am (EXTRA_DIST): New variable.
24468 * m4/gettext.m4: New file, from the fileutils.
24469 * m4/lcmessage.m4: Likewise
24470 * m4/progtest.m4: Likewise.
24471 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
24472
f95997e7
AD
244732000-03-10 Akim Demaille <akim@epita.fr>
24474
24475 * src/closure.c:
24476 Formatting changes of various comments.
24477 Respect the GNU coding standards at various places.
24478 Don't use `_()' when no translation is needed.
24479
244801999-12-13 Jesse Thilo <jthilo@gnu.org>
24481
24482 * src/files.c:
24483 OS/2 honors TMPDIR environment variable.
24484
244851999-12-13 Jesse Thilo <jthilo@gnu.org>
24486
24487 * doc/bison.texinfo: Tweaked spelling and grammar.
24488 Updated ISBN.
24489 Removed reference to price of printed copy.
24490 Mention BISON_SIMPLE and BISON_HAIRY.
24491
244921999-12-13 Jesse Thilo <jthilo@gnu.org>
24493
24494 * configure.in, NEWS:
24495 Bison 1.29 released.
24496
244971999-10-27 Jesse Thilo <jthilo@gnu.org>
24498
24499 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
24500 Added reference card.
24501
245021999-07-26 Jesse Thilo <jthilo@gnu.org>
24503
24504 * po/ru.po: Added Russian translation.
24505
245061999-07-26 Jesse Thilo <jthilo@gnu.org>
24507
24508 * configure.in: Added Russian translation.
24509
245101999-07-06 Jesse Thilo <jthilo@gnu.org>
24511
24512 * configure.in, NEWS, README:
24513 Released version 1.28.
24514
245151999-06-14 Jesse Thilo <jthilo@gnu.org>
24516
24517 * src/system.h:
24518 Squashed redefinition warning on some systems.
24519
24520 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
24521 Have configure build version string instead of relying on ANSI string
24522 concatentation.
24523
245241999-06-14 Jesse Thilo <jthilo@gnu.org>
24525
24526 * po/POTFILES.in: Got rid of version.c.
24527
245281999-06-14 Jesse Thilo <jthilo@gnu.org>
24529
24530 * acconfig.h, configure.in:
24531 Have configure build version string instead of relying on ANSI string
24532 concatentation.
24533
245341999-06-08 Jesse Thilo <jthilo@gnu.org>
24535
24536 * doc/bison.1:
24537 Dropped mention of `+' for long-named options.
24538
245391999-05-30 Jesse Thilo <jthilo@gnu.org>
24540
24541 * src/files.c: Added <unistd.h> for unlink().
24542
24543 * src/Makefile.am, src/system.h:
24544 I18n fixes.
24545
245461999-05-30 Jesse Thilo <jthilo@gnu.org>
24547
24548 * README: Added a FAQ list.
24549
24550 * configure.in, acconfig.h:
24551 I18n fixes.
24552
245531999-05-30 Jesse Thilo <jthilo@gnu.org>
24554
24555 * doc/FAQ, doc/Makefile.am:
24556 Added a FAQ list.
24557
245581999-05-19 Jesse Thilo <jthilo@gnu.org>
24559
24560 * src/alloc.h, src/symtab.h, src/version.c:
24561 Protected inclusion of "config.h" with HAVE_CONFIG_H.
24562
245631999-04-18 Jesse Thilo <jthilo@gnu.org>
24564
24565 * src/.cvsignore, src/Makefile.am:
24566 Reorganized: sources in `src', documentation in `doc'.
24567
24568 * src/lex.c (literalchar):
24569 fixed the code for escaping double quotes (thanks
24570 Jonathan Czisny.)
24571
245721999-04-18 Jesse Thilo <jthilo@gnu.org>
24573
24574 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
24575 Adjusted paths to reflect directory reorganization.
24576
245771999-04-18 Jesse Thilo <jthilo@gnu.org>
24578
24579 * doc/.cvsignore, doc/Makefile.am:
24580 Reorganized: sources in `src', documentation in `doc'.
24581
245821999-04-18 Jesse Thilo <jthilo@gnu.org>
24583
24584 * configure.in:
24585 Updated AC_INIT file to reflect directory reorganization.
24586
24587 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
24588 Reorganized: sources in `src', documentation in `doc'.
24589
245901999-04-13 Jesse Thilo <jthilo@gnu.org>
24591
24592 * src/allocate.c:
24593 Don't declare calloc() and realloc() if not necessary.
24594
245951999-04-13 Jesse Thilo <jthilo@gnu.org>
24596
24597 * configure.in, acconfig.h, acinclude.m4:
24598 Don't declare calloc() and realloc() if not necessary.
24599
246001999-03-23 Jesse Thilo <jthilo@gnu.org>
24601
24602 * po/.cvsignore: Added i18n support.
24603
246041999-03-23 Jesse Thilo <jthilo@gnu.org>
24605
24606 * acconfig.h, configure.in, Makefile.am:
24607 Added i18n support.
24608
246091999-03-22 Jesse Thilo <jthilo@gnu.org>
24610
24611 * src/bison.s1: Fixed #line numbers.
24612
246131999-03-15 Jesse Thilo <jthilo@gnu.org>
24614
24615 * po/es.po, po/fr.po, po/nl.po, po/de.po:
24616 Added PO files from Translation Project.
24617
246181999-03-03 Jesse Thilo <jthilo@gnu.org>
24619
24620 * Makefile.am:
24621 Added support for non-ANSI compilers (ansi2knr).
24622
246231999-02-16 Jesse Thilo <jthilo@gnu.org>
24624
24625 * configure.in: Bumped version number to 1.27.
24626
24627 * Makefile.am:
24628 Added `bison.simple' to list of files removed by `make distclean'.
24629
246301999-02-12 Jesse Thilo <jthilo@gnu.org>
24631
24632 * src/files.c, src/files.h:
24633 Defined locations of parser files in config.h instead of Makefile.
24634
246351999-02-12 Jesse Thilo <jthilo@gnu.org>
24636
24637 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
24638 Defined locations of parser files in config.h instead of Makefile.
24639
246401999-02-09 Jesse Thilo <jthilo@gnu.org>
24641
24642 * Makefile.am:
24643 Removed inappropriate use of $< macro.
24644
246451999-02-05 Jesse Thilo <jthilo@gnu.org>
24646
24647 * po/Makefile.in.in, po/POTFILES.in:
24648 Add `po' directory skeleton.
24649
246501999-01-27 Jesse Thilo <jthilo@gnu.org>
24651
24652 * README: Document help-bison list.
24653
24654 * configure.in: Add check for mkstemp().
24655
246561999-01-20 Jesse Thilo <jthilo@gnu.org>
24657
24658 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
24659 Hush a few compiler warnings.
24660
24661 * src/files.c:
24662 Add tryclose(), which verifies that fclose was successful.
24663 Hush a couple of compiler warnings.
24664
246651999-01-20 Jesse Thilo <jthilo@gnu.org>
24666
24667 * Makefile.am, OChangeLog:
24668 ChangeLog is now automatically generated. Include the old version as
24669 OChangeLog.
24670
246711999-01-14 Jesse Thilo <jthilo@gnu.org>
24672
24673 * 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:
24674 Update FSF address.
24675
246761999-01-14 Jesse Thilo <jthilo@gnu.org>
24677
24678 * doc/bison.texinfo: Fix formatting glitch.
24679
24680 * doc/bison.texinfo: Update FSF address.
24681
246821999-01-14 Jesse Thilo <jthilo@gnu.org>
24683
24684 * acconfig.h: Update FSF address.
24685
246861999-01-08 Jesse Thilo <jthilo@gnu.org>
24687
24688 * src/system.h:
24689 Don't define PACKAGE here, since config.h defines it.
24690
246911998-12-30 Jesse Thilo <jthilo@gnu.org>
24692
24693 * src/reader.c: Update copyright date.
24694
24695 * src/main.c:
24696 Ditch sprintf to statically-sized buffers in fatal/warn functions in
24697 favor of output directly to stderr (avoids buffer overruns).
24698
24699 * src/reader.c: Some checks for premature EOF.
24700
24701 * 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:
24702 Use prototypes if the compiler understands them.
24703
24704 * src/files.c: Honor TMPDIR on Unix hosts.
24705 Use prototypes if the compiler understands them.
24706
24707 * src/reader.c:
24708 Fix a couple of buffer overrun bugs.
24709 Use prototypes if the compiler understands them.
24710
24711 * src/system.h: Include unistd.h and ctype.h.
24712 Use #ifdef instead of #if for NLS symbols.
24713
247141998-12-30 Jesse Thilo <jthilo@gnu.org>
24715
24716 * doc/bison.texinfo:
24717 Delete comment "consider using @set for edition number, etc..." since
24718 we now are doing so.
24719
247201998-12-30 Jesse Thilo <jthilo@gnu.org>
24721
24722 * configure.in:
24723 Use prototypes if the compiler understands them.
24724
24725 * NEWS: Document 1.26 highlights.
24726
24727 * Makefile.am: Require Automake 1.3 or later.
24728
24729 * acconfig.h:
24730 Use prototypes if the compiler understands them.
24731
247321998-12-29 Jesse Thilo <jthilo@gnu.org>
24733
24734 * src/version.c:
24735 Use VERSION symbol from automake for version number.
24736
247371998-12-29 Jesse Thilo <jthilo@gnu.org>
24738
24739 * acconfig.h, configure.in, version.cin:
24740 Use VERSION symbol from automake for version number.
24741
247421998-11-28 Jesse Thilo <jthilo@gnu.org>
24743
24744 * Makefile.am:
24745 Distribute original version of simple parser (bison.s1), not built
24746 version (bison.simple).
24747
247481998-11-28 Jesse Thilo <jthilo@gnu.org>
24749
24750 * doc/bison.texinfo: Add info dir entry.
24751
24752 * doc/bison.texinfo:
24753 Let automake put version number into documentation.
24754
247551998-11-26 Jesse Thilo <jthilo@gnu.org>
24756
24757 * src/bison.cld, src/build.com, src/vmshlp.mar:
24758 Add non-RCS files from /gd/gnu/bison.
24759
247601998-11-26 Jesse Thilo <jthilo@gnu.org>
24761
24762 * doc/bison.1:
24763 Document the BISON_HAIRY and BISON_SIMPLE variables.
24764
247651998-11-25 Jesse Thilo <jthilo@gnu.org>
24766
24767 * src/version.c: Build version.c automatically.
24768
24769 * src/reader.c:
24770 Fix token numbering (used to start at 258, not 257).
24771
24772 * src/system.h: Include config.h.
24773
24774 * src/getargs.c: Update bug report address.
24775
24776 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
24777 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
24778
247791998-11-25 Jesse Thilo <jthilo@gnu.org>
24780
24781 * Makefile.am:
24782 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24783
24784 * configure.in, version.cin:
24785 Build version.c automatically.
24786
24787 * AUTHORS: Add AUTHORS file.
24788
24789 * README: Update bug report address.
24790
24791 * bison.simple:
24792 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24793
24794 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
24795 Add automake stuff.
24796
247971998-11-25 Jesse Thilo <jthilo@gnu.org>
24798
24799 * doc/bison.texinfo: Clean up some formatting.
24800
248011998-05-05 Richard Stallman <rms@gnu.org>
24802
24803 * doc/bison.texinfo:
24804 Explain better why to make a pure parser.
24805
248061998-01-05 Richard Stallman <rms@gnu.org>
24807
24808 * src/files.c (openfiles):
24809 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
24810 find a temporary directory, if possible. Do not unlink files while
24811 they are open.
24812
248131997-08-25 Richard Stallman <rms@gnu.org>
24814
24815 * src/reader.c (stack_offset;):
24816 Change some warni to warns.
24817
24818 * src/lex.c (literalchar): Use warns, not warni.
24819
248201997-06-28 Richard Stallman <rms@gnu.org>
24821
24822 * src/bison.s1: Add a Bison version comment.
24823
24824 * src/main.c (fatal, warn, berror):
24825 Use program_name.
24826
248271997-06-28 Richard Stallman <rms@gnu.org>
24828
24829 * Makefile.in (bison_version): New variable.
24830 (dist): Use that variable.
24831 (bison.s1): Substitute the Bison version into bison.simple.
24832
24833 * bison.simple: Add a Bison version comment.
24834
248351997-06-18 Richard Stallman <rms@gnu.org>
24836
24837 * src/main.c (fatal, warn, berror):
24838 Make error messages standard.
24839 (toomany): Improve error message text.
24840
24841 * 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:
24842 new.h renamed to alloc.h.
24843
248441997-06-18 Richard Stallman <rms@gnu.org>
24845
24846 * Makefile.in: new.h renamed to alloc.h.
24847
248481997-05-24 Richard Stallman <rms@gnu.org>
24849
24850 * src/lex.c (literalchar):
24851 Fix the code for escaping \, " and '.
24852
24853 (lex): Avoid trouble when there are many chars
24854 to discard in a char literal with just several chars in it.
24855
248561997-05-17 Richard Stallman <rms@gnu.org>
24857
24858 * src/bison.s1:
24859 Use malloc, if using alloca is troublesome.
24860 (YYSTACK_USE_ALLOCA): New flag macro.
24861 Define it for some systems and compilers.
24862 (YYSTACK_ALLOC): New macro.
24863 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24864 If it was malloc'd, free it.
24865
248661997-05-17 Richard Stallman <rms@gnu.org>
24867
24868 * bison.simple:
24869 Use malloc, if using alloca is troublesome.
24870 (YYSTACK_USE_ALLOCA): New flag macro.
24871 Define it for some systems and compilers.
24872 (YYSTACK_ALLOC): New macro.
24873 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24874 If it was malloc'd, free it.
24875
248761997-04-23 Richard Stallman <rms@gnu.org>
24877
24878 * src/bison.s1:
24879 (alloca) [__hpux]: Always define as __builtin_alloca.
24880
248811997-04-23 Richard Stallman <rms@gnu.org>
24882
24883 * bison.simple:
24884 (alloca) [__hpux]: Always define as __builtin_alloca.
24885
248861997-04-22 Richard Stallman <rms@gnu.org>
24887
24888 * src/bison.s1:
24889 [__hpux]: Include alloca.h (right for HPUX 10)
24890 instead of declaring alloca (right for HPUX 9).
24891
24892 * src/bison.s1 (__yy_memcpy):
24893 Declare arg `count' as unsigned int.
24894 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24895
248961997-04-22 Richard Stallman <rms@gnu.org>
24897
24898 * bison.simple:
24899 [__hpux]: Include alloca.h (right for HPUX 10)
24900 instead of declaring alloca (right for HPUX 9).
24901
24902 * bison.simple (__yy_memcpy):
24903 Declare arg `count' as unsigned int.
24904 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24905
249061997-01-03 Richard Stallman <rms@gnu.org>
24907
24908 * src/allocate.c: [__STDC__ or _MSC_VER]:
24909 Declare calloc and realloc to return void *.
24910
249111997-01-02 Richard Stallman <rms@gnu.org>
24912
24913 * src/system.h:
24914 [_MSC_VER]: Include stdlib.h and process.h.
24915 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
24916
24917 * src/main.c (main): Return FAILURE as a value.
24918 (printable_version): Declare arg as int, not char.
24919
249201997-01-02 Richard Stallman <rms@gnu.org>
24921
24922 * Makefile.in (dist):
24923 Explicitly check for symlinks, and copy them.
24924
249251996-12-19 Richard Stallman <rms@gnu.org>
24926
24927 * src/files.c:
24928 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
24929
249301996-12-18 Paul Eggert <eggert@gnu.org>
24931
24932 * src/bison.s1 (yyparse):
24933 If __GNUC__ and YYPARSE_PARAM are both defined,
24934 declare yyparse to have a void * argument.
24935
249361996-12-18 Paul Eggert <eggert@gnu.org>
24937
24938 * bison.simple (yyparse):
24939 If __GNUC__ and YYPARSE_PARAM are both defined,
24940 declare yyparse to have a void * argument.
24941
249421996-12-17 Richard Stallman <rms@gnu.org>
24943
24944 * src/reduce.c (nbits): Add some casts.
24945
249461996-08-12 Richard Stallman <rms@gnu.org>
24947
24948 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
24949
249501996-08-12 Richard Stallman <rms@gnu.org>
24951
24952 * bison.simple: Test _MSDOS as well as _MSDOS_.
24953
249541996-07-31 Richard Stallman <rms@gnu.org>
24955
24956 * src/bison.s1:
24957 [__sun && __i386]: Include alloca.h.
24958
249591996-07-31 Richard Stallman <rms@gnu.org>
24960
24961 * bison.simple:
24962 [__sun && __i386]: Include alloca.h.
24963
249641996-07-30 Richard Stallman <rms@gnu.org>
24965
24966 * src/bison.s1: Comment change.
24967
24968 * src/bison.s1: Test _MSDOS_, not MSDOS.
24969
249701996-07-30 Richard Stallman <rms@gnu.org>
24971
24972 * bison.simple: Comment change.
24973
24974 * bison.simple: Test _MSDOS_, not MSDOS.
24975
249761996-06-01 Richard Stallman <rms@gnu.org>
24977
24978 * 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:
24979 Insert `_' macro around many string constants.
24980
24981 * src/main.c:
24982 Insert `_' macro around many string constants.
24983
24984 (main): Call setlocale, bindtextdomain and textdomain.
24985
24986 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
24987 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
24988 [ENABLE_NLS]: Include libintl.h.
24989 [ENABLE_NLS] (gettext): Define.
24990 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
24991 (N_, PACKAGE, LOCALEDIR): New macros.
24992
249931996-06-01 Richard Stallman <rms@gnu.org>
24994
24995 * POTFILES.in: New file.
24996
24997 * Makefile.in (allocate.o):
24998 Define target explicitly.
24999
25000 * Makefile.in (CFLAGS): Set to @CFLAGS@.
25001 (LDFLAGS): Set to @LDFLAGS@.
25002 (configure): Run autoconf only if preceding `cd' succeeds.
25003 (bison.s1): Redirect output to temporary file then move the
25004 temporary to the target, rather than redirecting directly to bison.s1.
25005 (clean): Remove config.status and config.log.
25006 (distclean): Don't remove config.status here.
25007
250081996-05-12 Richard Stallman <rms@gnu.org>
25009
25010 * src/bison.s1:
25011 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25012
250131996-05-12 Richard Stallman <rms@gnu.org>
25014
25015 * bison.simple:
25016 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25017
250181996-05-11 Richard Stallman <rms@gnu.org>
25019
25020 * src/bison.s1 (__yy_memcpy):
25021 Really reorder the args, as was supposedly done on Feb 14 1995.
25022 (yyparse): Calls changed accordingly.
25023
250241996-05-11 Richard Stallman <rms@gnu.org>
25025
25026 * Makefile.in (dist): Don't use $(srcdir).
25027
25028 * bison.simple (__yy_memcpy):
25029 Really reorder the args, as was supposedly done on Feb 14 1995.
25030 (yyparse): Calls changed accordingly.
25031
250321996-01-27 Richard Stallman <rms@gnu.org>
25033
25034 * src/output.c (output_rule_data):
25035 Test YYERROR_VERBOSE in the conditional
25036 around the definition of ttyname.
25037
250381995-12-29 Richard Stallman <rms@gnu.org>
25039
25040 * src/bison.s1:
25041 Fix line numbers in #line commands.
25042
250431995-12-29 Richard Stallman <rms@gnu.org>
25044
25045 * bison.simple:
25046 Fix line numbers in #line commands.
25047
250481995-12-27 Richard Stallman <rms@gnu.org>
25049
25050 * src/bison.s1 (YYPARSE_PARAM_DECL):
25051 In C++, make it always null.
25052 (YYPARSE_PARAM_ARG): New macro.
25053 (yyparse): Use YYPARSE_PARAM_ARG.
25054
250551995-12-27 Richard Stallman <rms@gnu.org>
25056
25057 * bison.simple (YYPARSE_PARAM_DECL):
25058 In C++, make it always null.
25059 (YYPARSE_PARAM_ARG): New macro.
25060 (yyparse): Use YYPARSE_PARAM_ARG.
25061
250621995-11-29 Richard Stallman <rms@gnu.org>
25063
25064 * doc/bison.texinfo:
25065 Describe literal string tokens, %raw, %no_lines, %token_table.
25066
250671995-11-29 Daniel Hagerty <hag@gnu.org>
25068
25069 * doc/bison.texinfo: Fixed update date
25070
250711995-10-16 Richard Stallman <rms@gnu.org>
25072
25073 * src/version.c: Version 1.25.
25074
250751995-10-16 Richard Stallman <rms@gnu.org>
25076
25077 * NEWS: *** empty log message ***
25078
250791995-10-16 Richard Stallman <rms@gnu.org>
25080
25081 * doc/bison.1, doc/bison.rnh:
25082 Add new options.
25083
250841995-10-15 Richard Stallman <rms@gnu.org>
25085
25086 * src/vmsgetargs.c, src/getargs.c:
25087 Added -n, -k, and -raw switches.
25088 (noparserflag, toknumflag, rawtoknumflag): New variables.
25089
25090 * src/symtab.h (SALIAS):
25091 New #define for adding aliases to %token.
25092 (struct bucket): Added `alias' field.
25093
25094 * src/reduce.c (reduce_grammar):
25095 Revise error message.
25096 (print_notices): Remove final `.' from error message.
25097
25098 * src/reader.c (reader_output_yylsp):
25099 New function.
25100 (readgram): Use `#if 0' around code that accepted %command
25101 inside grammar rules: The documentation doesn't allow it,
25102 and it will fail since the %command processors scan for the next %.
25103 (parse_token_decl): Extended the %token
25104 declaration to allow a multi-character symbol as an alias.
25105 (parse_thong_decl): New function.
25106 (read_declarations): Added %thong declarations.
25107 (read_declarations): Handle NOOP to deal with allowing
25108 % declarations as another means to specify the flags.
25109 (readgram): Allow %prec prior to semantics embedded in a rule.
25110 (skip_to_char, read_declarations, copy_definition)
25111 (parse_token_decl, parse_start_decl, parse_type_decl)
25112 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
25113 (get_type_name, copy_guard, copy_action, readgram)
25114 (get_type, packsymbols): Revised most error messages.
25115 Changed `fatal' to `warnxxx' to avoid aborting for error.
25116 Revised and use multiple warnxxx functions to avoid using VARARGS1.
25117 (read_declarations): Improve the error message for
25118 an invalid character. Do not abort.
25119 (read_declarations, copy_guard, copy_action): Use
25120 printable_version to avoid unprintable characters in printed output.
25121 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
25122 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
25123 Allow the type of a non-terminal can be given
25124 more than once, as long as all specifications give the same type.
25125
25126 * src/output.c:
25127 (output_headers, output_trailers, output, output_gram)
25128 (output_rule_data): Implement noparserflag variable.
25129 Implement toknumflag variable.
25130 (output): Call reader_output_yylsp to output LTYPESTR.
25131
25132 * src/main.c (main):
25133 If reader sees an error, don't process the grammar.
25134 (fatals): Updated to not use VARARGS1.
25135 (printable_version, int_to_string, warn, warni, warns, warnss)
25136 (warnsss): New error reporting functions. Avoid abort for error.
25137
25138 * src/lex.h:
25139 Added THONG and NOOP for alias processing.
25140 Added SETOPT for the new code that allows setting options with %flags.
25141
25142 * src/lex.c:
25143 Include getopt.h. Add some extern decls.
25144 (safegetc): New function to deal with EOF gracefully.
25145 (literalchar); new function to deal with reading \ escapes.
25146 (lex): Use literalchar.
25147 (lex): Implemented "..." tokens.
25148 (literalchar, lex, parse_percent_token): Made tokenbuffer
25149 always contain the token. This includes growing the token
25150 buffer while reading an integer.
25151 (parse_percent_token): Replaced if-else statement with percent_table.
25152 (parse_percent_token): Added % declarations as another
25153 way to specify the flags -n, -l, and -r. Also added hooks for
25154 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
25155 major changes to files.c.
25156 (lex) Retain in the incoming stream a character following
25157 an incorrect '/'.
25158 (skip_white_space, lex): Revised most error messages
25159 and changed fatal to warn to avoid aborting.
25160 (percent_table): Added %thong declarations.
25161
25162 * src/gram.h: Comment changes.
25163
25164 * src/files.c (openfiles, open_extra_files, done):
25165 Add faction flag
25166 and actfile file. Handle noparserflag. Both for -n switch.
25167
25168 * src/conflicts.c (resolve_sr_conflict):
25169 Remove use of alloca.
25170
251711995-06-01 Jim Meyering <meyering@gnu.org>
25172
25173 * doc/bison.texinfo: *** empty log message ***
25174
251751995-05-06 Richard Stallman <rms@gnu.org>
25176
25177 * src/bison.s1: Comment change.
25178
251791995-05-06 Richard Stallman <rms@gnu.org>
25180
25181 * bison.simple: Comment change.
25182
251831995-05-03 Richard Stallman <rms@gnu.org>
25184
25185 * src/version.c: Version now 1.24.
25186
25187 * src/bison.s1: Change distribution terms.
25188
25189 * src/version.c: Version now 1.23.
25190
251911995-05-03 Richard Stallman <rms@gnu.org>
25192
25193 * doc/bison.texinfo:
25194 Rewrite "Conditions for Using Bison".
25195 Update version to 1.24.
25196
251971995-05-03 Richard Stallman <rms@gnu.org>
25198
25199 * bison.simple: Change distribution terms.
25200
252011995-02-23 Richard Stallman <rms@gnu.org>
25202
25203 * src/files.c: Test __VMS_POSIX as well as VMS.
25204
252051995-02-14 Jim Meyering <meyering@gnu.org>
25206
25207 * src/bison.s1 (__yy_memcpy):
25208 Renamed from __yy_bcopy to avoid
25209 confusion. Reverse FROM and TO arguments to be consistent with
25210 those of memcpy.
25211
252121995-02-14 Jim Meyering <meyering@gnu.org>
25213
25214 * bison.simple (__yy_memcpy):
25215 Renamed from __yy_bcopy to avoid
25216 confusion. Reverse FROM and TO arguments to be consistent with
25217 those of memcpy.
25218
252191994-11-10 David J. MacKenzie <djm@gnu.org>
25220
25221 * NEWS: reformat
25222
25223 * NEWS: New file.
25224
25225 * Makefile.in (DISTFILES): Include NEWS.
25226
25227 * Makefile.in (DISTFILES):
25228 Include install-sh, not install.sh.
25229
25230 * configure.in: Update to Autoconf v2 macro names.
25231
252321994-10-05 David J. MacKenzie <djm@gnu.org>
25233
25234 * Makefile.in: fix typo
25235
25236 * Makefile.in (prefix, exec_prefix):
25237 Let configure set them.
25238
252391994-09-28 David J. MacKenzie <djm@gnu.org>
25240
25241 * Makefile.in: Set datadir to $(prefix)/share.
25242
252431994-09-15 Richard Stallman <rms@gnu.org>
25244
25245 * src/bison.s1:
25246 Update copyright notice and GPL version.
25247
252481994-09-15 Richard Stallman <rms@gnu.org>
25249
25250 * bison.simple:
25251 Update copyright notice and GPL version.
25252
252531994-07-12 Richard Stallman <rms@gnu.org>
25254
25255 * src/reduce.c, src/reader.c:
25256 entered into RCS
25257
252581994-05-05 David J. MacKenzie <djm@gnu.org>
25259
25260 * Makefile.in: entered into RCS
25261
252621994-03-26 Richard Stallman <rms@gnu.org>
25263
25264 * src/bison.s1: entered into RCS
25265
252661994-03-26 Richard Stallman <rms@gnu.org>
25267
25268 * bison.simple: entered into RCS
25269
252701994-03-25 Richard Stallman <rms@gnu.org>
25271
25272 * src/main.c: entered into RCS
25273
252741994-03-24 Richard Stallman <rms@gnu.org>
25275
25276 * src/conflicts.c: entered into RCS
25277
252781994-01-02 Richard Stallman <rms@gnu.org>
25279
25280 * Makefile.in: *** empty log message ***
25281
252821993-11-21 Richard Stallman <rms@gnu.org>
25283
25284 * src/bison.s1: *** empty log message ***
25285
252861993-11-21 Richard Stallman <rms@gnu.org>
25287
25288 * doc/bison.texinfo: entered into RCS
25289
25290 * doc/bison.texinfo: *** empty log message ***
25291
252921993-11-21 Richard Stallman <rms@gnu.org>
25293
25294 * bison.simple: *** empty log message ***
25295
252961993-10-25 David J. MacKenzie <djm@gnu.org>
25297
25298 * doc/bison.texinfo: *** empty log message ***
25299
253001993-10-19 Richard Stallman <rms@gnu.org>
25301
25302 * src/bison.s1: *** empty log message ***
25303
253041993-10-19 Richard Stallman <rms@gnu.org>
25305
25306 * bison.simple: *** empty log message ***
25307
253081993-10-14 Richard Stallman <rms@gnu.org>
25309
25310 * src/bison.s1: *** empty log message ***
25311
253121993-10-14 Richard Stallman <rms@gnu.org>
25313
25314 * bison.simple: *** empty log message ***
25315
253161993-09-14 David J. MacKenzie <djm@gnu.org>
25317
25318 * doc/bison.texinfo: *** empty log message ***
25319
253201993-09-13 Noah Friedman <friedman@gnu.org>
25321
25322 * Makefile.in: *** empty log message ***
25323
253241993-09-10 Richard Stallman <rms@gnu.org>
25325
25326 * src/conflicts.c: *** empty log message ***
25327
25328 * src/system.h: entered into RCS
25329
253301993-09-10 Richard Stallman <rms@gnu.org>
25331
25332 * doc/bison.1: entered into RCS
25333
253341993-09-06 Noah Friedman <friedman@gnu.org>
25335
25336 * src/version.c: entered into RCS
25337
253381993-09-06 Noah Friedman <friedman@gnu.org>
25339
25340 * Makefile.in: *** empty log message ***
25341
253421993-07-30 David J. MacKenzie <djm@gnu.org>
25343
25344 * Makefile.in: *** empty log message ***
25345
253461993-07-24 Richard Stallman <rms@gnu.org>
25347
25348 * src/bison.s1: *** empty log message ***
25349
253501993-07-24 Richard Stallman <rms@gnu.org>
25351
25352 * bison.simple: *** empty log message ***
25353
253541993-07-08 David J. MacKenzie <djm@gnu.org>
25355
25356 * Makefile.in: *** empty log message ***
25357
253581993-07-04 Richard Stallman <rms@gnu.org>
25359
25360 * src/bison.s1: *** empty log message ***
25361
253621993-07-04 Richard Stallman <rms@gnu.org>
25363
25364 * bison.simple: *** empty log message ***
25365
253661993-06-26 David J. MacKenzie <djm@gnu.org>
25367
25368 * src/getargs.c: entered into RCS
25369
253701993-06-26 David J. MacKenzie <djm@gnu.org>
25371
25372 * doc/bison.texinfo: *** empty log message ***
25373
25374 * doc/bison.1: New file.
25375
253761993-06-25 Richard Stallman <rms@gnu.org>
25377
25378 * src/getargs.c: New file.
25379
253801993-06-16 Richard Stallman <rms@gnu.org>
25381
25382 * src/bison.s1: *** empty log message ***
25383
253841993-06-16 Richard Stallman <rms@gnu.org>
25385
25386 * bison.simple: *** empty log message ***
25387
253881993-06-03 Richard Stallman <rms@gnu.org>
25389
25390 * src/bison.s1: New file.
25391
253921993-06-03 Richard Stallman <rms@gnu.org>
25393
25394 * doc/bison.texinfo: *** empty log message ***
25395
253961993-06-03 Richard Stallman <rms@gnu.org>
25397
25398 * bison.simple: New file.
25399
254001993-05-19 Richard Stallman <rms@gnu.org>
25401
25402 * doc/bison.texinfo: New file.
25403
254041993-05-07 Noah Friedman <friedman@gnu.org>
25405
25406 * Makefile.in: *** empty log message ***
25407
254081993-04-28 Noah Friedman <friedman@gnu.org>
25409
25410 * src/reader.c: *** empty log message ***
25411
254121993-04-23 Noah Friedman <friedman@gnu.org>
25413
25414 * src/alloc.h: entered into RCS
25415
254161993-04-20 David J. MacKenzie <djm@gnu.org>
25417
25418 * src/version.c: *** empty log message ***
25419
25420 * src/files.c, src/allocate.c:
25421 entered into RCS
25422
25423 * src/reader.c: *** empty log message ***
25424
25425 * src/lex.c: entered into RCS
25426
25427 * src/conflicts.c: New file.
25428
25429 * src/symtab.c: entered into RCS
25430
25431 * src/alloc.h: New file.
25432
25433 * src/LR0.c: entered into RCS
25434
254351993-04-18 Noah Friedman <friedman@gnu.org>
25436
25437 * src/reader.c: New file.
25438
25439 * src/version.c: *** empty log message ***
25440
254411993-04-18 Noah Friedman <friedman@gnu.org>
25442
25443 * Makefile.in: *** empty log message ***
25444
254451993-04-17 Noah Friedman <friedman@gnu.org>
25446
25447 * Makefile.in: *** empty log message ***
25448
254491993-04-15 Richard Stallman <rms@gnu.org>
25450
25451 * src/main.c, src/files.c:
25452 New file.
25453
254541993-04-15 Noah Friedman <friedman@gnu.org>
25455
25456 * configure.in: entered into RCS
25457
25458 * configure.in: *** empty log message ***
25459
25460 * configure.in: New file.
25461
254621993-04-14 Richard Stallman <rms@gnu.org>
25463
25464 * Makefile.in: New file.
25465
254661993-04-13 Richard Stallman <rms@gnu.org>
25467
25468 * src/version.c: New file.
25469
254701993-03-25 Richard Stallman <rms@gnu.org>
25471
25472 * src/output.c: entered into RCS
25473
254741992-09-25 Richard Stallman <rms@gnu.org>
25475
25476 * configure.bat: entered into RCS
25477
254781992-06-22 Richard Stallman <rms@gnu.org>
25479
25480 * src/vmsgetargs.c: entered into RCS
25481
254821992-06-22 Richard Stallman <rms@gnu.org>
25483
25484 * doc/bison.rnh: entered into RCS
25485
254861992-04-20 David J. MacKenzie <djm@gnu.org>
25487
25488 * README: entered into RCS
25489
254901992-01-22 Richard Stallman <rms@gnu.org>
25491
25492 * src/machine.h: entered into RCS
25493
254941991-12-21 Richard Stallman <rms@gnu.org>
25495
25496 * src/lalr.c, src/closure.c:
25497 entered into RCS
25498
254991991-12-20 Richard Stallman <rms@gnu.org>
25500
25501 * src/state.h: entered into RCS
25502
255031991-12-18 Richard Stallman <rms@gnu.org>
25504
25505 * src/print.c, src/nullable.c, src/derives.c:
25506 entered into RCS
25507
255081991-11-03 David J. MacKenzie <djm@gnu.org>
25509
25510 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
25511 entered into RCS
25512
255131988-09-09 Richard Stallman <rms@gnu.org>
25514
25515 * src/bison.hairy: entered into RCS
25516
255171987-12-16 Richard Stallman <rms@gnu.org>
25518
25519 * REFERENCES: entered into RCS
dc546b0f 25520
f294a2c2 25521
04098407 25522 -----
f294a2c2 25523
e141f4d4
JD
25524 Copyright (C) 1987-1988, 1991-2010 Free Software Foundation,
25525 Inc.
f294a2c2 25526
04098407
PE
25527 Copying and distribution of this file, with or without
25528 modification, are permitted provided the copyright notice and this
25529 notice are preserved.