]> git.saurik.com Git - bison.git/blame - ChangeLog
i18n: update.
[bison.git] / ChangeLog
CommitLineData
825c88e8
JD
12010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
2
3 i18n: update.
4 * po/POTFILES.in: Add src/graphviz.c.
5
343c3db8
JD
62010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
7
8 i18n: fix for gnulib.
9 * po/POTFILES.in: Add remaining gnulib files that have
10 translatable strings.
11
42765f8e
JD
122010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
13
14 build: fix our adjustments for gnulib files in lib.
15 * configure.ac: For prepending lib/ to the values of config
16 variables, fix detection of empty values. Also, due to recent
17 gnulib changes, add LIBUNISTRING_UNITYPES_H and
18 LIBUNISTRING_UNIWIDTH_H to the list of those variables.
19
e35bc778
JD
202010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
21
22 maint: use announce-gen's new --mail-headers.
23 * HACKING (Announce): Update instructions.
24 * cfg.mk (announcement_Cc_): Define.
25 * configure.ac (AM_GNU_GETTEXT_VERSION): Update to 0.18 as
26 required by latest gnulib.
27 * gnulib: Update to latest.
28
b6ca79e8
JD
292010-07-24 Joel E. Denny <joeldenny@joeldenny.org>
30
31 tests: handle Valgrind that complains about >&-.
32 * tests/output.at (AT_CHECK_OUTPUT): Extend to accept pre-tests.
33 (Output files: -dv >&-): Skip test group if running
34 maintainer-check-valgrind.
35
ca2a6d15
PH
362010-07-23 Paul Hilfinger <hilfingr@EECS.Berkeley.EDU>
37
38 * NEWS: Describe new semantic-predicate feature.
39 * data/c.m4 (b4_predicate_case): New definition.
40 * data/java.m4 (b4_predicate_case): New definition.
41 * data/glr.c (yyimmediate): Add definition.
42 (yydoAction): Remove comment, now obsolete.
43 Do YY_REDUCE_PRINT here.
44 (yyglrReduce): Alter comment to indicate that semantic values
45 need not be deferred.
46 Remove YY_REDUCE_PRINT from here; done in yydoAction.
47 (yyprocessOneStack): Pass immediate flag.
48 Delete stacks rejected by predicates in newly split-off parsers.
49 Change handling of yyerr so that only current stack gets deleted
50 when semantic predicate fails.
51 (yyfillin): Don't crash if a semantic value is unresolved (as may
52 happen in predicate rules).
53 Copy lr state as well in debugging mode.
54 Update comment on setting of yysval to include yyloc as well.
55 (yy_reduce_print): Add yynormal argument. Perform fillin properly.
56 Report unresolved RHS values.
57 (yyimmediate): New table.
58 * src/gram.h (struct rule): Add is_predicate field.
59 * src/output.c (user_actions_output): Use b4_predicate_case for
60 predicates.
61 (prepare_symbols): Output yyimmediate.
62 * src/scan-gram.l: Add %? token, SC_PREDICATE state.
63 * src/scan-code.l (code_props_rule_action_init): Add is_predicate
64 argument.
65 * src/scan-code.h (struct code_props): Add is_predicate field.
66 (code_props_rule_action_init): New interface.
67 * src/parse-gram.y (%?{...}): New token.
68 (rhs): Add %?{...} rule.
69 * src/parse-gram.c: Regenerate.
70 * src/parse-gram.h: Regenerate.
71 * src/reader.c (grammar_current_rule_action_append): Add
72 immediate argument.
73 (grammar_midrule_action): Use new interface for
74 code_props_rule_action_init.
75 (grammar_current_rule_action_append): Ditto.
76 (packgram): Transfer is_predicate value.
77 * src/reader.h (grammar_current_rule_action_append): New interface.
78 * doc/bison.texinfo: Document semantic predicates (%?).
79
80 * data/glr.c (yylhsNonterm, yyisDefaultedState,yyDefaultAction)
81 (yygetLRActions,yynewGLRStackItem,yyaddDeferredAction,yyinitStateSet)
82 (yyinitGLRStack,yyexpandGLRStack,yyupdateSplit,yymarkStackDeleted)
83 (yyundeleteLastStack,yyglrShift,yyglrShiftDefer,yydoAction,yyglrReduce)
84 (yyidenticalOptions,yymergeOptionSets,yyresolveStates,yyresolveAction)
85 (yyresolveLocations,yyresolveValue,yyreducePrint): Update parameter
86 names in comments and mention all parameters.
87 (struct yyGLRState): Fix description of yyposn field.
88 (yyresolveLocations): Correct comment so as not to imply action when
89 yyn1==0.
90
7d424de1
PE
912010-06-17 Paul Eggert <eggert@cs.ucla.edu>
92
804e83b2
PE
93 Update from GFDL GFDL 1.2 to 1.3.
94 * doc/bison.texinfo: Update GFDL version number.
95 * doc/fdl.texi: Update to version 1.3, taken from:
96 http://www.gnu.org/licenses/fdl.texi
97
7d424de1
PE
98 Do not use date ranges in copyright notices.
99 See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices
100
101 * HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha:
102 * TODO, bootstrap, bootstrap.conf:
103 * build-aux/update-b4-copyright, cfg.mk, configure.ac:
104 * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4:
105 * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc:
106 * data/java-skel.m4, data/java.m4, data/lalr1.cc:
107 * data/lalr1.java, data/local.mk, data/location.cc:
108 * data/stack.hh, data/variant.hh, data/xslt/bison.xsl:
109 * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl:
110 * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint:
111 * djgpp/README.in, djgpp/config.bat, djgpp/config.sed:
112 * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat:
113 * djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h:
114 * djgpp/testsuite.sed, doc/bison.texinfo, doc/local.mk:
115 * doc/refcard.tex, etc/README, etc/bench.pl.in, etc/local.mk:
116 * examples/calc++/Makefile.am, examples/extexi:
117 * examples/local.mk, lib/abitset.c, lib/abitset.h:
118 * lib/bbitset.h, lib/bitset.c, lib/bitset.h:
119 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
120 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
121 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
122 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
123 * lib/libiberty.h, lib/local.mk, lib/main.c, lib/timevar.c:
124 * lib/timevar.def, lib/timevar.h, lib/vbitset.c:
125 * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4:
126 * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4:
127 * src/AnnotationList.c, src/AnnotationList.h:
128 * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c:
129 * src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c:
130 * src/assoc.h, src/closure.c, src/closure.h, src/complain.c:
131 * src/complain.h, src/conflicts.c, src/conflicts.h:
132 * src/derives.c, src/derives.h, src/files.c, src/files.h:
133 * src/flex-scanner.h, src/getargs.c, src/getargs.h:
134 * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c:
135 * src/ielr.h, src/lalr.c, src/lalr.h, src/local.mk:
136 * src/location.c, src/location.h, src/main.c:
137 * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c:
138 * src/named-ref.h, src/nullable.c, src/nullable.h:
139 * src/output.c, src/output.h, src/parse-gram.y:
140 * src/print-xml.c, src/print-xml.h, src/print.c, src/print.h:
141 * src/print_graph.c, src/print_graph.h, src/reader.c:
142 * src/reader.h, src/reduce.c, src/reduce.h, src/relation.c:
143 * src/relation.h, src/scan-code.h, src/scan-code.l:
144 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
145 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
146 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
147 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
148 * tests/actions.at, tests/atlocal.in, tests/c++.at:
149 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
150 * tests/existing.at, tests/glr-regression.at:
151 * tests/headers.at, tests/input.at, tests/java.at:
152 * tests/local.at, tests/local.mk, tests/named-refs.at:
153 * tests/output.at, tests/push.at, tests/reduce.at:
154 * tests/regression.at, tests/sets.at, tests/skeletons.at:
155 * tests/synclines.at, tests/testsuite.at, tests/torture.at:
156 Don't use date ranges in copyright notices.
157
38435078
AD
1582010-05-11 Akim Demaille <demaille@gostai.com>
159
160 lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
161 * data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
162 header file to the implementation file, after the user %code
163 sections.
164 * NEWS (2.5): Document this.
165
e944aaff
AD
1662010-05-11 Akim Demaille <demaille@gostai.com>
167
168 doc: please Emacs.
169 * doc/bison.texinfo (Local Variables): Move this after the
170 LocalWords, since the latter are looked for in the whole document,
171 while the former are looked for only at its end.
172 Require american spell checking.
173
86e5b440
AD
1742010-05-10 Akim Demaille <demaille@gostai.com>
175
176 doc: fix lalr1.cc documentation.
177 * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature.
178 (C++ Bison Interface): Fix lalr1.cc skeleton name.
179 (C++ Parser Interface): Fix semantic_type and location_type names.
180 Document yy::parser::token.
181 Reported by Jerry Quinn.
182
bb9191dd
AD
1832010-05-10 Akim Demaille <demaille@gostai.com>
184
185 c++: use YYRHSLOC.
186 * data/lalr1.cc (YYRHSLOC): New.
187 (YYLLOC_DEFAULT): Use it.
188 * data/glr.cc: If location_type was user defined, do not include
189 location.hh, and do not produce location.hh and position.hh.
190 * tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC.
191 Check that glr.cc supports user defined location_type.
192 * NEWS: Document this.
193
8aec287e
AD
1942010-05-07 Akim Demaille <demaille@gostai.com>
195
196 doc: fix typo.
197 * tests/synclines.at: here.
198
c826013f
AD
1992010-05-04 Akim Demaille <demaille@gostai.com>
200
201 tests: enhance AT_SYNCLINES_COMPILE.
202 * tests/synclines.at (AT_SYNCLINES_COMPILE): More distcc patterns.
203 (AT_TEST_SYNCLINE): Remove GCC 4.5 protection which is already
204 taken care of in AT_SYNCLINES_COMPILE.
205
7789b6e3
AD
2062010-05-04 Akim Demaille <demaille@gostai.com>
207
208 lalr1.cc: don't generate location.hh when location_type is defined
209 * data/bison.m4 (b4_percent_define_get): Accept a default value.
210 * data/c++.m4: Do not provide a default value for the %define
211 variable location_type, rather, use b4_percent_define_get with a
212 default argument where its value is needed.
213 * data/lalr1.cc: Do not load location.cc (which outputs both
214 location.hh and position.hh) if the user defined location_type.
215 Do not include location.hh either.
216
19ad326b
AD
2172010-05-04 Akim Demaille <demaille@gostai.com>
218
219 lalr1.cc: minor refactoring.
220 * data/lalr1.cc: Don't issue empty namespaces.
221
f5da8149
AD
2222010-05-04 Akim Demaille <demaille@gostai.com>
223
224 tests: fix %printer.
225 Currently, there is no check that %printer ... <foo> (nor
226 %destructor) is about an existing <foo> type. This C++ test had
227 it wrong (<::std::string> vs. <std::string>).
228
229 * tests/c++.at (AT_CHECK_VARIANTS): In list.yy, redefine the
230 pretty-printing of lists into something better for parser traces.
231 Update the expected output.
232 Fix correspondance between %type/%token and %printer.
233
49976d5c
AD
2342010-05-04 Akim Demaille <demaille@gostai.com>
235
236 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
237 * tests/calc.at (Span): Instead of begin/end, as in the built-in
238 location class, use first and last.
239 Define YYLLOC_DEFAULT to adjust to these changes.
240 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
241 location_type changes.
242
bc81de36
JD
2432010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
244
245 tests: fix maintainer-xml-check.
246 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
247 Update output to include comments now produced by --graph.
248 (xsl:template match="automaton"): As for --graph, name the
249 digraph after the grammar file.
250 * src/print-xml.c (escape_bufs): Enlarge array.
251 (print_xml): Add bug-report and url attributes to
252 bison-xml-report element.
253
b7666378
JD
2542010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
255
256 In DOT output, convert from "/*" comments to "//" comments.
257 This handles the possibility that a "*/" might appear in
258 variable portions of those comments at some point in the future.
259 * src/graphviz.c (start_graph): Implement.
260
9b5049bd
JD
2612010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
262
263 Document that undefined %prec identifier warnings will remain.
264 * NEWS (2.4.3): Here.
265 (2.4.2): Here.
266
02354690
JD
2672010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
268
269 Revert 2009-12-30 change for undefined %prec token complaints.
270 That is, keep them as warnings because that should be sufficient
271 to satisfy POSIX without creating backward compatibility issues.
272 Suggested by Richard Stallman at
273 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
274 * NEWS (2.5): Remove mention of complaint.
56e92e0b
JD
275 * src/reader.c (grammar_rule_check): Convert complaint back to
276 warning.
02354690
JD
277 * tests/input.at (%prec's token must be defined): Update.
278
a7ddefd1
JD
2792010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
280
281 build: don't require src/bison during bootstrap.
282 Suggested by Eric Blake at
283 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
284 * bootstrap.conf (bootstrap_epilogue): New function to make sure
285 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
286
c1bd4b2b
JD
2872010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
288
289 i18n: fix untranslatable string.
290 Reported by Goran Uddeborg at
291 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
292 * src/muscle-tab.c (muscle_percent_define_insert): Here.
293
67f1a2c2
AD
2942010-04-13 Akim Demaille <demaille@gostai.com>
295
296 tests: calc: minor refactoring.
297 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
298
4f756f88
AD
2992010-04-13 Akim Demaille <demaille@gostai.com>
300
301 tests: calc: simplify location management.
302 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
303 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
304 define the appropriate AT_LOC accessors.
305 * tests/calc.at: Use AT_LOC accessors.
306
24bb8c8c
AD
3072010-04-13 Akim Demaille <demaille@gostai.com>
308
309 test location_type.
310 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
311 Define AT_LOCATION_TYPE_IF.
312 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
313 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
314 used, provide a user location type and use it.
315 (Simple LALR1 C++ Calculator): Add a test case for location_type.
316
af129079
AD
3172010-04-13 Akim Demaille <demaille@gostai.com>
318
319 tests: check fclose's return value.
320 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
321
36dc3637
AD
3222010-04-13 Akim Demaille <demaille@gostai.com>
323
324 tests: don't depend on the actual location type.
325 * tests/calc.at: Use yy::parser::location_type rather than
326 yy::location, since the former is always right, and might point to
327 another type than the latter.
328
c499231d
AD
3292010-04-13 Akim Demaille <demaille@gostai.com>
330
331 formatting changes.
332 * tests/calc.at: Formatting changes.
333
7799ef15
AD
3342010-04-13 Akim Demaille <demaille@gostai.com>
335
336 lalr1.cc: remove useless forward declaration.
337 * data/lalr1.cc: Include location.hh before stack.hh.
338 Remove the useless forward declarations of position and location.
339 Reported by Chris Morley.
340 * data/glr.cc: Likewise.
341
06cb07d5
JD
3422010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
343
344 * NEWS (2.4.3): Mention fix for Sun Studio C++.
345
4586c8cd
JD
3462010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
347
348 tests: fix for newer Sun Studio C++.
349 Reported by Dagobert Michelsen at
350 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
351 * THANKS (Dagobert Michelsen): Add.
352 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
353 Autoconf macro for handling the restrict keyword.
354 * gnulib: Update to latest, which no longer overrides that macro
355 from Autoconf.
356
44c2b42d
JD
3572010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
358
359 portability: fix pointer arithmetic to conform to C standard.
360 Reported by Tys Lefering at
361 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
362 This fix is already implemented in glr.c and does not apply to
363 lalr1.java.
364 * data/lalr1.cc (yy::parser::parse): Increase size of
365 yyerror_range and adjust subscripting so you don't have to
366 subtract one from the beginning of the array.
367 * data/yacc.c (b4_declare_parser_state_variables,
368 yyparse, yypush_parse): Likewise.
369
218287f5
AD
3702010-04-05 Akim Demaille <demaille@gostai.com>
371
372 remove useless include.
373 * src/graphviz.h: Don't include stdbool.h.
374
8176ab33
AD
3752010-04-05 Akim Demaille <demaille@gostai.com>
376
377 graph: sign the output file.
378 * src/graphviz.c (start_graph): Issue comments about Bison.
379 Suggested by Tys Lefering.
380
4ad3921d
JD
3812010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
382
383 portability: fix test suite for GCC 4.5's new #error message.
384 Reported by Tys Lefering at
385 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
386 * NEWS (2.4.3): Mention.
387 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
388
10a697de
AD
3892010-03-30 Akim Demaille <demaille@gostai.com>
390
391 fix comments.
392 * src/graphviz.h: Add missing license notice.
393 Document.
394
d6b347e4
AD
3952010-03-25 Akim Demaille <demaille@gostai.com>
396
397 tests: fix 250: parse.error=verbose overflow.
398 * tests/regression.at (parse.error=verbose overflow): Avoid the
399 double inclusion of stdlib.h as it triggers hard errors.
400
b8675840
JD
4012010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
402
403 portability: fix for BSD make.
404 Reported by Johan van Selst at
405 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
406 * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in
407 this dependency list as in package.m4's target rule.
408
8b9e021f
JD
4092010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
410
411 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
412 Reported by Johan van Selst at
413 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
414 * NEWS (2.4.3): New.
415 * THANKS (Johan van Selst): Add.
416 * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
417 targets so that gnulib's new c++defs.h is matched.
418 * gnulib: Update to latest.
419
96a381c5
JD
4202010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
421
422 maint: update for changes to gnulib's announce-gen.
423 * HACKING (Announce): RELEASE_TYPE=major must now be written
424 RELEASE_TYPE=stable.
425
e19a049c
JD
4262010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
427
428 Version 2.4.2.
429 * NEWS (2.4.2): Set version and date. For the recent test suite
430 portability fixes, don't be so optimistic about their success
431 given the lack of feedback on the affected platforms.
432
890aeb28
JD
4332010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
434
435 tests: fix maintainer-xml-check for recent changes.
436 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
437 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
438 output file whose name conflicts with a previous output file
439 is now never generated.
440
f39ab286
JD
4412010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
442
443 portability: fix several issues with M4 subprocess.
444
445 M4's output pipe was not being drained upon fatal errors during
446 scan_skel. As a result, broken-pipe messages from M4 were seen
447 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
448 failure in the test suite. The problem was that, on platforms
449 where the default disposition for SIGPIPE is ignore instead of
450 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
451 then reported it. However, there's some sort of race condition,
452 because the new test group occasionally succeeded.
453 Reported by Albert Chin at
454 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
455
456 There were also problems with the test suite livelocking on
457 Tru64 5.1b. Reported by Didier Godefroy at
458 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
459 Switching to create_pipe_bidi suggested by Akim Demaille.
460
461 To attempt to solve both of these problems, switch to gnulib's
462 create_pipe_bidi and register M4 process as a slave. Along the
463 way, clean up file name conflict handling, which was affected by
464 the broken-pipe problem before the switch.
465 * NEWS (2.4.2): Document.
466 * THANKS (Didier Godefroy): Add.
467 * bootstrap.conf (gnulib_modules): Add pipe.
468 * gnulib: Update to latest to make sure we have all the latest
469 fixes.
470 * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and
471 subpipe.c.
472 * po/POTFILES.in (lib/subpipe.c): Remove.
473 * src/files.c (compute_output_file_names): Update invocations
474 of output_file_name_check.
475 (output_file_name_check): In the case that the grammar file
476 would be overwritten, use complain instead of fatal, but replace
477 the output file name with /dev/null. Use the /dev/null solution
478 for the case of two conflicting output files as well because it
479 seems safer in case Bison one day tries to open both files at
480 the same time.
481 * src/files.h (output_file_name_check): Update prototype.
482 * src/output.c (output_skeleton): Use create_pipe_bidi and
483 wait_subprocess. Assert that scan_skel completely drains the
484 pipe.
485 * src/scan-skel.l (at_directive_perform): Update
486 output_file_name_check invocation.
487 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
488 grammar file actually isn't overwritten.
489 (Conflicting output files: -o foo.y): Update expected output.
490 * tests/skeletons.at (Fatal errors but M4 continues producing
491 output): New test group.
492
e32050b0
JD
4932010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
494
495 Update POTFILES.
496 * HACKING (Release Procedure): Add reminder about keeping
497 POTFILES files up-to-date.
498 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
499
efc4ed4a
JD
5002010-02-01 Joel E. Denny <jdenny@clemson.edu>
501
502 Code cleanup.
503 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
504 which is already defined in atconfig.
505
95611b56
JD
5062010-01-22 Joel E. Denny <jdenny@clemson.edu>
507
508 tests: fix missing include caught by g++ 4.4.1.
509 Reported by Tys Lefering.
510 * HACKING (Release checks): Add note about trying a recent GCC.
511 * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include
512 cstdlib for abort.
513 (_AT_DATA_EXPECT2_Y): Likewise.
514
d6e40cba
JD
5152010-01-21 Joel E. Denny <jdenny@clemson.edu>
516
517 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
518
80b70223
JD
5192010-01-21 Joel E. Denny <jdenny@clemson.edu>
520
521 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
522 * HACKING (Release Procedure): Update notes on copyright years.
523 * Makefile.am (update-package-copyright-year): New target rule.
524 * build-aux/update-package-copyright-year: New file.
525 * cfg.mk (update-copyright): Add update-package-copyright-year
526 as a dependency.
527
3320a276
JD
5282010-01-19 Joel E. Denny <jdenny@clemson.edu>
529
530 * bootstrap: Import improvements from latest gnulib.
531
e30c0477
JD
5322010-01-19 Joel E. Denny <jdenny@clemson.edu>
533
534 build: require Automake 1.11.1 to avoid a security flaw.
535 * HACKING (Release Procedure): Don't document Automake security
536 flaw here.
537 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
538 why here.
539
a538eeb1
JD
5402010-01-19 Joel E. Denny <jdenny@clemson.edu>
541
542 gnulib: update to latest.
543
d6bdb90a
JD
5442010-01-19 Joel E. Denny <jdenny@clemson.edu>
545
546 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
547
326e5cf8
JD
5482010-01-15 Joel E. Denny <jdenny@clemson.edu>
549
550 Thank the developer of the initial push parser implementation.
551 This unfortunate oversight is several years old.
552 * THANKS (Odd Arild Olsen): Add.
553
fca9c5ef
JD
5542010-01-04 Joel E. Denny <jdenny@clemson.edu>
555
556 Fix some comments concerning LR(0) versus LALR(1).
557
558 Stop equating LR(0) with nondeterminism and LALR(1) with
559 determinism. That is, if all states are consistent, then LR(0)
560 tables are deterministic. On the other hand, LALR(1) tables
561 might be nondeterministic before conflict resolution, and GLR
562 permits LALR(1) tables to remain nondeterministic.
563 * src/LR0.c, src/LR0.h: Here.
564 * src/lalr.c, src/lalr.h: Here.
565 * src/main.c (main): Here.
566 * src/state.c, src/state.h: Here.
567
568 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
569 parser tables.
570
e141f4d4
JD
5712010-01-04 Joel E. Denny <jdenny@clemson.edu>
572
573 maint: run "make update-copyright"
574
882be728
JD
5752009-12-30 Joel E. Denny <jdenny@clemson.edu>
576
577 POSIX: complain if %prec's token was not defined.
578 * NEWS (2.5): Document.
579 * src/reader.c (grammar_rule_check): Convert warning to
580 complaint.
581 * tests/input.at (%prec's token must be defined): Update.
582
8bb3a2e7
JD
5832009-12-30 Joel E. Denny <jdenny@clemson.edu>
584
585 POSIX: warn if %prec's token was not defined.
586 Reported by Florian Krohm at
587 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
588 * NEWS (2.4.2): Document.
589 * src/reader.c (grammar_rule_check): Implement.
590 (grammar_current_rule_prec_set): Add comments explaining that we
591 here assume a %prec identifier is a token, but we still manage
592 to support POSIX.
593 * tests/input.at (%prec's token must be defined): New test
594 group.
595
505e1551
JD
5962009-12-31 Joel E. Denny <jdenny@clemson.edu>
597
598 * HACKING (Release Procedure): Recommend a secure automake.
599
b8d19cf8
JD
6002009-12-29 Joel E. Denny <jdenny@clemson.edu>
601
602 portability: `<' and `>' are not always defined on addresses.
603 Specifically, don't sort objects by their memory addresses when
604 they're not allocated in the same array or other object. Though
605 I haven't found a test case where that fails on my platform, C
606 says the behavior is undefined.
607 * src/AnnotationList.c (AnnotationList__insertInto): Remove
608 FIXME. Use new id field of InadequacyList nodes rather than
609 their memory addresses when sorting.
610 (AnnotationList__compute_from_inadequacies): Add
611 inadequacy_list_node_count argument to pass to
612 InadequacyList__new_conflict.
613 * src/AnnotationList.h
614 (AnnotationList__compute_from_inadequacies): Update prototype
615 and documentation for new argument.
616 * src/InadequacyList.c (InadequacyList__new_conflict): Add
617 node_count argument and use it to assign a unique ID.
618 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
619 (InadequacyList): Add id field.
620 (InadequacyList__new_conflict): Update prototype and
621 documentation for new argument.
622 * src/ielr.c (ielr_compute_annotation_lists): Update
623 AnnotationList__compute_from_inadequacies invocation.
624
df222dfa
JD
6252009-12-20 Joel E. Denny <jdenny@clemson.edu>
626
627 Fix handling of yychar manipulation in user semantic actions.
628 The problem was that yacc.c didn't always update the yychar
629 translation afterwards. However, other skeletons appear to be
630 fine. glr.c appears to already translate yychar before every
631 use. lalr1.cc does not define yychar and does not document its
632 replacement, yyla, for users. It does provide yyclearin, but
633 that does not manipulate yyla and thus requires no translation
634 update. In lalr1.java, yychar is out of scope during semantic
635 actions.
636 * NEWS (2.5): Document.
637 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
638 yytoken here.
639 (yyparse, yypush_parse): Instead, translate before every use of
640 yytoken, and add comments explaining this approach.
641 * tests/actions.at (Destroying lookahead assigned by semantic
642 action): New test group checking that translation happens before
643 lookahead destructor calls at parser return. Previously,
644 incorrect destructors were called.
645 * tests/conflicts.at (parse.error=verbose and consistent
646 errors): New test group checking that translation happens at
647 syntax error detection before the associated verbose error
648 message and the associated lookahead destructor calls. While
649 the destructor call is fixed by this patch, the verbose error
650 message is currently incorrect due to another bug (see
651 comments in test group), so this is an expected failure for now.
652
4395a9ff
JD
6532009-12-21 Joel E. Denny <jdenny@clemson.edu>
654
655 YYFAIL: warn about uses and remove from lalr1.java.
656 * NEWS (2.5): Document.
657 * data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
658 and make it private. Update all uses.
659 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
660
1625df5b
JD
6612009-12-21 Joel E. Denny <jdenny@clemson.edu>
662
663 YYFAIL: deprecate.
664 * NEWS (2.4.2): Document deprecation and the phase-out plan.
665 * data/lalr1.java (parser::YYStack::YYFAIL): Add comment about
666 deprecation.
667 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
668 YYFAIL from GCC cpp's -Wunused-macros.
669 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
670 documentation.
671 (LocalWords): Remove YYFAIL.
672
5335b65a
JD
6732009-12-20 Joel E. Denny <jdenny@clemson.edu>
674
675 tests: cleanup.
676 * tests/c++.at (Syntax error discarding no lookahead): Don't
677 ignore stderr. Instead, eliminate remaining warnings.
678
d59beda0
JD
6792009-12-18 Joel E. Denny <jdenny@clemson.edu>
680
681 lalr1.cc: don't discard non-existent lookahead on syntax error.
682 * data/lalr1.cc (parser::parse): Check yyempty first.
683 * tests/c++.at (Syntax error discarding no lookahead): New test
684 group.
685
387b4d50
JD
6862009-12-17 Joel E. Denny <jdenny@clemson.edu>
687
688 Code cleanup.
689 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
690 function, which is no longer used.
691
a603c6e0
JD
6922009-12-16 Joel E. Denny <jdenny@clemson.edu>
693
694 Add gcc's -Wundef to test suite and fix another warning from it.
695 * NEWS (2.4.2): Update description of -Wundef fix.
696 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
697 (WARN_CFLAGS_TEST): New substitution.
698 * data/glr.c: Avoid warning about __STRICT_ANSI__.
699 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
700 WARN_CFLAGS.
701 (NO_WERROR_CFLAGS): Likewise.
702 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
703
19750d31
JD
7042009-12-16 Joel E. Denny <jdenny@clemson.edu>
705
706 * data/yacc.c: Reformat m4 a little.
707
c938d650
JD
7082009-12-16 Joel E. Denny <jdenny@clemson.edu>
709
710 Document gcc -Wundef fix.
711 * NEWS (2.4.2): Here.
712 * THANKS (Jonathan Nieder): Add.
713
fcd32abd
JN
7142009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
715
716 Simplify y.tab.c when location tracking is disabled.
717 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
718 tracking is not enabled. Instead, unconditionally define
719 YY_LOCATION_PRINT as a no-op for backward compatibility.
720
ae93128c
JN
7212009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
722
723 Avoid warnings from gcc -Wundef y.tab.c.
724 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
725 defined before using them.
726 * data/lalr1.cc: Likewise.
727 * data/yacc.c: Likewise.
728
c843aaab
JD
7292009-12-15 Joel E. Denny <jdenny@clemson.edu>
730
731 autoconf: update to latest for fix of M4 detection.
732 Reported by Eric Blake.
733 * submodules/autoconf: Update.
734
5c99151a
JD
7352009-12-15 Joel E. Denny <jdenny@clemson.edu>
736
737 portability: use -DGNULIB_POSIXCHECK.
738 Reported by Eric Blake. See discussions at
739 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
740 and
741 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
742 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
743 * bootstrap.conf (gnulib_modules): Add all the printf modules
744 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
745 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
746 (excluded_files): Remove m4/printf-posix.m4.
747 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
748 lib/libbison.a so gnulib libraries can be linked.
749
75f94c6d
JD
7502009-12-15 Joel E. Denny <jdenny@clemson.edu>
751
752 gnulib: update for fix of fprintf-posix, which we'll use soon.
753 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
754 targets so that gnulib's new arg-nonnull.h and link-warning.h
755 are matched.
756 * gnulib: Update.
757
ca01f454
JD
7582009-12-14 Joel E. Denny <jdenny@clemson.edu>
759
760 Enable assertion output and --disable-assert for configure.
761 * bootstrap.conf (gnulib_modules): Add assert module.
762 * src/system.h (aver): Define as assert, and summarize the
763 discussion on this issue.
764
9dc3ee6d
JD
7652009-12-14 Joel E. Denny <jdenny@clemson.edu>
766
767 Expand GLR acronym in summary of Bison.
768 Based on discussion with Akim Demaille starting at
769 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
770 * doc/bison.texinfo (Introduction): Here.
771 * src/getargs.c (usage): Here.
772
d013372c
AR
7732009-10-03 Alex Rozenman <rozenman@gmail.com>
774
775 Document named references.
776 * doc/bison.texinfo (Actions): Add new example and xref to
777 Using Named References node.
778 (Using Named References): New node.
779
5297ebb3
JD
7802009-10-16 Joel E. Denny <jdenny@clemson.edu>
781
782 cleanup.
783 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
784 of char*.
785 (Sbitset__isEmpty): Use Sbitset instead of char*.
786 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
787 instead of char. This helps to avoid casting errors.
788 (Sbitset__or): Use Sbitset instead of char*.
789
175620d3
JD
7902009-10-16 Joel E. Denny <jdenny@clemson.edu>
791
792 portability: don't assume 8-bit bytes.
793 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
794 * src/Sbitset.h (Sbitset__nbytes): Here.
795 (Sbitset__byteAddress): Here.
796 (Sbitset__bit_mask): Here.
797 (Sbitset__last_byte_mask): Here.
798 (Sbitset__ones): Here.
799 (SBITSET__FOR_EACH): Here.
800
786578e3
JD
8012009-10-11 Joel E. Denny <jdenny@clemson.edu>
802
803 portability: use va_start and va_end in the same function.
804 * src/complain.c (error_message): Move va_end from here...
805 (ERROR_MESSAGE): ... to here.
806
416a9da6
JD
8072009-10-08 Joel E. Denny <jdenny@clemson.edu>
808
809 * data/bison.m4: Update comments for rename to muscle-tab.h.
810
10659d0e
JD
8112009-10-07 Joel E. Denny <jdenny@clemson.edu>
812
813 Minor code cleanup.
814 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
815 replace all uses with UNIQSTR_CONCAT.
816 * src/uniqstr.c (uniqstr_vsprintf): New function.
817 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
818 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
819 macros.
820
3c5362b8
JD
8212009-10-06 Joel E. Denny <jdenny@clemson.edu>
822
823 * TODO (Complaint submessage indentation): New.
824
b143f404
JD
8252009-10-04 Joel E. Denny <jdenny@clemson.edu>
826
827 Minor code cleanup.
828 * src/parse-gram.y: Clean up sorting of declarations.
829 Use types to simplify %printer declarations where possible.
830 Provide %printer for BRACKETED_ID and symbol.prec.
831 * src/symtab.c: Whitespace change.
832
7439c5c0
JD
8332009-10-04 Joel E. Denny <jdenny@clemson.edu>
834
835 tests: skip tests of file names that platform does not support.
836 Reported by Michael Raskin at
837 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
838 * THANKS (Michael Raskin): Add.
839 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
840 to fail at least for file names containing ":" or "\".
841
45319f13
JD
8422009-09-23 Joel E. Denny <jdenny@clemson.edu>
843
844 yysyntax_error: avoid duplicate lookahead collection.
845 Except when memory reallocation is required, this change
846 eliminates the need to invoke yysyntax_error twice and thus to
847 repeat the collection of lookaheads. It also prepares for
848 future extensions that will make those repetitions more
849 expensive and that will require additional memory management in
850 yysyntax_error. Finally, it fixes an obscure bug already
851 exercised in the test suite.
852 * data/yacc.c (yysyntax_error): Add arguments for message
853 buffer variables stored in the parser. Instead of size, return
854 status similar to yyparse status but indicating success of
855 message creation. Other than the actual reallocation of the
856 message buffer, import and clean up memory management code
857 from...
858 (yyparse, yypush_parse): ... here.
859 * tests/regression.at (parse.error=verbose overflow): No longer
860 an expected failure.
861
52cea04a
JD
8622009-09-23 Joel E. Denny <jdenny@clemson.edu>
863
864 yysyntax_error: test memory management more.
865 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
866 * tests/regression.at (parse.error=verbose and
867 YYSTACK_USE_ALLOCA): New test group.
868 (parse.error=verbose overflow): New test group that reveals an
869 obscure bug. Expected fail for now.
870
37318e2f
JD
8712009-10-04 Joel E. Denny <jdenny@clemson.edu>
872
873 benchmarks: use %debug consistently among grammars.
874 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
875 %debug by default. It can affect the timings even if yydebug=0.
876 (generate_grammar_calc): For consistency with other grammars,
877 use YYDEBUG environment variable to set yydebug.
878
f74d6d25
JD
8792009-10-03 Joel E. Denny <jdenny@clemson.edu>
880
881 Remove dead code.
882 * src/symtab.c (symbol_pack): Here because every symbol's number
883 is always defined by this time.
884
5b1ff423
AR
8852009-10-03 Alex Rozenman <rozenman@gmail.com>
886
887 Add additional space after periods in NEWS.
888 * NEWS (2.5): here.
889
47eced30
JD
8902009-09-29 Joel E. Denny <jdenny@clemson.edu>
891
892 Use the correct conversion specifier for size_t.
893 Reported by Jim Meyering.
894 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
895 because Sbitset__Index is size_t.
896 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
897
d8f68fc2
JD
8982009-09-27 Joel E. Denny <jdenny@clemson.edu>
899
900 tests: don't abuse AT_BISON_CHECK.
901 * tests/regression.at (parse-gram.y: LALR = IELR): Move
902 additional shell commands outside of AT_BISON_CHECK.
903
43aabb70
JD
9042009-09-26 Joel E. Denny <jdenny@clemson.edu>
905
906 tests: check that parse-gram.y's IELR and LALR are identical.
907 * tests/atlocal.in (abs_top_srcdir): New shell variable.
908 * tests/regression.at (parse-gram.y: LALR = IELR): New test
909 group.
910
66381412
AR
9112009-09-19 Alex Rozenman <rozenman@gmail.com>
912
913 Keep sub-messages aligned. Fix strings for translation.
5b1ff423
AR
914 * src/location.h (location_print): Add return value.
915 * src/location.c (location_print): Return number of printed
66381412 916 characters.
5b1ff423
AR
917 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
918 new functions.
919 * src/complain.cpp (indent_ptr): New static variable.
920 (error_message, complain_at_indent, warn_at_indent): Implement
921 the alignment mechanism.
922 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
923 for translations. Use new alignment mechanism.
924 * tests/named-ref.at: Adjust test-cases.
66381412
AR
925 * NEWS (2.5): Add an announcement about named references.
926
a6ca4ce2
AD
9272009-09-17 Akim Demaille <demaille@gostai.com>
928
929 doc: fixes.
930 * doc/bison.texinfo: here.
931 Reported by Alex Rozenman.
932
3cdc21cf
AD
9332009-09-16 Akim Demaille <demaille@gostai.com>
934
935 doc: lalr1.cc and variants.
936 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
937 "variant" %define variables.
938 (C++ Semantic Values): Split into...
939 (C++ Unions, C++ Variants): these.
940 The latter is new.
941 (C++ Parser Interface): Fix type names.
942 Document parser::syntax_error.
943 Document the fact that locations are not mandatory.
944 (C++ Scanner Interface): Split into...
945 (Split Symbols, Complete Symbols): these.
946 The later is new.
947 (Calc++ Parsing Driver): Use variants.
948 Add more comments.
949 Adjust style.
950 (Calc++ Parser): Declare all the tokens, no
951 longer accept raw characters.
952 Remove %union.
953 Adjust types and printers.
954 Remove destructors.
955 (Calc++ Scanner): Use make_<SYMBOL> functions.
956 Use strerror in error message.
957
f50bfcd6
AD
9582009-09-16 Akim Demaille <demaille@gostai.com>
959
960 doc: spell checking.
961 * doc/bison.texinfo: here.
962
6b5a0de9
AD
9632009-09-16 Akim Demaille <demaille@gostai.com>
964
965 doc: comment changes.
966 * doc/bison.texinfo: Comment changes.
967
2b08bceb
AD
9682009-09-16 Akim Demaille <demaille@gostai.com>
969
970 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
971 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
972 constructor to take a token_type instead of the (internal) symbol
973 number.
974 Call yytranslate_.
975 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
976 don't call yytranslate_ here.
977
c981ce9b
AD
9782009-09-16 Akim Demaille <demaille@gostai.com>
979
980 TODO: statistics.
981 * TODO (Figures): New.
982
00d80a9c
JD
9832009-09-13 Joel E. Denny <jdenny@clemson.edu>
984
985 tests: clean up push.at test group titles.
986 * tests/push.at: Remove "Push Parsing: " from test group titles
987 because these are already under the banner "Push Parsing Tests".
988
f64e406b
AR
9892009-09-12 Alex Rozenman <rozenman@gmail.com>
990
991 Provide an additional sub-message for clarity.
992 Add "symbol not found in production" error message when
993 an "invalid reference" is detected in named references
994 resolution.
995 * src/scan-code.l: Update "invalid reference" case.
996 * tests/named-ref.at: Adjust test-cases.
997
bb31eb56
JD
9982009-09-10 Joel E. Denny <jdenny@clemson.edu>
999
1000 Clean up yacc.c a little.
1001 * data/yacc.c: Clean up M4 for readability, and make output
1002 whitespace more consistent. For the main parse function
1003 comment, instead of saying "yyparse or yypush_parse", say either
1004 "yyparse" or "yypush_parse" depending on which it actually is.
1005
2d399888
JD
10062009-09-10 Joel E. Denny <jdenny@clemson.edu>
1007
1008 Fix --enable-gcc-warnings.
1009 * src/parse-gram.y (%printer <param>): Handle param_none.
1010
ff601366
AD
10112009-09-09 Akim Demaille <demaille@gostai.com>
1012
1013 lalr1.cc: syntax_error as exceptions.
1014 It is common to use sort of factories in the user actions. These
1015 factories may check some "syntactic" constraints that are not
1016 enforced by the grammar itself. This is possible using YYERROR
1017 within the action itself. Provide the user with a means to throw
1018 a syntax_error exception.
1019
1020 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
1021 Declare and define yy::parser::syntax_error.
1022 * data/lalr1.cc: Include stdexcept.
1023 (yy::parser::parse): Wrap the user action within a try/catch.
1024 * data/glr.cc: Include stdexcept.
1025
29660062
AD
10262009-09-09 Akim Demaille <demaille@gostai.com>
1027
1028 lalr1.cc: add missing "inline".
1029 * data/c++.m4 (b4_public_types_define): Add missing inline to
1030 implementations provided in headers.
1031
2055a44e
AD
10322009-09-09 Akim Demaille <demaille@gostai.com>
1033
1034 %param: documentation.
1035 * NEWS (2.6): Document %param, %lex-param, and %parse-param
1036 changes.
1037 * doc/bison.texinfo: Document that %lex-param and %parse-param
1038 are n-ary.
1039 Changes some examples to demonstrate it.
1040 (Calc++ Parser): Use %param.
1041
dd875058
AD
10422009-09-09 Akim Demaille <demaille@gostai.com>
1043
1044 Regen.
1045
f71db70b
AD
10462009-09-09 Akim Demaille <demaille@gostai.com>
1047
1048 style changes.
1049 * src/parse-gram.y (add_param): Scope changes.
1050
eaca4c11
AD
10512009-09-09 Akim Demaille <demaille@gostai.com>
1052
1053 %parse: support several arguments.
1054 * src/parse-gram.y (current_param): New.
1055 (param_type): Add param_none.
1056 (params): New nonterminal.
1057 Use it.
1058
b18cdd91
AD
10592009-09-09 Akim Demaille <demaille@gostai.com>
1060
1061 Regen.
1062
a7706735
AD
10632009-09-09 Akim Demaille <demaille@gostai.com>
1064
1065 %param.
1066 Provide a means to factor lex-param and parse-param common
1067 declarations.
1068
1069 * src/parse-gram.y (param_type): New.
1070 Define a %printer for it.
1071 (add_param): Use it.
1072 (%parse-param, %lex-param): Merge into...
1073 (%parse): this new token.
1074 Adjust the grammar to use it.
1075 * src/scan-gram.l (RETURN_VALUE): New.
1076 (RETURN_PERCENT_FLAG): Use it.
1077 (RETURN_PERCENT_PARAM): New.
1078 Use it to support %parse-param, %lex-param and %param.
1079
9789acf0
JD
10802009-09-03 Joel E. Denny <jdenny@clemson.edu>
1081
1082 Use aver not assert.
1083 * src/output.c: Don't include assert.h.
1084 (output_skeleton): Use aver not assert.
1085 * src/system.h (aver): In documentation of why, add links to
1086 Paul Eggert's explanations in the mailing lists.
1087
61bc57e5
AR
10882009-09-05 Alex Rozenman <rozenman@gmail.com>
1089
1090 Use "Unresolved reference" error message when no symbols were found
1091 in a symbolic reference resolution. Remove .expr and -expr from
1092 the shown reference when the reference is unresolved.
1093 * src/scan-code.l: Change the error message, adjust location columns,
1094 rename variable "exact_mode" to "explicit_bracketing".
1095 * tests/named-ref.at: Adjust existing tests and add a new one.
1096
f4c75eaf
AD
10972009-09-04 Akim Demaille <demaille@gostai.com>
1098
1099 Adjust synclines in src/parse-gram.[ch].
1100 * tests/bison.in: Do some magic (including working around issues
1101 with ylwrap) when this wrapper is used to compile
1102 src/parse-gram.y.
1103
c6abeab1
JD
11042009-09-03 Joel E. Denny <jdenny@clemson.edu>
1105
1106 Complain about unused %define variables and %code qualifiers.
1107 * NEWS (2.5): Document.
1108 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
1109 * doc/bison.texinfo (Decl Summary): Document complaint, and
1110 improve %define documentation a little otherwise.
1111 * tests/input.at (Reject unused %code qualifiers): Update.
1112 (%define errors): Update.
1113 (%define, --define, --force-define): Update.
1114 (%define backward compatibility): Update.
1115 (Unused %define api.pure): Update.
1116 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
1117
82db7cdb
JD
11182009-09-03 Joel E. Denny <jdenny@clemson.edu>
1119
1120 Don't suppress warnings about unused parse.error.
1121 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
1122 %define variable parse.error unless b4_error_verbose_flag is
1123 actually expanded in a skeleton.
1124
2755de8f
AD
11252009-09-03 Akim Demaille <demaille@gostai.com>
1126
1127 * NEWS (2.4.2): Add "Internationalization" item.
1128
1deef26d
AD
11292009-09-03 Akim Demaille <demaille@gostai.com>
1130
1131 bootstrap: fix/improve find_tool.
1132 * bootstrap (find_tool): Improve error messages.
1133 Fix typo about find_tool_names.
1134
2646cd54
JD
11352009-08-29 Joel E. Denny <jdenny@clemson.edu>
1136
1137 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
1138 See
1139 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
1140 * src/scan-code.h (code_props_rule_action_init): Rename
1141 named_ref arg to name so it doesn't shadow named_ref type. This
1142 makes it consistent with the function definition in scan-code.l
1143 anyway.
1144
cf499cff
JD
11452009-08-28 Joel E. Denny <jdenny@clemson.edu>
1146
1147 %define: accept unquoted values.
1148 * NEWS (2.5): Group all %define changes together, and document
1149 this one. Remove quotes in IELR and canonical LR entry.
1150 * doc/bison.texinfo: Remove quotes in most examples throughout.
1151 (Decl Summary): Update %define documentation.
1152 (Table of Symbols): Likewise.
1153 * src/ielr.c (LrType): Update documentation.
1154 * src/parse-gram.y (content.opt): Add production for ID.
1155 * tests/actions.at: Remove quotes in most tests.
1156 * tests/calc.at: Likewise.
1157 * tests/existing.at: Likewise.
1158 * tests/input.at: Likewise.
1159 * tests/local.at: Likewise.
1160 * tests/push.at: Likewise.
1161 * tests/reduce.at: Likewise.
1162 * tests/torture.at: Likewise.
1163
6ba96404
JD
11642009-08-28 Joel E. Denny <jdenny@clemson.edu>
1165
1166 %define lr.type: make values lowercase IDs.
1167 That is, "LALR" => "lalr", "IELR" => "ielr", and
1168 "canonical LR" => "canonical-lr".
1169 * NEWS (2.5): Update documentation.
1170 * doc/bison.texinfo (Decl Summary): Likewise.
1171 * src/ielr.c (ielr): Use new values.
1172 * src/ielr.h (ielr): Update documentation.
1173 * src/reader.c (prepare_percent_define_front_end_variables): Use
1174 and validate new values.
1175 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
1176 grammars.
1177 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
1178
4413bbd3
EB
11792009-08-27 Eric Blake <ebb9@byu.net>
1180
1181 scan-gram: avoid portability trap with ctype usage.
1182 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
1183 Avoid compiler warning.
1184
b70c7fb4
JD
11852009-08-27 Joel E. Denny <jdenny@clemson.edu>
1186
1187 tests: use perl for printing special sequences to files.
1188 And skip tests if perl is not available. This is better than
1189 playing tricks with shell portability. Suggested by Akim
1190 Demaille.
1191 * tests/input.at (Bad character literals): Use it here for
1192 omitting final newlines.
1193 (Bad escapes in literals): Use it here for special characters.
1194
d1cc31c5
JD
11952009-08-26 Joel E. Denny <jdenny@clemson.edu>
1196
1197 tests: show a use of %define lr.default-reductions "consistent"
1198 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
1199 prevents the omission of expected tokens for %error-verbose.
1200
3bed3a75
AD
12012009-08-26 Akim Demaille <demaille@gostai.com>
1202
1203 tests: portability fix.
1204 * tests/input.at (Bad escapes in literals): Don't expect "echo
1205 '\0'" to output \ then 0.
1206
aa0cb40d
JD
12072009-08-26 Joel E. Denny <jdenny@clemson.edu>
1208
1209 Actually handle the yytable zero value correctly this time.
1210 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
1211 zero values in the YYTABLE comments.
1212 * data/glr.c (yytable_value_is_error): Don't check for zero
1213 value.
1214 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
1215 * data/yacc.c (yytable_value_is_error): Likewise.
1216 * data/lalr1.java (yy_table_value_is_error_): Likewise.
1217 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
1218 * src/tables.h: In header comments, explain why it's useless to
1219 check for a zero value in yytable.
1220
f2b30bdf
JD
12212009-08-25 Joel E. Denny <jdenny@clemson.edu>
1222
1223 More fixes related to last two patches.
1224 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
1225 comments: zero indicates syntax error not default action.
1226 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
1227 defined.
1228 * data/glr.c (yyis_pact_ninf): Rename to...
1229 (yypact_value_is_default): ... this.
1230 (yyisDefaultedState): Update for rename.
1231 (yyis_table_ninf): Rename to...
1232 (yytable_value_is_error): ... this, and check for value zero
1233 besides just YYTABLE_NINF.
1234 (yygetLRActions): Check for default value from yypact. It
1235 appears that this check is always performed before this function
1236 is invoked, and so adding the check here is probably redundant.
1237 However, the code may evolve after this subtlety is forgotten.
1238 Also, update for rename to yytable_value_is_error. Because that
1239 macro now checks for zero, a different but equivalent branch of
1240 the if-then-else here is evaluated.
1241 (yyreportSyntaxError): Update for rename to
1242 yytable_value_is_error. The zero condition was mishandled
1243 before.
1244 (yyrecoverSyntaxError): Update for renames. No behavioral
1245 changes.
1246 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1247 New function.
1248 (yy_table_value_is_error_): New function.
1249 (parse): Use new functions where possible. No behavioral
1250 changes.
1251 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1252 The zero condition was mishandled before.
1253 * data/yacc.c (yyis_pact_ninf): Rename to...
1254 (yypact_value_is_default): ... this.
1255 (yyis_table_ninf): Rename to...
1256 (yytable_value_is_error): ... this, and check for value zero
1257 besides just YYTABLE_NINF.
1258 (yysyntax_error): Update for rename to yytable_value_is_error.
1259 The zero condition was mishandled before.
1260 (yyparse): Update for renames. No behavioral changes.
1261 * src/tables.h: Improve comments about yypact, yytable, etc.
1262 more. Most importantly, say yytable value of zero means syntax
1263 error not default action.
1264
53f036ce
JD
12652009-08-25 Joel E. Denny <jdenny@clemson.edu>
1266
1267 Fix %error-verbose for conflicts resolved by %nonassoc.
1268 * NEWS (2.5): Document.
1269 * data/glr.c (yyreportSyntaxError): Fix this by checking
1270 yyis_table_ninf.
1271 * data/yacc.c (yysyntax_error): Likewise.
1272 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1273 yytable_ninf_.
1274 * data/lalr1.java (yysyntax_error): Likewise.
1275 * tests/conflicts.at (%nonassoc and eof): Update expected output
1276 and remove FIXME.
1277
87412882
JD
12782009-08-25 Joel E. Denny <jdenny@clemson.edu>
1279
1280 Some code and documentation improvements.
1281 * data/c.m4 (b4_table_value_equals): New macro to capture
1282 some repeated code.
1283 * data/glr.c (yyis_pact_ninf): Use it here.
1284 (yyis_table_ninf): Likewise.
1285 (yyreportSyntaxError): Improve internal comments.
1286 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1287 Use it everywhere possible.
1288 (yyis_table_ninf): Likewise.
1289 (yysyntax_error): Improve internal comments.
1290 * data/lalr1.cc (yysyntax_error_): Likewise.
1291 * data/lalr1.java (yysyntax_error): Likewise.
1292 * src/tables.h: Improve comments about yypact, yytable, etc.
1293
e6c849d8
JD
12942009-08-21 Joel E. Denny <jdenny@clemson.edu>
1295
1296 Use locale when quoting.
1297 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1298 quote rather than implementing quoting here.
1299
d8911864
EB
13002009-08-20 Eric Blake <ebb9@byu.net>
1301
b0778bdd
EB
1302 Make previous patch more robust.
1303 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1304 argmatch.h.
1305 (output_skeleton): Use it.
1306 Suggested by Akim Demaille.
1307
d8911864
EB
1308 Import latest m4/m4.m4.
1309 * submodules/autoconf: Update to autoconf 2.64.
1310 * configure.ac (M4_GNU_OPTION): New define.
1311 * src/output.c (output_skeleton): Use it to resolve FIXME.
1312 * NEWS: Mention this.
1313
c2724603
JD
13142009-08-19 Joel E. Denny <jdenny@clemson.edu>
1315
1316 Fix complaints about escape sequences.
1317 Discussed starting at
1318 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1319 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1320 For a \0 and similar escape sequences meaning the null
1321 character, report an invalid escape sequence instead of an
1322 invalid null character because the latter does not actually
1323 appear in the user's input.
1324 In all escape sequence complaints, don't escape the initial
1325 backslash, and don't quote when the sequence appears at the end
1326 of the complaint line unless there's whitespace that quotearg
1327 won't escape.
1328 Consistently say "invalid" not "unrecognized".
1329 Consistently prefer "empty character literal" over "extra
1330 characters in character literal" warning for invalid escape
1331 sequences; that is, consistently discard those sequences.
1332 * tests/input.at (Bad escapes in literals): New.
1333
17aed602
AD
13342009-08-19 Akim Demaille <demaille@gostai.com>
1335
1336 doc: fixes.
1337 * doc/bison.texinfo: Fix minor Texinfo errors.
1338
9142239a
AD
13392009-08-19 Akim Demaille <demaille@gostai.com>
1340
1341 tests: distcc compliance.
1342 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
1343 error messages from the output.
1344
171ad99d
AD
13452009-08-19 Akim Demaille <demaille@gostai.com>
1346
1347 variables: simplify the upgrade of namespace into api.namespace.
1348
1349 This patch simplifies "variables: rename namespace as
1350 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
1351 Suggested by Joel E. Denny in
1352 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
1353
1354 * src/muscle-tab.c (muscle_percent_variable_update): New.
1355 (muscle_percent_define_insert): Use it in replacement of the
1356 previous tr invocation.
1357 Remove variable_tr, no longer needed.
1358 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1359 Remove.
1360 * data/c++.m4: No longer handle namespace -> api.namespace.
1361 * tests/input.at (%define backward compatibility): Check that
1362 namespace is treated as api.namespace.
1363
d59e456d
AD
13642009-08-19 Akim Demaille <demaille@gostai.com>
1365
1366 doc: %initial-action to initialize yylloc.
1367 Reported by Bill Allombert.
1368 * doc/bison.texinfo: Set fill-column to 76.
1369 (Location Type): Document the use of %initial-action to initialize
1370 yylloc.
1371
ceb8b8e6
AD
13722009-08-19 Akim Demaille <demaille@gostai.com>
1373
1374 lalr1.cc: use state_type.
1375 * data/lalr1.cc (yysyntax_error_): Use state_type.
1376 Move argument names into yy*.
1377
7580c379
AD
13782009-08-19 Akim Demaille <demaille@gostai.com>
1379
1380 lalr1.cc: get rid of yyparse's yystate.
1381 yystate and yystack_[0].state are equal, keep only the latter.
1382 The former was also used as a temporary variable to compute the
1383 post-reduction state. Move this computation into an auxiliary
1384 function.
1385
1386 * data/glr.c (yyLRgotoState): Fuse variable definition and first
1387 assignment.
1388 * data/lalr1.cc (yy_lr_goto_state_): New.
1389 (yyparse): Use it.
1390 Replace remaining uses of yystate by yystate_[0].state.
1391 Remove the former.
1392
c4dc4c46
AD
13932009-08-19 Akim Demaille <demaille@gostai.com>
1394
1395 lalr1.cc: destroy $$ when YYERROR is called.
1396 * data/lalr1.cc (yyreduce): Compute the resulting state before
1397 running the user action so that yylhs is a valid symbol.
1398 (yyerrorlab): Since yylhs is complete (it knows its type), we can
1399 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
1400 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
1401
c67e466f
JD
14022009-08-18 Joel E. Denny <jdenny@clemson.edu>
1403
1404 maint: update for gnulib's recent update-copyright changes
1405 * gnulib: Update.
1406 * .x-update-copyright (COPYING): Add as it's no longer implied
1407 when .x-update-copyright is present.
1408 * cfg.mk (update-copyright-local): Remove, now ignored.
1409 (update-copyright): Declare update-b4-copyright as a dependency.
1410
af6d2358
AD
14112009-08-17 Akim Demaille <demaille@gostai.com>
1412
1413 build: require gettext 0.17.
1414
1415 Suggested by Bruno Haible.
1416 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1417 * configure.ac: require gettext 0.17 to ensure compatibility with
1418 gnulib.
1419
91a2b9b1
AD
14202009-08-17 Akim Demaille <demaille@gostai.com>
1421
1422 build: lower gettext requirements.
1423
1424 Bison was uselessly requiring the formatstring macros from
1425 gettext, which resulted in mo files not being installed on systems
1426 that perfectly supported Bison mo files. Lower the requirement.
1427 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1428
b0778bdd
EB
1429 * configure.ac: Require need-ngettext instead of
1430 need-formatstring-macros.
1431 Reported by Martin Jabocs.
1432 Suggested by Bruno Haible.
1433 * INSTALL: Restructure.
1434 (Internationalization): New.
91a2b9b1 1435
585935e8
JD
14362009-08-14 Joel E. Denny <jdenny@clemson.edu>
1437
1438 maint: fix use of copyright year intervals.
1439 * gnulib: Update.
1440 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1441 as now recommended in gnulib/NEWS.
1442 * build-aux/update-b4-copyright: Fix.
1443 * cfg.mk (update-copyright-env): Configure update-copyright.
1444
83b60c97
JD
14452009-08-13 Joel E. Denny <jdenny@clemson.edu>
1446
1447 Make it easier to write deterministic tests.
1448 Continues Akim's work from his 2009-06-10 commits.
1449 * src/reader.c (check_and_convert_grammar): Don't add any
1450 symbols after the first symbols_do invocation.
1451 * src/symtab.c (symbols_sorted): New static global.
1452 (user_token_number_redeclaration): Update comments.
1453 (symbol_from_uniqstr): If a new symbol is being created, assert
1454 that symbols_sorted hasn't been allocated yet.
1455 (symbols_free): Free symbols_sorted.
1456 (symbols_cmp, symbols_cmp_qsort): New functions.
1457 (symbols_do): Sort symbol_table into symbols_sorted on first
1458 invocation.
1459 * tests/input.at (Numbered tokens): Recombine tests now that the
1460 output should be deterministic across multiple numbers.
1461
28169bab
AD
14622009-08-12 Akim Demaille <demaille@gostai.com>
1463
1464 tests: GCC 4.5 compliance.
1465 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
1466 messages about #error.
1467
9f14e187
AD
14682009-08-12 Akim Demaille <demaille@gostai.com>
1469
1470 build: fix the generation of the documentation.
1471 Some of our targets use "bison --help", but they can't depend on
1472 "bison" itself (to avoid additional requirements on the user), so
1473 they used to call "make src/bison" in the commands. Then
1474 concurrent builds may fail: one make might be aiming one of its
1475 jobs at compiling src/bison, and another job at generating the man
1476 page. If the latter is faster than the former, then we have two
1477 makes that concurrently try to compile src/bison.
1478
1479 This might also be a more convincing explanation for the failure
1480 described in the patch "build: fix paths".
1481
1482 * Makefile.am (SUFFIXES): Initialize.
1483 * build-aux/move-if-change: New, symlink to gnulib's.
1484 * build-aux/local.mk: Ship it.
1485 * doc/common.x: Remove, merged into...
1486 * doc/bison.x: here.
1487 * doc/local.mk (doc/bison.help): New.
1488 ($(CROSS_OPTIONS_TEXI)): Depend on it.
1489 Use src/bison.
1490 (.x.1): Replace with...
1491 (doc/bison.1): this explicit, simpler, target.
1492 (common_dep): Remove, inlined where appropriate.
1493 (SUFFIXES, PREPATH): Remove, unused.
1494
d1b55e81
AD
14952009-08-12 Akim Demaille <demaille@gostai.com>
1496
1497 gnulib: improve prefixing.
1498 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
1499 change the value of...
1500 (gl_LIBOBJS): this.
1501 Adjust more variables.
1502 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
1503 gl_LIBOBJS.
1504 (prefix): Also transform rules whose targets have slashes.
1505 Use $prefix liberally.
1506 Map @MKDIR_P@ to $(MKDIR_P).
1507 Prefix directories that are mkdir'd.
1508
838205d5
AD
15092009-08-12 Akim Demaille <demaille@gostai.com>
1510
1511 build: fix paths.
1512 When using $(top_builddir) inconsistently, Make (including GNU
1513 Make) is sometimes confused. As a result it may want to build
1514 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
1515 file, different names) concurrently, which, amusingly enough,
1516 might end with:
1517
1518 ranlib lib/libbison.a
1519 ranlib lib/libbison.a
1520 make[2]: *** [lib/libbison.a] Segmentation fault
1521
1522 on OS X.
1523
1524 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
1525 needed.
1526
67af7198
AD
15272009-08-12 Akim Demaille <demaille@gostai.com>
1528
1529 distcheck: fix.
1530
b0778bdd 1531 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
67af7198 1532
c467dc42
JD
15332009-08-10 Joel E. Denny <jdenny@clemson.edu>
1534
1535 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
1536
dfaa4860
JD
15372009-08-10 Joel E. Denny <jdenny@clemson.edu>
1538
1539 Miscellaneous code readability improvements.
1540
1541 * src/reader.c (reader): Move %define front-end variable
1542 defaults and checking into...
1543 (prepare_percent_define_front_end_variables): ... this new
1544 function.
1545
1546 * src/scan-gram.l (INITIAL): For consistency with string
1547 literals, don't store open quote on character literal. It's
1548 discarded before returning anyway.
1549 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1550 Make length test more readable, and make the character stored
1551 for an empty literal more obvious while consistent with the
1552 previous behavior.
1553
1554 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1555 USER_NUMBER_HAS_STRING_ALIAS throughout.
1556 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1557 that is repeated in symtab.h. Improve argument names to make it
1558 clear which side of the symbol-string alias pair is which.
1559 (symbol_check_alias_consistency): Improve local variable names
1560 for the same purpose.
1561 * src/symtab.h (struct symbol): Make comments about aliases
1562 clearer.
1563 (symbol_make_alias): Improve comments and argument name.
1564 * src/output.c (token_definitions_output): Update for rename to
1565 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1566
ce268795
AR
15672009-08-08 Alex Rozenman <rozenman@gmail.com>
1568
1569 Convert "misleading reference" messages to warnings.
1570 * src/scan-code.l: New function 'show_sub_messages', more
1571 factoring.
1572 * tests/named-ref.at: Adjust tests.
1573
401b73af
JD
15742009-08-06 Joel E. Denny <jdenny@clemson.edu>
1575
1576 maint: run "make update-copyright"
1577
a1a9422d
JD
15782009-08-06 Joel E. Denny <jdenny@clemson.edu>
1579
1580 maint: make update-b4-copyright easier to use
1581 * build-aux/update-b4-copyright: In warnings, report line
1582 numbers rather than character positions.
1583 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1584 that update-copyright runs it.
1585 * gnulib: Update.
1586
0b61a8ec
JD
15872009-08-05 Joel E. Denny <jdenny@clemson.edu>
1588
1589 maint: clean up update-b4-copyright code
1590 * build-aux/update-b4-copyright: Do not accept 2-digit
1591 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1592 Don't accept a `[' in a b4_copyright argument.
1593 Format code more consistently.
1594 Don't assume b4*copyright never occurs.
1595
269e222e
JD
15962009-08-04 Joel E. Denny <jdenny@clemson.edu>
1597
1598 maint: automate b4_copyright updates.
1599 * Makefile.am (update-b4-copyright): New target rule.
1600 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
1601 * build-aux/update-b4-copyright: New.
1602 * data/yacc.c: Remove stray characters around b4_copyright
1603 invocations.
1604
35905f2b
JD
16052009-08-04 Joel E. Denny <jdenny@clemson.edu>
1606
1607 maint: automate annual package-wide copyright-year update.
1608 * .x-update-copyright: New.
1609 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1610 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1611 update-copyright. Remove gnumakefile, which is implied by
1612 maintainer-makefile.
1613 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1614 * gnulib: Update.
1615 * maint.mk: Remove, now copied from gnulib.
1616 * examples/extexi: Add missing "(C)" in copyright statement so
1617 update-copyright can recognize it.
1618 * src/LR0.h: Likewise.
1619 * src/print.h: Likewise.
1620 * src/print_graph.h: Likewise.
1621 * src/gram.c: Add missing comma in copyright statement.
1622 * src/gram.h: Likewise.
1623
b30e18dc
JD
16242009-08-04 Joel E. Denny <jdenny@clemson.edu>
1625
1626 Fix "make distcheck".
1627 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1628 of just calc.stamp.
1629
8d90395d
JD
16302009-08-01 Joel E. Denny <jdenny@clemson.edu>
1631
1632 Pacify "gcc -Wunused" for the input function from Flex.
1633 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1634 and later.
1635 * src/scan-code.l: Add "%option noinput", which I cannot find in
1636 the Flex manual, but which Flex has supported since at least as
1637 far back as 2.5.4. However, if any of our developers still use
1638 Flex 2.5.4, they'll need to stop configuring with
1639 --enable-gcc-warnings because "%option noinput" didn't work
1640 correctly until Flex 2.5.6.
1641 * src/scan-gram.l: Likewise.
1642 * src/scan-skel.l: Likewise.
1643
ba4184ec
AR
16442009-07-31 Alex Rozenman <rozenman@gmail.com>
1645
1646 Fix --enable-gcc-warnings problems.
1647 * src/reader.c: Adjust variable names.
1648 * src/scan-code.l: Fix prototypes and adjust names.
1649 * src/named-ref.c: Remove redundant "if".
1650
91a2af97
JD
16512009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1652
1653 Fix a --enable-gcc-warnings problem.
1654 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1655 variable.
1656
3208e3f4
JD
16572009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1658
1659 Warn about character literals not of length one.
1660 * NEWS (2.5): Document.
1661 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1662 the length.
1663 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1664 * tests/input.at (Bad character literals): New test group.
1665
5add20ab 16662009-07-24 Alex Rozenman <rozenman@gmail.com>
13cdf208
AR
1667
1668 Fix some memory leaks.
1669 * src/named-ref.c: Add a pointer check (named_ref_free).
1670 * src/scan-code.l: New function (variant_table_free). Called in
1671 code_scanner_free.
1672 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1673
e459fb0e
JD
16742009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1675
1676 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1677
c4be5517
JD
16782009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1679
1680 Some M4 cleanup in the testsuite.
1681 Suggested by Eric Blake at
1682 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1683 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1684 complicate the code by distinguishing between a missing value
1685 and an empty string value for an optional argument. This fix is
1686 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1687 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1688 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1689 arguments are not needed because of the following changes.
1690 Fix stale comments.
1691 Bison developers should use GNU M4 and should not use
1692 POSIXLY_CORRECT when building the test suite, so do not
1693 complicate the code by avoiding $10 and above.
1694 Do not quote an empty string value for an optional argument, and
1695 do not distinguish between a missing value and an empty string
1696 value.
1697
feeb56cd
JD
16982009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1699
1700 Revert unnecessary column realignment in --help output.
1701 Reported by Akim Demaille at
1702 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1703 * src/getargs.c (usage): Here.
1704
5add20ab 17052009-07-04 Alex Rozenman <rozenman@gmail.com>
629e4def
AR
1706
1707 Alphabetical order in src/local.mk.
1708 * src/local.mk: Adjust.
1709
5add20ab 17102009-07-04 Alex Rozenman <rozenman@gmail.com>
872b52bc
AR
1711
1712 Style changes and factoring.
1713 * src/named-ref.h: Add comments.
1714 * src/parse-gram.y: Readability and style changes.
1715 * src/reader.c: Factoring: assign_named_ref function.
1716 * src/scan-code.l: Factoring and style changes. Rename
1717 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1718 Use "unsigned" type for variant index. Improve readablity.
1719 * src/scan-gram.l: Change error messages and add comments.
1720 * src/symlist.h: symbol_list_null: New function decl.
1721 * src/symlist.c: symbol_list_null: Implement here.
1722 * tests/named-refs.at: Adjust for new error messages.
1723
83ea2423
EB
17242009-06-29 Eric Blake <ebb9@byu.net>
1725
1726 scan-code: avoid compiler warnings
1727 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1728
5ece73ea
AD
17292009-06-29 Akim Demaille <demaille@gostai.com>
1730
1731 build: avoid concurrent extraction of calc++.
1732 * examples/calc++/Makefile.am (calc.stamp): New.
1733 Depend on it to create the sources of calc++ so that concurrent
1734 builds don't launch several "extexi" in parallel.
1735 Not only this is inefficient, this also builds incorrect sources
1736 with several extractions mixed together.
1737
ad597a78
AD
17382009-06-29 Akim Demaille <demaille@gostai.com>
1739
1740 parse.error: fix.
1741 * data/bison.m4: Move code related to specific variables after the
1742 definition of the variable-maintaining macros so that we don't
1743 "invoke" b4_percent_define_check_values before it is defined.
1744
31b850d2
AD
17452009-06-29 Akim Demaille <demaille@gostai.com>
1746
1747 variables: parse.error
1748
1749 Implement, document, and test the replacement of %error-verbose
1750 by %define parse.error "verbose".
1751 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
1752 values of the parse.error variable.
1753 Make "simple" its default value.
1754 Check the valid values.
1755 * src/parse-gram.y: Use %define parse.error.
1756 (PERCENT_ERROR_VERBOSE): New token.
1757 Support it.
1758 * src/scan-gram.l: Support %error-verbose.
1759
1760 * doc/bison.texinfo (Decl Summary): Replace the documentation of
1761 %define error-verbose by that of %define parse.error.
1762 * NEWS: Document it.
1763
1764 * tests/actions.at, tests/calc.at: Use parse.error instead of
1765 %error-verbose.
1766
b9f1d9a4
AR
17672009-06-27 Alex Rozenman <rozenman@gmail.com>
1768
1769 Implement support for named symbol references.
1770 * src/parse-gram.y: Add new syntax (named_ref.opt).
1771 * src/reader.c: Store named refs in symbol lists.
1772 * src/reader.h: New argument for symbol_append and
1773 action_append functions.
1774 * src/scan-code.h: Add new field (named_ref) into
1775 code_props data structure. Keeps named ref of midrule
1776 actions.
1777 * src/scan-code.l: Support for named refs in semantic
1778 action code. New function 'parse_named_ref'.
1779 * src/scan-gram.l: Support bracketed id.
1780 * src/symlist.c: Store named refs in symbol lists.
1781 * src/symlist.h: New field in symbol list: named_ref.
1782 * src/named-ref.h: New file, a struct for named_ref.
1783 * src/named-ref.cp: New file, named_ref_new function.
1784 * src/local.mk: Add two new files.
1785 * tests/testsuite.at: Include new test group:
1786 * tests/named-refs.at: this new file.
1787
b5c212b6
AD
17882009-06-25 Akim Demaille <demaille@gostai.com>
1789
1790 hash: check insertion for memory exhaustion.
1791 * src/uniqstr.c (uniqstr_new): New.
1792
67501061
AD
17932009-06-24 Akim Demaille <demaille@gostai.com>
1794
1795 variables: rename namespace as api.namespace.
1796 Discussed in
1797 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
1798
1799 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1800 New.
1801 (b4_percent_define_use): New.
1802 Use it where applicable.
1803 * data/c++.m4: Replace uses of the variable "namespace" by
1804 "api.namespace".
1805 Default the latter to the former.
1806 * doc/bison.texinfo (Decl Summary): Document "namespace" as
1807 obsolete.
1808 Document api.namespace.
1809 Use @samp to document %define uses, keep @code for identifiers.
1810 * NEWS: Likewise.
1811 * tests/c++.at, tests/input.at: Test api.namespace instead of
1812 namespace. (The tests passed with namespace.)
1813
41976786
AD
18142009-06-11 Akim Demaille <demaille@gostai.com>
1815
1816 style changes.
1817 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1818 * src/print-xml.c: Style changes.
1819 * tests/conflicts.at: Comment changes.
1820
44bb9084
AD
18212009-06-11 Akim Demaille <demaille@gostai.com>
1822
1823 xml: beware of user strings used to give a %prec to rules.
1824 * tests/conflicts.at (%prec with user strings): New.
1825 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1826 XML output.
1827
04d1e39d
AD
18282009-06-11 Akim Demaille <demaille@gostai.com>
1829
1830 hash: check insertion for memory exhaustion.
1831 * src/muscle-tab.c (muscle_insert, muscle_grow)
1832 * src/state.c (state_hash_insert): Check the return value of
1833 hash_insert.
1834
a8873669
AD
18352009-06-11 Akim Demaille <demaille@gostai.com>
1836
1837 tests: honor TESTSUITEFLAGS in every check target.
1838 * tests/local.mk (RUN_TESTSUITE): New.
1839 (check-local, installcheck-local, maintainer-check-g++)
1840 (maintainer-check-posix, maintainer-check-valgrind): Use it.
1841
8893145a
AD
18422009-06-10 Akim Demaille <demaille@gostai.com>
1843
1844 deterministic test suite.
1845 Some consistency checks on symbols are performed after all the
1846 symbols were read, by an iteration over the symbol table. This
1847 traversal is nondeterministic, which can be a problem for test
1848 cases.
1849 Avoid this.
1850 Addresses another form of nondeterminism reported by Joel E. Denny.
1851 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1852
1853 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1854 test in two.
1855 Use different file names for the three tests to make the
1856 maintenance easier.
1857
92d7a23a
AD
18582009-06-10 Akim Demaille <demaille@gostai.com>
1859
1860 gnulib: update.
b0778bdd
EB
1861 * gnulib: Update to latest.
1862 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1863 * m4/.gitignore: Regen.
1864 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1865 Call xalloc_die on hash_insert failures.
1866 Requested by the new __warn_unused_result__ attribute of
1867 hash_insert.
92d7a23a 1868
12cf133f
AD
18692009-06-10 Akim Demaille <demaille@gostai.com>
1870
1871 deterministic user-token-number redeclaration errors.
1872 Address nondeterminism reported by Joel E. Denny.
1873 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1874
1875 * src/uniqstr.h: Comment changes.
1876 * src/location.h (boundary_cmp, location_cmp): New.
1877 * src/symtab.c (user_token_number_redeclaration): New.
1878 (symbol_translation): Use it.
1879 * tests/input.at (Numbered tokens): Adjust the expected output.
1880
796a2b0a
AD
18812009-05-25 Akim Demaille <demaille@gostai.com>
1882
1883 build: avoid ignored errors.
1884 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
1885 errors, they pollute the output.
1886
0b6d43c5
JD
18872009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1888
1889 Convert multiple variable definition warnings to complaints.
1890 * NEWS (2.5): Add a new entry for that change.
1891 * doc/bison.texinfo (Decl Summary): Update %define entry.
1892 (Bison Options): Update -D/--define/-F/--force-define entry.
1893 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
1894 * src/muscle-tab.h (muscle_percent_define_insert): Update
1895 comments.
1896 * tests/input.at (`%define errors'): Update.
1897 (`%define, --define, --force-define'): Update.
1898
de5ab940
JD
18992009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1900
1901 -F/--force-define and relative %define/-D/--define priorities.
1902 * NEWS (2.5): Add documentation to -D/--define entry.
1903 * build-aux/cross-options.pl: Hard-code association of
1904 --force-define with %define.
1905 * doc/bison.texinfo (Decl Summary): In %define entry,
1906 cross-reference command-line options.
1907 (Bison Options): Add documentation to -D/--define entry.
1908 (Option Cross Key): Widen column for --force-define row.
1909 * src/getargs.c (usage): Document -F/--force-define. Realign
1910 options in output.
1911 (short_options, long_options, getargs): Parse -F/--force-define,
1912 and update muscle_percent_define_insert invocations.
1913 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
1914 (muscle_percent_define_insert): Add argument with that type.
1915 * src/muscle-tab.c (muscle_percent_define_insert): Implement
1916 -F/--force-define behavior and priorities.
1917 (muscle_percent_define_ensure): Update
1918 muscle_percent_define_insert invocation.
1919 * src/parse-gram.y (prologue_declaration): Update
1920 muscle_percent_define_insert invocations.
1921 * tests/input.at (`%define, --define'): Rename to...
1922 (`%define, --define, --force-define'): ... this and extend.
1923
f8e7258f
JD
19242009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1925
1926 Update some comments to make sense for -D.
1927 * data/bison.m4 (b4_check_user_names): In header comments, say
1928 "user occurrence" instead of "grammar occurrence".
1929 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
1930 (muscle_percent_code_grow): Likewise just for consistency.
1931
b987342b
JD
19322009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1933
1934 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1935
4977e0a7
JD
19362009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1937
1938 Handle a trailing `:' in a user-supplied C++ namespace better.
1939 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1940 among the closing braces here. This fix might make the
1941 generated code easier to debug, but otherwise it should be
1942 insignificant because a trailing `:' is a C++ error already.
1943
9b04dad7
AD
19442009-05-19 Akim Demaille <demaille@gostai.com>
1945
1946 remove useless variable.
1947 * src/getargs.c (skeleton_arg): Remove now useless variable.
1948 Should help the compiler see that this printf-like call is sane.
1949
4c6622c2
AD
19502009-05-15 Akim Demaille <demaille@gostai.com>
1951
1952 Rename token.prefix as api.tokens.prefix.
1953 Discussed here.
1954 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
1955
1956 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
1957 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
1958 (token.prefix): Rename as...
1959 (api.tokens.prefix): this.
1960
3c248d70
AD
19612009-05-11 Akim Demaille <demaille@gostai.com>
1962
1963 doc: use C++ headers.
1964 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1965 headers.
1966
99c08fb6
AD
19672009-05-11 Akim Demaille <demaille@gostai.com>
1968
1969 doc: token.prefix
1970 * doc/bison.simple (Decl Summary): Document token.prefix.
1971 (Calc++ Parser): Various fixes.
1972 Formatting changes.
1973 Use token.prefix.
1974 Introduce a macro TOKEN to shorten the code and make it more
1975 readable.
1976 (Calc++ Scanner): Adjust.
1977 * NEWS (Variable token.prefix): New.
1978
84a1cb5a
AD
19792009-05-04 Akim Demaille <demaille@gostai.com>
1980
1981 bison: catch bad symbol names.
1982 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1983 * tests/input.at: Adjust.
1984
cdf3f113
AD
19852009-05-04 Akim Demaille <demaille@gostai.com>
1986
1987 identifiers: dashes are letters.
1988 Dashes can now start identifiers (symbols and directives).
84a1cb5a 1989
cdf3f113
AD
1990 * src/scan-gram.l ({letter}): Add dash.
1991 ({id}): Remove it.
1992 * tests/input.at (Symbols): Adjust.
1993 Remove stray comment.
1994 * tests/regression.at (Invalid inputs): Adjust error message.
1995 * doc/bison.texinfo (Symbols): Update.
1996
98a345a2
JD
19972009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1998
1999 Declare %code to be a permanent feature.
2000 * NEWS (2.4.2): Here.
2001 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
2002 experimental.
2003 (Decl Summary): Likewise.
2004
67212941
JD
20052009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2006
2007 Convert underscores to dashes in some %define variable names.
2008 For now, just api.push-pull and lr.keep-unreachable-states.
2009 Maintain old names for backward compatibility.
2010 * NEWS (2.5): Document.
2011 * data/c.m4 (b4_identification): Update comment.
2012 * data/yacc.c: Update access.
2013 * doc/bison.texinfo: Update.
2014 * etc/bench.pl.in (bench_push_parser): Update use.
2015 * src/files.c (tr): Move to...
2016 * src/getargs.c, src/getargs.h (tr): ... here because I can't
2017 think of a better place to expose it. My logic is that, for all
2018 uses of tr so far, command-line arguments can be involved, and
2019 getargs.h is already included.
2020 * src/main.c (main): Update access.
2021 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
2022 variable names to new variable names before assigning value.
2023 * src/reader.c (reader): Update setting default.
2024 * tests/calc.at: Update uses.
2025 * tests/conflicts.at (Unreachable States After Conflict
2026 Resolution): Update use.
2027 * tests/input.at (%define enum variables): Update use.
2028 (%define backward compatibility): New test group.
2029 * tests/push.at: Update uses.
2030 * tests/reduce.at: Update uses.
2031 * tests/torture.at: Update uses.
2032
ba5c6d94
JD
20332009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2034
2035 Set all front-end %define defaults in one place.
2036 * src/main.c (main): Move lr.keep_unreachable_states default...
2037 * src/reader.c (reader): ... to here.
2038
5bab9d08
JD
20392009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2040
2041 Rename lr.default_reductions to lr.default-reductions.
2042 * NEWS (2.5): Here.
2043 * doc/bison.texinfo: Here.
2044 * src/lalr.c (initialize_LA): Here.
2045 * src/print.c (print_reductions): Here.
2046 * src/reader.c (reader): Here.
2047 * src/tables.c (action_row): Here.
2048 * tests/input.at (%define enum variables): Here.
2049 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
2050
d521ee19
JD
20512009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2052
2053 Pacify ./configure --enable-gcc-warnings.
2054 * tests/input.at (Symbols): Prototype yyerror and yylex.
2055
20562009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
2057
2058 Document how `%define "var" "value"' is not M4-friendly.
2059 * src/parse-gram.y (variable): In comments here.
2060
8f0d265e
JD
20612009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2062
2063 Clean up recent patches a little.
2064 Reported by Akim Demaille.
2065 * doc/bison.texinfo (Understanding): Fix typos.
2066 * src/print.c (print_reductions): Don't use negated variable.
2067
f4909773
JD
20682009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2069
2070 List accepted values for a %define enum variable with an invalid value.
2071 Suggested by Akim Demaille at
2072 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
2073 * data/bison.m4 (_b4_percent_define_check_values): Implement.
2074 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
2075 * tests/input.at (%define lr.default_reductions invalid values): Merge
2076 into...
2077 (%define enum variables): ... here, and update output.
2078
110ef36a
JD
20792009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
2080
2081 Rename "default rule" to "default reduction".
2082 This includes changing variable names in code, changing
2083 comments, and renaming %define lr.default_rules to %define
2084 lr.default_reductions.
2085 * NEWS (2.5): Update IELR documentation.
2086 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
2087 documentation.
2088 * data/glr.c, data/lalr1.java: Sync copyright dates.
2089 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
2090 and lr.type documentation. Make some other wording
2091 improvements.
2092 (Glossary): Adjust cross-references and Default Reduction
2093 definition.
2094 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
2095 Remove a confusing comment pointed out by Akim Demaille.
2096 (initialize_LA): Adjust code.
2097 * src/print-xml.c (print_reductions): Adjust code.
2098 * src/print.c (print_reductions): Adjust code.
2099 * src/reader.c (reader): Adjust code.
2100 * src/tables.c (action_row): Adjust code.
2101 (token_actions): Adjust code.
2102 * src/tables.h: Adjust YYDEFACT documentation.
2103 * tests/input.at (%define lr.default_rules invalid values):
2104 Rename test group to...
2105 (%define lr.default_reductions invalid values): ... this, and
2106 update grammar file and expected output.
2107 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
2108 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
2109
746ee38c
AD
21102009-04-21 Akim Demaille <demaille@gostai.com>
2111
2112 tests: check the use of dashes and periods in symbols.
2113 * tests/input.at (Symbol): New test group.
2114
eb45ef3b
JD
21152009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2116
2117 Document %define lr.type and lr.default_rules.
2118 * NEWS (2.5): Add an entry.
2119 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
2120 besides just LALR(1) and GLR(1).
2121 * doc/bison.texinfo (Introduction): Likewise.
2122 (Language and Grammar): Bison is no longer limited to LALR(1)
2123 restrictions.
2124 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
2125 when trying to distinguish from GLR. Talk about LR(1) grammars
2126 rather than LALR(1) grammars.
2127 (Decl Summary): In %define api.push_pull entry, say it applies
2128 to deterministic parsers in C rather than LALR(1) parsers in C.
2129 Add lr.default_rules entry.
2130 Add lr.type entry.
2131 (Mystery Conflicts): Bison is no longer limited to LALR(1)
2132 restrictions.
2133 (Generalized LR Parsing): Same changes as for the previous GLR
2134 section.
2135 (Memory Management): Say deterministic rather than LALR(1).
2136 (Understanding): Correct some bison output.
2137 Index discussion of "accepting state".
2138 Say deterministic rather than LALR(1).
2139 (Bison Options): In --yacc entry, say deterministic rather than
2140 LALR(1).
2141 In --report, --graph, and --xml entries, just don't mention
2142 LALR(1).
2143 (C++ Parsers): Say deterministic rather than LALR(1).
2144 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
2145 (Glossary): Add Accepting State, Consistent State, Default Rule,
2146 and IELR(1) definitions.
2147 In Generalized LR (GLR) definition, make same changes as in
2148 previous GLR sections.
2149 In LALR(1) definition, say Bison uses LALR(1) by default rather
2150 than implying Bison is limited to LALR(1).
2151 (LocalWords): Add IELR.
2152
db34f798
JD
21532009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2154
2155 Finish implementing %define lr.type.
2156 Its value can be "LALR", "IELR", or "canonical LR".
2157 * lib/timevar.def (TV_IELR_PHASE1): New var.
2158 (TV_IELR_PHASE2): New var.
2159 (TV_IELR_PHASE3): New var.
2160 (TV_IELR_PHASE4): New var.
2161 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
2162 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
2163 Sbitset.h, ielr.h, and ielr.c.
2164 * src/getargs.h, src/getargs.c (enum trace, trace_args,
2165 trace_types): Add trace_ielr.
2166 * src/lalr.h, src/lalr.c (ngotos): Export it.
2167 (F): Rename to...
2168 (goto_follows): ... this, update all uses, and export it.
2169 (set_goto_map): Export it.
2170 (map_goto): Export it.
2171 (compute_lookahead_tokens): Don't free goto_follows yet. Now
2172 handled in ielr.
2173 (initialize_LA): Export it. Move lookback allocation to...
2174 (lalr): ... here because, for canonical LR, initialize_LA must
2175 be invoked but lookback and much of the rest of LALR isn't
2176 needed.
2177 * main.c (main): Instead of lalr, invoke ielr, which invokes
2178 lalr.
2179 * src/reader.c (reader): Default lr.type to "LALR".
2180 Default lr.default_rules to "accepting" if lr.type is "canonical
2181 LR". Leave the default as "all" otherwise.
2182 Check for a valid lr.type value.
2183 * src/state.h, src/state.c (struct state_list): Add state_list
2184 member.
2185 (state_new): Initialize state_list member to NULL.
2186 (state_new_isocore): New function, exported.
2187 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
2188 exercises all values of lr.type.
2189 (GNU AWK Grammar): Rename test group to...
2190 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
2191 AT_TEST_EXISTING_GRAMMAR.
2192 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
2193 (GNU pic Grammar): Rename test group to...
2194 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
2195 AT_TEST_EXISTING_GRAMMAR.
2196 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
2197 all values of lr.type.
2198 (Single State Split): New test groups using AT_TEST_LR_TYPE.
2199 (Lane Split): Likewise.
2200 (Complex Lane Split): Likewise.
2201 (Split During Added Lookahead Propagation): Likewise.
2202
7fe11bb5
JD
22032009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2204
2205 Add new files for IELR and canonical LR implementation.
2206 * src/AnnotationList.c: New.
2207 * src/AnnotationList.h: New.
2208 * src/InadequacyList.c: New.
2209 * src/InadequacyList.h: New.
2210 * src/Sbitset.c: New.
2211 * src/Sbitset.h: New.
2212 * src/ielr.c: New.
2213 * src/ielr.h: New.
2214
7254f6a8
JD
22152009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2216
2217 Implement %define lr.default_rules.
2218 Its value describes the states that are permitted to contain
2219 default rules: "all", "consistent", or "accepting".
2220 * src/reader.c (reader): Default lr.default_rules to "all".
2221 Check for a valid lr.default_rules value.
2222 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
2223 is "accepting", then only mark the accepting state as
2224 consistent.
2225 (initialize_LA): Tell state_lookahead_tokens_count whether
2226 lr.default_rules is "accepting".
2227 * src/tables.c (action_row): If lr.default_rules is not "all",
2228 then disable default rules in inconsistent states.
2229 * src/print.c (print_reductions): Use this opportunity to
2230 perform some assertions about whether lr.default_rules was
2231 obeyed correctly.
2232 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
2233 helps with checking the parser tables for a grammar.
2234 * tests/input.at (%define lr.default_rules invalid values): New
2235 test group.
2236 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
2237 AT_TEST_TABLES_AND_PARSE.
2238 (`no %define lr.default_rules'): New test group generated by
2239 AT_TEST_LR_DEFAULT_RULES.
2240 (`%define lr.default_rules "all"'): Likewise.
2241 (`%define lr.default_rules "consistent"'): Likewise.
2242 (`%define lr.default_rules "accepting"'): Likewise.
2243
72e727f2
AD
22442009-04-20 Akim Demaille <demaille@gostai.com>
2245
2246 Formatting change.
2247
90462b8d
AD
22482009-04-20 Akim Demaille <demaille@gostai.com>
2249
2250 bison: factoring.
2251 * src/output.c (token_definitions_output): Use symbol_id_get
2252 instead of duplicating its logic.
2253 * TODO (YYERRCODE): Extend.
2254
4f646c37
AD
22552009-04-20 Akim Demaille <demaille@gostai.com>
2256
71b00ed8
AD
2257 variables: prefer error-verbose to error_verbose.
2258 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
2259 instead of error_verbose.
2260 * src/scan-gram.l (%error-verbose): Map to the error-verbose
2261 variable.
2262 * doc/bison.texinfo: Promote %define error-verbose instead of
2263 %error-verbose.
2264 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
2265
22662009-04-15 Akim Demaille <demaille@gostai.com>
2267
4f646c37
AD
2268 variables: accept dashes.
2269 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
2270 underscores.
2271 * src/scan-gram.l ({id}): Also accept dashes after the initial
2272 letter.
2273 ({directive}): Use {id}.
2274 * src/parse-gram.y: Comment and formatting changes.
2275 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
2276 symbols.
2277 * src/complain.h, src/complain.c (yacc_at): New.
2278 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
2279 symbol names.
2280 * src/output.c (token_definitions_output): Do not #define token
2281 names with dashes.
2282
184e3179
AD
22832009-04-20 Akim Demaille <demaille@gostai.com>
2284
2285 Consistently refer to Yacc, not YACC.
2286 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2287
41253c3a
JD
22882009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
2289
2290 Pacify make maintainer-check-posix.
2291 * tests/input.at (%define, --define): Move bison command-line
2292 options before grammar file name.
2293
197b82ba
JD
22942009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2295
2296 Document semicolon warnings.
2297 * NEWS (2.5): Here.
2298
0c90a1f5
AD
22992009-04-14 Akim Demaille <demaille@gostai.com>
2300
2301 variables: use `parse.assert' instead of `assert'.
2302 * TODO (assert): Remove.
2303 * data/bison.m4 (b4_assert_if): Replace with...
2304 (b4_parse_assert_if): this.
2305 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
2306 * doc/bison.texinfo (Decl Summary): Document parse.assert.
2307
fa819509
AD
23082009-04-14 Akim Demaille <demaille@gostai.com>
2309
16dc0d90 2310 variables: use `parse.trace' instead of `debug'.
fa819509
AD
2311 * src/getargs.c (getargs): Map -t to %define trace.parse.
2312 * src/scan-gram.l (%debug): Map to %define trace.parse.
2313 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
2314 names to `_' in macro names.
2315 (b4_debug_if): Replace with...
2316 (b4_parse_trace_if): this.
2317 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2318 * data/yacc.c: Adjust.
2319 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
2320 Use @code to label the variable list.
2321 Document the variable parse.trace.
2322 (Tracing): Promote the parse.trace variable.
2323 * TODO: %printer is not documented.
2324
f7dae1ea
AD
23252009-04-14 Akim Demaille <demaille@gostai.com>
2326
2327 doc: minor fixes.
2328 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2329 (Table of Symbols): Remove duplicate entry for %debug.
2330
3535c071
EB
23312009-04-10 Eric Blake <ebb9@byu.net>
2332
2333 submodules: update to latest
2334 * submodules/autoconf: Use latest upstream Autoconf.
2335
cf48f675
EB
23362009-04-06 Eric Blake <ebb9@byu.net>
2337
2338 Work around autoconf 2.63b bug in testsuite.
2339 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2340 autoconf bug related to # in test.
2341
50cca368
JD
23422009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2343
2344 * NEWS (2.5): New section. Describe new -D/--define feature.
2345
3583d96b
AD
23462009-04-06 Akim Demaille <demaille@gostai.com>
2347
2348 Regen.
2349 * src/parse-gram.h, src/parse-gram.c: Regen.
2350
00f5d575
AD
23512009-04-06 Akim Demaille <demaille@gostai.com>
2352
2353 rename muscle_tab.* as muscle-tab.* for consistency.
2354 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
2355 * src/muscle-tab.h, src/muscle-tab.c: these.
2356 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
2357 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
2358
76bf5102
AD
23592009-04-06 Akim Demaille <demaille@gostai.com>
2360
2361 Makefile: introduce $(BISON).
2362 * src/local.mk (BISON): New.
2363 (YACC): Use it.
2364
bc0f5737
AD
23652009-04-06 Akim Demaille <demaille@gostai.com>
2366
2367 parser: handle %locations as %define locations.
2368 * src/getargs.h, src/getargs.c (locations_flag): Remove.
2369 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
2370 to set "locations" to true.
2371 * src/output.c (prepare): Don't output "locations".
2372 * src/scan-gram.l (%locations): Handle it as a %<flag>.
2373 * src/parse-gram.y: It's no longer a token.
2374 Don't handle it.
2375 * data/bison.m4 (b4_locations_if): Define it with
2376 b4_percent_define_if_define.
2377 * data/c.m4, data/glr.cc: Adjust.
2378
697c912f
AD
23792009-04-06 Akim Demaille <demaille@gostai.com>
2380
2381 Regen.
2382 * src/parse-gram.c: Regen.
2383
4920ae8b
AD
23842009-04-06 Akim Demaille <demaille@gostai.com>
2385
2386 muscle: factor the handling of obsolete of obsolete directives.
2387 Suggested by Joel E. Denny.
50cca368 2388
4920ae8b
AD
2389 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
2390 New, extracted from...
2391 * src/parse-gram.y (prologue_declaration: pure-parser): here.
2392 Remove it.
2393 (prologue_declaration: "%<flag>"): Use
2394 muscle_percent_define_ensure.
2395 (%error-verbose, %pure-parser): No longer tokens.
2396 * src/scan-gram.l (pure-parser): Return as a %<flag>.
2397
1d5b3c08
JD
23982009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2399
2400 Fix options documentation.
2401 * build-aux/cross-options.pl: As in --help output, write optional
2402 arguments as [=ARG] not =[ARG].
2403 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2404
62c99cf4
JD
24052009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2406
2407 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2408 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2409 requirements for a correct m4 are stricter.
2410 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
2411 * configure.ac: Update to use AC_PROG_GNU_M4.
2412 Reported by Eric Blake.
2413
1c93f35b
JD
24142009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2415
2416 Help with updating web manual.
2417 * HACKING: Incorporate instructions from gnulib/doc/README.
2418 * bootstrap.conf (gnulib_modules): Add gendocs.
2419
86cfae0a
AD
24202009-04-03 Akim Demaille <demaille@gostai.com>
2421
2422 Regen.
2423 * src/parse-gram.h, src/parse-gram.c: Regen.
2424
ba061fa6
AD
24252009-04-03 Akim Demaille <demaille@gostai.com>
2426
2427 Factor %FLAG at scan level.
2428 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
2429 definitions and associated rules, replaced by....
2430 (PERCENT_FLAG): this new token type, and rule.
2431 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
2432 Use it for %debug and %error-verbose.
2433
b19ebeb3
AD
24342009-04-03 Akim Demaille <demaille@gostai.com>
2435
2436 Regen.
2437 * src/parse-gram.h, src/parse-gram.c: Regen.
2438
001a16a9
AD
24392009-04-03 Akim Demaille <demaille@gostai.com>
2440
2441 Treat %debug as %define debug.
2442 * data/bison.m4 (b4_debug_if): New.
2443 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
2444 * data/lalr1.java: Use it instead of b4_debug_flag.
2445 * src/getargs.h, src/getargs.c (debug_flag): Remove.
2446 * src/output.c (prepare): Don't output it.
2447 * src/parse-gram.y: Treat %debug as %define debug.
2448
24492009-04-03 Akim Demaille <demaille@gostai.com>
2450
2451 Treat %error-verbose as %define error_verbose.
2452 This allows to pass -Derror_verbose on the command line. Better
2453 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
2454 ERROR_VERBOSE being defined as false or true.
2455 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
2456 on b4_percent_define_ifdef, for does not check the defined value,
2457 but only whether the symbol is defined, rely on
2458 b4_percent_define_flag_if, so that a value of "false" is processed
2459 as a false.
2460 If not defined, define the flag to "false".
2461 (b4_error_verbose_if): New.
2462 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
2463 b4_error_verbose_flag.
2464 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
2465 * src/output.c (prepare): Don't output it.
2466 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
2467
92822aff
JD
24682009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2469
2470 Fix strange %define locations for default values.
2471 Reported by Akim Demaille at
2472 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2473 and discussed again starting at
2474 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2475 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2476 because location information is bogus.
2477 Use angle brackets to delimit fake file name because square brackets
2478 look like underexpanded m4. Choose a better fake file name.
2479 Use negative line numbers.
2480 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2481 * src/location.c (location_print): If line for a boundary is negative,
2482 only print that boundary's file name.
2483 * src/location.h: Document that.
2484 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2485 defaults): Update output.
2486
e021191b
JD
24872009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2488
2489 Pacify ./configure --enable-gcc-warnings.
2490 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
2491 in lib won't compile with it.
2492 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
2493
78f65418
AD
24942009-03-31 Akim Demaille <demaille@gostai.com>
2495
2496 bootstrap: --help to stdout.
2497 * bootstrap (usage): Don't send --help to stderr.
2498 Use a here doc instead of a long string.
2499
f7e241f4
AD
25002009-03-31 Akim Demaille <demaille@gostai.com>
2501
2502 bootstrap: README-hacking no longer exists
2503 * bootstrap (checkout_only_file): Set to HACKING.
2504
31d3e510
AD
25052009-03-26 Akim Demaille <demaille@gostai.com>
2506
2507 doc: merge HACKING and README-hacking.
2508 Two files is confusing.
2509 Reported by Alexandre Duret-Lutz.
1f9d8248 2510
31d3e510
AD
2511 * README-hacking: Merge into...
2512 * HACKING (Working from the repository): here.
2513
81535bfa
AD
25142009-03-26 Akim Demaille <demaille@gostai.com>
2515
2516 doc: update README-hacking.
2517 * README-hacking: We now use git and git submodules.
2518 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2519
56f772e9
AD
25202009-03-26 Akim Demaille <demaille@gostai.com>
2521
2522 lalr1.cc: avoid GCC 4.3 warnings.
2523 GCC 4.3 now warns about "a || b && c" and asks for explicit
2524 parentheses.
2525 Reported by Alexandre Duret-Lutz.
2526 * data/location.cc: Update copyright years.
2527 (Position::operator==): Use parens to make precedence explicit.
2528 Compare lines and columns first, as they are more likely to be
2529 different, and they are faster to compare.
2530
11c073b7
AD
25312009-03-26 Akim Demaille <demaille@gostai.com>
2532
2533 gnulib: update.
2534 * gnulib: Update to latest.
2535 * src/local.mk (AM_CFLAGS): Move to...
2536 * Makefile.am: here.
2537 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
2538 AM_CFLAGS.
2539
91be6b28
AD
25402009-03-02 Akim Demaille <demaille@gostai.com>
2541
2542 Comment changes.
2543
cbf25ce7
AD
25442009-03-02 Akim Demaille <demaille@gostai.com>
2545
2546 Share b4_yytranslate_define.
2547 * data/lalr1.cc (b4_yytranslate_define): Move to...
2548 * data/c++.m4: here.
2549
882f02ed
AD
25502009-03-02 Akim Demaille <demaille@gostai.com>
2551
2552 Use locations in the variant example.
1f9d8248
AD
2553 Yes, this obfuscates the point of this example, variants only.
2554 But glr.cc cannot work (yet?) without locations. This change
2555 makes it easier to use this example with glr.cc.
11c073b7 2556
882f02ed
AD
2557 * examples/variant.yy (assert): %define it.
2558 (locations): Request them.
2559 (yylex): Bind the location to the stage.
2560
0623bacc
AD
25612009-03-02 Akim Demaille <demaille@gostai.com>
2562
2563 Dub make_TOKEN as a public type interface.
2564 * data/c++.m4 (b4_symbol_constructor_declare)
2565 (b4_symbol_constructor_define): New empty stubs.
2566 (b4_public_types_declare, b4_public_types_define): Use them.
2567 * data/lalr1.cc (b4_symbol_constructor_declare)
2568 (b4_symbol_constructor_declare_)
2569 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
2570 Move to...
2571 * data/variant.hh: here.
2572 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
2573 needed.
2574 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
2575 b4_symbol_constructor_declare, as it is now done by
2576 b4_public_types_define and b4_public_types_declare.
2577
5f5a90df
AD
25782009-03-02 Akim Demaille <demaille@gostai.com>
2579
2580 Coding style changes.
2581 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2582 (b4_symbol_constructor_declarations)
2583 (b4_symbol_constructor_definition_)
2584 (b4_symbol_constructor_definitions)
2585 (b4_yytranslate_definition): Rename as...
2586 (b4_symbol_constructor_declare_)
2587 (b4_symbol_constructor_declare)
2588 (b4_symbol_constructor_define_)
2589 (b4_symbol_constructor_define)
2590 (b4_yytranslate_define): these.
2591 * data/variant.hh (b4_variant_definition): Rename as...
2592 (b4_variant_define): this.
2593
b47b6ff7
AD
25942009-03-02 Akim Demaille <demaille@gostai.com>
2595
2596 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
2597 * data/bison.m4 (b4_percent_define_if_define): New.
2598 * data/c++.m4 (b4_variant_if): Move to...
2599 * data/bison.m4: Here, using b4_percent_define_if_define.
2600 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
2601 * data/bison.m4: Here, using b4_percent_define_if_define.
2602
1d6b689b
AD
26032009-03-02 Akim Demaille <demaille@gostai.com>
2604
2605 Dub symbol_type_base as a public type.
2606 * data/c++.m4 (b4_public_types_declare): Now define
2607 symbol_type_base and symbol_type.
2608 (b4_public_types_define): New.
2609 In both cases, the definitions are taken verbatim from lalr1.cc.
2610 * data/lalr1.cc: Adjust.
2611
4f84717d
AD
26122009-03-02 Akim Demaille <demaille@gostai.com>
2613
2614 b4_public_types_declare.
2615 * data/c++.m4 (b4_public_types_declare): New.
2616 * data/glr.cc, data/lalr1.cc: Use it.
2617
b9e4eb5b
AD
26182009-03-02 Akim Demaille <demaille@gostai.com>
2619
2620 b4_semantic_type_declare.
2621 * data/c++.m4 (b4_semantic_type_declare): New.
2622 Factors and generalizes what was in glr.cc and lalr1.cc.
2623 * data/variant.hh (b4_semantic_type_declare): Redefine it for
2624 variants.
2625 * data/lalr1.cc, data/glr.cc: Use it.
2626
6a6e7f0c
AD
26272009-02-26 Akim Demaille <demaille@gostai.com>
2628
2629 Upgrade gnulib.
2630 * gnulib: Upgrade from master.
2631 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
2632 Regen.
2633
e9e61b00
AD
26342009-02-25 Akim Demaille <demaille@gostai.com>
2635
2636 Remove useless arguments.
2637 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
2638 relevant.
2639
3eead995
AD
26402009-02-25 Akim Demaille <demaille@gostai.com>
2641
2642 Comment changes.
2643 * data/lalr1.cc: here.
2644
87f28efe
AD
26452009-02-25 Akim Demaille <demaille@gostai.com>
2646
2647 Fix glr.cc's debug level handling.
2648 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
2649 glr.c which is used.
2650 (debug_level, set_debug_level): Adjust.
2651
9be2a009
AD
26522009-02-25 Akim Demaille <demaille@gostai.com>
2653
2654 Copyright years.
2655 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2656
07a6e87d
AD
26572009-02-25 Akim Demaille <demaille@gostai.com>
2658
2659 Style changes.
2660 * etc/bench.pl.in (generate_grammar_list): Consitently use
2661 location_type, not yy::location.
2662
33c78bd2
AD
26632009-02-25 Akim Demaille <demaille@gostai.com>
2664
2665 Comment change.
2666 * data/lalr1.cc: here.
2667
49572920
AD
26682009-02-19 Akim Demaille <demaille@gostai.com>
2669
2670 Make yyparser::error public.
2671 * data/lalr1.cc: here.
2672 There is no good reason to keep it private (and it is convenient
2673 to use it from the scanner for instance). It is already public in
2674 glr.cc.
2675
88654b47
AD
26762009-02-19 Akim Demaille <demaille@gostai.com>
2677
2678 Comment changes.
2679 * data/glr.cc: here.
2680
4524c55b
AD
26812009-02-19 Akim Demaille <demaille@gostai.com>
2682
2683 Remove trailing blanks.
6a6e7f0c
AD
2684 The epilogue has its own ending \n, no need to add another.
2685
4524c55b
AD
2686 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
2687 epilogue.
2688 * data/glr.cc: dnl when extending the epilogue.
2689 Remove stray "private:".
2690
6ceccee8
AD
26912009-02-19 Akim Demaille <demaille@gostai.com>
2692
2693 Use b4_c_modern.
2694 * data/c.m4 (b4_c_function_decl): Here.
2695
9c6a8966
AD
26962009-02-19 Akim Demaille <demaille@gostai.com>
2697
2698 Comment changes.
2699 * data/lalr1.cc: here.
2700
507aa0e2
AD
27012009-02-19 Akim Demaille <demaille@gostai.com>
2702
2703 Extract variant.hh
2704 * data/variant.hh: New, extracted from...
2705 * data/lalr1.cc: here.
2706 Adjust.
2707 * data/local.mk: Adjust.
2708
51bacae6
AD
27092009-02-19 Akim Demaille <demaille@gostai.com>
2710
2711 Extract stack.hh from lalr1.cc.
2712 * data/stack.hh: New.
2713 * data/lalr1.cc: Extract from here.
2714 * data/local.mk: Adjust.
2715
06c3084f
JD
27162009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2717
2718 Add reminder about uploading public key to keys.gnupg.net.
2719 * HACKING (Release Procedure): Here.
2720
0ea583d2
AD
27212009-01-28 Akim Demaille <demaille@gostai.com>
2722
2723 * NEWS: Update information about 2.4.1 and 2.4.2.
2724
402b123d
AD
27252008-11-04 Akim Demaille <demaille@gostai.com>
2726
2727 Reformat NEWS.
2728 * NEWS: Use more outline-mode markup.
2729 Suggested by Jim Meyering.
2730
74553c98
AD
27312009-01-08 Akim Demaille <demaille@gostai.com>
2732
2733 Fix grep portability issues.
2734 Grep on Solaris does not support -q.
2735 Reported by Summum Bonum.
2736
2737 * NEWS: Add a stub for 2.4.2.
2738 * THANKS: Add Summum Bonum.
2739 * tests/atlocal.in (EGREP): New.
2740 (CC, CXX, XSLTPROC): Make it possible to override them via
2741 envvars.
2742 * tests/java.at: Use $EGREP instead of egrep.
2743 Use AT_CHECK's ignore instead of grep's -q.
2744
84eedf86
AD
27452008-12-11 Akim Demaille <demaille@gostai.com>
2746
2747 Pass the token type to yysyntax_error.
2748 * data/yacc.c (yysyntax_error): Take the transated token instead
2749 of the raw number.
2750 Adjust callers.
2751 * TODO: Update.
2752
5860cc8c
AD
27532008-12-11 Akim Demaille <demaille@gostai.com>
2754
2755 Formatting changes.
2756 * data/glr.c: Formatting changes.
2757
2b008529
AD
27582008-12-11 Akim Demaille <demaille@gostai.com>
2759
2760 Propagate i18n changes into glr.c.
2761 * TODO: Update.
2762 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
2763 building the error message format dynamically.
2764 * data/lalr1.java: Formatting changes.
2765
2cd1af95
AD
27662008-12-11 Akim Demaille <demaille@gostai.com>
2767
2768 Use testsuite -C.
2769 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
2770 Solves problems when top_srcdir is an absolute path.
2771 Suggested by Eric Blake.
2772 * configure.ac: Require Autoconf 2.62.
2773
eeb29422
AD
27742008-12-11 Akim Demaille <demaille@gostai.com>
2775
2776 Simplify the i18n of the error messages.
2777 * data/lalr1.cc: Comment changes.
2778 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
2779 lalr1.cc instead of building dynamically the format string.
2780
6617622c
AD
27812008-12-08 Akim Demaille <demaille@gostai.com>
2782
2783 Fix portability issue in the test suite.
2784 * tests/local.at (AT_MATCHES_CHECK): New.
2785 Based on Perl instead of Sed. Sed has too many portability
2786 pitfalls, not ever Sed is GNU Sed.
2787 * tests/actions.at (Fix user actions without a trailing semicolon):
2788 Use it.
2789
2ca1136c
AD
27902008-12-08 Akim Demaille <demaille@gostai.com>
2791
2792 Update data/README.
2793 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2794
6c63b895
AD
27952008-12-08 Akim Demaille <demaille@gostai.com>
2796
2797 Install autoconf as a submodule to get m4sugar.
2798 * .gitmodules: Add submodules/autoconf.
2799 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2800 submodules/autoconf.
2801
417e31d2
AD
28022008-12-08 Akim Demaille <demaille@gostai.com>
2803
2804 Test token.prefix in all the skeletons.
2805 * data/java.m4 (b4_token_enum): Use the token.prefix.
2806 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
2807 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
2808 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
2809 * tests/java.at: Comment changes.
2810 (AT_CHECK_JAVA_MINIMAL): Define the END token.
2811 (Java parser class and package names): Add token.prefix check.
2812
97abf544
AD
28132008-12-08 Akim Demaille <demaille@gostai.com>
2814
2815 Fix regeneration of atconfig.
2816 * tests/local.mk (tests/atconfig): The rule was incorrect, but
2817 remove it: now that there is no tests/Makefile.am, the top-level
2818 Makefile properly updates atconfig when needed.
2819
e8cd1ad6
DJ
28202008-12-07 Di-an Jan <dianj@freeshell.org>
2821
2822 Implement the FIXME that ends an user action with a semicolon
2823 if it seems necessary.
2824 * src/scan-code.l (flex rules section): Flag cpp directive from
2825 any `#' to the first unescaped end-of-line. Semicolon is not
2826 needed after `;', `{', '}', or cpp directives and is needed after
2827 any other token (whitespaces and comments have no effect).
2828 * tests/actions.at (Fix user actions without a trailing semicolon):
2829 New test.
2830 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2831 to make user actions complete statements.
2832 Adjust column numbers in error messages.
2833 * tests/regression.at (Fix user actions without a trailing semicolon):
2834 Remove. Covered by new test.
2835
ce9447fc
AD
28362008-12-07 Akim Demaille <demaille@gostai.com>
2837
2838 Update gnulib.
2839 * gnulib: Update from master.
2840
d333175f
EB
28412008-12-05 Eric Blake <ebb9@byu.net>
2842
2843 Avoid compiler warning.
2844 * src/output.c (muscle_insert_item_number_table): Delete unused
2845 function.
2846
215b40ac
EB
28472008-12-02 Eric Blake <ebb9@byu.net>
2848
2849 Build testsuite with newer autoconf.
2850 * tests/output.at (m4_expand): Don't override in newer autoconf,
2851 where the underlying implementation changed.
2852 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2853 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2854 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2855 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2856 since some of them contain unbalanced ')'.
2857
3bb21113
AD
28582008-12-01 Akim Demaille <demaille@gostai.com>
2859
2860 Use b4_symbol for printers and destructors everywhere.
2861 * data/bison.m4 (b4_symbol_action_location): New.
2862 * data/c.m4 (b4_symbol_actions): Remove.
2863 Adjust all callers to use by b4_symbol_foreach and the corresponding
2864 b4_symbol_printer/destructor macro.
2865 * data/glr.cc: Adjust.
2866 * data/lalr1.java: Adjust the %destructor sanity check.
2867 * src/output.c (symbol_code_props_output): Remove, we no longer
2868 need the b4_symbol_printers/destructors tables.
2869
fb7c5b1f
AD
28702008-12-01 Akim Demaille <demaille@gostai.com>
2871
2872 Use b4_symbol_case_.
2873 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
2874 b4_symbol_case_.
2875
cf6fb222
AD
28762008-12-01 Akim Demaille <demaille@gostai.com>
2877
2878 Move b4_symbol based macro to bison.m4.
2879 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
2880 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
2881 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
2882 (b4_type_foreach): Move to...
2883 * data/bison.m4: Here.
2884 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
2885 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 2886
e3c52a63
AD
28872008-12-01 Akim Demaille <demaille@gostai.com>
2888
2889 b4_symbol/type_foreach.
2890 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
2891 Use them.
2892
2bde9113
AD
28932008-12-01 Akim Demaille <demaille@gostai.com>
2894
2895 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
2896 Instead of defining complex list of tuples to define various
2897 properties of the symbols, we now prefer to define symbols as
2898 "structs" in m4: using the symbol key (its number), and the
2899 property name, b4_symbol gives it value. Use this to handle
2900 destructors and printers.
2901
2bde9113
AD
2902 * src/output.c (CODE_PROP): New.
2903 (prepare_symbol_definitions): Use it to define the printer and
2904 destructor related attributes of the symbols.
2905 * data/lalr1.cc (b4_symbol_actions): Rename as...
2906 (b4_symbol_action): this.
2907 Use b4_symbol instead of 6 arguments.
2908 (b4_symbol_printer, b4_symbol_destructor): New.
2909 Use them instead of b4_symbol_actions.
2910
44494bf6
AD
29112008-12-01 Akim Demaille <demaille@gostai.com>
2912
2913 Avoid capturing variables too easily.
2914 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
2915 v__ and p__ instead of v and p.
2916
fad814bd
AD
29172008-12-01 Akim Demaille <demaille@gostai.com>
2918
2919 Remove spurious empty line before syncline.
2920 * data/bison.m4 (b4_syncline): Don't output an empty line before
2921 the output.
2922
feda5527
AD
29232008-11-26 Akim Demaille <demaille@gostai.com>
2924
2925 Convert lib/Makefile.am into lib/local.mk.
2926 The real problem is rather gnulib.mk, which itself is extracted
2927 from a Makefile.am that gnulib expects to the "recursive". The
2928 tool prefix-gnulib-mk converts such a gnulib.mk to be
2929 non-recursive. Also, some AC_SUBST variables need to be adjusted.
2930
2931 * etc/prefix-gnulib-mk: New.
2932 * bootstrap (slurp): Use it to convert further gnulib.mk.
2933 No longer try to avoid re-creation of lib/gnulib.mk as the changes
2934 are deeper.
2935 * lib/Makefile.am: Rename as...
2936 * lib/local.mk: this.
2937 Adjust to be prefixed.
2938 * Makefile.am, configure.ac: Adjust.
2939 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
2940
56ddee7f
AD
29412008-11-26 Akim Demaille <demaille@gostai.com>
2942
2943 s/_FLAGS/FLAGS/.
2944 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
2945 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
2946 Reported by Eric Blake.
2947
728e89a0
AD
29482008-11-26 Akim Demaille <demaille@gostai.com>
2949
2950 Use b4_parser_tables_define in glr.cc.
2951 * data/glr.c: Use b4_parser_tables_define instead of defining the
2952 (deterministic integral) tables by hand.
2953
2c1bf9bd
AD
29542008-11-26 Akim Demaille <demaille@gostai.com>
2955
2956 Use b4_parser_tables_define in Java.
2957 * data/java.m4 (b4_typed_parser_table): Rename as...
2958 (b4_typed_parser_table_define): this, for consistency.
2959 Accept a comment as $4.
2960 Move $2 into yy*_.
2961 (b4_integral_parser_table): Rename as...
2962 (b4_integral_parser_table_define): this.
2963 * data/lalr1.java: Adjust all uses.
2964 Use b4_parser_tables_define instead of generation by hand.
2965
ba206cf4
AD
29662008-11-26 Akim Demaille <demaille@gostai.com>
2967
2968 Prepare the convergence bw C style and Java table generation.
2969 * data/bison.m4 (b4_tables_map, b4_tables_declare)
2970 (b4_tables_define): Rename as...
2971 (b4_integral_parser_tables_map, b4_parser_tables_declare)
2972 (b4_parser_tables_define): these.
2973 * data/c.m4 (b4_table_define): Rename as...
2974 (b4_integral_parser_table_define): this.
2975 * data/lalr1.cc: Adjust.
2976 (b4_table_define, b4_table_declare): Rename as...
2977 (b4_integral_parser_table_define)
2978 (b4_integral_parser_table_declare): these.
2979 (yyrline_): Move the comment where it is actually used.
2980 * data/yacc.c: Adjust.
2981 (yyrline): Use b4_integral_parser_table_define.
2982
d12f8e49
AD
29832008-11-26 Akim Demaille <demaille@gostai.com>
2984
2985 Regen.
2986 * src/parse-gram.h, src/parse-gram.c: Regen.
2987
0991e29b
AD
29882008-11-26 Akim Demaille <demaille@gostai.com>
2989
2990 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
2991 * data/lalr1.cc (b4_tables_map): Move to...
2992 * data/bison.m4: here.
2993 Update the comment for yytable during the flight.
2994 (b4_tables_declare, b4_tables_define): New.
2995 * data/lalr1.cc: Use them.
2996 * data/c.m4 (b4_table_define): New.
2997 * data/yacc.c: Use b4_tables_define instead of output the tables
2998 by hand.
2999 * tests/regression.at (Web2c Actions): Adjust the expected output,
3000 the order of the tables changed.
3001
3d3bc1fe
AD
30022008-11-26 Akim Demaille <demaille@gostai.com>
3003
3004 Get rid of (yy)rhs and (yy)prhs.
3005 These tables are no longer needed in the parsers, and they don't seem to
3006 be useful. They are not documented either.
feda5527 3007
3d3bc1fe
AD
3008 * src/output.c (prepare_rules): Get rid of rhs and prhs.
3009 Adjust the computation of (yy)r2.
3010
08c81469
AD
30112008-11-26 Akim Demaille <demaille@gostai.com>
3012
3013 Rule length is unsigned.
3014 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
3015
932b0c96
AD
30162008-11-26 Akim Demaille <demaille@gostai.com>
3017
3018 Get rid of lalr1-split.cc.
3019 It was no longer maintainer.
feda5527 3020
932b0c96
AD
3021 * data/lalr1-split.cc: Remove.
3022 * etc/bench.pl.in (bench_fusion_parser): Remove.
3023 Adjust.
3024
8452c667
AD
30252008-11-26 Akim Demaille <demaille@gostai.com>
3026
3027 Use yy* consistently.
3028 * data/glr.c: Now that yyrhs no longer exists as a global
3029 variable, rename local "rhs" variables into "yyrhs" for
3030 consistency.
3031
783aa653
AD
30322008-11-25 Akim Demaille <demaille@gostai.com>
3033
3034 Get rid of yyrhs and yyprhs in glr.c.
3035 * data/glr.c (yyrhs, yyprhs): Remove.
3036 Instead, use the state stack and yystos.
3037
6130b755
AD
30382008-11-25 Akim Demaille <demaille@gostai.com>
3039
3040 Flag glr tests.
3041 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
3042 as an Autotest keyword.
3043
95a7b1c9
AD
30442008-11-25 Akim Demaille <demaille@gostai.com>
3045
3046 Prefer TESTSUITE_FLAGS.
3047 TESTSUITEFLAGS is barely readable.
feda5527 3048
95a7b1c9
AD
3049 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
3050 for backward compatibility.
3051 Use the former instead of the latter.
3052
b4f18401
AD
30532008-11-25 Akim Demaille <demaille@gostai.com>
3054
3055 Get rid of yyrhs and yyprhs in larl1.java.
3056 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
3057 (yy_reduce_print): Rather, use yystos_ and the state stack.
3058
c265fd6b
AD
30592008-11-25 Akim Demaille <demaille@gostai.com>
3060
3061 Formatting changes.
3062
68dbdee8
AD
30632008-11-25 Akim Demaille <demaille@gostai.com>
3064
3065 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
3066 They were used to get the symbol types, given a rule number, when
3067 displaying the top of the stack before a reduction. But the
3068 symbol type is available from the state stack. This has two be
3069 benefits: two tables less in the parser (making it smaller), and a
3070 more consistent use of the three stacks which will help to fuse
3071 them.
feda5527 3072
68dbdee8
AD
3073 * data/yacc.c (yyprhs, yyrhs): Remove.
3074 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
3075 (yy_reduce_print): Take yyssp as argument.
3076 Use it, together with yystos, to get the symbol type.
3077 * tests/regression.at (Web2c Report): Remove these tables from the
3078 expected output.
3079
6ab1adbe
AD
30802008-11-25 Akim Demaille <demaille@gostai.com>
3081
3082 b4_tables_map.
3083 The point is to factor the generation of the tables across skeletons.
3084 This is language dependant.
feda5527 3085
6ab1adbe
AD
3086 * data/c.m4 (b4_comment_): New.
3087 Should be usable to define how to generate tables independently of
3088 the language.
3089 (b4_c_comment): New.
3090 (b4_comment): Bounce to b4_c_comment.
3091 Now support $2 = [PREFIX] for indentation.
3092 * data/lalr1.cc (b4_table_declare): Don't output a comment if
3093 there is no comment.
3094 Indent it properly when there is one.
3095 Output the ending semicolon.
3096 (b4_table_define): Space changes.
3097 Output the ending semicolon.
3098 (b4_tables_map): New.
3099 Use it twice instead of declaring and defining the (integral)
3100 tables by hand.
3101
0fddb3d5
AD
31022008-11-25 Akim Demaille <demaille@gostai.com>
3103
3104 b4_table_declare.
3105 * data/lalr1.cc (b4_table_declare): New.
3106 Use it to declare the tables defined with b4_table_define.
3107 (b4_table_define): Declare a third arg to match b4_table_declare
3108 signature.
3109 Move all the comments around invocations of b4_table_define into
3110 the invocations itselves.
3111 Move things around to have the order for declarations and
3112 definitions.
3113
c4ddc0fb
AD
31142008-11-25 Akim Demaille <demaille@gostai.com>
3115
3116 Formatting changes.
3117 * data/lalr1.java: here.
3118
e0c653e7
AD
31192008-11-25 Akim Demaille <demaille@gostai.com>
3120
3121 b4_args is more general than only C++.
3122 * data/lalr1.cc (b4_args, _b4_args): Move to...
3123 * data/bison.m4: here.
3124
4182a0a1
DJ
31252008-11-21 Di-an Jan <dianj@freeshell.org>
3126
3127 Implement no-XXX arguments for --warnings, --report, --trace.
3128 * src/getargs.c (flags_argmatch): Handles no-XXX.
3129 Fix typo in doxygen comment.
3130
01466c3e
AD
31312008-11-21 Akim Demaille <demaille@gostai.com>
3132
3133 Display the changes in cross-options.texi.
3134 * build-aux/cross-options.pl ($sep): New, to separate items.
3135 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
3136 changes.
3137
a7c09cba
DJ
31382008-11-20 Di-an Jan <dianj@freeshell.org>
3139
3140 Improves options in the manual.
3141 * doc/bison.texinfo (-g, -x): Add space before argument.
3142 (Option Cross Key): Implement FIXME: listing directives also.
3143 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
3144 (Short Option): Special case -d. Put arguments inside @option.
feda5527 3145 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
3146 src/scan-gram.l (actual name passed as the first argument)
3147 with special case for %define.
3148 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
3149 to build-aux/cross-options.pl.
3150 * src/getargs.c (usage): Document limitations of cross-options.pl.
3151 * src/scan-gram.l: Likewise.
3152
6c88b51e
JD
31532008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3154
3155 Fix unexpanded macros in GLR defines file.
3156 Reported by Csaba Raduly at
3157 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
3158 * THANKS (Csaba Raduly): Add.
3159 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
3160 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
3161 lexer in a separate module that includes the defines file.
3162 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
3163 source.
3164 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
3165 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
3166 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
3167 (AT_DATA_SOURCE_PROLOGUE): New.
3168 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
3169 (AT_DATA_SOURCE): New.
3170 (AT_FULL_COMPILE): Extend to support an additional source file.
3171
1e034807
AD
31722008-11-18 Akim Demaille <demaille@gostai.com>
3173
3174 More TODO.
3175 * TODO: More short term issues.
3176
e3dda35c
AD
31772008-11-18 Akim Demaille <demaille@gostai.com>
3178
3179 Regen.
3180 * src/parse-gram.h, src/parse-gram.c: Regen.
3181
bd187d7b
AD
31822008-11-18 Akim Demaille <demaille@gostai.com>
3183
3184 Use b4_subtract where possible.
3185 * data/lalr1.cc (b4_subtract): Move to...
3186 * data/bison.m4: here.
3187 * data/glr.c (b4_rhs_data): Use it.
3188 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
3189
6085ab0d
AD
31902008-11-18 Akim Demaille <demaille@gostai.com>
3191
3192 Remove incorrect mode specification.
3193 * data/glr.cc: Don't pretend it's C code.
3194
9ce405ce
JD
31952008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3196
3197 Simplify last patch slightly.
3198 * src/getargs.c (getargs): Here.
3199
a8beef7e
JD
32002008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3201
3202 Fix last warning from --enable-gcc-warnings.
3203 * src/getargs.c (getargs): Don't assign const address to non-const
3204 pointer.
3205
d50eea6d
JD
32062008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3207
3208 Don't let maintainer-*-check targets force a version update.
3209 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
3210 handled.
3211
f5f419de
DJ
32122008-11-17 Di-an Jan <dianj@freeshell.org>
3213
3214 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
3215 Align menus. Adjust word wrapping. Use node names for menu names.
3216 (Examples): Don't abbreviate node names.
3217 (LocalWords): Remove abbreviations.
3218 (Copying): Make description a sentence.
d50eea6d 3219 (Java Action Features): Remove period to match the rest of menu.
f5f419de 3220
d73e55e0
DJ
32212008-11-17 Di-an Jan <dianj@freeshell.org>
3222
3223 Handles several --enable-gcc-warnings.
3224 * src/getargs.c (command_line_location): Set parameters to void.
3225 * src/output.c (symbol_type_name_cmp): Make static.
3226 (symbols_by_type_name): Set parameters to void.
3227 (symbol_definitions_output): Remove unused parameter. Rename as...
3228 (prepare_symbol_definitions): this.
3229 (muscles_output): Move symbol_definitions_output to...
3230 (output): here as prepare_symbol_definitions.
3231 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 3232 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 3233
68c989de
DJ
32342008-11-17 Di-an Jan <dianj@freeshell.org>
3235
3236 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
3237 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
3238
23ce6f4c
AD
32392008-11-16 Akim Demaille <demaille@gostai.com>
3240
3241 Add missing $(EXEEXT).
3242 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
3243 "src/bison$(EXEEXT)".
3244 Reported by Di-an Jan.
3245
dd704c35
AD
32462008-11-15 Akim Demaille <demaille@gostai.com>
3247
3248 * TODO: Update.
3249
dab244d5
AD
32502008-11-15 Akim Demaille <demaille@gostai.com>
3251
3252 Formatting changes.
3253 * tests/input.at: here.
3254
4b4da9fb
AD
32552008-11-15 Akim Demaille <demaille@gostai.com>
3256
3257 Remove duplicate header inclusion.
3258 * src/LR0.c: here.
3259
4ea3f53d
AD
32602008-11-15 Akim Demaille <demaille@gostai.com>
3261
3262 * src/parse-gram.h, src/parse-gram.c: Regen.
3263
cb823b6f
AD
32642008-11-15 Akim Demaille <demaille@gostai.com>
3265
3266 Support parametric types.
b06df3c2
AD
3267
3268 There are two issues to handle: first scanning nested angle
3269 bracket pairs to support types such as std::pair< std::string,
3270 std::list<std::string> > >.
3271
3272 Another issue is to address idiosyncracies of C++: do not glue two
3273 closing angle brackets together (otherwise it's operator>>), and
3274 avoid sticking blindly a TYPE to the opening <, as it can result
3275 in '<:' which is a digraph for '['.
3276
cb823b6f
AD
3277 * src/scan-gram.l (brace_level): Rename as...
3278 (nesting): this.
3279 (SC_TAG): New.
3280 Implement support for complex tags.
b06df3c2 3281 (tag): Accept
cb823b6f
AD
3282 , but not <.
3283 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
3284 (b4_symbol_variant): Leave space around types as parameters.
3285 * examples/variant.yy: Use nested template types and leading ::.
3286 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
3287 Rename as...
3288 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
3289 * tests/c++.at: Test parametric types.
3290
7b6e6753
AD
32912008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3292
3293 Test token.prefix.
3294 This is not sufficient, but we test at least that the make_SYMBOL
3295 interface is not affected by token.prefix. A more general test
3296 will be implemented when the support of token.prefix is generalized
3297 to more skeletons.
b06df3c2 3298
7b6e6753
AD
3299 * tests/c++.at: One more variant test, using token.prefix.
3300
dddec537
AD
33012008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3302
3303 Test the make_TOKEN interface.
3304 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
3305 Factor the common code in yylex.
3306 Use it to test "%define lex_symbol".
3307
7d3e21ba
AD
33082008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3309
3310 Formatting change.
3311
4fc55348
AD
33122008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3313
3314 Simplify code for variants bench marks.
3315 * etc/bench.pl.in (&generate_grammar_list): Define and use
3316 location_type.
3317 Factor the common code in yylex.
3318
070e6509
AD
33192008-11-15 Akim Demaille <demaille@gostai.com>
3320
3321 Better error message.
3322 * bootstrap (find_tool): Fix the error message.
3323
0078681b
AD
33242008-11-15 Akim Demaille <demaille@gostai.com>
3325
3326 Update variant.yy to newest interface.
3327 * examples/variant.yy: Define lex_symbol.
3328 Adjust.
3329
ff084799
AD
33302008-11-15 Akim Demaille <demaille@gostai.com>
3331
3332 Don't use locations in variant.yy.
3333 * examples/variant.yy: Adjust to not using locations.
3334
b0d79ec6
AD
33352008-11-15 Akim Demaille <demaille@gostai.com>
3336
3337 Comment changes.
3338 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
3339 comments for the license.
3340
d4977ce3
AD
33412008-11-15 Akim Demaille <demaille@gostai.com>
3342
3343 Remove tests/Makefile.am.
3344 * tests/Makefile.am: Rename as...
3345 * tests/local.mk: this.
3346 * Makefile.am, configure.ac: Adjust.
3347 * Makefile.am (DISTCLEANFILES): Define.
3348 (maintainer-check, maintainer-xml-check, maintainer-push-check):
3349 Remove, we no longer need to bounce to the real targets.
3350
87f1149a
AD
33512008-11-15 Akim Demaille <demaille@gostai.com>
3352
3353 Comment changes.
3354
36415906
AD
33552008-11-15 Akim Demaille <demaille@gostai.com>
3356
3357 djgpp/local.mk.
3358 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
3359 * djgpp/local.mk: this new file.
3360
e2c2f696
AD
33612008-11-15 Akim Demaille <demaille@gostai.com>
3362
3363 Remove doc/Makefile.am.
3364 * doc/Makefile.am: Rename as...
3365 * doc/local.mk: this.
3366 Adjust paths
3367 * Makefile.am, configure.ac: Adjust.
3368 * Makefile.am (MOSTLYCLEANFILES): New.
3369 * src/local.mk: Adjust.
3370
2ead32e6
AD
33712008-11-15 Akim Demaille <demaille@gostai.com>
3372
3373 Move sc_tight_scope into maint.mk.
b06df3c2
AD
3374 It does not work, and I don't know how it was supposed to work: it
3375 seems to be looking for sources in the build tree. I just moved
3376 it at a better place, fixing it is still required.
3377
2ead32e6
AD
3378 * src/local.mk (echo): Remove.
3379 (sc_tight_scope): Move to...
3380 * maint.mk: here.
3381
2df9ec37
AD
33822008-11-15 Akim Demaille <demaille@gostai.com>
3383
3384 Regen.
3385 * src/parse-gram.h, src/parse-gram.h: Regen.
3386
0305d25e
AD
33872008-11-15 Akim Demaille <demaille@gostai.com>
3388
3389 Remove src/Makefile.am.
3390 * src/Makefile.am: Rename as...
3391 * src/local.mk: this.
3392 Prefix all the paths with src/.
3393 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
3394 (AM_CPPFLAGS): Find find in builddir/src.
3395 (YACC): Move the flags into...
3396 (AM_YFLAGS): here.
3397 * maint.mk (sc_tight_scope): Disable.
3398 It used to bounce to the version in src/Makefile.am which is now
3399 part of this very Makefile.
3400 * Makefile.am, configure.ac: Adjust.
3401 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
3402 include "..." to find files "here": we are no longer in src/, so
3403 qualify the includes with src/.
3404 * doc/Makefile.am (PREPATH): No longer include the top_builddir
3405 prefix.
3406 (.x.1): Adjust to be able to create src/foo from the top level
3407 Makefile, instead of going bounce to src/Makefile the creation of
3408 foo.
3409
5277c0a3
AD
34102008-11-15 Akim Demaille <demaille@gostai.com>
3411
3412 Remove useless variable.
3413 * doc/Makefile.am (srcsrcdir): Remove.
3414
6a5aa0cd
AD
34152008-11-15 Akim Demaille <demaille@gostai.com>
3416
3417 Remove data/Makefile.am.
3418 * data/Makefile.am: Rename as...
3419 * data/local.mk: this.
3420 Adjust paths.
3421 * Makefile.am, configure.ac: Adjust.
3422
7cb794dc
AD
34232008-11-15 Akim Demaille <demaille@gostai.com>
3424
3425 Remove etc/Makefile.am.
3426 * etc/Makefile.am: Rename as...
3427 * etc/local.mk: this.
3428 Adjust.
3429 * Makefile.am, configure.ac: Adjust.
3430
cd409e3b
AD
34312008-11-15 Akim Demaille <demaille@gostai.com>
3432
3433 Remove examples/local.mk.
3434 examples/calc++/Makefile.am might be interesting to keep as is, since
3435 it is an example in itself.
2df9ec37 3436
cd409e3b
AD
3437 * examples/Makefile.am: Rename as...
3438 * examples/local.mk: this.
3439 Adjust.
3440 * Makefile.am, configure.ac: Adjust.
3441
9a1e4214
AD
34422008-11-15 Akim Demaille <demaille@gostai.com>
3443
3444 Remove build-aux/Makefile.am.
3445 Recursive Makefiles are really way too slow, let's get rid of some of
3446 them.
2df9ec37 3447
9a1e4214
AD
3448 * build-aux/Makefile.am: Rename as...
3449 * build-aux/local.mk: this.
3450 Adjust paths.
3451 * Makefile.am, configure.ac: Adjust.
3452
0634493c
AD
34532008-11-15 Akim Demaille <demaille@gostai.com>
3454
3455 Provide convenience constructors for locations and positions.
3456 * data/location.cc (position::position): Accept file, line and
3457 column as arguments with default values.
3458 Always qualify initial line and column literals as unsigned.
3459 (location::location): Provide convenience constructors.
3460
fe1b448a
AD
34612008-11-15 Akim Demaille <demaille@gostai.com>
3462
b06df3c2
AD
3463 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
3464 token type.
fe1b448a
AD
3465 Using template buys us nothing, and makes it uselessly complex to
3466 construct a symbol. Besides, it could not be generalized to other
3467 languages, while make_FOO would work in C/Java etc.
2df9ec37 3468
fe1b448a
AD
3469 * data/lalr1.cc (b4_symbol_): New.
3470 (b4_symbol): Use it.
3471 (b4_symbol_constructor_declaration_)
3472 (b4_symbol_constructor_definition_): Instead of generating
3473 specializations of an overloaded template function, just generate
3474 several functions whose names are forged from the token names
3475 without the token.prefix.
3476 (b4_symbol_constructor_declarations): Generate them for all the
3477 symbols, not just by class of symbol type, now that instead of
3478 specializing a function template by the token, we generate a
3479 function named after the token.
3480 (b4_symbol_constructor_specialization_)
3481 (b4_symbol_constructor_specializations): Remove.
3482 * etc/bench.pl.in: Adjust to this new API.
3483
5679f311
AD
34842008-11-13 Akim Demaille <demaille@gostai.com>
3485
3486 %define token.prefix.
b06df3c2
AD
3487 Provide a means to add a prefix to the name of the tokens as
3488 output in the generated files. Because of name clashes, it is
3489 good to have such a prefix such as TOK_ that protects from names
3490 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 3491
5679f311
AD
3492 * data/bison.m4 (token.prefix): Empty by default.
3493 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
3494 * data/lalr1.cc (b4_symbol): Ditto.
3495
3204049e
AD
34962008-11-13 Akim Demaille <demaille@gostai.com>
3497
3498 Compute at M4 time some of the subtractions.
90290ce5 3499 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
3500 (b4_rhs_data): Use it.
3501
202598d3
AD
35022008-11-13 Akim Demaille <demaille@gostai.com>
3503
3504 symbol::token.
b06df3c2 3505 This allows the user to get the type of a token returned by yylex.
2df9ec37 3506
202598d3
AD
3507 * data/lalr1.cc (symbol::token): New.
3508 (yytoknum_): Define when %define lex_symbol, independently of
3509 %debug.
3510 (yytoken_number_): Move into...
3511 (symbol::token): here, since that's the only use.
3512 The other one is YYPRINT which was not officially supported
3513 by lalr1.cc, and anyway it did not work since YYPRINT uses this
3514 array under a different name (yytoknum).
3515
fc2476c7
AD
35162008-11-13 Akim Demaille <demaille@gostai.com>
3517
3518 YYERRCODE.
3519 * TODO (YYERRCODE): Mention the case of $undef.
3520
865f1e9f
AD
35212008-11-13 Akim Demaille <demaille@gostai.com>
3522
3523 TODO: YYPRINT.
3524 * TODO (YYPRINT): New.
3525
cb0b136a
AD
35262008-11-13 Akim Demaille <demaille@gostai.com>
3527
3528 Comment changes.
3529 * data/lalr1.cc, data/yacc.c: Fix the description of the
3530 yytranslate and yytoknum tables.
3531
2c086d29
AD
35322008-11-13 Akim Demaille <demaille@gostai.com>
3533
3534 Define make_symbol in the header.
b06df3c2
AD
3535 To reach good performances these functions should be inlined (yet
3536 this is to measure precisely). To this end they must be available
3537 to the caller.
2df9ec37 3538
2c086d29
AD
3539 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
3540 location_type with the class name.
3541 Since will now be output in the header, declare "inline".
3542 No longer use b4_symbol_constructor_specializations, but
3543 b4_symbol_constructor_definitions in the header.
3544 Don't call it in the *.cc file.
3545
1c4af381
AD
35462008-11-13 Akim Demaille <demaille@gostai.com>
3547
3548 Define yytranslate in the header for lex_symbol.
3549 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
3550 into the header file when using %define lex_symbol.
3551 (yytranslate_): Declare inline.
3552
e51b0a82
AD
35532008-11-13 Akim Demaille <demaille@gostai.com>
3554
b06df3c2
AD
3555 Define the constructors of symbol_type in
3556 b4_symbol_constructor_definitions.
e51b0a82 3557 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
3558 forthcoming patch will move elsewhere. Hence the interest of
3559 putting them together.
2df9ec37 3560
b06df3c2
AD
3561 The stack_symbol_type does not need to be moved, it is used only
3562 by the parser.
2df9ec37 3563
e51b0a82
AD
3564 * data/lalr1.cc: Move symbol_type and symbol_base_type
3565 constructors into...
3566 (b4_symbol_constructor_definitions): here.
3567 Adjust.
3568
78835571
AD
35692008-11-13 Akim Demaille <demaille@gostai.com>
3570
3571 Make it easier to move the definition of yytranslate_.
3572 Forthcoming changes will make it possible to use yytranslate_
3573 from outside the parser implementation file.
2df9ec37 3574
78835571
AD
3575 * data/lalr1.cc (b4_yytranslate_definition): New.
3576 Use it.
3577
c1e6c88c
AD
35782008-11-13 Akim Demaille <demaille@gostai.com>
3579
3580 Remove useless class specification.
3581 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
3582 to refer to the class name to use a type defined by the class for
3583 arguments of member functions.
3584
4654b0c0
AD
35852008-11-13 Akim Demaille <demaille@gostai.com>
3586
3587 Finer input type for yytranslate.
3588 This patch is debatable: the tradition expects yylex to return an int
3589 which happens to correspond to token_number (which is an enum). This
3590 allows for instance to return characters (such as '*' etc.). But this
3591 goes against the stronger typing I am trying to have with the new
3592 lex interface which return a symbol_type. So in this case, feed
3593 yytranslate_ with a token_type.
2df9ec37 3594
4654b0c0
AD
3595 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
3596 expect a token_type.
3597
dd735e4e
AD
35982008-11-13 Akim Demaille <demaille@gostai.com>
3599
3600 Honor lex-params in %define lex_symbol mode.
3601 * data/lalr1.cc: Use b4_lex_param.
3602
6659366c
AD
36032008-11-13 Akim Demaille <demaille@gostai.com>
3604
3605 Simplify names.
3606 * src/output.c (symbol_definitions_output): Rename symbol
3607 attributes type_name and has_type_name as type and has_type.
3608 * data/lalr1.cc: Adjust uses.
3609
e9805e57
AD
36102008-11-13 Akim Demaille <demaille@gostai.com>
3611
3612 Use b4_type_names for the union type.
b06df3c2
AD
3613 The union used to compute the size of the variant used to iterate
3614 over the type of all the symbols, with a lot of redundancy. Now
3615 iterate over the lists of symbols having the same type-name.
2df9ec37 3616
e9805e57
AD
3617 * data/lalr1.cc (b4_char_sizeof_): New.
3618 (b4_char_sizeof): Use it.
3619 Adjust to be called with a list of numbers instead of a single
3620 number.
3621 Adjust its caller for new-line issues.
3622
aea10ef4
AD
36232008-11-13 Akim Demaille <demaille@gostai.com>
3624
3625 Define the "identifier" of a symbol.
b06df3c2
AD
3626 Symbols may have several string representations, for instance if
3627 they have an alias. What I call its "id" is a string that can be
3628 used as an identifier. May not exist.
2df9ec37 3629
b06df3c2
AD
3630 Currently the symbols which have the "tag_is_id" flag set are
3631 those that don't have an alias. Look harder for the id.
2df9ec37 3632
aea10ef4
AD
3633 * src/output.c (is_identifier): Move to...
3634 * src/symtab.c (is_identifier): here.
3635 * src/symtab.h, src/symtab.c (symbol_id_get): New.
3636 * src/output.c (symbol_definitions_output): Use it to define "id"
3637 and "has_id".
3638 Remove the definition of "tag_is_id".
3639 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
3640 "tag_is_id" were used to produce code.
3641 We still use "tag" for documentation.
3642
2ea7730c
AD
36432008-11-11 Akim Demaille <demaille@gostai.com>
3644
3645 Locations are no longer required by lalr1.cc.
3646 * data/lalr1.cc (_b4_args, b4_args): New.
3647 Adjust all uses of locations to make them optional.
3648 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
3649 (AT_CHECK_NAMESPACE): Check the use of locations.
3650 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
3651 without locations with lalr1.cc.
3652 Test these cases.
3653 * tests/output.at: Check lalr1.cc with and without location
3654 support.
3655 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
3656 Don't use locations.
3657
7ca2266a
AD
36582008-11-11 Akim Demaille <demaille@gostai.com>
3659
3660 AT_FULL_COMPILE.
3661 * tests/local.at (AT_FULL_COMPILE): New.
3662 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
3663
1a7a65f9
AD
36642008-11-11 Akim Demaille <demaille@gostai.com>
3665
3666 Support parens in calc++.
3667 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
3668 * examples/calc++/test (run): Check the expected output.
3669 Adjust callers.
3670 Check parens too.
3671
c944f7f2
AD
36722008-11-11 Akim Demaille <demaille@gostai.com>
3673
3674 Simplify lalr1.cc since %defines is mandatory.
3675 * data/lalr1.cc: Remove useless calls to b4_defines_if.
3676
dada3cd1
AD
36772008-11-11 Akim Demaille <demaille@gostai.com>
3678
3679 TODO: yyfmt.
3680 * TODO (yysyntax_error): New item.
3681
422c18f4
AD
36822008-11-11 Akim Demaille <demaille@gostai.com>
3683
3684 Prefer M4 to CPP.
3685 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
3686 YYERROR_VERBOSE.
3687
a0ffc175
AD
36882008-11-11 Akim Demaille <demaille@gostai.com>
3689
3690 Support i18n of the parse error messages.
3691 * TODO (lalr1.cc/I18n): Remove.
3692 * data/lalr1.cc (yysyntax_error_): Support the translation of the
3693 error messages, as done in yacc.c.
3694 Stay within the yy* pseudo namespace.
3695
00a8a083
AD
36962008-11-11 Akim Demaille <demaille@gostai.com>
3697
3698 More TODO.
3699 * TODO (single stack, yysyntax_error): New.
3700
09277875
AD
37012008-11-11 Akim Demaille <demaille@gostai.com>
3702
3703 Make it possible to return a symbol_type from yylex.
3704 * data/lalr1.cc (b4_lex_symbol_if): New.
3705 (parse): When lex_symbol is defined, expected yylex to return the
3706 complete lookahead.
3707 * etc/bench.pl.in (generate_grammar_list): Extend to support this
3708 yylex interface.
3709 (bench_variant_parser): Exercise it.
3710
64c1b92a
AD
37112008-11-11 Akim Demaille <demaille@gostai.com>
3712
3713 Remove useless bench case.
3714 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
3715 no longer used.
3716
2722aa42
AD
37172008-11-11 Akim Demaille <demaille@gostai.com>
3718
3719 Improve display of directives.
3720 * etc/bench.pl.in (parse_term): Don't add useless eol.
3721
918eb7c5
AD
37222008-11-11 Akim Demaille <demaille@gostai.com>
3723
3724 Use string_cast in the bench.
3725 * etc/bench.pl.in (generate_grammar_list): Define and use
3726 string_cast.
3727
39be9022
AD
37282008-11-11 Akim Demaille <demaille@gostai.com>
3729
3730 Replace yychar with a Boolean.
3731 * data/lalr1.cc (parse::yychar): Replace by...
3732 (parse::yyempty): this.
3733
a2e3fa77
AD
37342008-11-11 Akim Demaille <demaille@gostai.com>
3735
3736 Factor the tables.
3737 * TODO: New item.
3738
aba12ad1
AD
37392008-11-11 Akim Demaille <demaille@gostai.com>
3740
3741 Let yytranslate handle the eof case.
3742 * data/lalr1.cc (yytranslate_): Handle the EOF case.
3743 Adjust callers.
3744 No longer expect yychar to be equal to yyeof_, rather, test the
3745 lookahead's (translated) kind.
3746
27cb5b59
AD
37472008-11-11 Akim Demaille <demaille@gostai.com>
3748
3749 yychar cannot be empty in yyerrlab.
3750 * TODO (yychar == yyempty_): New.
3751 * data/lalr1.cc: Remove the handling of this case.
3752 This eases forthcoming changes related to yychar and yytranslate.
3753
fce629c0
AD
37542008-11-11 Akim Demaille <demaille@gostai.com>
3755
3756 Bench: syntactic sugar for %define/#define.
3757 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
3758 (&bench_push_parser, bench_variant_parser): Use this feature.
3759 (&eat): New.
3760 Use it.
3761
ce671960
AD
37622008-11-11 Akim Demaille <demaille@gostai.com>
3763
3764 Less memory pressure on the "list" bench.
3765 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
3766 the values, to limit memory pressure.
3767
2873fdf8
AD
37682008-11-11 Akim Demaille <demaille@gostai.com>
3769
3770 Introduce make_symbol.
b06df3c2
AD
3771 make_symbol provides a means to construct a full symbol (kind,
3772 value, location) in a single shot. It is meant to be a Symbol
3773 constructor, parameterized by the symbol kind so that overloading
3774 would prevent incorrect kind/value pairs. Unfortunately
3775 parameterized constructors do not work well in C++ (unless the
3776 parameter also appears as an argument, which is not acceptable),
3777 hence the use of a function instead of a constructor.
2df9ec37 3778
2873fdf8
AD
3779 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3780 (b4_symbol_constructor_declarations)
3781 (b4_symbol_constructor_specialization_)
3782 (b4_symbol_constructor_specializations)
3783 (b4_symbol_constructor_definition_)
3784 (b4_symbol_constructor_definitions): New.
3785 Use them where appropriate to generate declaration, declaration of
3786 the specializations, and implementations of the templated
3787 overloaded function "make_symbol".
3788 (variant::variant): Always define a default ctor.
3789 Also provide a copy ctor.
3790 (symbol_base_type, symbol_type): New ctor overloads for value-less
3791 symbols.
3792 (symbol_type): Now public, so that functions such as yylex can use
3793 it.
3794
8be046d7
AD
37952008-11-11 Akim Demaille <demaille@gostai.com>
3796
3797 Inform m4 whether a tag is a valid id.
3798 * src/output.c (is_identifier): New.
3799 (symbol_definitions_output): Use it to define tag_is_id.
3800 But maybe this should be done at m4 level?
3801
de62edee
AD
38022008-11-11 Akim Demaille <demaille@gostai.com>
3803
3804 Test 214 was failing: it greps with a pattern containing [ ]*
3805 which obviously meant to catch spaces and tabs, but contained only
3806 spaces. Tabulations in sources are a nuisance, so to simplify the
3807 matter, get rid of all the tabulations in the Java sources. The
3808 other skeletons will be treated equally later.
3809
3810 * data/java.m4, data/lalr1.java: Untabify.
3811 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
3812 tabulations are no longer generated.
3813
905f0697
PB
38142008-11-11 Paolo Bonzini <bonzini@gnu.org>
3815
3816 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3817 * configure.ac: Adjust usage.
3818 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3819 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3820 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3821
09ccae9b
DJ
38222008-11-10 Di-an Jan <dianj@freeshell.org>
3823
3824 Workaround Java's ``code too large'' problem for parser tables
3825 in most cases, by using one function per initialization.
3826 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
3827 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
3828 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
3829 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
3830 (yytname_): Use b4_typed_parser_table.
3831 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
3832 ``code too large'' error.
3833
1979121c
DJ
38342008-11-10 Di-an Jan <dianj@freeshell.org>
3835
3836 * NEWS: Document them.
de62edee 3837
1979121c
DJ
3838 General Java skeleton improvements.
3839 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
3840 using gcj < 4.3 in the testsuite, according to comments in
3841 gnulib/m4/javacomp.m4.
3842 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
3843 location_type, position_type): Remove extraneous brackets from
3844 b4_percent_define_default.
3845 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
3846 m4_define and m4_define_default.
3847 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
3848 which marks the end of user code with appropriate syncline, like all
3849 the other skeletons.
3850 (b4_user_post_prologue): Add. Don't silently drop.
3851 (yylex): Remove.
3852 (parse): Inline yylex.
3853 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
3854 (%{...%}): Fix typo of %code imports.
3855 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
3856
3857 Support annotations on parser class with %define annotations.
3858 * data/lalr1.java (annotations): Add to parser class modifier.
3859 * doc/bison.texinfo (Java Parser Interface): Document
3860 %define annotations.
3861 (Java Declarations Summary): Document %define annotations.
3862 * tests/java.at (Java parser class modifiers): Test annotations.
3863
3864 Do not generate code for %error-verbose unless requested.
3865 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
3866 Make private. Make conditional on %error-verbose.
3867 (getErrorVerbose, setErrorVerbose): New.
3868 (yytnamerr_): Make conditional on %error-verbose.
3869 (yysyntax_error): Make some code conditional on %error-verbose.
3870 * doc/bison.texinfo (Java Bison Interface): Remove the parts
3871 about %error-verbose having no effect.
3872 (getErrorVerbose, setErrorVerbose): Document.
3873
3874 Move constants for token names to Lexer interface.
3875 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
3876 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
3877 (parse): Qualify EOF to Lexer.EOF.
3878 * doc/bison.texinfo (Java Parser Interface): Move documentation of
3879 EOF and token names to Java Lexer Interface.
3880 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
3881
3882 Make yyerror public.
3883 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
3884 (yyerror): Change to public. Add Javadoc comments. Use longer
3885 parameter names. Make the body rather than the declarator
3886 conditional on %locations.
3887 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
3888
3889 Allow user to add code to the constructor with %code init.
3890 * data/java.m4 (b4_init_throws): New, for %define init_throws.
3891 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
3892 Add %code init to the front of the constructor body.
3893 * doc/bison.texinfo (YYParser.YYParser): Document %code init
3894 and %define init_throws.
3895 (Java Declarations Summary): Document %code init and
3896 %define init_throws.
3897 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
3898 (Java constructor init and init_throws): Add tests.
de62edee 3899
42f832d6
AD
39002008-11-10 Akim Demaille <demaille@gostai.com>
3901
3902 Update TODO.
3903 * TODO (-D): is implemented.
3904 (associativity): Same precedence must have the same associativity.
3905 For instance, how can a * b / c be parsed if * is %left and / is
3906 %right?
3907 (YYERRORCODE, YYFAIL, YYBACKUP): New.
3908
247efe34
AD
39092008-11-10 Akim Demaille <demaille@gostai.com>
3910
3911 Formatting changes.
3912
5d731440
AD
39132008-11-10 Akim Demaille <demaille@gostai.com>
3914
3915 More information about the symbols.
3916 * src/output.c (type_names_output): Document all the symbols,
3917 including those that don't have a type-name.
3918 (symbol_definitions_output): Define "is_token" and
3919 "has_type_name".
3920 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
3921 type-name, now that they are defined too in b4_type_names.
3922
21db118b
AD
39232008-11-10 Akim Demaille <demaille@gostai.com>
3924
3925 Regen.
3926
6ed15cde
AD
39272008-11-10 Akim Demaille <demaille@gostai.com>
3928
3929 Make parser::yytranslate static.
b06df3c2
AD
3930 Small speedup (1%) on the list grammar. And makes yytranslate_
3931 available in non member functions.
de62edee 3932
6ed15cde
AD
3933 * data/lalr1.cc (yytranslate_): Does not need to be a instance
3934 function.
3935
30bb2edc
AD
39362008-11-10 Akim Demaille <demaille@gostai.com>
3937
3938 Avoid trailing spaces.
3939 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
3940 * data/lalr1.cc: Don't indent before rule and symbol actions, as
3941 they can be empty, and anyway this incorrectly indents the first
3942 action.
3943
b3a28fd4
AD
39442008-11-10 Akim Demaille <demaille@gostai.com>
3945
3946 Comment changes.
3947
914202bd
AD
39482008-11-10 Akim Demaille <demaille@gostai.com>
3949
3950 Use "enum" for integral constants.
3951 This is just nicer to read, I observed no speedup.
de62edee 3952
914202bd
AD
3953 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
3954 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
3955 (yyuser_token_number_max_, yyundef_token_): Move into...
3956 (yytranslate_): here.
3957
c17f9a4a
AD
39582008-11-10 Akim Demaille <demaille@gostai.com>
3959
3960 Shortcuts in bench directives.
3961 * etc/bench.pl.in (parse_dirs): New.
3962 Use it.
3963 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
3964 Create the benches in "benches/".
3965
b9855ea5
AD
39662008-11-10 Akim Demaille <demaille@gostai.com>
3967
3968 Formatting changes.
3969 * data/lalr1.cc: here.
3970
6e097787
AD
39712008-11-10 Akim Demaille <demaille@gostai.com>
3972
3973 Adjust verbose message to using emacs.
3974 * etc/bench.pl.in: Inform compilation-mode when we change the
3975 directory.
3976 (generate_grammar_list): Recognize %define "variant" in addition
3977 to %define variant.
3978
4c3cc7da
AD
39792008-11-10 Akim Demaille <demaille@gostai.com>
3980
3981 Classify symbols by type-name.
3982 * src/uniqstr.h (UNIQSTR_CMP): New.
3983 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
3984 (type_names_output): New.
3985 (muscles_output): Use it.
3986 * data/lalr1.cc (b4_symbol_action_): Remove.
3987 (b4_symbol_case_, b4_type_action_): New.
3988 Adjust uses of b4_symbol_action_ to use b4_type_action_.
3989
d69c9694
AD
39902008-11-10 Akim Demaille <demaille@gostai.com>
3991
3992 Change the handling of the symbols in the skeletons.
3993 Before we were using tables which lines were the symbols and which
3994 columns were things like number, tag, type-name etc. It is was
3995 difficult to extend: each time a column was added, all the numbers had
3996 to be updated (you asked for colon $2, not for "tag"). Also, it was
3997 hard to filter these tables when only a subset of the symbols (say the
3998 tokens, or the nterms, or the tokens that have and external number
3999 *and* a type-name) was of interest.
de62edee 4000
d69c9694
AD
4001 Now instead of monolithic tables, we define one macro per cell. For
4002 instance "b4_symbol(0, tag)" is a macro name which contents is
4003 self-decriptive. The macro "b4_symbol" provides easier access to
4004 these cells.
de62edee 4005
d69c9694
AD
4006 * src/output.c (type_names_output): Remove.
4007 (symbol_numbers_output, symbol_definitions_output): New.
4008 (muscles_output): Call them.
4009 (prepare_symbols): Define b4_symbols_number.
4010
5263bea9
AD
40112008-11-10 Akim Demaille <demaille@gostai.com>
4012
4013 --trace=muscles
4014 * src/getargs.h, src/getargs.c (trace_muscle): New.
4015 (trace_types, trace_args): Support it.
4016 * src/output.c (output_skeleton): Use it.
4017
4175f6bb
AD
40182008-11-10 Akim Demaille <demaille@gostai.com>
4019
4020 muscles_output.
4021 * src/output.c (muscles_output): New, extracted from...
4022 (output_skeleton): here.
4023 Adjust.
4024
1de69d6a
AD
40252008-11-10 Akim Demaille <demaille@gostai.com>
4026
4027 Formatting changes.
4028
36db78a7
AD
40292008-11-10 Akim Demaille <demaille@gostai.com>
4030
4031 Update the variant example.
4032 * examples/variant.yy: Formatting changes.
4033 One stage build.
4034
e5eb92e7
AD
40352008-11-10 Akim Demaille <demaille@gostai.com>
4036
4037 Support constructor with an argument.
4038 This improves the "list" bench by 2%.
de62edee 4039
e5eb92e7
AD
4040 * data/lalr1.cc (variant::build): Add an overloaded version with
4041 an argument.
4042 * tests/c++.at (AT_CHECK_VARIANT): Check it.
4043
76307410
AD
40442008-11-10 Akim Demaille <demaille@gostai.com>
4045
4046 Test variants.
4047 * tests/c++.at (AT_CHECK_VARIANTS): New.
4048 Use it with and without %define assert.
4049
d78f0ac9
AD
40502008-11-10 Akim Demaille <demaille@gostai.com>
4051
4052 Add %precedence support.
4053 Unfortunately it is not possible to reuse the %prec directive. This
4054 is because to please POSIX, we do not require to end the rules with a
4055 semicolon. As a result,
de62edee 4056
d78f0ac9 4057 foo: bar %prec baz
de62edee 4058
d78f0ac9
AD
4059 is ambiguous: either a rule which precedence is that of baz, or a rule,
4060 and then a declaration of the precedence of the token baz.
de62edee 4061
d78f0ac9
AD
4062 * doc/bison.texinfo: Document %precedence.
4063 (Precedence Only): New.
4064 * src/assoc.h, src/assoc.c (precedence_assoc): New.
4065 * src/conflicts.c (resolve_sr_conflict): Support it.
4066 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
4067 Parse it.
4068 * tests/calc.at: Use %precedence for NEG.
4069 * tests/conflicts.at (%precedence does not suffice)
4070 (%precedence suffices): New tests.
4071
c85be41a
AD
40722008-11-09 Akim Demaille <demaille@gostai.com>
4073
4074 Make benches in a sub dirs.
4075 * etc/bench.pl.in ($dir): New.
4076 Use it.
4077 Check the use of constructors with an argument.
4078 (bench_variant_parser): Fix.
4079
db65ca1f
AD
40802008-11-09 Akim Demaille <demaille@gostai.com>
4081
4082 fix eof condition
4083
9b0efa5b
AD
40842008-11-09 Akim Demaille <demaille@gostai.com>
4085
4086 Fix --help.
4087
432ac57a
AD
40882008-11-09 Akim Demaille <demaille@gostai.com>
4089
4090 Require the generation of parse-gram.output.
4091 * src/Makefile.am (YACC): Pass --report=all.
4092
deef2a0a
AD
40932008-11-09 Akim Demaille <demaille@gostai.com>
4094
4095 Formatting changes.
4096
df72984a
AD
40972008-11-09 Akim Demaille <demaille@gostai.com>
4098
4099 Update TODO.
4100 * TODO: Remove obsolete items.
4101 Update others.
4102
f10e19fd
AD
41032008-11-09 Akim Demaille <demaille@gostai.com>
4104
4105 Enhance bench.pl.
4106 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
4107 (@token, $grammar, $bench): New.
4108 (generate_grammar_variant): Rename as...
4109 (generate_grammar_list): this.
4110 (generate_grammar): Adjust.
4111 (bench_grammar): Rename as...
4112 (bench): this.
4113 Use it in the various bench-marking routines.
4114 (-b, -g): New options.
4115
5de9c593
AD
41162008-11-09 Akim Demaille <demaille@gostai.com>
4117
4118 Use a static hierarchy for symbols in the C++ parser.
4119 * data/lalr1.cc (symbol_base_type, symbol_type)
4120 (stack_symbol_type): Make it a static hierarchy.
4121 Adjust dependencies.
4122
757f8f98
AD
41232008-11-09 Akim Demaille <demaille@gostai.com>
4124
4125 bench.pl -d, --directive.
4126 * etc/bench.pl.in (@directive): New.
4127 (&bench_grammar): Use it.
4128 (&bench_list_grammar): New, to provide access to the "variant"
4129 grammar.
4130 Use it.
4131 (getopts): Support -d, --directive.
4132
d3be4f6d
AD
41332008-11-09 Akim Demaille <demaille@gostai.com>
4134
4135 Use inline for small operations.
4136 * data/lalr1.cc (symbol_base_type, symbol_type)
4137 (stack_symbol_type): Declare constructor and other operations as
4138 inline.
4139 (yy_destroy_): Inline.
4140
1f7d007b
AD
41412008-11-09 Akim Demaille <demaille@gostai.com>
4142
4143 Introduce a hierarchy for symbols.
4144 * data/lalr1.cc (symbol_base_type, symbol_type): New.
4145 (data_type): Rename as...
4146 (stack_symbol_type): this.
4147 Derive from symbol_base_type.
4148 (yy_symbol_value_print_): Merge into...
4149 (yy_symbol_print_): this.
4150 Rename as...
4151 (yy_print_): this.
4152 (yydestruct_): Rename as...
4153 (yy_destroy_): this.
4154 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
4155 (parser::parse): yyla is now of symbol_type.
4156 Use its type member instead of yytoken.
4157
bc0b0477
AD
41582008-11-09 Akim Demaille <demaille@gostai.com>
4159
4160 Rename data_type and stack_symbol_type.
4161 * data/lalr1.cc (data_type): Rename as...
4162 (stack_symbol_type): this.
4163
57295d14
AD
41642008-11-09 Akim Demaille <demaille@gostai.com>
4165
4166 Handle semantic value and location together.
4167 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
4168 yydata.value and yydata.location.
4169 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
4170 (YY_SYMBOL_PRINT): Now take semantic value and location as a
4171 single arg.
4172 Adjust all callers.
4173 (yydestruct_): New overload for a stack symbol.
4174
e9b0834e
AD
41752008-11-09 Akim Demaille <demaille@gostai.com>
4176
4177 Push a complete symbol, not connected parts.
4178 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
4179 state, value and location.
4180 Adjust callers.
4181
6082531a
AD
41822008-11-09 Akim Demaille <demaille@gostai.com>
4183
4184 Agregate yylval and yylloc.
4185 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
4186 (parser::yyla): this.
4187
33c195cc
AD
41882008-11-09 Akim Demaille <demaille@gostai.com>
4189
4190 Rely on the state stack to display reduction traces.
b06df3c2
AD
4191 To display rhs symbols before a reduction, we used information
4192 about the rule reduced, which required the tables yyrhs and
4193 yyprhs. Now use rely only on the state stack to get the same
4194 information.
de62edee 4195
33c195cc
AD
4196 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
4197 Use them.
4198 (parser::yyrhs_, parser::yyprhs_): Remove.
4199 (parser::yy_reduce_print_): Use the state stack.
4200
e1f93869
AD
42012008-11-09 Akim Demaille <demaille@gostai.com>
4202
4203 Fuse yyval and yyloc into yylhs.
4204 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
4205 yylhs.
4206 (parse): Replace yyval and yyloc with yylhs.value and
4207 yylhs.location.
4208 After a user action, compute yylhs.state earlier.
4209 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
4210 fresh error_token.
4211
2935744b
DJ
42122008-11-09 Di-an Jan <dianj@freeshell.org>
4213
4214 Remove unused variable.
4215 * src/output.c (type_names_output): Remove unused variable sep.
4216
bbf9ca37
PB
42172008-11-09 Paolo Bonzini <bonzini@gnu.org>
4218
4219 Change tests/output.at quoting.
4220 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
4221 expanding arguments.
4222
d9a9b96b
JD
42232008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4224
4225 Don't add a semicolon to actions for %skeleton or %language.
4226 It breaks Java test cases as reported by Akim Demaille.
4227 * src/scan-code.l: Implement.
4228
51365192
JD
42292008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4230
4231 Clean up %skeleton and %language priority implementation.
4232 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
4233 remove static qualifier because others will soon need to see it.
4234 (language_prio): Likewise.
4235 (getargs): Use command_line_prio rather than 0.
4236 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
4237 enum fields.
4238 (skeleton_prio): Extern it.
4239 (language_prio): Extern it.
4240 * src/parse-gram.y: Use grammar_prio rather than 1.
4241
9380cfd0
AD
42422008-11-07 Akim Demaille <demaille@gostai.com>
4243
4244 Moving push traces into yypush_.
4245 * data/lalr1.cc (yypush_): Now takes a optional trace message.
4246 Adjust all uses.
4247
8901f32e
AD
42482008-11-07 Akim Demaille <demaille@gostai.com>
4249
4250 The single-stack C++ parser is now the standard one.
4251 * data/lalr1.cc: Rename as...
4252 * data/lalr1-split.cc: this.
4253 * data/lalr1-fusion.cc: Rename as...
4254 * data/lalr1.cc: this.
4255 * etc/bench.pl.in: Adjust.
4256
8cdabf02
AD
42572008-11-07 Akim Demaille <demaille@gostai.com>
4258
4259 Avoid empty-if warnings.
4260 Reported by Quentin Hocquet.
de62edee 4261
8cdabf02
AD
4262 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
4263 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
4264
5a893c2b
AD
42652008-11-07 Akim Demaille <demaille@gostai.com>
4266
4267 Pass command line location to skeleton_arg and language_argmatch.
4268 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
4269 The location argument is now mandatory.
4270 Adjust all dependencies.
4271 (getargs): Use command_line_location.
4272
58697c6d
AD
42732008-11-07 Akim Demaille <demaille@gostai.com>
4274
4275 -D, --define.
4276 * src/getargs.c (usage): Document -D.
4277 Fix help string for --locations.
4278 (command_line_location): New.
4279 (short_options, long_options, getargs): Support -D, --define.
4280 (getargs): Move -d support at the right place.
4281 * doc/bison.texinfo (Bison Options): Update.
4282 * tests/input.at (%define, --define): New.
4283
9fe5a457
AD
42842008-11-07 Akim Demaille <demaille@gostai.com>
4285
4286 Initialize the muscle table before parsing the command line.
4287 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
4288 (getargs): Define file_name.
4289 * src/main.c (main): Initialize muscle_tab before calling
4290 getargs.
4291 * src/muscle_tab.c (muscle_init): No longer define file_name, as
4292 its value is not available yet.
4293
56c5eca9
AD
42942008-11-07 Akim Demaille <demaille@gostai.com>
4295
4296 Locations without columns for command line arguments.
4297 * src/location.c (location_print): Don't display negative columns.
4298 * src/location.h: Document this.
4299
9b9e0a7d
AD
43002008-11-07 Akim Demaille <demaille@gostai.com>
4301
4302 Fix --help.
4303 * src/getargs.c (usage): Fix help string for -W.
4304
74eae918
AD
43052008-11-07 Akim Demaille <demaille@gostai.com>
4306
4307 Handle more general types of option arguments.
4308 * build-aux/cross-options.pl: The argument ends at the first
4309 space, not the first non-symbol character.
4310 Use @var for each word appearing the argument description.
4311
a3d4c6fb
AD
43122008-11-07 Akim Demaille <demaille@gostai.com>
4313
4314 Destroy the variants that remain on the stack in case of error.
4315 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
4316 destructor.
4317 Display the value only if yymsg is nonnull.
4318 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
4319
2d32fc9f
AD
43202008-11-07 Akim Demaille <demaille@gostai.com>
4321
4322 Add "%define assert" to variants.
4323 This is used to help the user catch cases where some value gets
4324 ovewritten by a new one. This should not happen, as this will
4325 probably leak.
de62edee 4326
2d32fc9f
AD
4327 Unfortunately this uncovered a bug in the C++ parser itself: the
4328 lookahead value was not destroyed between two calls to yylex. For
4329 instance if the previous lookahead was a std::string, and then an int,
4330 then the value of the std::string was correctly taken (i.e., the
4331 lookahead was now an empty string), but std::string structure itself
4332 was not reclaimed.
de62edee 4333
2d32fc9f
AD
4334 This is now done in variant::build(other&) (which is used to take the
4335 value of the lookahead): other is not only stolen from its value, it
4336 is also destroyed. This incurs a new performance penalty of a few
4337 percent, and union becomes faster again.
de62edee 4338
2d32fc9f
AD
4339 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
4340 (b4_variant_if): New.
4341 (variant::built): New.
4342 Use it whereever the status of the variant changes.
4343 * etc/bench.pl.in: Check the penalty of %define assert.
4344
f6038cb8
AD
43452008-11-07 Akim Demaille <demaille@gostai.com>
4346
4347 Use "%define variant" in bench.pl.
4348 * etc/bench.pl.in: No longer use the pseudo directive %variants,
4349 just use %define variants.
4350
ccde1f98
AD
43512008-11-07 Akim Demaille <demaille@gostai.com>
4352
4353 Regen.
4354 * src/parse-gram.h, src/parse-gram.c: Regen.
4355
58bd33b7
JD
43562008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
4357
4358 Fix user actions without a trailing semicolon.
4359 Reported by Sergei Steshenko at
4360 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
4361 * THANKS (Sergei Steshenko): Add.
4362 * src/scan-code.l (SC_RULE_ACTION): Fix it.
4363 * tests/regression.at (Fix user actions without a trailing semicolon):
4364 New test case.
4365
639867b5
AD
43662008-11-04 Akim Demaille <demaille@gostai.com>
4367
4368 Use b4_copyright_years.
4369 * data/yacc.c (b4_copyright_years): New.
4370 Fix its value according to the comments in the file.
4371 Use it and undefine it.
4372
3c262606
AD
43732008-11-04 Akim Demaille <demaille@gostai.com>
4374
4375 Formatting changes.
4376 * data/lalr1-fusion.cc, src/parse-gram.y: here.
4377
a2b93d52
AD
43782008-11-04 Akim Demaille <demaille@gostai.com>
4379
4380 Formatting changes.
4381 * data/lalr1-fusion.cc: here.
4382
3a2803df
AD
43832008-11-04 Akim Demaille <demaille@gostai.com>
4384
4385 Use strict on bench.pl.
4386 * etc/bench.pl.in (&run, &generate_grammar): New.
4387 Rename the grammar generating functions for consistency.
4388 Change the interface so that the list of benches to run is passed
4389 as (optionless) arguments.
4390 (&compile): Use &run.
4391
a0d4650a
AD
43922008-11-04 Akim Demaille <demaille@gostai.com>
4393
4394 Remove spurious initial empty lines.
4395 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
4396 * data/yacc.c: End the @output lines with an @.
4397
cac9e09b
AD
43982008-11-04 Akim Demaille <demaille@gostai.com>
4399
4400 Improve the display of sizes.
4401 * etc/bench.p.in: Higher precision.
4402 Sort by decreasing size.
4403
4af4348a
AD
44042008-11-04 Akim Demaille <demaille@gostai.com>
4405
4406 Don't memcpy C++ structures.
4407 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
4408 arguments.
4409 (variant::build): New overload for
4410 copy-construction-that-destroys.
4411 (variant::swap): New.
4412 (parser::yypush_): Use it in variant mode.
4413
ef05c4d6
AD
44142008-11-04 Akim Demaille <demaille@gostai.com>
4415
4416 Better defaults for bench.pl.
4417 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
4418 default values.
4419 Adjust &verbose uses.
4420 (-q, --quiet): New.
4421
9718cfa9
AD
44222008-11-04 Akim Demaille <demaille@gostai.com>
4423
4424 Make variant.yy more complex.
4425 std::list cannot be copied via memcpy, they are more demanding than
4426 std::string. Use one std::list to strengthen the test.
de62edee 4427
9718cfa9
AD
4428 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
4429 Adjust.
4430 Create a list of strings, instead of a single large string.
4431
a6df593d
AD
44322008-11-04 Akim Demaille <demaille@gostai.com>
4433
4434 bench.pl --bench.
4435 * etc/bench.pl.in (--bench, $bench): New.
4436
006a0303
AD
44372008-11-04 Akim Demaille <demaille@gostai.com>
4438
4439 Sort methods.
4440 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
4441 Define it after as().
4442
faef3466
AD
44432008-11-04 Akim Demaille <demaille@gostai.com>
4444
4445 Useless parens.
4446 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
4447
2141aded
AD
44482008-11-04 Akim Demaille <demaille@gostai.com>
4449
4450 Issue missing synclines after user actions.
4451 * data/c.m4 (b4_case): Issue synclines on the output file.
4452
e426d17b
AD
44532008-11-04 Akim Demaille <demaille@gostai.com>
4454
4455 Remove trailing empty line.
4456 * data/lalr1-fusion.cc: Don't add an empty line after the user's
4457 epilogue.
4458
a9ce3f54
AD
44592008-11-04 Akim Demaille <demaille@gostai.com>
4460
4461 Fix output of copyright years.
4462 * data/bison.m4 (b4_copyright): Fix the indentation of the
4463 copyright year paragraph.
4464 Use b4_copyright_years when no years are given.
4465 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
4466 (b4_copyright_years): New.
4467 Use it.
4468
59c544c2
AD
44692008-11-04 Akim Demaille <demaille@gostai.com>
4470
4471 Avoid the spurious initial empty line.
4472 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
4473 the end of @output request to suppress the empty line that
4474 results.
4475
96b15448
AD
44762008-11-04 Akim Demaille <demaille@gostai.com>
4477
4478 Remove parser::rhs_number_type.
4479 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
4480 (yyrhs_): Use b4_table_define.
4481
f0633174
AD
44822008-11-04 Akim Demaille <demaille@gostai.com>
4483
4484 Fix iteration type.
4485 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
4486
417b8004
AD
44872008-11-04 Akim Demaille <demaille@gostai.com>
4488
4489 Factor the declaration of the integer tables.
4490 * data/lalr1-fusion.cc (b4_table_define): New.
4491 Use it.
4492
1a5246c6
AD
44932008-11-03 Akim Demaille <demaille@gostai.com>
4494
4495 Fix indentation of tables in lalr1.cc
4496 * data/lalr1-fusion.cc: Fix the indentation.
4497
f8a95c9c
AD
44982008-11-03 Akim Demaille <demaille@gostai.com>
4499
4500 Destroy the lhs symbols after reduction.
4501 * data/lalr1-fusion.cc (parse): After the user action, when in
4502 variant mode, destroy the lhs symbols.
4503
d7f4d823
AD
45042008-11-03 Akim Demaille <demaille@gostai.com>
4505
4506 Simplify yysyntax_error_ use.
4507 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
4508 type, but make it unnamed in the declaration when it is not used.
4509
8b9c89fb
AD
45102008-11-03 Akim Demaille <demaille@gostai.com>
4511
4512 Let yy::variant::build return an lvalue.
4513 * data/lalr1-fusion.cc (variant::build): Return a reference to the
4514 object.
4515
83243c24
AD
45162008-11-03 Akim Demaille <demaille@gostai.com>
4517
4518 Define yy::variant only when needed.
4519 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
4520 used.
4521
429b4848
AD
45222008-11-03 Akim Demaille <demaille@gostai.com>
4523
4524 Bench the three-stack lalr1.cc.
4525 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
4526 one-stack one.
4527
414c76a4
AD
45282008-11-03 Akim Demaille <demaille@gostai.com>
4529
4530 Fail on parse error in calc++.
4531 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
4532 status.
4533 * examples/calc++/test ($me, $number, $exit, run): New.
4534 Use them to propagate errors to the exit status.
4535
8a5783fd
AD
45362008-11-03 Akim Demaille <demaille@gostai.com>
4537
4538 Don't specify the skeleton twice in the example.
4539 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
4540 file does what is needed.
4541
0cc5bead
AD
45422008-11-03 Akim Demaille <demaille@gostai.com>
4543
4544 bench: Improve output.
4545 * etc/bench.pl.in (bench_grammar): Tune the printf format.
4546
5b421a4e
AD
45472008-11-03 Akim Demaille <demaille@gostai.com>
4548
4549 bench: check impact of %debug on variants.
4550 * etc/bench.pl.in (variant_grammar): Fix the computation of
4551 $variant.
4552 Generate a grammar file that can work with or without %debug.
4553 Do use the @directive.
4554 (bench_variant_parser): Check impact of %debug.
4555 (@directives): Rename all the occurrences to...
4556 (@directive): this, for consistency.
4557
d11ee647
AD
45582008-11-03 Akim Demaille <demaille@gostai.com>
4559
4560 bench: report the size too.
4561 * etc/bench.pl.in ($iterations): Defaults to -3.
4562 (&bench_grammar): Require hireswallclock.
4563 Compute and display the size of the result.
4564 More comments.
4565
e1b74b92
AD
45662008-11-03 Akim Demaille <demaille@gostai.com>
4567
4568 bench: More use of the verbosity level.
4569 * etc/bench.pl.in ($verbose, &verbose): New.
4570 Use them.
4571 More POD documentation.
4572
7e5f9c54
AD
45732008-11-03 Akim Demaille <demaille@gostai.com>
4574
4575 bench.pl: a command line interface
4576 * etc/bench.pl.in: More doc.
4577 Some fixes in the documentation.
4578 ($cflags, $iterations, &help, &getopt): New.
4579 Use them.
4580 (&variant_grammar): Let the number of stages be 10 times what is
4581 specified.
4582
7109a18d
AD
45832008-11-03 Akim Demaille <demaille@gostai.com>
4584
4585 Bench the use of Boost.Variants.
4586 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
4587 New.
4588 (&compile): Be ready to compile C++ parsers.
4589 (&bench_push_parser): Move debug information to the outermost
4590 level.
4591 * THANKS: Add Michiel De Wilde.
4592
922730fe
AD
45932008-11-03 Akim Demaille <demaille@gostai.com>
4594
4595 bench.pl: Pass directives as a list instead of as a string.
4596 * etc/bench.pl.in (&directives): New.
4597 (&triangular_grammar, &calc_grammar): Use it to format the Bison
4598 directives.
4599 (&triangular_grammar): Do use the directives (were ignored).
4600 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
4601 directives.
4602
7484f1d4
AD
46032008-11-03 Akim Demaille <demaille@gostai.com>
4604
4605 Improve genericity of bench.pl.
4606 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
4607 argument.
4608 (&bench_push_parser): New.
4609 Call it.
4610
15129f25
AD
46112008-11-03 Akim Demaille <demaille@gostai.com>
4612
4613 Add documentation to bench.pl.
4614 * etc/bench.pl.in: Comment changes.
4615
0e0ed236
AD
46162008-11-03 Akim Demaille <demaille@gostai.com>
4617
4618 Fuse the three stacks into a single one.
de62edee 4619
b06df3c2
AD
4620 In order to make it easy to perform benchmarks to ensure that
4621 there are no performance loss, lalr1.cc is forked into
4622 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
4623 lalr1.cc.
4624
4625 Meanwhile, to make sure that lalr1-fusion.cc is correctly
4626 exercized by the test suite, the user must install a symbolic link
4627 from lalr1.cc to it.
de62edee 4628
b06df3c2
AD
4629 Instead of having three stacks (state, value, location), use a
4630 stack of triples. This considerably simplifies the code (and it
4631 will be easier not to require locations as currently does the C++
4632 parser), and also gives a 10% speedup according to
4633 etc/bench (probably mainly since memory allocation is done once
4634 instead of three times).
de62edee 4635
0e0ed236
AD
4636 Another motivation is to make it easier to destruct properly
4637 semantic values: now that they are bound to their state (hence
4638 symbol type) it will be easier to call the appropriate destructor.
de62edee 4639
0e0ed236 4640 These changes should probably benefit the C parser too.
de62edee 4641
b06df3c2
AD
4642 * data/lalr1.cc: Copy as...
4643 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
4644 (b4_rhs_value, b4_rhs_location): New definitions overriding those
4645 from c++.m4.
4646 (state_stack_type, semantic_stack_type, location_stack_type)
4647 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
4648 (data_type, stack_type, yystack_): New.
4649 (YYLLOC_DEFAULT, yypush_): Adjust.
4650 (yyerror_range): Now based on data_type, not location_type.
4651
7dedf26e
AD
46522008-11-03 Akim Demaille <demaille@gostai.com>
4653
4654 Push the state, value, and location at the same time.
4655 This is needed to prepare a forthcoming patch that fuses the three
4656 stacks into one.
de62edee 4657
7dedf26e
AD
4658 * data/lalr1.cc (parser::yypush_): New.
4659 (parser::yynewstate): Change the semantics: instead of arriving to
4660 this label when value and location have been pushed, but yystate
4661 is to be pushed on the state stack, now the three of them must
4662 have been pushed before. yystate still must be the new state.
4663 This allows to use yypush_ everywhere instead of individual
4664 handling of the stacks.
4665
c4585f1e
AD
46662008-11-03 Akim Demaille <demaille@gostai.com>
4667
4668 Prefer references to pointers.
4669 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
4670 definition to use references instead of pointers.
4671 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
4672 Take the value and location as references.
4673 Adjust callers.
4674
56017c17
AD
46752008-11-03 Akim Demaille <demaille@gostai.com>
4676
4677 stack::size instead of stack::height.
4678 * data/lalr1.cc (stack::height): Rename as...
4679 (stack::size): this.
4680 Fix the output type.
4681 Comment changes.
4682
5ab8c47b
AD
46832008-11-03 Akim Demaille <demaille@gostai.com>
4684
4685 Use variants to support objects as semantic values.
b06df3c2
AD
4686 This patch was inspired by work by Michiel De Wilde. But he used
4687 Boost variants which (i) requires Boost on the user side, (ii) is
4688 slow, and (iii) has useless overhead (the parser knows the type of
4689 the semantic value there is no reason to duplicate this
4690 information as Boost.Variants do).
4691
4692 This implementation reserves a buffer large enough to store the
4693 largest objects. yy::variant implements this buffer. It was
4694 implemented with Quentin Hocquet.
de62edee 4695
5ab8c47b
AD
4696 * src/output.c (type_names_output): New.
4697 (output_skeleton): Invoke it.
4698 * data/c++.m4 (b4_variant_if): New.
4699 (b4_symbol_value): If needed, provide a definition for variants.
4700 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
4701 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
4702 (b4_char_sizeof, yy::variant): New.
4703 (parser::parse): If variants are requested, define
4704 parser::union_type, parser::variant, change the definition of
4705 semantic_type, construct $$ before running the user action instead
4706 of performing a default $$ = $1.
4707 * examples/variant.yy: New.
4708 Based on an example by Michiel De Wilde.
4709
1fa5d8bb
AD
47102008-11-03 Akim Demaille <demaille@gostai.com>
4711
4712 Parameterize the extraction of semantic values.
4713 To make future changes easier, no longer rely on ".TYPE" being the
4714 way to get a semantic value.
de62edee 4715
1fa5d8bb
AD
4716 * data/c.m4 (b4_symbol_value): New.
4717 Use it.
4718 * data/c++.m4, data/yacc.c: Use it.
4719 * data/glr.c: Use b4_symbol_value.
4720 (b4_rhs_data): New.
4721 Use it.
4722
91ba8a55
AD
47232008-11-03 Akim Demaille <demaille@gostai.com>
4724
4725 Prepare easier M4 changes.
4726 * data/lalr1.cc: Use escaped [] instead of literals to prepare
4727 future changes.
4728
c9ba9e59
JD
47292008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4730
4731 Initiate further development.
4732 * NEWS: Create an empty section for new entries.
4733 * gnulib: Update submodule to HEAD.
4734
bfb40910
JD
47352008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4736
4737 * NEWS: Version 2.4.
4738
241fda7a
JD
47392008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4740
4741 Prepare for next release.
4742 * NEWS: Briefly mention changes since 2.3b.
4743 * README: Say GNU m4 1.4.6, which we've been requiring in release
4744 announcements already, not 1.4.3, which breaks the build.
4745
ed4d67dc
JD
47462008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4747
4748 Say %language is experimental.
4749 We're thinking of extending it's effect on output file naming. See the
4750 thread at
4751 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
4752 * NEWS: Say it's experimental.
4753 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
4754 recommend it over %skeleton for now.
4755 (Bison Options): Likewise.
4756 (C++ Bison Interface): Use %skeleton not %language.
4757 (Calc++ Parser): Use %skeleton not %language.
4758 * src/getargs.c (usage): Say it's experimental.
4759
e254a580
DJ
47602008-11-01 Di-an Jan <dianj@freeshell.org>
4761 Paolo Bonzini <bonzini@gnu.org>
4762
4763 Support all Java parser class modifiers.
4764 * data/java.m4 (b4_percent_define_get3): New.
4765 (b4_final_if, b4_strictfp_if): New.
4766 * data/lalr1.java (final, strictfp, extends, implements): Support.
4767 * doc/bison.texinfo (final, strictfp, extends, implements): Add
4768 documentation.
4769 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
4770 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
4771 (AT_CHECK_JAVA_GREP): New.
4772 (Java parser class modifiers): New test.
4773 (Java parser class extends and implements): New test.
4774
4775 Model exception propagation better with throws and lex_throws.
4776 * data/java.m4 (b4_list2): New.
4777 (throws): Change default.
4778 * data/lalr1.java (yyaction): Add throws.
4779 (parse): Add lex_throws in addition to throws.
4780 * doc/bison.texinfo (throws, lex_throws): Add documentation.
4781 * tests/java.at (Java throws specifications): New test.
4782
4783 Improve documentation for Java parsers.
4784 * doc/bison.texinfo (Java Parsers): Add subsections.
4785 Don't quote first argument of %define.
4786 (Java Bison Interface): Document output files. Move documentation
4787 of parser class and merge into Java Parser Interface. Document
4788 features that error out. Document directives with no effect.
4789 Move note about Javadoc higher.
4790 (Java Semantic Values): Explicitly mention stype.
4791 Document that generic types cannot be used.
4792 (Java Location Values): Use @deftypeivar. Document constructors.
4793 Correct return value for toString.
4794 (Java Parser Interface): List undocumented constants/fields.
4795 Move documentation of fields added by %parse-param closer to list
4796 of members. Document that token names are added as fields.
4797 Document constructors accurately. Remove error method.
4798 (Java Scanner Interface): Move note on %pure-parser to Java Bison
4799 Interface. Describe %code lexer and yylex accutately.
4800 Remove documentation that does not match the code.
4801 (Java Action Features): New.
4802 (Java Differences): Add reference. Add item on semantic values.
4803 Add note about @{ ... @}. Clarify %% epilogue placement.
4804 (Java Declarations Summary): New.
4805
4806 Fix Java skeleton.
4807 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
4808 (b4_remove_comma): Quote test argument.
4809 (b4_identification): Remove "bison" field.
4810 * tests/java.at (Java parser class and package names): New test.
4811 (Java %parse-param and %lex-param): New test.
4812 (Java stype, position_class and location_class): New test.
4813
f259e4e6
PB
48142008-10-31 Di-an Jan <dianj@freeshell.org>
4815
4816 * data/lalr1.jave: Update copyright years.
4817 (YYParser): Correct name of "generated from" file in Javadoc:
4818 use b4_file_name instead of @ofile@.
4819 (Location constructor): Correct Javadoc parameter name.
4820 (yylloc): Add missing opening m4 quote after b4_location_if.
4821 This removes a stray [ in the Javadoc of Lexer.getStartPos.
4822 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
4823 (YYParser constructor): Correct Javadoc parameter name.
4824
cae5057f
JD
48252008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
4826
4827 Always put auxiliary code files in the same dir as other output files.
4828 * src/files.c (compute_file_name_parts): When the user specifies
4829 --output but not --file-prefix, extract the directory prefix from the
4830 file prefix not from the grammar file name. This affects the location
4831 of files like location.hh generated by the C++ skeleton. The includes
4832 in the other output files require this fix.
4833 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
4834 for expected output files.
4835 (Output files): Add a test for the above.
4836
4af432ba
JD
48372008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
4838
4839 * gnulib: Update submodule to HEAD.
4840
e26d4e43
JD
48412008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4842
4843 Update copyright year.
4844 * src/files.c: Here.
4845
c0ee9e21
DJ
48462008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
4847
4848 Don't overwrite the input file.
4849 * src/files.c (output_file_name_check): Fatal error if using input file
4850 for output.
4851 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
4852 argument.
4853 (Conflicting output files): Add test.
4854
482dc52f
AD
48552008-10-28 Akim Demaille <demaille@gostai.com>
4856
4857 Space changes.
4858 * data/lalr1.cc: Formatting changes.
4859
52cbbe84
AD
48602008-10-28 Akim Demaille <demaille@gostai.com>
4861
4862 Don't define debugging functions when !YYDEBUG.
4863 * data/lalr1.cc (debug_stream, set_debug_stream)
4864 (debug_level_type, debug_level, set_debug_level): Don't
4865 declare them when YYDEBUG is not defined.
4866 The implementation are already YYDEBUG-aware.
4867
0925d5bf
AD
48682008-10-28 Akim Demaille <demaille@gostai.com>
4869
4870 Prefer "continue" for empty loop bodies.
4871 * etc/bench.pl.in: Use "continue" instead of {}.
4872
cf98343c
AD
48732008-10-28 Akim Demaille <demaille@gostai.com>
4874
4875 Space and comments changes.
4876 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
4877 * data/c.m4, data/lalr1.cc: Space changes.
4878
9f467b7d
AD
48792008-10-28 Akim Demaille <demaille@gostai.com>
4880
4881 Make gnulib a submodule.
4882 * gnulib: New.
4883 * .gitmodules (gnulib): New.
4884
0f0e1ace
JD
48852008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4886
4887 Fix yyerror_range for user-defined location type in C++. Reported by
4888 Georg Sauthoff at
4889 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
4890 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
4891 * THANKS (Georg Sauthoff): Add.
4892
548e2104
JD
48932008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4894
4895 Update several administrative files mainly to facilitate releasing.
4896 * HACKING (Administrivia): Make the git-merge-changelog notes more
4897 helpful.
4898 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
4899 (Release Procedure): Update for git and add numerous details that were
4900 previously missing.
4901 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
4902 * maint.mk (announcement): Don't list bison as a bootstrap tool so
4903 that announcements don't claim we bootstrapped with whatever bison
4904 happened to be in PATH. Add flex as a bootstrap tool.
4905 * Makefile.maint: Remove, previously replaced by maint.mk.
4906 * Makefile.cfg: Remove, and migrate settings to...
4907 * cfg.mk: ... here for the sake of `make announcement'.
4908 * bootstrap.conf (gnulib_modules): Add announce-gen.
4909 * README: Say GNU Bison instead of just Bison. Suggested by Karl
4910 Berry.
4911
ddf17a6e
PB
49122008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
4913
4914 Small but important bugfixes for the Java skeleton.
4915 * data/lalr1.java (yyerror): Change Location to b4_location_type.
4916 (yy_symbol_print): Call toString on yyvaluep.
4917
e1145ad8
AD
49182008-08-29 Akim Demaille <demaille@gostai.com>
4919
4920 Clarify UPDATED use.
215b40ac 4921 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 4922 not to the release date of Bison.
215b40ac 4923 Reported by Joel E. Denny.
e1145ad8 4924
0df72d78
AD
49252008-08-29 Akim Demaille <demaille@gostai.com>
4926
4927 * README: Update FAQ pointer.
4928 Reported by Joel E. Denny.
4929
9a90b6bb
EB
49302008-08-27 Eric Blake <ebb9@byu.net>
4931
4932 Resync m4sugar from autoconf.
4933 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
4934 (m4_init): Adjust to latest m4.git changes.
4935 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
4936 effects.
4937 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
4938 (_m4_list_cmp): Reduce side effects.
4939
65015668
AD
49402008-08-27 Akim Demaille <demaille@gostai.com>
4941
4942 Check yyerrok in calc.at.
215b40ac
EB
4943 * tests/calc.at (calc.y): Use yyerrok on "( error )".
4944 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
4945 expected.
65015668 4946
98e26a92
AD
49472008-08-27 Akim Demaille <demaille@gostai.com>
4948
4949 Support yyerrok in lalr1.cc.
4950 YYBACKUP is still to import back into lalr1.cc.
215b40ac 4951 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 4952
86c0e784
JD
49532008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4954
4955 For maintainer-check*, don't recompile for a $(VERSION) update.
4956 * cfg.mk: New file.
4957 (_is-dist-target): Override the one in GNUmakefile.
4958 * Makefile.am (EXTRA_DIST): Add cfg.mk.
4959
88511166
JD
49602008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4961
4962 Update for recent change to gnulib.
4963 * src/parse-gram.y: Don't include strverscmp.h. It comes from
4964 string.h now.
4965
6bbb2ed5
EB
49662008-08-15 Eric Blake <ebb9@byu.net>
4967
d67c52e8
EB
4968 Remaining m4sugar merge from autoconf.
4969 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
4970 * data/m4sugar/foreach.m4: New file, copied from autoconf.
4971 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
4972 * src/output.c (output_skeleton): Tell m4 how to find it.
4973
6bbb2ed5
EB
4974 Partial m4sugar merge from autoconf: m4_map.
4975 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
4976 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
4977 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
4978 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
4979 for empty list.
4980 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
4981 Likewise.
4982 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
4983 declares it.
4984
8dce3875
JD
49852008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
4986
4987 Keep .version and PACKAGE_VERSION in sync.
4988 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
4989 dependency, and add comments justifying this in more detail. Discussed
4990 starting at
4991 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
4992
882a1fbf
EB
49932008-08-06 Eric Blake <ebb9@byu.net>
4994
a3764451
EB
4995 Partial m4sugar merge from autoconf: m4_shiftn.
4996 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
4997 (m4_shift2, m4_shift3): New macros.
4998 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
4999 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
5000 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
5001 * data/java.m4 (b4_remove_comma): Likewise.
5002
882a1fbf
EB
5003 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
5004 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
5005 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
5006 (m4_init): Consolidate wrapped text into single m4_wrap.
5007 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
5008 in wrapped text.
5009
a30e920d
EB
50102008-08-05 Eric Blake <ebb9@byu.net>
5011
dfcc5959
EB
5012 Partial m4sugar merge from autoconf: builtins, version.m4.
5013 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
5014 (m4_prepend): Remove, as it is unused and inherently quadratic,
5015 whereas m4_append is linear in newer m4.
5016 (m4_mkstemp): New builtin.
5017 (m4_symbols): Make rename conditional.
5018 (m4_version_prereq): Ensure fatal error if used in bison, which
5019 intentionally lacks version.m4.
5020
a30e920d
EB
5021 Fix comments in m4sugar.
5022 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
5023
445b7470
JD
50242008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
5025
5026 Update for recent .gitignore fix in Gnulib.
5027 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
5028 anchored .gitignore entries.
5029
a1e50014
JD
50302008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
5031
5032 Set gnu or gnits strictness.
5033 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
5034 development and gnits strictness for releases. Based on Eric Blake's
5035 suggestion at
5036 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
5037
d43f77e7
PB
50382008-07-31 Paolo Bonzini <bonzini@gnu.org>
5039
5040 * NEWS: Clarify documentation of %language.
5041
fee2ed87
PB
50422008-07-31 Paolo Bonzini <bonzini@gnu.org>
5043
5044 Support usage of git-merge-changelog.
5045 * .gitattributes: New.
5046 * HACKING: Document usage of git-merge-changelog.
5047 * bootstrap: Install git-merge-changelog entries in .git/config
5048 if appropriate.
5049
78029cd5
JD
50502008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5051
5052 Remove remaining dependence on CVS Id keyword.
5053 * ChangeLog: For the sake of people still using CVS, don't use dollars
5054 when mentioning Id.
5055 * data/xslt/bison.xsl: Remove Id from header comments, where it was
5056 unusual anyway.
5057 * data/xslt/xml2dot.xsl: Likewise.
5058 * data/xslt/xml2text.xsl: Likewise.
5059 * data/xslt/xml2xhtml.xsl: Likewise.
5060 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
5061 * doc/Makefile.am (neutralize): Remove, no longer needed.
5062 (.x.1): Don't use neutralize.
5063 (edit): Don't substitute for ID.
5064 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
5065
c53d18b1
JD
50662008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5067
5068 Fix dependence on computed configure variables.
5069 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
5070 $(top_srcdir)/configure.ac so that changes to computed variables, such
5071 as PACKAGE_VERSION, are seen.
5072 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
5073
5523ac79
JD
50742008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
5075
5076 Update copyright dates for recent changes.
5077 * Makefile.am: Here.
5078 * src/Makefile.am: Here.
5079 * src/reduce.c: Here.
5080 * tests/reduce.at: Here.
5081
8fa36911
JD
50822008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
5083
5084 Use git-version-gen for version names between releases.
5085 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
5086 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
5087 * .prev-version: New.
5088 * .version.in: Remove.
78029cd5 5089 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
5090 revision.
5091 * GNUmakefile: Remove, now copied from Gnulib.
5092 * Makefile.am: Add code suggested by comments in
5093 build-aux/git-version-gen.
5094 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
5095 .prev-version, and .version.
5096 * NEWS (2.3b+): Rename to...
5097 (?.?): ... this because we're dropping the "+" version naming scheme,
5098 but, in general, we still can't be sure of our next release name.
5099 * bootstrap: Add a quick hack to remove from .gitignore the
5100 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
5101 entry. This should really be fixed in gnulib instead.
5102 * bootstrap.conf (gnulib_modules): Add gnumakefile.
5103 * configure.ac (AC_INIT): Set version name by invoking
5104 build-aux/git-version-gen.
5105 (AC_CONFIG_FILES): Remove .version, now generated by
5106 build-aux/git-version-gen.
5107 * maint.mk: New, copied from coreutils.
5108 * doc/.cvsignore (bison.1): Add.
5109 * doc/.gitignore (/bison.1): Add.
5110 * doc/bison.1: Remove, generated.
5111 * src/.cvsignore (revision.c): Remove.
5112 * src/.gitignore (/revision.c): Remove.
5113 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
5114 (BUILT_SOURCES): Remove revision.c.
5115 (revision.c): Remove.
5116 * src/getargs.c (version): Don't print revision after the VERSION.
5117 * src/revision.h: Remove.
5118
bcf07cb7
JD
51192008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5120
5121 Fix untranslatable composition of sentences. Reported by Goran
5122 Uddeborg at
5123 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
5124 * THANKS (Goran Uddeborg): Add.
5125 * src/reduce.c (reduce_print): Report the number of nonterminals and
5126 rules useless in the grammar in separate sentences.
5127 * tests/reduce.at (Useless Rules): Update output.
5128 (Reduced Automaton): Likewise.
5129 (Underivable Rules): Likewise.
5130 (Empty Language): Likewise.
5131
9aacab9a
JD
51322008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
5133
5134 Fix some .gitignore and .cvsignore problems.
5135 * bootstrap (insert_sorted_if_absent): Replace all uses with...
5136 (insert_vc_ignore): ... this new function, which prepends `/' to all
5137 .gitignore entries before passing them to insert_sorted_if_absent.
5138 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
5139 .cvsignore files are maintained even though Bison developers run
5140 bootstrap while using Git.
5141 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
5142 unneeded by Bison.
5143 (gnulib): Add.
5144 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
5145 unneeded. Reported by Eric Blake.
5146 * lib/.gitignore (/*~): Add.
5147 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
5148 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
5149 Blake.
5150 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
5151
a9fc7990
JD
51522008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
5153
5154 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
5155 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
5156 * bootstrap.conf (gnulib_modules): Add unsetenv.
5157 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
5158 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
5159 (/setenv.m4): Add.
5160 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
5161 the first argument because it may become position-dependent, and unset
5162 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
5163 Add comments explaining these issues in more detail.
5164
0f1d6f10
JD
51652008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
5166
5167 Add .gitignore everywhere based on .cvsignore.
5168 * .gitignore: New.
5169 * build-aux/.gitignore: New.
5170 * data/.gitignore: New.
5171 * doc/.gitignore: New.
5172 * etc/.gitignore: New.
5173 * examples/.gitignore: New.
5174 * examples/calc++/.gitignore: New.
5175 * lib/.gitignore: New.
5176 * m4/.gitignore: New.
5177 * po/.gitignore: New.
5178 * runtime-po/.gitignore: New.
5179 * src/.gitignore: New.
5180 * tests/.gitignore: New.
5181
7bd1665a
JD
51822008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5183
5184 * NEWS (2.3b+): New section, empty for now.
5185 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
5186
72c5b982
JD
51872008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5188
5189 * NEWS (2.3b): Update release date since there has been a delay in
5190 getting the announcements and tarballs out.
5191
bd02cd5d
JD
51922008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5193
5194 * NEWS: Version 2.3b.
5195 * configure.ac (AC_INIT): Likewise.
5196 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
5197
9126263e
JD
51982008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5199
5200 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
5201 been doing it for years.
5202 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
5203 (Release Procedure): Add FIXME about make alpha being unmaintained.
5204
fa6aa7b3
JD
52052008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
5206
5207 * data/yacc.c: Reformat m4 a little for readability.
5208 * src/lalr.c (build_relations): Correct comment.
5209
d30b312d
JMG
52102008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5211
5212 DJGPP specific issue.
5213 * djgpp/config.sed: Fixes required to run configure scripts generated
5214 by autoconf 2.62.
5215
138d4cd9
JD
52162008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5217
5218 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
5219 coordinator@translationproject.org.
5220
8f7e2e1f
JD
52212008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5222
5223 * THANKS: Add Eric Blake.
5224
f55efa38
JD
52252008-04-23 Eric Blake <ebb9@byu.net>
5226
5227 Revert prior patch, by working around autoconf regression.
5228 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
5229 ("Output file name: ("): Uncomment test.
5230 ("Output file name: )"): Likewise.
5231 Based on an idea from Noah Misch.
5232
096c9f9d
JD
52332008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5234
5235 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
5236 2.61. Reported by Juan Manuel Guerrero at
5237 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
5238 * tests/output.at ("Output file name: ("): Comment out test case for
5239 now.
5240 ("Output file name: )"): Likewise.
5241
0f664b89
JD
52422008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5243
5244 * GNUmakefile: Update git-version-gen invocation so make dist
5245 succeeds.
5246
1cfe6375
JD
52472008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5248
5249 Update to the current gnulib CVS repository, and fix trigraph handling
5250 in Bison.
5251 * bootstrap: Update gnulib CVS repository URL.
5252 (symlink_to_dir): Encapsulate the code that guarantees the destination
5253 directory exists into...
5254 (check_dst_dir): ... this new function, and...
5255 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
5256 fail when copying files into lib/uniwidth/.
5257 * src/output.c (prepare_symbols): When writing yytname muscles, where
5258 symbol names will be encoded in C-string literals, tell quotearg to
5259 escape trigraphs. This used to be the default in gnulib.
5260 * tests/regression.at (Token definitions): Because of the change in
5261 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
5262 escapes trigraphs in symbol names. Thus, yytname no longer has
5263 trigraphs unnecessarily doubly escaped. Update test case output.
5264 Extend test case to be sure Bison's own error messages will no longer
5265 have trigraphs in symbol names unnecessarily escaped once.
5266
74c52fc8
JD
52672008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
5268
5269 Fix make dist infinite loop reported by Juan Manuel Guerrero at
5270 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
5271 * .cvsignore: Add .version.
5272 * .version.in: New.
5273 * bootstrap.conf (gnulib_modules): Add git-version-gen.
5274 * configure.ac (AC_CONFIG_FILES): Add .version.
5275 * build-aux/.cvsignore: Add git-version-gen.
5276
8e55b3aa
JD
52772008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5278
5279 * NEWS (2.3a+): Mention that -g now takes an argument.
5280 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
5281 consistency. Update the -g and -x entries now that they take
5282 arguments. Use brackets to indicate optional arguments.
5283 * src/getargs.c (usage): Explain the relationship between arguments of
5284 long and short options more completely. Document --defines and -d
5285 separately since the former takes an argument but, for POSIX Yacc, the
5286 latter does not.
5287 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 5288 (getargs): Sort cases.
8e55b3aa 5289
59c5ac72
AD
52902008-02-28 Akim Demaille <demaille@gostai.com>
5291
5292 * doc/bison.texinfo: Fix a few typos.
5293
118d4978
AD
52942008-02-28 Akim Demaille <akim@epita.fr>
5295
5296 * doc/bison.texinfo (Bison Options): Document -W.
5297 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
5298
7020f1e9
AD
52992008-02-28 Akim Demaille <akim@epita.fr>
5300
5301 * src/getargs.c (short_options): Split and sort for readability.
5302 -g and -x take optional arguments, just like their long options.
5303 * build-aux/cross-options.pl: Use /x to make the regexp easier to
5304 understand.
5305 Fix the handling of $opt which resulted in all the argument to be
5306 considered as optional.
5307
59da312b
JD
53082008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
5309
5310 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
5311 say its interface is experimental.
5312 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5313 Java.
5314 (Bison Options): In the -L and --language entry, mention Java.
5315 (Java Bison Interface): Say the interface is experimental.
5316 * src/getargs.c (usage): Mention -L and --language.
5317
5318 * NEWS (2.3a+): Say the push parsing interface is experimental.
5319 * doc/bison.texinfo (Push Decl): Likewise.
5320 (Decl Summary): Likewise in the "%define api.push_pull" entry.
5321 (Push Parser Function): Likewise.
5322 (Pull Parser Function): Likewise.
5323 (Parser Create Function): Likewise.
5324 (Parser Delete Function): Likewise.
5325 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
5326 yypull_parse, and yypush_parse entries.
5327
5328 * NEWS (2.3a+): Mention XML support, and say the schema is
5329 experimental.
5330 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
5331 * src/getargs.c (usage): Say the XML schema is experimental.
5332
5333 * NEWS (2.3a+): Say option instead of flag.
5334
2bb3ebec
WP
53352008-02-21 Wojciech Polak <polak@gnu.org>
5336
5337 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
5338 text.
5339
333e670c
JD
53402008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
5341
5342 Fix impure push parser compile error reported by Bob Rossi at
5343 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
5344 * data/yacc.c: Clean up whitespace in the output a little.
5345 (yypstate_allocated): Define for impure push parsers regardless of
5346 whether the pull interface is also requested.
5347 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
5348 check impure push parsers without the pull interface.
5349
5350 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
5351 yyerror takes arguments specified by %parse-param while yypstate_new
5352 does not.
5353 * doc/bison.texinfo (Parser Create Function): Document that
5354 yypstate_new returns 0 for multiple impure parser instances.
5355 * tests/push.at (Push Parsing: Multiple impure instances): Update
5356 expected stderr output.
5357
798096e1
JD
53582008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5359
5360 * runtime-po/POTFILES.in (push.c): Remove.
5361
9ca7f077
JD
53622008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5363
5364 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
5365 * data/push.c: Rename to...
5366 * data/yacc.c: ... this, overwriting it.
5367 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
5368 `%push-pull-parser' -> `%define api.push_pull "both"'.
5369 Remove old yacc.c tests, and update push.c tests to yacc.c.
5370
42ee26bb
JD
53712008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5372
5373 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
5374 `"%code top" blocks' instead of `%code "top" blocks'.
5375 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
5376 Clean up whitespace in the output a little.
5377
b1cc23c4
JD
53782008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5379
5380 Fix documentation problems reported by Tim Josling at
5381 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
5382 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
5383 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
5384 integers. Explain the effect of literal string aliases on error
5385 messages. Copy token 0 documentation from the C++ skeleton
5386 documentation.
5387
ab7f29f8
JD
53882008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5389
5390 Accept a token number in a %left, %right, or %nonassoc for POSIX
5391 conformance. Reported by Tim Josling at
5392 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
5393 * NEWS (2.3a+): Mention.
5394 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
5395 and code numbers are treated by precedence declarations.
5396 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
5397 of symbols.1.
5398 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
5399 of symbol.
5400 (symbol.prec): New, just like symbol but allows INT.
5401 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
5402 longer holds.
5403 * tests/regression.at (Token number in precedence declaration): New
5404 test case.
5405
a924ef36
JMG
54062008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5407
5408 DJGPP specific issues.
5409 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
5410 be changed. Copyright timestamp adjusted.
5411 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
5412 be changed. Copyright timestamp adjusted.
5413 * djgpp/config.site: Copyright timestamp adjusted.
5414 * djgpp/config_h.sed: Copyright timestamp adjusted.
5415 * djgpp/djunpack.bat: Copyright timestamp adjusted.
5416 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
5417 filename translation list.
5418 * djgpp/subpipe.c (init_subpipe): Check the environment variables
5419 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
5420 files shall be created. Before trying to use the temp dir where the
5421 environment variable points to check that the dir really exists. If
5422 not default to the cwd as temp dir. Copyright timestamp adjusted.
5423 * djgpp/subpipe.h: Copyright timestamp adjusted.
5424 * djgpp/testsuite.sed: Copyright timestamp adjusted.
5425
389c8cfd
PE
54262008-01-30 Paul Eggert <eggert@cs.ucla.edu>
5427
5428 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
5429
5d1cfef4
PE
54302008-01-09 Paul Eggert <eggert@cs.ucla.edu>
5431
5432 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
5433 Problem reported by Claudio Saavedra in
5434 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
5435
e2dcf996
WP
54362008-01-05 Wojciech Polak <polak@gnu.org>
5437
5438 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
5439 document's title with the input grammar file name.
5440
da730230
JD
54412007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
5442
5443 Automate regression testing of the XML/XSLT implementation. Discussed
5444 starting at
5445 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
5446 * configure.ac (XSLTPROC): New substitution.
5447 * Makefile.am (maintainer-xml-check): New phony target invoking...
5448 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
5449 invoking make maintainer-check with BISON_TEST_XML=1.
5450 * tests/atlocal.in (XSLTPROC): New.
5451 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
5452 not to report reachable memory when Bison is expected to have a
5453 non-zero exit status and (2) to compare XML/XSLT output with --graph
5454 and --report=all output for every working grammar when
5455 BISON_TEST_XML=1.
5456 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
5457 (AT_BISON_CHECK_XML): New.
5458 (AT_QUELL_VALGRIND): New.
5459 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
5460 (AT_CHECK): ... don't redefine this since this was the old way to
5461 quell Valgrind.
5462 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
5463 AT_BISON_CHECK invocations.
5464 * tests/c++.at: Likewise.
5465 * tests/calc.at: Likewise.
5466 * tests/conflicts.at: Likewise.
5467 * tests/cxx-type.at: Likewise.
5468 * tests/existing.at: Likewise.
5469 * tests/glr-regression.at: Likewise.
5470 * tests/headers.at: Likewise.
5471 * tests/input.at: Likewise.
5472 * tests/java.at: Likewise.
5473 * tests/output.at: Likewise.
5474 * tests/push.at: Likewise.
5475 * tests/reduce.at: Likewise.
5476 * tests/regression.at: Likewise.
5477 * tests/sets.at: Likewise.
5478 * tests/skeletons.at: Likewise.
5479 * tests/synclines.at: Likewise.
5480 * tests/torture.at: Likewise.
5481 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
5482 tends to hang xsltproc.
5483 (Big horizontal): Likewise.
5484
408476bc
JD
54852007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5486
5487 In XML output, remove redundant class attribute on symbol element.
5488 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
5489 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
5490 look up a symbol to determine whether it's a nonterminal or terminal.
5491 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
5492 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
5493
5494 Add prec/assoc information to XML output.
5495 * src/gram.c (grammar_rules_print_xml): For each rule that has a
5496 %prec, add a percent_prec attribute.
5497 * src/print-xml.c (print_grammar): For each terminal that has a
5498 precedence or associativity, add a prec or assoc attribute.
5499 (xml_indent): New.
5500 (xml_puts): Use xml_indent.
5501 (xml_printf): Use xml_indent.
5502 * src/print-xml.h (xml_indent): Prototype.
5503
5504 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
5505 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5506
d4a26c48
JD
55072007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5508
5509 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
5510 (bison:ruleByNumber): ... this for clarity.
5511 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
5512 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
5513 (xsl:template match="reduction"): Update.
5514 (xsl:template match="item"): Update.
5515 (xsl:template match="reduction"): Update.
5516
5517 In the XML output, don't print the list of rules where symbols appear.
5518 Compute it in XSLT instead. Discussed at
5519 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
5520 * data/xslt/bison.xsl (bison:ruleByLhs): New.
5521 (bison:ruleByRhs): New.
5522 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
5523 bison:ruleByRhs.
5524 (xsl:template match="terminal/rule"): Remove.
5525 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5526 bison:ruleByRhs.
5527 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5528 Remove.
5529 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
5530 bison:ruleByRhs and mode="number-link" for rule template.
5531 (xsl:template match="terminal/rule"): Remove.
5532 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5533 bison:ruleByRhs and mode="number-link" for rule template.
5534 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5535 Rewrite as...
5536 (xsl:template match="rule" mode="number-link"): ... this.
5537 * src/print-xml.c (print_grammar): Don't print the list of rules.
5538
ef1b4273
JD
55392007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5540
5541 Don't let --report affect XML output; always print all information.
5542 Discussed at
5543 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
5544 * src/conflicts.c (log_resolution): Implement.
5545 * src/print-xml.c (print_core): Implement.
5546 (print_state): Implement.
5547 (print_xml): Implement.
5548
5549 * NEWS (2.3a+): Fix quotes.
5550 * src/parse-gram.y (prologue_declaration): For consistency with -v,
5551 don't let %verbose clear the list specified by --report.
5552
0f6cd9e3
AD
55532007-11-26 Akim Demaille <akim@epita.fr>
5554
5555 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
5556
d80fb37a
JD
55572007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
5558
5559 In the XML output, list useless and unused symbols and rules with the
5560 useful ones and add a "usefulness" attribute. Discussed starting at
5561 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
5562 * src/gram.c (grammar_rules_partial_print_xml): Remove.
5563 (grammar_rules_print_xml): Print all rules instead of just those
5564 useful in the grammar, and add a "usefulness" attribute.
5565 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
5566 * src/print-xml.c (print_rules_useless_in_parser): Remove.
5567 (print_grammar): Print all nonterminals instead of just useful ones,
5568 and add a "usefulness" attribute to nonterminals and terminals.
5569 (print_xml): Don't print a separate "reductions" or
5570 "rules-useless-in-parser" element.
5571 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
5572 (reduce_xml): Remove.
5573 (reduce_token_unused_in_grammar): New.
5574 (reduce_nonterminal_useless_in_grammar): New.
5575 * src/reduce.h (reduce_xml): Remove prototype.
5576 (reduce_token_unused_in_grammar): Add prototype.
5577 (reduce_nonterminal_useless_in_grammar): Add prototype.
5578 * data/xslt/xml2text.xsl: Update for XML changes.
5579 * data/xslt/xml2xhtml.xsl: Update for XML changes.
5580 * tests/reduce.at (Useless Terminals): Update output.
5581 (Useless Rules): Update output.
5582 (Reduced Automaton): Update output.
5583
5584 Say "Terminals unused in grammar" instead of "Unused terminals".
5585 * NEWS (2.3a+): Update.
5586 * doc/bison.texinfo (Understanding): Update example output.
5587 * src/reduce.c (reduce_output): Implement.
5588 * data/xslt/xml2text.xsl: Implement.
5589 * data/xslt/xml2xhtml.xsl: Implement.
5590
1bb2bd75
JD
55912007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
5592
5593 Accept --report-file=FILE to override the default `.output' filename.
5594 * NEWS (2.3a+): Mention.
5595 * doc/bison.texinfo (Bison Options): Add an entry.
5596 * src/files.c (compute_output_file_names): Don't override
5597 spec_verbose_file if already set.
5598 * src/getargs.c (usage): Document --report-file.
5599 (REPORT_FILE_OPTION): New anonymous enum member.
5600 (long_options): Add entry for it.
5601 (getargs): Add case for it setting spec_verbose_file.
5602
5603 * build-aux/cross-options.pl: Don't record a short option just because
5604 there's an arg.
5605 * doc/.cvsignore: Add yacc.1.
5606
a005a9c4
AD
56072007-11-14 Akim Demaille <akim@epita.fr>
5608
5609 * doc/yacc.1.in: New.
5610 * configure.ac, doc/Makefile.am: Adjust.
5611 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
5612 config.h symbol.
5613 Use AC_SUBST for assignments too.
5614 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
5615
cff03fb2
JD
56162007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5617
5618 * src/gram.c: Remove comments that duplicate comments in gram.h.
5619
5620 When reporting useless rules and nonterminals, say "useless in grammar"
5621 instead of "useless", and say "useless in parser" instead of "never
5622 reduced". Discussed starting at
5623 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
5624 * NEWS (2.3a+): Mention this change.
5625 * data/xslt/xml2text.xsl: Update output text and expected input XML
5626 element names to match changes below.
5627 * data/xslt/xml2xhtml.xsl: Likewise.
5628 (xsl:template match="bison-xml-report"): Add missing entry in Table of
5629 Contents: "Rules useless in parser due to conflicts".
5630 * doc/bison.texinfo (Decl Summary): Reword a little.
5631 (Understanding): Update example output for changes below.
5632 * src/gram.c: (rule_useful_p): Rename to...
5633 (rule_useful_in_grammar_p): ... this.
5634 (rule_useless_p): Rename to...
5635 (rule_useless_in_grammar_p): ... this.
5636 (rule_never_reduced_p): Rename to...
5637 (rule_useless_in_parser_p): ... this.
5638 (grammar_rules_print): Update for renames.
5639 (grammar_rules_print_xml): Update for renames.
5640 (grammar_rules_never_reduced_report): Rename to...
5641 (grammar_rules_useless_report): ... this since it is used for either
5642 kind of useless rule.
5643 * src/gram.h: Reword comments and update function names in prototypes.
5644 * src/main.c (main): Say "rule useless in parser due to conflicts".
5645 * src/print-xml.c (print_rules_never_reduced): Rename to...
5646 (print_rules_useless_in_parser): ... this, and rename output XML
5647 element "rules-never-reduced" to "rules-useless-in-parser".
5648 (print_xml): Update for rename.
5649 * src/print.c (print_results): Say "Rules useless in parser due to
5650 conflicts".
5651 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
5652 (nonterminals_reduce): Say "nonterminal useless in grammar".
5653 (reduce_output): Say "Nonterminals useless in grammar".
5654 Say "Rules useless in grammar".
5655 (reduce_xml): Rename output XML element "useless" to
5656 "useless-in-grammar".
5657 (reduce_print): Don't report the count of grammatically useless rules
5658 as "rules never reduced" just because %yacc is specified.
5659 In the correct report of this count, say nonterminal(s) and rule(s)
5660 "useless in grammar".
5661 * tests/conflicts.at (S/R in initial): Update expected output.
5662 (Defaulted Conflicted Reduction): Likewise.
5663 (Unreachable States After Conflict Resolution): Likewise.
5664 * tests/existing.at (GNU pic Grammar): Likewise.
5665 * tests/reduce.at (Useless Nonterminals): Likewise.
5666 (Useless Rules): Likewise.
5667 (Reduced Automaton): Likewise.
5668 (Underivable Rules): Likewise.
5669 (Empty Language): Likewise.
5670
66f0441d
JD
56712007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5672
5673 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
5674 here document and before the EOF so that BSD's implementation of Bourne
5675 shell doesn't parse the delimiter as part of the here document.
5676 * doc/.cvsignore: Add cross-options.texi.
5677 * src/getargs.c (usage): Add a blank line after the warning categories.
5678
d0ee4105
PB
56792007-11-08 Paolo Bonzini <bonzini@gnu.org>
5680
5681 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
5682
e8b1fb9b
AD
56832007-11-05 Akim Demaille <akim@epita.fr>
5684
5685 Remove Id: from bison.1.
5686 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
5687 (perl -0777 -pi -e 's/\.PP\nId): New.
5688 (.x.1): Use it to ignore the version control revision.
5689
2f7a96b5
AD
56902007-11-05 Akim Demaille <demaille@gostai.com>
5691
5692 * build-aux/Makefile.am: Ship cross-options.pl.
5693 * doc/Makefile.am: Always refer to cross-options.texi with
5694 $(srcdir).
5695 (MAINTAINERCLEANFILES): Add it.
5696
f4101aa6
AD
56972007-11-04 Akim Demaille <demaille@gostai.com>
5698
5699 Generate the long/short option cross-table.
5700 * build-aux/cross-options.pl: New.
5701 * doc/Makefile.am (cross-options.texi): New.
5702 * doc/bison.texinfo: Use it.
5703
727a1401
AD
57042007-11-04 Akim Demaille <demaille@gostai.com>
5705
5706 Generate bison.1 using help2man.
5707 * doc/common.x, doc/bison.x: New.
5708 * doc/Makefile.am (bison.1, .x.1): New.
5709 The code is taken from autoconf-2.61/man/Makefile.am.
5710 * configure.ac: Look for help2man.
5711
6aeb9c57
AD
57122007-11-04 Akim Demaille <demaille@gostai.com>
5713
5714 Complete --help.
5715 * src/getargs.c (usage): Document -W, make it clear that -d,
5716 -g and -x have optional arguments.
5717
d7be4085
AD
57182007-11-04 Akim Demaille <demaille@gostai.com>
5719
5720 Find sha1sum when named gsha1sum.
5721 * bootstrap (find_tool): New.
5722 ($SHA1SUM): New.
5723
d9df47b6
JD
57242007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5725
5726 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
5727 at
5728 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
5729 * NEWS (2.3a+): Mention.
5730 * data/bison.m4 (b4_pure_if): Don't define it here.
5731 * data/c.m4 (b4_identification): Depend on individual skeletons to
5732 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
5733 values of the %define variables api.pure or api.push_pull. Define
5734 YYPURE, YYPUSH, and YYPULL accordingly.
5735 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
5736 glr.cc has already defined b4_pure_flag.
5737 * data/push.c: Define b4_pure_if based on `%define api.pure'.
5738 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 5739 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
5740 * doc/bison.texinfo (Pure Decl): Update.
5741 (Push Decl): Update.
5742 (Decl Summary): Add api.pure to %define entry.
5743 In %pure-parser entry, say it's deprecated and reference %define.
5744 (Pure Calling): Update.
5745 (Error Reporting): Update.
5746 (C++ Scanner Interface): Update.
5747 (How Can I Reset the Parser): Update.
5748 (Table of Symbols): In %pure-parser entry, say it's deprecated and
5749 reference %define.
5750 * src/getargs.c (pure_parser): Remove global variable.
5751 * src/getargs.h (pure_parser): Remove extern.
5752 * src/output.c (prepare): Don't define pure_flag muscle.
5753 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
5754 wrapper around `%define api.pure'.
5755 * tests/calc.at (Simple LALR Calculator): Update.
5756 (Simple GLR Calculator): Update.
5757 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
5758 Update.
5759 (GLR: Resolve ambiguity, pure, locations): Update.
5760 (GLR: Merge conflicting parses, pure, no locations): Update.
5761 (GLR: Merge conflicting parses, pure, locations): Update.
5762 * tests/glr-regression.at (Uninitialized location when reporting
5763 ambiguity): Update
5764 * tests/input.at (Unused %define api.pure): New test case.
5765 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
5766 AT_PURE_IF and AT_PURE_AND_LOC_IF.
5767 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5768
c373bf8b
JD
57692007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5770
5771 %define push_pull -> %define api.push_pull. Discussed starting at
5772 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
5773 * data/push.c: Expect the new name.
5774 * data/yacc.c: Likewise.
5775 * doc/bison.texinfo (Push Decl): Update.
5776 (Decl Summary): Update %define entry.
5777 (Push Parser Function): Update.
5778 (Pull Parser Function): Update.
5779 (Parser Create Function): Update.
5780 (Parser Delete Function): Update.
5781 * tests/calc.at (Simple LALR Calculator): Update.
5782 * tests/input.at (%define enum variables): Update.
5783 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5784 (Push Parsing: Multiple impure instances): Update.
5785 (Push Parsing: Unsupported Skeletons): Update.
5786 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
5787 (Exploding the Stack Size with Malloc): Update.
5788
5789 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
5790 other entries some.
5791
32f19b6b
JD
57922007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
5793
5794 For the XML output's terminal element, rename @number to @token-number,
5795 and add @symbol-number. In the nonterminal element, rename @number to
5796 @symbol-number. Discussed starting at
5797 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
5798 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
5799 renames.
5800 (xsl:template match="nonterminal"): Likewise.
5801 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
5802 (xsl:template match="nonterminal"): Likewise.
5803 * src/print-xml.c (print_grammar): Implement.
5804
255a6b90
JD
58052007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5806
5807 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
5808 2007-10-11 change, the child elements here are items not rules.
408476bc 5809 (xsl:template match="item"): New.
255a6b90
JD
5810 (xsl:template match="rule"): Update for new reduced itemset.
5811 (xsl:template match="point"): Remove.
5812 (xsl:template match="empty"): For consistency with --graph, don't
5813 output "/* empty */".
5814 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
5815 line-wrap, don't pass a negative value as first-line-length since this
5816 won't work with the following changes.
5817 (xsl:template name="line-wrap"): Simplify slightly.
5818 (xsl:template name="ws-search"): Eliminate recursion.
5819 * src/print_graph.c (print_core): Don't print a reduction's lookahead
5820 set next to an item whose dot is not at the end of the RHS even if it
5821 happens to be associated with the same rule.
5822
88c78747
JD
58232007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5824
31984206
JD
5825 Add %define lr.keep_unreachable_states.
5826 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
5827 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
5828 * src/main.c (main): Implement it.
5829 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5830 Extend to test it, and fix a typo.
5831
58322007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5833
5834 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
5835 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
5836 the example .output text.
5837 * tests/regression.at (Extra lookahead sets in report): Improve wording
5838 of comments.
5839
b7a70162
WP
58402007-10-17 Wojciech Polak <polak@gnu.org>
5841
5842 * src/print-xml.c (print_grammar): Renamed
5843 <terminal> and <nonterminal> attributes:
5844 "type" to "number" and "symbol" to "name".
5845 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
5846 Use new attribute names.
5847 (xsl:template match="nonterminal"): Likewise.
5848 * data/xslt/xml2xhtml.xsl: Likewise.
5849
a0de5091
JD
58502007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
5851
5852 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
5853 (Option Cross Key): Likewise.
5854
5855 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
5856 next to an item whose dot is not at the end of the RHS even if it
5857 happens to be associated with the same rule.
5858 * src/print.c (print_core): Likewise.
5859 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
5860 (Resolved SR Conflicts): Update output.
5861 * tests/regression.at (Extra lookahead sets in report): New test case.
5862
4c20d18d
WP
58632007-10-11 Wojciech Polak <polak@gnu.org>
5864
5865 * src/print-xml.c (print_core): Remove item set
5866 redundancy.
5867 * data/xslt/bison.xsl (bison:ruleNumber): New key.
5868 Improve processing time. Suggested by Joel E. Denny.
5869 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
5870 Write xsl:param "required" attribute as comment.
5871 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
5872 (xsl:template match="rule"): Support new reduced itemset.
5873 (xsl:template match="point"): Remove.
5874 * data/xslt/xml2xhtml.xsl: Likewise.
5875
f506ad1c
JD
58762007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5877
5878 * src/getargs.c (version): Update copyright year.
5879
21f1b063
JD
58802007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5881
5882 Make xml2dot.xsl and --graph produce the same output.
5883 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
5884 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
5885 escaped later.
5886 (xsl:template name="output-node"): Use the new escape template instead
5887 of the string-replace template directly.
5888 (xsl:template name="output-edge"): Likewise.
5889 (xsl:template name="escape"): New, escapes backslashes and newlines in
5890 addition to quotation marks.
5891 * src/graphviz.c (start_graph, output_node, output_edge): Add
5892 whitespace to output for legibility.
5893
5894 Make xml2text.xsl and --report produce the same output, and remove the
5895 XML "conflicts" element since a conflict summary is easily extracted
5896 from the automaton.
5897 * data/xslt/bison.xsl: New.
5898 (xsl:template match="state" mode="bison:count-conflicts): New.
5899 * data/xslt/xml2text.xsl: Import bison.xsl.
5900 (xsl:template match="bison-xml-report"): Instead of styling the
5901 "conflicts" element, style the "automaton" element with mode
5902 "conflicts". Unlike the former, the latter lists S/R and R/R
5903 conflicts for a state on the same line.
5904 (xsl:template match="conflicts"): Remove.
5905 (xsl:template match="conflict"): Remove.
5906 (xsl:template match="terminal"): Line-wrap the list of rules in which
5907 the terminal is used.
5908 (xsl:template match="nonterminal"): Likewise for nonterminals.
5909 (xsl:template match="automaton" mode="conflicts"): New.
5910 (xsl:template match="state" mode="conflicts"): New.
5911 (xsl:template name="line-wrap"): New.
5912 (xsl:template name="ws-search"): New.
5913 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
5914 (xsl:template match="bison-xml-report"): Instead of styling the
5915 "conflicts" element, style the "automaton" element with mode
5916 "conflicts."
5917 (xsl:template match="conflicts"): Remove.
5918 (xsl:template match="conflict"): Remove.
5919 (xsl:template match="automaton" mode="conflicts"): New.
5920 (xsl:template match="state" mode="conflicts): New.
5921 * src/conflicts.c (conflicts_output_xml): Remove.
5922 * src/conflicts.h (conflicts_output_xml): Remove prototype.
5923 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
5924 * src/print.c (print_grammar): Consistently wrap at the 66th column so
5925 the corresponding XSLT is easier. Also, never wrap between a word and
5926 the comma that follows it.
5927
793fbca5
JD
59282007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5929
5930 Improve C++ namespace support. Discussed starting at
5931 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
5932 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
5933 b4_namespace_close): New macros that interpret the %define variable
5934 "namespace" so its value can contain "::" to indicate nested
5935 namespaces.
5936 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
5937 the above macros.
5938 * data/lalr1.cc (b4_namespace): Likewise.
5939 * data/location.cc (b4_namespace): Likewise.
5940 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
5941 inside a new table in the general %define entry. Document `%define
5942 namespace' there as well. Point the %name-prefix entry to it since it
5943 explains it more completely in the case of C++.
5944 (C++ Bison Interface): Mention `%define namespace' instead of
5945 %name-prefix.
5946 (Table of Symbols): Remove the `%define push_pull' entry. The %define
5947 entry suffices.
5948 * tests/c++.at (Relative namespace references): New test case.
5949 (Absolute namespace references): New test case.
5950 (Syntactically invalid namespace references): New test case.
5951 * tests/input.at (C++ namespace reference errors): New test case.
5952
35b8730d
JD
59532007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5954
5955 Add syncline support and location accessor to internal %define
5956 interfaces.
5957 * data/bison.m4 (b4_percent_define_get_loc): New.
5958 (b4_percent_define_get_syncline): New.
5959 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
5960 (b4_percent_define_default): Record defining location as line 1 rather
5961 than 0 for the sake of synchronizing #line's, and define
5962 b4_percent_define_syncline(VARIABLE).
5963 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
5964 * src/muscle_tab.c (muscle_syncline_grow): New.
5965 (muscle_code_grow): Use muscle_syncline_grow.
5966 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
5967 define b4_percent_define_syncline(VARIABLE).
5968 (muscle_percent_define_get_loc): New.
5969 (muscle_percent_define_get_syncline): New.
5970 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
5971 remove some unused variables.
5972 (muscle_percent_define_default): Record defining location as line 1
5973 rather than 0 for the sake of synchronizing #line's, and define
5974 b4_percent_define_syncline(VARIABLE).
5975 (muscle_percent_define_check_values): Use
5976 muscle_percent_define_get_loc.
5977 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
5978 (muscle_percent_define_get_syncline): Prototype.
5979 * tests/skeletons.at (%define Boolean variables: invalid skeleton
5980 defaults): Update output for location change.
5981 (Complaining during macro argument expansion): Extend to test
5982 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
5983
7dc4a694
JD
59842007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
5985
5986 Fix some error-reporting macro bugs.
5987 * data/bison.m4 (b4_cat): New.
5988 (b4_error, b4_error_at): Use b4_cat to send error directives directly
5989 to stdout so they don't become arguments to other macros. Update
5990 comments and add examples.
5991 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
5992 add examples.
5993 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
5994 after printing the error directive so that M4 doesn't report subsequent
5995 problems that are induced by this problem.
5996 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
5997 instead of just in them. Recognize @\n in both places. Both expand to
5998 the empty string. Needed by b4_cat.
5999 * tests/skeletons.at (Complaining during macro argument expansion):
6000 New test case.
6001 (Fatal errors make M4 exit immediately): New test case.
6002
d4bd2295
JD
60032007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
6004
6005 Implement --print-datadir.
6006 * src/getargs.c (usage): Mention.
6007 (PRINT_DATADIR_OPTION): New anonymous enum member.
6008 (long_options): Add entry for it.
6009 (getargs): Add case for it calling compute_pkgdatadir.
6010 * src/output.c (output_skeleton): Encapsulate data directory
6011 computation from here...
6012 (prepare): ... and from here...
6013 (compute_pkgdatadir): ... into this new function.
6014 * src/output.h (compute_pkgdatadir): Prototype.
6015
34cdeddf
JD
60162007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
6017
6018 * src/print-xml.c (escape_bufs): New static global variable
6019 replacing...
6020 (xml_escape_n): ... the static local variable buf here.
6021 (print_xml): Free memory for escape_bufs.
6022 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
6023
d782395d
JD
60242007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
6025
6026 Replace `%push-parser' and `%push-pull-parser' with
6027 `%define push_pull "push"' and `%define push_pull "both"'.
6028 `%define push_pull "pull"' is the default.
6029 * doc/bison.texinfo (Push Decl, Push Parser Function,
6030 Pull Parser Function, Parser Create Function, Parser Delete Function):
6031 Update declarations.
6032 (Decl Summary, Table of Symbols): Replace %push-parser and
6033 %push-pull-parser entries with a %define push_pull entry.
6034 * data/bison.m4 (b4_percent_define_check_values): New macro.
6035 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
6036 definitions...
6037 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
6038 definitions...
6039 * data/push.c: ... to here and compute them from the value of the
6040 %define variable push_pull.
6041 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
6042 parsing requests here...
6043 * data/yacc.c: ... hack this to switch to push.c any time
6044 b4_use_push_pull_flag or the %define variable push_pull is set. This
6045 will go away when we mv push.c yacc.c.
6046 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
6047 push parsing is not supported since unused %define variables are
6048 reported anyway.
6049 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
6050 * src/muscle_tab.h (muscle_percent_define_check_values): Update
6051 comments for consistency with b4_percent_define_check_values.
6052 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
6053 muscles.
6054 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
6055 Remove.
6056 (prologue_declaration): Remove %push-parser and %push-pull-parser
6057 rules.
6058 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
6059 * tests/calc.at: Update declarations.
6060 * tests/input.at (%define enum variables): New test case.
6061 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
6062 declaration.
6063 (Push Parsing: Multiple impure instances): Update declaration.
6064 (Push Parsing: Unsupported Skeletons): New test case.
6065 * tests/torture.at (Exploding the Stack Size with Alloca): Update
6066 declaration.
6067 (Exploding the Stack Size with Malloc): Update declaration.
6068
3f999f78
WP
60692007-09-24 Wojciech Polak <polak@gnu.org>
6070
6071 Add XSLT transformations.
6072
6073 * data/xslt/xml2dot.xsl: Transform XML into DOT.
6074 * data/xslt/xml2text.xsl: Transform XML into plain text.
6075 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
6076 * data/Makefile.am (xsltdir): New variable.
6077 (dist_xslt_DATA): Add xslt/*.xsl files.
6078
a4f75309
PE
60792007-09-23 Paul Eggert <eggert@cs.ucla.edu>
6080
6081 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
6082 Problem reported by Wojciech Polak.
6083 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
6084 (xml_printf): Undo change I made on 21 September; that is,
6085 indent 2 spaces, not 1.
6086
ad5feac4
JD
60872007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
6088
6089 Pacify ./configure --enable-gcc-warnings.
6090 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
6091 `char const *' instead of `char *'.
6092 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
6093 local variable `sep'.
6094
41d7a5f2
PE
60952007-09-21 Paul Eggert <eggert@cs.ucla.edu>
6096
6097 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
6098 elsewhere.
6099 * src/print-xml.c: Prefer "const" after types; that's more consistent.
6100 (xml_printf): Indent just 1 space for level.
6101 (e_char, xlate_char): Remove.
6102 (xml_escape_string): Rewrite to avoid undefined behavior (used
6103 storage that was freed from the stack).
6104 (xml_escape_n): Don't bother checking for subscript error.
6105
3f999f78
WP
61062007-09-21 Wojciech Polak <polak@gnu.org>
6107
6108 Add Bison XML Automaton Report.
41d7a5f2
PE
6109
6110 Add support for an -x option to generate an XML report.
6111 It is not documented yet.
6112 * src/print-xml.c: New file.
6113 * src/print-xml.h: Likewise.
6114 * lib/timevar.def (TV_XML): New var.
6115 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
6116 * src/conflicts.c: Include print-xml.h.
6117 (solved_conflicts_xml_obstack): New var.
6118 (log_resolution, conflicts_solve, conflicts_free):
6119 Add support for XML report.
6120 (conflicts_output_val): New function.
6121 * src/conflicts.h (conflicts_output_val): New decl.
6122 * src/files.c (spec_xml_file): New var.
6123 (compute_output_file_names, output_file_names_free): Add XML support.
6124 * src/files.h (spec_xml_file): New decl.
6125 * src/getargs.c (xml_flag): New var.
6126 (usage, short_options, long_options, getargs): Add XML support.
6127 * src/getargs.h (xml_flag): New decl.
6128 * src/gram.c: Include print-xml.h.
6129 (rule_lhs_print_xml, rule_rhs_print_xml):
6130 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
6131 New functions.
6132 * src/gram.h: Declare external ones.
6133 * src/main.c: Include print-xml.h.
6134 (main): Add XML support.
6135 * src/reduce.c: Include print-xml.h.
6136 (reduce_xml): New function.
6137 * src/reduce.h: Declare it.
6138 * src/state.c: Include print-xml.h.
6139 (state_new): Add XML support.
6140 (state_rule_lookahead_tokens_print_xml): New function.
6141 * src/state.h: Declare it.
6142 (struct state): New member solved_conflicts_xml.
6143 * src/symtab.c (symbol_class_get_string): New function.
6144 * src/symtab.h: Declare it.
6145
6d8e724d
PE
61462007-09-21 Paul Eggert <eggert@cs.ucla.edu>
6147
6148 * GNUmakefile: Switch to coreutils's version.
6149 * bootstrap: Likewise.
6150 * Makefile.cfg: Adjust to new GNUmakefile.
6151 * README-hacking: Likewise.
6152
6153 Import from gnulib:
6154
6155 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
6156 Bruno Haible <bruno@clisp.org>
6157
6158 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
6159 and is a script that invokes bison. Tighten the code. Add comments.
6160
922bdd7f
JD
61612007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
6162
6163 Spell "boolean" as "Boolean". Reported by Akim Demaille.
6164 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
6165 * doc/bison.texinfo (Decl Summary): Fix.
6166 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
6167 * tests/input.at (Boolean %define variables): Update output.
6168 * tests/skeletons.at (%define boolean variables: invalid skeleton
6169 defaults): Rename to...
6170 (%define Boolean variables: invalid skeleton defaults): ... this and
6171 update output.
6172
1b17b01d
JD
61732007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
6174
6175 In impure push mode, don't allow more than one yypstate to be allocated
6176 since multiple impure parsers would corrupt yynerrs.
6177 * data/push.c (yypstate_allocated): New static global variable
6178 initialized to 0.
6179 (yypull_parse): If yypstate_new returns 0, don't report it as memory
6180 exhaustion if yypstate_allocated is 1, but still return 2.
6181 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
6182 already 1. Otherwise, set it to 1.
6183 (yypstate_delete): Set it to 0.
6184 * tests/push.at (Push Parsing: Multiple impure instances): New test
6185 case.
6186
9987d1b3
JD
61872007-08-17 Bob Rossi <bob@brasko.net>
6188
6189 * doc/bison.texinfo (Push Decl): Document the push parser.
6190 (Table of Symbols): Ditto.
6191 (Pure Decl): Ditto.
6192 (Decl Summary): Ditto.
6193 (Multiple Parsers, Push Parser Function, Pull Parser Function,
6194 Parser Create Function, Parser Delete Function):
6195 Add new push parser symbols.
6196 (Table of Symbols): Document push-parser, push-pull-parser,
6197 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
6198
f16b0819
PE
61992007-08-15 Paul Eggert <eggert@cs.ucla.edu>
6200
6201 Update to GPLv3.
6202 * doc/gpl-3.0.texi: New file.
6203 * doc/gpl.texi: Remove.
6204 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
6205 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
6206 * README-hacking, TODO, bootstrap, bootstrap.conf:
6207 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
6208 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
6209 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
6210 * data/lalr1.cc, data/lalr1.java, data/location.cc:
6211 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
6212 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
6213 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
6214 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
6215 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
6216 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
6217 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
6218 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
6219 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
6220 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
6221 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
6222 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
6223 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
6224 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
6225 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
6226 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
6227 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
6228 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
6229 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
6230 * src/complain.c, src/complain.h, src/conflicts.c:
6231 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
6232 * src/files.h, src/flex-scanner.h, src/getargs.c:
6233 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
6234 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
6235 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
6236 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
6237 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
6238 * src/print.c, src/print.h, src/print_graph.c:
6239 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
6240 * src/reduce.h, src/relation.c, src/relation.h:
6241 * src/revision.h, src/scan-code.h, src/scan-code.l:
6242 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
6243 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
6244 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
6245 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
6246 * tests/Makefile.am, tests/actions.at, tests/c++.at:
6247 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
6248 * tests/existing.at, tests/glr-regression.at:
6249 * tests/headers.at, tests/input.at, tests/java.at:
6250 * tests/local.at, tests/output.at, tests/push.at:
6251 * tests/reduce.at, tests/regression.at, tests/sets.at:
6252 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
6253 * tests/torture.at:
6254 Update to GPLv3.
6255
728c4be2
JD
62562007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6257
6258 Get rid of broken %no-parser, -n, and --no-parser implementation and
6259 documentation.
6260 * TODO: Don't mention them.
6261 * doc/bison.1: Likewise.
6262 * doc/bison.texinfo (Decl Summary): Likewise.
6263 (Bison Options): Likewise.
6264 (Option Cross Key): Likewise.
6265 * src/getargs.c (no_parser_flag): Remove global variable.
6266 (usage): Don't print description of -n and --no-parser.
6267 (long_options): Remove --no-parser entry here.
6268 (getargs): Remove -n case in the switch here.
6269 * src/getargs.h (no_parser_flag): Remove extern.
6270 * tests/regression.at (Web2c Actions): Remove comment that mentions
6271 --no-parser.
6272
5d31a216
JD
62732007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6274
6275 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
6276 name user variables starting with `yy'. Just pass NULL instead of a
6277 dummy local &yylval to yypush_parse.
6278 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
6279 starting with `yy'.
6280
a2ea208d
JD
62812007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
6282
6283 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
6284 true since it's then always used regardless of whether yyoverflow is
6285 defined. Reported by Christian Burger at
6286 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
6287 * THANKS: Add Christian Burger.
6288
91661ebb
JD
6289 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6290 node names: say "Decl Summary" not "Bison Declaration Summary".
6291
cbd50549
JD
62922007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
6293
6294 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
6295 determine whether this function has already complained about an invalid
6296 value for a %define boolean variable, don't check whether Bison has
6297 ever examined the value. As written, the check was a tautology.
6298 Instead, record and check for this complaint using a separate muscle.
6299
eb1b0740
JD
63002007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
6301
6302 Fix push parsing memory leak reported by Brandon Lucia at
6303 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
6304 * THANKS: Add Brandon Lucia.
6305 * data/push.c (yypstate_delete): Free the stack if it was reallocated
6306 but the parse never completed and thus freed it.
6307 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
6308 * tests/testsuite.at: Include push.at.
6309 * test/push.at: New.
6310 (Push Parsing: Memory Leak for Early Deletion): New test case.
6311
9d774aff
JD
63122007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
6313
6314 Improve handling of multiple S/R conflicts in the same state and of S/R
6315 conflicts involving multiple reductions.
6316 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
6317 set for a state here or Bison will abort if it is reassigned on a
6318 later conflicted reduction in the same state.
6319 Similarly, don't finalize and assign the solved conflicts report here
6320 or it will be lost if it is reassigned on a later conflicted reduction
6321 in the same state.
6322 (set_conflicts): Instead, assign them both here after all S/R conflicts
6323 in the state have been fully examined.
6324 * src/print.c (shift_set): Rename to...
6325 (no_reduce_set): ... this.
6326 (print_reductions): Update for rename, and add %nonassoc error action
6327 tokens to no_reduce_set so that, when printing the first remaining
6328 reduction on an error action token, the reduction is enclosed in
6329 brackets.
6330 (print_results): Update for rename.
6331 * tests/conflicts.at (Solved conflicts report for multiple reductions
6332 in a state): New test case.
6333 (%nonassoc error actions for multiple reductions in a state): New test
6334 case.
6335
6336 * src/main.c (main): Don't depend on C99 features.
6337
10159d2a
JD
63382007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
6339
6340 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
6341 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
6342 uniwidth.
10159d2a 6343
953b3935
JD
63442007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
6345
6346 * bootstrap (slurp): Create target directories that don't exist.
6347 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
6348
6ce2d93a
JD
63492007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6350
6351 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
6352 than item number.
6353 * closure.c (closure): Likewise.
6354 * state.h (reductions): Comment sorting of rules.
6355 (state): Comment sorting of items.
6356
ce3448d5
JD
63572007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
6358
6359 Fix C++ test cases after recent Gnulib changes. Discussed starting at
6360 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
6361 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
6362 definition in order to avoid Gnulib headers since we don't use config.h
6363 here.
6364 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
6365 rather than AT_DATA so that config.h is included.
6366
8a86eef0
JD
63672007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
6368
6369 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
6370 instead of fprintf. Guard these functions with #if YYDEBUG instead of
6371 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
6372 and so that YYFPRINTF is guaranteed to be defined here.
6373
b1a81613
JD
63742007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6375
6376 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
6377 with...
6378 (muscle_percent_define_check_values): ... this more helpful function.
6379 Again, it's not used yet, but it will be.
6380 * src/muscle_tab.h: Likewise.
6381
71b61d4d
JD
6382 Improve some comments in parser table construction.
6383 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
6384 (generate_states): Don't mention ruleset, which is internal to closure.
6385 * src/closure.c (closure): Explain sorting of core and itemset, which
6386 is required for this function to behave correctly.
6387 * src/closure.h (closure): Mention sorting.
6388
2a6b783d
JD
63892007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
6390
6391 * src/lalr.c (state_lookahead_tokens_count): For code readability,
6392 move the check for disabled transitions to an aver since conflict
6393 resolution hasn't happened yet.
6394
6395 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
6396 labels a state as inconsistent just because it has error transitions.
6397 The original form of this check appeared in revision 1.1 of lalr.c,
6398 which was committed on 1991-12-21. Now (at least), changing the
6399 consistency label on such a state appears to have no useful effect in
6400 any of the places it is examined, which I enumerate below. The key
6401 point to understanding each item in this enumeration is that a state
6402 with an error transition is labelled consistent in the first place only
6403 if it has no rules, so the check cannot matter for states that have
6404 rules. (1) Labelling a state as inconsistent will cause set_conflicts
6405 to try to identify its conflicts, and a state must have *rules* to have
6406 conflicts. (2) Labelling a state as inconsistent will affect how
6407 action_row sets the default *rule* for the state. (3) Labelling a
6408 state as inconsistent will cause build_relations to add lookback edges
6409 to *rules* in that state.
6410 * src/state.h (struct state): Word the comment for member consistent
6411 more carefully.
6412
14462c2b
JD
64132007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
6414
6415 Don't depend on C99 features.
6416 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
6417 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
6418 * src/reader.c (check_and_convert_grammar): Fix for-loop.
6419 * src/state.c (state_mark_reachable_states): Fix for-loop.
6420 (state_remove_unreachable_states): Fix for-loop.
6421
6422 Don't widen struct state with member reachable just to temporarily
6423 record reachability. Instead, use a local bitset.
6424 * src/state.h (struct state): Remove member.
6425 * src/state.c (state_new): Don't initialize it.
6426 (state_mark_reachable_states): Rename to...
6427 (state_record_reachable_states): ... this, and use bitset.
6428 (state_remove_unreachable_states): Use bitset.
6429
5a43d418
JD
64302007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
6431
6432 * src/Makefile.am (yacc): Quote target action commands properly so
6433 that the yacc script isn't corrupt. Reported by Hans Aberg at
6434 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
6435
0c650a20
JD
6436 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
6437 the case of pure parsers. Reported by Frans Englich at
6438 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
6439 * THANKS: Add Frans Englich.
6440
61fee93e
JD
6441 * NEWS (2.3a+): In the %code entry, reference section `Bison
6442 Declaration Summary' from the manual now since the %code summary has
6443 moved there.
6444 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
6445 in the rules section must be terminated by semicolons.
6446
f124d423
JD
64472007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
6448
6449 Extend the front-end API for %define variables to more completely
6450 mirror the back-end. This will be useful in the future.
6451 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
6452 Update comments to mention the new front-end counterparts of these
6453 macros.
6454 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
6455 for muscle_string_decode and muscle_location_decode.
6456 (muscle_string_decode): New static function.
6457 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
6458 (muscle_percent_define_get, muscle_percent_define_ifdef): New
6459 functions.
6460 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
6461 muscle_percent_define_get to mimic the b4_percent_define_flag_if
6462 implementation more closely.
6463 (muscle_percent_define_invalid_value): New function.
6464 * src/muscle_tab.h (muscle_percent_define_get,
6465 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
6466 Prototype.
6467
75ad86ee
JD
64682007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
6469
6470 * NEWS (2.3a+): Mention yesterday's state-removal change.
6471 (2.3a): Remove the %language entry, which was added after 2.3a.
6472 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
6473 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
6474 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
6475 tests/existing.at: Update copyright date.
6476
5967f0cf
JD
64772007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6478
6479 If conflict resolution makes states unreachable, remove those states,
6480 report rules that are then unused, and don't report conflicts in those
6481 states.
6482 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
6483 New global function.
6484 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
6485 function.
6486 * src/main.c (main): After conflict resolution, remove the unreachable
6487 states and update all data structures that reference states by number.
6488 * src/state.c (state_new): Initialize each state's reachable member to
6489 false.
6490 (state_mark_reachable_states): New static function.
6491 (state_remove_unreachable_states): New global function.
6492 * src/state.h (struct state): Add member bool reachable.
6493 (state_remove_unreachable_states): Prototype.
6494 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6495 New test case.
6496 * tests/existing.at (GNU pic Grammar): Update test case output now that
6497 an unused rule is discovered.
6498
b09f4f48
JD
64992007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6500
6501 Minor code cleanup in parser table construction.
6502 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
6503 (new_itemsets, save_reductions): Update for rename to nitemset.
6504 * src/closure.c (nritemset): Rename to...
6505 (nitemset): ... this since the "r" appears to meaningless and isn't
6506 used in the comments.
6507 (closure): Update for rename.
6508 * src/closure.h (nritemset): Update extern to...
6509 (nitemset): ... this.
6510 * src/lalr.c (LA): Fix a typo in comments.
6511 * src/print.c (print_core): Update for rename to nitemset.
6512 * src/print_graph.c (print_graph): Likewise.
6513 * src/state.h: Fix some typos in header comments.
6514
bbb44d83
PE
65152007-04-04 Paul Eggert <eggert@cs.ucla.edu>
6516
9b33de72
PE
6517 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
6518 still sticks to ASCII. Sorry!
6519
bbb44d83
PE
6520 * README-hacking: New file, taken mostly from coreutils, with changes
6521 for Bison. Contains much of the contents of:
6522 * README-cvs: Remove.
6523 * bootstrap: Sync from gnulib.
6524 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
6525 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
6526
29553547
JD
65272007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
6528
6529 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
6530 Setzer.
6531 (Java Differences): Fix some typos.
6532 * THANKS: Add Sebastian Setzer.
6533
01b477c6
PB
65342007-03-07 Paolo Bonzini <bonzini@gnu.org>
6535
730739e4
AD
6536 * data/java.m4 (b4_single_class_if): Remove.
6537 (b4_abstract_if): Look at "%define abstract".
6538 (b4_lexer_if): New.
6539 (b4_union_name): Rename...
6540 (b4_yystype): ... to this. Map to "%define stype".
6541 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
6542 b4_maybe_throws): Fix quoting.
6543 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
6544 * data/lalr1.java (Lexer interface): Always define.
6545 (Lexer interface within parser class): Remove.
6546 (YYLexer class): New, used when "%code lexer" is present.
6547 (constructor): When "%code lexer" is used, pass %lex-param
6548 to the lexer constructor.
6549 (yylex, yyparse): Remove %lex-param from method invocations
6550 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
6551
6552 * doc/bison.texinfo (Java Bison Interface): Mention "%define
6553 abstract". Rename "%define union_name" to "%define stype".
6554 Rename method names according to previous patch.
6555 (Java Scanner Interface): Describe "%code lexer" instead of
6556 "%pure-parser" and "%define single_class".
6557 (Java Differences): Mention "%code lexer".
6558
6559 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
6560 Include scanner here, using macros from tests/local.at.
6561 (AT_DATA_CALC_Y): Remove final argument.
6562 (_AT_CHECK_JAVA_CALC): Likewise.
6563 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
6564 of %locations and %error-verbose.
6565 (main): Test with and without %lex-param.
6566 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
6567 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 6568
122bea3a
JMG
65692007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6570
6571 DJGPP spefic issue. Inhibit the use of disallowed characters for
6572 file name genertion on Win98, WinXP, etc. These are |<>":?*\
6573 and concern testsuite case 46.
6574 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
6575 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
6576 * djgpp/config.bat: Inhibit the use of disallowed characters.
6577
9611cfa2
JD
65782007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6579
6580 Miscellaneous %define and %code cleanup.
6581 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
6582 values are interpreted.
6583 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
6584 documentation a little more.
6585 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
6586 muscle_percent_define_insert, muscle_percent_code_grow): New
6587 functions/macros.
6588 * src/muscle_tab.h (muscle_percent_define_insert,
6589 muscle_percent_code_grow): Prototype.
6590 * src/parse-gram.y (prologue_declaration): Use
6591 muscle_percent_define_insert and muscle_percent_code_grow when parsing
6592 %define and %code directives.
6593
6594 Make it easy to share %define boolean variables between the front-end
6595 and back-end. Though not used yet, this will be useful in the future.
6596 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
6597 Bison uses of names rather than just skeleton uses of names.
6598 (b4_percent_define_get, b4_percent_define_ifdef): Rename
6599 b4_percent_define_skeleton_variables(VARIABLE) to
6600 b4_percent_define_bison_variables(VARIABLE).
6601 (b4_percent_code_get, b4_percent_code_ifdef): Rename
6602 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
6603 b4_percent_code_bison_qualifiers(QUALIFIER).
6604 (b4_check_user_names_wrap): Update for renames.
6605 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
6606 muscle_percent_define_default): New functions mimicking
6607 b4_percent_define_flag_if and b4_percent_define_default.
6608
6609 For %define variables, report locations for invalid values and
bbb44d83 6610 redefinitions.
9611cfa2
JD
6611 * data/bison.m4 (b4_percent_define_flag_if): Read
6612 b4_percent_define_loc(VARIABLE) to report the location of an invalid
6613 value for VARIABLE.
6614 (b4_percent_define_default): Save a special location in
6615 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
6616 must later be reported as invalid.
6617 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
6618 functions.
6619 (muscle_percent_define_insert): Record the location of VARIABLE in
6620 muscle percent_define_loc(VARIABLE), and use it to report the previous
6621 location for a redefinition.
6622 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
6623 (muscle_percent_define_default): Update like b4_percent_define_default.
6624 (muscle_grow_user_name_list): Rename to...
6625 (muscle_user_name_list_grow): ... this for consistency and use
6626 muscle_location_grow.
6627 * src/muscle_tab.h (muscle_location_grow): Prototype.
6628 * tests/input.at (%define errors): Update expected output.
6629 * tests/skeletons.at (%define boolean variables: invalid skeleton
6630 defaults): New test case.
6631
0bf92491
JD
66322007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
6633
6634 * src/print.c (lookahead_set, state_default_rule): Remove.
6635 (print_reductions): Replace state_default_rule invocation with
6636 equivalent use of yydefact, which was computed in token_actions in
6637 tables.c.
6638 (print_results): Don't allocate lookahead_set.
6639
d3b12988
PB
66402007-02-27 Paolo Bonzini <bonzini@gnu.org>
6641
6642 * data/lalr1.java: Prefix all private members with yy.
6643
f57a7536
JD
66442007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
6645
6646 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 6647 Sebastien Fricker at
f57a7536 6648 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 6649 * THANKS: Add Sebastien Fricker.
f57a7536
JD
6650 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
6651 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
6652 accept a variable number of arguments.
6653
6404a5bf
JD
66542007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
6655
6656 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
6657
e4e09639
JMG
66582007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6659
6660 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
6661 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
6662 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
6663
d7e0a1a7
PE
66642007-02-11 Paul Eggert <eggert@cs.ucla.edu>
6665
6666 Undo my 2007-02-07 change, switching back to the c-strcase module
6667 introduced in the 2007-02-03 change. Bruno Haible reported that
6668 the 2007-02-07 change would be dangerous in Turkish if we add a
6669 language whose name contains "i", since "i" is not lowercase "I"
6670 in Turkish.
6671 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
6672 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
6673 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
6674 * m4/.cvsignore: Remove strcase.m4.
6675 * src/getargs.c: Revert 2007-02-07 change, as follows.
6676 Include c-strcase.h.
6677 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
6678
deee93a1
JD
66792007-02-11 Bruno Haible <bruno@clisp.org>
6680
6681 Enable the Java related testsuite tests when the only Java compiler
6682 found is a gcj < 4.3. Discussed at
6683 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
6684 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
6685
574add85
JD
66862007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
6687
6688 * data/Makefile.am: Update copyright date.
6689 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
6690 yypstate_new returns NULL.
6691 (yypstate_new): Return NULL if malloc does.
6692 * src/reader.c (packgram): Move translation of rule actions from the
6693 beginning of packgram to...
6694 (check_and_convert_grammar): ... here right before packgram is invoked
6695 so it's easier to write more complete comments, and remove redundant
6696 code.
6697
e785ccf7
JD
66982007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
6699
6700 As in semantic actions, make @$ in %initial-action, %destructor, and
6701 %printer imply %locations.
6702 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
6703 scanning @$.
6704 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
6705 (@$ in %initial-action implies %locations,
6706 @$ in %destructor implies %locations,
6707 @$ in %printer implies %locations): ... these new test cases.
6708
1cfe1ed7
PE
67092007-02-07 Paul Eggert <eggert@cs.ucla.edu>
6710
6711 Undo most of the 2007-02-03 change, switching to the strcase module
6712 now that gnulib strcase has been fixed.
6713 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
6714 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
6715 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
6716 * m4/.cvsignore: Add strcase.m4.
6717 * src/getargs.c: Revert 2007-02-03 change, as follows.
6718 Don't include c-strcase.h.
6719 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
6720 strcasecmp has "unspecified behavior" outside the POSIX locale,
6721 but it works fine in practice if at least one argument is ASCII,
6722 as is the case in Bison.
6723
0049ec86
PB
67242007-02-07 Paolo Bonzini <bonzini@gnu.org>
6725
6726 * tests/java.at: Skip tests if only one of javac/java is present.
6727 Reported by Joel E. Denny.
6728 * tests/atlocal.in: Adjust copyright years.
6729
67302007-02-05 Paolo Bonzini <bonzini@gnu.org>
6731
6732 * data/lalr1.java (Stack): Work around old verifiers that disallow
6733 access to the private fields of an inner class, from the outer class.
6734 We can make Stack's fields public because user code doesn't have access
6735 to the instance of Stack used by parse(). Reported by Paul Eggert.
6736
2c2b7220
PE
67372007-02-03 Paul Eggert <eggert@cs.ucla.edu>
6738
6739 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
6740 the right spot for these files?
6741 * bootstrap.conf (gnulib_modules): Add c-strcase.
6742 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
6743 c-strncasecmp.c.
6744 * src/getargs.c: Include c-strcase.h.
6745 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
6746 to avoid unspecified behavior.
6747
b2b81dae
JD
67482007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
6749
6750 * doc/bison.texinfo (Decl Summary): Correct typo.
6751
c1d19e10
PB
67522007-01-30 Paolo Bonzini <bonzini@gnu.org>
6753
6754 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
6755 Complain if the value does not match empty, "true" or "false".
6756 * data/c++.m4: Adjust default definitions of %define variables.
6757 * data/java.m4: Adjust default definitions of %define variables.
6758 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
6759 to above behavior.
6760 * tests/input.at (Boolean %define variables): Test new behavior.
6761
8405b70c
PB
67622007-01-29 Paolo Bonzini <bonzini@gnu.org>
6763
6764 * NEWS: Mention java.
6765 * TODO: Remove things that are done.
6766 * bootstrap.conf: Add javacomp-script and javaexec-script.
6767 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
6768
6769 * data/Makefile.am: Add new files.
6770 * data/java-skel.m4: New.
6771 * data/java.m4: New.
6772 * data/lalr1.java: New.
6773
6774 * doc/bison.texinfo: Put "A Complete C++ Example" under
6775 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
6776 under Other Languages.
6777
6778 * src/getargs.c (valid_languages): Add Java.
6779 * src/getargs.h (struct bison_language): Update size of string fields.
6780
6781 * tests/Makefile.am: Add java.at.
6782 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
6783 * tests/java.at: New.
6784 * tests/testsuite.at: Include it.
6785
3eb82471
JD
67862007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
6787
6788 Clean up.
6789 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
6790 at_directive_argv arguments so these no longer have to be global
6791 variables. Also, update the implementation for the following changes.
6792 (fail_for_at_directive_too_many_args,
6793 fail_for_at_directive_too_few_args): Add at_directive_name argument.
6794 (at_directive_name): Remove as at_directive_argv[0] will be used for
6795 this now.
6796 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
6797 for the directive name.
6798 (at_directive_argc, at_directive_argv): Make these local within
6799 skel_lex instead of global.
6800 (INITIAL): Update directive start action for above changes.
6801 (SC_AT_DIRECTIVE_ARG): Rename to...
6802 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
6803 (SC_AT_DIRECTIVE_SKIP_WS): Update.
6804 (scan_skel): Move yylex_destroy to...
6805 (skel_scanner_free): ... here.
6806 * tests/skeletons.at (installed skeleton file name): Rename to...
6807 (installed skeleton file names): ... this.
6808
148d66d8
JD
68092007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
6810
6811 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6812 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
6813 Summary" not "Directives".
6814 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
6815 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
6816 since the former is now the more complete one.
6817 (Prologue Alternatives): Likewise and do the same for %defines.
6818 (Table of Symbols): Add summary of %code, add summary of %define, and
6819 move full %code documentation to...
6820 (Decl Summary): ... here for consistency with other entries in these
6821 sections.
6822 Move %define entry in order to keep this list alphabetized.
6823 Reword %define entry a little to put less emphasis on the skeleton
6824 concept, which most users shouldn't have to think about.
6825
665f0c24
PE
68262007-01-26 Paul Eggert <eggert@cs.ucla.edu>
6827
6828 Adjust to recent gnulib changes.
6829 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
6830 Add string.h, string_.h, unistd_.h, wchar_.h.
6831 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
6832 * src/system.h: Don't include <stpcpy.h>; this is now done by
6833 <string.h>.
6834
592d0b1e
PB
68352007-01-23 Paolo Bonzini <bonzini@gnu.org>
6836
6837 Simplify implementation of unqualified %code, implement macros for
6838 uniform treatment of boolean %define flags. Document %define.
6839 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
6840 b4_percent_code_ifdef): New.
6841 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
6842 * data/c++.m4: Define default value for global_tokens_and_yystype.
6843 * data/glr.cc: Likewise.
6844 * data/location.cc: Use b4_percent_define_flag_if.
6845
148d66d8 6846 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
6847
6848 * src/parse-gram.y (Unqualified %code): Change muscle name to
6849 b4_percent_code().
6850 (content.opt): Default to empty.
6851
a7867f53
JD
68522007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6853
6854 Implement support for relative and absolute skeleton file names.
6855 Discussed starting at
6856 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
6857 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
6858 (Bison Options): Document in --skeleton entry.
6859 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
6860 full_skeleton can't necessarily hold all of pkgdatadir.
6861 If the specified skeleton file name contains a `/', don't prepend
6862 pkgdatadir.
6863 * src/parse-gram.y (prologue_declaration): If the specified skeleton
6864 file name contains a `/', prepend the grammar file directory.
6865 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
6866 * skeletons.at: New file.
6867 (relative skeleton file names): New test case.
6868 (installed skeleton file names): New test case.
6869 * tests/testsuite.at: Include skeletons.at.
6870
6871 * bootstrap: Update copyright to 2007.
6872
830c9b18
PB
68732007-01-17 Paolo Bonzini <bonzini@gnu.org>
6874
6875 * bootstrap: Remove occurrences of .#bootmp from the files.
6876
a8c2e813
AD
68772007-01-17 Akim Demaille <akim@epita.fr>
6878
6879 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
6880 nonterminals.
6881 Use per-type %printer.
6882
279cabb6
JD
68832007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6884
6885 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
6886 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6887 djgpp/config.site, src/files.c, src/files.h, src/main.c,
6888 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
6889 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
6890 tests/glr-regression.at, tests/input.at, tests/local.at,
6891 tests/output.at, tests/torture.at: Update copyright to 2007.
6892
bb32f4f2
AD
68932007-01-16 Akim Demaille <akim@epita.fr>
6894
6895 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
6896 error code.
6897 (Calc++ Scanner): Exit with failure if we can't open the input
6898 file.
6899 Accept "-" standing for stdin.
6900 (Calc++ Top Level): Print the result only if the parsing was
6901 successful.
6902
7cff04b5
AD
69032007-01-16 Akim Demaille <akim@epita.fr>
6904
6905 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
6906
a4e25e1d
JD
69072007-01-15 Paolo Bonzini <bonzini@gnu.org>
6908 and Joel E. Denny <jdenny@ces.clemson.edu>
6909
6910 Clean up %define and %code implementation in M4 some. Most
6911 importantly, rename all related macros to be in the b4_percent_define
6912 and b4_percent_code namespaces. Also, complete support for `.' in
6913 %define variable names and %code qualifiers.
6914 * data/bison.m4 (b4_check_user_names): Check for special
6915 "SKELETON-NAMESPACE(name)" macros instead of using two nested
6916 m4_foreach loops.
6917 (b4_get_percent_define, b4_get_percent_code): Rename to...
6918 (b4_percent_define_get, b4_percent_code_get): ... these.
6919 Extend documentation with examples.
6920 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
6921 b4_percent_define_skeleton_variables and
6922 b4_percent_code_skeleton_qualifiers.
6923 Expect any value for the %define variable `foo' to be stored in the
6924 macro named `b4_percent_define(foo)'; expect any %code blocks for the
6925 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
6926 expect any unqualified %code blocks to be stored in a macro named
6927 `b4_percent_code_unqualified'.
6928 Use m4_indir so that %define variable names and %code qualifiers can
6929 contain `.', which is allowed by the grammar parser.
6930 (b4_percent_define_default): New macro to set a default value for a
6931 %define variable.
6932 (m4_wrap): Update wrapped code, and fix some underquoting.
6933 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
6934 Expect grammar uses of %define variables and %code qualifiers to be
6935 defined in b4_percent_define_user_variables and
6936 b4_percent_code_user_qualifiers.
6937 * data/c++.m4: Use b4_percent_define_default rather than
6938 m4_define_default. Fix some underquoting. Skeleton usage of %define
6939 variable define_location_comparison now implies skeleton usage of
6940 %define variable filename_type.
6941 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6942 data/push.c, data/yacc.c: Update macro names.
6943 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
6944 muscle names.
6945
e37c665c
JMG
69462007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6947
6948 DJGPP specific issues.
6949
6950 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
6951 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
6952
7d2d521f
JD
69532007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6954
6955 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
6956 run parsers in all tests so that Valgrind is invoked during
6957 maintainer-check-valgrind.
6958 (Duplicate representation of merged trees): Free all semantic values.
6959 (Duplicated user destructor for lookahead): Likewise.
6960
e0ac9b4b
JD
69612007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6962
6963 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
6964 command-line prefix.
6965 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
6966 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
6967 miss Valgrind messages.
6968 (Exploding the Stack Size with Malloc): Likewise.
6969
78143faa
JD
69702007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6971
6972 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
6973 locals. Reported by Juan Manuel Guerrero at
6974 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
6975 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
6976 Fix some indentation also.
6977 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
6978 explaining this issue.
6979
7ecec4dd
JD
69802007-01-09 Paolo Bonzini <bonzini@gnu.org>
6981 and Joel E. Denny <jdenny@ces.clemson.edu>
6982
6983 Simplify union and prologue handling, and escape union and lex/parse
6984 params with digraphs.
6985 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
6986 values to the empty string since these are no longer guaranteed
6987 initialized by the front-end.
6988 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
6989 braces around b4_user_stype since this is no longer done by the
6990 front-end.
6991 * src/files.c, src/files.h (pre_prologue_obstack,
6992 post_prologue_obstack): Remove.
6993 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
6994 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
6995 with digraphs. This fixes lex params and parse params.
6996 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
6997 * src/output.c (prepare): Remove muscle insertion of the prologues.
6998 (output): Remove freeing of pre_prologue_obstack and
6999 post_prologue_obstack.
7000 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
7001 than prologue_augment for prologue parsing so you don't need prologue
7002 obstacks.
5c80250c
JD
7003 (grammar_declaration): For %union RHS, use `braceless' instead of
7004 "{...}" so that braces are already stripped and code is escaped with
7005 digraphs.
7ecec4dd
JD
7006 * src/reader.c (prologue_augment): Remove.
7007 (reader): Remove initialization of pre_prologue_obstack and
7008 post_prologue_obstack.
7009 * src/reader.h (prologue_augment): Remove.
7010
7011 * data/c.m4: Remove stray parenthesis.
7012
16dc6a9e
JD
70132007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7014
7015 Remove quotes from variables names in %define directives and from
7016 qualifiers in %code directives, and restrict the characters that are
7017 allowed in them to M4-friendly ones. For %define, continue to support
7018 the quoted form as a deprecated feature. Discussed starting at
7019 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
7020 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
7021 %code.
7022 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
7023 (Decl Summary): In %defines entry, update mention of `%code requires'
7024 and `%code provides'.
16dc6a9e
JD
7025 (C++ Location Values): Update %define uses.
7026 (Calc++ Parser Interface): Likewise.
7027 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 7028 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
7029 * src/parse-gram.y (prologue_declaration): For %define variables, use
7030 `variable' instead of `STRING'.
7031 (grammar_declaration): For %code qualifiers, use `ID' instead of
7032 `STRING'.
7033 (variable): New nonterminal that takes an `ID' or a `STRING'.
7034 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
7035 and %define uses.
7036 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
7037 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
7038 (%define errors): Update %define uses.
7039
e9813cd4
JD
70402007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7041
7042 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
7043 instead of muscle_insert for %define values so that M4-special
7044 characters are replaced with digraphs.
7045 * tests/input.at (%define errors): Extend to check weird values.
7046
6afc30cc
JD
70472007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7048
7049 Instead of having skeletons declare all valid %define variables and
7050 %code qualifiers, provide macros that retrieve the associated values
7051 and build these lists automatically. Thus Bison will now warn when a
7052 variable or qualifier is not used by the skeleton in the current
7053 invocation regardless of whether it might sometimes be used by that
7054 skeleton in other invocations. Also, move all %define value macros to
7055 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
7056 form, which is replaced by %code.
7057 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
7058 (b4_check_user_names): ... this, and change the series of valid name
7059 arguments to a single list argument for names used in the skeleton
7060 similar to the existing list argument for names used in the grammar.
7061 Warn instead of complaining.
7062 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
7063 values and %code code, to format %code code properly, and to build
7064 lists of all %define variables and %code qualifiers used in the
7065 skeleton: b4_skeleton_percent_define_variables and
7066 b4_skeleton_percent_code_qualifiers.
7067 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
7068 Remove, and...
7069 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
7070 the skeleton names lists can finish building first. In place of
7071 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
7072 expect the lists b4_user_percent_define_variables and
7073 b4_user_percent_code_qualifiers.
7074 * data/c++.m4: Where setting default values for b4_parser_class_name,
7075 b4_location_type, b4_filename_type, b4_namespace, and
7076 b4_define_location_comparison, update their names to the
7077 b4_percent_define_ namespace.
7078 * data/glr.c: Don't use b4_check_percent_define_variables and
7079 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
7080 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
7081 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 7082 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
7083 * data/location.cc: Use b4_get_percent_define.
7084 * data/push.c: Don't use b4_check_percent_define_variables and
7085 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
7086 * data/yacc.c: Likewise, and don't call m4_exit in
7087 b4_use_push_for_pull_if or m4_wrap code will never execute.
7088 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
7089 Rename to...
7090 (muscle_grow_user_name_list): ... this for consistency with the
7091 terminology used in bison.m4.
7092 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
7093 %define variable names, and rename muscle used_percent_define_variables
7094 to user_percent_define_variables.
7095 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
7096 user_percent_code_qualifiers.
7097 (content): Remove.
7098 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
7099 {CODE} form is no longer accepted.
7100 * tests/input.at (Reject bad %code qualifiers): Rename to...
7101 (Reject unused %code qualifiers): ... this, and update test output.
7102 (%define error): Update test output.
7103
7eb8a0bc
JD
71042007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
7105
7106 Check for unrecognized %define variables similar to checking for
7107 unrecognized %code qualifiers. Check for redefined %define variables.
7108 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
7109 generalizes...
7110 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
7111 (b4_check_percent_define_variables): New, also wraps it.
7112 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
7113 variables using b4_check_percent_define_variables.
7114 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
7115 all those exercised in the test suite and all those listed in the
7116 `Default values' section of c++.m4. Are there others?
7117 * data/push.c, data/yacc.c: Declare no valid %define variables.
7118 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
7119 similar to muscle_find, but it works even when the muscle stores a
7120 const value.
7121 (muscle_grow_used_name_list): New function for constructing the used
7122 name list muscles that b4_check_for_unrecognized_names requires.
7123 * src/parse-gram.y (prologue_declaration): Warn if a variable is
7124 %define'd more than once. Define the b4_used_percent_define_variables
7125 muscle with muscle_grow_used_name_list.
7126 (grammar_declaration): Abbreviate %code code with
7127 muscle_grow_used_name_list.
7128 * tests/input.at (%define errors): New.
7129
3fc65ead
JD
71302007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7131
7132 Provide warn_at, complain_at, and fatal_at function callbacks to the
7133 skeletons, and use this for %code qualifier complaints.
7134 * data/bison.m4 (b4_error_at): New, invoked by...
7135 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
7136 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
7137 @fatal_at(...@) directives.
7138 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
7139 qualifiers in b4_used_percent_code_qualifiers and to use
7140 b4_complain_at.
7141 * src/location.c, src/location.h (boundary_set_from_string): New global
7142 function.
7143 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
7144 function.
7145 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
7146 to b4_used_percent_code_qualifiers.
7147 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
7148 function.
7149 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
7150 (lineno): Rename to...
7151 (out_lineno): ... this so I don't misunderstand it again.
7152 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
7153 here; these newlines are in the input but not the output file.
7154 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
7155 (at_directive_perform): ... this new static function, and add handling
7156 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
7157 directives.
7158 * tests/input.at (Reject bad %code qualifiers): Update test output with
7159 locations and extend.
7160
7161 * tests/output.at (Output file name: [, Output file name: ]): Remove
7162 bogus comment about these tests failing.
7163
1c7b7e1d
JD
71642007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7165
7166 Clean up b4_check_percent_code_qualifiers a little.
7167 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
7168 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
7169 documentation and add examples.
7170 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
7171 qualifiers here.
7172
08af01c2
JD
71732007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7174
7175 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
7176 unreliable -- especially when they're hidden inside another macro.
7177 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
7178 data/c.m4: Remove m4_divert(-1).
7179 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7180 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
7181 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 7182 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
7183 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
7184 pushed and popped by m4sugar, should be first on the stack.
7185
7186 Provide warn, complain, and fatal function callbacks to the skeletons.
7187 This provides more flexibility than m4_fatal, improves the error
7188 message format, and captures messages for translation. Discussed
7189 starting at
7190 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
7191 * data/bison.m4 (b4_error): New, invoked by...
7192 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
7193 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
7194 directives. Because these M4 macros might be called when the current
7195 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
7196 the previous removal of uses of m4_divert, which caused trouble.
7197 (b4_check_percent_code_qualifiers): Use b4_complain instead of
7198 m4_fatal to report unrecognized %code qualifiers.
7199 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
7200 push parser requests.
7201 * data/glr.c: Use b4_complain instead of m4_fatal to report
7202 non-deterministic push parser requests.
7203 Update @output usage to @output(...@) form.
7204 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
7205 report missing %defines. Update @output usage to @output(...@) form.
7206 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
7207 @output(...@) form.
7208 * src/main.c (main): Invoke skel_scanner_free.
7209 * src/scan-skel.h (skel_scanner_free): Prototype new function.
7210 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
7211 obstack_for_string from flex-scanner.h.
7212 (YY_DECL): Use to declare skel_lex static.
7213 (decode_at_digraphs): Remove; now handled in the new
7214 SC_AT_DIRECTIVE_ARG start condition.
7215 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
7216 functions.
7217 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
7218 at_directive_argv): New static globals.
7219 (INITIAL): Use fail_for_invalid_at.
7220 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
7221 recognize the start of a generalized `@directive(...@)' form and
7222 start...
7223 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
7224 directive args (using the new obstack_for_string), to decode the
7225 contained @ diagraphs, and to perform the directive. It recognizes
7226 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
7227 @output(...@).
7228 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
7229 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
7230 `@,'.
7231 (scan_skel): Initialize obstack_for_string on the first call.
7232 (skel_scanner_free): New function to free obstack_for_string.
7233 * tests/input.at (Reject bad %code qualifiers): Update test output.
7234
8e0a5e9e
JD
72352007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
7236
7237 Consolidate the 4 prologue alternative directives (%code, %requires,
7238 %provides, and %code-top) into a single %code directive with an
7239 optional qualifier field. Discussed at
7240 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
7241 * NEWS (2.3a+): Rewrite the existing entry for the prologue
7242 alternatives.
7243 * doc/bison.texinfo (Prologue Alternatives): Update.
7244 (Decl Summary): Update to %code "requires" and %code "provides".
7245 (Calc++ Parser): Update to %code "requires".
148d66d8 7246 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
7247 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
7248 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
7249 are replaced by b4_percent_code_provides and b4_percent_code_requires,
7250 which are skeleton-specific.
7251 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
7252 declare what %code qualifiers it supports and to complain if any other
7253 qualifiers were used in the grammar.
7254 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
7255 and b4_user_code([b4_percent_code_provides]) in place of
7256 b4_user_requires and b4_user_provides.
7257 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
7258 Add b4_user_code([b4_percent_code_top]) and
7259 b4_user_code([b4_percent_code]).
7260 Invoke b4_check_percent_code_qualifiers.
7261 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7262 PERCENT_REQUIRES): Remove.
7263 (grammar_declaration): Remove RHS's for %code-top, %provides, and
7264 %requires. Rewrite the %code RHS as the unqualified form defining the
7265 muscle b4_percent_code. Add another RHS for the qualified %code form,
7266 which defines muscles of the form b4_percent_code_QUALIFIER and the
7267 b4_used_percent_code_qualifiers muscle.
7268 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7269 PERCENT_REQUIRES): Remove.
7270 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
7271 %code "requires" and %code "provides".
7272 * tests/input.at (Reject bad %code qualifiers): New.
7273
95021767
JD
72742007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7275
7276 Use the new code_props interface for destructors and printers.
7277 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
7278 printer_location members, and change the type of the destructor and
7279 printer members to code_props.
7280 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
7281 symbol_printer_get, semantic_type_destructor_set,
7282 semantic_type_printer_set, default_tagged_destructor_set,
7283 default_tagless_destructor_set, default_tagged_printer_set,
7284 default_tagless_printer_set): Use code_props in arguments and return
7285 types in place of char const * and location.
7286 (symbol_destructor_location_get, symbol_printer_location_get): Remove
7287 since the locations are now contained in the return of
7288 symbol_destructor_get and symbol_printer_get.
7289 * src/output.c (symbol_destructors_output, symbol_printers_output):
7290 Replace with...
7291 (symbol_code_props_output): ... this to eliminate duplicate code.
7292 (output_skeleton): Update to use symbol_code_props_output.
7293 * src/reader.c (symbol_should_be_used): Update use of
7294 symbol_destructor_get.
7295 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7296 Update uses of the various _destructor_set and _printer_set functions.
7297 * src/symtab.c: (default_tagged_destructor_location,
7298 default_tagless_destructor_location, default_tagged_printer_location,
7299 default_tagless_printer_location): Remove since we...
7300 (default_tagged_destructor, default_tagless_destructor,
7301 default_tagged_printer, default_tagless_printer): ... change the type
7302 of these to code_props.
7303 (symbol_new, semantic_type_new, symbol_destructor_set,
7304 semantic_type_destructor_set, symbol_destructor_get,
7305 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
7306 symbol_check_alias_consistency, default_tagged_destructor_set,
7307 default_tagless_destructor_set, default_tagged_printer_set,
7308 default_tagless_printer_set): Update.
7309 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
7310 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
7311 code_props members.
7312 (symbol_print): Use SYMBOL_CODE_PRINT.
7313
f6857bbf
JD
73142007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7315
7316 Use the new code_props interface for rule actions.
7317 * src/symlist.h (symbol_list): Replace action, action_location, and
7318 used members with a code_props action_props member.
7319 * src/reader.c (symbol_should_be_used, grammar_rule_check,
7320 grammar_midrule_action, grammar_current_rule_merge_set,
7321 grammar_current_rule_symbol_append, packgram): Update.
7322 * src/scan-code.h (translate_rule_action): Remove, no longer used.
7323 * src/scan-code.l (handle_action_dollar): Update.
7324 (translate_rule_action): Remove, no longer used.
7325 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
7326
7c0c6181
JD
73272007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7328
7329 Use the new code_props interface in parse-gram.y.
7330 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
7331 Update all uses of translate_* functions to use the new code_props
7332 interface and to use gram_scanner_last_string_free and
7333 code_scanner_last_string_free where possible.
7334 (grammar_declaration): symbol_list_destructor_set and
7335 symbol_list_printer_set now perform the translation, so don't do it
7336 here. Use gram_scanner_last_string_free where possible.
7337 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
7338 translate_code): Remove, no longer used.
7339 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
7340 symbol_list_printer_set): Perform code translation here rather than
7341 depending on the caller to do so.
7342
7343 * src/symlist.h (struct symbol_list): Correct some documentation typos.
7344 * src/scan-gram.h (gram_last_string): Remove declaration.
7345 * src/scan-gram.l (last_string): Declare it static.
7346
28e52c0d
JD
73472007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7348
7349 Encapsulate code properties and related functionality for the various
7350 destructors, printers, and actions into a code_props structure and
7351 interface. This patch merely implements code_props in scan-code.h and
7352 scan-code.l. Future patches will rewrite other modules to use it.
7353 Discussed starting at
7354 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
7355 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
7356 consistently initialize const structs that have an empty location
7357 field.
7358 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
7359 to ensure consistency.
7360 * src/scan-code.h (code_props): New structure.
7361 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
7362 function, macro, and const global variable for initializing a
7363 code_props with no code.
7364 (code_props_plain_init, code_props_symbol_action_init,
7365 code_props_rule_action_init, code_props_translate_code): The rest of
7366 the new code_props functional interface. Among other things, the init
7367 functions set the code_props kind field so that
7368 code_props_translate_code will know whether to behave like
7369 translate_symbol_action, translate_rule_action, or translate_code.
7370 These old translate functions must remain until all other modules are
7371 updated to use the new code_props interface.
7372 (code_scanner_last_string_free): New function similar to
7373 gram_scanner_last_string_free.
7374 (code_scanner_free): Add documentation.
7375 * src/scan-code.l: Implement the new interface.
7376 (code_lex): Make it static, add a code_props* argument, and remove the
7377 rule argument.
7378 (last_string): New static global similar to the one in scan-gram.l.
7379 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
7380 instead of rule.
7381 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
7382 code_props since Bison may one day use this information for destructors
7383 and printers.
7384 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
7385 (handle_action_dollar): Use symbol_list_n_get and set used flag
7386 directly since symbol_list_n_used_set is removed.
7387 (translate_action): Add a code_props* argument and remove the rule,
7388 action, and location arguments. Pass the code_props* on to code_lex.
7389 (translate_rule_action, translate_symbol_action, translate_code):
7390 Rewrite as wrappers around the new code_props interface.
7391 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
7392 it would eventually need to break the encapsulation of code_props.
7393
96034983
JD
73942007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7395
7396 * etc/.cvsignore: New.
7397
945e396c
JD
73982007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7399
7400 Add maintainer-push-check to run maintainer-check using push parsing in
7401 place of pull parsing where available.
7402 * Makefile.am (maintainer-push-check): New.
7403 * data/bison.m4 (b4_use_push_for_pull_if): New.
7404 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
7405 appropriately based on their existing values.
7406 (yypush_parse): Don't print push-parser-specific diagnostics if push
7407 parsing is being used in place of pull parsing.
7408 * data/yacc.c: If push parsing should replace pull parsing, redirect to
7409 push.c.
7410 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
7411 variable, and insert b4_use_push_for_pull_flag into muscles.
7412 * tests/Makefile.am (maintainer-push-check): New.
7413
7d596384
JD
74142006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7415
7416 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
7417 (whether successful or failed) so that yypush_parse can be invoked
7418 again to start a new parse using the same yypstate.
7419 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
7420 check multiple yypull_parse invocations on the same yypstate. For pull
7421 mode, extend to check multiple yyparse invocations.
7422 (Exploding the Stack Size with Alloca): Extend to try with
7423 %push-pull-parser.
7424 (Exploding the Stack Size with Malloc): Likewise.
7425
7426 * tests/calc.at (Simple LALR Calculator): Don't specify
7427 %skeleton "push.c" since %push-pull-parser implies that now.
7428 * tests/headers.at (export YYLTYPE): Don't check for the push
7429 declarations. Otherwise, this test case can't be used to see if push
7430 mode can truly emulate pull mode.
7431 * tests/input.at (Torturing the Scanner): Likewise.
7432 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
7433 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
7434 AT_YACC_IF, which now includes the case of push mode since %skeleton
7435 need not be used for push mode. This will be more intuitive once
7436 push.c is renamed to yacc.c.
7437
7172e23e
JD
74382006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7439
7440 For push mode, convert yyparse from a macro to a function, invoke yylex
7441 instead of passing a yylexp argument to yypull_parse, and don't
7442 generate yypull_parse or yyparse unless %push-pull-parser is declared.
7443 Discussed starting at
7444 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
7445 * data/bison.m4 (b4_pull_if): New.
7446 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
7447 * data/push.c: Improve M4 quoting a little.
7448 (b4_generate_macro_args, b4_parenthesize): Remove.
7449 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
7450 any time a pull parser is requested.
7451 Don't #define this as a wrapper around yypull_parse. Instead, when
7452 both push and pull are requested, make it a function that does that
7453 same thing.
7454 (yypull_parse): If there's a b4_prefix, #define this to
7455 b4_prefix[pull_parse] when both push and pull are requested.
7456 Don't define this as a function unless both push and pull are
7457 requested.
7458 Remove the yylexp argument and hard-code yylex invocation instead.
7459 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
7460 %push-parser.
7461 * src/getargs.c (pull_parser): New global initialized to true.
7462 * getargs.h (pull_parser): extern it.
7463 * src/output.c (prepare): Insert pull_flag muscle.
7464 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
7465 (prologue_declaration): Set both push_parser and pull_parser = true for
7466 %push-pull-parser. Set push_parser = true and pull_parser = false for
7467 %push-parser.
7468 * src/scan-gram.l: Don't accept %push_parser as an alternative to
7469 %push-parser since there's no backward-compatibility concern here.
7470 Scan %push-pull-parser.
7471 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
7472 instead of %push-parser.
7473 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
7474 prototype it in the module that calls yyparse.
7475 * tests/input.at (Torturing the Scanner): Likewise.
7476 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
7477
2e7944cb
JD
74782006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
7479
7480 Update etc/bench.pl. Optimize push mode a little (the yyn change
7481 deserves most of the credit).
7482 * Makefile.am (SUBDIRS): Add etc subdirectory.
7483 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
7484 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
7485 yytoken, yyval, and yyloc declarations to...
7486 (yyparse or yypush_parse): ... here to improve performance. For
7487 yypush_parse invocations after the first, be sure to assign yyn its old
7488 value again.
7489 (yypstate_new): Don't bother initializing the yyresult field since the
7490 initial value isn't used.
7491 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
7492 remove the #define that, in push mode, set it to yyps->NAME.
7493 * etc/Makefile.am: New.
7494 * etc/bench.pl: Remove and build it instead from...
7495 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
7496 "tests/bison" from the build directory by default rather than just
7497 invoking "bison" from $PATH.
7498 (calc_grammar): Update push parser code: don't declare yylval globally,
7499 don't define yyparse_wrapper, and don't #define yyparse.
7500 (bench_grammar): Update to check all working combinations of yacc.c,
7501 push.c, impure, pure, pull, and push.
7502
c3d50342
JD
75032006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7504
7505 For push mode, add pull wrappers around yypush_parse.
7506 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
7507 (yypull_parse): New function wrapping yypush_parse.
7508 (yyparse): New #define wrapping yypull_parse.
7509 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
7510 is declared.
7511 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
7512 prototype yylex in the module that calls yyparse, and don't prototype
7513 yyparse there. Otherwise, the yyparse expansion won't compile.
7514 * tests/input.at (Torturing the Scanner): Likewise.
7515
94ebeba5
JD
75162006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7517
7518 Enable push parsers to operate in impure mode. Thus, %push-parser no
7519 longer implies %pure-parser. The point of this change is to move
7520 towards being able to test the push parser code by running the entire
7521 test suite as if %push-parser had been declared.
7522 * data/push.c (yypush_parse): For impure mode, remove the
7523 yypushed_char, yypushed_val, and yypushed_loc arguments.
7524 Instead, declare these as local variables initialized to the global
7525 yychar, yylval, and yylloc.
7526 For the first yypush_parse invocation only, restore the initial values
7527 of these global variables when it's time to read a token since they
7528 have been overwritten.
7529 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
7530 %push-parser.
7531 * tests/calc.at (Simple LALR(1) Calculator): Always declare
7532 %pure-parser along with %push-parser since this test case was designed
7533 for pure push parsers.
7534 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
7535 (AT_YACC_OR_PUSH_IF): New.
7536 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
7537 add a note that it's still wrong for some cases (as it has been for a
7538 while).
7539 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
7540 %push-parser no longer implies %pure-parser.
7541
a0633178
JD
75422006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7543
7544 Remove some unnecessary differences between the pull parser code and
7545 the push parser code. This patch enables yynerrs in push mode.
7546 * data/push.c: Reformat M4 a little.
7547 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
7548 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
7549 because push mode is on. Instead, if pure mode is on, move yynerrs
7550 to...
7551 (b4_declare_parser_state_variables): ... here.
7552 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
7553 to yyps->NAME so it can be used in yypush_parse.
7554 (yypush_parse): Don't omit uses of yynerrs in push mode.
7555
8646b6a3
JD
75562006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7557
7558 Fix bug such that the first pushed token's value and location are
7559 sometimes overwritten (sometimes by %initial-action) before being used.
7560 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
7561 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
7562 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
7563 more closely mimic the pull parser logic.
7564 Don't copy the pushed token to yychar, yylval, and yylloc until it's
7565 time to read a token, which is after any initialization of yylval and
7566 yylloc.
7567 (gottoken): Rename label to...
7568 (yyread_pushed_token): ... for clarity and to avoid infringing on the
7569 user namespace.
7570
9baf4d74
JD
75712006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7572
7573 Rearrange initialization of the parser state variables so that the
7574 skeleton doesn't have to have a copy for pull mode and another for push
7575 mode. This patch also fixes at least a bug such that yylloc was not
7576 initialized (with b4_location_initial_line and
7577 b4_location_initial_column) upon calling yypush_parse. However, that
7578 initialization now overwrites the first token's location;
7579 %initial-action assigning @$ already did the same thing, and both bugs
7580 will be fixed in a later patch.
7581 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
7582 (b4_declare_parser_state_variables): Remove initialization of yytoken,
7583 yyss, yyvs, yyls, and yystacksize.
7584 (yypstate_new): Remove initialization of some yypstate fields: yystate,
7585 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
7586 yylsp.
7587 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
7588 yyps->NAME so it can be used in yypush_parse.
7589 (yyparse or yypush_parse): For yypush_parse, don't print the
7590 "Starting parse" diagnostic for invocations after the first.
7591 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
7592 yypush_parse, only do it for the first invocation.
7593 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
7594 initialization to occur in yypush_parse but only on the first
7595 invocation.
7596
23522164
JD
75972006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7598
7599 * data/push.c: Add CPP guards around push parser declarations in both
7600 the header and the code file.
7601 In the code file, move the push parser declarations to the same place
7602 they appear in the header file.
7603 Clean up the M4 some, especially the inconsistent underquoting in
7604 some b4_c_function_def and b4_c_function_decl uses.
7605
bb010fe5
JD
76062006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7607
7608 Encapsulate the push parser state variables into an M4 macro so the
7609 push skeleton doesn't have to list them again for pull mode's yyparse.
7610 For push mode, remove yypush_parse's local equivalents of these
7611 variables to eliminate unnecessary copying between the two sets at
7612 run-time. This patch also fixes at least a bug related to multiple
7613 %initial-action invocations in push mode.
7614 * data/push.c (b4_declare_parser_variables): Rename to...
7615 (b4_declare_scanner_communication_variables): ... this for clarity and
7616 update both uses.
7617 (b4_declare_yyparse_variables): Remove and move its contents to the one
7618 spot where it was invoked.
7619 (b4_declare_parser_state_variables): New macro containing the parser
7620 state variables required by push mode.
7621 (struct yypstate): Replace all fields but yynew with
7622 b4_declare_parser_state_variables.
7623 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
7624 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
7625 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
7626 (yyparse or yypush_parse): For yyparse in pull mode, replace local
7627 parser state variable declarations with
7628 b4_declare_parser_state_variables.
7629 Don't initialize parser state variables when calling yypush_parse since
7630 yypstate_new already does that.
7631 Invoke the user's initial action only upon the first yypush_parse
7632 invocation.
7633 Remove all code that copies between the local parser state variables
7634 and the yypstate.
7635
2d212f8c
JD
76362006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7637
7638 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
7639 prevent a name collision in a future patch where these names will
7640 sometimes be #define'd.
7641 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
7642 since it no longer has the same name as the existing argument.
7643 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
7644
e6e704dc
JD
76452006-12-19 Paolo Bonzini <bonzini@gnu.org>
7646 and Joel E. Denny <jdenny@ces.clemson.edu>
7647
7648 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
7649 that the argument is case-insensitive, and there's no `=' here.
7650 For the %skeleton entry, mention that %language is better.
7651 (Bison Options): Likewise for --language and --skeleton. Move the
7652 --skeleton entry so that the `Tuning the parser' section is sorted
7653 alphabetically on long options.
7654 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
7655 %language directive in detail here; cross-reference the %language
7656 documentation instead.
7657 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
7658 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 7659 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
7660 * examples/extexi (normalize): Instead of replacing every %require
7661 argument with the current Bison version, just substitute for
7662 `@value{VERSION}'. This guarantees that we're testing what actually
7663 appears in the documentation.
7664 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
7665 rather than `@VERSION@'.
7666
0e021770
PE
76672006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7668
fd575f05
PE
7669 * NEWS: Reword the %language news a bit, and put it earlier.
7670
0e021770
PE
7671 * src/getargs.c (skeleton_arg): Last arg is now location const *.
7672 Rewrite to simplify the logic.
7673 (language_argmatch): Likewise.
fd575f05
PE
7674 (program_name): We now own this var.
7675 * src/getargs.h (struct bison_language): Use char[] rather than
7676 const char *.
0e021770
PE
7677
7678 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
7679 Java is supported.
7680 * src/complain.c (program_name): Remove decl; no longer needed.
7681 * src/main.c (program_name): Remove; now belongs to getargs.
7682
76832006-12-18 Paolo Bonzini <bonzini@gnu.org>
7684
7685 * NEWS: Document %language.
7686
7687 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
7688
7689 * data/c-skel.m4, data/c++-skel.m4: New files.
7690 * data/glr.c: Complain on push parsers.
7691
7692 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
7693 over %skeleton.
148d66d8 7694 (Decl Summary): Document %language and %skeleton.
0e021770
PE
7695 (Command line): Document -L.
7696
7697 * examples/extexi: Rewrite %require directive.
7698 * examples/calc++/Makefile.am: Pass VERSION to extexi.
7699
7700 * src/files.c (compute_exts_from_gc): Look in language structure
7701 for .y extension.
7702 (compute_file_name_parts): Check whether .tab should be added.
7703 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
7704 (language, skeleton_arg, language_argmatch): New.
7705 (long_options): Add --language.
7706 (getargs): Use skeleton_arg, add -L/--language.
7707 * src/getargs.h: Include location.h.
7708 (struct bison_language, language, skeleton_arg, language_argmatch): New.
7709 * src/output.c (prepare): Pick default skeleton from struct language.
7710 Don't dispatch C skeletons here.
7711 * src/parse-gram.y (PERCENT_LANGUAGE): New.
7712 (prologue_declaration): Add "%language" rule, use skeleton_arg.
7713 * src/scan-gram.l ("%language"): New rule.
7714
7715 * tests/calc.at: Test %skeleton and %language.
7716 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
7717 (AT_GLR_IF): Look for %skeleton "glr.cc".
7718 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
7719 (AT_YACC_IF): Reject %language.
7720
5691bf57
PE
77212006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7722
db06f0ce
PE
7723 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
7724 since it wasn't used; only the typedef name 'semantic_type' is needed.
7725 Also, omit trailing white space.
7726
5691bf57
PE
7727 * bootstrap: Sync from coreutils.
7728 (gnulib_extra_files): Add build-aux/announce.gen.
7729 (slurp): Adjust .gitignore files like .cvsignore files.
7730 * build-aux/announce-gen: Remove from CVS, since bootstrap
7731 now creates this.
7732
791934e4
JD
77332006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
7734
7735 Make %push-parser imply %pure-parser. This fixes several bugs; see
7736 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
7737 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
7738 pure_parser = true.
7739 * data/push.c: Don't bother testing b4_push_if when deciding whether
7740 to expand b4_declare_parser_variables globally.
7741 (yypush_parse): Likewise in here.
7742
7743 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
7744 (yy_reduce_print): Reformat M4 for readability.
7745
ee5abb37
JD
77462006-12-15 Bob Rossi <bob@brasko.net>
7747 and Joel Denny <jdenny@ces.clemson.edu>
7748
7749 * data/push.c (yypstate): Add typedef, and update all uses of
7750 struct yypstate to just yypstate.
7751 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
7752
16ca01f9
JD
77532006-12-14 Bob Rossi <bob@brasko.net>
7754
7755 * data/push.c (yypush_parse): Declare prototype regardless of
7756 %locations option.
7757
ab8e7e1a
JD
77582006-12-14 Bob Rossi <bob@brasko.net>
7759
7760 * data/push.c (yyparse): Remove the prototype and the #define when in
7761 push-parser mode.
7762
9bf32be3
JD
77632006-12-13 Bob Rossi <bob@brasko.net>
7764
7765 * data/push.c (yypstate_init): Rename to...
7766 (yypstate_new): ... this and use b4_c_function_def.
7767 (yypstate_delete): New.
7768 (yypush_parse): Change parameters yynval and yynlloc to be const.
7769 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
7770 yypstate_delete functions.
7771
f02e2948
JD
77722006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
7773
7774 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
7775 strange test case titles. Reported by Bob Rossi.
7776
38eb7751
PE
77772006-12-13 Paul Eggert <eggert@cs.ucla.edu>
7778
7779 * TODO: Add pointer to Sylvain Schmitz's work on static detection
7780 of potential ambiguities in GLR grammers.
7781
bd9d212b
JD
77822006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
7783
7784 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
7785 `bison ', use m4_index instead of m4_substr since chopping up a string
7786 containing M4-special characters causes problems here.
7787
7788 Fix a couple of bugs related to special characters in user-specified
7789 file names, and make it easier for skeletons to compute output file
7790 names with the same file name prefix as Bison-computed output file
7791 names.
7792 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
7793 b4_parser_file_name and b4_spec_defines_file instead of
7794 @output_parser_name@ and @output_header_name@, which are now redundant.
7795 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
7796 b4_parser_file_name, b4_spec_defines_file, and the new
7797 @basename(FILENAME@) instead of @output_parser_name@ and
7798 @output_header_name@, which inappropriately escaped the file names as
7799 C string literals.
7800 * src/files.c (all_but_ext): Remove static qualifier.
7801 (compute_output_file_names): Move `free (all_but_ext)' to...
7802 (output_file_names_free): ... here since all_but_ext is needed later.
7803 * src/files.h (all_but_ext): Extern.
7804 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
7805 exactly what MUSCLE_INSERT_STRING used to do.
7806 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
7807 characters are escaped properly.
7808 * src/output.c (prepare): Define muscle file_name_all_but_ext as
7809 all_but_ext.
7810 For pkgdatadir muscle, maintain previous functionality by using
7811 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
7812 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
7813 digraphs would never be expanded. Hopefully no one has M4-special
7814 characters in his Bison installation path.
7815 * src/scan-skel.l: Don't parse @output_header_name@ and
7816 @output_parser_name@ anymore since they're now redundant.
7817 In @output, use decode_at_digraphs.
7818 Parse a new @basename command that invokes last_component.
7819 (decode_at_digraphs): New.
7820 (BASE_QPUTS): Remove unused.
7821 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
7822 (Output file name): New tests.
7823
3f7ca628
JD
78242006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
7825
7826 Warn about output files that are generated by the skeletons and that
7827 conflict with other output files.
7828 * data/glr.c: Don't generate the header file here when glr.cc does.
7829 * src/files.c (file_names, file_names_count): New static globals.
7830 (compute_output_file_names): Invoke output_file_name_check for files
7831 not generated by the skeletons and remove existing checks.
7832 (output_file_name_check): New function that warns about conflicting
7833 output file names.
7834 (output_file_names_free): Free file_names.
7835 * src/files.h (output_file_name_check): Declare.
7836 * src/scan-skel.l: Invoke output_file_name_check for files generated by
7837 the skeletons.
7838 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
7839 (Conflicting output files): New tests.
7840
178e123e
PE
78412006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7842
7843 * doc/bison.texinfo: Fix a couple of typos.
7844
78452006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
7846
7847 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
7848 Rename to...
7849 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
7850 update all uses.
7851 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
7852 (yypush_parse): Rename yypvars argument to yyps and remove redundant
7853 local pv.
7854 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
7855 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
7856
ea17f233
JD
78572006-12-07 Bob Rossi <bob@brasko.net>
7858 and Joel Denny <jdenny@ces.clemson.edu>
7859
7860 * data/push.c (yypvarsinit): Change return type from void* to struct
7861 yypvars*. No longer cast to void* on return.
7862 (struct yypvars): Remove yylen since it need not be remembered between
7863 yypushparse invocations.
7864 (yypushparse): Don't copy between yylen and pv->yylen.
7865
55a30bda
JD
78662006-12-05 Bob Rossi <bob@brasko.net>
7867
7868 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
7869 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
7870 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
7871 (struct yypvars): Remove b4_declare_parser_variables.
7872 (yypvarsinit): Remove init code for removed variables.
7873 (global scope): Do not declare b4_declare_parser_variables if
7874 push or pure mode.
7875 (yypushparse): Add b4_declare_parser_variables.
7876 Init new local variables, and remove init code for removed
7877 yypvars variables.
7878 (yyparse): Delete.
7879 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
7880 and yyparse for other modes.
7881 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
7882 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
7883 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
7884 (AT_PURE_LEX_IF): True if pure or push parser.
7885
85894313
JD
78862006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
7887
7888 Document Yacc prologue alternatives and default %destructor's and
7889 %printer's as experimental. Don't mention Java yet. Discussed at
7890 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
7891 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
7892 (2.3a): Annotate this entry to say the old forms of these features were
7893 also experimental.
7894 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 7895 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
7896 of Java (we'll want this back eventually).
7897
02975b9a
JD
78982006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
7899
7900 Support a file name argument to %defines. Deprecate `=' in
7901 %file-prefix, %name-prefix, and %output. Discussed at
7902 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
7903 * NEWS (2.3a+): Mention.
148d66d8 7904 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
7905 form of %defines, and remove `=' from entries for %file-prefix,
7906 %name-prefix, and %output.
7907 * src/parse-gram.y (prologue_declaration): Implement.
7908 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
7909 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
7910 all but one occurrence of %name-prefix.
7911 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
7912 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
7913 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
7914 occurrence of each of %file-prefix and %output. Add check for %defines
7915 with argument.
7916 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
7917 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
7918 Remove the `=' from %output.
7919
287b314e
JD
79202006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
7921
7922 Don't escape $ in test case titles since Autoconf 2.61 now does that
7923 correctly.
7924 * tests/actions.at (Default %printer and %destructor are not for error
7925 or $undefined): Here.
7926 (Default %printer and %destructor are not for $accept): Here.
7927 * tests/input.at (Invalid $n and @n): Here.
7928
3ebecc24
JD
79292006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
7930
7931 Rename <!> to <>. Discussed starting at
7932 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
7933 * NEWS (2.3a+): Update.
148d66d8 7934 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
7935 Update.
7936 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
7937 * src/scan-gram.l (INITIAL): Implement.
7938 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
7939 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
7940 comment.
7941 * tests/actions.at (Default tagless %printer and %destructor,
7942 Default tagged and per-type %printer and %destructor,
7943 Default %printer and %destructor are not for error or $undefined,
7944 Default %printer and %destructor are not for $accept,
7945 Default %printer and %destructor for mid-rule values): Update.
7946 * tests/input.at (Default %printer and %destructor redeclared,
7947 Unused values with default %destructor): Update.
7948
26b8a438
JD
79492006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
7950
7951 Don't let %prec take a nonterminal.
7952 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
7953 token.
7954 * tests/input.at (%prec takes a token): New test checking that %prec
7955 won't take a nonterminal.
7956
07c39ae9
JD
79572006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7958
405d53b7
JD
7959 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
7960 it was double-quoted.
07c39ae9
JD
7961 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
7962 grammar is maintained with Bison's highest standards.
7963 * src/getargs.c: Fix some typos in Doxygen comments.
7964
580b8926
JD
79652006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7966
7967 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
7968 later. Reported by Paul Eggert in
7969 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
7970 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
7971 * src/scan-code.l (translate_action): Don't bother invoking
7972 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
7973 (code_scanner_free): Instead of invoking
7974 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
7975 which frees more.
7976 * src/scan-gram.l (gram_scanner_free): Likewise.
7977 * src/scan-skel.l (scan_skel): Likewise.
7978
4502eadc
JD
79792006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
7980
7981 * src/files.c (tr): Change return type to void.
7982 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
7983 has been called previously for the same key.
7984 (muscle_find): Return storage instead of value so that
7985 --enable-gcc-warnings doesn't produce warnings that the return discards
7986 const. aver that the value and storage are the same since storage
7987 could potentially be NULL when value is not.
7988 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
7989 same as 0.
7990
7746c8f6
PE
79912006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7992
7993 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
7994 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
7995 us a slightly cleaner distribution, and also works.
7996 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
7997 gnulib changes.
7998
eb095650
PE
79992006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
8000 and Paul Eggert <eggert@cs.ucla.edu>
8001
8002 Don't let Bison leak memory except when it complains.
8003 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
8004 (spec_defines_file, dir_prefix): Now char *, not const char *,
8005 since they are freed.
8006 * src/files.c: Likewise.
8007 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
8008 Likewise.
8009 (tr): Now operates in-place. All uses changed.
8010 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
8011 values.
8012 (compute_file_name_parts, compute_output_file_names): Don't store
8013 read-only data in variables that will be freed.
8014 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
8015 src_extension, and header_extension.
8016 (output_file_names_free): New public function to free
8017 spec_verbose_file, spec_graph_file, spec_defines_file,
8018 parser_file_name, and dir_prefix.
8019 * src/getargs.c (getargs): Don't store read-only data in variables that
8020 will be freed.
8021 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
8022 (which previously existed but was unused), and quotearg_free.
8023 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
8024 * src/muscle_tab.c: Likewise.
8025 (muscle_entry): Make the value char const *,
8026 and add a new storage member that is char * and can be freed.
8027 (muscle_entry_free): New private function.
8028 (muscle_init): Use it instead of free.
8029 (muscle_insert, muscle_grow): Update and use new storage member.
8030 (muscle_code_grow): Free the string passed to muscle_grow
8031 since it's not needed anymore.
8032 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
8033 add a new `char *code' member.
8034 ("{...}"): Declare semantic type as code.
8035 * src/scan-code.h (translate_rule_action):
8036 (translate_symbol_action, translate_code, translate_action): Return
8037 `char const *' rather than `char *' since external code should not free
8038 these strings.
8039 * src/scan-code.l: Likewise.
8040 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
8041 which is "{...}" in the parser.
8042 * tests/Makefile.am (maintainer-check-valgrind): Set
8043 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
8044 Valgrind.
8045 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
8046 complain.
8047 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
8048 expecting a non-zero exit status sets --leak-check=summary and
8049 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
8050 this case, and we don't want to hear about it.
8051
ac564be4
PE
80522006-11-08 Paul Eggert <eggert@cs.ucla.edu>
8053
8054 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
8055 instead of from the template, to simplify configuration a bit.
8056 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
8057 and m4/wint_t.m4, as they are needed with the latest gnulib.
8058
17bd8a73
JD
80592006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8060
8061 Disable unset/unused mid-rule value warnings by default, and recognize
8062 --warnings=midrule-values to enable them. Discussed starting at
8063 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
8064 * NEWS (2.3a+): Mention.
8065 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
8066 warnings): Add entry for midrule-values subargument.
8067 * src/reader.c (symbol_should_be_used): Don't return true just because
8068 the value is a set/used mid-rule value unless
8069 --warnings=midrule-values was specified.
8070 * tests/input.at (Unused values, Unused values before symbol
8071 declarations): Run tests with and without --warnings=midrule-values.
8072
8073 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
8074 than LIST_FREE directly.
8075
89eb3c76
JD
80762006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8077
8078 Finish implementing --warnings=error, which should not be implied by
8079 --warnings=all (or by its synonyms -W and --warnings without
8080 subarguments).
8081 * src/complain.c (set_warning_issued): New function to report that
8082 warnings are being treated as errors and to record an error if so.
8083 Invoke...
8084 (warn_at, warn): ... here.
8085 * src/getargs.c (warnings_args, warnings_types): Reorder so that
8086 "error - warnings are errors" does not appear above "all - all of the
8087 above".
8088 (getargs): For -W and --warnings without subarguments, don't let
8089 FLAGS_ARGMATCH set warnings_error in warnings_flag.
8090 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
8091
ba7560e2
JD
80922006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8093
8094 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
8095 empty subargument list. For example: `bison --warnings= parser.y'.
8096
31283fc3
JD
80972006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8098
8099 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
8100 the parser header file so that gcc doesn't warn.
8101
12e35840
JD
81022006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8103
8104 Split the default %destructor/%printer into two kinds: <*> and <!>.
8105 Discussed starting at
8106 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
8107 * NEWS (2.3a+): Mention.
8108 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
8109 previous change today related to mid-rules.
148d66d8 8110 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 8111 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
8112 (TYPE_TAG_ANY): Add as <*>.
8113 (TYPE_TAG_NONE): Add as <!>.
8114 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
8115 for <*> and <!>.
8116 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
8117 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
8118 * src/symlist.c (symbol_list_default_new): Split into tagged and
8119 tagless versions.
8120 (symbol_list_destructor_set, symbol_list_printer_set): Split
8121 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
8122 SYMLIST_DEFAULT_TAGLESS.
8123 * src/symlist.h: Update symbol_list_default*_new prototypes.
8124 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
8125 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
8126 * src/symtab.c (default_destructor, default_destructor_location,
8127 default_printer, default_printer_location): Split each into tagged and
8128 tagless versions.
8129 (symbol_destructor_get, symbol_destructor_location_get,
8130 symbol_printer_get, symbol_printer_location_get): Implement tagged
8131 default and tagless default cases.
8132 (default_destructor_set, default_printer_set): Split each into tagged
8133 and tagless versions.
8134 * src/symtab.h: Update prototypes.
8135 * tests/actions.at (Default %printer and %destructor): Rename to...
8136 (Default tagless %printer and %destructor): ... this, and extend.
8137 (Per-type %printer and %destructor): Rename to...
8138 (Default tagged and per-type %printer and %destructor): ... this, and
8139 extend.
8140 (Default %printer and %destructor for user-defined end token): Extend.
8141 (Default %printer and %destructor are not for error or $undefined):
8142 Update.
8143 (Default %printer and %destructor are not for $accept): Update.
8144 (Default %printer and %destructor for mid-rule values): Extend.
8145 * tests/input.at (Default %printer and %destructor redeclared): Extend.
8146 (Unused values with default %destructor): Extend.
8147
f91b1629
JD
81482006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8149
8150 Don't apply the default %destructor/%printer to an unreferenced midrule
8151 value. Mentioned at
8152 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
8153 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
8154 like $@n instead of just @n so that the default %destructor/%printer
8155 logic doesn't see them as user-defined symbols.
8156 (symbol_is_dummy): Check for both forms of the name.
8157 * src/reader.c (packgram): Remove the `$' from each midrule symbol
8158 name for which the midrule value is referenced in any action.
8159 * tests/actions.at (Default %printer and %destructor for mid-rule
8160 values): New test.
8161 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
8162 for change to dummy symbol names.
8163
519d0004
JD
81642006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
8165
8166 Warn about unset midrule $$ if the corresponding $n is used.
8167 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
8168 $n usage.
8169 (packgram): Before invoking grammar_rule_check on any rule, make sure
8170 all actions have already been scanned in order to set `used' flags.
8171 Otherwise, checking that a midrule's $$ is set will not always work
8172 properly because the midrule check must forward-reference the midrule's
8173 parent rule.
8174 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
8175 warning.
8176
a501eca9
JD
81772006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
8178
8179 More improvements to the documentation of the prologue alternatives:
8180 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
8181 Bison manual.
8182 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
8183 some text to clarify the relative importance of the new directives and
8184 to show how these directives may be viewed as code labels.
8185
2cbe6b7f
JD
81862006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
8187
8188 Similar to the recently removed %before-header, add %code-top as the
8189 alternative to the pre-prologue. Mentioned at
8190 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
8191 Also, let the prologue alternatives appear in the grammar section.
8192 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
8193 (prologue_declaration): Move the existing prologue alternatives to...
8194 (grammar_declaration): ... here and add %code-top.
8195 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
8196
8197 Clean up and extend documentation for the prologue alternatives.
8198 * NEWS (2.3a+): Describe prologue alternatives.
8199 * doc/bison.texinfo (Prologue): Move discussion of prologue
8200 alternatives to...
8201 (Prologue Alternatives): ... this new section, and extend it to discuss
8202 all 4 directives in detail.
148d66d8
JD
8203 (Table of Symbols): Clean up discussion of prologue alternatives and
8204 add %code-top.
2cbe6b7f 8205
e557d3ea
JMG
82062006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8207
8208 DJGPP specific issues.
8209
8210 * djgpp/config.bat: config.hin has been moved to lib. Adjust
8211 config.bat accordingly.
8212 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
8213 * djgpp/config.site: Likewise.
8214
136a0f76
PB
82152006-10-16 Paolo Bonzini <bonzini@gnu.org>
8216
27bd5d67
PB
8217 Replace %*-header with %provides, %requires, %code. See discussion at
8218 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
8219
136a0f76
PB
8220 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
8221 (b4_user_start_header): Remove.
8222 * data/glr.c: Use new macros instead of b4_*start_header
8223 and b4_*end_header.
8224 * data/glr.cc: Likewise.
8225 * data/lalr1.cc: Likewise.
8226 * data/push.c: Likewise.
8227 * data/yacc.c: Likewise.
8228
8229 * doc/bison.texinfo: Remove %before-header, rename
8230 %{start,end,after}-header to %requires, %provides, %code.
8231
8232 * src/parse-gram.y: Likewise (also rename token names accordingly).
8233 * src/scan-gram.l: Likewise.
8234 * tests/actions.at: Likewise.
8235
10f429ef
PE
82362006-10-14 Paul Eggert <eggert@cs.ucla.edu>
8237
8238 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
8239 Problem reported by Joel E. Denny.
8240
82412006-10-14 Jim Meyering <jim@meyering.net>
8242
8243 (Sync from coreutils.)
8244 Work also when the working directory (with e.g. coreutils sources)
8245 is version controlled with git, rather than CVS.
8246 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
8247 rather than CVS.
8248 In messages and comments, say e.g., "checked-out sources",
8249 rather than "CVS sources".
8250 (version_controlled_file): New function. Work for git as well as
8251 for CVS. Don't use grep's -q option.
8252 (slurp): Call it here, in place of CVS-specific code.
8253
c4bd5bf7
JD
82542006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
8255
8256 Fix testsuite for ./configure --enable-gcc-warnings:
8257 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
8258 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
8259 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
8260 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
8261 * test/regression.at (Diagnostic that expects two alternatives):
8262 Likewise.
8263
46356ea4
PE
82642006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8265
231ed89a
PE
8266 * bootstrap.conf (gnulib_modules): Add config-h.
8267 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
8268 worry about HAVE_CONFIG_H.
8269 * lib/abitset.c: Likewise.
8270 * lib/bitset.c: Likewise.
8271 * lib/bitset_stats.c: Likewise.
8272 * lib/bitsetv-print.c: Likewise.
8273 * lib/bitsetv.c: Likewise.
8274 * lib/ebitset.c: Likewise.
8275 * lib/get-errno.c: Likewise.
8276 * lib/lbitset.c: Likewise.
8277 * lib/subpipe.c: Likewise.
8278 * lib/timevar.c: Likewise.
8279 * lib/vbitset.c: Likewise.
8280 * lib/bitset.c: Include "bitset.h" first, to test interface.
8281 * lib/bitset_stats.c: Include "bitset_stats.h" first.
8282 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
8283 * lib/bitsetv.c: Include "bitsetv.h" first.
8284 * lib/get-errno.c: Include "get-errno.h" first.
8285 * m4/.cvsignore: Add config-h.m4.
8286 * tests/actions.at (Default %printer and %destructor for ...):
8287 Adjust expected line numbers in output to reflect removal of #if
8288 HAVE_CONFIG_H lines.
8289 * tests/glr-regression.at (Missed %merge type warnings when ...):
8290 Likewise.
8291 * tests/regression.at (Braced code in declaration in rules section):
8292 Likewise.
8293 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
8294 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
8295 Include <config.h> unconditionally.
8296
46356ea4
PE
8297 * bootstrap: Sync from coreutils, as follows:
8298
8299 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8300
8301 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
8302 variable was sometimes used without being initialized. This
8303 messed up the installation of the INSTALL file in some cases.
8304
8305 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8306
8307 * bootstrap (usage, main program, symlink_to_gnulib): Add option
8308 --copy. Inspired by a suggestion from Bruno Haible.
8309
8310 2006-10-03 Jim Meyering <jim@meyering.net>
8311
8312 * bootstrap: Undo last change to this file, since now gnulib-tool
8313 sticks with the automake default in generating dependencies.
8314
dd4bf078
PE
83152006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8316
cf2a5f7c
PE
8317 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
8318 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
8319
8320 * doc/bison.1: Add copyright notice.
8321
8322 * data/glr.c: Don't include <stdarg.h>; not used.
8323
35fe0834
PE
8324 * NEWS: The -g and --graph options now output graphs in Graphviz
8325 DOT format, not VCG format.
8326 * doc/bison.1: Likewise.
8327 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
8328 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
8329 of this change in
8330 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
8331 * TODO: Remove Graphviz entry.
8332 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
8333 remove vcg.c, vcg.h, vcg_defaults.h.
8334 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
8335 * src/graphviz.c, src/graphviz.h: New files.
8336 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
8337 * src/files.h: Make comment more generic.
8338 * src/main.c (main): Likewise.
8339 * src/print_graph.h: Likewise.
8340 * src/getargs.c (usage): Make usage description more generic.
8341 * src/print_graph.c: Include graphviz.h rather than vcg.h.
8342 (static_graph, fgraph): Remove. All uses changed to pass
8343 arguments instead of sharing a static var.
8344 (print_core, print_actions, print_state, print_graph):
8345 Output graphviz format rather than VCG format.
8346 * tests/.cvsignore: Remove *.vcg; add *.dot.
8347 * tests/output.at: Expect *.dot files, not *.vcg files.
8348
dd4bf078
PE
8349 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
8350 accommodates the 2006-10-08 change.
8351
efdd7421
PE
83522006-10-11 Bob Rossi <bob@brasko.net>
8353
8354 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
8355 (b4_yyssa, b4_yyerror_range): New macros.
8356 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
8357 (yypvarsinit): Remove init of removed fields.
8358 (yypushparse): Remove use of removed fields; use new macros instead.
8359
96a1981a
PE
83602006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8361
8362 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
8363 in a push parser. Reindent slightly to match yacc.c better.
8364
83652006-10-11 Bob Rossi <bob@brasko.net>
8366
46356ea4
PE
8367 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
8368 yymsg_alloc fields.
8369 (yypvarsinit, yypushparse): Remove init of removed fields.
8370 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 8371
c1630a8b
PE
83722006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8373
8374 * THANKS: Add Paolo Bonzini and Bob Rossi.
8375
90b9908d
PB
83762006-10-08 Paolo Bonzini <bonzini@gnu.org>
8377
8378 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
8379 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
8380 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
8381 b4_define_user_cde and uses): Remove.
8382 (b4_comment, b4_prefix, b4_sync_start): New.
8383 * data/bison.m4: New file, with most of the content removed from c.m4.
8384 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
8385 * src/output.c (output_skeleton): Pass bison.m4.
8386 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
8387 only if specified.
8388
cf806753
PE
83892006-10-05 Paul Eggert <eggert@cs.ucla.edu>
8390
8391 Fix test failure reported by Tom Lane in
8392 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
8393 and try to make such failures easier to catch in the future.
8394 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
8395 that's now the caller's responsibility.
8396 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
8397 Set yychar = YYEOF if it's negative.
8398 * tests/actions.at (yylex): Abort if asked to read past EOF.
8399 * tests/conflicts.at (yylex): Likewise.
8400 * tests/cxx-type.at (yylex): Likewise.
8401 * tests/glr-regression.at (yylex): Likewise.
8402 * tests/input.at (yylex): Likewise.
8403 * tests/regression.at (yylex): Likewise.
8404 * tests/torture.at (yylex): Likewise.
8405
0e2f006a
PE
84062006-10-01 Paul Eggert <eggert@cs.ucla.edu>
8407
8408 Fix problems with translating English-language diagnostics.
8409 * bootstrap: Fix bug introduced in recent bootstrap changes, with
8410 respect to bison-runtime pot generation. The YY_ stuff
8411 wasn't being captured.
8412 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
8413 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
8414 * runtime-po/POTFILES.in: Add data/push.c.
8415
e3ddc1e3
PE
84162006-09-29 Paul Eggert <eggert@cs.ucla.edu>
8417
8418 Merge bootstrap changes from coreutils.
8419
8420 2006-09-28 Jim Meyering <jim@meyering.net>
8421
8422 Automatically generated dependencies are important even
8423 when all of the sources in a directory come from gnulib.
8424 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
8425 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
8426
8427 2006-09-23 Jim Meyering <jim@meyering.net>
8428
8429 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
8430
8431 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8432
8433 * bootstrap: Add support for --force.
8434 (usage): New function. Describe usage less tersely.
8435 (CVS_only_file): New var.
8436
01e972b3
PE
84372006-09-21 Paul Eggert <eggert@cs.ucla.edu>
8438
8439 * data/push.c (YYPUSH_MORE): Make it an enum instead.
8440 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
8441 Adjust white space and comments to match GNU style better.
8442
c63d3e90
PE
84432006-09-20 Bob Rossi <bob@brasko.net>
8444
8445 * data/push.c (yyresult_get): Remove function.
8446 (YYPUSH_MORE): Add #define.
8447 (yypushparse): Modify return value.
8448
e70f46d1
PE
84492006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8450
8451 * stamp-h.in: Remove; no longer needed.
8452 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
8453 Remove config.h, config.hin, intl (no longer created).
8454 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
8455 stamp-h1.
8456
8457 Sync bootstrap from coreutils, as follows:
8458
8459 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
8460
8461 * bootstrap (symlink_to_gnulib): New function.
8462 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
8463 to copies-of-gnulib.
8464 (cp_mark_as_generated, slurp, gnulib_files):
8465 Avoid making a copy if it's the same as the old version.
8466 (gnulib_files): Add support for this variable (used by Bison).
8467
a92be413
PE
84682006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8469
8470 * src/getargs.c (usage): Rework to use conventions similar to
8471 coreutils, to make translation a bit easier and the code a bit
8472 smaller. Problem reported by Tim Van Holder.
8473
4f82b42a
PE
84742006-09-15 Paul Eggert <eggert@cs.ucla.edu>
8475
3b2942e6
PE
8476 Use some of gnulib's new modules, taken from coreutils.
8477
8478 * bootstrap: Sync from coreutils, except add support for gnulib_files.
8479 * bootstrap.conf: New file.
8480 (gnulib_modules): Add configmake, inttypes, unistd.
8481 (XGETTEXT_OPTIONS): Add complain, complain_at,
8482 fatal, fatal_at, warn, warn_at, unexpected_end.
8483 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
8484 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
8485 (gl_EARLY): Add.
8486 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
8487 (gl_INIT): Add
8488 (GNULIB_AUTOCONF_SNIPPET): Remove.
8489 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
8490 the pickiest.
8491 * lib/.cvsignore: Add inttypes_.h.
8492 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
8493 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
8494 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
8495 no-longer-necessary initializations.
8496 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
8497 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
8498 use the unistd module.
8499 * src/system.h: Likewise.
8500 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
8501 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
8502 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
8503 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
8504 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
8505 * src/system.h: Include inttypes.h unconditionally, now that we
8506 use the inttypes module. Don't bother to include stdint.h, since
8507 inttypes.h now does that for us.
8508 (LOCALEDIR): Remove, now that we use the configmake module.
8509 * src/getargs.c: Include configmake.h.
8510 * src/main.c: Likewise.
8511 * src/output.c: Likewise.
8512 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
8513 not from $abs_top_builddir, since config.h moved.
8514
8515
4f82b42a
PE
8516 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
8517 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
8518
8519 * src/parse-gram.y (symbol_declaration): Don't put statements
8520 before declarations; it's not portable to C89.
8521 * src/scan-code.l (handle_action_at): Likewise.
8522
8523 * src/scan-code.l: Always initialize braces_level; the old code
8524 left it uninitialized and therefore had undefined behavior.
8525
8526 Don't attempt to redefine 'assert', since it runs afoul of
8527 systems where standard headers (mistakenly) include <assert.h>.
8528 Instead, define and use our own alternative, called 'aver'.
8529 * src/reader.c: Don't include assert.h, since we no longer
8530 use assert.
8531 * src/scan-code.l: Likewise.
8532 * src/system.h (assert): Remove, replacing with....
8533 (aver): New function, taking a bool arg. All uses changed.
8534 * src/tables.c (pack_vector): Ensure that aver arg is bool,
8535 not merely an integer.
8536
31c10e38
PE
85372006-09-15 Bob Rossi <bob@brasko.net>
8538
d6bdb90a
JD
8539 Add support for push parsing. Based on the original work of
8540 Odd Arild Olsen <oao@fibula.no>.
31c10e38
PE
8541 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
8542 * data/c.m4 (YYPUSH): New.
8543 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
d6bdb90a 8544 * data/push.c: New file.
31c10e38
PE
8545 * src/getargs.c (push_parser): New var.
8546 * src/getargs.h (push_parser): New declaration.
8547 * src/output.c (prepare): Add macro insertion of `push_flag'.
8548 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
8549 (prologue_declaration): Parse %push-parser.
8550 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
8551 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
8552 list of removed lines from the traces observed.
8553 (AT_CHECK_CALC_LALR): Added push parser tests.
8554
fa7b79c0
PE
85552006-09-13 Paul Eggert <eggert@cs.ucla.edu>
8556
21fe08ca
PE
8557 * NEWS: Version 2.3a.
8558 * configure.ac (AC_INIT): Likewise.
8559
e8ec4d9b
PE
8560 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
8561 "#define YYSTYPE int" that caused "make maintainer-check" to fail
8562 due to header ordering dependencies. I don't know why the #define
8563 was there.
8564
fa7b79c0
PE
8565 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
8566 runtime cost when YYDEBUG is not defined, and so that some tests
8567 that used to fail now work. Problem and initial suggestion by
8568 Paolo Bonzini.
8569 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
8570 * data/glr.cc (b4_parser_class_name):
8571 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
8572 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
8573 (yydebug_) [YYDEBUG]: New member.
8574 (yycdebug_): Now defined only if YYDEBUG.
8575 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
8576 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
8577 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
8578 if YYYDEBUG.
8579 (debug_stream, set_debug_stream, debug_level, set_debug_level):
8580 Define only if YYDEBUG.
8581 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
8582 set_debug_level.
8583 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
8584 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
8585 AT_CHECK_CALC_GLR_CC that are working now.
8586
4ec13d60
PE
85872006-09-12 Paul Eggert <eggert@cs.ucla.edu>
8588
8589 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
8590 We don't need them in glr.cc, and glr.c defines them.
8591 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
8592 assumes that defining it to anything is the same as defining
8593 it to 1. Problem reported by Paolo Bonzini.
8594
8e1687ae
PE
85952006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
8596
8597 * data/c.m4 (b4_null, b4_case): Define.
8598 * src/output.c (prepare_symbols): Use b4_null.
8599 (user_actions_output): Use b4_case.
8600
3dc5e96b
PE
86012006-09-11 Paul Eggert <eggert@cs.ucla.edu>
8602
aef3da86
PE
8603 * data/glr.c (b4_shared_declarations): Put start-header first,
8604 before any #includes that we generate, so that feature-test
8605 macros work. Problem reported by Michael Deutschmann in
8606 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
8607 * data/lalr1.cc: Likewise.
8608 * doc/bison.texinfo (Prologue): Document that feature-test macros
8609 should be defined before any Bison declarations.
8610 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
8611 that depend on location.hh after, not before, Bison decls, since
8612 we now include location.hh after the first user prologue.
8613
3dc5e96b
PE
8614 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
8615 Sander Brandenburg in
8616 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
8617 Also, fix minor white space and comment issues.
aef3da86
PE
8618 (Prologue): Mention that it's better to define feature-test macros
8619 before Bison declarations. Problem reported by Michael Deutschmann.
8620
8621 * README-cvs: Fix typo: "&" should be "&&". Problem reported
8622 by Jim Meyering.
8623 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
8624 This adjusts to recent gnulib changes.
3dc5e96b 8625
b2a0b7ca
JD
86262006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8627
8628 Finish implementation of per-type %destructor/%printer. Discussed
8629 starting at
8630 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
8631 and
8632 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
8633 * NEWS (2.3+): Add a description of this feature to the default
8634 %destructor/%printer description.
8635 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
8636 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
8637 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
8638 list node contains a semantic type.
8639 * src/symtab.c, src/symtab.h: Extend with a table that associates
8640 semantic types with their %destructor's and %printer's.
8641 (semantic_type_from_uniqstr, semantic_type_get,
8642 semantic_type_destructor_set, semantic_type_printer_set): New functions
8643 composing the public interface of that table.
8644 (symbol_destructor_get, symbol_destructor_location_get,
8645 symbol_printer_get, symbol_printer_location_get): If there's no
8646 per-symbol %destructor/%printer, look up the per-type before trying
8647 the default.
8648 * tests/actions.at (Per-type %printer and %destructor): New test case.
8649 * tests/input.at (Default %printer and %destructor redeclared):
8650 Extend to check that multiple occurrences of %symbol-default in a
8651 single %destructor/%printer declaration is an error.
8652 (Per-type %printer and %destructor redeclared, Unused values with
8653 per-type %destructor): New test cases.
8654
3be03b13
JD
86552006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8656
8657 Require default %destructor/%printer to be declared using
8658 %symbol-default instead of an empty symbol list, and start working on
8659 new per-type %destructor/%printer. Discussed at
8660 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
8661 * NEWS (2.3+): Add %symbol-default to example.
8662 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 8663 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
8664 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
8665 (generic_symlist, generic_symlist_item): New nonterminals for creating
8666 a list in which each item is a symbol, semantic type, or
8667 %symbol-default.
8668 (grammar_declaration): Use generic_symlist in %destructor and %printer
8669 declarations instead of symbols.1 or an empty list.
8670 (symbol_declaration, precedence_declaration, symbols.1): Update actions
8671 for changes to symbol_list.
8672 * src/reader.c: Update for changes to symbol_list.
8673 * src/scan-code.l: Likewise.
8674 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
8675 * src/symlist.c, src/symlist.h: Extend such that a list node may
8676 represent a semantic type or a %symbol-default in addition to just an
8677 ordinary symbol. Add switched functions for setting %destructor's and
8678 %printer's.
8679 * tests/actions.at, tests/input.at: Add %symbol-default to all default
8680 %destructor/%printer declarations.
8681
3508ce36
JD
86822006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
8683
8684 Whether the default %destructor/%printer applies to a particular symbol
8685 isn't a question of whether the user *declares* that symbol (in %token,
8686 for example). It's a question of whether the user by any means
8687 *defines* the symbol at all (by simply using a char token, for
8688 example). $end is defined by Bison whereas any other token with token
8689 number 0 is defined by the user. The error token is always defined by
8690 Bison regardless of whether the user declares it with %token, but we
8691 may one day let the user define error as a nonterminal instead.
8692 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
8693 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
8694 the meaning of "user-defined".
8695 * tests/actions.at (Default %printer and %destructor for user-declared
8696 end token): Rename to...
8697 (Default %printer and %destructor for user-defined end token): ...
8698 this.
8699
8700 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
8701 computation of whether to apply the default, don't maintain a list of
8702 every Bison-defined symbol. Instead, just check for a first character
8703 of '$', which a user symbol cannot have, and check for the error token.
8704
9350499c
JD
87052006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
8706
8707 Don't apply the default %destructor or %printer to the error token,
8708 $undefined, or $accept. This change fits the general rule that the
8709 default %destructor and %printer are only for user-declared symbols,
8710 and it solves several difficulties that are described in the new test
8711 cases listed below.
8712 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
8713 * tests/actions.at (Default %printer and %destructor are not for error
8714 or $undefined, Default %printer and %destructor are not for $accept):
8715 New test cases.
8716
4d7370cb
JD
87172006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
8718
8719 Allow %start after the first rule.
8720 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
8721 when parsing the first rule.
8722 (check_and_convert_grammar): Search for it here after all grammar
8723 declarations have been parsed. Skip midrules, which have dummy LHS
8724 nonterminals.
8725 * src/symtab.c (symbol_is_dummy): New function.
8726 * src/symtab.h (symbol_is_dummy): Declare it.
8727 * tests/input.at (%start after first rule): New test.
8728
6d0ef4ec
JD
87292006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8730
8731 Redo some of the previous commit: add back the ability to use
8732 non-aliased/undeclared string literals since it might be useful to
8733 those declaring %token-table.
8734 * src/reader.c (check_and_convert_grammar): Undo changes in previous
8735 commit: don't worry about complaints from symbols_pack.
8736 * src/symtab.c (symbol_new, symbol_class_set,
8737 symbol_check_alias_consistency): Undo changes in previous commit: count
8738 each string literal as a new symbol and token, assign it a symbol
8739 number, and don't complain about non-aliased string literals.
8740 (symbols_pack): Since symbol_make_alias still does not decrement symbol
8741 and token counts but does still set aliased tokens to the same number,
8742 symbol_pack_processor now leaves empty slots in the symbols array.
8743 Remove those slots.
8744 * tests/regression.at (Undeclared string literal): Remove test case
8745 added in previous commit since non-aliased string literals are allowed
8746 again.
8747 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
8748 remove unnecessary string literal declarations.
8749 * tests/sets.at (Firsts): Likewise.
8750
965537bc
JD
87512006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8752
8753 Don't allow an undeclared string literal, but allow a string literal to
8754 be used before its declaration.
8755 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
8756 symbols_pack complained.
8757 * src/symtab.c (symbol_new): Don't count a string literal as a new
8758 symbol.
8759 (symbol_class_set): Don't count a string literal as a new token, and
8760 don't assign it a symbol number since symbol_make_alias does that.
8761 (symbol_make_alias): It's not necessary to decrement the symbol and
8762 token counts anymore. Don't assume that an alias declaration occurs
8763 before any uses of the identifier or string, and thus don't assert that
8764 one of them has the highest symbol number so far.
8765 (symbol_check_alias_consistency): Complain if there's a string literal
8766 that wasn't declared as an alias.
8767 (symbols_pack): Bail if symbol_check_alias_consistency failed since
8768 symbol_pack asserts that every token has been assigned a symbol number
8769 although undeclared string literals have not.
8770 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 8771 string literal): New test cases.
965537bc
JD
8772 (Characters Escapes, Web2c Actions): Declare string literals as
8773 aliases.
8774 * tests/sets.at (Firsts): Likewise.
8775
47aee066
JD
87762006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
8777
8778 In the grammar scanner, STRING_FINISH unclosed constructs and return
8779 them to the parser in order to improve error messages.
8780 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
8781 SC_BRACED_CODE, SC_PROLOGUE): Implement.
8782 * tests/input.at (Unclosed constructs): New test case.
8783 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
8784 seen.
8785
8786 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
8787 unused global.
8788
1f6b3679
JD
87892006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
8790
8791 Handle string aliases for character tokens correctly.
8792 * src/symtab.c (symbol_user_token_number_set): If the token has an
8793 alias, check and set its alias's user token number instead of its own,
8794 which is set to indicate the alias. Previously, every occurrence of
8795 the character token in the grammar overwrote that alias indicator with
8796 the character code.
8797 * tests/input.at (String aliases for character tokens): New test.
8798
219741d8
JD
87992006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
8800
8801 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
8802
11daa4e7
PE
88032006-08-11 Paul Eggert <eggert@cs.ucla.edu>
8804
8805 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
8806 to prevent failures when building on older platforms.
8807 Check for autopoint failure.
8808 Set XGETTEXT_OPTIONS to values that check for C format strings,
8809 so that translators are warned about them (this also helps
8810 prevent core dumps).
8811
8812 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
8813 function, since it simplifies our code a bit.
8814
8815 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
8816 rather than -W, so we don't get bogus warnings about sign comparisons.
8817 Add -Wpointer-arith, since that warning is useful (it reports code
8818 that does not conform to C89 and that some compilers reject).
8819 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
8820 since it's no longer needed.
8821
f9bfc42a
JD
88222006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
8823
8824 Clean up scanners a bit.
8825 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
8826 definitions so gcc won't warn when obstack_for_string is unused.
8827 * src/scan-code.l: config.h and system.h are already #include'd by
8828 scan-code-c.c, so get rid of them here.
8829 * src/scan-gram.l: Likewise.
8830 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
8831 definitions rather than duplicating the rest of it.
8832 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
8833
06e8700a
JD
88342006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
8835
8836 Suppress signed/unsigned comparison warnings for yycheck.
8837 * data/c.m4 (b4_safest_int_type): New macro.
8838 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
8839 a signed int type, cast it to b4_safest_int_type first.
8840 * data/yacc.c: Likewise.
8841 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
8842 also overwritten.
8843
9c437126
PE
88442006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
8845
8846 * doc/bison.texinfo: Fix some typos.
8847
284d8a13
PE
88482006-08-02 Paul Eggert <eggert@cs.ucla.edu>
8849
8850 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
8851 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
8852
8853 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
8854 the latest gnulib does this a different way.
8855 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
8856 translation was patched, so stop omitting it.
8857
ec5479ce
JD
88582006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8859
8860 Enable declaration of default %printer/%destructor. Make the parser
8861 use these for all user-declared grammar symbols for which the user does
8862 not declare a specific %printer/%destructor. Thus, the parser uses it
8863 for token 0 if the user declares it but not if Bison generates it as
8864 $end. Discussed starting at
8865 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
8866 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
8867 and
8868 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
8869 * NEWS (2.3+): Mention.
8870 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
8871 declare a %destructor for a mid-rule's semantic value. It's just
8872 impossible to declare one specific to it.
8873 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
8874 code. Describe default %destructor form.
8875 * src/parse-gram.y (grammar_declaration): Parse default
8876 %printer/%destructor declarations.
8877 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
8878 and symbol_destructor_location_get rather than accessing the destructor
8879 and destructor_location members of struct symbol.
8880 (symbol_printers_output): Likewise but for %printer's.
8881 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
8882 again.
8883 * src/symtab.c (default_destructor, default_destructor_location,
8884 default_printer, default_printer_location): New static global
8885 variables to record the default %destructor and %printer.
8886 (symbol_destructor_get, symbol_destructor_location_get,
8887 symbol_printer_get, symbol_printer_location_get): New functions to
8888 compute the appropriate %destructor and %printer for a symbol.
8889 (default_destructor_set, default_printer_set): New functions to set the
8890 default %destructor and %printer.
8891 * src/symtab.h: Prototype all those new functions.
8892 * tests/actions.at (Default %printer and %destructor): New test to
8893 check that the right %printer and %destructor are called, that they're
8894 not called for $end, and that $$ and @$ work correctly.
8895 (Default %printer and %destructor for user-declared end token): New
8896 test to check that the default %printer and %destructor are called for
8897 a user-declared end token.
8898 * tests/input.at (Default %printer and %destructor redeclared, Unused
8899 values with default %destructor): New tests to check related grammar
8900 warnings and errors.
8901
868d2d96
JD
89022006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8903
8904 Clean up handling of %destructor for the end token (token 0).
8905 Discussed starting at
8906 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
8907 and
8908 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
8909
8910 Make the skeletons consistent in how they pop the end token and invoke
8911 its %destructor.
8912 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
8913 state, which has token number 0, since this would invoke the
8914 %destructor for the end token.
8915 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
8916 until after shifting the end token, or else it won't be popped.
8917 * data/yacc.c (yyparse): Likewise.
8918
8919 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
8920 it's the end token. Upon termination, destroy an unshifted lookahead
8921 even when it's the end token.
8922 * data/lalr1.cc (yy::parser::parse): Likewise.
8923 * data/yacc.c (yyparse): Likewise.
8924
8925 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
8926 value warnings for the end token when the user gives the end token a
8927 %destructor.
8928
8929 * tests/actions.at (Printers and Destructors): Test all the above.
8930
62a9592d
PE
89312006-07-24 Paul Eggert <eggert@cs.ucla.edu>
8932
8933 Update to latest gnulib and gettext versions.
8934 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
8935 Add fopen-safer.
8936 (gnulib_files): Add m4/warning.m4. Don't worry about files
8937 overwritten by autopoint.
8938 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
8939 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
8940 rejects them.
8941 Don't use autoreconf; instead, invoke autopoint etc. by hand,
8942 so that we can remove the intl files at a better time.
8943 (intl_files_to_remove): Remove aclocal.m4, since it gets
8944 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
8945 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
8946 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
8947 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
8948 Remove datarootdir hack; no longer needed.
8949 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
8950 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
8951 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
8952 strdup.h.
8953 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
8954 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
8955
10d6970f
PE
89562006-07-20 Paul Eggert <eggert@cs.ucla.edu>
8957
8958 * bootstrap: Adjust to today's change to gnulib-tool by invoking
8959 it with --assume-autoconf='latest-stable'.
8960
50a33993
JD
89612006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
8962
8963 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
8964 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
8965 YYSTYPE' and `{'.
8966 * src/muscle_tab.h (muscle_grow): Replace the header comments with
8967 those from muscle_tab.c since the old ones are misleading.
8968
2ce4ed68
AD
89692006-07-13 Akim Demaille <akim@epita.fr>
8970
8971 Support %define "KEY" {VALUE}.
8972 * src/scan-code.h, src/scan-code.l (translate_action)
8973 (translate_rule_action, translate_symbol_action, translate_code):
8974 Return char *, not const char *.
8975 * src/parse-gram.y (declaration): Rename as...
8976 (prologue_declaration): this.
8977 (string_content): Remove this nonterminal, use STRING.
8978 (braceless, content, content.opt): New nonterminal.
8979 Use them.
8980 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
8981 as value.
8982 * src/scan-gram.l (getargs.h): Don't include it.
8983
db7e5eb5
PE
89842006-07-12 Paul Eggert <eggert@cs.ucla.edu>
8985
8986 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
8987 rather than a for-loop that declares a local bool variable. This
8988 should work around a compatibility problem with a Cray x1e C++
8989 compiler reported by Hung Nguyen in
8990 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
8991 The for-loop was introduced in the 2004-11-17 change but I don't
8992 know why it was needed.
8993
a5d80ba5
AD
89942006-07-12 Akim Demaille <akim@epita.fr>
8995
8996 * data/c.m4: Comment changes.
8997
23eb2a69
AD
89982006-07-10 Akim Demaille <akim@lrde.epita.fr>
8999
9000 * src/complain.c (error_message, ERROR_MESSAGE): New.
9001 To factor...
9002 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
9003 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
9004
ddc8ede1
PE
90052006-07-09 Paul Eggert <eggert@cs.ucla.edu>
9006
9007 * NEWS: Instead of %union, you can define and use your own union type
9008 YYSTYPE if your grammar contains at least one <type> tag.
9009 Your YYSTYPE need not be a macro; it can be a typedef.
9010 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
9011 (Union Decl, Decl Summary): Document this.
9012 * data/glr.c (YYSTYPE): Implement this.
9013 * data/glr.cc (YYSTYPE): Likewise.
9014 * data/lalr1.cc (YYSTYPE): Likewise.
9015 * data/yacc.c (YYSTYPE): Likewise.
9016 * src/output.c (prepare): Output tag_seen_flag.
9017 * src/parse-gram.y (declaration, grammar_declaration):
9018 Use 'union_seen' rather than 'typed' to determine whether
9019 %union has been seen, since grammars can now be typed without
9020 %union.
9021 (symbol_declaration, type.opt, symbol_def):
9022 Keep track of whether a tag has been seen.
9023 * src/reader.c (union_seen, tag_seen): New vars.
9024 (typed): remove.
9025 * src/reader.h (union_seen, tag_seen, typed): Likewise.
9026 * src/scan-code.l (untyped_var_seen): New variable.
9027 (handle_action_dollar): Adjust to above changes.
9028 (handle_action_dollar, handle_action_at):
9029 Improve overflow checking for outlandish numbers.
9030 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
9031 avoid new diagnostics generated by above changes.
9032 * tests/regression.at (YYSTYPE typedef): Add test to check
9033 for type tags without %union.
9034
9035 * src/symlist.c (symbol_list_length): Return int, not unsigned
9036 int, since callers expect int. This may need to get revisited
9037 once we have proper integer overflow checking.
9038
9039 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
9040 object is now static.
9041
9042 * src/getargs.c (flags_argmatch): Return void, not int,
9043 to pacify ./configure --enable-gcc-warnings.
9044
9045 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
9046 since last_string is already defined to FLEX_PREFIX (last_string).
9047
7b42569e
AD
90482006-07-09 Akim Demaille <akim@lrde.epita.fr>
9049
9050 Implement --warnings/-W.
9051 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
9052 replaced by...
9053 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
9054 Adjust callers.
9055 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
9056 (warnings_args, warnings_types): New.
9057 (getargs, short_options, long_options): Accept -W/--warnings.
9058 Sort the options by alphabetical order, upper case letter right
9059 before its lower case.
9060
3b452f4e
JD
90612006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
9062
9063 Change %merge result type clash warnings to errors. Discussed at
9064 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
9065 * src/reader.c (record_merge_function_type): Use complain_at.
9066 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9067 declared later): Update test case results.
9068
b8a41559
AD
90692006-07-09 Akim Demaille <akim@lrde.epita.fr>
9070
9071 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
9072 to be in alphabetical order.
9073 (trace_args): Spelling fixes.
9074
cd9e1ba2
PE
90752006-07-09 Paul Eggert <eggert@cs.ucla.edu>
9076
9077 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
9078 so they don't collide with user-defined macros.
9079 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
9080 this was never guaranteed, and now that we're using gnulib stdint,
9081 which defines int_fast16_t to long int, the problem is exposed.
9082
cb48f191
PE
90832006-07-08 Paul Eggert <eggert@cs.ucla.edu>
9084
b8445a15
PE
9085 * data/c.m4 (b4_basename): Simplify a bit, since we don't
9086 need the full POSIX semantics (and weren't implementing them
9087 anyway).
9088
cb48f191
PE
9089 Adjust to Autoconf 2.60 and today's gnulib.
9090 * bootstrap (gnulib_modules): Add stdint.
9091 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
9092 no longer copies it.
9093 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
9094 since stdint needs the former and wcwidth (which is now required
9095 by mbswidth) needs the latter.
9096 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
9097 work around a compatibility glitch between gettext 0.14.6 and
9098 Autoconf 2.60.
9099 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
9100 Do not check for uintptr_t, since new stdint module does the right
9101 thing.
9102 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
9103 Add stdint.h, stdint_.h, wcwidth.h.
9104 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
9105 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
9106 stdint.m4, wchar_t.m4, wcwidth.m4.
9107 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
9108 usual order for ../lib/*.h files.
9109 (file_name_split): Use last_component, not base_name, to adjust
9110 to gnulib changes.
9111 * src/parse-gram.h: Include <strverscmp.h> in the usual order
9112 for ../lib/*.h files.
9113 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
9114 Define unconditionally, since we now assume the stdint module.
9115 * src/scan-skel.l: Include <dirname.h>.
9116 (BASE_QPUTS): Use last_component, not base_name.
9117 * src/system.h: Include <unlocked-io.h> in the usual order
9118 for ../lib/*.h files. Include <stdint.h> unconditionally,
9119 since we now use the stdint module.
9120 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
9121 HAVE_UINTPTR_T, since we now use the stdint module.
9122 (base_name): Remove decl, since files now include <dirname.h>
9123 to get the decl.
9124
cd48d21d
AD
91252006-07-08 Akim Demaille <akim@lrde.epita.fr>
9126
9127 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
9128 New, default to 1.
9129 * data/yacc.c, data/glr.c, data/location.cc: Use them.
9130 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
9131 default.
9132 * tests/calc.at: Adjust.
9133
8ec0a172
AD
91342006-07-08 Akim Demaille <akim@lrde.epita.fr>
9135
b8445a15 9136 * data/c.m4 (b4_basename): New.
8ec0a172
AD
9137 (b4_syncline): Also output the location of its invocation (from
9138 the skeleton).
9139 (b4_user_action, b4_define_user_action, b4_user_actions)
9140 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
9141 (b4_user_stype): New.
9142 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
9143
4a678af8
JD
91442006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
9145
9146 In the grammar file, the first column is 1 not 0 on the first line as
9147 on every other line.
9148 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
9149 * tests/input.at (Torturing the Scanner): Update output.
9150
9151 * src/scan-gram.l (scanner_cursor): Declare it static.
9152
dd60572a
JD
91532006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
9154
9155 In warnings, say "previous declaration" rather than "first
9156 declaration".
9157 * src/symtab.c (redeclaration): Do that here.
9158 * src/reader.c (record_merge_function_type): In the case of a result
9159 type clash, report the previous declaration rather than the very first
9160 one in the grammar file.
9161 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9162 declared later): Add a third declaration to check this behavior.
9163 * tests/input.at (Incompatible Aliases): Update output.
9164
2073e1b6
AD
91652006-06-27 Akim Demaille <akim@epita.fr>
9166
9167 * doc/Doxyfile.in: New.
9168 * doc/Makefile.am: Use it.
9169 * src/lalr.h, src/symtab.h: Initial doxygenation.
9170
8ee5b538
JD
91712006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9172
9173 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
9174 declared after the %merge. This continues the effort of the previous
9175 patch.
8ee5b538
JD
9176 * src/reader.c (get_merge_function): Don't set the merger type yet.
9177 (record_merge_function_type): New function for setting the merger type
9178 and checking for clashes.
9179 (grammar_current_rule_merge_set): Set the location of the %merge for
9180 the current rule.
9181 (packgram): Invoke record_merge_function_type for each rule now that
9182 all symbol type declarations have been parsed.
9183 * src/reader.h (merger_list.type_declaration_location): New member
9184 storing the location of the first %merge from which the type for this
9185 merging function was derived.
9186 * src/symlist.h (symbol_list.merger_declaration_location): New member
9187 storing the location of a rule's %merge, if any.
9188 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9189 declared later): New test to catch the error fixed by the above patch.
9190
ffa4ba3a
JD
91912006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9192
9193 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
9194 declarations appear after the rules. Discussed at
9195 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
9196 and
9197 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
9198 Don't mistake the type of $$ in a midrule to be that of its parent
9199 rule's $$.
ffa4ba3a
JD
9200 * src/reader.c (grammar_current_rule_end): Don't invoke
9201 grammar_rule_check yet since not all symbol declarations may have been
9202 parsed yet.
9203 (grammar_midrule_action): Likewise.
9204 Don't record whether the midrule's $$ has been used yet since actions
9205 haven't been translated yet.
9206 Record the midrule's parent rule and its RHS index within the parent
9207 rule.
9208 (grammar_current_rule_action_append): Don't translate the action yet
9209 since not all symbol declarations may have been parsed yet and, thus,
9210 warnings about types for $$, $n, @$, and @n can't be reported yet.
9211 (packgram): Translate the action and invoke grammar_rule_check now that
9212 all symbol declarations have been parsed.
9213 * src/scan-code.l (handle_action_dollar): Now that this is invoked
9214 after parsing the entire grammar file, the symbol list here in the case
9215 of a midrule is actually the midrule's empty RHS, so reference its
9216 parent rule's RHS where necessary.
9217 On the other hand, now that you can already know it's a midrule, you
9218 aren't forced to think $$ has the same type as its parent rule's $$.
9219 (handle_action_at): In the case of a midrule, reference the parent rule
9220 where necessary.
9221 * src/symlist.c (symbol_list_new): Initialize new midrule-related
9222 members.
9223 (symbol_list_length): Now that this is invoked after all rules have
9224 been parsed, a NULL symbol (rather than a NULL symbol list node)
9225 terminates a rule. symbol_list_print already does this correctly.
9226 * src/symlist.h (symbol_list.midrule_parent_rule,
9227 symbol_list.midrule_parent_rhs_index): New members so that midrules can
9228 remember their relationships with their parents.
9229 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
9230 fixed by the above patch.
9231 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
9232 implementing...
9233 (Unused values): ... this old test case and...
9234 (Unused values before symbol declarations): ... this new test case.
9235 This one is the same as `Unused values' except that all symbol
9236 declarations appear after the rules in order to catch the rest of the
9237 errors fixed by the above patch.
9238
e256e17f
JD
92392006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9240
300a1930
JD
9241 More cleanup.
9242 * src/reader.c (current_rule): Declare it static since it's no longer
9243 used outside this file.
9244 (grammar_current_rule_action_append): Remove redundant arguments from
9245 translate_rule_action invocation.
9246 * src/reader.h (current_rule): Remove this unused extern.
9247 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
9248 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 9249
381ecb06
JD
92502006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
9251
9252 Clean up yesterday's patch.
9253 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
9254 to...
9255 * src/reader.c (grammar_current_rule_action_append): ... here for
9256 consistency with grammar_current_rule_symbol_append.
9257 * tests/regression.at (Braced code in declaration in rules section):
9258 Make yyerror and yylex static as usual.
9259
4210cd0b
JD
92602006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
9261
9262 Fix bug that mistakes braced code in a declaration in the rules section
9263 to be a rule action. Mentioned at
9264 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
9265 * src/scan-gram.l: Move midrule action detection from the start of the
9266 scanning of any braced code to...
9267 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
9268 action. For readability, use $2 and @2 rather than the equivalent
9269 global variables.
9270 * tests/regression.at (Braced code in declaration in rules section):
9271 New test to catch the error fixed by the above patch.
9272
9273 Work on code readability some.
9274 * src/scan-code.l (current_rule): Get rid of this misleading and
9275 redundant declaration: it's actually extern'ed in reader.h.
9276 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
9277 translate_action): Add a rule argument and use it instead of the global
9278 current_rule.
9279 (translate_rule_action): This already receives current_rule through an
9280 argument, so pass it on to translate_action instead of assigning
9281 current_rule to current_rule.
9282 (translate_symbol_action, translate_code): Pass rule = NULL to
9283 translate_action.
9284
34f98f46
JD
92852006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
9286
9287 Rename %before-definitions to %start-header and %after-definitions to
9288 %end-header. Don't use these declarations to separate pre-prologue
9289 blocks from post-prologue blocks. Add new order-independent
9290 declarations %before-header and %after-header as alternatives to the
9291 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
9292 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
9293 * NEWS (2.3+): Update for these changes.
9294 * data/glr.c (b4_before_definitions): Update to...
9295 (b4_start_header): ... this.
9296 (b4_after_definitions): Update to...
9297 (b4_end_header): ... this.
9298 * data/glr.cc: Likewise.
9299 * data/lalr1.cc: Likewise.
9300 * data/yacc.c: Likewise.
9301 * doc/bison.texinfo (The prologue): Update names, and replace remaining
9302 prologue blocks with %*-header declarations.
9303 (Calc++ Parser): Likewise.
91661ebb 9304 (Decl Summary): Update names.
148d66d8 9305 (Table of Symbols): Update description.
34f98f46
JD
9306 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
9307 (PERCENT_END_HEADER): ... this.
9308 (PERCENT_BEFORE_DEFINITIONS): Update to...
9309 (PERCENT_START_HEADER): ... this.
9310 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9311 (declaration): Update token names and m4 macro names.
9312 When parsing %end-header and %start-header, invoke translate_code
9313 before muscle_code_grow, and no longer set global booleans to remember
9314 whether these declarations have been seen.
9315 Parse new %after-header and %before-header.
9316 * src/reader.c (before_definitions, after_definitions): Remove.
9317 (prologue_augment): Accept a new bool argument to specify whether to
9318 augment the pre-prologue or post-prologue.
9319 * src/reader.h (before_definitions, after_definitions): Remove these
9320 extern's.
9321 (prologue_augment): Add new bool argument.
9322 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
9323 (PERCENT_END_HEADER): ... this.
9324 (PERCENT_BEFORE_DEFINITIONS): Update to...
9325 (PERCENT_START_HEADER): ... this.
9326 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9327 * tests/actions.at (Printers and Destructors): Update names.
9328
31b2b07e
JD
93292006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
9330
9331 Add comparison operators for C++ location classes. Discussed at
9332 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
9333 * data/c++.m4 (b4_define_location_comparison): New boolean %define
9334 declaration indicating whether filename_type has an operator==. If
9335 filename_type is `std::string', it defaults to `1', `0' otherwise.
9336 * data/location.cc: Iff b4_define_location_comparison is `1', add
9337 operator== and operator!= for class position and for class location.
9338
9339 Some minor fixes.
9340 * src/scan-action.l: Remove unused file.
9341 * src/symtab.c (symbol_printer_set): Use printer_location not
9342 destructor_location.
9343 * src/symtab.h (struct symbol): Replace incorrect source comment for
9344 printer members.
9345 * tests/input.at (Incompatible Aliases): Update output with correct
9346 printer location.
9347
9bc0dd67
JD
93482006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
9349
9350 Don't put the pre-prologue in the header file. For the yacc.c code
9351 file and the glr.c header and code files, move the pre-prologue before
9352 the token definitions. Add new %before-definitions and
9353 %after-definitions to declare code that will go in both the header file
9354 and code file. Discussed at
9355 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
9356 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
9357 and
9358 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
9359 * NEWS (2.3+): Describe these changes.
9360 * data/glr.c (b4_pre_prologue): Move from within to before...
9361 (b4_shared_declarations): ... this.
9362 Add new b4_before_definitions before b4_token_enums.
9363 Add new b4_after_definitions at the end.
9364 * data/glr.cc (b4_pre_prologue): Replace with...
9365 (b4_before_definitions): ... this in the header file.
9366 (b4_after_definitions): New near the end of the header file.
9367 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
9368 code file right before including the header file.
9369 (b4_before_definitions): New in the previous position of
9370 b4_pre_prologue in the header file.
9371 (b4_after_definitions): New near the end of the header file.
9372 * data/yacc.c: Clean up some m4 quoting especially in the header file.
9373 (b4_token_enums_defines): In the code file, move to right before
9374 YYSTYPE for consistency with the header file.
9375 (b4_before_definitions): New right before b4_token_enums_defines in
9376 both the header and code file.
9377 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
9378 header and code file.
9379 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
9380 of prologues for %union dependencies.
91661ebb
JD
9381 (Decl Summary): In %defines description, mention the effect of
9382 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
9383 (Calc++ Parser): Forward declare driver in a %before-definitions rather
9384 than in the pre-prologue so that make check succeeds.
148d66d8 9385 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
9386 %after-definitions.
9387 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
9388 %before-definitions.
9389 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
9390 (declaration): Parse those declarations and append to
9391 b4_before_definitions and b4_after_definitions, respectively.
9392 * src/reader.c (before_definitions, after_definitions): New bools to
9393 track whether those declarations have been seen.
9394 (prologue_augment): Add to the post-prologue if %union,
9395 %before-definitions, or %after-definitions has been seen.
9396 * src/reader.h (before_definitions, after_definitions): New extern's.
9397 * src/scan-gram.l: Scan the new declarations.
9398 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
9399 prologue block in a %before-definitions or a %after-definitions based
9400 on whether the %union is declared.
9401 * tests/regression.at (Early token definitions with --yacc, Early token
9402 definitions without --yacc): Move tests for token definitions into the
9403 post-prologue since token names are no longer defined in the
9404 pre-prologue.
9405
203b9274
AD
94062006-06-20 Akim Demaille <akim@epita.fr>
9407
9408 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
9409 (symbol_get): Use it.
9410 * src/parse-gram.y: Use it.
9411
a7ee59cf
JD
94122006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
9413
9414 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
9415 build succeeds when configured with --enable-gcc-warnings.
9416
5a2baae7
PE
94172006-06-19 Paul Eggert <eggert@cs.ucla.edu>
9418
33ad1a9c
PE
9419 * src/parse-gram.y (char_name): New function.
9420 (CHAR, STRING, string_content): For %printer, properly escape.
9421 (ID): Prefer fputs to fprintf.
9422 (id): Reindent to be consistent with other rules.
9423 Properly quote char.
9424
5a2baae7
PE
9425 The Translation Project changed its way of publishing translations
9426 to maintainers. I haven't received any responses to my request
9427 for supporting the old way, or for documenting the new way. I
9428 have modified 'bootstrap' to use screen scraping
9429 (in this case, HTML scraping). This is unreliable and inelegant,
9430 but I don't see any better way. Yuck.
9431 * bootstrap (TP_URL, WGET_COMMAND): New vars.
9432 (get_translations): New function, which uses HTML scraping to
9433 deduce locations of latest translations.
9434 Use this function to grab both bison and bison-runtime .po files.
9435 Don't bother priming the pump for the runtime-po domain any more,
9436 as it's now translated better than bison is.
9437
58d7a1a1
AD
94382006-06-19 Akim Demaille <akim@epita.fr>
9439
9440 * src/scan-gram.l: No longer "parse" things after `%union' until
9441 `{'. Rather, return a single "%union" token.
9442 No longer make symbols: return strings, and leave the conversion
9443 to symbols to the parser.
9444 (SC_PRE_CODE, token_type): Remove.
9445 * src/parse-gram.y (%union): New field `character'.
9446 Sort tokens.
9447 (CHAR): New token.
9448 (ID, ID_COLON): Now that the scanner no longer makes them
9449 identifiers, adjust all uses to invoke symbol_get.
9450 (id_colon): New, wraps the conversion from string to symbol.
9451 (%union): Accept a possible union_name.
9452 (symbol): Now can be a char.
9453 * data/c.m4 (b4_union_name): Leave a default value.
9454 * data/glr.c, data/yacc.c: Use it.
9455
b931235e
JD
94562006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
9457
9458 For associating token numbers with token names for "yacc.c", don't use
9459 #define statements unless `--yacc' is specified; always use enum
9460 yytokentype. Most important discussions start at:
9461 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
9462 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
9463 and
9464 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
9465 * NEWS (2.3+): Mention.
9466 * data/c.m4 (b4_yacc_if): New.
9467 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
9468 token #define's.
9469 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
9470 on token name definitions.
9471 * src/getargs.c (usage): Capitalize `Yacc' in English.
9472 * src/output.c (prepare): Define b4_yacc_flag.
9473 * tests/regression.at (Early token definitions): Test that tokens names
9474 are defined before the pre-prologue not just before the post-prologue.
9475 Remove this test case and copy to...
9476 (Early token definitions with --yacc): ... this to test #define's.
9477 (Early token definitions without --yacc): ... and this to test enums.
9478
9e6e7ed2
PE
94792006-06-11 Paul Eggert <eggert@cs.ucla.edu>
9480
9481 * NEWS: Reword the post-2.3 change to not be so optimistic about
9482 removing the old "look-ahead" spelling.
9483 Update previous look-ahead/lookahead change reports.
9484 * REFERENCES: look-ahead -> lookahead (since that's
9485 what he actually wrote).
9486 * doc/refcard.tex: look ahead -> lookahead,
9487 look-ahead -> lookahead
9488
742e4900
JD
94892006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
9490
9491 For consistency, use `lookahead' instead of `look-ahead' or
9492 `look_ahead'. Discussed starting at
9493 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
9494 and then at
9495 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
9496 * NEWS: For the next release, note the change to `--report'.
9497 * TODO, doc/bison.1: Update English.
9498 * doc/bison.texinfo: Update English.
9499 (Understanding Your Parser, Bison Options): Document as
9500 `--report=lookahead' rather than `--report=look-ahead'.
9501 * src/conflicts.c: Update English in comments.
9502 (lookahead_set): Rename from look_ahead_set.
9503 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
9504 (resolve_sr_conflict): Rename local look_ahead_tokens to
9505 lookahead_tokens, and update other uses.
9506 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
9507 count_rr_conflicts, conflicts_free): Update uses.
9508 * src/getargs.c (report_args): Move "lookahead" before alternate
9509 spellings.
9510 (report_types): Update uses.
9511 (usage): For `--report' usage description, state `lookahead' spelling
9512 rather than `look-ahead'.
9513 * src/getargs.h (report.report_lookahead_tokens): Rename from
9514 report_look_ahead_tokens.
9515 * src/lalr.c: Update English in comments.
9516 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
9517 (state_lookahead_tokens_count): Rename from
9518 state_look_ahead_tokens_count.
9519 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9520 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
9521 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9522 Update other uses.
9523 Update English in output.
9524 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
9525 * src/print.c: Update English in comments.
9526 (lookahead_set): Rename from look_ahead_set.
9527 (print_reduction): Rename argument lookahead_token from
9528 look_ahead_token.
9529 (print_core, state_default_rule, print_reductions, print_results):
9530 Update uses.
9531 * src/print_graph.c: Update English in comments.
9532 (print_core): Update uses.
9533 * src/state.c: Update English in comments.
9534 (reductions_new): Update uses.
9535 (state_rule_lookahead_tokens_print): Rename from
9536 state_rule_look_ahead_tokens_print, and update other uses.
9537 * src/state.h: Update English in comments.
9538 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
9539 (state_rule_lookahead_tokens_print): Rename from
9540 state_rule_look_ahead_tokens_print.
9541 * src/tables.c: Update English in comments.
9542 (conflict_row, action_row): Update uses.
9543 * tests/glr-regression.at
9544 (Incorrect lookahead during deterministic GLR,
9545 Incorrect lookahead during nondeterministic GLR): Rename
9546 print_look_ahead to print_lookahead.
9547 * tests/torture.at: Update English in comments.
9548 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
9549 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
9550 (Many lookahead tokens): Update uses.
9551 * data/glr.c: Update English in comments.
9552 * lalr1.cc: Likewise.
9553 * yacc.c: Likewise.
9554 * src/conflicts.h: Likewise.
9555 * src/lalr.h: Likewise.
9556 * src/main.c: Likewise.
9557 * src/output.c: Likewise.
9558 * src/parse-gram.c: Likewise.
9559 * src/tables.h: Likewise.
9560 * tests/calc.at: Likewise.
9561
3c40d0b5
JD
95622006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
9563
9564 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
9565
5d278082
PE
95662006-06-07 Paul Eggert <eggert@cs.ucla.edu>
9567
9568 * TODO: Add request from Nelson H. F. Beebe to be able to install
9569 Bison without installing the yacc script.
9570
9e668899
JD
95712006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9572
9573 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
9574 and yytext if they're already #define'd.
9575 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
9576 * src/scan-code-c.c: ... here.
9577 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
9578 <config.h>.
9579
0c8e079f
JD
95802006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9581
9582 Get Bison to build again when configured with --enable-gcc-warnings.
9583 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
9584 missing #include's.
9585 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
9586 loc argument as it shadows a global.
9587 * src/scan-gram.l: Remove stray comma that prevents boundary_set
9588 invocation.
9589
9590 * src/.cvsignore: Add scan-code.c.
9591
2346344a
AD
95922006-06-07 Akim Demaille <akim@epita.fr>
9593
9594 * src/scan-gram.l: Move the "add a trailing ; to actions" code
9595 to...
9596 * src/scan-code.l: here.
9597 * tests/input.at (Torturing the Scanner): Fix another location
9598 error.
9599
4862bdfd
AD
96002006-06-07 Akim Demaille <akim@epita.fr>
9601
9602 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
9603
e9071366
AD
96042006-06-06 Akim Demaille <akim@epita.fr>
9605
9606 Extract the parsing of user actions from the grammar scanner.
9607 As a consequence, the relation between the grammar scanner and
9608 parser is much simpler. We can also split "composite tokens" back
9609 into simple tokens.
9610 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
9611 * src/scan-gram.l (add_column_width, adjust_location): Move to and
9612 rename as...
9613 * src/location.h, src/location.c (add_column_width)
9614 (location_compute): these.
9615 Fix the column count: the initial column is 0.
9616 (location_print): Be robust to ending column being 0.
9617 * src/location.h (boundary_set): New.
9618 * src/main.c: Adjust to scanner_free being renamed as
9619 gram_scanner_free.
9620 * src/output.c: Include scan-code.h.
9621 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
9622 Use boundary_set.
9623 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
9624 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
9625 which is now, again, a separate token.
9626 Adjust all dependencies.
9627 Whereever actions with $ and @ are used, use translate_code.
9628 (action): Remove this nonterminal which is now useless.
9629 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
9630 (grammar_current_rule_action_append): Use translate_code.
9631 (packgram): Bound check ruleno, itemno, and rule_length.
9632 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
9633 (last_string, last_braced_code_loc, max_left_semantic_context)
9634 (scanner_initialize, scanner_free, scanner_last_string_free)
9635 (gram_out, gram_lineno, YY_DECL_): Move to...
9636 * src/scan-gram.h: this new file.
9637 (YY_DECL): Rename as...
9638 (GRAM_DECL): this.
9639 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
9640 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9641 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9642 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9643 Move these declarations, and...
9644 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
9645 these to...
9646 * src/flex-scanner.h: this new file.
9647 * src/scan-gram.l (rule_length, rule_length_overflow)
9648 (increment_rule_length): Remove.
9649 (last_braced_code_loc): Rename as...
9650 (gram_last_braced_code_loc): this.
9651 Adjust to the changes of the parser.
9652 Move all the handling of $ and @ into...
9653 * src/scan-code.l: here.
9654 * src/scan-gram.l (handle_dollar, handle_at): Remove.
9655 (handle_action_dollar, handle_action_at): Move to...
9656 * src/scan-code.l: here.
9657 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
9658 scan-code.h, scan-code-c.c, scan-gram.h.
9659 (EXTRA_bison_SOURCES): Add scan-code.l.
9660 (BUILT_SOURCES): Add scan-code.c.
9661 (yacc): Be robust to white spaces.
9662
9663 * tests/conflicts.at, tests/input.at, tests/reduce.at,
9664 * tests/regression.at: Adjust the column numbers.
9665 * tests/regression.at: Adjust the error message.
7891a7c4 9666
184e42f0
JD
96672006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9668
9669 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9670 Use Akim's wording from
9671 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
9672
7891a7c4
JD
96732006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9674
9675 Between Bison releases, manually append `+' to the previous Bison
9676 release number, and use that as a signal to automatically print the
9677 ChangeLog's CVS Id keyword from --version. Discussed starting at
9678 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
9679 * ChangeLog: Add Id header.
9680 * configure.ac (AC_INIT): Append `+' to `2.3'.
9681 * src/.cvsignore: Add revision.c.
9682 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
9683 (BUILT_SOURCES): Add revision.c.
9684 (revision.c): New target rule. This file defines a new global variable
9685 named revision. It initializes it with either the Id from ChangeLog
9686 or, if VERSION doesn't contain `+', with the empty string.
9687 * src/getargs.c (version): Print the value of revision.
9688 * src/revision.h: Extern revision.
9689
4ad3ed84
PE
96902006-06-05 Paul Eggert <eggert@cs.ucla.edu>
9691
9692 * NEWS: Version 2.3.
9693 * configure.ac (AC_INIT): Likewise.
9694
02103984
PE
96952006-05-30 Paul Eggert <eggert@cs.ucla.edu>
9696
9697 * data/glr.c (YYRECOVERING): Define to be a function-like macro
9698 with no arguments, not as an object-like macro. This is for
9699 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
9700 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
9701 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
9702 Document this.
9703
2c08afa5
JD
97042006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
9705
9706 * src/getargs.c (usage): Back out yesterday's modification of the
9707 --help output so that we don't have to wait for translation before
9708 releasing 2.3.
9709
6077da58
PE
97102006-05-29 Paul Eggert <eggert@cs.ucla.edu>
9711
9712 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
9713 Problem reported by Akim Demaille.
9714
2a26b6c2
JD
97152006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
9716
9717 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9718
aefef0d6
PE
97192006-05-26 Paul Eggert <eggert@cs.ucla.edu>
9720
9721 * data/yacc.c (yy_reduce_print): Omit trailing white space in
9722 generated source code. Problem reported by Frans Englich in
9723 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
9724
fcd8e201
PE
97252006-05-22 Paul Eggert <eggert@cs.ucla.edu>
9726
9727 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
9728 shell, not within 'make', so that 'make' by an ordinary builder
9729 (using GNU make) does not worry about configuring gzip. This also
9730 works around a bug reported independently by Keith Thompson and by
9731 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
9732 stderr rather than stdout, messing up the build logs.
9733
7b5cdcbd
JD
97342006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9735
9736 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
9737 to make sure that YYID will never be unused. This fixes a 'make
9738 maintainer-check' failure caused by the recent changes to the 'Trivial
9739 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
9740 not used.
9741 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
9742
5ad0a449
JD
97432006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9744
9745 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
9746 state before an empty RHS is always resolved here. Only the location
9747 of that state is guaranteed to be resolved, and that's enough. This
9748 fixes the remaining bug reported by Derek M. Jones in
9749 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9750 * tests/glr-regression.at (Uninitialized location when reporting
9751 ambiguity): Test the above case.
9752 Also, the embedded comments in this test case claim it checks the case
9753 of an empty RHS that has inherited the initial location. However, the
9754 corresponding LHS was already resolved, so yyresolveLocations didn't
9755 actually have reason to modify it. Fix this by forcing
9756 nondeterministic operation at the beginning of the parse.
9757
50cce58e
PE
97582006-05-20 Paul Eggert <eggert@cs.ucla.edu>
9759
9760 * data/c.m4 (b4_yy_symbol_print_generate):
9761 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
9762 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
9763 of the bugs reported today by Derek M Jones in
9764 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9765 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
9766 defined to be a type name without parens or brackets.
9767 (Location Type): Similarly for YYLTYPE.
9768 * tests/regression.at (Trivial grammars): Put in a test for this
9769 bug that will be caught by 'make maintainer-check' (though not,
9770 alas, by 'make check' unless your compiler is picky).
9771
ab8d9dc5
PE
97722006-05-19 Paul Eggert <eggert@cs.ucla.edu>
9773
0d2c8934 9774 * NEWS: Version 2.2.
ab8d9dc5
PE
9775 * configure.ac (AC_INIT): Likewise.
9776
9138c575
JD
97772006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
9778
9779 * data/glr.c (yyreportTree): Make room in yystates for the state
9780 preceding the RHS. This fixes the segmentation fault reported by Derek
9781 M. Jones in
9782 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
9783 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
9784 to the user. Reported for yyreportTree by Derek M. Jones later in the
9785 same thread.
9786 * THANKS: Add Derek M. Jones.
9787 Update my email address.
9788 Fix typo in Steve Murphy's name.
9789
276f48df
PE
97902006-05-14 Paul Eggert <eggert@cs.ucla.edu>
9791
d6645148
PE
9792 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
9793 checking against YYLAST that caused the parser to miss a potential
9794 alternative in its diagnostic.
9795 Problem reported by Maria Jose Moron Fernandez in
9796 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
9797 * data/lalr1.cc (yysyntax_error_): Likewise.
9798 * data/yacc.c (yysyntax_error): Likewise.
9799 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
9800 tokens, in case we run into an older C compiler.
9801 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
9802 Use them to check for the off-by-one error fixed above.
9803
276f48df
PE
9804 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
9805 YYSIZE_T, not size_t.
9806 * tests/regression.at (Trivial grammars): New test, to catch
9807 the error fixed by the above patch.
9808
cd8b5791
AD
98092006-05-14 Akim Demaille <akim@lrde.epita.fr>
9810
9811 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
9812 scheme.
9813 Reported by Steve Murphy.
9814
34376418
AD
98152006-05-14 Akim Demaille <akim@lrde.epita.fr>
9816
9817 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
9818 * data/glr.cc: b4_location_flag is now b4_locations_flag.
9819
327afc7c
AD
98202006-05-14 Akim Demaille <akim@lrde.epita.fr>
9821
9822 Implement --trace=m4.
9823 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
9824 * src/output.c (output_skeleton): When set, pass -dV to m4.
9825
9826 Factor the handling of flags in m4.
9827 * src/output.c (prepare): Rename the muscle names debug, defines,
9828 error_verbose to debug_flag, defines_flag, error_verbose_flag.
9829 * data/c.m4: Adjust.
9830 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
9831 Use b4_define_flag_if to define other b4_FLAG_if macros.
9832 (b4_location_if): As a consequence, rename as...
9833 (b4_locations_if): this, for consistency.
9834 Adjust all the skeletons.
9835
ba9ecd19
AD
98362006-05-14 Akim Demaille <akim@lrde.epita.fr>
9837
9838 * etc/bench.pm: Shorten bench names.
9839
4e83ea15
AD
98402006-05-14 Akim Demaille <akim@lrde.epita.fr>
9841
9842 * src/output.h, src/output.c (error_verbose): Move to...
9843 * src/getargs.h, src/getargs.c: here.
9844 Sort the flags.
9845 Adjust dependencies.
9846
6e93d810
PE
98472006-05-13 Paul Eggert <eggert@cs.ucla.edu>
9848
9849 * data/c.m4 (b4_copyright): Put the special exception for Bison
9850 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
9851 uses changed. Suggested by Akim Demaille. Also, wrap the
9852 copyright notice, in case it is longer than 80 columns. Replace
9853 comma by newline after title.
6e93d810 9854
eaea13f5
PE
98552006-05-11 Paul Eggert <eggert@cs.ucla.edu>
9856
9857 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
9858 incompatibility, not a bug. Mention that it wasn't fixed as of
9859 flex 2.5.33.
9860
3cf084ec
AD
98612006-05-11 Akim Demaille <akim@lrde.epita.fr>
9862
9863 * examples/extexi: Enforce the precedence of concatenation over
9864 >>.
0a9f1c7d 9865 Reported by Tommy Nordgren.
3cf084ec 9866
32c96bd7
AD
98672006-05-11 Akim Demaille <akim@lrde.epita.fr>
9868
9869 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
9870 with the member "token".
f94705b2 9871 Reported by Martin Nylin.
32c96bd7 9872
eaea13f5
PE
98732006-05-08 Paul Eggert <eggert@cs.ucla.edu>
9874
9875 * data/glr.c: Switch to Bison 2.2 special-exception language in
9876 the copyright notice. Use more-regular format for titles and
9877 copyright notices.
9878 * data/glr.cc: Likewise.
9879 * data/location.cc: Likewise.
9880 * data/yacc.cc: Likewise.
9881 * doc/bison.texinfo (Conditions): Document this.
9882 * NEWS: likewise. Upgrade version to 2.2.
9883
6e2d1146
AD
98842006-04-27 Akim Demaille <akim@lrde.epita.fr>
9885
9886 * data/glr.cc: Remove dead code.
9887
47671055
PE
98882006-04-25 Paul Eggert <eggert@cs.ucla.edu>
9889
9890 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
9891 that variable and the line breaks the bootstrap. Problem reported
9892 by Juan M. Guerrero.
9893
ed2e6384
AD
98942006-04-24 Akim Demaille <akim@lrde.epita.fr>
9895
9896 * doc/bison.texinfo (Multiple start-symbols): New.
9897
3cedc2dc
AD
98982006-04-24 Akim Demaille <akim@lrde.epita.fr>
9899
9900 * etc/README, etc/bench.pl: New.
9901
b2ddc3f3
AD
99022006-04-03 Akim Demaille <akim@lrde.epita.fr>
9903
9904 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
9905 rule.
9906 Reported by Mickael Labau.
9907 * tests/input.at (Torturing the Scanner): Test it.
9908
91e3ac9a
PE
99092006-03-16 Paul Eggert <eggert@cs.ucla.edu>
9910
9911 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
9912 Problem reported by Bob Rossi.
9913
99142006-03-13 Paul Eggert <eggert@cs.ucla.edu>
9915
9916 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
9917 and didn't really work.
9918 For the index, use @ifnotinfo, not @iftex.
9919 Minor cleanups of spacing and terminology.
9920
5cf61e93
AD
99212006-03-12 Akim Demaille <akim@lrde.epita.fr>
9922
9923 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
9924 of AT_NAME_PREFIX when %name-prefix is not used.
9925
aa08666d
AD
99262006-03-12 Akim Demaille <akim@lrde.epita.fr>
9927
9928 Apply --prefix to C++ skeletons too: they change the namespace.
9929 The test suite already exercize these cases.
9930 * data/c++.m4 (b4_namespace): New.
9931 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
9932 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
9933 * data/yacc.c, data/glr.c: Remove a useless `[]'.
9934 * doc/bison.texinfo: Document it.
9935 (Option Cross Key): Use @multitable in all formats. It looks
9936 nicer, even in TeX outputs.
9937 (Rules): Use the same code whatever the output type is.
9938 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
9939 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
9940 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 9941
45567173
AD
99422006-03-10 Akim Demaille <akim@lrde.epita.fr>
9943
9944 * TODO: Remove dead items.
9945
e9d8f881 99462006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
9947
9948 * doc/FAQ: Remove, merged into...
9949 * doc/bison.texinfo (FAQ): this.
9950 * doc/Makefile.am (EXTRA_DIST): Adjust.
9951
c095d689
AD
99522006-03-10 Akim Demaille <akim@lrde.epita.fr>
9953
9954 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
9955 even if empty.
9956 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
9957 * doc/bison.texinfo (Calc++ Scanner): Use it.
9958
6e0f8287
PE
99592006-03-09 Paul Eggert <eggert@cs.ucla.edu>
9960
9961 Fix two nits reported by twlevo, plus one more that I discovered.
9962
9963 * src/assoc.h (assoc_to_string): Give a name to the arg, as
9964 this is the usual Bison style.
9965 * src/location.h (location_print): Likewise.
9966
9967 * src/reader.h (token_name): Likewise.
9968
d6b771c3
PE
99692006-03-08 Paul Eggert <eggert@cs.ucla.edu>
9970
9971 Fix some nits reported by twlevo.
9972 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
9973 and "POSIX". Use more-modern syntax for URLs. Mention C++
9974 and ask for Java. Don't hardwire OS version numbers. Add
9975 copyright notice.
9976 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
9977 * src/conflicts.c (solved_conflicts_obstack): Now static.
9978
1e137b71
JD
99792006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
9980
9981 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
9982 page. Say "you can use it" not "you may use it" as on the web page;
9983 we're describing capabilities not granting permission.
9984
73f2e47e
PE
99852006-03-06 Paul Eggert <eggert@cs.ucla.edu>
9986
6d05403d
PE
9987 * data/glr.c (yyresolveLocations): Rename local variables to avoid
9988 shadowing warnings. Use usual patter for iterating through RHS.
9989 * tests/glr-regression.at
9990 (Uninitialized location when reporting ambiguity):
9991 Modify yylex so that it uses its argument, rather than trying
9992 to rely on ARGSUSED (which doesn't work for gcc with warnings).
9993 const char -> char const.
9994
73f2e47e
PE
9995 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
9996 Don't use tabs inside commands; it messes up 'ps'.
9997 Problem reported by twlevo.
9998
8710fc41
JD
99992006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
10000
10001 * tests/glr-regression.at (Uninitialized location when reporting
10002 ambiguity): New test case.
10003 * data/glr.c (yyresolveLocations): New function, which uses
10004 YYLLOC_DEFAULT.
10005 (yyresolveValue): Invoke yyresolveLocations before reporting an
10006 ambiguity.
10007 * doc/bison.texinfo (Default Action for Locations): Note
10008 YYLLOC_DEFAULT's usage for ambiguity locations.
10009 (GLR Semantic Actions): Cross-reference those notes.
10010
ae952af2
JD
100112006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
10012
10013 * tests/glr-regression.at (Leaked semantic values when reporting
10014 ambiguity): Remove unnecessary union and type declarations.
10015 (Leaked lookahead after nondeterministic parse syntax error): New test
10016 case.
10017 * data/glr.c (yyparse): Check for zero stacks remaining before
10018 attempting to shift the lookahead so that you don't lose it.
10019
35ee866a
JD
100202006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
10021
10022 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
10023 * tests/glr-regression.at (Leaked semantic values when reporting
10024 ambiguity): New test case.
10025 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
10026 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
10027 now unnecessary yystackp parameter.
10028 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
10029 destructors can be called.
10030
10031 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
10032 in existing testcases.
10033
520181ab
JD
100342006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
10035
10036 Don't leak semantic values for parent RHS when a user action cuts the
10037 parser, and clean up related code a bit.
10038 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
10039 cuts parse): Rename to...
10040 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
10041 for leaked parent RHS values.
10042 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
10043 between an unresolved state (non-empty chain of semantic options) and
10044 an incomplete one (signaled by an empty chain).
ae952af2 10045 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
10046 successfully or unsuccessfully resolved yyGLRState to...
10047 (yyresolveValue): ... here so that yyresolveValue always leaves a
10048 yyGLRState with consistent data and thus is easier to understand.
10049 Remove the yyvalp and yylocp parameters since they are always just
10050 taken from the yys parameter. When reporting a discarded merged value
10051 in debugging output, note that it is incompletely merged. Document the
10052 interface.
10053 (yyresolveAction): If resolving any of the RHS states fails, destroy
10054 them all rather than leaking them. Thus, as long as user actions are
10055 written to clean up the RHS correctly, yyresolveAction always cleans up
10056 the RHS of a semantic option. Document the interface.
10057
18d9185c
PE
100582006-02-27 Paul Eggert <eggert@cs.ucla.edu>
10059
10060 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
10061 led to a segmentation fault in GNU Pascal. Problem reported
10062 by Waldek Hebisch.
10063
841a7737
JD
100642006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
10065
10066 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
10067 mid-rule action inside a nonterminal symbol in order to declare a
10068 destructor for its semantic value.
10069
fc3f467f
PE
100702006-02-16 Paul Eggert <eggert@cs.ucla.edu>
10071
10072 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
10073 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
10074 __cplusplus && ! defined _STDLIB_H && !
10075 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
10076 defined free))]: Include <stdlib.h> rather than rolling our own
10077 declarations of malloc and free, to avoid problems with
10078 incompatible declarations (using 'throw') C++'s stdlib.h. This
10079 should fix Debian bug 340012
10080 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
10081 reported by Guillaume Melquiond.
10082
a3af26dd
PE
100832006-02-13 Paul Eggert <eggert@cs.ucla.edu>
10084
4d7bc38c
PE
10085 * NEWS: Clarify symbols versus types in unused-value warnings.
10086
a3af26dd
PE
10087 * configure.ac (AC_INIT): Bump version number.
10088
4e26c69e
PE
100892006-02-13 Paul Eggert <eggert@cs.ucla.edu>
10090
10091 * NEWS: Version 2.1a.
10092 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
10093 since C99 requires this.
10094
498e897c
PE
100952006-02-11 Paul Eggert <eggert@cs.ucla.edu>
10096
10097 * m4/c-working.m4: New file.
10098 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
10099
57bb17ca
PE
101002006-02-10 Paul Eggert <eggert@cs.ucla.edu>
10101
10102 * Makefile.maint: Merge from coreutils.
10103
0be105dc
PE
101042006-02-09 Paul Eggert <eggert@cs.ucla.edu>
10105
10106 More portability fixes for problems summarized by Nelson H. F. Beebe.
10107
10108 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
10109 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
10110 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
10111 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
10112 messes up because C++ code is compiled in 32-bit mode but linked
10113 in 64-bit mode.
10114
6fc0c024
PE
101152006-02-08 Paul Eggert <eggert@cs.ucla.edu>
10116
10117 More portability fixes for problems summarized by Nelson H. F. Beebe.
10118
7870f699
PE
10119 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
10120 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
10121
6fc0c024
PE
10122 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
10123 nodist_PROGRAMS, since we don't need to actually compile the
10124 example if we're just doing a plain 'make'. This avoids bothering
10125 the installer unnecessarily about problems due to weird C++
10126 compilers.
10127
fe6c2fde
PE
101282006-02-06 Paul Eggert <eggert@cs.ucla.edu>
10129
10130 More portability fixes for problems summarized by Nelson H. F. Beebe.
10131
10132 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
10133 than #include "...", and compile with -I'.'. The old method was
10134 not portable, according to Posix and the C standard, and it does
10135 not work with Sun C 5.7, where previous #line directives affect
10136 the working directory used in later #include "..." directives.
10137
927b425b
JMG
101382006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10139
10140 Various DJGGP specific issues in /djgpp
10141
d9735e9e
PE
101422006-02-02 Paul Eggert <eggert@cs.ucla.edu>
10143
10144 More portability fixes for problems summarized by Nelson H. F. Beebe.
10145
10146 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
10147 '#include <map>' works and that you can apply ++ to iterators.
10148
5a6755af
PE
101492006-02-01 Paul Eggert <eggert@cs.ucla.edu>
10150
67a0dc4f
PE
10151 Work around portability problems summarized by Nelson H. F. Beebe in
10152 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
10153
8c86f0ef
PE
10154 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10155 that '#include <string>' works.
10156
de35dd59
PE
10157 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
10158 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
10159 "warning: sorry: semantics of inline function static data `const
10160 unsigned char translate_table[262]' are wrong (you'll wind up with
10161 multiple copies)".
10162
67a0dc4f
PE
10163 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
10164 or, xor to not_, and_, or_, and xor_, respectively. This works
10165 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
10166 random system header somewhere that includes the equivalent of
10167 <iso646.h>.
10168
5a6755af
PE
10169 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
10170 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 10171 Suite Version 2.0.
5a6755af 10172
3f001415
JD
101732006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
10174
10175 During deterministic GLR operation, user actions should be able to
10176 influence the parse by changing yychar. To make this easier to fix and
10177 to make glr.c easier to evolve in general, don't maintain yytoken in
10178 parallel with yychar; just compute yytoken when needed.
10179 * tests/glr-regression.at (Incorrect lookahead during deterministic
10180 GLR): Check that setting yychar in a user action has the intended
10181 effect.
10182 * data/glr.c (yyGLRStack): Remove yytokenp member.
10183 (yyclearin): Don't set *yytokenp.
10184 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
10185 yychar rather than *yytokenp to determine the current lookahead.
10186 Compute yytoken locally when needed.
10187 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
10188 point to.
10189
10190 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
10191 after `--report' documentation.
10192
e2a8c0f5
PE
101932006-01-30 Paul Eggert <eggert@cs.ucla.edu>
10194
10195 * src/parse-gram.y (grammar_declaration): Location of printer
10196 symbol is @1, not list->location. Bug reported by twlevo.
10197 * tests/input.at (Incompatible Aliases): Adjust to above change.
10198
6b702268
PE
101992006-01-29 Paul Eggert <eggert@cs.ucla.edu>
10200
27622431
PE
10201 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
10202 all the test at once. This makes the output easier to read in the
10203 normal case.
10204
6b702268
PE
10205 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
10206 got from <http://bro-ids.org/download.html>. The bug is that
10207 when two actions appeared in succession, the second one was
10208 scanned before the first one was added to the grammar rule
10209 as a midrule action. Bison then output the incorrect warning
10210 "parse.y:905.17-906.36: warning: unused value: $3".
10211 * src/parse-gram.y (BRACED_CODE, action): These are no longer
10212 associated with a value.
10213 (rhs): Don't invoke grammar_current_rule_action_append.
10214 (action): Invoke it here instead.
10215 * src/reader.c (grammar_midrule_action): Now extern.
10216 (grammar_current_rule_action_append): Don't invoke
10217 grammar_midrule_action; that is now the scanner's job.
10218 * src/reader.h (last_string, last_braced_code_loc):
10219 (grammar_midrule_action): New decls.
10220 * src/scan-gram.l (last_string): Now extern, sigh.
10221 (last_braced_code_loc): New extern variable.
10222 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
10223 rule already has an action.
10224 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
10225 * tests/input.at (AT_CHECK_UNUSED_VALUES):
10226 Add some tests to check that the above changes fixed the bug.
10227
d40ba6c2
PE
102282006-01-27 Paul Eggert <eggert@cs.ucla.edu>
10229
10230 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
10231 All used changed. Check whether the symbol has a destructor,
10232 not whether it is typed.
10233 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
10234 that the values are still reported as unused. All line numbers
10235 adjusted.
10236
401aace6
PE
102372006-01-23 Paul Eggert <eggert@cs.ucla.edu>
10238
10239 Work around a bug in bro 0.8, which underparenthesizes its
10240 definition of YYLLOC_DEFAULT.
10241 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
10242 their arguments.
10243 * data/lalr1.cc: Likewise.
10244 * data/yacc.cc: Likewise.
10245
06f01bc4
PE
102462006-01-22 Paul Eggert <eggert@cs.ucla.edu>
10247
401aace6
PE
10248 Work around a bug in Pike 7.0, and give the Pike folks a
10249 better way to override the usual int widths.
10250 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
10251 user can override the types.
10252 (short): #undef, to work around a bug in Pike 7.0.
10253 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
10254 (union yyalloc.yyss): Use yytype_int16 rather than short.
10255 All uses changed.
10256 (yysigned_char): Remove.
10257 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
10258 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
10259 * tests/regression.at (Web2c Actions): Adjust to above changes.
10260
10261 * src/reader.c (check_and_convert_grammar): New function.
10262 (reader): Close the input file even if something went wrong during
10263 parsing. Minor file descriptor leak reported by twlevo.
10264
06f01bc4
PE
10265 * src/assoc.c (assoc_to_string): Use a default: abort (); case
10266 to pacify gcc -Wswitch-default.
10267 * src/scan-gram.l (adjust_location): Use a default: break; case
10268 to pacify gcc -Wswitch-default.
10269 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
10270 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10271 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10272 Move these decls to scan-skel.l, since they don't need to be
10273 visible elsewhere.
10274 * src/scan-skel.l: Accept the above decls.
10275 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
10276 is used.
10277
02650b7f
PE
102782006-01-21 Paul Eggert <eggert@cs.ucla.edu>
10279
10280 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
10281 since we don't want to insist on a version number at the start
10282 of the changelog every time.
10283 * Makefile.maint: Sync from coreutils a bit better.
10284 (sc_trailing_blank): Renamed from sc_trailing_space.
10285 All uses changed.
10286 (sc_no_if_have_config_h, sc_require_config_h):
10287 (sc_prohibit_assert_without_use): New rules.
10288 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
10289 (sc_dd_max_sym_length): Fix leading spaces in rule.
10290 (sc_system_h_headers): Prefix with @.
10291 (sc_useless_cpp_parens, m4-check): Output line numbers.
10292 (changelog-check): Allow version only in head.
10293 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
10294 satisfy new Makefile.maint rule.
10295 * data/glr.c: Likewise.
10296 * data/glr.cc: Likewise.
10297 * data/lalr1.cc: Likewise.
10298 * data/yacc.c: Likewise.
10299 * lib/ebitsetv.c: Likewise.
10300 * lib/lbitset.c: Likewise.
10301 * lib/subpipe.c: Likewise.
10302 * lib/timevar.c: Likewise.
10303 * src/system.h: Likewise.
10304 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
10305 * djgpp/Makefile.maint: Add copyright notice.
10306 * djgpp/README.in: Likewise.
10307 * djgpp/config.bat: Likewise.
10308 * djgpp/config.site: Likewise.
10309 * djgpp/config_h.sed: Likewise.
10310 * djgpp/djunpack.bat: Likewise.
10311 * djgpp/config.sed: Fix copyright notice to match standard format.
10312 * djgpp/subpipe.h: Likewise.
10313 * lib/bitsetv-print.c: Likewise.
10314 * lib/bitsetv.c: Likewise.
10315 * lib/subpipe.h: Likewise.
10316 * lib/timevar.c: Likewise.
10317 * lib/timevar.h: Likewise.
10318 * djgpp/subpipe.c: Use standard recipe for config.h.
10319 * lib/abitset.c: Likewise.
10320 * lib/bitset.c: Likewise.
10321 * lib/bitset_stats.c: Likewise.
10322 * lib/bitsetv-print.c: Likewise.
10323 * lib/bitsetv.c: Likewise.
10324 * lib/ebitsetv.c: Likewise.
10325 * lib/get-errno.c: Likewise.
10326 * lib/lbitset.c: Likewise.
10327 * lib/subpipe.c: Likewise.
10328 * lib/timevar.c: Likewise.
10329 * lib/vbitset.c: Likewise.
10330 * tests/local.at: Likewise.
10331 * src/scan-gram.l: Don't include verify.h, since system.h does
10332 that for us.
10333 * .x-sc_require_config_h: New file.
10334 * .x-sc_unmarked_diagnostics: New file.
10335
287c78f6
PE
103362006-01-20 Paul Eggert <eggert@cs.ucla.edu>
10337
287c78f6
PE
10338 Be a bit more systematic about using 'abort'.
10339 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
10340 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
10341 Put 'default: abort ();' before some other case, to satisfy older
10342 pedantic compilers.
10343 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10344 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
10345 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
10346 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
10347 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
10348 (get_decision_str, get_orientation_str, get_node_alignment_str):
10349 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
10350 (get_linestyle_str, get_arrowstyle_str): Likewise.
10351 * src/conflicts.c (resolve_sr_conflict):
10352 Use a default case rather than one for the one remaining enum
10353 value, to catch invalid enum values as well.
10354 * src/lalr.c (set_goto_map, map_goto):
10355 Prefer "assert (FOO);" to "if (!FOO) abort ();".
10356 * src/nullable.c (nullable_compute, token_definitions_output):
10357 Likewise.
10358 * src/reader.c (packgram, reader): Likewise.
10359 * src/state.c (transitions_to, state_new, state_reduction_find):
10360 Likewise.
10361 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
10362 (symbol_pack): Likewise.
10363 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
10364 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
10365 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
10366 * src/system.h: Don't include <assert.h>.
10367 (assert): New macro.
10368
10369 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
10370 (Destructor Decl, Parser Function, Pure Calling):
10371 Describe rules for braces inside C code more carefully.
287c78f6 10372
c66dfadd
PE
103732006-01-19 Paul Eggert <eggert@cs.ucla.edu>
10374
c21493b8
PE
10375 Fix some porting glitches found by Nelson H. F. Beebe.
10376 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
10377 compilers that don't understand that abort () does not return.
10378 * src/state.c (transitions_to): Likewise.
10379 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10380 that '#include <cstdlib>' works.
10381 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
10382 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
10383 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
10384 for the benefit of some pre-C99 compilers.
10385
b6e3facf
PE
10386 * bootstrap: Undo changes to gnulib files that autoreconf made.
10387
c66dfadd
PE
10388 Minor fixups to get 'make maintainer-check' to work.
10389 * configure.ac: Don't use -Wnested-externs, as it's incompatible
10390 with the new verify.h implementation.
10391 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
10392 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
10393 * data/yacc.c (YYUSE): Likewise.
10394 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
10395 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
10396 * src/parse-gram.y (declaration): Don't pass a string constant
10397 to a function that expects char *, since GCC might complain
10398 about the constant value.
10399 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
10400 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
10401 before #defining them.
10402 * tests/glr-regression.at
10403 (Incorrectly initialized location for empty right-hand side in GLR):
10404 In yyerror, use the msg arg.
10405 (Corrupted semantic options if user action cuts parse):
10406 (Incorrect lookahead during deterministic GLR):
10407 (Incorrect lookahead during nondeterministic GLR):
10408 Don't name a local var 'index'; it shadows string.h's 'index'.
10409
ed94ef2a
AD
104102006-01-19 Akim Demaille <akim@epita.fr>
10411
10412 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
10413 location, not just parts of it.
10414
e9ad4aec
PE
104152006-01-18 Paul Eggert <eggert@cs.ucla.edu>
10416
d6ca7905
PE
10417 * NEWS: Document the fact that multiple %unions are now allowed.
10418 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
10419 * TODO: This feature is now implemented, so remove it from
10420 the wishlist.
d6ca7905 10421
ef1b70e0
PE
10422 * Makefile.maint: Merge with coreutils Makefile.maint.
10423 (CVS_LIST): Use build-aux version if available.
10424 (VERSION_REGEXP): New macro.
10425 (syntax-check-rules): Add sc_no_if_have_config_h,
10426 sc_prohibit_assert_without_use, sc_require_config_h,
10427 sc_useless_cpp_parens.
10428 (sc_obsolete_symbols): Check for O_NDELAY.
10429 (sc_dd_max_sym_length): Track coreutils.
10430 (sc_unmarked_diagnostics): Look in all files, not just *.c.
10431 (sc_useless_cpp_parens): New rule.
10432 (news-date-check): Look for version or today's date.
10433 (changelog-check): Don't require version number near head.
10434 (copyright-check): Use current year instead of hardwiring 2005.
10435 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
10436 (announcement): Add --gpg-key-ID.
10437
10438 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
10439 with "file system".
10440
2073ce56 10441 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
10442 array. Problem reported by twlevo.
10443 * src/reader.c (packgram): Prepend a new sentinel before ritem.
10444 * src/lalr.c (build_relations): Rely on new sentinel.
10445 * src/gram.c (gram_free): Adjust to new sentinel.
10446
b7691f15
JD
104472006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
10448
10449 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
10450 yylookaheadNeeds. All uses updated.
10451 (yysplitStack): Rename local yynewLookaheadStatuses to
10452 yynewLookaheadNeeds.
10453 * data/glr-regression.at (Incorrect lookahead during nondeterministic
10454 GLR): In comments, change `lookahead status' to `lookahead need'.
10455
ddee1b06
PH
104562006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10457
10458 * data/glr.c (yysplitStack): A little stylistic rewrite.
10459
12f4614d
PH
104602006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10461
10462 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
10463
32c29292
JD
104642006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
10465
10466 * doc/bison.texinfo: Fix some typos.
10467 (GLR Semantic Actions): New subsection discussing special
10468 considerations because GLR semantic actions might be deferred.
10469 (Actions): Mention look-ahead usage of yylval.
10470 (Actions and Locations): Mention look-ahead usage of yylloc.
10471 (Special Features for Use in Actions): Add YYEOF entry and mention it
10472 in the yychar entry.
10473 In the yychar entry, remove mention of the local yychar case (pure
10474 parser) since this is irrelevant information when writing semantic
148d66d8 10475 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
10476 yychar is otherwise described as an external variable.
10477 In the yychar entry, don't call it the `current' look-ahead since it
10478 isn't when semantic actions are deferred.
10479 In the yychar and yyclearin entries, add note about deferred semantic
10480 actions.
10481 Add yylloc and yylval entries discussing look-ahead usage.
10482 (Look-Ahead Tokens): When discussing yychar, don't call it the
10483 `current' look-ahead, and do mention yylval and yylloc.
10484 (Error Recovery): Cross-reference `Action Features' when mentioning
10485 yyclearin.
148d66d8 10486 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
10487 look-ahead.
10488 In the yylloc and yylval entries, mention look-ahead usage.
10489
de366a2f 104902006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
10491
10492 * tests/glr-regression.at: Update copyright year to 2006.
10493
bf70fa87
JD
104942006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10495
10496 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
10497 use during nondeterministic operation to track which stacks have
10498 actually needed the current lookahead.
10499 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
10500 Allocate, deallocate, resize, and otherwise shuffle space for
10501 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
10502 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
10503 appropriately during nondeterministic operation.
10504 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
10505 members to store the current lookahead to be used by the deferred
10506 user action.
10507 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
10508 from which the RHS is taken. Set the lookahead members of the new
10509 yySemanticOption according to the lookahead status for stack yyk.
10510 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
10511 yyaddDeferredAction.
10512 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
10513 members of yySemanticOption before invoking yyuserAction, and then set
10514 them back to their current values afterward.
10515 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
10516 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
10517 * tests/glr-regression.at: Remove `.' from the ends of recent test case
10518 titles for consistency.
10519 (Leaked merged semantic value if user action cuts parse): In order to
10520 suppress lint warnings, use arguments in merge function, and assign
10521 char value < 128 in main.
10522 (Incorrect lookahead during deterministic GLR): New test case.
10523 (Incorrect lookahead during nondeterministic GLR): New test case.
10524
05449a2c
JD
105252006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10526
de366a2f 10527 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
10528 !yyvaluep as signal that no semantic value is available to print.
10529 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
10530 to print a semantic value.
10531
4158e0a1 105322006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 10533
4158e0a1
JD
10534 * tests/glr-regression.at: For consistency with my newer test cases,
10535 don't thank myself.
10536
d659304d
JD
105372006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
10538
10539 * data/glr.c (yyresolveValue): When merging semantic options, if at
10540 least one user action succeeds but a later one cuts the parse, then
10541 destroy the semantic value before returning rather than leaking it.
10542 (yyresolveStates): If a user action cuts the parse and thus
10543 yyresolveValue fails, ignore the (unset) semantic value rather than
10544 corrupting the yyGLRState, and empty the semantic options list since
10545 the user actions should have called all necessary destructors.
10546 Simplify code with YYCHK.
10547 * tests/glr-regression.at (Corrupted semantic options if user action
10548 cuts parse): New test case.
10549 (Undesirable destructors if user action cuts parse): New test case.
10550 Before applying any of this patch, this test case never actually failed
10551 for me... but only because the corrupted semantic options usually
10552 masked this bug.
10553 (Leaked merged semantic value if user action cuts parse): New test
10554 case.
10555
6ec2c0f2
AD
105562006-01-05 Akim Demaille <akim@epita.fr>
10557
10558 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
10559
1b9c21fb
PE
105602006-01-04 Paul Eggert <eggert@cs.ucla.edu>
10561
10562 * data/c.m4 (b4_c_modern): New macro, with a new provision for
10563 _MSC_VER. Problem reported by Cenzato Marco.
10564 (b4_c_function_def): Use it.
10565 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
10566 b4_c_modern.
10567 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
10568 than rolling our own.
10569
84866159
AD
105702006-01-04 Akim Demaille <akim@epita.fr>
10571
10572 Also warn about non-used mid-rule values.
10573 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
10574 member.
10575 (symbol_list_new): Adjust.
10576 * src/reader.c (symbol_typed_p): New.
10577 (grammar_rule_check): Use it.
10578 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
10579 Check its rule.
10580 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
10581 Use it.
10582 * tests/actions.at (Exotic Dollars): Adjust.
10583
378f4bd8
AD
105842006-01-04 Akim Demaille <akim@epita.fr>
10585
10586 * src/reader.c (grammar_midrule_action): If $$ is set in a
10587 mid-rule, move the `used' bit to its lhs.
10588 * tests/input.at (Unused values): New.
10589 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
10590
e2a21b6f
PE
105912006-01-03 Paul Eggert <eggert@cs.ucla.edu>
10592
54662697
PE
10593 * doc/bison.texinfo (Bison Options): Say more accurately what
10594 --yacc does.
10595 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
10596 about declarations in the grammar when in Yacc mode, as POSIX does
10597 not require a diagnostic when the grammar uses extensions.
10598
10599 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
10600
073f9288
PE
10601 Warn about dubious constructions like "%token T T".
10602 Reported by twlevo.
10603 * src/symtab.h (struct symbol.declared): New member.
10604 * src/symtab.c (symbol_new): Initialize it to false.
10605 (symbol_class_set): New arg DECLARING, specifying whether
10606 this is a declaration that we want to warn about, if there
10607 is more than one of them. All uses changed.
10608
1221b78a
PE
10609 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
10610 Allow multiple %union directives, whose contents concatenate.
10611 * src/parse-gram.y (grammar_declaration): Likewise.
10612 Use muscle_code_grow, so that we don't need stype_line any more.
10613 All uses changed.
10614
10615 * src/muscle_tab.c (muscle_grow): Fix comment.
10616
e2a21b6f
PE
10617 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
10618 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
10619 Update copyright year to 2006.
10620
8f7e3cf9
AD
106212006-01-03 Akim Demaille <akim@epita.fr>
10622
10623 Have glr.cc pass (some of) the calc.at tests.
10624 * data/glr.cc (b4_parse_param_orig): New.
10625 (b4_parse_param): Improve its definition, and bound it more
10626 clearly in the skeleton.
10627 (b4_epilogue): Append, instead of prepending, in order to keep
10628 #line consistency.
10629 Simplify the generation of auxiliary functions: locations and
10630 purity are mandated.
10631 (b4_global_tokens_and_yystype): Honor it.
10632 * data/location.cc (c++.m4): Don't include it.
10633 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
10634 and AT_SKEL_CC_IF.
10635 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
10636 AT_LALR1_CC_IF.
10637 Be sure to initialize the first position's filename.
10638 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
10639 mandated anyway.
10640 (AT_CHECK_CALC_GLR_CC): New.
10641 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
10642
3953ed88
AD
106432006-01-02 Akim Demaille <akim@epita.fr>
10644
10645 * src/output.c (output_skeleton): Don't hard wire the inclusion of
10646 c.m4.
0a96ba81 10647 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
10648 * data/glr.cc: Do not include stack.hh.
10649
9ecafbbf
AD
106502006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
10651
10652 * data/glr.c: Reformat whitespace with tabs.
10653 (b4_lpure_formals): Remove this unused m4 macro.
10654 * tests/cxx-type.at: Reformat whitespace with tabs.
10655 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
10656 since it's a member. Rename type to isNterm for clarity.
10657
c4d497a0
AD
106582005-12-29 Akim <akim@sulaco.local>
10659
10660 Let glr.cc catch up with symbol_value_print.
10661 * data/glr.cc (b4_yysymprint_generate): Replace by...
10662 (b4_yy_symbol_print_generate): this.
10663 (yy_symbol_print, yy_symbol_value_print): Declare them.
10664
4517da37
PE
106652005-12-28 Paul Eggert <eggert@cs.ucla.edu>
10666
10667 * src/location.h (boundary): Note that a line or column equal
10668 to INT_MAX indicates an overflow.
10669 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
10670 (rule_length_overflow, increment_rule_length, add_column_width):
10671 New functions.
10672 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
10673 (<SC_BRACED_CODE>"}"):
10674 Use increment_rule_length rather than incrementing it by hand.
10675 (adjust_location, handle_syncline): Diagnose overflow.
10676 (handle_action_dollar, handle_action_at):
10677 Fix bug with monstrosities like $-2147483648.
10678 Remove now-unnecessary checks.
10679 (scan_integer): Verify assumptions and remove now-unnecessary checks.
10680 (convert_ucn_to_byte): Verify assumptions.
10681 (handle_syncline): New arg LOC. All callers changed.
10682 Don't store through a value derived from char const * pointer.
10683
10684 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
10685 GCC warnings.
10686
e3233bf6
PE
106872005-12-27 Paul Eggert <eggert@cs.ucla.edu>
10688
10689 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
10690 Remove unnecessary forward static decls.
10691
8f3596a6
AD
106922005-12-27 Akim Demaille <akim@epita.fr>
10693
10694 * src/reader.c (grammar_current_rule_check): Also check that $$
10695 is used.
10696 Take the rule to check as argument, hence rename as...
10697 (grammar_rule_check): this.
10698 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
10699 Rename as...
10700 (grammar_rule_begin, grammar_rule_end): these, for consistency.
10701 (grammar_midrule_action, grammar_symbol_append): Now static.
10702 * tests/torture.at (input): Don't rely on the default action
10703 being always performed.
10704 * tests/calc.at: "Set" $$ even when the action is "cut" with
10705 YYERROR or other.
10706 * tests/actions.at (Exotic Dollars): Instead of using unused
10707 values, check that the warning is issued.
10708
721be13c
PE
107092005-12-22 Paul Eggert <eggert@cs.ucla.edu>
10710
10711 * NEWS: Improve wording for unused-value warnings.
10712
a0af42fc
AD
107132005-12-22 Akim Demaille <akim@epita.fr>
10714
10715 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
10716 (b4_yysymprint_generate): Rename as...
10717 (b4_yy_symbol_print_generate): this.
10718 Generate yy_symbol_print instead of yysymprint.
10719 Generate also yy_symbol_value_print, and use it.
10720
affac613
AD
107212005-12-22 Akim Demaille <akim@epita.fr>
10722
721be13c 10723 * NEWS: Warn about unused values.
affac613
AD
10724 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
10725 a `used' member.
10726 (symbol_list_n_get, symbol_list_n_used_set): New.
10727 (symbol_list_n_type_name_get): Use symbol_list_n_get.
10728 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
10729 * src/reader.c (grammar_current_rule_check): Check that values are
10730 used.
10731 * src/symtab.c (symbol_print): Accept 0.
10732 * tests/existing.at: Remove the type information.
10733 Empty the actions.
10734 Remove useless actions (beware of mid-rule actions: perl -000
10735 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
10736 * tests/actions.at (Exotic Dollars): Use unused values.
10737 * tests/calc.at: Likewise.
10738 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10739 Likewise.
10740
10741 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
10742 rule_useful_p.
10743
9d9b8b70
PE
107442005-12-21 Paul Eggert <eggert@cs.ucla.edu>
10745
8bb4c753
PE
10746 Undo 2005-12-01 tentative license wording change. The wording is
10747 still being reviewed by the lawyers, and we don't want to wait for
10748 them before publishing a test release. For now, revert to the
10749 previous wording.
10750 * NEWS: Undo 2005-12-01 change.
10751 * data/glr.c: Revert to previous license wording.
10752 * data/glr.cc: Likewise.
10753 * data/lalr1.cc: Likewise.
10754 * data/location.cc: Likewise.
10755 * data/yacc.c: Likewise.
10756
9d9b8b70
PE
10757 * NEWS: Reword %destructor vs YYABORT etc.
10758 * data/glr.c: Use American spacing, for consistency.
10759 * data/glr.cc: Likewise.
10760 * data/lalr1.cc: Likewise.
10761 * data/yacc.c: Likewise.
10762 * data/yacc.c: Reformat comments slightly.
10763 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
10764 for consistency. Fix some spelling errors and reword recently-included
10765 text slightly.
10766 * tests/cxx-type.at: Cast results of malloc, for C++.
10767
2c3b392a
AD
107682005-12-21 Joel E. Denny <address@hidden>
10769
10770 * tests/cxx-type.at: Construct a tree, count the parents of shared
10771 nodes, and free each node once and only once. Previously, the memory
10772 for semantic values was leaked instead.
10773
d6cff4dc
AD
107742005-12-21 Joel E. Denny <address@hidden>
10775
10776 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
10777 (yylval, yylloc): If pure, #define to yystackp->yyval and
10778 yystackp->yyloc similar to yychar and yynerrs.
10779 (yyparse): If pure, remove local yylval and yylloc. Add local
10780 yystackp to accommodate pure definitions of yylval and yylloc.
10781 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
10782 yylvalp and yyllocp to &yylval and &yylloc.
10783 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
10784 namespace. Previously, nerrs and char were missing, but lval and lloc
10785 weren't necessary.
10786 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
10787 yylvalp and yyllocp parameters since, if pure, these are now always
10788 accessible through yystackp. If not pure, they are still accessible
10789 globally.
10790 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
10791 `if (YYID (N))' to pacify lint.
10792
a85284cf
AD
107932005-12-21 Akim Demaille <akim@epita.fr>
10794
10795 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
10796 destroy the RHS symbols of a rule.
10797 * data/yacc.c (yylen): Initialize to 0.
10798 Keep its value to the number of items to possibly shift.
10799 In particular, a regular successful parse that ends on YYFINAL by
10800 a (internal) YYACCEPT must not have yylen != 0.
10801 (yyerrorlab, yyreturn): Pop the RHS.
10802 Reorder a bit to emphasize the `shifting' bits of code.
10803 (YYPOPSTACK): Now accept a number of items to pop.
10804 * data/lalr1.cc: Likewise.
10805 * data/glr.c: Formatting changes.
10806 Use goto instead of fall through.
10807 * doc/bison.texinfo (Destructor Decl): Complete.
10808
d508c281
JMG
108092005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10810
10811 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10812 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
10813 * djgpp/config.bat: Replace every occurence of the file name
10814 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10815 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10816 * djgpp/config.sed: Replace every occurence of the file name
10817 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10818 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10819 * djgpp/djunpack.bat: DJGPP specific file.
10820 * djgpp/fnchange.lst: DJGPP specific file.
10821 * djgpp/README.in: Add new information about how to unpack the bison
10822 source on MSDOS and other systems which have 8.3 file name restrictions
10823 using djunpack.bat and fnchange.lst.
10824
3e7a2cd9
PE
108252005-12-12 Paul Eggert <eggert@cs.ucla.edu>
10826
10827 * bootstrap (build_cvs_prefix): Remove; unused.
10828 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
10829 when getting gnulib.
10830
108312005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
10832
10833 * data/glr.c: Reorder typedef declarations for structs to match order
10834 of struct declarations.
10835 Rename yystack everywhere to yystackp except in yyparse where it's not
10836 a pointer.
10837 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
10838 consistency.
10839 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
10840 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
10841 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
10842 lint.
10843
877519f8
PE
108442005-12-09 Paul Eggert <eggert@cs.ucla.edu>
10845
0eca5a39
PE
10846 * tests/sets.at (Accept): Fix typos in regular expression used to
10847 sed out the final state number.
10848
2cec9080
PE
10849 Work around portability problem on Solaris 10: flex-generated
10850 files include <stdio.h> before <config.h>, which messes up
10851 because the latter defines __EXTENSIONS__. Address the problem
10852 by creating two new little files that include <config.h> first,
10853 then include the flex-generated files. Rewrite everyone else
10854 to include <config.h> first, as well.
10855 * lib/timevar.c: Always include "config.h".
10856 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
10857 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
10858 (EXTRA_bison_SOURCES): New macro.
10859 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
10860 * src/system.h: Don't include config.h.
10861 * src/LR0.c: Include <config.h> first.
10862 * src/assoc.c: Likewise.
10863 * src/closure.c: Likewise.
10864 * src/complain.c: Likewise.
10865 * src/conflicts.c: Likewise.
10866 * src/derives.c: Likewise.
10867 * src/files.c: Likewise.
10868 * src/getargs.c: Likewise.
10869 * src/gram.c: Likewise.
10870 * src/lalr.c: Likewise.
10871 * src/location.c: Likewise.
10872 * src/main.c: Likewise.
10873 * src/muscle_tab.c: Likewise.
10874 * src/nullable.c: Likewise.
10875 * src/output.c: Likewise.
10876 * src/parse-gram.y: Likewise.
10877 * src/print.c: Likewise.
10878 * src/print_graph.c: Likewise.
10879 * src/reader.c: Likewise.
10880 * src/reduce.c: Likewise.
10881 * src/relation.c: Likewise.
10882 * src/state.c: Likewise.
10883 * src/symlist.c: Likewise.
10884 * src/symtab.c: Likewise.
10885 * src/tables.c: Likewise.
10886 * src/uniqstr.c: Likewise.
10887 * src/vcg.c: Likewise.
10888
877519f8
PE
10889 * src/parse-gram.y: Fix minor problems uncovered by lint.
10890 (current_lhs, current_lhs_location): Now static.
10891 (current_assoc): Remove unused variable.
10892
10893 Cleanups so that Bison-generated parsers have less lint.
10894 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
10895 Prepend /*ARGSUSED*/, for lint's sake.
10896 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
10897 definition if 'lint' is defined.
10898 (YYID): New macro (or function, if lint).
10899 All uses of /*CONSTCOND*/0 replaced by YYID(0).
10900 * data/yacc.c: Likewise.
10901 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
10902 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
10903 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
10904 is C++ only.
10905 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
10906 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
10907 Use YYID(0) rather than 0, for lint.
10908 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
10909 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
10910
f5228370
PE
109112005-12-07 Paul Eggert <eggert@cs.ucla.edu>
10912
10913 * tests/glr-regression.at
10914 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10915 Close memory leak reported by twlevo.
10916
69ce078b
PE
109172005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
10918
6ff99711
PE
10919 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
10920 all stacks.
10921 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
10922 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10923 New test case.
10924 (Duplicated user destructor for lookahead): This test now is expected
10925 to succeed.
10926
af3412cd
PE
109272005-12-01 Paul Eggert <eggert@cs.ucla.edu>
10928
32b5b719 10929 * NEWS: Document the following change.
af3412cd
PE
10930 * data/yacc.c: Say "parser skeleton" rather than "file", since
10931 it's no longer just a file.
10932 * data/glr.c: Grant a special exception for C GLR parsers, that
10933 reads like the already-existing exception for C LALR(1) parsers.
10934 * data/glr.cc: Likewise.
10935 * data/lalr1.cc: Likewise.
10936 * data/location.cc: Likewise.
10937 * data/yacc.c: Reword the "written by" statement to clarify that
10938 it was the parser skeleton, not the entire output file.
10939 * data/glr.c: Written by Paul Hilfinger.
10940 * data/glr.cc: Written by Akim Demaille.
10941 * data/lalr1.cc: Likewise.
10942
035aa4a0
PE
109432005-11-18 Paul Eggert <eggert@cs.ucla.edu>
10944
d9963c85
PE
10945 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
10946 Fix typos in previous change that broke 'make check'.
10947 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
10948 supported in C.
10949 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
10950 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
10951 We can revert this once things settle down.
10952
035aa4a0
PE
10953 * src/conflicts.c (conflicts_print): Don't print file name twice
10954 when %expect fails because there were no conflicts.
10955 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
10956 change.
10957 * tests/conflicts.at (%expect not enough, %expect too much):
10958 (%expect with reduce conflicts): Adjust to new behavior.
10959
109602005-11-18 Akim Demaille <akim@epita.fr>
10961
10962 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
10963 errors.
10964 * NEWS: Document this.
10965 * doc/bison.texinfo (Expect Decl): Likewise.
10966
d1ff7a7c
AD
109672005-11-16 Akim Demaille <akim@epita.fr>
10968
10969 Generalize the display of semantic values and locations in traces.
10970 * data/glr.c (yy_reduce_print): Fix indices (again).
10971 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
10972 literal integers.
10973 * data/lalr1.cc (yyreduce_print): Rename as...
10974 (yy_reduce_print): this.
10975 Display values and locations.
10976 * data/yacc.c (yy_reduce_print): Likewise.
10977 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
10978 (yysymprint): Move higher to be visible from yy_reduce_print).
10979 (yyparse): Adjust.
10980 * tests/calc.at: Adjust the expected length of the traces.
10981
6de5398d
AD
109822005-11-14 Akim Demaille <akim@epita.fr>
10983
10984 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
10985 from 1 to N, while values and location start at 0.
10986 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
10987
a1373f55
AD
109882005-11-14 Akim Demaille <akim@epita.fr>
10989
10990 * data/glr.c (yy_reduce_print): Fix the $ number.
10991
613d8952
AD
109922005-11-14 Akim Demaille <akim@epita.fr>
10993
10994 "Use" parse parameters.
10995 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
10996 * data/glr.c, data/glr.cc: Use them.
10997 * data/glr.c (YYUSE): Have a C++ definition that supports
10998 non-pointer types.
10999
b2741627
AD
110002005-11-14 Akim Demaille <akim@epita.fr>
11001
11002 * data/glr.c (yyexpandGLRStack): Declare only if defined.
11003
5059b5c8
AD
110042005-11-14 Akim Demaille <akim@epita.fr>
11005
42249483
AD
11006 * data/glr.cc: New.
11007 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 11008
4626a15d
AD
110092005-11-12 Akim Demaille <akim@epita.fr>
11010
11011 Let position and location be PODs.
11012 * data/location.cc (position::initialize, location::initialize): New.
11013 (position::position, location::location): Define only if
11014 b4_location_constructors is defined.
11015 * data/lalr1.cc (b4_location_constructors): Define it for backward
11016 compatibility.
11017 * doc/bison.texinfo (Initial Action Decl): Use initialize.
11018
110192005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
11020
11021 * data/lalr1.cc: Move the body of the ctor and dtor into the
11022 parser file (instead of the header).
11023 Wrap the implementations in a "namespace yy".
11024
110252005-11-12 Akim Demaille <akim@epita.fr>
11026
11027 Have glr.c include its header file when created.
11028 * data/glr.c (b4_shared_declarations): New.
11029 Output them verbatim in the parser if !%defines, otherwise
11030 output then in the header file, and include it instead.
11031
1989d947
AD
110322005-11-11 Akim Demaille <akim@epita.fr>
11033
11034 * data/glr.c: Comment changes.
11035
110362005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
11037
11038 When yydebug, report semantic and location values for reductions.
11039 * data/glr.c (yy_reduce_print): Report the semantic values and the
11040 locations.
11041 (YY_REDUCE_PRINT): Adjust.
11042 (yyglrReduce): Use them.
11043 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
11044 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
11045 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
11046 traces.
11047
02998094
AD
110482005-11-10 Akim Demaille <akim@epita.fr>
11049
11050 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
11051 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
11052 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
11053
5210672f
PE
110542005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
11055
11056 * m4/cxx.m4, examples/Makefile.am: Don't build
11057 examples/calc++ if no C++ compiler is available. (trivial change)
11058
a8991a1d
AD
110592005-11-09 Akim Demaille <akim@epita.fr>
11060
11061 * src/scan-skel.l: Use a couple of asserts.
11062
36b5e963
AD
110632005-11-03 Akim Demaille <akim@epita.fr>
11064
11065 In some (weird) cases, the final state number is incorrect.
11066 Reported by Alexandre Duret-Lutz.
11067 * src/LR0.c (state_list_append): Remove the computation of
11068 final_state.
11069 (save_reductions): Do it here.
11070 (get_state): Alpha conversion.
11071 (generate_states): Use a for loop.
11072 * src/gram.h (item_number_is_rule_number)
11073 (item_number_is_symbol_number): New.
11074 * src/state.c: Use assert.
11075 * src/system.h: Include assert.h.
11076 * tests/sets.at (Accept): New.
11077
44e7ead1
PH
110782005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11079
11080 * data/glr.c (yyfill): Adjust comment.
36b5e963 11081 (yyresolveAction): Initialize default location properly
44e7ead1
PH
11082 for empty right-hand sides.
11083 (yydoAction): Ditto.
11084 Add comment explaining apparently dead code.
36b5e963
AD
11085 * tests/glr-regression.at
11086 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 11087 New test.
36b5e963 11088
e10a80ee
PE
110892005-10-30 Paul Eggert <eggert@cs.ucla.edu>
11090
11091 * bootstrap (cleanup_gnulib): New function. Use it to clean up
11092 gnulib when interrupted. This fixes some race conditions and
11093 works around some portability problems (one noted by Paul
11094 Hilfinger).
11095
067b32ee
AD
110962005-10-22 Akim <akim@epita.fr>
11097
11098 * Makefile.cfg: Adjust to config -> build-aux.
11099 Reported by twledo.
11100
4b367315
AD
111012005-10-21 Akim Demaille <akim@epita.fr>
11102
11103 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
11104 the %parse-params.
11105 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
11106 * data/yacc.c (b4_Pure_if): Rename as...
11107 (b4_yacc_pure_if): this.
11108 (YY_SYMBOL_PRINT, yyparse): Adjust.
11109 * doc/bison.texinfo: Formatting changes.
11110
24cc23d9
AD
111112005-10-21 Akim Demaille <akim@epita.fr>
11112
11113 Finish the transition config -> build-aux.
11114 * configure.ac, Makefile.am: Use build-aux.
11115 * config/prev-version, config/announce-gen, config/Makefile.am:
11116 Move to...
11117 * build-aux/prev-version, build-aux/announce-gen,
11118 * build-aux/Makefile.am: here.
11119
d4476375
AD
111202005-10-14 Akim Demaille <akim@epita.fr>
11121
11122 * examples/calc++/test: Use set -x only when VERBOSE.
11123
302c0aee
PE
111242005-10-13 Paul Eggert <eggert@cs.ucla.edu>
11125
11126 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
11127 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
11128
7625ec2c
AD
111292005-10-13 Akim Demaille <akim@epita.fr>
11130
11131 * src/scan-skel.l: Output the base name parts of the parser and
11132 header file names.
302c0aee 11133 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
11134 additional checks.
11135 Use this to exercise C++ outputs in subdirs.
11136 Reported by Oleg Smolsky.
11137
ba0fe3c7
PE
111382005-10-12 Paul Eggert <eggert@cs.ucla.edu>
11139
11140 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
11141 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
11142 Problem reported by John P. Hartmann.
11143 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
11144 already defined it.
11145
9b8a5ce0
AD
111462005-10-12 Akim Demaille <akim@epita.fr>
11147
11148 * src/parse-gram.y (version_check): Exit 63 to please missing
11149 (stands for "version mismatch).
11150 * tests/input.at, doc/bison.texinfo: Adjust.
11151
4f6e011e
PE
111522005-10-10 Paul Eggert <eggert@cs.ucla.edu>
11153
11154 Work around portability problems with Visual Age C compiler
11155 (xlc and xlC_r) reported by John P. Hartmann.
11156 * data/location.cc (initial_column, initial_line): Remove.
11157 All uses replaced by 0 and 1.
11158 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
11159 that xlc complains about.
11160 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 11161 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 11162 as __STDC__.
4d7aa45e
PE
11163 * data/yacc.c (YYMODERN_C): New macro, which also looks at
11164 __STDC_VERSION__. Use it everywhere instead of looking at
11165 __STDC__ and __cplusplus.
4f6e011e 11166
a1b3bf8c
AD
111672005-10-10 Akim Demaille <akim@epita.fr>
11168
11169 * examples/calc++/test: Be quiet unless VERBOSE.
11170
412e44aa
PE
111712005-10-05 Paul Eggert <eggert@cs.ucla.edu>
11172
2a4647a3
PE
11173 * data/c.m4 (yydestruct, yysymprint):
11174 Use YYUSE instead of casting to void.
11175 * data/glr.c (YYUSE): New macro.
11176 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11177 Use it instead of rolling our own.
11178 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11179 (YYCHK1):
11180 Use /*CONSTCOND*/ to suppress lint warnings.
11181 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11182 (YY_STACK_PRINT): Use 'false' not '0'.
11183 (YYUSE): New macro.
11184 (yysymprint_, yydestruct_): Use it instead of rolling our own.
11185 * data/yacc.c (YYUSE): New macro.
11186 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
11187 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
11188 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
11189
11190
412e44aa
PE
11191 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
11192 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
11193
88c6637f
PE
111942005-10-04 Paul Eggert <eggert@cs.ucla.edu>
11195
2f4f028d
PE
11196 Undo the parts of the unlocked-I/O change that substituted
11197 putc or puts for printf. This might hurt performance a bit,
11198 but some people prefer the printf style.
11199 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
11200 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
11201 All uses replaced by YYFPRINTF and YYDPRINTF.
11202 * data/yacc.c: Likewise.
11203 * lib/bitset.c (bitset_print): Likewise.
11204 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
11205 putc and puts.
11206 * lib/lbitset.c (debug_lbitset): Likewise.
11207 * src/closure.c (print_firsts, print_fderives): Likewise.
11208 * src/gram.c (grammar_dump): Likewise.
11209 * src/lalr.c (look_ahead_tokens_print): Likewise.
11210 * src/output.c (escaped_output): Likewise.
11211 (user_actions_output): Break apart two printfs.
11212 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
11213 * src/reduce.c (reduce_print): Likewise.
11214 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
11215 * src/system.h: Include unlocked-io.h rathe than stdio.h.
11216
88c6637f
PE
11217 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11218 Use assignments rather than casts-to-void to suppress
11219 unused-variable warnings. This pacifies 'lint'.
11220 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
11221 unused-variable warnings.
11222
fb32e373
JMG
112232005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11224
11225 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11226
edb8f44f
PE
112272005-10-02 Paul Eggert <eggert@cs.ucla.edu>
11228
fb9c0b33
PE
11229 Use unlocked I/O for a minor performance improvement on hosts like
11230 GNU/Linux and Solaris that support unlocked I/O. The basic idea
11231 is to use the gnlib unlocked-io module, and to prefer putc and
11232 puts to printf when either will work (since the latter doesn't
11233 come in an unlocked flavor).
11234 * bootstrap (gnulib_modules): Add unlocked-io.
11235 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
11236 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
11237 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
11238 and similarly for puts and putc and printf.
11239 * data/yacc.c: Likewise.
11240 * lib/bitset.c (bitset_print): Likewise.
11241 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
11242 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
11243 to printf.
11244 * lib/lbitset.c (debug_lbitset): Likewise.
11245 * src/closure.c (print_firsts, print_fderives): Likewise.
11246 * src/gram.c (grammar_dump): Likewise.
11247 * src/lalr.c (look_ahead_tokens_print): Likewise.
11248 * src/output.c (escaped_output): Likewise.
11249 (user_actions_output): Coalesce two printfs.
2f4f028d 11250 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
11251 * src/reduce.c (reduce_print): Likewise.
11252 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 11253 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 11254
edb8f44f
PE
11255 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
11256 this confuses xgettext.
11257
b50d2359
AD
112582005-10-02 Akim Demaille <akim@epita.fr>
11259
11260 * bootstrap (gnulib_modules): Add strverscmp.
11261 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
11262 * m4/.cvsignore: Add strverscmp.m4.
11263 * src/parse-gram.y (%require): New token, new rule.
11264 (version_check): New.
11265 * src/scan-gram.l (%require): Adjust.
11266 * tests/input.at (AT_REQUIRE): New.
11267 Use it.
11268 * doc/bison.texinfo (Require Decl): New.
11269 (Calc++ Parser): Use %require.
11270
21667f64
AD
112712005-10-02 Akim Demaille <akim@epita.fr>
11272
11273 * data/location.cc: New.
11274
2b81e969
AD
112752005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
11276 Akim Demaille <akim@epita.fr>
11277
11278 Make sure -odir/foo.cc creates dir/location.hh etc.
11279 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
11280 (spec_file_prefix, spec_verbose_file, spec_graph_file)
11281 (spec_defines_file): Now const.
11282 (dir_prefix): New.
11283 (short_base_name): Remove.
11284 * src/files.c: Adjust.
11285 (dirname.h): Include.
11286 (base_name): Don't prototype it.
11287 (finput): Remove, duplicates gram_in.
11288 (full_base_name, short_base_name): Replace by...
11289 (all_but_ext, all_but_tab_ext): these.
11290 (compute_base_names): Rename as...
11291 (compute_file_name_parts): this.
11292 Update to compute the new variables, including dir_prefix.
11293 Adjust dependencies.
11294 * src/output.c (prepare): Output them.
11295 * src/reader.c: Adjust to use gram_in, not finput.
11296 * src/scan-skel.l (@dir_prefix@): New.
11297
ad6a9b97
JMG
112982005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11299
11300 * lib/subpipe.c: New function end_of_output_subpipe() added
11301 to allow support for non-posix systems. This is a no-op function
11302 for posix systems.
11303
11304 * lib/subpipe.h: New function end_of_output_subpipe() added
11305 to allow support for non-posix systems. This is a no-op function
11306 for posix systems.
11307
11308 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
11309 handle the lack of pipe/fork functionality on non-posix systems.
11310
11311 * djgpp/Makefile.maint: DJGPP specific file.
11312
11313 * djgpp/README.in: DJGPP specific file.
11314
11315 * djgpp/config.bat: DJGPP specific configuration file.
11316
11317 * djgpp/config.sed: DJGPP specific configuration file.
11318
11319 * djgpp/config.site: DJGPP specific configuration file.
11320
11321 * djgpp/config_h.sed: DJGPP specific configuration file.
11322
11323 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
11324
11325 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
11326
fc695704
AD
113272005-10-02 Akim Demaille <akim@epita.fr>
11328
11329 * data/location.cc: New, extract from...
11330 * data/lalr1.cc: here.
11331 (location.hh): Include it after the user prologue, in case the
11332 filename type is defined by the user.
11333 Forward declation location and position before the pre-prologue.
11334 (yyresult_): Rename as...
11335 (yyresult): this, it's a local variable, not an attribute.
11336 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
11337
113382005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
11339
11340 * examples/extexi: Restore the #line generation.
11341
fb9712a9
AD
113422005-09-30 Akim Demaille <akim@epita.fr>,
11343 Alexandre Duret-Lutz <adl@gnu.org>
11344
11345 Move the token type and YYSTYPE in the parser class.
11346 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
11347 (parser::token): New, from the moved free definition of tokens.
11348 (parser::semantic_value): Now a full definition instead of an
11349 indirection to YYSTYPE.
11350 (b4_post_prologue): No longer included in the header file, but
11351 in the implementation file.
11352 * doc/bison.texi (C+ Language Interface): Update.
11353 * src/parse-gram.y: Support unary %define.
11354 * tests/actions.at: Define global_tokens_and_yystype for backward
11355 compatibility until we update the tests.
11356 * tests/calc.at: Idem.
11357 (first_line, first_column, last_line, last_column): Define for lalr1.cc
11358 to simplify the code.
11359
55f0c7b1
PE
113602005-09-29 Paul Eggert <eggert@cs.ucla.edu>
11361
11362 Port to SunOS 4.1.4, which lacks strtoul and strerror.
11363 Ah, the good old days! Problem reported by Peter Klein.
11364 * bootstrap (gnulib_modules): Add strerror, strtoul.
11365 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
11366 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
11367
fb9712a9 113682005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
11369
11370 * data/c.m4 (b4_error_verbose_if): New.
11371 * data/lalr1.cc: Use it.
11372 (YYERROR_VERBOSE_IF): Remove.
11373 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
11374 parser members, replaced by...
11375 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
11376 local variables.
11377 (yysyntax_error_): Takes the state number as argument.
11378 (yyreduce_print_): Use the argument yyrule, not the former
11379 attribute yyn_.
11380
8a6f72f3
PE
113812005-09-26 Paul Eggert <eggert@cs.ucla.edu>
11382
11383 * bootstrap (gnulib_modules): Add verify.
11384 * lib/.cvsignore: Add verify.h.
11385 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
11386 * src/system.h (verify): Remove.
11387 Include verify.h instead.
11388 * src/tables.c (tables_generate): Use new API for 'verify'.
11389
0d50976f
PE
113902005-09-21 Paul Eggert <eggert@cs.ucla.edu>
11391
ebc3737e
PE
11392 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
11393 local variables whose names begin with 'yy'.
11394 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11395 Trivial changes from Joel E. Denny.
11396
0d50976f
PE
11397 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
11398 it itself.
11399 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
11400 don't use alloca any more.
11401
11402 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
11403 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 11404 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
11405 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
11406 to match yacc.c, to test more hosts.
11407
a05b79df
PE
114082005-09-20 Paul Eggert <eggert@cs.ucla.edu>
11409
55289366
PE
11410 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
11411 doesn't affect behavior.
11412 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
11413 Solaris, AIX, MSC.
11414 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
11415 This works a bit better with glibc, if user code has already included
11416 stdlib.h.
11417 * doc/bison.texinfo (Bison Parser): Document that users can't
11418 arbitrarily use malloc and free for other purposes. Document
11419 that <alloca.h> and <malloc.h> might be included.
11420 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
11421 user must declare alloca.
11422
a05b79df
PE
11423 * HACKING (release): Forwarn the Translation Project about
11424 stable releses.
11425
3ab2ca22
AD
114262005-09-20 Akim Demaille <akim@epita.fr>
11427
11428 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
11429
a9739e7c
PE
114302005-09-19 Paul Eggert <eggert@cs.ucla.edu>
11431
a702593e
PE
11432 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
11433 (YYSTACK_ALLOC_MAXIMUM): Use it.
11434 (yysyntax_error): New function.
11435 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
11436 multiple syntax errors are reported, and alloca is being used.
11437 Instead, reallocate buffers twice as big each time, so that
11438 we waste at most half the allocated memory. Start with a small
11439 (128-byte) buffer that will suffice in most cases anyway.
11440 Use yysyntax_error to do most of the work.
11441
11442 * doc/bison.texinfo (Error Reporting, Table of Symbols):
11443 yynerrs is the number of errors reported, not the number of
11444 errors encountered.
11445
a9739e7c
PE
11446 * tests/glr-regression.at (Duplicated user destructor for lookahead):
11447 Mark it as expected to fail.
11448 Cast result of malloc; problem reported by twlevo@xs4all.nl.
11449 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
11450 Don't start user-code symbols with "yy", to avoid name space problems.
11451
f479c6c6
AD
114522005-09-19 Akim Demaille <akim@epita.fr>
11453
11454 Remove the traits, failed experiment.
11455 It never proved useful, and anyway because of the current
11456 definition, it was not possible to have several specialization of
11457 this traits, making it useless.
11458 * data/lalr1.cc (yy:traits): Remove.
11459 Inline its definitions in the parser class.
11460
e2586f82
AD
114612005-09-19 Akim Demaille <akim@epita.fr>
11462
11463 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
11464 least Mac OSX with a /usr/local install of gettext.
11465
2e8cf949
AD
114662005-09-19 Akim Demaille <akim@epita.fr>
11467
11468 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
11469 and yytoken for similarity with the other skeletons.
11470
c7fb0b90
AD
114712005-09-19 Akim Demaille <akim@epita.fr>
11472
4e26c69e 11473 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 11474
1bd0deda
PE
114752005-09-16 Paul Eggert <eggert@cs.ucla.edu>
11476
11477 * NEWS: Version 2.1.
11478
11479 * NEWS: Remove notice of yytname change, since it was never in an
11480 official release.
11481 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
11482 diagnostic.
11483 * src/output.c (prepare): Likewise.
11484 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
11485 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
11486 is not defined. This is an awful hack, but it's enough for now.
11487 All callers changed.
11488 * tests/glr-regression-at (make_value): Args are const pointers now,
11489 to avoid GCC warning.
11490 (Duplicated user destructor for lookahead): New test. Currently
11491 skipped. It fails on my host but I'm not sure it'll always fail.
11492
114932005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
11494
11495 * src/symtab.h (struct symbol): Declare the printer and destructor
11496 as const, to avoid accidental calls to free.
11497 (symbol_destructor_set, symbol_printer_set): Adjust.
11498 * src/symtab.c: Adjust.
11499
1bd0deda 115002005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
11501
11502 * data/c.m4 (b4_token_enums): New.
11503 (b4_token_defines): Rename as...
11504 (b4_token_enums_defines): this.
11505 (b4_token_defines): New, output only the #defines.
11506 * data/yacc.c, data/glr.c: Adjust.
11507 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
11508 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
11509 as default values.
11510
dbcdae2d
AD
115112005-09-16 Akim Demaille <akim@epita.fr>
11512
11513 * data/lalr1.cc (yylex_): Remove, inline its code.
11514 (yyreport_syntax_error_): Remove, replaced by...
11515 (yysyntax_error_): this which returns a string and leaves to the
11516 caller the call to the users' error function.
11517 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
11518 Move from members of the parser object...
11519 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
11520 to local variables of the parse function.
11521
70d8f291
AD
115222005-09-16 Akim Demaille <akim@epita.fr>
11523
11524 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
11525 since it's in Bison's name space.
11526
b47dbebe
PE
115272005-09-15 Paul Eggert <eggert@cs.ucla.edu>
11528
ae199bf1
PE
11529 * data/glr.c (yyresolveValue): Add default case to pacify
11530 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
11531
b47dbebe
PE
11532 * NEWS: Document when yyparse started to return 2.
11533 * doc/bison.texinfo (Parser Function): Document when yyparse
11534 returns 2.
11535
11536 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
11537 (b4_filename_type): Renamed back from b4_file_name_type. All uses
11538 changed.
11539 (class position): file_name -> filename (reverting). All uses changed.
11540
115412005-09-14 Paul Eggert <eggert@cs.ucla.edu>
11542
11543 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
11544 do anything if $@ exists. This reverts part of the 2005-07-07
11545 patch.
11546
00292f66
PE
115472005-09-11 Paul Eggert <eggert@cs.ucla.edu>
11548
11549 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
11550 contains obsolete information and isn't worth distributing as a
11551 separate file anyway.
11552 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
11553 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
11554 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
11555 (yyparse): Abort if user code uses longjmp to throw an unexpected
11556 value.
11557
a420f962
PE
115582005-09-09 Paul Eggert <eggert@cs.ucla.edu>
11559
00292f66
PE
11560 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
11561 Suggested by twlevo@xs4all.nl.
11562
127287e9
PE
11563 * data/glr.c (YYCHK1): Do not assume YYE is in range.
11564 This avoids a diagnostic from gcc -Wswitch-enum.
11565 Problem reported by twlevo@xs4all.nl.
11566
a420f962
PE
11567 * doc/bison.texinfo: Don't use "filename", as per GNU coding
11568 standards. Use "file name" or "file" or "name", depending on
11569 the context.
11570 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
11571 not to hack/foo.tab.c.
11572 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
11573 * data/glr.c: b4_filename -> b4_file_name.
11574 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
11575 All uses changed.
11576 (class position): filename -> file_name. All uses changed.
11577 * data/yacc.c: b4_filename -> b4_file_name.
11578 * lib/bitset.h: filename -> file_name in local vars.
11579 * lib/bitset_stats.c: Likewise.
11580 * src/files.c: Likewise.
11581 * src/scan-skel.l ("@output ".*\n): Likewise.
11582 * src/files.c (file_name_split): Renamed from filename_split.
11583 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
11584
115852005-09-08 Paul Eggert <eggert@cs.ucla.edu>
11586
11587 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
11588 to accommodate latest gnulib.
11589
11590 * tests/glr-regression.at (Duplicate representation of merged trees):
11591 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
11592
11593 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
11594 needed.
11595
42a6501d
PE
115962005-08-26 Paul Eggert <eggert@cs.ucla.edu>
11597
11598 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
11599 All uses changed. Invoke user destructor after an error during a
11600 split parse (trivial change from Joel E. Denny).
11601
11602 * tests/glr-regression.at
11603 (User destructor after an error during a split parse): New test case.
11604 Problem reported by Joel E. Denny in:
11605 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
11606
ef9a1faf
PE
116072005-08-25 Paul Eggert <eggert@cs.ucla.edu>
11608
5b4aaf78
PE
11609 * README-cvs: Give URLs for recommended tools.
11610 Mention Gzip version problem, and bootstrapping issues.
11611 Remove troubleshooting section, as it's somewhat obsolete.
11612
b5240ba5
PE
11613 * bootstrap (no_cache): New var, to accommodate different wget
11614 variants. Use it instead of '-C off'. Problem reported by
11615 twlevo@xs4all.nl.
11616
ef9a1faf
PE
11617 * data/glr.c (yydestroyStackItem): New function.
11618 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
11619 debugging information. Problem reported by Joel E. Denny.
11620
e6efa9da
AD
116212005-08-25 Akim Demaille <akim@epita.fr>
11622
11623 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
11624
adc90f13
PE
116252005-08-24 Paul Eggert <eggert@cs.ucla.edu>
11626
11627 * data/glr.c (yyrecoverSyntaxError, yyreturn):
11628 Don't invoke destructor on unresolved entries.
11629 * tests/glr-regression.at
11630 (User destructor for unresolved GLR semantic value): New test case.
11631 Problem reported by Joel E. Denny in:
11632 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
11633
f9315de5
PE
116342005-08-21 Paul Eggert <eggert@cs.ucla.edu>
11635
15d29c1f
PE
11636 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
11637 Add strnlen.c.
11638 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
11639 lib-prefix.m4, po.m4.
11640
dd5f2af2
PE
11641 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
11642 in yydestruct diagnostic, since it might not be an error.
11643 Problem reported by Joel Denny near end of
11644 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 11645 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
11646 * data/yacc.c (yyreturn): Likewise.
11647 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
11648
11649 * src/files.c: Remove obsolete FIXME comment.
11650
11651 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
11652 with the other templates, and to fix bogus run-on messages such
11653 as the one reported at the end of
11654 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11655 All callers changed to avoid the newline.
11656 (yyprocessOneStack): Output two lines rather than one, to accommodate
11657 the above change. This changes the debug output format slightly.
11658
f9315de5
PE
11659 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
11660 reported by Joel E. Denny in
11661 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
11662 (trivial change).
11663 * tests/glr-regression.at (Duplicate representation of merged trees):
11664 New test, from Joel E. Denny in:
11665 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
11666 * THANKS: Add Joel E. Denny.
11667
11668 * configure.ac (AC_INIT): Bump to 2.0c.
11669
04098407
PE
116702005-07-24 Paul Eggert <eggert@cs.ucla.edu>
11671
11672 * NEWS: Version 2.0b.
11673
ca5d2013
PE
11674 * Makefile.am (SUBDIRS): Put examples before tests, so that
11675 "make check" doesn't finish with "All 1 tests passed".
11676
3d54b576
PE
11677 * tests/regression.at (Token definitions): Don't rely on
11678 AT_PARSER_CHECK for data that contains backslashes. It currently
11679 uses 'echo', and 'echo' isn't portable if its argument contains
11680 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
11681 that the byte '\0xff' is not printable in the C locale; it is,
11682 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
11683 not printable, so use '\0x81' to test.
11684
d53ae497
PE
11685 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
11686 version of GCC, since the macro is used with non-GCC compilers.
11687
fc01665e
PE
11688 Fix core dump reported by Pablo De Napoli in
11689 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
11690 * tests/regression.at (Invalid inputs with {}): New test.
11691 * src/parse-gram.y (token_name): Translate type before using
11692 it as an index.
11693
04098407
PE
11694 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
11695 the user's name space. All uses changed to __attribute__
11696 ((__unused__)).
11697 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
11698 Add __attribute__ ((__noreturn__)).
11699
11700 * etc/clcommit: Remove. We weren't using it, and it failed
11701 "make maintainer-distcheck".
11702 * Makefile.maint: Merge from coreutils.
11703 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
11704 (syntax-check-rules): Change list of rules as described below.
11705 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
11706 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
11707 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
11708 (sc_trailing_space): New rules.
11709 (sc_xalloc_h_in_src): Remove.
11710 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
11711 (sc_space_tab, sc_error_exit_success, sc_changelog):
11712 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
11713 (makefile-check, po-check, author_mark_check):
11714 (makefile_path_separator_check, copyright-check):
11715 Use grep -n, to make it easier to find violations.
11716 Use CVS_LIST and CVS_LIST_EXCEPT.
11717 (header_regexp, h_re): Remove.
11718 (dd_c): New macro.
11719 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
11720 (my-distcheck): Use more-modern GCC flags.
11721 (signatures, %.asc): Remove.
11722 (rel-files, announcement): Remove signatures.
11723 Restore old updating code, even though we don't use it, so
11724 that we're the same as coreutils.
11725 (alpha, beta, major): Depend on news-date-check.
11726 Make the upload commands.
11727
11728 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
11729 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
11730 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
11731 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
11732 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
11733 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
11734 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
11735 * tests/sets.at: Likewise.
11736
11737 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
11738 we comment out the Autoconf version number.
11739 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
11740 it's error-prone and "make maintainer-distcheck" rejects it.
11741
11742 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
11743 Indent calls to "error" to pacify "make maintainer-distcheck",
11744 when the calls are not intended to be translated.
11745 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
11746
11747 * src/Makefile.am (DEFS): Use +=, to pacify
11748 "make maintainer-distcheck".
11749 (bison_SOURCES): Add scan-skel.h.
11750 (sc_tight_scope): New rule, from coreutils.
11751
11752 * src/files.c (src_extension, header_extension):
11753 Now static, not extern.
11754 * src/getargs.c (short_options): Likewise.
11755 * src/muscle_tab.c (muscle_table): Likewise.
11756 * src/parse-gram.y (current_class, current_type, current_prec):
11757 Likewise.
11758 * src/reader.c (grammar_end, previous_rule_end): Likewise.
11759 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
11760 * src/main.c (main): Cast bindtextdomain and textdomain calls to
11761 void, to avoid warning when NLS is disabled.
11762 * src/output.c: Include scan-skel.h.
11763 (scan_skel): Remove decl, since scan-skel.h does this.
11764 (output_skeleton):
11765 Indent calls to "error" to pacify "make maintainer-distcheck".
11766 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
11767 * src/reader.h (gram_end, gram_lineno): New decls to pacify
11768 "make maintainer-distcheck".
11769 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
11770 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
11771 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
11772 (skel_lex_destroy, scan_skel): Move these decls to...
11773 * src/scan-skel.h: New file.
11774 * src/uniqstr.c (uniqstr_assert):
11775 Indent calls to "error" to pacify "make maintainer-distcheck".
11776
11777 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
11778 not @VAR@.
11779
11780 * tests/torture.at: Revamp to avoid misuse of atoi that
11781 "make maintainer-distcheck" complained about.
11782
11783 * examples/extexi (message): Don't print a message more than once,
11784 and omit line-number decoration that makes Emacs compile think
11785 that informative messages are worth worrying about.
11786
117872005-07-22 Paul Eggert <eggert@cs.ucla.edu>
11788
11789 * configure.ac: Update version number.
11790
11791 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
11792 accidentally.
11793 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
11794 autogenerated by the maintainer.
11795 * examples/calc++/.cvsignore: Add *.yy.
11796
11797 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
11798 * lib/bitset_stats.c (bitset_stats_init): Likewise.
11799 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11800
11801 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
11802
11803 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
11804 from maintainer-distcheck about casting the argument of 'free'.
11805
11806 * NEWS: Mention recent yytname changes.
11807 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
11808
11809 * bootstrap: For translations that have not yet been upgraded to
11810 the new runtime-po domain, prime the pump by extracting the
11811 relevant strings from the obsolete translations. This code can be
11812 removed once the bison-runtime domain has been translated by each
11813 team.
11814
11815 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
11816 now that token names are already quoted.
11817
11818 Fix problem reported by Anthony Heading.
11819 * data/glr.c (YYTOKEN_TABLE): New macro.
11820 (yytname): Define if YYTOKEN_TABLE.
11821 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
11822 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
11823 (YYERROR_VERBOSE): Define the same way the other skeletons do.
11824 * src/output.c (prepare_symbols): Output token_table_flag.
11825
0ffda363
PE
118262005-07-21 Paul Eggert <eggert@cs.ucla.edu>
11827
11828 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
11829 again if the first call fails.
11830
11831 * data/glr.c (yytnamerr): New function.
11832 (yyreportSyntaxError): Use it to dequote most string literals.
11833 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
11834 with other skeletons. All uses changed.
11835 (yytnameerr_): New function.
11836 (yyreport_syntax_error): Use it to dequote most string literals.
11837 * data/yacc.c (yytnamerr): New function.
11838 (yyerrlab): Use it to decode most string literals.
11839 * doc/bison.texinfo (Decl Summary, Calling Convention):
11840 Clarify quoting convention of yytname.
11841 * src/output.c (prepare_symbols): Quote all names. This undoes
11842 the 2005-04-17 change, which is now accomplished (mostly) via
11843 changes in the parsers as described above.
11844 * tests/regression.at (Token definitions, Web2c Actions):
11845 Undo most 2005-04-17 change here, too.
11846
118472005-07-20 Paul Eggert <eggert@cs.ucla.edu>
11848
11849 Fix more problems reported by twlevo@xs4all.nl.
11850 * tests/cxx-type.at: Don't pipe output of ./types through sed to
11851 remove trailing spaces. This loses the exit status of ./types,
11852 and isn't needed since ./types shouldn't be emitting trailing
11853 spaces.
11854 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
11855 as the stack isn't valid in that case.
11856
11857 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
11858 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
11859 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
11860 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
11861 is used.
11862 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
11863 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
11864 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
11865 Likewise.
11866
11867 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
11868 overly-picky compilers that reject 'char *foo = "bar";'.
11869
11870 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
11871 to FILE * parameter, not to stderr. This fixes a typo introduced
11872 in the 2005-07-12 change.
11873
11874 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
11875 warnings from GCC 4.
11876
11877 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
11878 (yyglrShiftDefer, yysplitStack):
11879 Remove unused parameters b4_pure_formals. All uses changed.
11880 (yyglrShift): Remove unused parameters b4_user_formals.
11881 All uses changed.
11882 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
11883
6100a9aa
PE
118842005-07-18 Paul Eggert <eggert@cs.ucla.edu>
11885
258b75ca
PE
11886 Destructor cleanups and regularization among the three skeletons.
11887 * NEWS: Document the behavior changes.
11888 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
11889 stack before failing, as the cleanup code will do it for us now.
11890 * data/lalr1.cc (yyerrlab): Likewise.
11891 * data/glr.c (yyparse): Pop everything off the stack before
11892 freeing it, so that destructors get called properly.
11893 * data/lalr1.cc (yyreturn): Likewise.
11894 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
11895 This is more consistent.
11896 * doc/bison.texinfo (Destructor Decl): Mention more reasons
11897 why destructors might be called. 1.875 -> 2.1.
11898 (Destructor Decl, Decl Summary, Table of Symbols):
11899 Some English-language cleanups for %destructor.
11900 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11901 Add output line for destructor of start symbol.
11902 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
11903 because of that same extra output line.
11904
1a059451
PE
11905 * NEWS: Document minor wording changes in diagnostics of
11906 Bison-generated parsers.
11907 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
11908 Remove unused formals. All uses changed.
11909 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
11910 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
11911 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
11912 Rename yyoverflowab to yyexhaustedlab.
11913 When memory exhaustion occurs during syntax-error reporting,
11914 report it separately rather than in a single diagnostic; this
11915 eases translation.
11916 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
11917 (Memory Exhausted): Renamed from Parser Stack Overflow.
11918 Revamp wording slightly to prefer "memory exhaustion".
11919 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
11920
97460c78
PE
11921 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
11922
30757c8c
PE
11923 Add i18n support to the GLR skeleton. Partially fix the C++
11924 skeleton; a C++ expert needs to finish this. Remove debugging
11925 msgids; there's little point to having them translated, since they
11926 can be understood only by someone who can read the
11927 (English-language) source code.
11928
11929 Generate runtime-po/bison-runtime.pot automatically, so that we
11930 don't have to worry about garbage getting in that file. We'll
11931 make sure after the next official release that old msgids don't
11932 get lost. See
11933 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
11934
11935 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
11936 Now auto-generated.
11937 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
11938 Fix typos in explanations of the runtime file.
11939 * bootstrap: Change gettext keyword from YYI18N to YY_.
11940 Use standard Makefile.in.in in runtime-po, since we'll arrange
11941 for backward-compatible bison-runtime.po files in a different way.
11942 * data/glr.c (YY_): New macro, from yacc.c.
11943 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
11944 Translate messages intended for users.
11945 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
11946 the wording in the other skeletons. We don't know that the memory
11947 is virtual.
11948 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
11949 Use same method that yacc.c uses.
11950 Don't translate debugging messages.
11951 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
11952 it doesn't work (yet), and requires C++ expertise to fix.
11953 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
11954 Move defn to a more logical place, to be consistent with other
11955 skeletons.
11956 Don't translate debugging messages.
11957 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
11958 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
11959 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
11960 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
11961
ac8c5689
PE
11962 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
11963 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
11964 void, not int.
11965 * tests/glr-regression.at (Badly Collapsed GLR States):
11966 Likewise.
11967 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11968 yylex should return 0 at EOF rather than aborting.
11969
6100a9aa
PE
11970 Improve tests for stack overflow in GLR parser.
11971 Problem reported by twlevo@xs4all.nl.
11972 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
11973 All uses removed.
11974 (yyStackOverflow): Just longjmp, but with value 2 so that caller
11975 can handle the problem.
11976 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
11977 (yyparse): New local variable yyresult to record the result.
11978 Use result of setjmp to set it, rather than storing itinto
11979 struct.
11980 (yyDone): Remove label.
11981 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
11982 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
11983 if YYABORT is used).
11984 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
11985 yyparse status; put status > 1 into diagnostic.
11986 Check that status==2 works.
11987 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
11988 Use exit status 3 for failure to open (which shouldn't happen).
11989
15f40952
PE
119902005-07-17 Paul Eggert <eggert@cs.ucla.edu>
11991
67fd79c4
PE
11992 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
11993 1 on syntax error; just let yyparse do its thing.
11994 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
11995 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
11996 (Exploding the Stack Size with Alloca):
11997 (Exploding the Stack Size with Malloc):
11998 Expect exit status 2, not 1, since the parser is supposed to blow
11999 its stack. Problem reported by twlevo@xs4all.nl.
12000
15f40952
PE
12001 * data/glr.c (yyparse): Don't assume that the initial calls
12002 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
12003 Print a stack-overflow message and fail instead.
12004 Initialize the line-number information before creating the stack,
12005 so that the stack-overflow message can report line zero safely.
12006
f32c66b5
PE
120072005-07-14 Paul Eggert <eggert@cs.ucla.edu>
12008
a22ff96f 12009 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
12010 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
12011 (yyuserMerge): Provide a default case if b4_mergers is empty.
12012 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
12013 * tests/glr-regression.at
12014 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 12015 Add casts to pacify C++ compilers.
1beb0b24
PE
12016 * tests/glr-regression.at (Improper merging of GLR delayed action
12017 sets): Declare yylex before using it.
f32c66b5 12018 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
12019 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
12020 test for valgrind; valgrind is independent of g++.
12021 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
12022 for compatibility with POSIX 1003.1-2001 (if running coreutils).
12023 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
12024 Use a destructor, so that we can expand the stack. Change
12025 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 12026
d741bd1b
PE
120272005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12028
12029 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
12030 a valgrind failure. Problem reported by twlevo@xs4all.nl.
12031
0410a6e0
PE
120322005-07-13 Paul Eggert <eggert@cs.ucla.edu>
12033
12034 * PACKAGING: New file, suggested by Bruno Haible and taken from
12035 similar wording in gettext's PACKAGING file.
12036 * NEWS: Mention PACKAGING.
12037 * Makefile.am (EXTRA_DIST): Add PACKAGING.
12038
f7ab6a50
PE
120392005-07-12 Paul Eggert <eggert@cs.ucla.edu>
12040
baf785db 12041 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
12042 * bootstrap: Get runtime translations into runtime-po.
12043 Create runtime-po files automatically, if possible.
12044 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
12045 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
12046 does not infringe on the user's name space.
12047 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
12048 * doc/bison.texinfo (Internationalization): Revamp the English
12049 and Texinfo syntax a bit, to try to make it clearer.
12050 (Bison Options, Option Cross Key): Mention --print-localedir.
12051 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
12052 YYENABLE_NLS. Quote a bit more.
12053 * runtime-po/.cvsignore: New file.
12054 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
12055 * runtime-po/Rules-quot: Remove; now created by bootstrap.
12056 * runtime-po/quot.sed: Likewise.
12057 * runtime-po/boldquot.sed: Likewise.
12058 * runtime-po/en@quot.header: Likewise.
12059 * runtime-po/en@boldquot.header: Likewise.
12060 * runtime-po/insert-header.sin: Likewise.
12061 * runtime-po/remove-potcdate.sin: Likewise.
12062 * runtime-po/Makevars: Likewise.
12063 * runtime-po/LINGUAS: Likewise.
12064 * runtime-po/de.po: Likewise; we will rely on the translation project
12065 to maintain this, so "bootstrap" should get it.
0410a6e0 12066 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
12067 its value.
12068 * src/main.c (main): Bind the bison-runtime domain, too.
12069
120702005-07-12 Bruno Haible <bruno@clisp.org>
12071
12072 * data/yacc.c: Include <libintl.h> when NLS is enabled.
12073 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
12074 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
12075 * runtime-po: New directory.
12076 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
12077 $(DOMAIN).pot-update rule, so that old messages are never dropped.
12078 * runtime-po/Rules-quot: New file, copied from po/.
12079 * runtime-po/quot.sed: Likewise.
12080 * runtime-po/boldquot.sed: Likewise.
12081 * runtime-po/en@quot.header: Likewise.
12082 * runtime-po/en@boldquot.header: Likewise.
12083 * runtime-po/insert-header.sin: Likewise.
12084 * runtime-po/remove-potcdate.sin: Likewise.
12085 * runtime-po/Makevars: New file.
12086 * runtime-po/POTFILES.in: New file.
12087 * runtime-po/LINGUAS: New file.
12088 * runtime-po/bison-runtime.pot: New file.
12089 * runtime-po/de.po: New file.
12090 * m4/bison.m4: New file.
12091 * Makefile.am (SUBDIRS): Add runtime-po.
12092 (aclocaldir, aclocal_DATA): New variables.
12093 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
12094 Define aclocaldir.
12095 * src/getargs.c (usage): Document --print-localedir option.
12096 (PRINT_LOCALEDIR_OPTION): New enum item.
12097 (long_options): Add --print-localedir option.
12098 (getargs): Handle --print-localedir option.
12099 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
12100 (Internationalization): New section.
12101
22dda0f0
AD
121022005-07-12 Akim Demaille <akim@epita.fr>
12103
12104 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
12105 for consistency with the rest of the code.
12106 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
12107 Add separators.
12108
82b248ad
AD
121092005-07-12 Akim Demaille <akim@epita.fr>
12110
12111 * src/parse-gram.y: Use %printer instead of YYPRINT.
12112
fa0e9314
AD
121132005-07-12 Akim Demaille <akim@epita.fr>
12114
867a3e00
AD
12115 * src/symtab.h, src/symtab.c (symbol_print): New.
12116 * src/symlist.h, src/symlist.c (symbol_list_print): New.
12117 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
12118
121192005-07-12 Akim Demaille <akim@epita.fr>
12120
12121 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
12122 b4_at_dollar and b4_dollar_dollar.
12123
e054b190
PE
121242005-07-11 Paul Eggert <eggert@cs.ucla.edu>
12125
12126 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
12127 and Pennello's paper.
12128
34160ec4
PE
121292005-07-09 Paul Eggert <eggert@cs.ucla.edu>
12130
407d4a75
PE
12131 * data/yacc.c (yyparse): Undo previous patch. Instead,
12132 set yylsp[0] and yyvsp[0] only if the initial action
12133 sets yylloc and yylval, respectively.
12134
34160ec4
PE
12135 * data/yacc.c (yyparse): In the initial action, set
12136 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
12137 This avoids the use of undefined variables if the initial
12138 action does not set yylloc and/or yylval.
12139
c3d5a4a7
PE
121402005-07-07 Paul Eggert <eggert@cs.ucla.edu>
12141
b34d96c1
PE
12142 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
12143 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
12144 Remove from CVS. These files are automatically generated.
12145 * examples/extexi: Clarify that this file is now part of Bison,
12146 not GNU M4, and that it works with any POSIX-compatible Awk.
12147 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
12148 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
12149 so that we also get calc++-parser.yy. Geneate it.
12150 Use $(AWK), not gawk, since any conforming Awk will do.
12151 Put comment before action, since older 'make' can't handle comment
12152 in action.
12153 $(BUILT_SOURCES): List all built sources, not just some of them.
12154 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
12155 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
12156 $($(calc_sources_generated)): Remove unnecessary test for existence
12157 of target. (This had a shell syntax error anyway; a stray "x".)
12158 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
12159 calc++-parser.yy.
12160 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
12161
c3d5a4a7
PE
12162 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
12163 implied by the other modules.
12164
828c373b
AD
121652005-07-06 Akim Demaille <akim@epita.fr>
12166
12167 Bind examples/calc++ to the package.
12168 * examples/calc++/Makefile: Remove, replaced by...
12169 * examples/calc++/Makefile.am: ... this new file.
12170 * examples/calc++/test: Remove input.
12171 * examples/calc++/compile: Remove.
12172 * examples/Makefile.am: New.
12173 * configure.ac, Makefile.am: Adjust.
12174 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
12175
63cb01d6
PE
121762005-07-05 Paul Eggert <eggert@cs.ucla.edu>
12177
fd2df2ed
PE
12178 * data/glr.c (yyFail): Drastically simplify; since the format argument
12179 never had any % directives, we can simply pass it to yyerror.
12180 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
12181 be modified later, as that is the usual style in glr.c.
12182 Problems reported by Paul Hilfinger.
12183
63cb01d6
PE
12184 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
12185 and size overflow errors.
12186 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
12187 in case the user prolog sets feature-test macros like _GNU_SOURCE.
12188 (YYSIZEMAX): New macro.
12189 (yystpcpy): New function, taken from yacc.c.
12190 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
12191 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
12192 so that we don't have to maintain their signatures.
12193 (yyFail): Check for buffer overflow, by using vsnprintf rather
12194 than vsprintf. Allocate a bigger buffer if possible.
12195 Report an error if buffer allocation fails.
12196 (yyStackOverflow): New function.
12197 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
12198 the initialization was successful. It might fail if storage was
12199 exhausted.
12200 (yyexpandGLRStack): Add more checks for storage allocation failure.
12201 Use yyStackOverflow to report failures.
12202 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
12203 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
12204 Don't assume stack number fits in int.
12205 (yysplitStack): Check for storage allocation failure.
12206 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
12207 can print diagnostics on storage allocation failure. All callers
12208 changed.
12209 (yyresolveValue): Use yybool for boolean.
12210 (yyreportSyntaxError): Check for size-calculation overflow.
12211 This code is taken from yacc.c.
12212 (yyparse): Check for storage allocation errors when allocating
12213 the initial stack.
12214
1c59e0a1
AD
122152005-07-05 Akim Demaille <akim@epita.fr>
12216
12217 Extract calc++ from the documentation.
12218 * doc/bison.texinfo (Calc++): Add the extraction marks.
12219 * examples/extexi: New, from the aborted GNU Programming 2E.
12220 Separate the different paragraph of a file with empty lines.
12221 * examples/Makefile: Use it to extract the whole calc++ example.
12222
8a0adb01
AD
122232005-06-24 Akim Demaille <akim@epita.fr>
12224
12225 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
12226 class typedefs.
12227
12545799
AD
122282005-06-22 Akim Demaille <akim@epita.fr>
12229
12230 * doc/bison.texinfo (C++ Language Interface): First stab.
12231 (C++ Parsers): Remove.
12232
99be0235
AD
122332005-06-22 Akim Demaille <akim@epita.fr>
12234
12235 * data/lalr1.cc (yylex_): Honor %lex-param.
12236
0ffd4fd1
AD
122372005-06-22 Akim Demaille <akim@epita.fr>
12238
12239 Start a set of simple examples.
12240 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
12241 * examples/calc++/calc++-driver.hh,
12242 * examples/calc++/calc++-parser.yy,
12243 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
12244 * examples/calc++/compile, examples/calc++/test: New.
12245
0925ebb4
PE
122462005-06-09 Paul Eggert <eggert@cs.ucla.edu>
12247
12248 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
12249 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
12250 which stems from the 2005-05-27 patch.
12251
43d3b664
PH
122522005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12253
12254 * data/glr.c: Modify treatment of unused parameters to permit use
12255 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
12256
3062864d
PE
122572005-05-30 Paul Eggert <eggert@cs.ucla.edu>
12258
12259 Fix infringement on user name space reported by Janos Zoltan Szabo.
12260 * data/yacc.c (yyparse): strlen -> yystrlen.
12261
989b5b8e
AD
122622005-05-30 Akim Demaille <akim@epita.fr>
12263
12264 * data/lalr1.cc (_): New.
12265 Translate the various messages.
12266
bedf57f5
PE
122672005-05-27 Paul Eggert <eggert@cs.ucla.edu>
12268
12269 Fix infringement on user name space reported by Bruno Haible.
12270 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
12271 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
12272 the user's name space.
12273 (alloca): Include <stdlib.h> to get it, if it's not built in.
12274 (YYMALLOC, YYFREE): Define only if needed.
12275 (malloc, free): Declare, but only if needed, as this infringes on
12276 the user name space.
12277
4d1801f1
PE
122782005-05-25 Paul Eggert <eggert@cs.ucla.edu>
12279
12280 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
12281 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
12282 with %d format.
12283 * lib/ebitset.c (min, max): Undef before defining.
12284 * lib/vbitset.c (min, max): Likewise.
12285 * lib/subpipe.c (create_subpipe): Save local variables in case
12286 vfork clobbers them.
12287
122882005-05-24 Bruno Haible <bruno@clisp.org>
12289
12290 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
12291 error message syntax used by gcc-4.0.
12292
b94a9e1e
PE
122932005-05-23 Paul Eggert <eggert@cs.ucla.edu>
12294
85ac3861
PE
12295 * README: Mention m4 1.4.3. Remove obsolete advice about
12296 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
12297
b94a9e1e
PE
12298 * bootstrap: Remove workaround for problem I encountered with
12299 gettext 0.14.1; it seems to be fixed now.
12300
51c30d21
PE
123012005-05-22 Paul Eggert <eggert@cs.ucla.edu>
12302
009ce67d
PE
12303 * NEWS: Version 2.0a.
12304
f2a97c62
PE
12305 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
12306 the previous change.
12307
c8775f93
PE
12308 Various maintainer cleanups.
12309 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
12310 conftest*, for benefit of CVS commands run at the same time as
12311 "configure". Add build-aux, since "bootstrap" now creates it and
12312 its subfiles.
12313 * Makefile.cfg (move_if_change): Remove.
12314 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
12315 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
12316 (po_repo, do-po-update, po-update, wget_files, get-targets):
12317 (config.guess-url_prefix, config.sub-url_prefix):
12318 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
12319 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
12320 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
12321 Remove.
12322 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
12323 this is now the recommended name.
12324 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
12325 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
12326 ylwrap. These files now go into build-aux.
12327 * config/move-if-change: Remove.
12328 * config/prev-version.txt: Bump from 1.75 to 2.0.
12329
3ea5f0ec
PE
12330 * bootstrap: Add stdio-safer, unistd-safer modules.
12331 Remove m4/glibc2.m4 (introduced by latest gnulib, but
12332 we don't need it).
12333 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
12334 fopen-safer.c, stdio-safer.h, unistd-safer.h.
12335 * lib/subpipe.c: Include "unistd-safer.h".
12336 (create_subpipe): Make sure all the newly-created
12337 file descriptors are > 2, so that diagnostics don't
12338 get sent down them (which might cause Bison to hang, in theory).
12339 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
12340 * src/files.c (xfopen): Use fopen_safer, not fopen.
12341
51c30d21
PE
12342 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
12343 yesterday's yacc.c fix.
12344
cea1469d
PE
123452005-05-21 Paul Eggert <eggert@cs.ucla.edu>
12346
3ea5f0ec
PE
12347 * data/glr.c, data/lalr1.cc: Update copyright date.
12348
cea1469d
PE
12349 Fix a destructor bug reported by Wolfgang Spraul in
12350 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
12351 * data/yacc.c (yyabortlab): Don't call destructor, and
12352 don't set yychar to EMPTY.
12353 (yyoverflowlab): Don't call destructor.
12354 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
12355 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
12356 since we no longer output the message "discarding lookahead token
12357 end of input ()".
12358
5e6f62f2
PH
123592005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12360
12361 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
12362 fix a small glitch in debugging output.
12363 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
12364 after YY_SYMBOL_PRINT where needed.
12365
12366 (struct yyGLRState): Add some comments.
12367 (struct yySemanticOption): Add some comments.
12368 (union yyGLRStackItem): Add comment.
12369
12370 (yymergeOptionSets): Correct this to properly perform the union,
12371 avoiding infinite reported by Michael Rosien.
12372 Update comment.
12373
12374 * tests/glr-regression.at: Add test for GLR merging error reported
12375 by M. Rosien.
cea1469d 12376
0fb669f9
PE
123772005-05-13 Paul Eggert <eggert@cs.ucla.edu>
12378
12379 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
12380 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
12381 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
12382 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
12383 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
12384 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
12385 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
12386 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
12387 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
12388 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
12389 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
12390 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
12391 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
12392 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
12393 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
12394 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
12395 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
12396 src/derives.h, src/files.c, src/files.h, src/getargs.c,
12397 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
12398 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
12399 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
12400 src/output.h, src/parse-gram.c, src/parse-gram.h,
12401 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
12402 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
12403 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
12404 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
12405 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
12406 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
12407 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
12408 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
12409 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
12410 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
12411 tests/reduce.at, tests/regression.at, tests/sets.at,
12412 tests/synclines.at, tests/testsuite.at, tests/torture.at:
12413 Update FSF postal mail address.
12414
51f4735e
PE
124152005-05-11 Paul Eggert <eggert@cs.ucla.edu>
12416
12417 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
12418 Problem reported by Ralf Menzel.
12419
80ce3401
PE
124202005-05-01 Paul Eggert <eggert@cs.ucla.edu>
12421
12422 * tests/actions.at: Test that stack overflow invokes destructors.
12423 From Marcus Holland-Moritz.
12424 * data/yacc.c (yyerrlab): Move the code that destroys the stack
12425 from here....
12426 (yyreturn): to here. That way, destructors are called properly
12427 even if the stack overflows, or the user calls YYACCEPT or
12428 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
12429 (yyoverflowlab): Destroy the lookahead.
12430
124312005-04-24 Paul Eggert <eggert@cs.ucla.edu>
12432
12433 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
12434
72f000b0
PE
124352005-04-17 Paul Eggert <eggert@cs.ucla.edu>
12436
12437 * NEWS: Bison-generated C parsers no longer quote literal strings
12438 associated with tokens.
12439 * src/output.c (prepare_symbols): Don't escape strings,
12440 since users don't want to see C escapes.
12441 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
12442 in diagnostics.
c19683bb 12443 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
12444 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
12445
1094323f
PE
124462005-04-16 Paul Eggert <eggert@cs.ucla.edu>
12447
12448 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
12449 the data size is known to be too small and we can't increase it.
12450 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
12451
ca407bdf
PE
124522005-04-15 Paul Eggert <eggert@cs.ucla.edu>
12453
12454 * src/parse-gram.y: Include quotearg.h.
12455 (string_as_id): Quote $1 before using it as a key, since the
12456 lexer no longer quotes it for us.
12457 (string_content): Don't strip quotes, since lexer no longer
12458 quotes it for us.
12459 * src/scan-gram.l: Include quotearg.h.
12460 ("\""): Omit quote.
12461 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
12462 a key, since the rest of the lexer doesn't quote it.
12463 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
12464 * tests/regression.at (Token definitions): Check for backslashes
12465 in token strings.
12466
12467 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
12468 (YYSIZE_T): Define to unsigned long int when using an older compiler.
12469 (yyparse): Revamp code to generate long syntax error message, to
12470 make it easier to translate, and to avoid problems with arithmetic
12471 overflow. Change "virtual memory" to "memory" in diagnostic, since
12472 we don't know whether the memory is virtual.
12473
1ce59070
PE
124742005-04-13 Paul Eggert <eggert@cs.ucla.edu>
12475
12476 * NEWS: Bison-generated C parsers now use the _ macro to
12477 translate strings.
12478 * data/yacc.c (_) [!defined _]: New macro.
12479 All English strings wrapped inside this macro.
12480 * doc/bison.texinfo (Bison Parser): Document _.
12481 * po/POTFILES.in: Include src/parse-gram.c, since it now
12482 includes translateable strings that parse-gram.y doesn't.
12483
a749a695
PE
124842005-04-12 Paul Eggert <eggert@cs.ucla.edu>
12485
12486 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
12487 reverting the 2004-10-11 change to this function.
12488 (symbol_check_alias_consistency): Don't call symbol_type_set
12489 if the type name is already correct.
12490 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
12491
8fb1053b
PE
124922005-03-25 Paul Eggert <eggert@cs.ucla.edu>
12493
12494 * tests/regression.at (Token definitions): Don't use a token named
12495 c, as that generates a "#define c ..." that runs afoul of buggy
12496 stdlib.h that uses the identifier c as a member of struct
12497 drand48_data. Problem reported by Horst Wente.
12498
ff498c4a
PE
124992005-03-21 Paul Eggert <eggert@cs.ucla.edu>
12500
12501 * bootstrap: Change translation URL from
12502 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
12503 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
12504 redirection glitches. Problem reported by twlevo@xs4all.nl.
12505
65211d70
PE
125062005-03-20 Paul Eggert <eggert@cs.ucla.edu>
12507
12508 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
12509 after operands; POSIX says this isn't portable for the c99 command.
12510
9577fb1f
PE
125112005-03-18 Paul Eggert <eggert@cs.ucla.edu>
12512
12513 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
12514 immediately if a data overrun has occurred; this may help us track
12515 down what may be a spurious failure on MacOS.
12516
78b178f7
PE
125172005-03-17 Paul Eggert <eggert@cs.ucla.edu>
12518
a2599d0f
PE
12519 Respond to problems reported by twlevo@xs4all.nl.
12520
12521 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
12522
78b178f7
PE
12523 * src/vcg.h: Comment fix.
12524 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
12525 (G_CMAX): Change to -1 instead of INT_MAX.
12526
12527 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 12528
7296e729
PE
125292005-03-15 Paul Eggert <eggert@cs.ucla.edu>
12530
12531 * src/tables.c (state_number_to_vector_number): Put it inside an
12532 "#if 0", since it's not currently used. Problem reported by
12533 Roland McGrath.
12534
05ac60f3
PE
125352005-03-06 Paul Eggert <eggert@cs.ucla.edu>
12536
12537 * src/output.c (escaped_output): Renamed from
12538 escaped_file_name_output, since we now use it for symbol tags as
12539 well. All uses changed.
12540 (symbol_destructors_output, symbol_printers_output):
12541 Escape symbol tags too.
12542 Problem reported by Matyas Forstner in
12543 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
12544
12545 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
12546 not needed.
12547 * src/output.c (user_actions_output, token_definitions_output,
12548 symbol_destructors_output, symbol_printers_output): Likewise.
12549 * src/reader.c (prologue_augment): Likewise.
12550 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
12551
12552 * src/vcg.c (output_edge): Don't quote linestyle arg.
12553 Problem reported by twlevo@xs4all.nl.
12554
7eb453ac
PE
125552005-02-28 Paul Eggert <eggert@cs.ucla.edu>
12556
12557 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
12558 example, reported by Derek M Jones. Also, make the example even
12559 more outrageous, to better illustrate how bad the problem is.
12560
4c04c52a
PE
125612005-02-24 Paul Eggert <eggert@cs.ucla.edu>
12562
12563 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
12564 putsym. Typo reported by Sebastian Piping.
12565
a61e1620
PE
125662005-02-23 Paul Eggert <eggert@cs.ucla.edu>
12567
12568 * doc/bison.texinfo (Language and Grammar): some -> same
12569 (Epilogue): int he -> in the
12570 Typos reported by Sebastian Piping via Justin Pence.
12571
9ec93868
PE
125722005-02-07 Paul Eggert <eggert@cs.ucla.edu>
12573
12574 * tests/glr-regression.at (Improper handling of embedded actions
12575 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
12576 embedded actions and $-N in GLR parsers", work around an Autoconf bug
12577 with dollar signs in test names.
12578 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
12579 for a similar reason.
12580
73ce7e7e
PE
125812005-01-28 Paul Eggert <eggert@cs.ucla.edu>
12582
12583 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
12584 wants to redefine G_VIEW.
12585
2e72b98e
PE
125862005-01-27 Paul Eggert <eggert@cs.ucla.edu>
12587
12588 * src/vcg.c (get_view_str): Remove case for normal_view.
12589 Problem reported by twlevo@xs4all.nl.
12590
e0d634e5
PE
125912005-01-24 Paul Eggert <eggert@cs.ucla.edu>
12592
ccf830a4
PE
12593 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
12594 Problem reported by twlevo@xs4all.nl.
12595
e0d634e5
PE
12596 * doc/bison.texinfo: Change @dircategory from "GNU programming
12597 tools" to "Software development". Requested by Richard Stallman
12598 via Karl Berry.
12599
7bbc8cb0
PE
126002005-01-23 Paul Eggert <eggert@cs.ucla.edu>
12601
12602 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
12603 Problem reported by twlevo@xs4all.nl.
12604
08b770bc
PE
126052005-01-21 Paul Eggert <eggert@cs.ucla.edu>
12606
12607 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
12608 keyword; it's not needed with modern compilers, and it doesn't
12609 affect correctness with older compilers. Suggested by
12610 twlevo@xs4all.nl.
12611
95f22ad2
PE
126122005-01-17 Paul Eggert <eggert@cs.ucla.edu>
12613
12614 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
12615 gcc -Wswitch-default.
12616 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12617 * data/yacc.c (yyparse): Likewise.
12618
d229d15c
PE
126192005-01-12 Paul Eggert <eggert@cs.ucla.edu>
12620
12621 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
12622 already. Let config.h define any nonstandard values.
12623
ecadd90f
PE
126242005-01-10 Paul Eggert <eggert@cs.ucla.edu>
12625
12626 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
12627 for the benefit of slower hosts. Problem reported by
12628 Nelson H. F. Beebe.
12629
213744b5
PE
126302005-01-07 Paul Eggert <eggert@cs.ucla.edu>
12631
12632 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
12633 being defined and not used.
12634 * data/lalr1.cc (yyparse): Likewise.
12635 Use "if (false)" rather than "if (0)".
12636
249d3236
PE
126372005-01-05 Paul Eggert <eggert@cs.ucla.edu>
12638
12639 * TODO: Mention that we should allow NUL bytes in tokens.
12640
987cc1fb
PE
126412005-01-02 Paul Eggert <eggert@cs.ucla.edu>
12642
12643 * src/scan-skel.l (<<EOF>>): Don't close standard output.
12644 Problem reported by Hans Aberg.
12645
08fe02d9
PE
126462005-01-01 Paul Eggert <eggert@cs.ucla.edu>
12647
12648 * src/getargs.c (version): Happy new year; update overall
12649 program copyright date from 2004 to 2005.
12650
12651 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
12652 Problem reported by Hans Aberg.
12653 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
12654 (Output file names.): Add a test for the case when standard output
12655 is closed.
12656
010c0266
PE
126572004-12-26 Paul Eggert <eggert@cs.ucla.edu>
12658
12659 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
12660 to fix an oversight in the Bison 2.0 manual.
12661
da12206a
PE
126622004-12-25 Paul Eggert <eggert@cs.ucla.edu>
12663
12664 * NEWS: Version 2.0. Reformat the existing news items since
12665 1.875, so that related items are grouped together.
3a4734aa 12666 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
12667 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
12668
c935d934
PE
12669 * tests/torture.at (Exploding the Stack Size with Alloca): Set
12670 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
12671 otherwise, we're not testing alloca. Unfortunately there's no
12672 simple way to consult HAVE_ALLOCA here.
12673
da12206a
PE
12674 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
12675 for yymsg, too.
12676
12677 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
12678 hand. This avoids a warning about comparing int to size_t when
12679 GCC warnings are enabled.
12680
0a2c5137
PE
126812004-12-22 Paul Eggert <eggert@cs.ucla.edu>
12682
d7e14fc0
PE
12683 * NEWS: Bison-generated parsers no longer default to using the
12684 alloca function (when available) to extend the parser stack, due
12685 to widespread problems in unchecked stack-overflow detection.
12686 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
12687 responsibility to set it to a positive value. This lets the user
12688 specify a value that is not a preprocessor constant.
12689 * data/yacc.c (YYMAXDEPTH): Likewise.
12690 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
12691 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
12692 to be a compile-time constant. However, explain the constraints on it.
12693 Also, explain the constraints on YYINITDEPTH.
12694 (Table of Symbols): Explain that alloca is no longer the default.
12695 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
12696 to 1.
12697
0a2c5137
PE
12698 * doc/bison.texinfo (Location Default Action): Mention that n must
12699 be zero when k is zero. Suggested by Frank Heckenbach.
12700
e019c247
AD
127012004-12-22 Akim Demaille <akim@epita.fr>
12702
12703 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
12704 (parser::state_type, parser::semantic_type, parser::location_type):
12705 Private, not public.
12706 (parser::parse): Return ints, not bool.
12707 Returning a bool introduces a problem: 0 corresponds to false, and
12708 it seems weird to return false on success. Returning true changes
12709 the conventions for yyparse.
12710 Alternatively we could return void and send an exception.
12711 There is no clear consensus (yet?).
12712 (state_stack, semantic_stack, location_stack): Rename as...
12713 (state_stack_type, semantic_stack_type, location_stack_type): these.
12714 Private, not public.
12715 * tests/c++.at: New.
12716 * tests/testsuite.at, tests/Makefile.am: Adjust.
12717
72731bb7
AD
127182004-12-21 Akim Demaille <akim@epita.fr>
12719
12720 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
12721
9a0d8bec
AD
127222004-12-21 Akim Demaille <akim@epita.fr>
12723
12724 Don't impose std::string for filenames.
12725
12726 * data/lalr1.cc (b4_filename_type): New.
12727 (position::filename): Use it.
12728 (parser.hh): Move the inclusion of stack.hh and location.hh below
12729 the user code, so that needed headers for the filename type can be
12730 included first.
72731bb7
AD
12731 Forward declare them before the user code.
12732 * tests/Makefile.am (check-local, installcheck-local): Pass
12733 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 12734
99880de5
AD
127352004-12-20 Akim Demaille <akim@epita.fr>
12736
12737 Use more STL like names: my_class instead of MyClass.
12738
12739 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
12740 (SemanticStack, SemanticType, StateStack, StateType)
12741 (TokenNumberType, Stack, Slice, Traits, Parser::location)
12742 (Parser::value): Rename as...
12743 (location_stack, location_type, rhs_number_type, semantic_stack)
12744 (semantic_type, state_stack, state_type, token_number_type, stack)
12745 (slice, traits, parser::yylloc, parser::yylval): these.
12746
12747 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
12748
9bec482e
PE
127492004-12-19 Paul Eggert <eggert@cs.ucla.edu>
12750
12751 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
12752 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12753
f6fbd3da
PE
127542004-12-17 Paul Eggert <eggert@cs.ucla.edu>
12755
12756 Remove uses of 'short int' and 'unsigned short int'. This raises
12757 some arbitrary limits. It uses more memory but nowadays that's
12758 not much of an issue.
12759
12760 This change does not affect the generated parsers; that's a different
12761 task, as some users will want to conserve memory there.
12762
12763 Ideally we should use size_t to represent all object counts, and
12764 something like ptrdiff_t to represent signed differences of object
12765 counts; but that will require more code-cleanup than I have the
12766 time to do right now.
12767
12768 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
12769 Use size_t, not int or short int, to count objects.
12770 * src/closure.c (nritemset, closure): Likewise.
12771 * src/closure.h (nritemset, closure): Likewise.
12772 * src/nullable.c (nullable_compute): Likewise.
12773 * src/print.c (print_core): Likewise.
12774 * src/print_graph.c (print_core): Likewise.
12775 * src/state.c (state_compare, state_hash): Likewise.
12776 * src/state.h (struct state): Likewise.
12777 * src/tables.c (default_goto, goto_actions): Likewise.
12778
12779 * src/gram.h (rule_number, rule): Use int, not short int.
12780 * src/output.c (prepare_rules): Likewise.
12781 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
12782 errs, reductions): Likewise.
12783 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
12784 Likewise.
12785 * src/tables.c (vector_number, tally, action_number,
12786 ACTION_NUMBER_MINIMUM): Likewise.
12787 * src/output.c (muscle_insert_short_int_table): Remove.
12788
efeed023
AD
127892004-12-17 Akim Demaille <akim@epita.fr>
12790
12791 * data/lalr1.cc: Extensive Doxygenation.
12792 (error_): Rename as...
12793 (error): this, since it is visible to the user.
12794 Adjust callers.
12795 (Parser::message): Now an automatic variable from...
12796 (Parser::yyreport_syntax_error_): here.
12797 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
12798 Parser::error.
12799 * tests/input.at: Escape $.
12800
bc82c5a5
PE
128012004-12-16 Paul Eggert <eggert@cs.ucla.edu>
12802
12803 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
12804 Parenthesize rhs to avoid obscure problems with mistakes like
12805 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
12806 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12807 b4_rhs_location): Likewise.
12808 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12809 b4_rhs_location): Likewise.
12810
fd19f271
AD
128112004-12-16 Akim Demaille <akim@epita.fr>
12812
12813 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
12814 yacc.c: be sure to stay within yycheck_.
12815 * tests/actions.at: Re-enable C++ tests.
12816
10454ea4
AD
128172004-12-16 Akim Demaille <akim@epita.fr>
12818
12819 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
12820 real.
12821
c5b95ccf
AD
128222004-12-16 Akim Demaille <akim@epita.fr>
12823
12824 Use #define to handle the %name-prefix.
12825
12826 * data/glr.c, data/yacc.c: Comment changes.
12827 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
12828 so that one can refer to yylex in the parser file, and have it
12829 renamed, as is the case with other skeletons.
12830
617a8f12
AD
128312004-12-16 Akim Demaille <akim@epita.fr>
12832
12833 Move lalr1.cc internals into yy*.
12834
12835 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
12836 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
12837 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
12838 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
12839 (empty_, final_, terror_, errcode_, ntokens_)
12840 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
12841 (looka_, ilooka_, error_range_, nerrs_):
12842 Rename as...
12843 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
12844 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
12845 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
12846 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
12847 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
12848 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
12849 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
12850 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
12851 these.
12852
1e547e6e
PE
128532004-12-15 Paul Eggert <eggert@cs.ucla.edu>
12854
12855 Fix some problems reported by twlevo at xs4all.
12856 * src/symtab.c (symbol_new): Report an error if the input grammar
12857 contains too many symbols. This is better than calling abort() later.
12858 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
12859 (struct node, struct graph):
12860 Rename member expand to stretch. All uses changed.
12861 (struct graph): Remove member layoutalgorithm. All uses removed.
12862 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
12863 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
12864 All uses changed.
12865 (N_STRETCH): Rename from N_EXPAND. All uses changed.
12866
735d6bd4
AD
128672004-12-15 Akim Demaille <akim@epita.fr>
12868
12869 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
12870 Add more Doxygen comments.
12871 (symprint_, stack_print_, reduce_print_, destruct_, pop)
12872 (report_syntax_error_, translate_): Rename as...
12873 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
12874 (yypop_, yyreport_syntax_error_, yytranslate_): this.
12875
2e1f5829
AD
128762004-12-15 Akim Demaille <akim@epita.fr>
12877
12878 * data/lalr1.cc (lex_): Rename as...
12879 (yylex_): this.
12880 Move the trace here.
12881 Take the %name-prefix into account.
12882 Reported by Alexandre Duret-Lutz.
12883
a3cb6248
AD
128842004-12-15 Akim Demaille <akim@epita.fr>
12885
12886 Simplify the C++ parser constructor.
12887
12888 * data/lalr1.cc (debug_): Rename as...
12889 (yydebug_): so that the parser's internals are always in the yy*
12890 pseudo namespace.
12891 Adjust uses.
12892 (b4_parse_param_decl): Remove the leading comma as it is now only
12893 called as unique argument list.
12894 (Parser::Parser): Remove the constructor accepting a location and
12895 an initial debugging level.
12896 Remove from the other ctor the argument for the debugging level.
12897 (debug_level_type, debug_level, set_debug_level): New.
12898
12899 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
12900 constructor calls.
12901
07fed891
AD
129022004-12-15 Akim Demaille <akim@epita.fr>
12903
12904 Remove b4_root related material: failure experiment
a3cb6248 12905 (which goal was to allow to derive from a class).
07fed891
AD
12906
12907 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
12908 definitions and uses.
12909
e603eaa5
PE
129102004-12-14 Paul Eggert <eggert@cs.ucla.edu>
12911
12912 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
12913 not 2, since it's not portable to subtract 1 from the start of an
12914 array. The new item 0 is never set or used. All uses changed.
12915
12916 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
12917 the default definition of YYLLOC_DEFAULT. Problem reported
12918 by Frank Heckenbach.
12919
fafb007d
PE
129202004-12-12 Paul Eggert <eggert@cs.ucla.edu>
12921
12922 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
12923 the normal case and one for the error case. Just use the
12924 first one uniformly. Problem reported by Frank Heckenbach.
12925 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
12926 use exactly the same macro in both places.
12927 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
12928 so that the normal-case YYRHSLOC works for the error case too.
12929 All uses changed.
12930 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
12931 (YYLLOC_DEFAULT): Use the same macro as glr.c.
12932 * doc/bison.texinfo (Location Default Action): Don't claim that
12933 we have an array of locations. Use the same macro for both glr
12934 and lalr parsers. Mention YYRHSLOC. Mention what happens when
12935 the index is 0.
12936
48814dcd
PE
129372004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12938
a4e1a53b
PE
12939 * HACKING: Update email addresses to send announcements to.
12940
48814dcd
PE
12941 * configure.ac (AC_INIT): Bump version to 1.875f.
12942
337116ba
PE
129432004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12944
12945 * NEWS: Version 1.875e.
12946 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
12947
12948 * src/scan-skel.l: Include "complain.h", for "fatal".
12949
12950 * src/relation.h (relation_print, relation_digraph):
12951 Relation sizes are of type relation_node, not size_t (this is
12952 merely a doc fix, since the two types are equivalent).
12953 (relation_transpose): Relation sizes are of type relation_node,
12954 not int.
12955 * src/relation.c: Likewise.
12956 (top, infinity): Now of type relation_node, not int.
12957 (traverse, relation_transpose): Use relation_node, not int.
12958
12959 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
12960 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
12961 (yyparse): Remove unused local introduced in 2004-10-25 patch.
12962
12963 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 12964 specifying whether the test should be skipped. Use it tp
337116ba 12965 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 12966 fail on some hosts, and should be skipped.
337116ba 12967
da2a7671
PE
129682004-12-08 Paul Eggert <eggert@cs.ucla.edu>
12969
12970 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
12971 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
12972 unless otherwise specified below.
12973
12974 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
12975 to allocate kernel_base, kernel_items, kernel_size, since
12976 they needn't be initialized to 0.
12977 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
12978 * src/closure.c (new_closure): Likewise, for itemset.
12979 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
12980 * src/lalr.c (set_goto_map): Likewise, for temp_map.
12981 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
12982 (build_relations): Likewise for edge, states1, includes.
12983 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
12984 * src/reader.c (packgram): Likewise, for ritem, rules.
12985 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
12986 * src/relation.c (relation_digraph): Likewise for VERTICES.
12987 (relation_transpose): Likewise for new_R, end_R.
12988 * src/symtab.c (symbols_token_translations_init): Likewise for
12989 token_translations.
12990 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
12991 (token_actions): Likewise for yydefact, actrow, conflrow,
12992 conflict_list.
12993 (save_column): Likewise for froms[symno], tos[symno].
12994 (goto_actions): Likewise for state_count.
12995 (pack_table): Likewise for base, pos, check.
12996 (tables_generate): Likewise for width.
12997
12998 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
12999 for initial core. Just have a separate core, so we needn't worry
13000 about whether kernel_size and kernel_base are initialized.
13001
13002 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
13003 kernel_size, kernel_items): Remove unnecessary initialization.
13004 * src/conflicts.c (conflicts): Likewise.
13005 * src/derives.c (derives): Likewise.
13006 * src/muscle_tablc (muscle_insert): Likewise.
13007 * src/relation.c (relation_digraph): Likewise.
13008 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
13009 conflrow, conflict_table, conflict_list, table, check):
13010 Likewise.
13011
13012 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
13013 This is because all callers pass unsigned int.
13014 * src/closure.h (new_closure): Likewise.
13015
13016 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
13017 (build_relations): Initialize includes[i] in all cases.
13018 * src/reader.c (packgram): Always initialize rules[ruleno].prec
13019 and rules[ruleno].precsym. Initialize members in order.
13020 * src/relation.c (relation_transpose): Always initialize new_R[i]
13021 and end_R[i].
13022 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
13023
13024 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
13025 conflict_list[0] was always 0, but now it isn't initialized.
13026
13027 * src/table.c (table_grow): When conflict_table grew, the grown
13028 area wasn't cleared. Fix this.
13029
13030 * lib/.cvsignore: Add strdup.c, strdup.h.
13031 * m4/.cvsignore: Add strdup.m4.
13032
00baeeac
PE
130332004-12-07 Paul Eggert <eggert@cs.ucla.edu>
13034
13035 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
13036 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
13037 GOTO_NUMBER_MAXIMUM, since we occasionally compute
13038 ngotos + 1 without checking for overflow.
13039 (build_relations): Use END_NODE, not -1, to denote end of edges.
13040 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
13041 build_relations): Use goto_number, not int, for goto numbers.
13042 * src/tables.c (save_column, default_goto): Likewise.
13043
be3d9d42
AD
130442004-11-23 Akim Demaille <akim@epita.fr>
13045
13046 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
13047 of #defining from yystype.
13048 Don't typedef yystype, C++ does not need it.
13049 This lets it possible to forward declare it as union.
13050
78e526d5
PE
130512004-11-23 Paul Eggert <eggert@cs.ucla.edu>
13052
13053 * bootstrap (gnulib_modules): Add extensions.
13054 Problem reported by Jim Meyering.
13055
afbb696d
PE
130562004-11-22 Paul Eggert <eggert@cs.ucla.edu>
13057
13058 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
13059 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
13060 src/system.h, src/tables.c: XFREE -> free, to accommodate
13061 recent change to gnulib xalloc.h.
78e526d5 13062 Problem reported by Jim Meyering.
afbb696d 13063
c1f8f16a
AD
130642004-11-17 Akim Demaille <akim@epita.fr>
13065
13066 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
13067
db7e5eb5 130682004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
13069 Alexandre Duret-Lutz <adl@gnu.org>
13070
13071 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
13072 changes.
13073 (YYCDEBUG): Adjust.
13074 Use it instead of cdebug_.
13075 (Parser::debug_stream, Parser::set_debug_stream): New.
13076 (Parser::symprint_): Define cdebug_ for temporary backward
13077 compatibility.
13078 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
13079 debug_stream ().
13080
68e11668
AD
130812004-11-17 Akim Demaille <akim@epita.fr>
13082
13083 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
13084 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
13085 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
13086 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13087
97cbc73e
PE
130882004-10-27 Paul Eggert <eggert@cs.ucla.edu>
13089
13090 * data/glr.c (yyloc_default): Remove; not used.
13091 Problem reported by Frank Heckenbach.
13092
e342c3be
AD
130932004-10-25 Akim Demaille <akim@epita.fr>
13094
13095 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
13096 Introduce another definition to address simple location arrays.
13097 (yyGLRStack): New member: yyerror_range.
13098 (yyrecoverSyntaxError, yyparse): Update it.
13099 (yyrecoverSyntaxError): Use it when shifting the error token to
13100 have an accurate range, equivalent to the one computed by both
13101 yacc.c and lalr1.cc.
13102 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
13103 that column numbers start at column 0, as per GNU Coding
13104 Standards, the others tests, and the doc.
13105 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
13106 Adjust to the above change (first column is 0).
13107 And adjust the location of the "<error>", now covering the whole
13108 line.
13109
93602feb 131102004-10-22 Akim Demaille <akim@epita.fr>
04098407 13111 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
13112
13113 Remove some arbitrary limits on goto numbers and relations.
13114 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
13115 initial values, since they're never used.
13116 (set_goto_map): ngotos is now unsigned, so test for overflow
13117 by seeing whether it wraps around to zero.
13118 * src/lalr.h (goto_number): Now size_t, not short int.
13119 (GOTO_NUMBER_MAXIMUM): Remove.
13120 * src/relation.c (relation_print, traverse, relation_transpose):
13121 Check for END_NODE rather than looking at sign.
13122 * src/relation.h (END_NODE): New macro.
13123 (relation_node): Now size_t, not short int.
13124
dba08b04
PE
131252004-10-22 Paul Eggert <eggert@cs.ucla.edu>
13126
13127 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
13128 keyword, not an identifier. Problem reported by Baron Schwartz in
13129 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
13130
df09ef2e
AD
131312004-10-11 Akim Demaille <akim@epita.fr>
13132
13133 * src/symtab.c (symbol_check_alias_consistency): Also check
13134 type names, destructors, and printers.
13135 Reported by Alexandre Duret-Lutz.
13136 Recode the handling of associativity and precedence in terms
13137 of symbol_precedence_set.
13138 Accept no redeclaration at all, not even equal to the previous
13139 value.
13140 (redeclaration): New.
13141 Use it to factor redeclaration complaints.
13142 (symbol_make_alias): Don't set the type of the alias, let
13143 symbol_check_alias_consistency do it as for other features.
13144 * src/symtab.h (symbol): Add new member prec_location, and
13145 type_location.
13146 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
13147 * tests/input.at (Incompatible Aliases): New.
13148
146bc99d
PE
131492004-10-09 Paul Eggert <eggert@cs.ucla.edu>
13150
13151 .cvsignore fixes to accommodate gnulib changes,
13152 and the practice of naming build directories "_build".
13153 * .cvsignore: Add "_*". Sort.
13154 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
13155 * m4/.cvsignore: Add "*_gl.m4".
13156
e503aa60
AD
131572004-10-06 Akim Demaille <akim@epita.fr>
13158
13159 * src/parse-gram.y (add_param): Fix the truncation of trailing
13160 spaces.
13161
b4a20338
AD
131622004-10-05 Akim Demaille <akim@epita.fr>
13163
13164 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
13165 whether the reducion was empty or not. This leaves room to
13166 improve the use of YYLLOC_DEFAULT in such a case.
13167 lalr1.cc is still experimental, so changing this is acceptable.
13168 And finally, there are probably not many users who changed the
13169 handling of locations in GLR, so changing is admissible too.
13170
13171 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
13172 empty reduction, set @$ to an empty location ending the previously
13173 stacked symbol.
13174 Adjust uses to make sure the code is triggered on empty
13175 reductions.
13176 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
13177 expected output: empty reductions have empty locations.
13178
f85a5e6f
AD
131792004-09-29 Akim Demaille <akim@epita.fr>
13180
13181 * data/lalr1.cc: Move towards a more standard C++ coding style
13182 for templates: Class < T > -> Class<T>.
13183
b203fc2c
AD
131842004-09-29 Akim Demaille <akim@epita.fr>
13185
13186 * data/lalr1.cc: Reinstall the former ctor, for sake of
13187 compatibility, but warn it will be removed.
13188 Move towards a more standard C++ coding style (i.e., type *var ->
13189 type* var).
13190
5b7e1e73
PE
131912004-09-27 Paul Eggert <eggert@cs.ucla.edu>
13192
3fee967f
PE
13193 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
13194 since it's less likely to work if NULs are involved in the future.
5b7e1e73 13195
0dcca5c2
AD
131962004-09-27 Akim Demaille <akim@epita.fr>
13197
13198 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
13199
6dde1c82
AD
132002004-09-27 Akim Demaille <akim@epita.fr>
13201
13202 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 13203 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
13204 and argument names.
13205 (b4_cc_constructor_call): Likewise.
13206
b233d555
AD
132072004-09-24 Akim Demaille <akim@epita.fr>
13208
13209 * src/parse-gram.y (add_param): Strip the leading and trailing
13210 blanks from a formal argument declaration.
13211 (YY_LOCATION_PRINT): New.
13212
619404e3
AD
132132004-09-24 Akim Demaille <akim@epita.fr>
13214
13215 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
13216 after the location.
13217
dd8d9022
AD
132182004-09-24 Akim Demaille <akim@epita.fr>
13219
13220 * doc/bison.texinfo (Table of Symbols): Sort.
13221
0092f063
AD
132222004-09-21 Akim Demaille <akim@epita.fr>
13223
13224 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
13225 the useless parentheses.
13226 Suggested by Paul Eggert.
13227
451364ed
AD
132282004-09-20 Akim Demaille <akim@epita.fr>
13229
13230 Let the initial-action act on the look-ahead, and use it for the
13231 "initial push" (corresponding to an hypothetical beginning-of-file).
13232 And let lalr1.cc honor %initial-action.
13233
13234 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
13235 example.
13236 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
13237 (Parser::Parser): Remove the ctor that used to initialize it.
13238 (Parser::parse): Like in the other skeletons, issue the "starting
13239 parse" message before any action.
13240 Honor %initial-action.
13241 Initialize the stacks with the lookahead.
13242 * data/yacc.c: Let $$ and @$ in %initial-action designate the
13243 look-ahead.
13244 Push them in the stacks.
13245 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
13246
18d192f0
AD
132472004-09-20 Akim Demaille <akim@epita.fr>
13248
13249 * doc/bison.texinfo (Initial Action Decl): New.
13250
b8458aa5
AD
132512004-09-20 Akim Demaille <akim@epita.fr>
13252
13253 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
13254 clearer criterion to define it.
13255 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
13256 When reducing on an empty RHS, use the latest stacked location as
13257 location.
13258 yylloc is not always available.
13259 * data/glr.c: Likewise.
13260 Also, honor initial-actions.
13261
3fc16193
AD
132622004-09-20 Akim Demaille <akim@epita.fr>
13263
13264 * data/yacc.c (YY_LOCATION_PRINT): New.
13265 Define when we know YYLTYPE's structure, i.e., when the default
13266 YYLLOC_DEFAULT is used.
13267 * data/c.m4 (b4_yysymprint_generate): Use it.
13268 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
13269 value of the result.
13270 (error_start_): Replace with...
13271 (error_range_): this location array.
13272 This allows to replace code relying on the implementation of
13273 locations by portable code.
13274 * data/yacc.c (yylerrsp): Replace with...
13275 (yyerror_range): this.
13276 Every time a token is popped, update yyerror_range[0], to have an
13277 accurate location for the error token.
13278 * data/glr.c (YY_LOCATION_PRINT): New.
13279 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
13280 deference a pointer.
13281 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
13282 report the location in %printers.
13283
13284 * src/scan-skel.l: Instead of abort, report error messages to ease
13285 understanding skeleton scanning failures.
13286
ecfe33e7
AD
132872004-09-16 Akim Demaille <akim@epita.fr>
13288
13289 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
13290 (iterator, const_iterator): these, to be more in the C++ spirit.
13291 Also, return reverse iterators so that when displaying the stack
13292 we display its bottom first.
13293 (Parser::stack_print_, Parser::reduce_print_): Match the messages
13294 from yacc.c.
13295 We should probably use vector here though.
13296
1576d44d
AD
132972004-09-16 Akim Demaille <akim@epita.fr>
13298
13299 Have more complete shift traces.
13300
13301 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
13302 to report Shifts instead of ad hoc YYDPRINTF invocations,
13303 including for the error token.
13304 * data/lalr1.cc (symprint_): Output the location.
13305 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
13306 output the location within the %printer.
13307 Activate GLR tests, at least to make sure they compile properly.
13308 They still don't pass though.
13309 * tests/calc.at: Adjust expect verbose output, since now "Entering
13310 state..." is on a different line than the "Shifting" message.
13311
9c66f418
AD
133122004-09-08 Akim Demaille <akim@epita.fr>
13313
13314 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
13315 Bison directive from the Bison file to the invocation of this
13316 macro, so that these directives are passed to
13317 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
13318 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
13319 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
13320 the extra Bison directives instead of the whole series.
13321 Change the grammar so that there are recoverable errors, and
13322 unrecoverable errors. Now we can have the parser give up before
13323 consuming the whole input. As a result we now can observe that
13324 the lookahead is freed when needed.
13325 Change the parser source to parse argv[1] instead of a hard coded
13326 string.
13327 Simplify yylex, and give a value and location to EOF.
13328 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
13329 passed directives already coded in the file.
13330 Add some tests to check the location of "error".
13331 For some tests, the C++ parser is correct, and not yacc.c.
13332 For other tests, they provide different, but unsatisfying, values,
13333 so keep the C++ value so that at least one parser is "correct"
13334 according to the test suite.
13335 (Actions after errors): Remove, this is subsumed by the
13336 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
13337
52d5733f
AD
133382004-09-06 Akim Demaille <akim@epita.fr>
13339
13340 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 13341 (Parser::pop): New.
52d5733f
AD
13342 Use it.
13343
a0e68930
AD
133442004-09-06 Akim Demaille <akim@epita.fr>
13345
13346 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
13347 argument, an informative message.
13348 Call YY_SYMBOL_PRINT.
13349 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
13350 * data/lalr1.cc (destruct_): Likewise.
13351 In addition, no longer depend on b4_yysymprint_generate and
13352 b4_yydestruct_generate to generate these functions, do it "by
13353 hand".
13354
e757bb10
AD
133552004-09-03 Akim Demaille <akim@epita.fr>
13356
13357 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
13358 invoked, yydestruct the lookahead.
13359 * tests/calc.at (Calculator $1): Update the expected lengths of
13360 traces: there is an added line for the discarded lookahead.
13361 * doc/bison.texinfo (Destructor Decl): Some rewording.
13362 Define "discarded" symbols.
13363
0fe1f06d
AD
133642004-09-02 Akim Demaille <akim@epita.fr>
13365
13366 * data/lalr1.cc (translate_, destruct_): No reason to be static.
13367
284acc8b
AD
133682004-09-02 Akim Demaille <akim@epita.fr>
13369
13370 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
13371 (YYDSYMPRINTF): Rename as...
13372 (YY_SYMBOL_PRINT): this.
13373 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
13374 two.
13375 Use it instead of direct symprint_ calls.
13376 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
13377 one.
13378
a5eb1ed2
AD
133792004-09-02 Akim Demaille <akim@epita.fr>
13380
b7c72fe1
AD
13381 * data/lalr1.cc (b4_yysymprint_generate): New.
13382 (symprint_): New member function, defined when YYDEBUG.
13383 Use it consistently instead of token/nterm debugging output by
13384 hand.
a5eb1ed2
AD
13385 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
13386 %printer calls to use cdebug_ when using lalr1.cc.
13387
417141dd
AD
133882004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
13389
13390 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
13391 with #ifdef YYDEBUG.
13392
2fa09258
AD
133932004-08-26 Akim Demaille <akim@epita.fr>
13394
13395 * doc/bison.texinfo (Implementing Loops): Rename as...
13396 (Implementing Gotos/Loops): this.
13397
9378b508
PE
133982004-08-13 Paul Eggert <eggert@cs.ucla.edu>
13399
13400 Adjust to latest gnulib.
13401 * bootstrap (gnulib_modules): Add xalloc-die.
13402 Set LC_ALL=C so that file names sort consistently.
13403 Prefer the gnulib copies of gettext.m4, glibc21.m4,
13404 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
13405 uintmax_t.m4, ulonglong.m4.
13406 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
13407 po.m4 since we are now using _gl.m4 instead.
13408
87a8ad5c
PE
134092004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
13410
13411 * src/scan-action.l: Remove. Scanning of semantic actions is
13412 handled in scan-gram.l.
13413
dca81a78
PE
134142004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
13415
13416 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
13417
13418 * src/location.h (struct): The file member is a uniqstr.
13419 (equal_boundaries): Use UNIQSTR_EQ for comparison.
13420
c9cbf7c5
PE
134212004-07-22 Paul Eggert <eggert@cs.ucla.edu>
13422
13423 Fix bug with non-%union parsers that have printers or destructors,
13424 which led to a Bison core dump. Reported by Peter Fales in
13425 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 13426
c9cbf7c5
PE
13427 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
13428 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
13429 not to our own type.
13430 * src/output.c (symbol_destructors_output, symbol_printers_output):
13431 Don't assume %union.
13432 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
13433 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
13434 UNION-FLAG. All callers changed.
13435 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
13436 Use type char, not unsigned int, when declaring an array of char;
13437 this lets us remove a cast.
13438 (Printers and Destructors): Add non-%union test cases.
13439
fa7e68c3
PE
134402004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13441
13442 * doc/bison.texinfo: Minor editorial changes, mostly to the new
13443 GLR writeups. E.g., avoid frenchspacing and the future tense,
13444 change "lookahead" to "look-ahead", and change "wrt" to "with
13445 respect to".
2fa09258 13446
fa7e68c3
PE
134472004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13448
13449 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
13450 New sections, split off from the GLR Parsers section. Put the new
13451 Simple GLR Parser near the start of the GLR section, for clarity.
13452 Rewrite connective text.
13453
99a9344e
PE
134542004-06-21 Frank Heckenbach <frank@g-n-u.de>
13455
13456 * doc/bison.texinfo (Simple GLR Parsers): New section.
13457
8dd162d3
PE
134582004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13459
13460 * NEWS, TODO, doc/bison.texinfo:
13461 Use "look-ahead" instead of "lookahead", to be consistent.
13462 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
13463 while we're fixing "look-ahead".
13464 * src/conflicts.c (shift_set): Renamed from shiftset.
13465 (look_ahead_set): Renamed from lookaheadset.
13466 * src/print.c: Likewise.
13467 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
13468 name for "lookahead".
13469 (report_types, usage): Likewise.
13470 * src/getargs.h (report_look_ahead_tokens): Renamed from
13471 report_lookaheads.
13472 * src/lalr.c (compute_look_ahead_tokens): Renamed from
13473 compute_lookaheads.
13474 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
13475 (look_ahead_tokens_print): Renamed from lookaheads_print.
13476 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
13477 state_rule_lookaheads_print.
13478 * src/state.h: Likewise.
13479 (reductions.look_ahead_tokens): Renamed from lookaheads.
13480 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
13481 AT_DATA_LOOKAHEADS_GRAMMAR.
13482
57a90331
PE
134832004-06-03 Paul Eggert <eggert@cs.ucla.edu>
13484
13485 * README: Update location of patched M4 distribution.
13486
8ed3234a
PE
134872004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
13488
13489 Don't assume the C++ compiler takes the same arguments as the C compiler
13490 (trivial change).
13491 * configure.ac (O0CXXFLAGS): New var.
13492 * tests/atlocal.in (CXXFLAGS): Use it.
13493
07971983
PE
134942004-05-29 Paul Eggert <eggert@cs.ucla.edu>
13495
13496 Fix some "make check" problems with C++ reported by
13497 Albert Chin-A-Young for Tru64 C++ in this thread:
13498 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
13499
13500 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
13501 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13502 Output to a .cc file for C++, not to a .c file.
13503 * tests/calc.at (AT_CHECK_CALC): Likewise.
13504 * tests/regression.at (AT_CHECK_DANCER): Likewise.
13505 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
13506
29058652
PE
135072004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
13508
13509 * tests/calc.at, tests/actions.at: Workaround for SGI
13510 C++ compiler. (trivial change)
13511
62cb8a99
PE
135122004-05-27 Paul Eggert <eggert@cs.ucla.edu>
13513
fd418816
PE
13514 Spent a few hours checking out which prerequisite versions the
13515 current sources actually require. I went all the way back to
13516 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
13517 a seemingly endless set of combinations of versions more recent
13518 than that. The bottom line is that the current sources require
13519 fairly recent versions of the build tools, and it'll be some work
13520 to change this.
13521 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
13522 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
13523 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
13524 Add comments explaining why those particular versions are
13525 currently needed.
2fa09258 13526
62cb8a99
PE
13527 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
13528 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 13529 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
13530
13531 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
13532 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
13533
caa52c10
PE
135342004-05-26 Paul Eggert <eggert@cs.ucla.edu>
13535
13536 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
13537 0.11.5. Suggested by Bruno Haible.
13538 * bootstrap: Remove gettext version checking.
13539
13540 * doc/bison.texinfo (Decl Summary): Also mention that %union
13541 can depend on prerequisite types. Problem reported by Tim
13542 Van Holder.
13543
4bfd5e4e
PE
135442004-05-25 Paul Eggert <eggert@cs.ucla.edu>
13545
2cef3017
PE
13546 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
13547 * README-alpha: Don't tell people not to package this.
13548
b9c85d5c
PE
13549 * bootstrap: Don't assume $(...) works; use `...` instead.
13550 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
13551 gettext better.
13552
4bfd5e4e
PE
13553 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
13554 put into the -d output file, and mention what to do if YYSTYPE is
13555 defined as a macro.
13556
6a36ff94
PE
135572004-05-24 Paul Eggert <eggert@cs.ucla.edu>
13558
6712933e
PE
13559 Undo change made earlier today: it caused autopoint to not bring
13560 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
13561 autopoint's.
13562
13563 * bootstrap: Check that gettext version matches what's in
13564 configure.ac. Warn users to ignore robots.txt ERROR 404.
13565 * bootstrap: Undo today's earlier change (logged below).
13566 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 13567
6a36ff94
PE
13568 The gettext version checking is causing more trouble than it's
13569 curing; remove it. Problem reported by Paul Hilfinger.
13570
13571 * bootstrap: Issue a warning that one can expect a message
13572 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
13573 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
13574
209ea708
PE
135752004-05-23 Paul Eggert <eggert@cs.ucla.edu>
13576
13577 Ensure that the C++ compiler used for testing actually works on a
13578 simple test program; if not, skip the C++-related tests. Problem
13579 reported by Vin Shelton in:
161a71f3 13580 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
13581
13582 * m4/cxx.m4: New file.
13583 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
13584 * tests/atlocal.in (BISON_CXX_WORKS): Add.
13585 * tests/local.at (AT_COMPILE_CXX): Use it.
13586
41ca2549
PE
135872004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13588
383e69dc
PE
13589 * data/glr.c (yylloc): Output this macro even if locations are not
13590 being generated, as the GLR parser needs it even in that case.
13591 Problem reported by Troy A. Johnson
13592 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
13593
41ca2549
PE
13594 * configure.ac (AC_INIT): Update to 1.875e.
13595
e476c87d
PE
135962004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13597
13598 * NEWS: Version 1.875d.
13599 * configure.ac (AC_INIT): Likewise.
13600 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
13601
13602 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
13603 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
13604 lalr1.cc runs afoul of the first, and the last two are no longer
13605 supported by GCC 3.4.0.
13606 * README: Mention GNU m4 1.4 or later; mention m4 patches.
13607 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
13608
233a88ad
PE
136092004-05-06 Paul Eggert <eggert@cs.ucla.edu>
13610
13611 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
13612 unsigned int, for compatibility with latest gnulib hash module.
13613 * src/state.c (state_hash, state_hasher): Likewise.
13614 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
13615 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 13616
12ffdd28
PE
136172004-05-03 Paul Eggert <eggert@cs.ucla.edu>
13618
13619 * NEWS: Unescaped newlines are no longer allowed in char & strings.
13620
13621 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
13622 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
13623 character and string literals.
13624 (unexpected_end): New function.
13625 (unexpected_eof): Use it.
13626 (unexpected_newline): New function.
13627 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
13628 actions.
e476c87d 13629
12ffdd28
PE
13630 * NEWS: Document %expect-rr.
13631
13632 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
13633 Fix typo by replacing $1 with $option.
13634 Remove more 'intl'-related files.
9668e2be 13635 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
13636
13637 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
13638 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
13639 strtoul.c.
13640 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
13641 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
13642 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
13643 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
13644 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
13645 * src/.cvsignore: Add *.output.
13646
13647 * src/parse-gram.y: Put copyright notice inside %{ %} so it
13648 gets copied to the output file.
e476c87d 13649
1f65350a
PE
136502004-04-28 Paul Eggert <eggert@twinsun.com>
13651
13652 Get files from the gnulib and po repositories, instead of relying
13653 on them being in our CVS. Upgrade to latest versions of gnulib
13654 and Automake.
13655
13656 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
13657 * bootstrap: Bootstrap from gnulib and po repositories.
13658 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
13659 * README-cvs: Document these changes. Remove version numbers from
13660 mentions of build tools, since they change so often. Mention Flex.
13661
13662 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
13663 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
13664 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
13665 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 13666 does this for us.
12ffdd28
PE
13667 (AC_ISC_POSIX): Remove; we no longer support this
13668 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
13669 (AC_HEADER_STDC): Remove: we now assume C89 or better.
13670 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
13671 Do not check for C89 headers, except for locale.h which is used
13672 by the Yacc library and must port to K&R hosts.
13673 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
13674 Do not check for C89 functions, except for setlocale which is
13675 used by the Yacc library.
13676 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
13677 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
13678 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
13679 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
13680 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
13681 AM_GNU_GETTEXT): Remove; now done by:
13682 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
13683 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
13684 for us.
13685
13686 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
13687 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
13688 Define to empty, as gnulib.mk will do the rest for us.
13689 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
13690 for us.
13691 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
13692 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
13693
13694 * src/files.c: Include gnulib's xstrndup.h.
13695
13696 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
13697 (REALLOC): Use xnrealloc, for likewise.
13698 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
13699 (strnlen, memrchr): Remove decls; functions no longer used.
13700 Include <stpcpy.h>.
13701
13702 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
13703 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13704 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
13705 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
13706 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
13707 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
13708 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
13709 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
13710 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
13711 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
13712 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
13713 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13714 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
13715 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
13716 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
13717 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
13718 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
13719 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
13720 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
13721 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
13722 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
13723 Remove, as these files are now generated automatically
13724 by bootstrap or automake.
13725
13726 * po/ChangeLog: Remove: all but one entry was a duplicate
13727 of this file, and I moved that 2000-11-02 entry here.
13728
13729 * config/.cvsignore: Add Makefile, depcomp, install-sh.
13730 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
13731 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
13732 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
13733 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
13734 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
13735 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
13736 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
13737 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
13738 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
13739 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
13740 xstrndup.h.
13741 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
13742 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
13743 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
13744 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
13745 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
13746 * src/.cvsignore: Remove *_.c.
13747
13748
13749 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
13750 support it. (The latest stable gzip doesn't.)
13751
137522004-04-27 Paul Eggert <eggert@twinsun.com>
13753
13754 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
13755 case, as stos_ is now used by destructors due to the 2004-02-09
13756 change.
13757
13758 Remove more K&R C support.
13759 * lib/libiberty.y (PARAMS): Remove. All uses removed.
13760 * lib/subpipe.c (errno): Remove decl.
13761 Include <stdlib.h> unconditionally.
13762 (EXIT_FAILURE): Remove macro.
13763 * src/complain.c (vfprintf, strerror): Remove.
13764 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
13765 unconditionally.
13766 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
13767 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
13768 (strchr, strspn, memchr): Remove decls.
13769 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
13770 unconditionally. Do not declare perror.
13771 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
13772 unconditionally.
13773
13774 * src/complain.c (_): Remove useless defn, as system.h defines this.
13775
13776 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
13777 with latest obstack.h.
13778 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
13779 to procedure types, as obstack.h now does that for us.
13780 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
13781
13782 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
13783 so that this include file can stand alone.
13784 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
13785 does this now. Include subpipe.h first after config.h, to
13786 test whether it can stand alone.
13787
13788 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
13789 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
13790 unused declaration.
13791
13792 * tests/synclines.at (%union synch line): Put a dummy member in
13793 the union, because empty unions aren't allowed in C. Caught
13794 by GCC 3.4.0.
13795
4f16766c
PE
137962004-04-13 Jim Meyering <jim@meyering.net>
13797
13798 * src/conflicts.c (conflicts_print): Correct format string typo:
13799 use `%%' to produce literal `%'. (trivial change)
13800
779e7ceb
PE
138012004-03-30 Paul Eggert <eggert@twinsun.com>
13802
13803 * src/getargs.c (version): Update copyright year to 2004.
13804
13805 * data/c.m4 (b4_int_type): Use 'short int' rather than
13806 'short', and similarly for 'long', 'unsigned', etc.
13807 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13808 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
13809 yy_yypstack, yydumpstack): Likewise.
13810 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
13811 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
13812 Likewise.
13813 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
13814 yy_stack_print, yyparse): Likewise.
13815 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
13816 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
13817 * lib/bitset.c (bitset_print): Likewise.
13818 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
13819 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13820 * lib/bitsetv.c (bitsetv_dump): Likewise.
13821 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
13822 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
13823 Likewise.
13824 * src/LR0.c (allocate_itemsets): Likewise.
13825 * src/gram.h (rule_number, rule): Likewise.
13826 * src/lalr.h (goto_number): Likewise.
13827 * src/nullable.c (nullable_compute): Likewise.
13828 * src/output.c (prepare_rules): Likewise.
13829 * src/relation.c (relation_print, relation_digraph): Likewise.
13830 * src/relation.h (relation_node): Likewise.
13831 * src/state.h (state_number, transitions, errs, reductions,
13832 struct state): Likewise.
13833 * src/symtab.h (symbol_number, struct symbol): Likewise.
13834 * src/tables.c (vector_number, tally, action_number,
13835 default_goto, goto_actions): Likewise.
13836 * tests/existing.at (GNU Cim Grammar): Likewise.
13837 * tests/regression.at (Web2c Actions): Likewise.
13838
13839 * src/output.c (muscle_insert_short_int_table): Renamed from
13840 muscle_insert_short_table. All uses changed.
13841
d6328241
PH
138422004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
13843
13844 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
13845 (declaration): Replace expected_conflicts with expected_sr_conflicts.
13846 Add %expect-rr rule.
4f16766c 13847
d6328241
PH
13848 * src/scan-gram.l: Recognize %expect-rr.
13849
4f16766c 13850 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 13851 expected_conflicts.
4f16766c 13852 (expected_rr_conflicts): Declare.
d6328241
PH
13853
13854 * src/conflicts.c (expected_sr_conflicts): Rename from
13855 expected_conflicts.
13856 (expected_rr_conflicts): Define.
13857 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
13858 for GLR parsers.
13859 Use expected_sr_conflicts in place of expected_conflicts.
13860 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 13861
d6328241 13862 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 13863
1452af69
PE
138642004-03-08 Paul Eggert <eggert@gnu.org>
13865
13866 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 13867 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
13868
13869 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
13870 in lalr1.cc.
13871 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
13872 * src/scan-gram.l (scan_integer): New function.
13873 ({int}): Use it.
13874 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
13875 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
13876 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
13877 Say "long int", not "long", for uniformity with GNU style.
13878
006d217d
PE
138792004-02-25 Paul Eggert <eggert@twinsun.com>
13880
13881 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
13882 compilers. This fixes a problem with Intel's C++ compiler being
13883 chatty, reported by Guido Trentalancia in
161a71f3 13884 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 13885
c2729758
ADL
138862004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
13887
13888 Support %destructor and merge error locations in lalr1.cc.
13889
13890 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
13891 (Parser::stos_): Define unconditionally.
13892 (Parser::destruct_): New method. Generate its body with
13893 b4_yydestruct_generate.
13894 (Parser::error_start_): New attribute.
13895 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
13896 token which are discarded.
13897 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
13898 error_start_ when erroneous token are discarded.
13899 (Parser::parse) <yyerrlab1>: Compute the location of the error
13900 token so that it covers all the discarded tokens.
13901 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
13902 it can be called with `%skeleton "lalr1.cc"', and do that.
13903
dd0e0635
PE
139042004-02-02 Paul Eggert <eggert@twinsun.com>
13905
13906 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
13907 $(top_srcdir)/lib and ../lib. This fixes a bug reported
13908 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
13909 There's no need to mention top_builddir since Automake does that
13910 for us.
13911 (INCLUDES): Remove, as Automake says it's obsolescent.
13912 Contents migrated into AM_CPPFLAGS as described above.
13913 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
13914
139152004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13916
13917 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
13918 (yyreportSyntaxError): Handle case where lookahead token is
13919 YYEMPTY.
13920
be16239b
PH
139212004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13922
13923 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
13924 resulting parsers are compilable with C++.
13925
5fa90832
PE
139262003-12-23 Paul Eggert <eggert@twinsun.com>
13927
13928 * config/depcomp, config/install-sh: Sync with Automake 1.8.
13929 * src/output.c (output_skeleton): Rename local var.
13930 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
13931 Bison tokens, as this runs afoul of the 2003-10-07 change that
13932 disallowed NUL bytes in character constants or string literals.
13933
13934 * tests/local.at: Require Autoconf 2.59's Autotest.
13935 * tests/testsuite.at: Don't include local.at, since we now assume
13936 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
13937 including it.
13938 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
13939 multiple inclusion warnings.
dd0e0635 13940
b165c324
AD
139412003-12-02 Akim Demaille <akim@epita.fr>
13942
13943 * doc/bison.texinfo (How Can I Reset the Parser): More about start
13944 conditions.
13945 From Bruno Haible.
13946
26e06a21
ADL
139472003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
13948
13949 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
13950
92ac3705
PE
139512003-10-07 Paul Eggert <eggert@twinsun.com>
13952
6a5ecb38
PE
13953 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
13954 if testsuite doesn't exist.
13955
92ac3705
PE
13956 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
13957 literals, unfortunately.
13958 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
13959 Complain about NUL bytes in character constants or string literals.
13960
91d2c560
PE
139612003-10-05 Paul Eggert <eggert@twinsun.com>
13962
13963 * NEWS: Don't document %no-default-prec, as it's still
13964 too experimental.
13965 * doc/bison.texinfo: Document %no-default-prec only if
13966 the defaultprec flag is set. Normally it's not.
13967
0cc3da3a
PE
139682003-10-04 Paul Eggert <eggert@twinsun.com>
13969
13970 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
13971 non-modifiable lvalue, instead of a modifiable one.
13972 * doc/bison.texinfo (Actions): Document that $$ can
13973 be assigned to. Do not claim that $$ and $N are
13974 array element references: user code should not rely on this.
13975
22fccf95
PE
139762003-10-01 Paul Eggert <eggert@twinsun.com>
13977
13978 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
13979 (grammar_declaration): Use it.
13980 * src/scan-gram.l: New token %no-default-prec.
13981 * tests/conflicts.at: Revamp tests to use %no-default-prec.
13982 * NEWS, doc/bison.texinfo: Document the above.
13983
fc8f2965
AD
139842003-10-01 Akim Demaille <akim@epita.fr>
13985
13986 VCG no longer supports long_straight_phase.
13987
13988 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
13989 * src/print_graph.c (print_graph): Adjust.
13990
39a06c25
PE
139912003-09-30 Frank Heckenbach <frank@g-n-u.de>
13992 and Paul Eggert <eggert@twinsun.com>
13993
13994 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
13995 Table of Symbols): Document %default-prec.
13996 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
13997 (grammar_declaration): Set default_prec on %default-prec.
13998 * src/scan-gram.l (%default-prec): New token.
13999 * src/reader.h (default_prec): New flag.
14000 * src/reader.c: Likewise.
14001 (packgram): Handle it.
14002 * tests/conflicts.at (%default-prec without %prec,
14003 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 14004
39a06c25
PE
140052003-09-30 Paul Eggert <eggert@twinsun.com>
14006
14007 * tests/testsuite.at: Include local.at, not input.at, fixing
14008 a typo in the 2003-08-25 patch.
14009
62b6aef9
AD
140102003-08-27 Akim Demaille <akim@epita.fr>
14011
14012 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
14013 GCC warnings.
14014
89e1cc61
AD
140152003-08-26 Akim Demaille <akim@epita.fr>
14016
14017 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
14018 "<\#" to avoid magic from Gnus when posting parts of this script.
14019
a08460b0
AD
140202003-08-26 Akim Demaille <akim@epita.fr>
14021
14022 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
14023 (Parser::parse): here.
14024 Adjust: nerrs and errstatus is now replaced by...
14025 (Parser::nerrs_, Parser::errstatus_): New.
14026
603f1cfd
AD
140272003-08-25 Akim Demaille <akim@epita.fr>
14028
14029 * config/announce-gen, Makefile.cfg: New.
14030 * Makefile.am: Adjust.
14031 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
14032 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
14033
cd3684cf
AD
140342003-08-25 Akim Demaille <akim@epita.fr>
14035
14036 When reducing initial empty rules, Bison parser read an initial
14037 location that is not defined. This results in garbage, and that
14038 affects Bison's own parser. Therefore we need (i) to extend Bison
14039 to support a means to initialize this location, and (ii) to use
14040 this CVS Bison to fix CVS Bison's parser.
14041
14042 * src/reader.h, reader.c (epilogue_augment): Remove, replace
14043 with...
14044 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
14045 * src/parse-gram.y: Adjust.
14046 (%initial-action): New.
14047 (%error-verbose): Since we require CVS Bison, there is no reason
14048 not to use it.
14049 * src/scan-gram.l: Adjust.
14050 * src/Makefile.am (YACC): New, to make sure we use our own parser.
14051 * data/yacc.c (yyparse): Use b4_initial_action.
14052
4e03e201
AD
140532003-08-25 Akim Demaille <akim@epita.fr>
14054
14055 * doc/bison.texinfo: Don't promote stdout for error messages.
14056
8c182d05
AD
140572003-08-25 Akim Demaille <akim@epita.fr>
14058
14059 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
14060 From Alexandre Duret-Lutz.
14061
6a60c4cf
PE
140622003-08-25 Akim Demaille <akim@epita.fr>
14063
14064 Version 1.875c.
14065
25f66e1a
AD
140662003-08-25 Akim Demaille <akim@epita.fr>
14067
14068 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
14069 Use them.
14070
5348bfbe
AD
140712003-08-25 Akim Demaille <akim@epita.fr>
14072
14073 * data/lalr1.cc (Parser::reduce_print_): New.
14074 Use it.
14075
47301314
AD
140762003-08-25 Akim Demaille <akim@epita.fr>
14077
14078 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
14079 error recovery loops. This patch is based on
161a71f3 14080 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
14081 Also, augment the similarity between lalr1.cc and yacc.c.
14082 Note: the locations of error recovery rules are not correct yet.
14083
14084 * data/lalr1.cc: Comment changes to augment the similarity between
14085 lalr1.cc and yacc.c.
14086 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
14087 (yyerrlab1): Remove, but where it used to be (now the bottom part of
14088 yyerrlab), when hitting EOF, pop the whole stack here instead of
14089 merely falling thru the default error handling mechanism.
14090 (yyerrorlab): New label, with the old contents of YYERROR,
14091 plus the following change: pop the stack of rhs corresponding
14092 to the production that invoked YYERROR. That is how Yacc
14093 behaves (required by POSIX).
14094 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
14095 fail.
14096
1f7a61ff
AD
140972003-08-25 Akim Demaille <akim@epita.fr>
14098
14099 Tune local.at so that people can "autom4te -l autotest calc.at -o
14100 calc" for instance, to extract a sub test suite.
14101
14102 * tests/testsuite.at: Move the initialization, Autotest version
14103 requirement, and AT_TESTED invocation into...
14104 * tests/local.at: here.
14105 * tests/testsuite.at: Include it for compatibility with Autoconf
14106 2.57.
14107 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
14108 be ignore.
14109
327b5b56
PE
141102003-08-04 Paul Eggert <eggert@twinsun.com>
14111
14112 Rework code slightly to avoid gcc -Wtraditional warnings.
14113 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
14114 The returned value is now stored in *YY0. All callers changed.
14115 * src/output.c (merge_output): Adjust to the above change.
14116
0051e3ed
PE
141172003-07-26 Paul Eggert <eggert@twinsun.com>
14118
14119 * data/glr.c (YYASSERT): New macro.
14120 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
14121 yyresolveStates, yyprocessOneStack):
14122 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
14123 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 14124
137437c6
PE
141252003-07-25 Paul Eggert <eggert@twinsun.com>
14126
5b620e06
PE
14127 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
14128 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 14129 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
14130 by Frank Heckenbach, though I have omitted the structure-initialization
14131 part of his glr-knr.diff patch since I recall that the Portable
14132 C Compiler didn't require that change.
14133
137437c6
PE
14134 Let the user specify how to allocate and free memory.
14135 Derived from a suggestion by Frank Heckenbach in
161a71f3 14136 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
14137 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
14138 All uses of free, malloc, realloc changed to use these macros,
14139 and unnecessary casts removed.
14140 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
14141
ddb85ca5
PE
141422003-07-06 Matthias Mann <MatthiasMann@gmx.de>
14143
14144 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
14145 use s.empty() rather than s == "" to test for empty string; see
161a71f3 14146 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
14147 (trivial change)
14148
39910e09
AD
141492003-06-25 Akim Demaille <akim@epita.fr>
14150
14151 * config/depcomp, config/install-sh: Update from masters.
14152
0ae99356
PE
141532003-06-20 Paul Eggert <eggert@twinsun.com>
14154
14155 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
14156 and return properly parenthesized result.
14157 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
14158 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
14159 Remove unnecessary parentheses from uses.
14160 * doc/bison.texinfo (Location Default Action): Describe the
14161 conventions for parentheses.
14162
cd05d13c
PE
141632003-06-19 Paul Eggert <eggert@twinsun.com>
14164
81fd08ca
PE
14165 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
14166 yyreportTree): Do not assume that size_t is the same width as int,
14167 when printing sizes. Print sizes using an unsigned format.
14168 Problem reported by Frank Heckenbach in
161a71f3 14169 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 14170
cd05d13c
PE
14171 Port to Forte Developer 7 C compiler.
14172 * data/glr.c (struct YYLTYPE): If locations are not being used,
14173 declare a single dummy member, as empty structs do not conform
14174 to the C standard.
14175 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
14176 the Forte Developer 7 C compiler complains that end-of-loop
14177 code is not reached.
14178
4dcf140b
PE
141792003-06-17 Paul Eggert <eggert@twinsun.com>
14180
14181 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
14182 avoid warnings from picky compilers about redefinition of PARAMS.
14183
8dd76bee
PE
141842003-06-17 Paul Eggert <eggert@twinsun.com>
14185
14186 Version 1.875b.
14187
14188 * NEWS: Document 1.875b.
14189
14190 * lib/bbitset.h: Do not include config.h; that's the includer's job.
14191 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
14192 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
14193 Don't use 'index' in comments, as it's a builtin fn on some hosts.
14194 * lib/bitset_stats.c: Include gettext.h unconditionally, as
14195 per recent gettext manual's suggestion.
14196 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
14197 Use prototypes, not old-style definitions.
14198 * lib/lbitset.c (lbitset_unused_clear): Likewise.
14199 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
14200 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
14201 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
14202 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
14203 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
14204 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
14205 vbitset_or_and_cmp, vbitset_copy): Likewise.
14206
14207 * lib/libiberty.h: Do not include config.h; that's the includer's job.
14208 Do not include <stdlib.h>.
14209 (PARAMS): Define unconditionally for C89.
14210 (ATTRIBUTE_NORETURN): Remove.
14211 (ATTRIBUTE_UNUSED): Define unconditionally.
14212
14213 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 14214 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
14215 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
14216 * lib/vbitset.c, lib/vbitset.h: New files.
14217 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14218 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
14219 from libbitset.
14220
14221 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
14222 `How Can I Reset @code{yyparse}', since texinfo does not allow
14223 arbitrary @ in node names.
14224
14225 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
14226 shouldn't be needed according to the gettext 0.12.1 documentation
14227 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 14228 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 14229 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 14230 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 14231
8dd76bee
PE
14232 * lib/.cvsignore: Add stdbool.h.
14233 * m4/.cvsignore: Add nls.m4, po.m4.
14234
14235 Upgrade to CVS gnulib.
14236 * stdbool_.h: File renamed from stdbool.h.in.
14237 * configure.ac (AM_STDBOOL_H): Invoke this instead of
14238 AC_HEADER_STDBOOL.
14239 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
14240 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
14241 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
14242 (MOSTLYCLEANFILES): New var.
14243 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
14244 (stdbool.h): New rule.
14245 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
14246 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
14247 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
14248 m4/quote.m4: Upgrade to today's gnulib.
14249
14250 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
14251 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
14252 the tests right now.
14253 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
14254 yyerror are declared before use; C99 requires this.
14255
25005f6a
PH
142562003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14257
14258 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
14259 first.
14260 (yyrecoverSyntaxError): Correct the logic for setting and testing
14261 yyerrState.
14262 Correct comment on handling EOF.
14263 Allow states with only a default reduction, rather than failing
8dd76bee 14264 (I can't quite reconstruct why these were not allowed before).
25005f6a 14265
137437c6 14266 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 14267 buffer overruns, corrupting state.
8dd76bee
PE
14268
14269 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
14270 definition.
14271 * src/reader.h (max_left_semantic_context): New variable declaration.
14272 * src/scan-gram.l (max_left_semantic_context): Define.
14273 (handle_action_dollar): Update max_left_semantic_context.
14274 * data/glr.c (YYMAXLEFT): New definition.
14275 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
14276 (yyresolveAction): Ditto.
14277
14278 Fixes to problems with location handling in GLR parsers reported by
14279 Frank Heckenbach (2003/06/05).
14280
14281 * data/glr.c (YYLTYPE): Make trivial if locations not used.
14282 (YYRHSLOC): Add parentheses, and define only if locations used.
14283 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
14284 locations not used.
14285 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
14286 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 14287
25005f6a
PH
14288 * tests/cxx-type.at: Exercise location information; update tests
14289 to differentiate output with and without locations.
8dd76bee 14290 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
14291 because default YYLTYPE not yet defined.
14292 Change semantic actions to compute strings, rather than printing
14293 them directly (to test proper passing of semantics values). Change
14294 output to prefix notation and update test data and expected results.
14295 (yylex): Track locations.
14296 (stmtMerge): Return value rather than printing, and include arguments
14297 in value.
8dd76bee 14298
711f40b7
PE
142992003-06-03 Paul Eggert <eggert@twinsun.com>
14300
14301 Avoid warnings generated by GCC 2.95.4 when Bison is
14302 configured with --enable-gcc-warnings.
14303 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
14304 yy::]b4_parser_class_name[::translate_,
14305 yy::Stack::operator[] (unsigned),
14306 yy::Stack::operator[] (unsigned) const,
14307 yy::Slice::operator[] (unsigned),
14308 yy::Slice::operator[] (unsigned) const):
14309 Rename local vars to avoid warnings.
14310 * tests/glr-regression.at (Improper handling of embedded actions
14311 and $-N in GLR parsers): Remove unused local variable from yylex.
14312 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
14313 (void) as arg when not pure, since we now assume C89 when building
14314 Bison. Pacify GCC by using parameter.
14315
ac695f7d
PE
143162003-06-02 Paul Eggert <eggert@twinsun.com>
14317
14318 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
14319 yy::Location::lines, yy::Location::columns): Rename arguments
14320 to avoid shadowing; this removes a warning generated by GCC 3.3.
14321
26ec81e0
PE
143222003-06-01 Paul Eggert <eggert@twinsun.com>
14323
14324 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
14325 to g++, as GCC 3.3 complains if you do it.
14326 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
14327 everything that WARNING_CFLAGS has, except omit warnings
14328 not suitable for C++.
14329 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
14330 * tests/atlocal.in (CXXFLAGS): New var.
14331 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
14332
14333 Fix a GLR parser bug I reported in February; see
161a71f3 14334 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
14335 The problem was that GLR parsers did not conform to the C standard,
14336 because actions like { $1 = $2 + $3; } expanded to expressions
14337 that invoked YYFILL in separate subexpressions, and YYFILL assigned
14338 to a local variable. The C standard says that expressions
14339 like (var = f ()) + (var = f ()) have undefined behavior.
14340 Another problem was that GCC sometimes issues warnings that
14341 yyfill and its parameters are unused.
14342
14343 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
14344 as possibly unused.
14345 (yyfill): New function.
14346 (YYFILL): Use it.
14347 (yyuserAction): Change type of yynormal to bool, so that it matches
14348 the new yyfill signature. Mark it as possibly unused.
14349
14350
14351 Follow up on a bug I reported in February, where a Bison-generated
14352 parser can loop. Provide a test case and a fix for yacc.c. I
14353 don't have a fix for lalr1.cc or for glr.c, unfortunately.
14354 The original bug report is in:
161a71f3 14355 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
14356
14357 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
14358 macro's size was becoming unwieldy.
14359 (yyerrlab): Do not discard an empty lookahead symbol, as this
14360 might destroy garbage.
14361 (yyerrorlab): New label, with the old contents of YYERROR,
14362 plus the following change: pop the stack of rhs corresponding
14363 to the production that invoked YYERROR. That is how Yacc
14364 behaves, and POSIX requires this behavior.
14365 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
14366 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
14367 Define 'alarm' to do nothing if unistd.h is not available.
14368 Add a new rule "exp: '-' error;" to test the above change to
14369 data/yacc.c. Use 'alarm' to abort any test taking longer than
14370 10 seconds, as it's probably looping.
14371 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
14372 Also, the new yacc.c generates two fewer diagnostics for an
14373 existing test.
14374
d0829076
PE
143752003-05-24 Paul Eggert <eggert@twinsun.com>
14376
c6ae27df
PE
14377 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
14378 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
14379 This fixes a problem reported by John Bowman when the Compaq/HP
14380 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
14381 -ansi -Wall -gall).
14382 * data/yacc.c (union yyalloc): Likewise.
14383 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 14384
d0829076
PE
14385 Switch from 'int' to 'bool' where that makes sense.
14386
14387 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
14388 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
14389 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
14390 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
14391 Return or accept bool, not int. All callers changed.
14392 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
14393 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
14394 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
14395 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
14396 bitset_or_and_cmp_): Likewise.
14397 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
14398 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
14399 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
14400 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
14401 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
14402 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
14403 bitset_stats_or_and_cmp): Likewise.
14404 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
14405 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
14406 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
14407 ebitset_xor_cmp): Likewise.
14408 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
14409 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
14410 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
14411 lbitset_xor_cmp): Likewise.
14412 * lib/bbitset.h: Include <stdbool.h>.
14413 (struct bitset_vtable): The following members now return bool, not
14414 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
14415 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
14416 or_and_cmp).
14417 * src/conflicts.c (count_rr_conflicts): Likewise.
14418 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
14419 All uses changed.
14420 * lib/ebitset.c (ebitset_obstack_init): Likewise.
14421 * lib/lbitset.c (lbitset_obstack_init): Likewise.
14422 * src/getargs.c (debug_flag, defines_flag, locations_flag,
14423 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14424 graph_flag): Likewise.
14425 * src/getargs.h (debug_flag, defines_flag, locations_flag,
14426 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14427 graph_flag): Likewise.
14428 * src/output.c (error_verbose): Likewise.
14429 * src/output.h (error_verbose): Likewise.
14430 * src/reader.c (start_flag, typed): Likewise.
14431 * src/reader.h (typed): Likewise.
14432 * src/getargs.c (LOCATIONS_OPTION): New constant.
14433 (long_options, getargs): Use it.
14434 * src/lalr.c (build_relations): Use bool, not int.
14435 * src/nullable.c (nullable_compute): Likewise.
14436 * src/print.c (print_reductions): Likewise.
14437 * src/tables.c (action_row, pack_vector): Likewise.
14438 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
14439 * src/output.c (prepare): Use it.
14440 * src/output.c (token_definitions_output,
14441 symbol_destructors_output, symbol_destructors_output): Use string,
14442 not boolean integer, to keep track of whether to output separator.
14443 * src/print_graph.c (print_core): Likewise.
14444 * src/state.c (state_rule_lookaheads_print): Likewise.
14445
14446 * config/install-sh: Sync from automake 1.7.5.
14447
6b2584b7
PE
144482003-05-14 Paul Eggert <eggert@twinsun.com>
14449
14450 * src/parse-gram.y (rules_or_grammar_declaration): Require a
14451 semicolon after a grammar declaration, in the interest of possible
14452 future changes to the Bison input language.
14453 Do not allow a stray semicolon at the start of the grammar.
14454 (rhses.1): Allow one or more semicolons after any rule, including
14455 just before "|" as required by POSIX.
14456 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
14457 grammar.
14458
caf37a36
ADL
144592003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
14460
14461 %parse-param support for lalr1.cc.
14462
14463 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
14464 b4_cc_constructor_calls, b4_cc_constructor_call,
14465 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
14466 definitions.
14467 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
14468 parse-param arguments.
14469 (yy::b4_parser_class_name): Declare instance variables to
14470 hold parse-param arguments.
14471 * tests/calc.at: s/value/semantic_value/ because value clashes
14472 with a member of yy::b4_parser_class_name. Adjust C++ code
14473 to handle %parse-param. Enable %parse-param test in C++.
14474
3ab37077
PE
144752003-05-12 Paul Eggert <eggert@twinsun.com>
14476
14477 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
14478 English a bit. Fix fclose typo. Change "const char" to "char
14479 const", and use ANSI C rather than K&R for "main". Suggest
14480 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
14481 and suggest yy_switch_to_buffer.
14482
144832003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
14484
14485 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
14486 C89. This avoids a diagnostic on compilers that define __STDC__
14487 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 14488 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 14489
e743727f
PE
144902003-05-03 Paul Eggert <eggert@twinsun.com>
14491
14492 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
14493 Do not overrun array bounds.
14494 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 14495 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 14496
916708d5
AD
144972003-04-29 Akim Demaille <akim@epita.fr>
14498
14499 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
14500 * src/getargs.c, src/getargs.h: here, as bool, not int.
14501 (nondeterministic_parser): New.
14502 * src/parse-gram.y, src/scan-gram.l: Support
14503 %nondeterministic-parser.
14504 * src/output.c (prepare): Use nondeterministic_parser instead
14505 of glr_parser where appropriate.
14506 * src/tables.c (conflict_row, action_row, save_row)
14507 (token_actions, token_actions, pack_vector): Ditto.
14508
a06ea4aa
AD
145092003-04-29 Akim Demaille <akim@epita.fr>
14510
14511 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
14512
211074ca
AD
145132003-04-29 Akim Demaille <akim@epita.fr>
14514
14515 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
14516 with %pure-parser and %locations to exercise the patch from Yakov
14517 Markovitch below.
14518
6175ffe3
PE
145192003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
14520
14521 * data/yacc.c: (b4_lex_param): Corrected for the case where
14522 %lex-param is provided and %pure-parser isn't.
14523
b1e95857
PE
145242003-04-27 Paul Eggert <eggert@twinsun.com>
14525
14526 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 14527 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
14528 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
14529 if it is not defined.
14530 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
14531
acda9df6
PE
145322003-04-26 Paul Eggert <eggert@twinsun.com>
14533
3470c57b
PE
14534 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
14535 Declare to be of type suitable for the ninf value itself, not of
14536 type suitable for the corresponding table, since the latter might
14537 be unsigned but the ninf value might be negative. This fixes a
14538 bug reported by Alexandre Duret-Lutz in
161a71f3 14539 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 14540
acda9df6
PE
14541 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
14542 invokes it. We shouldn't invoke it twice because it will attempt
14543 to put error.o in the archive twice. This fixes a glitch reported
14544 by Martin Mokrejs in
161a71f3 14545 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 14546
b5250f26
PE
145472003-04-21 Paul Eggert <eggert@twinsun.com>
14548
14549 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
14550 to gnulib.
14551
089ac0f1
PE
145522003-04-21 Yakov Markovitch <Markovitch@iso.ru>
14553
14554 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
14555 Fix obvious typo that results in uncompilable GLR parsers
14556 when both %pure-parser and %locations are used. (trivial change)
14557
5ededac6
PE
145582003-04-17 Paul Eggert <eggert@twinsun.com>
14559
1b8f2fff
PE
14560 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
14561 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
14562 Do not insert the expected token via unput, as this runs afoul
14563 of a POSIX-compatibility bug in flex 2.5.31.
14564 All uses changed to BEGIN the parent state,
14565 since we no longer insert the expected token via unput.
14566 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
14567 that is no longer emitted after the above change.
14568
5ededac6
PE
14569 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
14570 the first one. This change is from Paul Hilfinger, and it fixes
14571 regression reported by Werner Lemberg in
161a71f3 14572 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
14573
14574 (resolve_sr_conflict): Don't invoke state_errs_set
14575 unless one or more tokens have been explicitly made errors.
14576 Otherwise, the above change causes Bison to abort.
14577
14578 * tests/existing.at (GNU pic Grammar): New test case, taken from
14579 Lemberg's email.
14580
b8be9132
AD
145812003-03-31 Akim Demaille <akim@epita.fr>
14582
14583 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
14584
d423d460
AD
145852003-03-31 Akim Demaille <akim@epita.fr>
14586
14587 * src/output.c (prepare_symbols): Avoid trailing spaces in the
14588 output.
14589
c7e441b4
AD
145902003-03-31 Akim Demaille <akim@epita.fr>
14591
14592 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
14593 From Paul Hilfinger.
14594
231897ad
AD
145952003-03-29 Akim Demaille <akim@epita.fr>
14596
14597 * m4/error.m4: Do not put under dynamic conditions some code which
14598 expansion is under static control.
14599
5b066063
AD
146002003-03-29 Akim Demaille <akim@epita.fr>
14601
14602 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
14603
22a74fec
AD
146042003-03-29 Akim Demaille <akim@epita.fr>
14605
14606 * doc/bison.texinfo (Strings are Destroyed): New.
14607
0eee27e7
PE
146082003-03-13 Paul Eggert <eggert@twinsun.com>
14609
14610 * .cvsignore: Add configure.lineno.
14611 * src/.cvsignore: Add yacc.
14612 * tests/.cvsignore: Add testsuite.log.
14613 * doc/fdl.texi: Sync with latest FSF version.
14614
f61aad93
PE
146152003-03-12 Paul Eggert <eggert@twinsun.com>
14616
537636c7
PE
14617 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
14618 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
14619 cursor, instead of leaving it undefined. This fixes a bug
14620 reported by Tim Van Holder in
161a71f3 14621 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
14622 * tests/input.at (Torturing the Scanner): Test the scanner on
14623 an empty input file, which was Tim Van Holder's test case.
14624
14625 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
14626 <sys/resource.h> can be included, include sys/time.h and
14627 sys/times.h first, if available. This works around the SunOS
14628 4.1.4 porting bug reported by Bruce Becker in
161a71f3 14629 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
14630
14631 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
14632 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
14633 AC_HEADER_SYS_WAIT.
14634
f61aad93
PE
14635 Merge changes from gnulib. This was prompted because the CVS
14636 snapshot didn't build on Solaris 7 due to strnlen problems.
14637
14638 These changes need to be merged back into gnulib:
14639 * lib/hash.c: Include <stdbool.h> unconditionally.
14640 * m4/onceonly.m4 (m4_quote): New macro.
14641 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
14642 Quote AC_FOREACH variable-expansions properly.
14643 The 2003-01-03 obstack.h change also needs merging.
14644 {end of changes requiring merging}
5b066063 14645
f61aad93
PE
14646 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14647 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
14648 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
14649 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
14650 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
14651 New files, imported from gnulib.
14652 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
14653 above.
14654
14655 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
14656 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
14657 gnulib sources.
14658
14659 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
14660 Add.
14661 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
14662 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
14663 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
14664 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
14665 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
14666 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
14667 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
14668 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
14669 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
14670 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
14671 (jm_PREREQ_ARGMATCH): Remove.
14672 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
14673 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
14674
14675 * src/system.h: Include <stdbool.h> unconditionally.
14676
14677 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
14678 assuming at least C89 in the bitset code for some time now.
14679
d2ffe116
AD
146802003-03-03 Akim Demaille <akim@epita.fr>
14681
14682 * ro.po: New.
14683
052826fd
AD
146842003-03-02 Akim Demaille <akim@epita.fr>
14685
14686 * doc/bison.texinfo (Table of Symbols): Reactivate the
14687 documentation for %lex-param, and %parse-param.
14688
c4749565
AD
146892003-03-02 Akim Demaille <akim@epita.fr>
14690
14691 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
14692 generate verbose error messages.
14693 Use the number of tokens as an upper bound in yytname, as it
14694 cannot be a non terminal.
14695
d5286af1
AD
146962003-03-02 Akim Demaille <akim@epita.fr>
14697
14698 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
14699 message.
14700
22e304a6
AD
147012003-03-02 Akim Demaille <akim@epita.fr>
14702
22e304a6
AD
14703 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
14704 Use them to exercise yycheck overrun.
14705 Based on Andrew Suffield's grammar.
14706
67a25fed
AD
147072003-03-02 Akim Demaille <akim@epita.fr>
14708
14709 Create tests/local.at for Bison generic testing macros.
14710
14711 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
14712 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
14713 This new file.
14714 * tests/calc.at (AT_CHECK_CALC): Adjust.
14715 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
14716 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
14717 * tests/local.at: here.
14718 (AT_COMPILE_CXX): Tags the tests using it as c++.
14719 Ignore the test if CXX is not functional.
14720
9c2b381f
PE
147212003-03-01 Paul Eggert <eggert@twinsun.com>
14722
14723 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
14724 not loc->end, since loc->end might contain garbage and this leads
14725 to undefined behavior on some platforms.
14726 (id_loc, token_start): Use (IF_LINTed) initial values that do not
14727 depend on *loc, so that the reader doesn't give the the false
14728 impression that *loc is initialized.
14729 (<INITIAL>"%%"): Do not bother setting code_start, since its value
14730 does not survive the return.
14731
0433ba88
AD
147322003-03-01 Akim Demaille <akim@epita.fr>
14733
14734 * src/scan-gram.l (code_start): Always initialize it when entering
14735 into yylex, as SC_EPILOGUE is activated *before* the corresponding
14736 yylex invocation. An alternative would be making it static, but
14737 then it starts with the second %%'s beginning, instead of its end.
14738
b305ea69
PE
147392003-02-28 Paul Eggert <eggert@twinsun.com>
14740
14741 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
14742 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 14743 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 14744
c3d25e01
PE
147452003-02-26 Paul Eggert <eggert@twinsun.com>
14746
14747 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
14748 Remove Sequent/Pyramid discussion (nobody uses them any more).
14749 Merge VMS and MS-DOS discussion; these ports may well be dead
14750 but let's keep mentioning them for now. Put <> around email
14751 addresses. Add copyright notice.
14752
c267ffbc
PE
147532003-02-24 Paul Eggert <eggert@twinsun.com>
14754
14755 * data/glr.c (yy_reduce_print): yylineno -> yylno,
14756 to avoid collision with flex use of yylineno.
14757 Problem reported by Bruce Lilly in
161a71f3 14758 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
14759 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
14760 * data/yacc.c (yy_reduce_print): Likewise.
14761
14762 * config/depcomp: Sync with Automake 1.7.3.
14763
f939fc12
AD
147642003-02-21 Akim Demaille <akim@epita.fr>
14765
14766 * data/lalr1.cc: Use temporary variables instead of casts to
14767 change integer types.
14768 Suggested by Paul Eggert.
14769
95923bd6
AD
147702003-02-21 Akim Demaille <akim@epita.fr>
14771
14772 * doc/bison.texinfo: Use "location" consistently to refer to @n,
14773 to avoid confusions with lalr1.cc's notion of Position.
14774 Suggested by Paul Eggert.
14775
2cdc240e
AD
147762003-02-20 Akim Demaille <akim@epita.fr>
14777
14778 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
14779 before initial_columns.
14780 (location.hh): Use consistent variable names when defining the
14781 operator<<.
14782 Use "last" so that we subtract from Positions, not from unsigned.
14783
5d003116
AD
147842003-02-20 Akim Demaille <akim@epita.fr>
14785
14786 * data/lalr1.cc (position.hh): New subfile, including the extended
14787 and Doxygen'ed documentation of class Position.
14788 (location.hh): Use it.
14789 Document a` la Doxygen.
ba1ecc07 14790 With the help of Benoit Perrot.
5d003116 14791
d02b25f9
AD
147922003-02-20 Akim Demaille <akim@epita.fr>
14793
14794 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
14795 AT_YACC_IF.
14796 Redefine AT_YYERROR_SEES_LOC_IF using it.
14797 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
14798 not defined.
14799 Don't use the location in yy::Parser::error_ and
14800 yy::Parser::print_ when not %locations.
14801 Activate more lalr1.cc tests.
14802
0d1c3a04
AD
148032003-02-19 Akim Demaille <akim@epita.fr>
14804
14805 * data/lalr1.cc: When displaying a line number, be sure to make it
14806 an int.
14807
60a777aa
AD
148082003-02-19 Akim Demaille <akim@epita.fr>
14809
14810 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
14811 Remove, useless.
14812 (YYABORT, YYACCEPT, YYERROR): New.
14813 * tests/calc.at: Renable the lalr1.cc test.
14814
0b86fc41
AD
148152003-02-19 Akim Demaille <akim@epita.fr>
14816
14817 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
14818 error recovery, mixing with/without pops and discarding of the
14819 lookahead.
14820 Exercise YYERROR.
14821 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
14822
da99a5dc
PE
148232003-02-17 Paul Eggert <eggert@twinsun.com>
14824
14825 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
14826 * tests/testsuite.at (AT_COMPILE): Use them.
14827 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 14828 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 14829
93b8c255
PE
148302003-02-12 Paul Eggert <eggert@twinsun.com>
14831
14832 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
14833 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 14834 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
14835 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
14836 Check for malloc failure, for consistency with yacc.c.
14837 (yytname_size): Remove, for consistency with yacc.c.
14838
14839 The bug still remains in data/lalr1.cc, as I didn't have time
14840 to fix it there.
14841
7548fed2
AD
148422003-02-06 Akim Demaille <akim@epita.fr>
14843
14844 * configure.ac (GXX): Rename as...
14845 (CXX): this, to keep the original Autoconf semantics.
14846 Require 2.57.
14847 * data/lalr1.cc: Fix b4_copyright invocations.
14848 If YYDEBUG is not defined, don't depend upon name_ being defined.
14849 (location.hh): Include string and iostream.
14850 (Position::filename): New member.
14851 (Position::Position ()): New.
14852 (operator<< (Position)): New.
14853 (operator- (Position, int)): New.
14854 (Location::first, Location::last): Rename as...
14855 (Location::begin, Location::end): these, to mock the conventional
14856 iterator names.
14857 (operator<< (Location)): New.
14858 * tests/atlocal.in (CXX): New.
14859 * tests/testsuite.at (AT_COMPILE_CXX): New.
14860 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
14861 locations in a more synthetic way.
14862 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
14863 lalr1.cc is used.
14864 Adjust the C locations to match those from Emacs: first column is
14865 column 0.
14866 Change all the expected results.
14867 Conform to the GCS: simplify the locations when applicable.
14868 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
14869 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
14870 these CPP macros with the m4 macros new defined by...
14871 (AT_CHECK_PUSHDEFS): this, i.e.:
14872 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 14873 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
14874 New macros.
14875 (AT_CHECK_POPDEFS): Undefine them.
14876 (AT_CHECK_CALC_LALR1_CC): New.
14877 Use it for the first lalr1.cc test.
14878
43a176ef
AD
148792003-02-04 Akim Demaille <akim@epita.fr>
14880
14881 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
14882 Location as is defined.
14883
fc049e9c
AD
148842003-02-04 Akim Demaille <akim@epita.fr>
14885
14886 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
14887 name_ being defined.
14888
a737b216
PE
148892003-02-03 Paul Eggert <eggert@twinsun.com>
14890
14891 * src/gram.h (start_symbol): Remove unused decl.
14892
14893 Use more-consistent naming conventions for local vars.
14894
14895 * src/derives.c (derives_compute): Change type of local var from
14896 int to rule_number.
14897 * src/gram.c (grammar_rules_partial_print): Likewise.
14898 * src/print.c (print_core): Likewise.
14899 * src/reduce.c (reduce_grammar_tables): Likewise.
14900
14901 * src/gram.c (grammar_dump): Change name of item_number *
14902 local var from r to rp.
14903 * src/nullable.c (nullable_compute): Likewise.
14904
14905 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
14906
14907 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
14908 for symbol or symbol_number var.
14909 * src/reader.c (grammar_start_symbol_set): Likewise.
14910 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
14911 Likewise.
14912 * src/state.c (transitions_to): Likewise.
14913 * src/state.h: Likewise.
14914 * src/tables.c (symbol_number_to_vector_number): Likewise.
14915
14916 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
14917 char * var.
14918
14919 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
14920 var.
14921
14922 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
14923 var.
14924
14925 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
14926 Use str, not s, for char * var. Use ch, not c, for character var.
14927 Use size for size var.
14928
14929 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
14930 char * var.
14931 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
14932 uniqstr var.
14933 * src/uniqstr.h: Likewise.
14934
14935 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14936 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14937 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
14938 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
14939 param to have same name as that of enum, so that we don't use
14940 "s" to stand for a non-state.
14941
68e93ad5
AD
149422003-02-02 Akim Demaille <akim@epita.fr>
14943
14944 * src/scan-skel.l: Scan more than one inert character per yylex
14945 invocation.
14946
92898986
PE
149472003-02-01 Paul Eggert <eggert@twinsun.com>
14948
14949 Version 1.875a.
14950
1d9d5d71
PE
14951 * po/LINGUAS: Add ms.
14952
0435d061
AD
149532003-01-30 Akim Demaille <akim@epita.fr>
14954
14955 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
14956
6029a57f
PH
149572003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14958
14959 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
14960 of $1.
0435d061
AD
14961
14962 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 14963 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 14964 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 14965
6029a57f
PH
14966 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
14967 (b4_rhs_location): Ditto.
0435d061 14968 (yyfill): New function to copy from stack tree into array
6029a57f 14969 incrementally.
0435d061
AD
14970 (yyuserAction): Modify to allow incremental move of semantic values
14971 to rhs array when in GLR mode.
14972 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
14973 as needed.
14974 Remove dummy use of yystack, as there is now a guaranteed use.
14975 (yydoAction): Modify to allow incremental move of semantic values
14976 to rhs array when in GLR mode.
14977 (yyresolveAction): Ditto.
14978 (yyglrShiftDefer): Update comment.
0435d061 14979 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
14980 (yyglrReduce): Ditto.
14981 (yydoAction): Ditto
0435d061 14982
6029a57f
PH
14983 * tests/glr-regr1.at: Rename to ...
14984 * tests/glr-regression.at: Add new regression test for the problems
14985 described above (adapted from S. Eken).
14986 Update copyright notice.
14987 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
14988 * tests/Makefile.am: Ditto.
14989
6cee6297
PE
149902003-01-28 Paul Eggert <eggert@twinsun.com>
14991
14992 * data/lalr1.cc: Do not use @output_header_name@ unless
14993 b4_defines_flag is set. This fixes two bugs reported by
14994 Tim Van Holder in
161a71f3
PE
14995 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
14996 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 14997
b2a836b5
PE
149982003-01-21 Paul Eggert <eggert@twinsun.com>
14999
15000 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
15001 we don't need to worry about yyerrlab1 being reported as an
15002 "unused label" by non-GCC C compilers. The downside is that if
15003 locations are used then a couple of statements are duplicated each
15004 time YYERROR is invoked, but the upside is that the warnings
15005 should vanish.
15006 (yyerrlab1): Move code to YERROR.
15007 (yyerrlab2): Remove. Change uses back to yyerrlab1.
15008 This reverts some of the 2002-12-27 change.
15009
4196b931
PE
150102003-01-17 Paul Eggert <eggert@twinsun.com>
15011
15012 * src/output.c (symbol_printers_output): Fix typo that led
15013 to core dump. Problem reported by Antonio Rus in
161a71f3 15014 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 15015
3ae831b4
AD
150162003-01-13 Akim Demaille <akim@epita.fr>,
15017 Quoc Peyrot <chojin@lrde.epita.fr>,
15018 Robert Anisko <anisko_r@lrde.epita.fr>
15019
15020 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
15021 when the stacks contain one element, as the loop would otherwise
15022 free the last state, and then use the top state (the one we just
15023 popped). This means that the initial elements will not be freed
15024 explicitly, as is the case in yacc.c; it is not a problem, as
15025 these elements have fake values.
15026
e3aa65c5
PE
150272003-01-11 Paul Eggert <eggert@twinsun.com>
15028
15029 * NEWS: %expect-violations are now just warnings, reverting
15030 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
15031 bootstrapping problem reported by Matthias Klose; see
161a71f3 15032 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
15033 * src/conflicts.c (conflicts_print): Likewise.
15034 * tests/conflicts.at (%expect not enough, %expect too much,
15035 %expect with reduce conflicts): Likewise.
15036 * doc/bison.texinfo (Expect Decl): Document this. Also mention
15037 that the warning is enabled if the number of conflicts changes
15038 (not necessarily increases).
15039
15040 * src/getargs.c (version): Update copyright year.
15041
f0057011
AD
150422003-01-09 Akim Demaille <akim@epita.fr>
15043
15044 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
15045
1ee6d2a0
PE
150462003-01-08 Paul Eggert <eggert@twinsun.com>
15047
15048 * Makefile.maint (WGETFLAGS):
15049 New macro, containing "-C off" to disable proxy caches.
15050 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
15051 (rel-check): Use $(WGET) instead of wget.
15052
d4fd77c4
PE
150532003-01-06 Paul Eggert <eggert@twinsun.com>
15054
15055 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
15056 the GLR paper of Scott, Johnstone and Hussain.
15057
464c6927
PE
150582003-01-04 Paul Eggert <eggert@twinsun.com>
15059
d600ee67
PE
15060 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
15061 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
15062 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
15063 (EXTRA_LIBRARIES): New var, for liby.a.
15064 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
15065 (EXTRA_SCRIPTS): New var, for yacc.
15066
464c6927
PE
15067 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
15068 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
15069 Problem reported by Nelson H. F. Beebe.
15070
150712003-01-03 Paul Eggert <eggert@twinsun.com>
15072
15073 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
15074 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
15075 when compiling Bison 1.875's `bitset bset = obstack_alloc
15076 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
15077
15078 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
15079 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
15080 grow to a huge size with typical invocation.
d600ee67 15081
464c6927
PE
15082 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
15083 Use the pattern recommended by Autoconf 2.57, except also protect
15084 against double-definition.
15085 * src/system.h: Likewise.
15086 Portability issues reported by Nelson H. F. Beebe.
d600ee67 15087
464c6927
PE
15088 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
15089 All uses changed. Provide a definition in both C and C++.
15090 (yytrue, yyfalse): Define even if defined (__cplusplus).
15091
15092 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
15093 Reported by Nelson H. F. Beebe.
d600ee67 15094
464c6927
PE
15095 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
15096
0f42c7d5
PE
150972003-01-02 Paul Eggert <eggert@twinsun.com>
15098
15099 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
15100 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
15101 Bug reported by Nelson H. F. Beebe.
15102
dc546b0f
PE
151032003-01-01 Paul Eggert <eggert@twinsun.com>
15104
15105 * Version 1.875.
15106
2c09b6a7
PE
151072002-12-30 Paul Eggert <eggert@twinsun.com>
15108
15109 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
15110 Moved here from...
15111 (<INITIAL>","): Here. This causes stray "," to be treated
15112 more uniformly.
15113
dc546b0f 15114 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
15115 last brace in braced code when not in Yacc mode, for compatibility
15116 with Bison 1.35. This resurrects the 2001-12-15 patch to
15117 src/reader.c.
15118
15119 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
15120 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
15121
535c0f63
PE
151222002-12-28 Paul Eggert <eggert@twinsun.com>
15123
15124 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
15125 that of SYM's type. This fixes Debian bug 168069, reported by
15126 Thomas Olsson.
d600ee67 15127
963fcc17
PE
151282002-12-28 Paul Eggert <eggert@twinsun.com>
15129
15130 Version 1.75f.
15131
15132 Switch back to the Yacc style of conflict reports, undoing some
15133 of the 2002-07-30 change.
15134 * doc/bison.texinfo (Understanding): Use Yacc style for
15135 conflict reports. Also, use new way of locating rules.
15136 * src/conflicts.c (conflict_report):
15137 Renamed from conflict_report_yacc, removing the old
15138 'conflict_report'. Translate the entire conflict report at once,
15139 so that we don't assume that "," has the same interpretation in
15140 all languages.
15141 (conflicts_output): Use Yacc-style conflict report for each state,
15142 instead of our more-complicated style.
15143 (conflicts_print): Use Yacc-style conflict report, except print
15144 the input file name when not emulating Yacc.
15145 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
15146 Conflicted Reduction, %expect not enough, %expect too much,
15147 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
15148 * tests/existing.at (GNU Cim Grammar): Likewise.
15149 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
15150
15151 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
15152 fatal): Don't invoke fflush; it's not needed and it might even be
15153 harmful for stdout, as stdout might not be open.
15154 * src/reduce.c (reduce_print): Likewise.
15155
b1efe548
PE
151562002-12-27 Paul Eggert <eggert@twinsun.com>
15157
15158 Fix a bug where error locations were not being recorded correctly.
15159 This problem was originally reported by Paul Hilfinger in
161a71f3 15160 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
15161
15162 * data/yacc.c (yyparse): New local var yylerrsp, to record the
15163 top of the location stack's error locations.
15164 (yyerrlab): Set it. When discarding a token, push its location
15165 onto yylerrsp so that we don't lose track of the error's end.
15166 (yyerrlab1): Now is only the target of YYERROR, so that we can
15167 properly record the location of the action that failed. For GCC
15168 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
15169 GCC warning about yyerrlab1 being unused if YYERROR is unused.
15170 (yyerrlab2): New label, which yyerrlab now falls through to.
15171 Compute the error's location by applying YYLLOC_DEFAULT to
15172 the locations of all the symbols that went into the error.
15173 * doc/bison.texinfo (Location Default Action): Mention that
15174 YYLLOC_DEFAULT is also invoked for syntax errors.
15175 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
15176 Error locations include the locations of all the tokens that were
15177 discarded, not just the last token.
d600ee67 15178
983c5c2c
PE
151792002-12-26 Paul Eggert <eggert@twinsun.com>
15180
b1efe548
PE
15181 * src/files.c: Include quote.h.
15182 (compute_output_file_names): Warn if we detect conflicting
15183 outputs to the same file. This should catch the misunderstanding
15184 exemplified by Debian Bug 165349, reported by Bruce Stephens..
15185
15186 * src/conflicts.c (conflicts_print): If the user specifies
15187 "%expect N", report an error if there are any reduce/reduce
15188 conflicts. This is what the manual says should happen.
15189 This fixes Debian bug 130890, reported by Anthony DeRobertis.
15190 * tests/conflicts.at (%expect with reduce conflicts): New test.
15191
983c5c2c
PE
15192 Don't use m4_include on relative file names, as it doesn't work as
15193 desired if there happens to be a file with that name under ".".
d600ee67 15194
983c5c2c
PE
15195 * m4sugar/version.m4: Remove; it was included but it wasn't used.
15196 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
15197 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
15198 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
15199 * src/output.c (output_skeleton): Use full path names when
15200 specifying a file to include; don't rely on include path, as
15201 it's unreliable when the working file contains a file with
15202 that name.
d600ee67 15203
983c5c2c
PE
152042002-12-25 Paul Eggert <eggert@twinsun.com>
15205
15206 Remove obsolete references to bison.simple and bison.hairy.
15207 Problem mentioned by Aubin Mahe in
161a71f3 15208 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
15209 * data/glr.c: Comment fix.
15210 * doc/bison.1: Remove references. Also, mention "yacc".
15211
15212 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
15213 with -g option.
15214
15215 * src/parse-gram.y (declaration): Use enum "report_states" rather
15216 than its numeric value 1.
15217
15218 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
15219 opening a new one. This fixes Debian bug 165349, reported by
15220 Bruce Stephens.
15221
23f2d9dc
PE
152222002-12-24 Paul Eggert <eggert@twinsun.com>
15223
15224 Version 1.75e.
15225
15226 * Makefile.maint (cvs-update): Don't assume that the shell
15227 supports $(...), as Solaris sh doesn't.
15228
15229 * src/parse-gram.y (lloc_default): Remove test for empty
15230 nonterminals at the end, since it didn't change the result.
15231
152322002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
15233
15234 If the user does not define YYSTYPE as a macro, Bison now declares it
15235 using typedef instead of defining it as a macro. POSIX requires this.
15236 For consistency, YYLTYPE is also declared instead of defined.
15237
15238 %union directives can now have a tag before the `{', e.g., the
15239 directive `%union foo {...}' now generates the C code
15240 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
15241 The default union tag is `YYSTYPE', for compatibility with Solaris 9
15242 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
15243 instead of `yyltype'.
15244
15245 `yystype' and `yyltype' are now obsolescent macros instead of being
15246 typedefs or tags; they are no longer documented and will be
15247 withdrawn in a future release.
15248
15249 * data/glr.c (b4_location_type): Remove.
15250 (YYSTYPE): Renamed from yystype.
15251 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
15252 (struct YYLTYPE): Renamed from struct yyltype.
15253 (YYLTYPE): Renamed from yyltype.
15254 (yyltype, yystype): New (and obsolescent) macros,
15255 for backward compatibility.
15256 * data/yacc.c: Likewise.
15257
15258 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
15259 does not specify a union tag. This is for compatibility with
15260 Solaris 9 yacc.
15261
15262 * src/parse-gram.y (add_param): 2nd arg is now char * not char
15263 const *, since it is now modified by stripping surrounding { }.
15264 (current_braced_code): Remove.
15265 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
15266 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
15267 trailing " {...}". Now of type <chars>.
15268 (grammar_declaration): Adjust to bundled tokens.
15269 (code_content): Remove; stripping is now done by add_param.
15270 (print_token_value): Print contents of bundled tokens.
15271 (token_name): New function.
15272
15273 * src/reader.h (braced_code, current_braced_code): Remove.
15274 (token_name): New decl.
15275
15276 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
15277 token_type, not braced_code code_kind. All uses changed.
15278 (SC_PRE_CODE): New state, for scanning after a keyword that
15279 has (or usually has) an immediately-following braced code.
15280 (token_type): New local var, to keep track of which token type
15281 to return when scanning braced code.
15282 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 15283 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
15284 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
15285 instead of returning a token type immediately.
15286 (<INITIAL>"{"): Set token type.
15287 (<SC_BRACED_CODE>"}"): Use it.
15288 (handle_action_dollar, handle_action_at): Now returns bool
15289 indicating success. Fail if ! current_rule; this prevents a core dump.
15290 (handle_symbol_code_dollar, handle_symbol_code_at):
15291 Remove; merge body into caller.
15292 (handle_dollar, handle_at): Complain in invalid contexts.
15293
15294 * NEWS, doc/bison.texinfo: Document the above.
15295 * NEWS: Fix years and program names in copyright notice.
15296
879ca4f8
PE
152972002-12-17 Paul Eggert <eggert@twinsun.com>
15298
15299 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
15300 Reporting, Table of Symbols): Omit mentions of %lex-param and
15301 %parse-param from the documentation for now.
15302
1c5fe69d
PE
153032002-12-15 Paul Eggert <eggert@twinsun.com>
15304
15305 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
15306 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
15307 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
15308 disagreed with the Bison documentation. Bug
15309 reported by Andrew Walrond.
d600ee67 15310
1c5fe69d
PE
15311 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
15312 as the caller now does that.
15313 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
15314 (YYEMPTY): Parenthesize right hand side, since others use it.
15315 (yyparse): Don't assume that our generated code is the only code
15316 that sets yychar.
15317
d1de5372
PE
153182002-12-13 Paul Eggert <eggert@twinsun.com>
15319
15320 Version 1.75d.
15321
15322 POSIX requires a "yacc" command.
15323 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
15324 (MOSTLYCLEANFILES): Add yacc.
15325 (yacc): New rule.
1c5fe69d 15326 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
15327 as an alias for bison y.
15328
15329 * po/LINGUAS: Add da.
d600ee67 15330
d1de5372
PE
15331 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
15332 problem with latest <getopt.h>.
15333 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
15334
15335 * doc/fdl.texi: Upgrade to 1.2.
15336 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
15337 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
15338 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
15339 gnulib.
15340 * config/install-sh: Sync with autotools.
15341
15342 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 15343 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
15344 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
15345 locations are requested.
15346 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
15347 locations are requested.
15348
d0f3fe23
PE
153492002-12-12 Paul Eggert <eggert@twinsun.com>
15350
15351 Remove unportable casts and storage allocation tricks.
15352 While we're at it, remove almost all casts, since they
15353 usually aren't needed and are a sign of trouble.
15354
15355 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
15356
15357 * src/derives.c (derives_compute): Do not subtract NTOKENS from
15358 the pointer DSET returned by malloc; this isn't portable.
15359 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
15360 Similarly for DERIVES.
15361 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
15362 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
15363 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
15364
15365 * src/derives.c (derives_compute): Do not bother invoking
15366 int_of_rule_number, since rule numbers are integers.
15367
15368 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
15369 rather than XMALLOC (char, N).
15370
15371 * src/files.c (filename_split): Rewrite to avoid cast.
15372
15373 * src/gram.h (symbol_number_as_item_number,
15374 item_number_as_symbol_number, rule_number_as_item_number,
15375 item_number_as_rule_number):
15376 Now inline functions rather than macros, to avoid casts.
15377 * src/state.h (state_number_as_int): Likewise.
15378 * src/tables.c (state_number_to_vector_number,
15379 symbol_number_to_vector_number): Likewise.
15380
15381 * src/gram.h (int_of_rule_number): Remove; no longer used.
15382
15383 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
15384 since the resulting storage is always stored into.
15385
15386 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
15387 where it's needed.
15388
15389 * src/muscle_tab.c (muscle_m4_output):
15390 Now inline. Return bool, not int.
15391 * src/state.c (state_compare): Likewise.
15392 * src/symtab.c (symbol_check_defined,
15393 symbol_check_alias_consistency, symbol_pack, symbol_translation,
15394 hash_compare_symbol, hash_symbol):
15395 Likewise.
15396 * src/uniqstr.c (uniqstr_print): Likewise.
15397 * src/muscle_tab.c (muscle_m4_output_processor):
15398 New function, to avoid casts.
15399 * src/state.c (state_comparator, stage_hasher): Likewise.
15400 * src/symtab.c (symbol_check_defined_processor,
15401 symbol_check_alias_consistency_processor, symbol_pack_processor,
15402 symbol_translation_processor, hash_symbol_comparator,
15403 hash_symbol_hasher): Likewise.
15404 * src/uniqstr.c (uniqstr_print_processor): Likewise.
15405 * src/muscle_tab.c (muscles_m4_output):
15406 Use new functions instead of casting old functions unportably.
15407 * src/state.c (state_hash_new): Likewise.
15408 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
15409 symbols_token_translations_init):
15410 Likewise.
15411 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
15412
15413 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
15414 var instead of casting to long, to avoid casts.
15415 (prepare_states): Use MALLOC rather than alloca, so that we don't
15416 have to worry about alloca.
15417 * src/state.c (state_hash_lookup): Likewise.
15418
15419 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
15420 local var instead of casting to unsigned char, to avoid casts.
15421
15422 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
15423 STATE_ALLOC): Remove.
15424 (transitions_new, errs_new, reductions_new, state_new): Use malloc
15425 rather than calloc, and use offsetof to avoid allocating slightly
15426 too much storage.
15427 (state_new): Initialize all members.
15428
15429 * src/state.c (state_hash): Use unsigned accumulator, not signed.
15430
15431 * src/symtab.c (symbol_free): Remove; unused.
15432 (symbol_get): Remove cast in lhs of assignment.
15433 (symbols_do): Now static. Accept generic arguments, not
15434 hashing-related ones.
15435
15436 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
15437 (symbol_processor): Remove.
15438 (symbols_do): Remove decl; now static.
15439
15440 * src/system.h (alloca): Remove; decl no longer needed.
15441 (<stddef.h>): Include, for offsetof.
15442 (<inttypes.>, <stdint.h>): Include if available.
15443 (uintptr_t): New type, if system lacks it.
15444 (CALLOC, MALLOC, REALLOC): New macros.
15445 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
15446 new macros.
15447
15448 * src/tables.c (table_size): Now int, to pacify GCC.
15449 (table_grow, table_ninf_remap): Use signed table size.
15450 (save_row): Don't bother initializing locals when not needed.
15451 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
15452 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
15453
15454 * src/vcg.h: Correct misspellings.
15455
15456 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
15457
15458
15459 * src/getargs.c (getargs): Don't assume EOF == -1.
15460
26b4a969
PE
154612002-12-09 Paul Eggert <eggert@twinsun.com>
15462
15463 Change identifier spellings to avoid collisions with names
15464 that are reserved by POSIX.
15465
15466 Don't use names ending in _t, since POSIX reserves them.
15467 For consistency, remove _e and _s endings -- they're weren't
15468 needed to remove ambiguity. All uses changed.
15469 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
15470 turn was just renamed from struniq_t.
15471 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
15472 which in turn was just renamed from struniq_processor_t.
15473 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
15474 in turn was renamed from hash_compare_struniq_t.
15475 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
15476 (state_list): Renamed from state_list_t.
15477 * src/assoc.h (assoc): Renamed from assoc_t.
15478 * src/conflicts.c (enum conflict_resolution): Renamed from
15479 enum conflict_resolution_e.
15480 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
15481 (rule_list): Renamed from rule_list_t.
15482 * src/getargs.h (enum trace): Renamed from enum trace_e.
15483 (enum report): Renamed from enum report_e.
15484 * src/gram.h (item_number): Renamed from item_number_t.
15485 (rule_number): Renamed from rule_number_t.
15486 (struct rule_s): Remove the "rule_s" part; not used.
15487 (rule): Renamed from rule_t.
15488 (rule_filter): Renamed from rule_filter_t.
15489 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
15490 (goto_list): Renamed from goto_list_t.
15491 * src/lalr.h (goto_number): Renamed from goto_number_t.
15492 * src/location.h (location): Renamed from location_t.
15493 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
15494 and moved here from:
15495 * src/muscle_tab.h (muscle_entry_t): here.
15496 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
15497 (rule_list): Renamed from rule_list_t.
15498 * src/print_graph.c (static_graph): Renamed from graph.
15499 * src/reader.h (braced_code): Renamed from braced_code_t.
15500 Remove brace_code_e tag.
15501 * src/relation.h (relation_node): Renamed from relation_node_t.
15502 (relation_nodes): Renamed from relation_nodes_t.
15503 (relation): Renamed from relation_t.
15504 * src/state.h (state_number): Renamed from state_number_t.
15505 (struct state): Renamed from struct state_s.
15506 (state): Renamed from state_t.
15507 (transitions): Renamed from transitions_t. Unused (and
15508 misspelled) transtion_s tag removed.
15509 (errs): Renamed from errs_t. Unused errs_s tag removed.
15510 (reductions): Renamed from reductions_t. Unused tag
15511 reductions_s removed.
15512 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
15513 (struct symbol_list): Renamed from struct symbol_list_s.
15514 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
15515 (struct symbol): Renamed from struct symbol_s.
15516 (symbol): Renamed from symbol_t.
15517 * src/tables.c (vector_number): Renamed from vector_number_t.
15518 (action_number): Renamed from action_t.
15519 * src/tables.h (base_number): Renamed from base_t.
15520 * src/vcg.h (enum color): Renamed from enum color_e.
15521 (enum textmode): Renamed from enum textmode_e.
15522 (enum shape): Renamed from enum shape_e.
15523 (struct colorentry): Renamed from struct colorentry_s.
15524 (struct classname): Renamed from struct classname_s.
15525 (struct infoname): Renamed from struct infoname_s.
15526 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
15527 (enum decision): Renamed from enum decision_e.
15528 (enum orientation): Renamed from enum orientation_e.
15529 (enum alignment): Renamed from enum alignment_e.
15530 (enum arrow_mode): Renamed from enum arrow_mode_e.
15531 (enum crossing_type): Renamed from enum crossing_type_e.
15532 (enum view): Renamed from enum view_e.
15533 (struct node): Renamed from struct node_s.
15534 (node): Renamed from node_t.
15535 (enum linestyle): Renamed from enum linestyle_e.
15536 (enum arrowstyle): Renamed from enum arrowstyle_e.
15537 (struct edge): Renamed from struct edge.
15538 (edge): Renamed from edge_t.
15539 (struct graph): Renamed from struct graph_s.
15540 (graph): Renamed from graph_t.
15541 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
15542 Rename value_t -> value.
15543 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
15544 value_t_as_yystype -> value_as_yystype.
15545
15546 Don't include <errno.h> in the mainstream code, since it
15547 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
15548 * lib/get-errno.c, lib/get-errno.h: New files.
15549 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
15550 get-errno.c.
15551 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
15552 * src/output.c (output_skeleton): Likewise.
15553 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
15554 instead of errno.
15555 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
15556 Likewise.
15557 (handle_action_dollar, handle_action_at): Likewise.
15558 * src/system.h: Do not include <errno.h>.
15559 (TAB_EXT): Renamed from EXT_TAB.
15560 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
15561
15562 Avoid str[a-z]*, since <string.h> reserves that name space.
15563 Change all instances of "struniq" in names to "uniqstr", and
15564 likewise for "STRUNIQ" and "UNIQSTR".
15565 * src/uniqstr.c: Renamed from src/struniq.c.
15566 * src/uniqstr.h: Renamed from src/struniq.h.
15567 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
15568 * src/files.c (strsuffix): Remove; unused.
15569 (concat2): Renamed from stringappend. Now static.
15570 * src/files.h (strsuffix, stringappend): Remove; unused.
15571 * src/parse-gram.y (<chars>): Renamed from <string>.
15572 (<uniqstr>): Renamed from <struniq>.
15573 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
15574 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
15575 (struct graph_s.expand): Renamed from struct graph_s.stretch.
15576 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
15577 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
15578 (N_EXPAND): Renamed from N_STRETCH.
15579
15580 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
15581 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
15582 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
15583 Remove; unused.
15584 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
15585 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
15586 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
15587 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
15588 (BASE_MAXIMUM): Renamed from BASE_MAX.
15589 (BASE_MINIMUM): Renamed from BASE_MIN.
15590 (ACTION_MAX): Remove; unused.
15591 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
15592 Unnecessary casts removed from above defines.
15593
15594
15595 Fix misspelling in names.
15596 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
15597 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
15598 G_NODE_ALIGNEMENT.
15599
15600
15601 * lib/timevar.c (timevar_report): Renamed from time_report,
15602 for consistency with other names.
15603 * lib/timevar.h (timevar_report): New decl.
15604 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
15605
15606
15607 Sort include-file uses.
15608
15609 Reorder all include files under src to be in the order "system.h".
15610 then the ../lib include files in angle brackets (alphabetized),
15611 then the . include files in double-quotes (alphabetized). Fix
15612 dependency breakages encountered in this process, as follows:
15613 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
15614 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
15615 * src/state.h: Include "symtab.h".
15616
996b1c7e
PE
156172002-12-08 Paul Eggert <eggert@twinsun.com>
15618
15619 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
15620 since this causes problems when __file__ contains character
15621 sequences like "@" that are treated specially by src/scan-skel.l.
15622 Instead, just use the file's basename. This fixes the bug
15623 reported by Martin Mokrejs in
161a71f3 15624 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 15625
e19c4e5d
PE
156262002-12-06 Paul Eggert <eggert@twinsun.com>
15627
15628 Add support for rules that do not have trailing semicolons, as
15629 POSIX requires. Improve the quality of locations in Bison
15630 diagnostics.
26b4a969 15631
e19c4e5d
PE
15632 * src/location.c: Include <quotearg.h>.
15633 (empty_location): Now const.
15634 (location_print): New function. Follow the recommendation of the
15635 GNU Coding Standards for locations that span file boundaries.
15636 * src/location.h: Do not include <quotearg.h>; no longer needed.
15637 (boundary): New type.
15638 (location_t): Use it. This allows locations to span file boundaries.
15639 All member uses changed: file -> start.file or end.file (as needed),
15640 first_line -> start.line, first_column -> start.column,
15641 last_line -> end.line, last_column -> end.column.
15642 (equal_boundaries): New function.
15643 (LOCATION_RESET, LOCATION_STEP): Remove.
15644 (LOCATION_PRINT): Remove. All callers changed to use location_print.
15645 (empty_location): Now const.
15646 (location_print): New decl.
15647 * src/parse-gram.y (lloc_default): New function, which handles
15648 empty locations more accurately.
15649 (YYLLOC_DEFAULT): Use it.
15650 (%token COLON): Remove.
15651 (%token ID_COLON): New token.
26b4a969 15652 (rules): Use it.
e19c4e5d
PE
15653 (declarations, rules): Remove trailing semicolon.
15654 (declaration, rules_or_grammar_declaration):
15655 Allow empty (";") declaration.
15656 (symbol_def): Remove empty actions; no longer needed.
15657 (rules_or_grammar_declaration): Remove trailing semicolon.
15658 (semi_colon.opt): Remove.
15659 * src/reader.h: Include location.h.
15660 (scanner_cursor): New decl.
15661 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
15662 rolling our own.
15663 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
15664 of *loc.
15665 (STEP): Remove. No longer needed, now that adjust_location does
15666 the work. All uses removed.
15667 (scanner_cursor): New var.
15668 (adjust_location): Renamed from extend_location. It now sets
15669 *loc and adjusts the scanner cursor. All uses changed.
15670 Don't bother testing for CR.
15671 (handle_syncline): Remove location arg; now updates scanner cursor.
15672 All callers changed.
15673 (unexpected_end_of_file): Now accepts start boundary of token or
15674 comment, not location. All callers changed. Update scanner cursor,
15675 not the location.
15676 (SC_AFTER_IDENTIFIER): New state.
15677 (context_state): Renamed from c_context. All uses changed.
15678 (id_loc, code_start, token_start): New local vars.
15679 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
15680 processing of Yacc white space and equivalents here.
15681 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
15682 instead of returning ID immediately, since we need to search for
15683 a subsequent colon.
15684 (<INITIAL>"'", "\""): Save token_start.
15685 (<INITIAL>"%{", "{", "%%"): Save code_start.
15686 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
15687 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
15688 BEGIN context_state at end, not INITIAL.
15689 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
15690 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
15691 Return correct token start.
15692 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
15693 the start of a character, string or multiline comment is found.
15694 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
15695 Reduction): Adjust reported locations to match the more-precise
15696 results now expected.
15697 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
15698 * tests/reduce.at (Useless Rules, Reduced Automaton,
15699 Underivable Rules): Likewise.
15700 * tests/regression.at (Invalid inputs): No longer `expecting ";"
15701 or "|"' now that so many other tokens are allowed by the new grammar.
15702
15703 * src/complain.h (current_file): Remove duplicate decl;
15704 current_file is now owned by files.h.
15705 * src/complain.c, src/scan-gram.l: Include files.h.
15706
157072002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 15708
e19c4e5d
PE
15709 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
15710 promotes to int; it might be unsigned int.
15711 * data/yacc.c (yy_reduce_print): Likewise.
15712
15713 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
15714 be #defined in the prologue, not in the Bison declarations.
15715 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 15716
b64755e3
PE
157172002-12-02 Paul Eggert <eggert@twinsun.com>
15718
15719 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
15720 * lib/strtoul.c: New file, from gnulib.
15721 This fixes a porting bug reported by Peter Klein in
161a71f3 15722 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 15723
6e746484
PE
157242002-11-30 Paul Eggert <eggert@twinsun.com>
15725
b64755e3
PE
15726 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
15727 and put only a forward declaration in the prologue. This is for
15728 consistency with the other scanner helper functions.
15729
6ba55592
PE
15730 Type clashes now generate warnings, not errors, since it
15731 appears that POSIX may allow some grammars with type clashes.
15732 * src/reader.c (grammar_current_rule_check): Warn about
15733 type clashes instead of complaining.
15734 * tests/input.at (Type Clashes): Expect warnings, not complaints.
15735
6e746484
PE
15736 Add Yacc library, since POSIX requires it.
15737 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
15738 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
15739 * lib/main.c, lib/yyerror.c: New files.
15740
15741 gram_error can be static; it need not be extern.
15742 * src/reader.h (gram_error): Remove decl.
15743 * src/parse-gram.y (gram_error): Now static. Add static decl.
15744 (print_token_value): Omit parameter names from forward decl,
15745 for consistency.
15746
88510f9c
PE
157472002-11-29 Paul Eggert <eggert@twinsun.com>
15748
6e746484
PE
15749 * doc/bison.texinfo: Emphasize that yylex and yyerror must
15750 be declared before being used. E.g., one should typically
15751 declare them in the prologue. Use GNU coding style in examples.
15752 Put "const" consistently after the type it modifies. Mention
15753 that C99 supports "inline". Mention that yyerror traditionally
15754 returns "int".
15755
88510f9c
PE
15756 %parse-param and %lex-param now take just one argument, the
15757 declaration; the argument name is deduced from the declaration.
15758
15759 * doc/bison.texinfo (Parser Function, Pure Calling, Error
15760 Reporting, Table of Symbols): Document this.
15761 * src/parse-gram.y (add_param): New function.
15762 (COMMA): Remove.
15763 (declaration): Implement new rule for %parse-param and %lex-param.
15764 * src/scan-gram.l: "," now elicits a warning, rather than being
15765 a token; this is more compatible with byacc.
15766 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
15767
bb92250c
PE
157682002-11-27 Paul Eggert <eggert@twinsun.com>
15769
15770 Rename identifiers to avoid real and potential collisions.
15771
15772 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
15773 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 15774 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
15775 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
15776 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
15777 * src/parse-gram.y (print_token_value): Renamed from yyprint.
15778 All uses changed.
15779 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
15780 The name "yycontrol" violates the name space rules, and this stuff
15781 wasn't being used anyway.
15782 (input): Remove action; this stuff wasn't being used.
15783 (gram_error): Rename local variable yylloc -> loc.
15784 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
15785 (YY_DECL): Don't use "yy" at start of local variables.
15786 All uses changed, e.g., yylloc -> loc.
15787 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
15788 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
15789 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
15790 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
15791
15792 * src/parse-gram.y (gram_error): loc is now const *.
15793 * src/reader.h (gram_error): Likewise.
15794
3af4feb2
PE
157952002-11-24 Paul Eggert <eggert@twinsun.com>
15796
15797 Version 1.75c.
15798
15799 * tests/actions.at (Actions after errors): Use an output format
15800 more similar to that of the Printers and Destructors test.
15801 Test the position of the ';' token too.
15802 (Printers and Destructors): Likewise.
15803 (Printers and Destructors: %glr-parser): Remove for now, to avoid
15804 unnecessarily alarming people when the test fails.
15805
15806 * data/yacc.c (yyerrlab1): Move this label down, so that the
15807 parser does not discard the lookahead token if the user code
15808 invokes YYERROR. This change is required for POSIX conformance.
15809
15810 * lib/error.c: Sync with gnulib.
15811
158122002-11-22 Paul Eggert <eggert@twinsun.com>
15813
15814 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
15815 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
15816 * lib/xmalloc.c: Likewise.
26b4a969 15817
58004308
PE
158182002-11-20 Paul Eggert <eggert@twinsun.com>
15819
15820 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
15821
158222002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 15823
58004308
PE
15824 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
15825 should use `if (! x) abort ();' rather than `assert (x);', and
15826 anyway it's one less thing to worry about configuring.
15827
15828 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
15829 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
15830 and replace all instances of assert with abort.
15831 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
15832 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
15833
15834 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
15835 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
15836 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
15837 hash_find_entry, hash_rehash, hash_insert): Likewise.
15838 * src/conflicts.c (resolve_sr_conflict): Likewise.
15839 * src/lalr.c (set_goto_map, map_goto): Likewise.
15840 * src/nullable.c (nullable_compute): Likewise.
15841 * src/output.c (prepare_rules, token_definitions_output): Likewise.
15842 * src/reader.c (packgram, reader): Likewise.
15843 * src/state.c (state_new, state_free, state_transitions_set,
15844 state_reduction_find): Likewise.
15845 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
15846 symbol_pack): Likewise.
15847 * src/tables.c (conflict_row, pack_vector): Likewise.
15848 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15849 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15850 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
15851 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
15852
15853 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
15854 (ARGMATCH_CONSTRAINT): New macro.
15855 (ARGMATCH_ASSERT): Use it.
15856
15857 * src/system.h (verify): New macro.
15858 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
15859 rather than assert.
15860 * src/tables.c (tables_generate): Likewise.
15861
15862 * src/struniq.c (struniq_assert): Now returns void, and aborts
15863 if the assertion is false.
15864 (struniq_assert_p): Remove.
15865 * src/struniq.h: Likewise.
15866
76ae8198
PE
158672002-11-18 Paul Eggert <eggert@twinsun.com>
15868
15869 * data/glr.c (yygetLRActions): Replace `yyindex' with
15870 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
15871 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 15872 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 15873
d3c4e709
AD
158742002-11-18 Akim Demaille <akim@epita.fr>
15875
15876 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
15877 space.
15878 From Tim Van Holder.
15879
8d8a7238
PE
158802002-11-17 Paul Eggert <eggert@twinsun.com>
15881
15882 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
15883 to "SyntaxError" for consistency with my 2002-11-15 change.
15884
15885 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
15886 not define to {}, since this breaks the common use of `YYDPRINTF
15887 ((...));' if a single statement is desired (e.g. before `else').
15888 Work around GCC warnings by surrounding corresponding calls with
15889 {} if needed.
15890 (yyhasResolvedValue): Remove unused function.
15891 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
15892 loop body.
15893 (yyreportSyntaxError): Renamed from yyreportParseError.
15894 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
15895 All uses changed.
15896 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
15897 extern when possible. Remove unused initializations.
15898
b0937b22
AD
158992002-11-16 Akim Demaille <akim@epita.fr>
15900
15901 Augment the similarity between GLR and LALR traces.
15902
15903 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
15904 (YY_REDUCE_PRINT): New.
15905 (yyparse): Use them.
15906 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
15907 YYDPRINT here.
15908 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
15909 state reached after the reduction/recovery, since...
15910 (yyparse, yyprocessOneStack): Report the state we are entering in.
15911
c5e3e510
AD
159122002-11-16 Akim Demaille <akim@epita.fr>
15913
15914 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
15915 Add support for --trace=skeleton.
15916 * src/scan-skel.l: %option debug.
15917 Scan strings of non-@ or \n instead of character by character.
15918 (scan_skel): Handle trace_skeleton.
15919 (QPUTS): New.
15920 (@output_parser_name@, @output_header_name@): ``Restore'' their
15921 support (used to be M4 macros).
15922 * data/yacc.c: Quote larger chunks, a la glr.c.
15923 * data/lalr1.cc: Likewise.
15924 The header guards are no longer available, so use some other
15925 string than `YYLSP_NEEDED'.
15926
4c6cc1db
AD
159272002-11-16 Akim Demaille <akim@epita.fr>
15928
15929 Make the ``Printers and Destructors'' test more verbose, taking
15930 `yacc.c''s behavior as (possibly wrong) reference.
15931
15932 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
15933 instead of fprint on stdout.
15934 Set and report the last_line of the symbols.
15935 Consistently display values and locations.
15936
6d9e8019
PE
159372002-11-16 Paul Eggert <eggert@twinsun.com>
15938
15939 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
15940
6e649e65
PE
159412002-11-15 Paul Eggert <eggert@twinsun.com>
15942
b25d88f6
PE
15943 * tests/actions.at (Actions after errors): New test case.
15944
6e649e65
PE
15945 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
15946 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
15947 tests/action.at, tests/calc.at, tests/conflicts.at,
15948 tests/cxx-type.at, tests/regression.at:
15949 "parse error" -> "syntax error" for POSIX compatibility.
15950 "parsing stack overflow..." -> "parser stack overflow" so
15951 that code matches Bison documentation.
15952
0f39aab9
AD
159532002-11-15 Akim Demaille <akim@epita.fr>
15954
15955 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
15956 take two BRACED_CODE, not two string_content.
15957 Free the scanner's obstack when we are done.
15958 (code_content): New.
15959 * tests/calc.at: Adjust.
15960 * doc/bison.texinfo: Adjust.
15961 Also, make sure to include the `,' for these declarations.
15962
761c1926
AD
159632002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
15964
15965 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
15966 definition; avoids potential autoreconf problems.
15967
b0f98b10
AD
159682002-11-15 Akim Demaille <akim@epita.fr>
15969
15970 Always check the value returned by yyparse.
15971
15972 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
15973 returned by yyparse.
15974 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
15975 Adjust calls.
15976 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
15977 returned by yyparse.
15978
970785f1
PH
159792002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15980
15981 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
15982 on input.at test.
15983
8fcc7db1
PE
159842002-11-14 Paul Eggert <eggert@twinsun.com>
15985
7ec1b48e
PE
15986 * src/output.c (output_skeleton): Call xfopen instead of
15987 duplicating xfopen's body.
15988
cfff7583 15989 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 15990 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 15991
8fcc7db1
PE
15992 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
15993 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
15994 Group compiler. Instead, use "$CC -E bar.c". Include the .h
15995 file twice in the grammar, as an extra check.
15996
15997 * tests/input.at (Torturing the Scanner): Surround the
15998 backslash-newline tests with "#if 0", to make it less likely that
15999 we'll run into compiler bugs. Bring back solitary \ inside
16000 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 16001 test backslash-newline in C character constant.
8fcc7db1 16002
4e8d992c
AD
160032002-11-14 Akim Demaille <akim@epita.fr>
16004
16005 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
16006 status of the compiler.
f32b346d 16007 Calling `exit 1' is no longer needed.
4e8d992c
AD
16008 Reported by Nelson H. F. Beebe.
16009
9501dc6e
AD
160102002-11-14 Akim Demaille <akim@epita.fr>
16011
16012 * tests/atlocal.in (CPPFLAGS): We have config.h.
16013 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
16014 New.
16015 * tests/actions.at, tests/calc.at, tests/conflicts.at,
16016 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
16017 * tests/regression.at, tests/torture.at: Use them for all the
16018 grammars that are to be compiled.
16019 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
16020 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
16021 * doc/bison.texinfo (GLR Parsers): Document `inline'.
16022
18b519c0
AD
160232002-11-14 Akim Demaille <akim@epita.fr>
16024
16025 * doc/bison.texinfo: Various formatting changes (alignments in
16026 samples, additional @group/@end group, GCS in samples.
16027 Use @deffn instead of simple @table to define the directives,
16028 macros, variables etc.
16029
9a86cdb9
PE
160302002-11-13 Paul Eggert <eggert@twinsun.com>
16031
daa33def 16032 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 16033 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 16034
daa33def 16035 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 16036 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
16037 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
16038 * tests/headers.at (export YYLTYPE): Likewise.
16039
16040 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 16041 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 16042
9a86cdb9
PE
16043 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
16044 comments, since they're not portable. Use GNU coding style.
16045
9c1e26bd
AD
160462002-11-13 Akim Demaille <akim@epita.fr>
16047
16048 * data/yacc.c: Leave bigger chunks of quoted text.
16049 (YYDSYMPRINTF): New.
16050 Use it to report symbol activities.
16051 * data/glr.c (YYDSYMPRINTF): New.
16052 Use it.
16053
87f721cc
PE
160542002-11-12 Paul Eggert <eggert@twinsun.com>
16055
16056 Version 1.75b.
16057
16058 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
16059 (yyglrReduce): Return yyok, not 0.
16060 This should avoid the enumerated-type warnings reported
464c6927 16061 by Nelson H. F. Beebe in
161a71f3 16062 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
16063
16064 * lib/bbitset.h (BITSET_INLINE): Remove.
16065 * lib/bitset.h [! BITSET_INLINE]: Remove.
16066 (bitset_set, bitset_reset, bitset_test): Rename local vars
16067 to avoid shadowing warnings by GCC.
16068
16069 * data/glr.c (inline): Remove #define. It's the user's
16070 responsibility to #define it away, just like 'const'.
464c6927 16071 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 16072 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 16073
87f721cc
PE
16074 * Makefile.maint (po-check): Scan .l and .y files instead of the
16075 .c and the .h files that they generate. This fixes the bug
16076 reported by Tim Van Holder in:
161a71f3 16077 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
16078 Look for N_ as well as for _. Try to avoid matching #define for
16079 N_ and _.
16080 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
16081 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
16082 * src/scan-gram.l: Revamp regular expressions so that " and '
16083 do not confuse xgettext.
16084
16085 * src/struniq.h (struniq_new): Do not declare the return type
16086 to be 'const'; this violates the C standard.
16087 * src/struniq.c (struniq_new): Likewise.
16088
be14ade5
AD
160892002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
16090
16091 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
16092 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
16093 linker.
16094
05291fbc
AD
160952002-11-12 Akim Demaille <akim@epita.fr>
16096
16097 * Makefile.maint: Sync with Autoconf:
16098 (local_updates): New.
16099
1f5fd52e
AD
161002002-11-12 Akim Demaille <akim@epita.fr>
16101
16102 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
16103
283f1e64
AD
161042002-11-12 Akim Demaille <akim@epita.fr>
16105
16106 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
16107 locations.
16108
886b69d1
AD
161092002-11-12 Akim Demaille <akim@epita.fr>
16110
16111 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
16112 not yyvalue.
16113
3df37415
AD
161142002-11-12 Akim Demaille <akim@epita.fr>
16115
16116 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
16117 Use it to test the GLR parser.
16118
7bd6c77e
AD
161192002-11-12 Akim Demaille <akim@epita.fr>
16120
16121 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
16122 defines it.
16123 * data/glr.c (yystos): New.
16124 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
16125 (YYDSYMPRINT): New.
16126 (yyval): Don't define it, it is handled via M4.
16127 (yyrecoverParseError): Free verbosely the discarded symbols.
16128 * data/yacc.c (yysymprint): Remove, rather...
16129 (b4_yysymprint_generate): invoke.
16130 * data/c.m4 (b4_yysymprint_generate): New.
16131 Accept pointers as arguments, as opposed to the version from
16132 yacc.c.
16133 (b4_yydestruct_generate): Likewise.
16134 * tests/cations.at (Printers and Destructors): Use Bison directives
16135 instead of CPP macros.
16136 Don't rely on internal details.
16137
b0400cc6
AD
161382002-11-12 Akim Demaille <akim@epita.fr>
16139
16140 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
16141 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
16142 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
16143 it against YYEMPTY and so forth), work on yytoken (i.e., set
16144 it to YYEMPTY etc.).
16145 (yydestruct): Replace with a b4_yydestruct_generate invocation.
16146 (b4_symbol_actions): Remove.
16147 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
16148 for 0, end-of-input.
16149
72f889cc
AD
161502002-11-12 Akim Demaille <akim@epita.fr>
16151
16152 * doc/bison.texinfo (Destructor Decl): New.
16153
b1ae9233
AD
161542002-11-12 Akim Demaille <akim@epita.fr>
16155
16156 * src/tables.c (tables_generate): Use free for pointers that
16157 cannot be NULL, not XFREE.
16158 (pack_vector): Use assert, not fatal, for bound violations.
16159 * src/state.c (state_new): Likewise.
16160 * src/reader.c (reader): Likewise.
16161 * src/lalr.c (set_goto_map): Likewise.
72f889cc 16162 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
16163 the file name.
16164
7ec2d4cd
AD
161652002-11-12 Akim Demaille <akim@epita.fr>
16166
16167 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
16168 Restore.
16169 * src/scan-gram.l (last_string): Is global to the file, not to
16170 yylex.
16171 * src/parse-gram.y (input): Don't append the epilogue here,
16172 (epilogue.opt): do it here, and free the scanner's obstack.
16173 * src/reader.c (epilogue_set): Rename as...
16174 (epilogue_augment): this.
16175 * data/c.m4 (b4_epilogue): Defaults to empty.
16176
573a6cd3
AD
161772002-11-12 Akim Demaille <akim@epita.fr>
16178
16179 * src/getargs.c (long_options): Remove duplicates.
16180 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
16181 Remove.
16182 * doc/bison.rnh: Remove.
16183 * doc/bison.texinfo (VMS Invocation): Remove.
16184
95612cfa
AD
161852002-11-12 Akim Demaille <akim@epita.fr>
16186
16187 * src/struniq.h, src/struniq.c (struniq_t): Is const.
16188 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
16189
16190 Use struniq for symbols.
16191
16192 * src/symtab.h (symbol_t): The tag member is a struniq.
16193 (symbol_type_set): Adjust.
16194 * src/symtab.c (symbol_new): Takes a struniq.
16195 (symbol_free): Don't free the tag member.
16196 (hash_compare_symbol_t, hash_symbol_t): Rename as...
16197 (hash_compare_symbol, hash_symbol): these.
16198 Use the fact that tags as struniqs.
16199 (symbol_get): Use struniq_new.
16200 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
16201 Returns a strniq.
16202 * src/reader.h (merger_list, grammar_currentmerge_set): The name
16203 and type members are struniqs.
16204 * src/reader.c (get_merge_function)
16205 (grammar_current_rule_merge_set): Adjust.
16206 (TYPE, current_type): Are struniq.
16207
16208 Use struniq for file names.
16209
16210 * src/files.h, src/files.c (infile): Split into...
16211 (grammar_file, current_file): these.
16212 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
16213 * src/reduce.c (reduce_print): Likewise.
16214 * src/getargs.c (getargs): Likewise.
16215 * src/complain.h, src/complain.c: Likewise.
16216 * src/main.c (main): Call struniqs_new early enough to use it for
16217 file names.
16218 Don't free the input file name.
16219
3e6656f9
AD
162202002-11-12 Akim Demaille <akim@epita.fr>
16221
16222 * src/symtab.c (symbol_free): Remove dead deactivated code:
16223 type_name are properly removed.
16224 Don't use XFREE to free items that cannot be NULL.
16225 * src/struniq.h, src/struniq.c: New.
16226 * src/main.c (main): Initialize/free struniqs.
16227 * src/parse-gram.y (%union): Add astruniq member.
16228 (yyprint): Adjust.
16229 * src/scan-gram.l (<{tag}>): Return a struniq.
16230 Free the obstack bit that used to store it.
16231 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
16232
7672019c
PE
162332002-11-11 Paul Eggert <eggert@twinsun.com>
16234
16235 Revamp to fix many (but not all) of the C- and M4-related quoting
16236 problems. Among other things, this fixes the Bison bug reported
16237 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 16238 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
16239
16240 Use new @ escapes consistently. Represent brackets with @{ and @}
16241 rather than @<:@ and @:>@, since this works a bit better with dumb
16242 editors like vi. Represent @ with @@, since @ is now consistently
16243 an escape. Use @oline@ and @ofile@ rather than __oline__ and
16244 __ofile__, to avoid unexpected expansions. Similarly, use @output
16245 rather than #output.
16246
16247 * data/c.m4 (b4_copyright): Omit file name from comment, since
16248 the file name could contain "*/".
16249 (b4_synclines_flag): Don't quote the 2nd argument; it should already
16250 be quoted. All uses changed.
16251
16252 * data/glr.c: Use new @ escapes consistently.
16253 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
16254 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
16255 Remove, since they couldn't handle arbitrary characters in file
16256 names.
16257 * data/lalr1.cc: Likewise.
16258 * data/yacc.c: Likewise.
16259
16260 * src/files.c (output_infix): Remove; all uses removed.
16261 * src/files.h: Likewise.
16262
16263 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
16264 mishandled funny characters in file names, and anyway it isn't
16265 needed any more.
16266 * data/yacc.c: Likewise.
16267 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
16268
16269 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
16270 * data/yacc.c: Likewise.
16271
16272 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
16273 strings now.
16274 (muscle_init): Quote filename as a C string.
16275 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
16276 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
16277 * src/output.c (escaped_file_name_output): New function.
16278 (prepare_symbols): Quote tokens for M4.
16279 (prepare): Don't insert output_infix, output_prefix,
16280 output_parser_name, output_header_name; this is now down by scan-skel.
16281 Insert skeleton as a C string.
16282
16283 * src/output.c (user_actions_output, symbol_destructors_output,
16284 symbol_printers_output): Quote filenames for C and M4.
16285 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16286
16287 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
16288 escapes other than \\ and \'; this simplifies the code.
16289 (<SC_STRING>): Likewise, for \\ and \".
16290 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
16291 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
16292 Use new escapes @{ and @} for [ and ].
16293
16294 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
16295 them with auto vars.
16296 Switch to new escape scheme, where @ is the escape character uniformly.
16297 Abort if a stray escape character is found. Avoid unbounded input
16298 buffer when parsing non-escaped text.
16299
16300 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
16301 __oline__, #output, $@, and @{ do not have unintended meanings.
16302
acea4f3b
PE
163032002-11-09 Paul Eggert <eggert@twinsun.com>
16304
16305 Fix the test failure due to GCC warnings described in
161a71f3 16306 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
16307 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
16308 evaluate to 0 if it's impossible for NINF to be in the respective
16309 table.
16310 (yygetLRActions, yyrecoverParseError): Use them.
16311
16312 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
16313 counted in the token inserted at end of file. Now takes
16314 location_t *, not location_t, so that the location can be
16315 adjusted. All uses changed.
16316
16317 * tests/regression.at (Invalid inputs): Adjust wording in
16318 diagnostic to match the new behavior.
16319
16320 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
16321 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
16322 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
16323 abort ();'. This reduces the runtime of the "Many lookaheads"
16324 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
16325 GCC 3.2.
16326
20ef1ad5
PE
163272002-11-07 Paul Eggert <eggert@twinsun.com>
16328
16329 * src/parse-gram.y (CHARACTER): Remove unused token.
16330 All uses removed.
16331
16332 * src/scan-gram.l: Remove stack option. We no longer use the
16333 stack, since the stack was never deeper than 1; instead, use the
16334 new auto var c_context to record the stacked value.
16335
16336 Remove nounput option. At an unexpected end of file, we now unput
16337 the minimal input necessary to end cleanly; this simplifies the
16338 code.
16339
16340 Avoid unbounded token sizes where this is easy.
16341
16342 (unexpected_end_of_file): New function.
16343 Use it to systematize the error message on unexpected EOF.
16344 (last-string): Now auto, not static.
16345 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
16346 (scanner_last_string_free): Remove; not used.
16347 (percent_percent_count): Move decl to just before use.
16348 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
16349 not the (never otherwised-used) CHARACTER.
16350
93724f13
AD
163512002-11-07 Akim Demaille <akim@epita.fr>
16352
16353 Let yyerror always receive the msg as last argument, so that
16354 yyerror can be variadic.
16355
16356 * data/yacc.c (b4_yyerror_args): New.
16357 Use it when calling yyerror.
16358 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
16359 Use it when calling yyerror.
16360 * doc/bison.texinfo (Error Reporting): Adjust.
16361 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
16362 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
16363
6e40b4eb
AD
163642002-11-06 Akim Demaille <akim@epita.fr>
16365
16366 #line should have quoted strings.
16367 Ideally, this should be done by m4_quotearg.
16368
16369 * src/scan-skel.l: Include quotearg.h.
16370 Quote __ofile__.
16371 * src/output.c (symbol_printers_output)
16372 (symbol_destructors_output): Quote the file name.
16373
2dfbfc12
AD
163742002-11-06 Akim Demaille <akim@epita.fr>
16375
16376 * tests/regression.at (Invalid inputs): Adjust to the recent
16377 messages.
16378
437c2d80
AD
163792002-11-06 Akim Demaille <akim@epita.fr>
16380
16381 Restore --no-lines.
16382 Reported by Jim Kent.
16383
16384 * data/c.m4 (b4_syncline): New.
16385 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
16386 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
16387 * src/output.c (user_actions_output): Likewise.
16388 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 16389 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 16390
900c5db5
AD
163912002-11-06 Akim Demaille <akim@epita.fr>
16392
16393 * src/main.c (main): Free `infile'.
16394 * src/scan-gram.l (handle_syncline): New.
16395 Recognize `#line'.
16396 * src/output.c (user_actions_output, symbol_destructors_output)
16397 (symbol_printers_output): Use the location's file name, not
16398 infile.
16399 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16400
e183b123 164012002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 16402
e183b123 16403 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 16404 either has GLR conflict entries.
e183b123 16405
193eb6b7
PE
164062002-11-05 Paul Eggert <eggert@twinsun.com>
16407
e183b123
PE
16408 * src/scan-gram.l: Use more accurate diagnostics, e.g.
16409 "integer out of range" rather than "invalid value".
16410 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
16411 accordingly.
16412
193eb6b7
PE
16413 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
16414 Also, remove one static variable in the scanner.
16415
16416 * src/scan-gram.l (braces_level): Now auto, not static.
16417 Initialize to zero if the compiler is being picky.
16418 (INITIAL): Clear braces_level instead of incrementing it.
16419 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
16420 as POSIX 1003.1-2001 requires.
16421 * src/system.h (IF_LINT): New macro, taken from coreutils.
16422 * configure.ac: Define "lint" if --enable-gcc-warnings.
16423
29c01725
AD
164242002-11-05 Akim Demaille <akim@epita.fr>
16425
16426 * src/scan-gram.l: When it starts with `%', complain about the
16427 whole directive, not just that `invalid character: %'.
16428
8aeac3ca
AD
164292002-11-04 Akim Demaille <akim@epita.fr>
16430
16431 * Makefile.maint: Update from Autoconf.
16432 (update, cvs-update, po-update, do-po-update): New.
16433
793a58bb
AD
164342002-11-04 Akim Demaille <akim@epita.fr>
16435
16436 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
16437 and yyerror.
16438 Have yyerror `use' its arguments.
16439 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
16440 returns true when location & yacc & pure & parse-param.
16441 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
16442
c4d720cd
AD
164432002-11-04 Akim Demaille <akim@epita.fr>
16444
16445 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
16446 clashes.
16447 * src/scan-gram.l: Use [\'] instead of ['] to pacify
16448 font-lock-mode.
16449 Use complain_at.
16450 Use quote, not quote_n since LOCATION_PRINT no longer uses the
16451 slot 0.
16452
613a0dc5
PE
164532002-11-03 Paul Eggert <eggert@twinsun.com>
16454
16455 * src/reader.c (get_merge_function, grammar_current_rule_check):
16456 Use consistent diagnostics for reporting type name clashes.
16457 Quote the types with <>, for consistency with Yacc.
16458 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
16459
2a8d363a
AD
164602002-11-03 Akim Demaille <akim@epita.fr>
16461
16462 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
16463 New.
16464 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
16465 (b4_parse_param): Remove.
16466 Use b4_identification.
16467 Propagate b4_pure_args where needed to pass them to yyerror.
16468 * data/glr.m4 (b4_parse_param): Remove.
16469 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
16470 (b4_lpure_formals): New.
16471 Use b4_identification.
16472 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
16473 b4_user_formals and b4_user_args.
16474 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
16475 (yyreportAmbiguity): When using a pure parser, also need
16476 the location, and the parse-params.
16477 Adjust callers.
16478 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
16479 When using a pure parser, also need the parse-params.
16480 Adjust callers.
16481 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
16482 (%pure-parser + %parse-param) LALR and GLR parsers.
16483 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
16484 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
16485 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
16486 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
16487 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
16488 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
16489 * doc/bison.texinfo: Untabify the whole file.
16490 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
16491 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
16492 (Error Reporting): Adjust to these new directives.
16493 Document %error-verbose, deprecate YYERROR_VERBOSE.
16494
9e32add8
AD
164952002-11-03 Akim Demaille <akim@epita.fr>
16496
16497 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
16498 AT_CHECK_CALC_GLR invocations to use % directives, instead of
16499 command line options.
16500 * tests/cxx-type.at: Formatting changes.
16501
b02d90a5
PE
165022002-11-03 Paul Eggert <eggert@twinsun.com>
16503
16504 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
16505 to count columns correctly, and to check for invalid inputs.
9e32add8 16506
b02d90a5
PE
16507 Use mbsnwidth to count columns correctly. Account for tabs, too.
16508 Include mbswidth.h.
16509 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
16510 (extend_location): New function.
16511 (YY_LINES): Remove.
16512
16513 Handle CRLF in C code rather than in Lex code.
16514 (YY_INPUT): New macro.
16515 (no_cr_read): New function.
16516
16517 Scan UCNs, even though we don't fully handle them yet.
16518 (convert_ucn_to_byte): New function.
16519
16520 Handle backslash-newline correctly in C code.
16521 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
16522 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
16523 all uses changed.
16524 (tag, splice): New EREs. Do not allow NUL or newline in tags.
16525 Use {splice} wherever C allows backslash-newline.
16526 YY_STEP after space, newline, vertical-tab.
16527 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 16528
b02d90a5
PE
16529 (letter, id): Don't assume ASCII; e.g., spell out a-z.
16530
16531 ({int}, handle_action_dollar, handle_action_at): Check for integer
16532 overflow.
9e32add8 16533
b02d90a5
PE
16534 (YY_STEP): Omit trailing semicolon, so that it's more like C.
16535
16536 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
16537 as well as \000. Check for UCHAR_MAX, not 255.
16538 Allow \x with an arbitrary positive number of digits, as in C.
16539 Check for overflow here.
16540 Allow \? and UCNs, for compatibility with C.
16541
16542 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
16543 with quote slot used by complain_at.
16544
16545 * tests/input.at: Add tests for backslash-newline, m4 quotes
16546 in symbols, long literals, and funny escapes in strings.
16547
16548 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
16549 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
16550 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
16551 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
16552 * m4/mbswidth.m4: New file, from GNU coreutils.
16553
16554 * doc/bison.texinfo (Grammar Outline): Document // comments.
16555 (Symbols): Document that trigraphs have no special meaning in Bison,
16556 nor is backslash-newline allowed.
16557 (Actions): Document that trigraphs have no special meaning.
16558
16559 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
16560 no longer used.
16561
165622002-11-02 Paul Eggert <eggert@twinsun.com>
16563
16564 * src/reader.c: Don't include quote.h; not needed.
16565 (get_merge_function): Reword warning to be consistent with
16566 type clash diagnostic in grammar_current_rule_check.
16567
16568 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
16569 bug in trigraph handling.
16570
16571 * src/output.c (prepare_symbols): When printing token names,
16572 escape "[" as "@<:@" and likewise for "]".
16573
16574 * src/system.h (errno): Remove declaration, as we are now
16575 assuming C89 or better, and C89 guarantees errno.
16576
762b212b
PE
165772002-10-30 Paul Eggert <eggert@twinsun.com>
16578
16579 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
16580 Check for close failures.
16581 * src/files.h (xfclose): Return void, not int, since it always
16582 returned zero.
16583 * src/files.c (xfclose): Likewise. Report I/O error if ferror
16584 indicates one.
16585 * src/output.c (output_skeleton): Use xfclose rather than fclose
16586 and ferror. xfclose now checks ferror.
16587
16588 * data/glr.c (YYLEFTMOST_STATE): Remove.
16589 (yyreportTree): Use a stack-based leftmost state. This avoids
16590 our continuing battles with bogus warnings about initializers.
16591
56100c60
AD
165922002-10-30 Akim Demaille <akim@epita.fr>
16593
16594 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
16595 #if.
16596
51b4a04c
PH
165972002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16598
16599 * tests/glr-regr1.at: New test for reported regressions.
16600 * tests/testsuite.at: Add glr-regr1.at test.
16601 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 16602
bf1ebda2
PE
166032002-10-24 Paul Eggert <eggert@twinsun.com>
16604
5c16c6b1
PE
16605 Version 1.75a.
16606
bf1ebda2
PE
16607 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
16608 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
16609 we use malloc. Don't assume 'A' through 'Z' are contiguous.
16610 Don't assume strdup exists; POSIX says its an XSI extension.
16611 Check for buffer overflow on input.
16612
b526ee61
AD
166132002-10-24 Akim Demaille <akim@epita.fr>
16614
16615 * src/output.c (output_skeleton): Don't disable M4sugar comments
16616 too soon: it results in comments being expanded.
16617 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
16618 first output.
16619
f1886bb2
AD
166202002-10-24 Akim Demaille <akim@epita.fr>
16621
16622 * data/yacc.c (m4_int_type): New.
16623 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
16624 char' as only yacc.c wants K&R portability.
16625 * data/glr.c (yysigned_char): Remove.
16626 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
16627 Reported by Quoc Peyrot.
16628
c5576256
PE
166292002-10-23 Paul Eggert <eggert@twinsun.com>
16630
16631 * src/main.c (main): With --trace=time, report times even if a
16632 non-fatal error occurs. Formerly, the times were reported in some
16633 such cases but not in others.
16634 * src/reader.c (reader): Just return if a complaint has been issued,
16635 instead of exiting, so that 'main' can report times.
16636
27b0ffea
AD
166372002-10-22 Akim Demaille <akim@epita.fr>
16638
16639 * src/system.h: Include sys/types.
16640 Reported by Bert Deknuydt.
16641
223a7883
PE
166422002-10-23 Paul Eggert <eggert@twinsun.com>
16643
16644 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
16645 Suggested by Art Haas.
16646
166472002-10-22 Paul Eggert <eggert@twinsun.com>
16648
16649 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
16650 decl; not needed any more.
16651 * src/main.c (main): Use return to exit, undoing yesterday's change.
16652 The last OS that we could find where this wouldn't work is
16653 SunOS 3.5, and that's too old to worry about now.
16654
16655 * data/glr.c (struct yyltype): Define members even when not
16656 doing locations. This is more consistent with yacc.c, and it
16657 works around the following bug reports:
161a71f3
PE
16658 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
16659 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 16660
223a7883
PE
16661 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
16662 @acronym consistently. Standardize on "Yacc" instead of "YACC",
16663 "Algol" instead of "ALGOL". Give a bit more history about BNF.
16664
8b76775a
AD
166652002-10-22 Akim Demaille <akim@epita.fr>
16666
16667 * data/README: New.
16668
6db10d14
PE
166692002-10-21 Paul Eggert <eggert@twinsun.com>
16670
16671 Be consistent about 'bool'; the old code used an enum in one
16672 module and an int in another, and this violates the C standard.
16673 * m4/stdbool.m4: New file, from coreutils 4.5.3.
16674 * configure.ac (AC_HEADER_STDBOOL): Add.
16675 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
16676 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
16677 * src/symtab.c (hash_compare_symbol_t): Likewise.
16678 * src/system.h (bool, false, true): Use a definition consistent
16679 with ../lib/hash.c. All uses changed.
16680
16681 * src/complain.c (warning_issued): Renamed from warn_message_count,
16682 so that we needn't worry about integer overflow (!).
16683 Now of type bool. All uses changed.
16684 (complaint_issued): Renamed from complain_message_count; likewise.
16685
16686 * src/main.c (main): Use exit to exit with failure.
27b0ffea 16687
6db10d14
PE
16688 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
16689 rather than 1 and 0.
16690 * src/main.c (main): Likewise.
16691 * src/getargs.c (getargs): Likewise.
16692 * src/reader.c (reader): Likewise.
16693
16694 * src/getarg.c (getargs): Remove duplicate code for
16695 "Try `bison --help'".
16696
16697 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
16698 What was that "2" for?
16699
16700 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
16701 * src/getargs.c (usage): Likewise.
16702
16703 * src/getargs.c (getargs): When there are too few operands, report
16704 the last one. When there are too many, report the first extra
16705 one. This is how diffutils does it.
16706
92a060fd
PE
167072002-10-20 Paul Eggert <eggert@twinsun.com>
16708
16709 Remove K&R vestiges.
16710 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
16711 * src/complain.c (VA_START): Remove. Assume prototypes.
16712 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
16713 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
16714 fatal): Assume prototypes.
16715 * src/complain.h: Assume prototypes.
16716 * src/system.h (PARAMS): Remove.
16717 Include <limits.h> unconditionally, since it's guaranteeed even
16718 for a freestanding C89 compiler.
16719 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
16720 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 16721
e7cb57c0
AD
167222002-10-20 Akim Demaille <akim@epita.fr>
16723
16724 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
16725 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
16726 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
16727 (yyresolveStates, yyresolveAction, yyresolveStack)
16728 (yyprocessOneStack): Use them.
16729 (yy_reduce_print): New.
16730 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
16731
0245f82d
AD
167322002-10-20 Akim Demaille <akim@epita.fr>
16733
16734 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
16735 arguments and output `void'.
16736 (b4_c_function): Rename as...
16737 (b4_c_function_def): this.
16738 (b4_c_function_decl, b4_c_ansi_function_def)
16739 (b4_c_ansi_function_decl): New.
16740 Change the interpretation of the arguments: before `int, foo', now
16741 `int foo, foo'.
16742 * data/yacc.c (yyparse): Prototype and define thanks to these.
16743 Adjust b4_c_function_def uses.
16744 * data/glr.c (yyparse): Likewise, but ANSI only.
16745
39912f52
AD
167462002-10-20 Akim Demaille <akim@epita.fr>
16747
16748 * src/output.c (prepare): Move the definition of `tokens_number',
16749 `nterms_number', `undef_token_number', `user_token_number_max'
16750 to...
16751 (prepare_tokens): Here.
16752 (prepare_tokens): Rename as...
16753 (prepare_symbols): this.
16754 (prepare): Move the definition of `rules_number' to...
16755 (prepare_rules): here.
16756 (prepare): Move the definition of `last', `final_state_number',
16757 `states_number' to...
16758 (prepare_states): here.
16759 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
16760
20c1e2ad
AD
167612002-10-20 Akim Demaille <akim@epita.fr>
16762
16763 * src/tables.h, src/tables.c, src/output.c: Comment changes.
16764
21964f43
AD
167652002-10-20 Akim Demaille <akim@epita.fr>
16766
16767 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
16768 * data/c.m4: here.
16769
66d30cd4
AD
167702002-10-20 Akim Demaille <akim@epita.fr>
16771
16772 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
16773 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
16774 `pair'.
16775 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
16776 `name' to...
16777 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
16778 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
16779 These.
16780
95f2c9fe
PE
167812002-10-19 Paul Eggert <eggert@twinsun.com>
16782
16783 Do not create a temporary file, as that involves security and
16784 cleanup headaches. Instead, use a pair of pipes.
16785 Derived from a suggestion by Florian Krohm.
16786 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
16787 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
16788 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
16789 (BISON_PREREQ_SUBPIPE): Add.
16790 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
16791 Add subpipe.h, subpipe.c.
16792 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
16793 * po/POTFILES.in: Add lib/subpipe.c.
16794 * src/output.c: Include "subpipe.h".
16795 (m4_invoke): Remove decl.
16796 (scan_skel): New decl.
16797 (output_skeleton): Use pipe rather than temporary file for m4 input.
16798 Check that m4sugar.m4 is readable, to avoid deadlock.
16799 Check for pipe I/O error.
16800 * src/scan-skel.l (readpipe): Remove decl.
16801 (scan_skel): New function, to be used in place of m4_invoke.
16802 Read from stream rather than file.
66d30cd4 16803
95f2c9fe
PE
16804 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
16805 float, as this generates a warning on Solaris 8 + GCC 3.2 with
16806 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
16807 this generates a more-accurate value anyway.
16808
16809 * lib/timevar.c (timervar_accumulate): Rename locals to
16810 avoid confusion with similarly-named more-global.
16811 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
16812
16813 * src/output.c (prepare): Use xstrdup to convert char const *
16814 to char *, to avoid GCC warning.
16815
c19988b7
AD
168162002-10-19 Akim Demaille <akim@epita.fr>
16817
16818 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
16819 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
16820 Use them to have `calc.y' ready for %pure-parser.
16821 * data/yacc.c (YYLEX): Pass a yylex return type to
16822 b4_c_function_call.
16823
ae7453f2
AD
168242002-10-19 Akim Demaille <akim@epita.fr>
16825
16826 Prototype support of %lex-param and %parse-param.
16827
16828 * src/parse-gram.y: Add the definition of the %lex-param and
16829 %parse-param tokens, plus their rules.
16830 Drop the `_' version of %glr-parser.
16831 Add the "," token.
16832 * src/scan-gram.l (INITIAL): Scan them.
16833 * src/muscle_tab.c: Comment changes.
16834 (muscle_insert, muscle_find): Rename `pair' as `probe'.
16835 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
16836 (muscle_entry_s): The `value' member is no longer const.
16837 Adjust all dependencies.
16838 * src/muscle_tab.c (muscle_init): Adjust: use
16839 MUSCLE_INSERT_STRING.
16840 Initialize the obstack earlier.
16841 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
16842 (muscle_pair_list_grow): New.
16843 * data/c.m4 (b4_c_function_call, b4_c_args): New.
16844 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
16845 * tests/calc.at: Use %locations, not --locations.
16846 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
16847
0e575721
AD
168482002-10-19 Akim Demaille <akim@epita.fr>
16849
16850 * src/getargs.c (usage): Take status as argument and exit
16851 accordingly.
16852 Report the traditional `Try ... --help' message when status != 0.
16853 (usage, version): Don't take a FILE * as arg, it is pointless.
16854 (getargs): When there is an incorrect number of arguments, make it
16855 an error, and report it GNUlically thanks to `usage ()'.
16856
724ce7f5
PE
168572002-10-18 Paul Eggert <eggert@twinsun.com>
16858
3a781eb2
PE
16859 * data/glr.c (yyreportParseError): Don't assume that sprintf
16860 yields the length of the printed string, as this is not true
16861 on SunOS 4.1.4. Reported by Peter Klein.
16862
724ce7f5
PE
16863 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
16864 * tests/conflicts.at (%nonassoc and eof): Likewise.
16865 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
16866
473d0a75
AD
168672002-10-17 Akim Demaille <akim@epita.fr>
16868
16869 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
16870 * src/getargs.c (trace_types, trace_args): Adjust.
16871 * src/reader.c (grammar_current_rule_prec_set)
16872 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
16873 Standardize error messages.
16874 And s/@prec/%prec/!
16875 (reader): Use trace_flag to enable scanner/parser debugging,
16876 instead of an adhoc scheme.
16877 * src/scan-gram.l: Remove trailing debugging code.
16878
e76d2469
PE
168792002-10-16 Paul Eggert <eggert@twinsun.com>
16880
93e2236a
PE
16881 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
16882 MUSCLE_TAB_H.
16883
e76d2469
PE
16884 * NEWS: Officially drop support for building Bison with K&R C,
16885 since it didn't work anyway and it's not worth worrying about.
16886 * Makefile.maint (wget_files): Remove ansi2knr.c.
16887 (ansi2knr.c-url_prefix): Remove.
16888 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
16889 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16890 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16891
5bd1c419
PE
168922002-10-15 Paul Eggert <eggert@twinsun.com>
16893
16894 Stop using the "enum_" trick for K&R-style function definitions;
16895 it confused me, and I was the author! Instead, assume that people
16896 who want to use K&R C compilers (when using these modules in GCC,
16897 perhaps?) will run ansi2knr.
16898
16899 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
16900 All uses of "enum_" changed to "enum ".
16901 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16902 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 16903
5bd1c419
PE
16904 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
16905 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
16906 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
16907 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
16908 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
16909 abitset_not, abitset_ones, abitset_or, abitset_or_and,
16910 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
16911 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
16912 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
16913 Use function prototypes; this removes the need for declaring
16914 static functions simply to provide their prototypes.
16915 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
16916 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
16917 bitset_count_, bitset_create, bitset_dump, bitset_first,
16918 bitset_free, bitset_init, bitset_last, bitset_next,
16919 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
16920 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
16921 bitset_print, bitset_release_memory, bitset_toggle_,
16922 bitset_type_choose, bitset_type_get, bitset_type_name_get,
16923 debug_bitset): Likewise.
16924 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
16925 * lib/bitset_stats.c (bitset_log_histogram_print,
16926 bitset_percent_histogram_print, bitset_stats_and,
16927 bitset_stats_and_cmp, bitset_stats_and_or,
16928 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
16929 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
16930 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
16931 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
16932 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
16933 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
16934 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
16935 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
16936 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
16937 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
16938 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
16939 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
16940 bitset_stats_zero): Likewise.
16941 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16942 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16943 bitsetv_dump, debug_bitsetv): Likewise.
16944 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
16945 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
16946 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
16947 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
16948 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
16949 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
16950 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
16951 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
16952 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
16953 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
16954 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
16955 Likewise.
16956 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
16957 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
16958 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
16959 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
16960 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
16961 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
16962 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
16963 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
16964 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
16965 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
16966 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 16967
ae26e1f0
AD
169682002-10-14 Akim Demaille <akim@epita.fr>
16969
16970 Version 1.75.
16971
d43baf71
AD
169722002-10-14 Akim Demaille <akim@epita.fr>
16973
16974 * tests/Makefile.am (maintainer-check-posix): New.
16975
7ebc83e3
AD
169762002-10-14 Akim Demaille <akim@epita.fr>
16977
16978 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
16979 member.
16980
05846dae
AD
169812002-10-14 Akim Demaille <akim@epita.fr>
16982
16983 * src/tables.c (table_ninf_remap): base -> tab.
16984 Reported by Matt Rosing.
16985
1318e37d
PE
169862002-10-14 Paul Eggert <eggert@twinsun.com>
16987
447fbb17
PE
16988 * tests/action.at, tests/calc.at, tests/conflicts.at,
16989 tests/cxx-type.at, tests/headers.at, tests/input.at,
16990 tests/regression.at, tests/synclines.at, tests/torture.at:
16991 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
16992 so that the tests still work even if POSIXLY_CORRECT is set.
16993 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 16994
1318e37d
PE
16995 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
16996 for portability to K&R hosts. Fix typo: signed char is guaranteed
16997 only to 127, not to 128.
16998 * data/glr.c (yysigned_char): New type.
16999 * data/yacc.c (yysigned_char): Likewise.
17000 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
17001
cc0f0794
PE
170022002-10-13 Paul Eggert <eggert@twinsun.com>
17003
5038f418
PE
17004 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
17005 true due to limited range of data type" warning from GCC.
17006
cc0f0794
PE
17007 * data/c.m4 (b4_token_defines): Protect against double-inclusion
17008 by wrapping enum yytokentype's definition inside #ifndef
17009 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
17010
6fed0802
AD
170112002-10-13 Akim Demaille <akim@epita.fr>
17012
17013 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
17014 Un yy- yyrhs to avoid the name clash with the global YYRHS.
17015
32f0598d
AD
170162002-10-13 Akim Demaille <akim@epita.fr>
17017
17018 * Makefile.maint: Update from Autoconf 2.54.
17019 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
17020
7ea9a33f
AD
170212002-10-13 Akim Demaille <akim@epita.fr>
17022
17023 * src/print.c (print_state): Separate the list of solved conflicts
17024 from the other items.
17025 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
17026
ea99527d
AD
170272002-10-13 Akim Demaille <akim@epita.fr>
17028
17029 Let nondeterministic skeletons be usable with deterministic
17030 tables.
17031
17032 With the patch, GAWK compiled by GCC without -O2 passes its test
17033 suite using a GLR parser driven by LALR tables. It fails with -O2
17034 because `struct stat' gives two different answers on my machine:
17035 88 (definition of an auto var) and later 96 (memset on this var).
17036 Hence the stack is badly corrumpted. The headers inclusion is to
17037 blame: if I move the awk.h inclusion before GLR's system header
17038 inclusion, the two struct stat have the same size.
17039
17040 * src/tables.c (pack_table): Always create conflict_table.
17041 (token_actions): Always create conflict_list.
17042 * data/glr.c (YYFLAG): Remove, unused.
17043
f377f69f
AD
170442002-10-13 Akim Demaille <akim@epita.fr>
17045
17046 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
17047 (O0FLAGS): New.
17048 (VALGRIND, GXX): New.
17049 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
17050 * tests/bison.in: Run $PREBISON a pre-command.
17051 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
17052 (maintainer-check-g++): New.
17053 * Makefile.am (maintainer-check): New.
17054
2a1fe6ed
AD
170552002-10-13 Akim Demaille <akim@epita.fr>
17056
17057 * data/glr.c: Formatting changes.
17058 Tweak some trace messages to match yacc.c's.
17059
f50adbbd
AD
170602002-10-13 Akim Demaille <akim@epita.fr>
17061
17062 GLR parsers sometimes raise parse errors instead of performing the
17063 default reduction.
17064 Reported by Charles-Henry de Boysson.
17065
17066 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 17067 check the length of the traces when %glr.
f50adbbd
AD
17068 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
17069 GLR's traces.
17070 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
17071 Test GLR parsers.
17072 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
17073 (yyltype): Remove the yy prefix from the member names.
17074 (yytable): Complete its comment.
17075 (yygetLRActions): Map error action number from YYTABLE from
17076 YYTABLE_NINF to 0.
17077 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
17078 (which was a bug: it should have been YYTABEL_NINF, and yet it was
17079 not satisfying as we could compare an YYACTION computed from
17080 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
17081 only value for error actions.
17082 (yyreportParseError): In verbose parse error messages, don't issue
17083 `error' in the list of expected tokens.
17084 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
17085 next action to perform to match glr.c's decoding.
17086 (yytable): Complete its comment.
17087
bcbad5b9
PE
170882002-10-13 Paul Eggert <eggert@twinsun.com>
17089
17090 Fix problem reported by Henrik Grubbstroem in
161a71f3 17091 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
17092 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
17093 because the Bison parser reads the second action before reducing
17094 the first one.
17095 * src/scan-gram.l (rule_length): New static var.
17096 Use it to keep track of the rule length in the scanner, since
17097 we can't expect the parser to be in lock-step sync with the scanner.
17098 (handle_action_dollar, handle_action_at): Use this var.
17099 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 17100
14904b89
PE
171012002-10-12 Paul Eggert <eggert@twinsun.com>
17102
1fe611e5
PE
17103 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
17104 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
17105 Include <sys/time.h> when checking for clock_t and struct tms.
17106 Use same include order as source.
17107 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 17108 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 17109
1fe611e5
PE
17110 * lib/timevar.c: Update copyright date and clarify comments.
17111 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 17112
1fe611e5
PE
17113 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
17114 GCC version as of today, then merge Bison's changes.
17115 Change "GCC" to "Bison" in copyright notice. timevar.def's
17116 author is Akim, so change that too.
17117
98194095
PE
17118 * src/reader.c (grammar_current_rule_check):
17119 Don't worry about the default action if $$ is untyped.
17120 Prevents bogus warnings reported by Jim Gifford in
161a71f3 17121 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 17122
14904b89
PE
17123 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
17124 * data/glr.c, data/lalr1.cc, data/yacc.c:
17125 Output token definitions before the first part of user declarations.
17126 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 17127 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 17128
ff6dca18
PE
171292002-10-11 Paul Eggert <eggert@twinsun.com>
17130
17131 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
17132 (yyparse): here. This undoes some of the 2002-07-25 change.
17133 Compatibility problem reported by Ralf S. Engelschall with
17134 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
17135
eb714592
AD
171362002-10-11 Akim Demaille <akim@epita.fr>
17137
17138 * tests/regression.at Characters Escapes): New.
17139 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
17140 characters.
17141 Reported by Jan Nieuwenhuizen.
17142
b7195100
AD
171432002-10-11 Akim Demaille <akim@epita.fr>
17144
17145 * po/id.po: New.
17146
f28a0f2d
PE
171472002-10-10 Paul Eggert <eggert@twinsun.com>
17148
17149 Portability fixes for bitsets; this also avoids several GCC
17150 warnings.
17151
17152 * lib/abitset.c: Include <stddef.h>, for offsetof.
17153 * lib/lbitset.c: Likewise.
17154
17155 * lib/abitset.c (abitset_bytes): Return a size that is aligned
17156 properly for vectors of objects. Do not assume that adding a
17157 header size to a multiple of a word size yields a value that is
17158 properly aligned for the whole union.
17159 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17160
17161 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
17162 unique names for structures.
17163 * lib/ebitset.c (ebitset_bytes): Likewise.
17164 * lib/lbitset.c (lbitset_bytes): Likewise.
17165
17166 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
17167 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
17168 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
17169 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
17170 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
17171 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
17172 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
17173 to improve the type-checking that GCC can do.
17174 * lib/bitset.c (bitset_op4_cmp): Likewise.
17175 * lib/bitset_stats.c (bitset_stats_count,
17176 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
17177 bitset_stats_copy, bitset_stats_disjoint_p,
17178 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
17179 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
17180 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
17181 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
17182 bitset_stats_and_or_cmp, bitset_stats_andn_or,
17183 bitset_stats_andn_or_cmp, bitset_stats_or_and,
17184 bitset_stats_or_and_cmp): Likewise.
17185 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
17186 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
17187 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
17188 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
17189
17190 * lib/abitset.h: Include bitset.h, not bbitset.h.
17191 * lib/ebitset.h: Likewise.
17192 * lib/lbitset.h: Likewise.
17193
17194 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
17195 All instances of parameters of type enum bitset_opts are now of
17196 type enum_bitset_opts, to conform to the C Standard, and similarly
17197 for enum_bitset_type.
17198 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17199 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
17200
17201 Do not use "struct bitset_struct" to mean different things in
17202 different modules. Not only is this confusing, it violates
17203 the C Standard, which requires that structure types in different
17204 modules must be compatible if one is to be passed to the other.
17205 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
17206 All instances of "struct bitset_struct *" replaced with "bitset".
17207 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
17208 (union bitset_union, struct abitset_struct, struct ebitset_struct,
17209 struct lbitset_struct, struct bitset_stats_struct): New types.
17210 All uses of struct bitset_struct changed to union bitset_union,
17211 etc.
ba0fe3c7 17212 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
17213 struct bitset_struct): Remove.
17214 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
17215 struct bitset_struct): Remove.
17216 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
17217 bitset_struct): Remove.
17218 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
17219 Likewise.
17220
17221 Do not call a function of type T using a call that assumes the
17222 function is of a different type U. Standard C requires that a
17223 function must be called with a type that is compatible with its
17224 definition.
17225 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17226 New decls.
17227 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17228 New functions.
17229 * lib/ebitset.c (PFV): Remove.
17230 * lib/lbitset.c (PFV): Likewise.
17231 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
17232 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
17233 decls.
17234 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
17235 (ebitset_vtable): Use them.
17236 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
17237 lbitset_xor): New functions.
17238 (lbitset_vtable): Use them.
17239
17240 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
17241 Declare.
17242
17243 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
17244 GCC warning.
17245 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
17246 Use offsetof, for simplicity.
17247
6fbe4984
PE
172482002-10-06 Paul Eggert <eggert@twinsun.com>
17249
17250 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
17251 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 17252 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
17253 which was inadvertently undone by the 2002-09-30 patch.
17254 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
17255 the same width as int.
17256
420f93c8
PE
172572002-10-04 Paul Eggert <eggert@twinsun.com>
17258
17259 Version 1.50.
17260
17261 * configure.ac (AC_INIT), NEWS: Increment version number.
17262
17263 * doc/bison.texinfo: Minor spelling, grammar, and white space
17264 fixes.
17265 (Symbols): Mention that any negative value returned from yylex
17266 signifies end-of-input. Warn about negative chars. Mention
17267 the portable Standard C character set.
17268
17269 The GNU coding standard says CFLAGS and YFLAGS are reserved
17270 for the installer to set.
17271 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
17272 * src/Makefile.am (AM_CFLAGS): Likewise.
17273 (AM_YFLAGS): Renamed from YFLAGS.
17274
17275 Fix some MAX and MIN problems.
17276 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
17277 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
17278 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
17279 * src/reader.c (reader): Use it.
17280
17281 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
17282 POSIX 1003.1-2001 has removed fgrep.
17283
172842002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
17285
17286 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
17287 interpreted as signed.
17288 * lib/ebitset.c (ebitset_list): Fix bug.
17289
ff68026d
PE
172902002-10-01 Paul Eggert <eggert@twinsun.com>
17291
17292 More fixes for 64-bit hosts and large bitsets.
17293
17294 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
17295 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
17296 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
17297 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
17298 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
17299 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
17300 bitset_count_): Likewise.
17301 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
17302 bitset_first, bitset_last): Likewise.
17303 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
17304 bitset_stats_list_reverse, bitset_stats_size,
17305 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
17306 Likewise.
17307 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17308 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17309 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17310 bitsetv_reflexive_transitive_closure): Likewise.
17311 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
17312 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
17313 Likewise.
17314 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
17315 Likewise.
420f93c8 17316
ff68026d
PE
17317 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
17318 Use size_t, not unsigned int, to count bytes.
17319 * lib/abitset.h (abitset_bytes): Likewise.
17320 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
17321 Likewise.
17322 * lib/bitset.h (bitset_bytes): Likewise.
17323 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
17324 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
17325 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17326 * lib/ebitset.c (ebitset_bytes): Likewise.
17327 * lib/ebitset.h (ebitset_bytes): Likewise.
17328 * lib/lbitset.c (lbitset_bytes): Likewise.
17329 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 17330
ff68026d
PE
17331 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
17332 abitset_subset_p, abitset_disjoint_p, abitset_and,
17333 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
17334 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
17335 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
17336 abitset_or_and, abitset_or_and_cmp):
17337 Use bitset_windex instead of unsigned int.
17338 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17339 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
17340 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
17341 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
17342 Likewise.
17343 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 17344
ff68026d
PE
17345 * lib/bitset.c (bitset_print):
17346 Use proper printf formats for widths of integer types.
17347 * lib/bitset_stats.c (bitset_percent_histogram_print,
17348 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
17349 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17350 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17351 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 17352
ff68026d
PE
17353 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
17354 BITSET_SIZE_MAX): New macros.
17355 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
17356 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
17357 to BITSET_WINDEX_MAX.
17358
17359 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
17360 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
17361 since we now return the bitset_bindex type (not int).
17362
17363 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
17364 when computing sizes.
17365 * lib/ebitset.c (ebitset_elts_grow): Likewise.
17366
17367 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
17368 and avoid cast to unsigned.
17369
6aa452a6
AD
173702002-09-30 Akim Demaille <akim@epita.fr>
17371
17372 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
17373 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
17374 Updates from Michael Hayes.
17375
927f7817
AD
173762002-09-30 Art Haas <ahaas@neosoft.com>
17377
17378 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
17379 invocations.
17380 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
17381 defined.
17382
9738f41e
AD
173832002-09-27 Akim Demaille <akim@epita.fr>
17384
17385 Version 1.49c.
17386
a5c75d7f
AD
173872002-09-27 Akim Demaille <akim@epita.fr>
17388
17389 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
17390 (Because of AC_LIBSOURCE).
17391
8280e179
AD
173922002-09-27 Akim Demaille <akim@epita.fr>
17393
17394 Playing with Autoscan.
17395
17396 * configure.ac: Remove the old LIBOBJ tweaks.
17397 (AC_REPLACE_FUNCS): Add strrchr and strtol.
17398 * lib/strrchr.c: New.
17399 * lib/strtol.c: New, from the Coreutils 4.5.1.
17400
ae64af35
AD
174012002-09-27 Akim Demaille <akim@epita.fr>
17402
17403 Playing with Autoscan.
17404
17405 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
17406 * lib/Makefile.am (libbison_a_SOURCES): No longer include
17407 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
17408 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
17409 Coreutils 4.5.1.
17410
d1a1114f
AD
174112002-09-24 Akim Demaille <akim@epita.fr>
17412
17413 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
17414 (Frequently Asked Questions, Parser Stack Overflow): New.
17415
b906441c
AD
174162002-09-13 Akim Demaille <akim@epita.fr>
17417
17418 Playing with autoscan.
17419
17420 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
17421 * src/files.c (skeleton_find): Remove, unused.
17422 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
17423 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
17424
bd701811
AD
174252002-09-13 Akim Demaille <akim@epita.fr>
17426
17427 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
17428 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
17429
e0a13e7b
AD
174302002-09-13 Akim Demaille <akim@epita.fr>
17431
17432 * configure.ac: Require 2.54.
17433 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
17434 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
17435 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
17436 Remove, provided by Autoconf macros.
17437
c97011bf
AD
174382002-09-12 Akim Demaille <akim@epita.fr>
17439
17440 * m4/prereq.m4: Update, from Coreutils 4.5.1.
17441
d862b1be
AD
174422002-09-12 Akim Demaille <akim@epita.fr>
17443
17444 * m4/prereq.m4: Update, from Fileutils 4.1.5.
17445 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
17446 Reported by Martin Mokrejs.
17447
3d38c03a
AD
174482002-09-10 Akim Demaille <akim@epita.fr>
17449
17450 * src/parse-gram.y: Associate a human readable string to each
17451 token type.
17452 * tests/regression.at (Invalid inputs): Adjust.
17453
b6347355
AD
174542002-09-10 Gary V. Vaughan <gary@gnu.org>
17455
17456 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
17457 with an Autoconf-2.5x style configure.ac.
17458
09ba4ab2
PE
174592002-09-06 Paul Eggert <eggert@twinsun.com>
17460
17461 * doc/bison.texinfo (Conditions): Make explicit that the GPL
17462 exception applies only to yacc.c. This is a modification of a
17463 patch originally suggested by Akim Demaille.
17464
21846f69
AD
174652002-09-06 Akim Demaille <akim@epita.fr>
17466
09ba4ab2
PE
17467 * data/c.m4 (b4_copyright): Move the GPL exception comment from
17468 here to...
17469 * data/yacc.c: here.
17470
21846f69
AD
17471 * data/lalr1.cc (struct yyltype): Don't define it, since we use
17472 LocationType.
17473 (b4_ltype): Default to yy::Location from location.hh.
17474
c0ad8bf3
AD
174752002-09-04 Jim Meyering <jim@meyering.net>
17476
17477 * data/yacc.c: Guard the declaration of yytoknum also with
17478 `#ifdef YYPRINT', so it is declared only when used.
17479
3a93251e
AD
174802002-09-04 Akim Demaille <akim@epita.fr>
17481
17482 * configure.in: Rename as...
17483 * configure.ac: this.
17484 Bump to 1.49c.
17485
427c0dda
AD
174862002-09-04 Akim Demaille <akim@epita.fr>
17487
17488 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
17489 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
17490 translate maintainer only messages.
17491
6a254321
PE
174922002-08-12 Paul Eggert <eggert@twinsun.com>
17493
645e30d1
PE
17494 Version 1.49b.
17495
6a254321
PE
17496 * Makefile.am (SUBDIRS): Remove intl.
17497 (DISTCLEANFILES): Remove.
17498 * NEWS: Mention that GNU M4 is now required. Clarify what is
17499 meant by "larger grammars". Mention the pt_BR translation.
17500 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
17501 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
17502 Bump version from 0.11.2 to 0.11.5.
17503 (BISON_PREREQ_STAGE): Remove.
17504 (AM_GNU_GETTEXT): Use external gettext.
17505 (AC_OUTPUT): Remove intl/Makefile.
17506
17507 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
17508
17509 * data/glr.c: Include string.h, for strlen.
17510 (yyreportParseError): Use size_t for yysize.
17511 (yy_yypstack): No longer nested inside yypstates, as nested
17512 functions are not portable. Do not assume size_t is the
17513 same width as int.
17514 (yypstates): Do not assume that ptrdiff_t is the same width
17515 as int, and similarly for yyposn and YYINDEX.
17516
17517 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
17518
17519 * lib/Makefile.am (INCLUDES): Do not include from the intl
17520 directory, which has been removed.
17521 * src/Makefile.am (INCLUDES): Likewise.
17522
17523 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
17524 (bitsets_sources, additional_bitsets_sources, timevars_sources):
17525 New vars.
17526
17527 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
17528 * tests/Makefile.am (EXTRA_DIST): Likewise.
17529
17530 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
17531 Do not assume that bitset_windex is the same width as unsigned.
17532
17533 * lib/abitset.c (abitset_unused_clear): Do not assume that
17534 bitset_word is the same width as int.
17535 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
17536 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
17537 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
17538 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
17539 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
17540
17541 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
17542 portability to one's complement hosts!).
17543 * lib/ebitset.c (ebitset_op1): Likewise.
17544 * lib/lbitset.c (lbitset_op1): Likewise.
17545
17546 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
17547 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
17548 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
17549 Sync with fileutils.
17550 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
17551 lib/gettext.h: Sync with diffutils.
17552
17553 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
17554 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
17555
17556 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
17557 PROTOTYPES to check for prototypes, and "defined __STDC__" to
17558 check for void *.
17559
17560 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
17561 size_t; the old version tried to do this but casted improperly.
17562 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
17563 (bitset_test): Now returns int, not unsigned long.
17564
17565 * lib/bitset_stats.c: Include "gettext.h".
17566 (_): New macro.
17567 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
17568 name locals "index", as it generates unnecessary warnings on some
17569 hosts that have an "index" function.
17570
17571 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
17572 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
17573 they need translation.
17574 * src/LR0.c (state_list_append, new_itemsets, get_state,
17575 append_states, generate_states): Likewise.
17576 * src/assoc.c (assoc_to_string): Likewise.
17577 * src/closure.c (print_closure, set_firsts, closure): Likewise.
17578 * src/gram.c (grammar_dump): Likewise.
17579 * src/injections.c (injections_compute): Likewise.
17580 * src/lalr.c (lookaheads_print): Likewise.
17581 * src/relation.c (relation_transpose): Likewise.
17582 * src/scan-gram.l: Likewise.
17583 * src/tables.c (table_grow, pack_vector): Likewise.
17584
17585 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
17586 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
17587 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
17588 * m4/mbstate_t.m4: Sync with fileutils.
17589 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
17590
17591 * po/LINGUAS: Add pt_BR.
17592 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
17593 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
17594 lib/timevar.c.
17595 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
17596 manual recommends.
17597 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
17598
17599 * src/complain.c (strerror_r): Remove decl; not needed.
17600 (strerror): Use same pattern as ../lib/error.c.
17601
17602 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
17603
17604 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
17605
17606 * src/main.c (main): Cast result of bindtextdomain and textdomain
17607 to void, to avoid a GCC warning when --disable-nls is in effect.
17608
17609 * src/scan-gram.l: Use strings rather than escapes when possible,
17610 to minimize the number of warnings from xgettext.
17611 (handle_action_dollar, handle_action_at): Don't use isdigit,
17612 as it mishandles negative chars and it may not work as expected
17613 outside the C locale.
17614
17615 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
17616 this is a GCC extension and is not portable to other compilers.
17617
17618 * src/system.h (alloca): Use same pattern as ../lib/error.c.
17619 Do not include <ctype.h>; no longer needed.
17620 Do not include <malloc.h>; no longer needed (and generates
17621 warnings on OpenBSD 3.0).
17622
17623 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
17624 it's not portable.
17625
17626 * tests/regression.at: Do not use 'cc -c input.c -o input';
17627 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
17628
17629 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
17630 exit status as failure, not just exit status 1. Sun C exits
17631 with status 2 sometimes.
17632
17633 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
17634 Use it for the two large tests.
17635
c8f002c7
AD
176362002-08-02 Akim Demaille <akim@epita.fr>
17637
17638 * src/conflicts.c (conflicts_output): Don't output rules never
17639 reduced here, since anyway that computation doesn't work.
17640 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
17641 (rule_useless_p, rule_never_reduced_p): New.
17642 (grammar_rules_partial_print): Use a filter instead of a range.
17643 Display the title only if needed.
17644 (grammar_rules_print): Adjust.
17645 (grammar_rules_never_reduced_report): New.
17646 * src/tables.c (action_row): Move the computation of rules never
17647 reduced to...
17648 (token_actions): here.
17649 * src/main.c (main): Make the parser before making the report, so
17650 that rules never reduced are computed.
17651 Call grammar_rules_never_reduced_report.
17652 * src/print.c (print_results): Report rules never reduced.
17653 * tests/conflicts.at, tests/reduce.at: Adjust.
17654
cd08e51e
AD
176552002-08-01 Akim Demaille <akim@epita.fr>
17656
17657 Instead of attaching lookaheads and duplicating the rules being
17658 reduced by a state, attach the lookaheads to the reductions.
17659
17660 * src/state.h (state_t): Remove the `lookaheads',
17661 `lookaheads_rule' member.
17662 (reductions_t): Add a `lookaheads' member.
17663 Use a regular array for the `rules'.
17664 * src/state.c (reductions_new): Initialize the lookaheads member
17665 to 0.
17666 (state_rule_lookaheads_print): Adjust.
17667 * src/state.h, src/state.c (state_reductions_find): New.
17668 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
17669 (count_rr_conflicts): Adjust.
17670 * src/lalr.c (LArule): Remove.
17671 (add_lookback_edge): Adjust.
17672 (state_lookaheads_count): New.
17673 (states_lookaheads_initialize): Merge into...
17674 (initialize_LA): this.
17675 (lalr_free): Adjust.
17676 * src/main.c (main): Don't free nullable and derives too early: it
17677 is used by --verbose.
17678 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
17679
bb0027a9
AD
176802002-08-01 Akim Demaille <akim@epita.fr>
17681
17682 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
17683 `rule_number_t**'.
17684 (set_derives, free_derives): Rename as...
17685 (derives_compute, derives_free): this.
17686 Adjust all dependencies.
17687 * src/nullable.c (set_nullable, free_nullable): Rename as...
17688 (nullable_compute, nullable_free): these.
17689 (rule_list_t): Store rule_t *, not rule_number_t.
17690 * src/state.c (state_rule_lookaheads_print): Directly compare rule
17691 pointers, instead of their numbers.
17692 * src/main.c (main): Call nullable_free, and derives_free earlier,
17693 as they were lo longer used.
17694
3325ddc4
AD
176952002-08-01 Akim Demaille <akim@epita.fr>
17696
17697 * lib/timevar.c (get_time): Include children time.
17698 * src/lalr.h (LA, LArule): Don't export them: used with the
17699 state_t.
17700 * src/lalr.c (LA, LArule): Static.
17701 * src/lalr.h, src/lalr.c (lalr_free): New.
17702 * src/main.c (main): Call it.
17703 * src/tables.c (pack_vector): Check whether loc is >= to the
17704 table_size, not >.
17705 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
17706 (tables_generate): do it, since that's also it which allocates
17707 them.
17708 Don't free LA and LArule, main does.
17709
c6f1a33c
AD
177102002-07-31 Akim Demaille <akim@epita.fr>
17711
17712 Separate parser tables computation and output.
17713
17714 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
17715 (conflict_list, conflict_list_cnt, table, check, table_ninf)
17716 (yydefgoto, yydefact, high): Move to...
17717 * src/tables.h, src/tables.c: here.
17718 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17719 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17720 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
17721 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
17722 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
17723 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
17724 (action_row, save_row, token_actions, save_column, default_goto)
17725 (goto_actions, sort_actions, matching_state, pack_vector)
17726 (table_ninf_remap, pack_table, prepare_actions): Move to...
17727 * src/tables.c: here.
17728 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
17729 * src/output.c (token_actions, output_base, output_conflicts)
17730 (output_check): Merge into...
17731 (prepare_actions): this.
17732 (actions_output): Rename as...
17733 (user_actions_output): this.
17734 * src/main.c (main): Call tables_generate and tables_free.
17735
1509d42f
AD
177362002-07-31 Akim Demaille <akim@epita.fr>
17737
17738 Steal GCC's --time-report support.
17739
17740 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
17741 stolen/adjusted from GCC.
17742 * m4/stage.m4: Remove time related checks.
17743 * m4/timevar.m4: New.
17744 * configure.in: Adjust.
17745 * src/system.h: Adjust to using timevar.h.
17746 * src/getargs.h, src/getargs.c: Support trace_time for
17747 --trace=time.
17748 * src/main.c (stage): Remove.
17749 (main): Replace `stage' invocations with timevar calls.
17750 * src/output.c: Insert pertinent timevar calls.
17751
273a74fa
AD
177522002-07-31 Akim Demaille <akim@epita.fr>
17753
17754 Let --trace have arguments.
17755
17756 * src/getargs.h (enum trace_e): New.
17757 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
17758 (long_options, short_options): --trace/-T takes an optional
17759 argument.
17760 Change all the uses of trace_flag to reflect the new flags.
17761 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
17762
17763 Strengthen `stage' portability.
17764
17765 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
17766 * configure.in: Use it.
17767 Don't check for malloc.h and sys/times.h.
17768 * src/system.h: Include them when appropriate.
17769 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
17770 times and struct tms are available.
17771
217598da
AD
177722002-07-30 Akim Demaille <akim@epita.fr>
17773
17774 In verbose parse error message, don't report `error' as an
17775 expected token.
17776 * tests/actions.at (Printers and Destructors): Adjust.
17777 * tests/calc.at (Calculator $1): Adjust.
17778 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
17779 error message, do not report the parser accepts the error token in
17780 that state.
17781
52489d44
AD
177822002-07-30 Akim Demaille <akim@epita.fr>
17783
17784 Normalize conflict related messages.
17785
17786 * src/complain.h, src/complain.c (warn, complain): New.
17787 * src/conflicts.c (conflicts_print): Use them.
17788 (conflict_report_yacc): New, extracted from...
17789 (conflicts_print): here.
17790 * tests/conflicts.at, tests/existing.at: Adjust.
17791
e8832397
AD
177922002-07-30 Akim Demaille <akim@epita.fr>
17793
17794 Report rules which are never reduced by the parser: those hidden
17795 by conflicts.
17796
17797 * src/LR0.c (save_reductions): Don't make the final state too
17798 different: save its reduction (accept) instead of having a state
17799 without any action (no shift or goto, no reduce).
17800 Note: the final state is now a ``regular'' state, i.e., the
17801 parsers now contain `reduce 0' as default reduction.
17802 Nevertheless, since they decide to `accept' when yystate =
17803 final_state, they still will not reduce rule 0.
17804 * src/print.c (print_actions, print_reduction): Adjust.
17805 * src/output.c (action_row): Track reduced rules.
17806 (token_actions): Report rules never reduced.
17807 * tests/conflicts.at, tests/regression.at: Adjust.
17808
caf23d24
AD
178092002-07-30 Akim Demaille <akim@epita.fr>
17810
17811 `stage' was accidently included in a previous patch.
17812 Initiate its autoconfiscation.
17813
17814 * configure.in: Look for malloc.h and sys/times.h.
17815 * src/main.c (stage): Adjust.
17816 Report only when trace_flag.
17817
640748ee
AD
178182002-07-29 Akim Demaille <akim@epita.fr>
17819
17820 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
17821 state_number_t.
17822 (errs_t): symbol_t*, not symbol_number_t.
17823 (reductions_t): rule_t*, not rule_number_t.
17824 (FOR_EACH_SHIFT): New.
17825 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
17826 * src/print.c, src/print_graph.c: Adjust.
17827
88bce5a2
AD
178282002-07-29 Akim Demaille <akim@epita.fr>
17829
17830 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
17831
17832 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
17833 (endtoken, accept): these.
17834 * src/reader.c (reader): Set endtoken's default tag to "$end".
17835 Set undeftoken's tag to "$undefined" instead of "$undefined.".
17836 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
17837 Adjust.
17838
1bfb97db
AD
178392002-07-29 Akim Demaille <akim@epita.fr>
17840
17841 * src/reduce.c (reduce_grammar): When the language is empty,
17842 complain about the start symbol, not the axiom.
17843 Use its location.
17844 * tests/reduce.at (Empty Language): New.
17845
fc5734fe
AD
178462002-07-26 Akim Demaille <akim@epita.fr>
17847
17848 * src/reader.h, src/reader.c (gram_error): ... can't get
17849 yycontrol without making too strong assumptions on the parser
17850 itself.
17851 * src/output.c (prepare_tokens): Use the real 0th value of
17852 token_translations instead of `0'.
17853 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
17854 visible here.
17855 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
17856 for the time being: %locations ought to provide it to yyerror.
17857
3650b4b8
AD
178582002-07-25 Akim Demaille <akim@epita.fr>
17859
17860 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
17861 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
17862 * tests/regression.at (Web2c Actions): Adjust.
17863
4b3d3a8e
AD
178642002-07-25 Akim Demaille <akim@epita.fr>
17865
17866 Stop storing rules from 1 to nrules + 1.
17867
17868 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
17869 * src/nullable.c, src/output.c, src/print.c, src/reader.c
17870 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
17871 Iterate from 0 to nrules.
17872 Use rule_number_as_item_number and item_number_as_rule_number.
17873 Adjust to `derive' now containing possibly 0.
17874 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
17875 Handle the `- 1' part in rule numbers from/to item numbers.
17876 * src/conflicts.c (log_resolution): Fix the message which reversed
17877 shift and reduce.
17878 * src/output.c (action_row): Initialize default_rule to -1.
17879 (token_actions): Adjust.
17880 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
17881 expected output.
17882 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
17883
4a2a22f4
AD
178842002-07-25 Akim Demaille <akim@epita.fr>
17885
17886 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
17887 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
17888 (b4_c_knr_arg_decl): New.
17889 * data/yacc.c: Use it to define yysymprint, yydestruct, and
17890 yyreport_parse_error.
17891
b8df3223
AD
178922002-07-25 Akim Demaille <akim@epita.fr>
17893
17894 * data/yacc.c (yyreport_parse_error): New, extracted from...
17895 (yyparse): here.
17896 (yydestruct, yysymprint): Move above yyparse.
17897 Be K&R compliant.
17898
a762e609
AD
178992002-07-25 Akim Demaille <akim@epita.fr>
17900
17901 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
17902 replace...
17903 (b4_sint_type, b4_uint_type): these.
17904 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
17905 * tests/regression.at (Web2c Actions): Adjust.
17906
12b0043a
AD
179072002-07-25 Akim Demaille <akim@epita.fr>
17908
17909 * src/gram.h (TIEM_NUMBER_MAX): New.
17910 (item_number_of_rule_number, rule_number_of_item_number): Rename
17911 as...
17912 (rule_number_as_item_number, item_number_as_rule_number): these.
17913 Adjust dependencies.
17914 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17915 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17916 (symbol_number_to_vector_number): New.
17917 (order): Of vector_number_t* type.
17918 (base_t, BASE_MAX, BASE_MIN): New.
17919 (froms, tos, width, pos, check): Of base_t type.
17920 (action_number_t, ACTION_MIN, ACTION_MAX): New.
17921 (actrow): Of action_number_t type.
17922 (conflrow): Of unsigned int type.
17923 (table_ninf, base_ninf): New.
17924 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
17925 (muscle_insert_int_table, muscle_insert_base_table)
17926 (muscle_insert_rule_number_table): New.
17927 (prepare_tokens): Output `toknum' as int_table.
17928 (action_row): Returns a rule_number_t.
17929 Use ACTION_MIN, not SHRT_MIN.
17930 (token_actions): yydefact is rule_number_t*.
17931 (table_ninf_remap): New.
17932 (pack_table): Use it for `base' and `table'.
17933 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
17934 replaced with...
17935 (YYPACT_NINF, YYTABLE_NINF): these.
17936 (yypact, yytable): Compute their types instead of hard-coded
17937 `short'.
17938 * tests/regression.at (Web2c Actions): Adjust.
17939
5dde258a
AD
179402002-07-19 Akim Demaille <akim@epita.fr>
17941
17942 * src/scan-gram.l (id): Can start with an underscore.
17943
a945ec39
AD
179442002-07-16 Akim Demaille <akim@epita.fr>
17945
17946 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
17947 Adjust all former `associativity' dependencies.
17948 * src/symtab.c (symbol_new): Default associativity is `undef', not
17949 `right'.
17950 (symbol_check_alias_consistence): Adjust.
17951
fae437e8
AD
179522002-07-09 Akim Demaille <akim@epita.fr>
17953
17954 * doc/bison.texinfo: Properly set the ``header'' part.
17955 Use @dircategory ``GNU programming tools'' as per Texinfo's
17956 documentation.
17957 Use @copying.
17958
1a715ef2
AD
179592002-07-09 Akim Demaille <akim@epita.fr>
17960
17961 * lib/quotearg.h: Protect against multiple inclusions.
17962 * src/location.h (location_t): Add a `file' member.
17963 (LOCATION_RESET, LOCATION_PRINT): Adjust.
17964 * src/complain.c (warn_at, complain_at, fatal_at): Drop
17965 `error_one_per_line' support.
17966
a5d50994
AD
179672002-07-09 Akim Demaille <akim@epita.fr>
17968
17969 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
17970 * src/reader.c (lineno): Remove.
17971 Adjust all dependencies.
17972 (get_merge_function): Take a location and use complain_at.
17973 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
17974 * tests/regression.at (Invalid inputs, Mixing %token styles):
17975 Adjust.
17976
b275314e
AD
179772002-07-09 Akim Demaille <akim@epita.fr>
17978
17979 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
17980 recovery rule, and forbid extensions when --yacc.
17981 (gram_error): Use complain_at.
17982 * src/reader.c (reader): Exit if there were parse errors.
17983
865b9df1
AD
179842002-07-09 Akim Demaille <akim@epita.fr>
17985
17986 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
17987 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
17988 Reported by R Blake <blakers@mac.com>.
17989
c76e14da
AD
179902002-07-09 Akim Demaille <akim@epita.fr>
17991
17992 * data/yacc.c: Output the copyright notive in the header.
17993
7db2ed2d
AD
179942002-07-03 Akim Demaille <akim@epita.fr>
17995
17996 * src/output.c (froms, tos): Are state_number_t.
17997 (save_column): sp, sp1, and sp2 are state_number_t.
17998 (prepare): Rename `final' as `final_state_number', `nnts' as
17999 `nterms_number', `nrules' as `rules_number', `nstates' as
18000 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
18001 unused.
18002 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
18003 * data/lalr1.cc (nsym_): Remove, unused.
18004
e68e0410
AD
180052002-07-03 Akim Demaille <akim@epita.fr>
18006
18007 * src/lalr.h, src/lalr.c (goto_number_t): New.
18008 * src/lalr.c (goto_list_t): New.
18009 Propagate them.
18010 * src/nullable.c (rule_list_t): New.
18011 Propagate.
18012 * src/types.h: Remove.
18013
e1a4f3a4
AD
180142002-07-03 Akim Demaille <akim@epita.fr>
18015
18016 * src/closure.c (print_fderives): Use rule_rhs_print.
18017 * src/derives.c (print_derives): Use rule_rhs_print.
18018 (rule_list_t): New, replaces `shorts'.
18019 (set_derives): Add comments.
18020 * tests/sets.at (Nullable, Firsts): Adjust.
18021
536545f3
AD
180222002-07-03 Akim Demaille <akim@epita.fr>
18023
18024 * src/output.c (prepare_actions): Free `tally' and `width'.
18025 (prepare_actions): Allocate and free `order'.
18026 * src/symtab.c (symbols_free): Free `symbols'.
18027 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
18028 * src/output.c (m4_invoke): Move to...
18029 * src/scan-skel.l: here.
18030 (<<EOF>>): Close yyout, and free its name.
18031
8b752b00
AD
180322002-07-03 Akim Demaille <akim@epita.fr>
18033
18034 Fix some memory leaks, and fix a bug: state 0 was examined twice.
18035
18036 * src/LR0.c (new_state): Merge into...
18037 (state_list_append): this.
18038 (new_states): Merge into...
18039 (generate_states): here.
18040 (set_states): Don't ensure a proper `errs' state member here, do it...
18041 * src/conflicts.c (conflicts_solve): here.
18042 * src/state.h, src/state.c: Comment changes.
18043 (state_t): Rename member `shifts' as `transitions'.
18044 Adjust all dependencies.
18045 (errs_new): For consistency, also take the values as argument.
18046 (errs_dup): Remove.
18047 (state_errs_set): New.
18048 (state_reductions_set, state_transitions_set): Assert that no
18049 previous value was assigned.
18050 (state_free): New.
18051 (states_free): Use it.
18052 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
18053 temporary storage: use `errs' and `nerrs' as elsewhere.
18054 (set_conflicts): Allocate and free this `errs'.
18055
613f5e1a
AD
180562002-07-02 Akim Demaille <akim@epita.fr>
18057
18058 * lib/libiberty.h: New.
18059 * lib: Update the bitset implementation from upstream.
18060 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
18061 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
18062 * src/main.c: Adjust bitset stats calls.
18063
26e0cadc
PE
180642002-07-01 Paul Eggert <eggert@twinsun.com>
18065
18066 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
18067 char, so that negative chars don't collide with $.
18068
1154cced
AD
180692002-06-30 Akim Demaille <akim@epita.fr>
18070
18071 Have the GLR tests be `warning' checked, and fix the warnings.
18072
18073 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
18074 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
18075 (yyremoveDeletes): `yyi' and `yyj' are size_t.
18076 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
18077 (yyaddDeferredAction): static.
18078 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
18079 (yyreportParseError): yyprefix is const.
18080 yytokenp is used only when verbose.
18081 (yy__GNUC__): Replace with __GNUC__.
18082 (yypdumpstack): yyi is size_t.
18083 (yypreference): Un-yy local variables and arguments, to avoid
18084 clashes with `yyr1'. Anyway, we are not in the user name space.
18085 (yytname_size): be an int, as is compared with ints.
18086 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
18087 Use them.
18088 * tests/cxx-gram.at: Use quotation to protect $1.
18089 Use AT_COMPILE to enable warnings hunts.
18090 Prototype yylex and yyerror.
18091 `Use' argc.
18092 Include `string.h', not `strings.h'.
18093 Produce and prototype stmtMerge only when used.
18094 yylex takes a location.
18095
97650f4e
AD
180962002-06-30 Akim Demaille <akim@epita.fr>
18097
18098 We spend a lot of time in quotearg, in particular when --verbose.
18099
18100 * src/symtab.c (symbol_get): Store a quoted version of the key.
18101 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
18102 Adjust all callers.
18103
d2576365
AD
181042002-06-30 Akim Demaille <akim@epita.fr>
18105
18106 * src/state.h (reductions_t): Rename member `nreds' as num.
18107 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
18108 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
18109
ccaf65bc
AD
181102002-06-30 Akim Demaille <akim@epita.fr>
18111
18112 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
18113 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
18114 (shifts_to): Rename as...
18115 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
18116 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
18117 (TRANSITION_IS_DISABLED, transitions_to): these.
18118
87675353
AD
181192002-06-30 Akim Demaille <akim@epita.fr>
18120
18121 * src/print.c (print_shifts, print_gotos): Merge into...
18122 (print_transitions): this.
18123 (print_transitions, print_errs, print_reductions): Align the
18124 lookaheads columns.
18125 (print_core, print_transitions, print_errs, print_state,
18126 print_grammar): Output empty lines separator before, not after.
18127 (state_default_rule_compute): Rename as...
18128 (state_default_rule): this.
18129 * tests/conflicts.at (Defaulted Conflicted Reduction),
18130 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
18131 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
18132
ce4ccb4b
AD
181332002-06-30 Akim Demaille <akim@epita.fr>
18134
18135 Display items as we display rules.
18136
18137 * src/gram.h, src/gram.c (rule_lhs_print): New.
18138 * src/gram.c (grammar_rules_partial_print): Use it.
18139 * src/print.c (print_core): Likewise.
18140 * tests/conflicts.at (Defaulted Conflicted Reduction),
18141 (Unresolved SR Conflicts): Adjust.
18142 (Unresolved SR Conflicts): Adjust and rename as...
18143 (Resolved SR Conflicts): this, as was meant.
18144 * tests/regression.at (Web2c Report): Adjust.
18145
bc933ef1
AD
181462002-06-30 Akim Demaille <akim@epita.fr>
18147
18148 * src/print.c (state_default_rule_compute): New, extracted from...
18149 (print_reductions): here.
18150 Pessimize, but clarify the code.
18151 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
18152
53d4308d
AD
181532002-06-30 Akim Demaille <akim@epita.fr>
18154
18155 * src/output.c (action_row): Let default_rule be always a rule
18156 number.
18157
574fb2d5
AD
181582002-06-30 Akim Demaille <akim@epita.fr>
18159
18160 * src/closure.c (print_firsts, print_fderives, closure):
18161 Use BITSET_EXECUTE.
18162 * src/lalr.c (lookaheads_print): Likewise.
18163 * src/state.c (state_rule_lookaheads_print): Likewise.
18164 * src/print_graph.c (print_core): Likewise.
18165 * src/print.c (print_reductions): Likewise.
18166 * src/output.c (action_row): Likewise.
18167 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
18168
05811fd7
AD
181692002-06-30 Akim Demaille <akim@epita.fr>
18170
18171 * src/print_graph.c: Use report_flag.
18172
0e4d5753
AD
181732002-06-30 Akim Demaille <akim@epita.fr>
18174
18175 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
18176 to...
18177 * src/relation.h, src/relation.c (traverse, relation_digraph)
18178 (relation_print, relation_transpose): New.
18179
24c7d800
AD
181802002-06-30 Akim Demaille <akim@epita.fr>
18181
18182 * src/state.h, src/state.c (shifts_to): New.
18183 * src/lalr.c (build_relations): Use it.
18184
9222837b
AD
181852002-06-30 Akim Demaille <akim@epita.fr>
18186
18187 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
18188 (item_number_of_rule_number, rule_number_of_item_number): New.
18189 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
18190 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18191 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
18192 Propagate their use.
18193 Much remains to be done, in particular wrt `shorts' from types.h.
18194
260008e5
AD
181952002-06-30 Akim Demaille <akim@epita.fr>
18196
18197 * src/symtab.c (symbol_new): Initialize the `printer' member.
18198
8a731ca8
AD
181992002-06-30 Akim Demaille <akim@epita.fr>
18200
18201 * src/LR0.c (save_reductions): Remove, replaced by...
18202 * src/state.h, src/state.c (state_reductions_set): New.
18203 (reductions, errs): Rename as...
18204 (reductions_t, errs_t): these.
18205 Adjust all dependencies.
18206
32e1e0a4
AD
182072002-06-30 Akim Demaille <akim@epita.fr>
18208
18209 * src/LR0.c (state_list_t, state_list_append): New.
18210 (first_state, last_state): Now symbol_list_t.
18211 (this_state): Remove.
18212 (new_itemsets, append_states, save_reductions): Take a state_t as
18213 argument.
18214 (set_states, generate_states): Adjust.
18215 (save_shifts): Remove, replaced by...
18216 * src/state.h, src/state.c (state_shifts_set): New.
18217 (shifts): Rename as...
18218 (shifts_t): this.
18219 Adjust all dependencies.
18220 * src/state.h (state_t): Remove the `next' member.
18221
e5fb6710
AD
182222002-06-30 Akim Demaille <akim@epita.fr>
18223
18224 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
18225 escaped in slot 0.
18226
c7ca99d4
AD
182272002-06-30 Akim Demaille <akim@epita.fr>
18228
18229 Use hash.h for the state hash table.
18230
18231 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
18232 (allocate_storage): Use state_hash_new.
18233 (free_storage): Use state_hash_free.
18234 (new_state, get_state): Adjust.
18235 * src/lalr.h, src/lalr.c (states): Move to...
18236 * src/states.h (state_t): Remove the `link' member, no longer
18237 used.
18238 * src/states.h, src/states.c: here.
18239 (state_hash_new, state_hash_free, state_hash_lookup)
18240 (state_hash_insert, states_free): New.
18241 * src/states.c (state_table, state_compare, state_hash): New.
18242 * src/output.c (output_actions): Do not free states now, since we
18243 still need to know the final_state number in `prepare', called
18244 afterwards. Do it...
18245 * src/main.c (main): here: call states_free after `output'.
18246
df0e7316
AD
182472002-06-30 Akim Demaille <akim@epita.fr>
18248
18249 * src/state.h, src/state.c (state_new): New, extracted from...
18250 * src/LR0.c (new_state): here.
18251 * src/state.h (STATE_ALLOC): Move to...
18252 * src/state.c: here.
18253 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
18254 * src/state.h, src/state.c: here.
18255
39f41916
AD
182562002-06-30 Akim Demaille <akim@epita.fr>
18257
18258 * src/reader.c (gensym): Rename as...
18259 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
18260 (getsym): Rename as...
18261 (symbol_get): this.
18262
d57650a5
AD
182632002-06-30 Akim Demaille <akim@epita.fr>
18264
18265 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
18266 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
18267 * src/output.c, src/print.c, src/print_graph.c: Propagate.
18268 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
18269
5a08f1ce
AD
182702002-06-30 Akim Demaille <akim@epita.fr>
18271
18272 Make the test suite pass with warnings checked.
18273
18274 * tests/actions.at (Printers and Destructors): Improve.
18275 Avoid unsigned vs. signed issues.
18276 * tests/calc.at: Don't exercise the scanner here, do it...
18277 * tests/input.at (Torturing the Scanner): here.
18278
720623af
PH
182792002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18280
88e7e941 18281 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
18282 reorganize first lines parallel to yacc.c.
18283
fb8135fa
AD
182842002-06-28 Akim Demaille <akim@epita.fr>
18285
18286 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
18287 (b4_token_enum, b4_token_defines): New, factored from...
18288 * data/lalr1.cc, data/yacc.c, glr.c: here.
18289
41442480
AD
182902002-06-28 Akim Demaille <akim@epita.fr>
18291
18292 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
18293 unused variables.
18294 * src/output.c (merger_output): static.
18295
e0e5bf84
AD
182962002-06-28 Akim Demaille <akim@epita.fr>
18297
ba0fe3c7 18298 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
18299 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
18300 pacify GCC.
18301 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 18302
676385e2
PH
183032002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18304
18305 Accumulated changelog for new GLR parsing features.
18306
6a254321 18307 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
18308 conflicts_total_count.
18309 * src/conflicts.h: Ditto.
18310 * src/output.c (token_actions): Use the new name.
18311 (output_conflicts): Change conflp => conflict_list_heads, and
18312 confl => conflict_list for better readability.
18313 * data/glr.c: Use the new names.
18314 * NEWS: Add self to GLR announcement.
e0e5bf84 18315
676385e2
PH
18316 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
18317
18318 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
18319 Akim Demaille.
18320
18321 * data/bison.glr: Change name to glr.c
18322 * data/glr.c: Renamed from bison.glr.
18323 * data/Makefile.am: Add glr.c
e0e5bf84
AD
18324
18325 * src/getargs.c:
18326
676385e2 18327 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 18328 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 18329
676385e2
PH
18330 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18331
18332 * data/bison.glr: Be sure to restore the
18333 current #line when returning to the skeleton contents after having
18334 exposed the input file's #line.
18335
18336 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18337
18338 * data/bison.glr: Bring up to date with changes to bison.simple.
18339
18340 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18341
18342 * data/bison.glr: Correct definitions that use b4_prefix.
18343 Various reformatting.
18344 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
18345 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
18346 yytokenp argument; now part of stack.
18347 (yychar): Define to behave as documented.
18348 (yyclearin): Ditto.
e0e5bf84 18349
676385e2
PH
18350 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18351
18352 * src/reader.h: Add declaration for free_merger_functions.
18353
18354 * src/reader.c (merge_functions): New variable.
18355 (get_merge_function): New function.
18356 (free_merger_functions): New function.
18357 (readgram): Check for %prec that is not followed by a symbol.
18358 Handle %dprec and %merge declarations.
18359 (packgram): Initialize dprec and merger fields in rules array.
18360
18361 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
18362 conflict_list_cnt, conflict_list_free): New variables.
18363 (table_grow): Also grow conflict_table.
e0e5bf84 18364 (prepare_rules): Output dprec and merger tables.
676385e2 18365 (conflict_row): New function.
e0e5bf84 18366 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
18367 default reduction in conflicted states for GLR parser so that there
18368 are spaces for the conflict lists.
18369 (save_row): Also save conflict information.
18370 (token_actions): Allocate conflict list.
18371 (merger_output): New function.
18372 (pack_vector): Pack conflict table, too.
18373 (output_conflicts): New function to output yyconflp and yyconfl.
18374 (output_check): Allocate conflict_tos.
18375 (output_actions): Output conflict tables, also.
18376 (output_skeleton): Output b4_mergers definition.
18377 (prepare): Output b4_max_rhs_length definition.
18378 Use 'bison.glr' as default skeleton for GLR parsers.
18379
18380 * src/gram.c (glr_parser): New flag.
18381 (grammar_free): Call free_merger_functions.
18382
18383 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
18384 all pairs of conflicting reductions, rather than just all tokens
18385 causing conflicts. Needed to size conflict tables.
e0e5bf84 18386 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
18387 interface.
18388 (conflicts_print): Ditto.
18389 (count_total_conflicts): New function.
18390
18391 * src/reader.h (merger_list): New type.
18392 (merge_functions): New variable.
18393
18394 * src/lex.h (tok_dprec, tok_merge): New token types.
18395
18396 * src/gram.h (rule_s): Add dprec and merger fields.
18397 (glr_parser): New flag.
18398
18399 * src/conflicts.h (count_total_conflicts): New function.
18400
18401 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
18402
18403 * doc/bison.texinfo (Generalized LR Parsing): New section.
18404 (GLR Parsers): New section.
18405 (Language and Grammar): Mention GLR parsing.
18406 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
18407 Correct typo ("tge" -> "the").
18408
18409 * data/bison.glr: New skeleton for GLR parsing.
18410
18411 * tests/cxx-gram.at: New tests for GLR parsing.
18412
18413 * tests/testsuite.at: Include cxx-gram.at.
18414
18415 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 18416
676385e2
PH
18417 * src/parse-gram.y:
18418
18419 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
18420
18421 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 18422
b5480d74 184232002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
18424
18425 * src/options.h, src/options.c: Remove.
18426 * src/getargs.c (short_options, long_options): New.
18427
60491a94
AD
184282002-06-27 Akim Demaille <akim@epita.fr>
18429
18430 * data/bison.simple, data/bison.c++: Rename as...
18431 * data/yacc.c, data/lalr1.cc: these.
18432 * doc/bison.texinfo (Environment Variables): Remove.
18433
9be0c25b
AD
184342002-06-25 Raja R Harinath <harinath@cs.umn.edu>
18435
18436 * src/getargs.c (report_argmatch): Initialize strtok().
18437
1ae72863
AD
184382002-06-20 Akim Demaille <akim@epita.fr>
18439
18440 * data/bison.simple (b4_symbol_actions): New, replaces...
18441 (b4_symbol_destructor, b4_symbol_printer): these.
18442 (yysymprint): Be sure to call YYPRINT only for tokens, and using
18443 user token numbers.
18444
87542d29
AD
184452002-06-20 Akim Demaille <akim@epita.fr>
18446
18447 * data/bison.simple (yydestructor): Rename as...
18448 (yydestruct): this.
18449
1a31ed21
AD
184502002-06-20 Akim Demaille <akim@epita.fr>
18451
18452 * src/symtab.h, src/symtab.c (symbol_type_set)
18453 (symbol_destructor_set, symbol_precedence_set): The location is
18454 the last argument.
18455 Adjust all callers.
18456
e776192e
AD
184572002-06-20 Akim Demaille <akim@epita.fr>
18458
18459 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
18460 internals.
18461 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
18462 Takes a location.
18463 * src/symtab.h, src/symtab.c (symbol_class_set)
18464 (symbol_user_token_number_set): Likewise.
18465 Adjust all callers.
18466 Promote complain_at.
18467 * tests/input.at (Type Clashes): Adjust.
18468
5c1180b3
AD
184692002-06-20 Akim Demaille <akim@epita.fr>
18470
18471 * data/bison.simple (YYLEX): Fix the declaration when
18472 %pure-parser.
18473
e3170060
AD
184742002-06-20 Akim Demaille <akim@epita.fr>
18475
18476 * data/bison.simple (yysymprint): Don't print the token number,
18477 just its name.
18478 * tests/actions.at (Destructors): Rename as...
18479 (Printers and Destructors): this.
18480 Also exercise %printer.
18481
253862fd
AD
184822002-06-20 Akim Demaille <akim@epita.fr>
18483
18484 * data/bison.simple (YYDSYMPRINT): New.
18485 Use it to remove many of the #if YYDEBUG/if (yydebug).
18486
366eea36
AD
184872002-06-20 Akim Demaille <akim@epita.fr>
18488
18489 * src/symtab.h, src/symtab.c (symbol_t): printer and
18490 printer_location are new members.
18491 (symbol_printer_set): New.
18492 * src/parse-gram.y (PERCENT_PRINTER): New token.
18493 Handle its associated rule.
18494 * src/scan-gram.l: Adjust.
18495 (handle_destructor_at, handle_destructor_dollar): Rename as...
18496 (handle_symbol_code_at, handle_symbol_code_dollar): these.
18497 * src/output.c (symbol_printers_output): New.
18498 (output_skeleton): Call it.
18499 * data/bison.simple (yysymprint): New. Cannot be named yyprint
18500 since there are already many grammar files with a user `yyprint'.
18501 Replace the calls to YYPRINT to calls to yysymprint.
18502 * tests/calc.at: Adjust.
18503 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
18504 taking advantage of parser very internal details (stack size!).
18505
4f25ebb0
AD
185062002-06-20 Akim Demaille <akim@epita.fr>
18507
18508 * src/scan-gram.l: Complete the scanner with the missing patterns
18509 to pacify Flex.
18510 Use `quote' and `symbol_tag_get' where appropriate.
18511
93b68a0e
AD
185122002-06-19 Akim Demaille <akim@epita.fr>
18513
18514 * tests/actions.at (Destructors): Augment to test locations.
18515 * data/bison.simple (yydestructor): Pass it the current location
18516 if locations are enabled.
18517 Prototype only when __STDC__ or C++.
18518 Change the argument names to move into the yy name space: there is
18519 user code here.
18520
58612f1d
AD
185212002-06-19 Akim Demaille <akim@epita.fr>
18522
74310291
AD
18523 * data/bison.simple (b4_pure_if): New.
18524 Use it instead of #ifdef YYPURE.
18525
185262002-06-19 Akim Demaille <akim@epita.fr>
18527
18528 * data/bison.simple (b4_location_if): New.
58612f1d
AD
18529 Use it instead of #ifdef YYLSP_NEEDED.
18530
f25bfb75
AD
185312002-06-19 Akim Demaille <akim@epita.fr>
18532
18533 Prepare @$ in %destructor, but currently don't bind it in the
18534 skeleton, as %location use is not cleaned up yet.
18535
18536 * src/scan-gram.l (handle_dollar, handle_destructor_at)
18537 (handle_action_at): New.
18538 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
18539 a braced_code_t and a location as additional arguments.
18540 (handle_destructor_dollar): Instead of requiring `b4_eval', just
18541 unquote one when outputting `b4_dollar_dollar'.
18542 Adjust callers.
18543 * data/bison.simple (b4_eval): Remove.
18544 (b4_symbol_destructor): Adjust.
18545 * tests/input.at (Invalid @n): Adjust.
18546
c732d2c6
AD
185472002-06-19 Zack Weinberg <zack@codesourcery.com>
18548
18549 * doc/bison.texinfo: Document ability to have multiple
18550 prologue sections.
18551
8c165d89
AD
185522002-06-18 Akim Demaille <akim@epita.fr>
18553
18554 * src/files.c (compute_base_names): When computing the output file
18555 names from the input file name, strip the directory part.
18556
ca98bf57
AD
185572002-06-18 Akim Demaille <akim@epita.fr>
18558
18559 * data/bison.simple.new: Comment changes.
18560 Reported by Andreas Schwab.
18561
0bfb02ff
AD
185622002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
18563
18564 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
18565 there are no `label `yyoverflowlab' defined but not used' warnings
18566 when yyoverflow is defined.
18567
24c0aad7
AD
185682002-06-18 Akim Demaille <akim@epita.fr>
18569
18570 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
18571 new member.
18572 (symbol_destructor_set): Adjust.
18573 * src/output.c (symbol_destructors_output): Output the destructor
18574 locations.
18575 Output the symbol name.
18576 * data/bison.simple (b4_symbol_destructor): Adjust.
18577
5719c109
AD
185782002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
18579 and Akim Demaille <akim@epita.fr>
18580
18581 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
18582 what's left on the stack when the error recovery hits EOF.
18583 * tests/actions.at (Destructors): Complete to exercise this case.
18584
9280d3ef
AD
185852002-06-17 Akim Demaille <akim@epita.fr>
18586
18587 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
18588 arguments is really empty, not only equal to `[]'.
18589 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
18590 member.
18591 (symbol_destructor_set): New.
18592 * src/output.c (symbol_destructors_output): New.
18593 * src/reader.h (brace_code_t, current_braced_code): New.
18594 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
18595 (handle_dollar): Rename as...
18596 (handle_action_dollar): this.
18597 (handle_destructor_dollar): New.
18598 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
18599 (grammar_declaration): Use it.
18600 * data/bison.simple (yystos): Is always defined.
18601 (yydestructor): New.
18602 * tests/actions.at (Destructors): New.
18603 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
18604
dafdc66f
AD
186052002-06-17 Akim Demaille <akim@epita.fr>
18606
18607 * src/symlist.h, src/symlist.c (symbol_list_length): New.
18608 * src/scan-gram.l (handle_dollar, handle_at): Compute the
18609 rule_length only when needed.
18610 * src/output.c (actions_output, token_definitions_output): Output
18611 the full M4 block.
18612 * src/symtab.c: Don't access directly to the symbol tag, use
18613 symbol_tag_get.
18614 * src/parse-gram.y: Use symbol_list_free.
18615
56c47203
AD
186162002-06-17 Akim Demaille <akim@epita.fr>
18617
18618 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
18619 (symbol_list_prepend, get_type_name): Move to...
18620 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
18621 (symbol_list_prepend, symbol_list_n_type_name_get): here.
18622 Adjust all callers.
18623 (symbol_list_free): New.
18624 * src/scan-gram.l (handle_dollar): Takes a location.
18625 * tests/input.at (Invalid $n): Adjust.
18626
1e0bab92
AD
186272002-06-17 Akim Demaille <akim@epita.fr>
18628
18629 * src/reader.h, src/reader.c (symbol_list_new): Export it.
18630 (symbol_list_prepend): New.
18631 * src/parse-gram.y (%union): `list' is a new member.
18632 (symbols.1): New, replaces...
18633 (terms_to_prec.1, nterms_to_type.1): these.
18634 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
18635 Take a location as additional argument.
18636 Adjust all callers.
18637
04e60654
AD
186382002-06-15 Akim Demaille <akim@epita.fr>
18639
18640 * src/parse-gram.y: Move %token in the declaration section so that
18641 we don't depend upon CVS Bison.
18642
10e5b8bd
AD
186432002-06-15 Akim Demaille <akim@epita.fr>
18644
18645 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
18646 * src/print.c (print_core): Use it.
18647
9801d40c
AD
186482002-06-15 Akim Demaille <akim@epita.fr>
18649
18650 * src/conflicts.c (log_resolution): Accept the rule involved in
18651 the sr conflicts instead of the lookahead number that points to
18652 that rule.
18653 (flush_reduce): Accept the current lookahead vector as argument,
18654 instead of the index in LA.
18655 (resolve_sr_conflict): Accept the current number of lookahead
18656 bitset to consider for the STATE, instead of the index in LA.
18657 (set_conflicts): Adjust.
18658 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
18659
c0263492
AD
186602002-06-15 Akim Demaille <akim@epita.fr>
18661
18662 * src/state.h (state_t): Replace the `lookaheadsp' member, a
18663 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
18664 Adjust all dependencies.
18665 * src/lalr.c (initialize_lookaheads): Split into...
18666 (states_lookaheads_count, states_lookaheads_initialize): these.
18667 (lalr): Adjust.
18668
9757c359
AD
186692002-06-15 Akim Demaille <akim@epita.fr>
18670
18671 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
18672 out of...
18673 (grammar_rules_print): here.
18674 * src/reduce.c (reduce_output): Use it.
18675 * tests/reduce.at (Useless Rules, Reduced Automaton)
18676 (Underivable Rules): Adjust.
18677
6b98e4b5
AD
186782002-06-15 Akim Demaille <akim@epita.fr>
18679
18680 Copy BYacc's nice way to report the grammar.
18681
18682 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
18683 New.
18684 Don't print the rules' location, it is confusing and useless.
18685 (rule_print): Use grammar_rhs_print.
18686 * src/print.c (print_grammar): Use grammar_rules_print.
18687
6b98e4b5
AD
186882002-06-15 Akim Demaille <akim@epita.fr>
18689
18690 Complete and rationalize `useless thing' warnings.
18691
18692 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
18693 (symbol_tag_print): New.
18694 Use them everywhere in place of accessing directly the tag member.
18695 * src/gram.h, src/gram.c (rule_print): New.
18696 Use it where a rule used to be printed `by hand'.
18697 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
18698 (reduce_grammar_tables): Report the useless rules.
18699 (reduce_print): Useless things are a warning, not an error.
18700 Report it as such.
18701 * tests/reduce.at (Useless Nonterminals, Useless Rules):
18702 (Reduced Automaton, Underivable Rules): Adjust.
18703 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
18704 * tests/conflicts.at (Unresolved SR Conflicts)
18705 (Solved SR Conflicts): Adjust.
18706
ee000ba4
AD
187072002-06-15 Akim Demaille <akim@epita.fr>
18708
18709 Let symbols have a location.
18710
18711 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
18712 (getsym): Adjust.
18713 Adjust all callers.
18714 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
18715 Use location_t, not int.
18716 * src/symtab.c (symbol_check_defined): Take advantage of the
18717 location.
18718 * tests/regression.at (Invalid inputs): Adjust.
18719
8efe435c
AD
187202002-06-15 Akim Demaille <akim@epita.fr>
18721
18722 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
18723 (input): Don't try to initialize yylloc here, do it in the
18724 scanner.
18725 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
18726 * src/gram.h (rule_t): Change line and action_line into location
18727 and action_location, of location_t type.
18728 Adjust all dependencies.
18729 * src/location.h, src/location.c (empty_location): New.
18730 * src/reader.h, src/reader.c (grammar_start_symbol_set)
18731 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
18732 (grammar_current_rule_symbol_append)
18733 (grammar_current_rule_action_append): Expect a location as argument.
18734 * src/reader.c (grammar_midrule_action): Adjust to attach an
18735 action's location as dummy symbol location.
18736 * src/symtab.h, src/symtab.c (startsymbol_location): New.
18737 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
18738 the line numbers.
18739
1921f1d7
AD
187402002-06-14 Akim Demaille <akim@epita.fr>
18741
18742 Grammar declarations may be found in the grammar section.
18743
18744 * src/parse-gram.y (rules_or_grammar_declaration): New.
18745 (declarations): Each declaration may end with a semicolon, not
18746 just...
18747 (grammar_declaration): `"%union"'.
18748 (grammar): Branch to rules_or_grammar_declaration.
18749
4515534c
AD
187502002-06-14 Akim Demaille <akim@epita.fr>
18751
18752 * src/main.c (main): Invoke scanner_free.
18753
f958596b
AD
187542002-06-14 Akim Demaille <akim@epita.fr>
18755
18756 * src/output.c (m4_invoke): Extracted from...
18757 (output_skeleton): here.
18758 Free tempfile.
18759
2c569025
AD
187602002-06-14 Akim Demaille <akim@epita.fr>
18761
18762 * src/parse-gram.y (directives, directive, gram)
18763 (grammar_directives, precedence_directives, precedence_directive):
18764 Rename as...
18765 (declarations, declaration, grammar, grammar_declaration)
18766 (precedence_declaration, precedence_declarator): these.
18767 (symbol_declaration): New.
18768
592e8d4d
AD
187692002-06-14 Akim Demaille <akim@epita.fr>
18770
18771 * src/files.c (action_obstack): Remove, unused.
18772 (output_obstack): Remove it, and all its dependencies, as it is no
18773 longer needed.
18774 * src/reader.c (epilogue_set): Build the epilogue in the
18775 muscle_obstack.
18776 * src/output.h, src/output.c (muscle_obstack): Move to...
18777 * src/muscle_tab.h, src/muscle_tab.h: here.
18778 (muscle_init): Initialize muscle_obstack.
18779 (muscle_free): New.
18780 * src/main.c (main): Call it.
18781
0c15323d
AD
187822002-06-14 Akim Demaille <akim@epita.fr>
18783
18784 * src/location.h: New, extracted from...
18785 * src/reader.h: here.
18786 * src/Makefile.am (noinst_HEADERS): Merge into
18787 (bison_SOURCES): this.
18788 Add location.h.
18789 * src/parse-gram.y: Use location_t instead of Bison's.
18790 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
18791 Use location_t instead of ints.
18792
e96c9728
AD
187932002-06-14 Akim Demaille <akim@epita.fr>
18794
18795 * data/bison.simple, data/bison.c++: Be sure to restore the
18796 current #line when returning to the skeleton contents after having
18797 exposed the input file's #line.
18798
75d1fe16
AD
187992002-06-12 Akim Demaille <akim@epita.fr>
18800
18801 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
18802 eager.
18803 * tests/actions.at (Exotic Dollars): New.
18804
6c35d22c
AD
188052002-06-12 Akim Demaille <akim@epita.fr>
18806
18807 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
18808 ['"/] too eagerly.
18809 * tests/input.at (Torturing the Scanner): New.
18810
1d6412ad
AD
188112002-06-11 Akim Demaille <akim@epita.fr>
18812
18813 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
18814 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
18815 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
18816 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
18817 * src/reader.c (reader): Use it.
18818
4cdb01db
AD
188192002-06-11 Akim Demaille <akim@epita.fr>
18820
18821 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
18822 Adjust all callers.
18823 (scanner_last_string_free): New.
18824
44995b2e
AD
188252002-06-11 Akim Demaille <akim@epita.fr>
18826
18827 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
18828 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
18829 (last_string, YY_OBS_FREE): New.
18830 Use them when returning an ID.
18831
e9955c83
AD
188322002-06-11 Akim Demaille <akim@epita.fr>
18833
18834 Have Bison grammars parsed by a Bison grammar.
18835
18836 * src/reader.c, src/reader.h (prologue_augment): New.
18837 * src/reader.c (copy_definition): Remove.
18838
18839 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
18840 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
18841 (grammar_current_rule_prec_set, grammar_current_rule_check)
18842 (grammar_current_rule_symbol_append)
18843 (grammar_current_rule_action_append): Export.
18844 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
18845 (symbol_list_action_append): Remove.
18846 Hook the routines from reader.
18847 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
18848 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18849
18850 * src/reader.c (read_declarations): Remove, unused.
18851
18852 * src/parse-gram.y: Handle the epilogue.
18853 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
18854 (grammar_start_symbol_set): this.
18855 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
18856 * src/reader.c (readgram): Remove, unused.
18857 (reader): Adjust to insert eoftoken and axiom where appropriate.
18858
18859 * src/reader.c (copy_dollar): Replace with...
18860 * src/scan-gram.h (handle_dollar): this.
18861 * src/parse-gram.y: Remove `%thong'.
18862
18863 * src/reader.c (copy_at): Replace with...
18864 * src/scan-gram.h (handle_at): this.
18865
18866 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
18867 New.
18868
18869 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
18870 time being.
18871
18872 * src/reader.h, src/reader.c (grammar_rule_end): New.
18873
18874 * src/parse.y (current_type, current_class): New.
18875 Implement `%nterm', `%token' support.
18876 Merge `%term' into `%token'.
18877 (string_as_id): New.
18878 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
18879 type name.
18880
18881 * src/parse-gram.y: Be sure to handle properly the beginning of
18882 rules.
18883
18884 * src/parse-gram.y: Handle %type.
18885 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
18886
18887 * src/parse-gram.y: More directives support.
18888 * src/options.c: No longer handle source directives.
18889
18890 * src/parse-gram.y: Fix %output.
18891
18892 * src/parse-gram.y: Handle %union.
18893 Use the prologue locations.
18894 * src/reader.c (parse_union_decl): Remove.
18895
18896 * src/reader.h, src/reader.c (epilogue_set): New.
18897 * src/parse-gram.y: Use it.
18898
18899 * data/bison.simple, data/bison.c++: b4_stype is now either not
18900 defined, then default to int, or to the contents of %union,
18901 without `union' itself.
18902 Adjust.
18903 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
18904
18905 * src/output.c (actions_output): Don't output braces, as they are
18906 already handled by the scanner.
18907
18908 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
18909 characters to themselves.
18910
18911 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
18912 that the epilogue has a proper #line.
18913
18914 * src/parse-gram.y: Handle precedence/associativity.
18915
18916 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
18917 a terminal.
18918 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
18919 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
18920 at all to define terminals that cannot be emitted.
18921
18922 * src/scan-gram.l: Escape M4 characters.
18923
18924 * src/scan-gram.l: Working properly with escapes in user
18925 strings/characters.
18926
18927 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
18928 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
18929 grammar.
18930 Use more modest sizes, as for the time being the parser does not
18931 release memory, and therefore the process swallows a huge amount
18932 of memory.
18933
18934 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
18935 stricter %token grammar.
18936
18937 * src/symtab.h (associativity): Add `undef_assoc'.
18938 (symbol_precedence_set): Do nothing when passed an undef_assoc.
18939 * src/symtab.c (symbol_check_alias_consistence): Adjust.
18940
18941 * tests/regression.at (Invalid %directive): Remove, as it is now
18942 meaningless.
18943 (Invalid inputs): Adjust to the new error messages.
18944 (Token definitions): The new grammar doesn't allow too many
18945 eccentricities.
18946
18947 * src/lex.h, src/lex.c: Remove.
18948 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
18949 (copy_character, copy_string2, copy_string, copy_identifier)
18950 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
18951 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
18952 (parse_action): Remove.
18953 * po/POTFILES.in: Adjust.
18954
2e047461
AD
189552002-06-11 Akim Demaille <akim@epita.fr>
18956
cd05d13c 18957 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
18958 rule's action member: return the action as a string.
18959 Don't require `rule_length' as an argument: compute it.
18960 (grammar_current_rule_symbol_append)
18961 (grammar_current_rule_action_append): New, eved out from
18962 (readgram): here.
18963 Remove `action_flag', `rulelength', unused now.
18964
9af3fbce
AD
189652002-06-11 Akim Demaille <akim@epita.fr>
18966
18967 * src/reader.c (grammar_current_rule_prec_set).
18968 (grammar_current_rule_check): New, eved out from...
18969 (readgram): here.
18970 Remove `xaction', `first_rhs': useless.
18971 * tests/input.at (Type clashes): New.
18972 * tests/existing.at (GNU Cim Grammar): Adjust.
18973
1485e106
AD
189742002-06-11 Akim Demaille <akim@epita.fr>
18975
18976 * src/reader.c (grammar_midrule_action): New, Eved out from
18977 (readgram): here.
18978
da4160c3
AD
189792002-06-11 Akim Demaille <akim@epita.fr>
18980
18981 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
18982 New.
18983 (readgram): Use them as replacement of inlined code, crule and
18984 crule1.
18985
f6d0f937
AD
189862002-06-11 Akim Demaille <akim@epita.fr>
18987
18988 * src/reader.c (grammar_end, grammar_symbol_append): New.
18989 (readgram): Use them.
18990 Make the use of `p' as local as possible.
18991
69078d4b
AD
189922002-06-10 Akim Demaille <akim@epita.fr>
18993
18994 GCJ's parser requires the tokens to be defined before the prologue.
18995
18996 * data/bison.simple: Output the token definition before the user's
18997 prologue.
18998 * tests/regression.at (Braces parsing, Duplicate string)
18999 (Mixing %token styles): Check the output from bison.
19000 (Early token definitions): New.
19001
5e424082
AD
190022002-06-10 Akim Demaille <akim@epita.fr>
19003
19004 * src/symtab.c (symbol_user_token_number_set): Don't complain when
19005 assigning twice the same user number to a token, so that we can
19006 use it in...
19007 * src/lex.c (lex): here.
19008 Also use `symbol_class_set' instead of hand written code.
19009 * src/reader.c (parse_assoc_decl): Likewise.
19010
44536b35
AD
190112002-06-10 Akim Demaille <akim@epita.fr>
19012
19013 * src/symtab.c, src/symtab.c (symbol_class_set)
19014 (symbol_user_token_number_set): New.
19015 * src/reader.c (parse_token_decl): Use them.
19016 Use a switch instead of ifs.
19017 Use a single argument.
19018
8b9f2372
AD
190192002-06-10 Akim Demaille <akim@epita.fr>
19020
19021 Remove `%thong' support as it is undocumented, unused, duplicates
19022 `%token's job, and creates useless e-mail traffic with people who
19023 want to know what it is, why it is undocumented, unused, and
19024 duplicates `%token's job.
19025
19026 * src/reader.c (parse_thong_decl): Remove.
19027 * src/options.c (option_table): Remove "thong".
19028 * src/lex.h (tok_thong): Remove.
19029
3ae2b51f
AD
190302002-06-10 Akim Demaille <akim@epita.fr>
19031
19032 * src/symtab.c, src/symtab.c (symbol_type_set)
19033 (symbol_precedence_set): New.
19034 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
19035 (value_components_used): Remove, unused.
19036
2f1afb73
AD
190372002-06-09 Akim Demaille <akim@epita.fr>
19038
19039 Move symbols handling code out of the reader.
19040
19041 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
19042 (axiom): Move to...
19043 * src/symtab.h, src/symtab.c: here.
19044
19045 * src/gram.c (start_symbol): Remove: use startsymbol->number.
19046 * src/reader.c (startval): Rename as...
19047 * src/symtab.h, src/symtab.c (startsymbol): this.
19048 * src/reader.c: Adjust.
19049
19050 * src/reader.c (symbol_check_defined, symbol_make_alias)
19051 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19052 (token_translations_init)
19053 Move to...
19054 * src/symtab.c: here.
19055 * src/reader.c (packsymbols): Move to...
19056 * src/symtab.h, src/symtab.c (symbols_pack): here.
19057 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
19058 argument.
19059
e9bca3ad
AD
190602002-06-03 Akim Demaille <akim@epita.fr>
19061
19062 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
19063 then statements.
19064
86eff183
AD
190652002-06-03 Akim Demaille <akim@epita.fr>
19066
19067 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
19068 structs with non literals.
19069 * src/scan-skel.l: never-interactive.
19070 * src/conflicts.c (enum conflict_resolution_e): No trailing
19071 comma.
19072 * src/getargs.c (usage): Split long literal strings.
19073 Reported by Hans Aberg.
19074
717be197
AD
190752002-05-28 Akim Demaille <akim@epita.fr>
19076
19077 * data/bison.c++: Use C++ ostreams.
19078 (cdebug_): New member.
19079
670ddffd
AD
190802002-05-28 Akim Demaille <akim@epita.fr>
19081
19082 * src/output.c (output_skeleton): Be sure to allocate enough room
19083 for `/' _and_ for `\0' in full_skeleton.
19084
769b430f
AD
190852002-05-28 Akim Demaille <akim@epita.fr>
19086
19087 * data/bison.c++: Catch up with bison.simple:
19088 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19089 and Paul Eggert <eggert@twinsun.com>: `error' handing.
19090 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
19091 and popping traces.
19092
7067cb36
PH
190932002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19094
19095 * src/output.c (output_skeleton): Put an explicit path in front of
19096 the skeleton file name, rather than relying on the -I directory,
19097 to partially alleviate effects of having a skeleton file lying around
19098 in the current directory.
769b430f 19099
4a713ec2
PH
191002002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19101
769b430f 19102 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
19103 obstack_printf should be obstack_fgrow1.
19104
b408954b
AD
191052002-05-26 Akim Demaille <akim@epita.fr>
19106
19107 * src/state.h (state_t): `solved_conflicts' is a new member.
19108 * src/LR0.c (new_state): Set it to 0.
19109 * src/conflicts.h, src/conflicts.c (print_conflicts)
19110 (free_conflicts, solve_conflicts): Rename as...
19111 (conflicts_print, conflicts_free, conflicts_solve): these.
19112 Adjust callers.
19113 * src/conflicts.c (enum conflict_resolution_e)
19114 (solved_conflicts_obstack): New, used by...
19115 (log_resolution): this.
19116 Adjust to attach the conflict resolution to each state.
19117 Complete the description with the precedence/associativity
19118 information.
19119 (resolve_sr_conflict): Adjust.
19120 * src/print.c (print_state): Output its solved_conflicts.
19121 * tests/conflicts.at (Unresolved SR Conflicts)
19122 (Solved SR Conflicts): Exercise --report=all.
19123
a49aecd5
AD
191242002-05-26 Akim Demaille <akim@epita.fr>
19125
19126 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19127 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19128 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
19129 (token_number_t, item_number_as_token_number)
19130 (token_number_as_item_number, muscle_insert_token_number_table):
19131 Rename as...
19132 (symbol_number_t, item_number_as_symbol_number)
19133 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
19134 these, since it is more appropriate.
19135
5504898e
AD
191362002-05-26 Akim Demaille <akim@epita.fr>
19137
19138 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
19139 `Error:' lines.
19140 * data/bison.simple (yystos) [YYDEBUG]: New.
19141 (yyparse) [YYDEBUG]: Display the symbols which are popped during
19142 error recovery.
19143 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
19144
ec3bc396
AD
191452002-05-25 Akim Demaille <akim@epita.fr>
19146
19147 * doc/bison.texinfo (Debugging): Split into...
19148 (Tracing): this new section, its former contents, and...
19149 (Understanding): this new section.
19150 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
19151 by...
19152 (report_flag): this.
19153 Adjust all dependencies.
19154 (report_args, report_types, report_argmatch): New.
19155 (usage, getargs): Report/support -r, --report.
19156 * src/options.h
19157 (struct option_table_struct): Rename as..,
19158 (struct option_table_s): this.
19159 Rename the `set_flag' member to `flag' to match with getopt_long's
19160 struct.
19161 * src/options.c (option_table): Split verbose into an entry for
19162 %verbose, and another for --verbose.
19163 Support --report/-r, so remove -r from the obsolete --raw.
19164 * src/print.c: Attach full item sets and lookaheads reports to
19165 report_flag instead of trace_flag.
19166 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
19167
78df8250
PE
191682002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19169 and Paul Eggert <eggert@twinsun.com>
769b430f 19170
78df8250
PE
19171 * data/bison.simple (yyparse): Correct error handling to conform to
19172 POSIX and yacc. Specifically, after syntax error is discovered,
19173 do not reduce further before shifting the error token.
19174 Clean up the code a bit by removing the labels yyerrdefault,
19175 yyerrhandle, yyerrpop.
19176 * NEWS: Document the above.
19177
c0c9ea05
PH
191782002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19179
19180 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
19181 type; it isn't always big enough, since it doesn't necessarily
19182 include non-terminals.
769b430f 19183 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
19184 the latter can be removed.
19185 (yy_token_number_type): Remove, only one use.
19186 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
19187 don't use TokenNumberType as element type.
769b430f 19188
c0c9ea05
PH
19189 * tests/regression.at: Modify expected output to agree with change
19190 to yyr1 and yytranslate.
769b430f 19191
6390a83f
FK
191922002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
19193
19194 * src/reader.c (parse_action): Use copy_character instead of
19195 obstack_1grow.
19196
db7c8e9a
AD
191972002-05-13 Akim Demaille <akim@epita.fr>
19198
19199 * tests/regression.at (Token definitions): Prototype yylex and
19200 yyerror.
19201
fcc61800
PH
192022002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19203
158c687b 19204 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
19205 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
19206 32-bit arithmetic.
19207 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
19208
5683e9b2
AD
192092002-05-07 Akim Demaille <akim@epita.fr>
19210
19211 * tests/synclines.at: Be sure to prototype yylex and yyerror to
19212 avoid GCC warnings.
19213
0c2d3f4c
AD
192142002-05-07 Akim Demaille <akim@epita.fr>
19215
19216 Kill GCC warnings.
19217
19218 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
19219 over the RHS of each rule.
19220 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
19221 * src/state.h (state_t): Member `nitems' is unsigned short.
19222 * src/LR0.c (get_state): Adjust.
19223 * src/reader.c (packgram): Likewise.
19224 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
19225 `Type'.
19226 (muscle_insert_int_table): Remove, unused.
19227 (prepare_rules): Remove `max'.
19228
1565b720
AD
192292002-05-06 Akim Demaille <akim@epita.fr>
19230
19231 * src/closure.c (print_firsts): Display of the symbol tags.
19232 (bitmatrix_print): Move to...
19233 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
19234 here.
19235 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
19236
cfaee611
AD
192372002-05-06 Akim Demaille <akim@epita.fr>
19238
19239 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
19240 hash_do_for_each.
19241
458be8e0
AD
192422002-05-06 Akim Demaille <akim@epita.fr>
19243
19244 * src/LR0.c (new_state, get_state): Instead of using the global
19245 `kernel_size' and `kernel_base', have two new arguments:
19246 `core_size' and `core'.
19247 Adjust callers.
19248
a900a624
AD
192492002-05-06 Akim Demaille <akim@epita.fr>
19250
19251 * src/reader.c (packgram): No longer end `ritem' with a 0
19252 sentinel: it is not used.
19253
d4e7d3a1
AD
192542002-05-05 Akim Demaille <akim@epita.fr>
19255
19256 New experimental feature: display the lookaheads in the report and
19257 graph.
19258
19259 * src/print (print_core): When --trace-flag, display the rules
19260 lookaheads.
19261 * src/print_graph.c (print_core): Likewise.
19262 Swap the arguments.
19263 Adjust caller.
19264
39ceb25b
AD
192652002-05-05 Akim Demaille <akim@epita.fr>
19266
19267 * tests/torture.at (Many lookaheads): New test.
19268
5372019f
AD
192692002-05-05 Akim Demaille <akim@epita.fr>
19270
19271 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
19272 (GENERATE_MUSCLE_INSERT_TABLE): this.
19273 (output_int_table, output_unsigned_int_table, output_short_table)
19274 (output_token_number_table, output_item_number_table): Replace with...
19275 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
19276 (muscle_insert_short_table, muscle_insert_token_number_table)
19277 (muscle_insert_item_number_table): these.
19278 Adjust all callers.
19279 (prepare_tokens): Don't free `translations', since...
19280 * src/reader.h, src/reader.c (grammar_free): do it.
19281 Move to...
19282 * src/gram.h, src/gram.c (grammar_free): here.
19283 * data/bison.simple, data/bison.c++: b4_token_number_max is now
19284 b4_translate_max.
19285
5df5f6d5
AD
192862002-05-05 Akim Demaille <akim@epita.fr>
19287
19288 * src/output.c (output_unsigned_int_table): New.
19289 (prepare_rules): `i' is unsigned.
19290 `prhs', `rline', `r2' are unsigned int.
19291 Rename muscle `rhs_number_max' as `rhs_max'.
19292 Output muscles `prhs_max', `rline_max', and `r2_max'.
19293 Free rline and r1.
19294 * data/bison.simple, data/bison.c++: Adjust to use these muscles
19295 to compute types instead of constant types.
19296 * tests/regression.at (Web2c Actions): Adjust.
19297
b87f8b21
AD
192982002-05-04 Akim Demaille <akim@epita.fr>
19299
19300 * src/symtab.h (SALIAS, SUNDEF): Rename as...
19301 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
19302 Adjust dependencies.
19303 * src/output.c (token_definitions_output): Be sure not to output a
19304 `#define 'a'' when fed with `%token 'a' "a"'.
19305 * tests/regression.at (Token definitions): New.
19306
8bb936e4
PE
193072002-05-03 Paul Eggert <eggert@twinsun.com>
19308
19309 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
19310 for K&R C.
19311
193122002-05-03 gettextize <bug-gnu-gettext@gnu.org>
19313
19314 * Makefile.am (SUBDIRS): Remove intl.
19315 (EXTRA_DIST): Add config/config.rpath.
19316
53c71a12
AD
193172002-05-03 Akim Demaille <akim@epita.fr>
19318
19319 * data/bison.simple (m4_if): Don't output empty enums.
19320 And actually, output valid enum definitions :(.
19321
289dd0cf
AD
193222002-05-03 Akim Demaille <akim@epita.fr>
19323
19324 * configure.bat: Remove, completely obsolete.
19325 * Makefile.am (EXTRA_DIST): Adjust.
19326 Don't distribute config.rpath...
19327 * config/Makefile.am (EXTRA_DIST): Do it.
19328
db85e524
AD
193292002-05-03 Akim Demaille <akim@epita.fr>
19330
19331 * configure.in (GETTEXT_VERSION): New.
19332 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
19333
83ccf991
AD
193342002-05-03 Akim Demaille <akim@epita.fr>
19335
19336 * data/bison.simple (b4_token_enum): New.
19337 (b4_token_defines): Use it to output tokens both as #define and
19338 enums.
19339 Suggested by Paul Eggert.
19340 * src/output.c (token_definitions_output): Don't output spurious
19341 white spaces.
19342
1f418995
AD
193432002-05-03 Akim Demaille <akim@epita.fr>
19344
19345 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19346
45119f04
RA
193472002-05-02 Robert Anisko <robert@lrde.epita.fr>
19348
19349 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
19350 Update the stack class, give a try to deque as the default container.
19351
b2d52318
AD
193522002-05-02 Akim Demaille <akim@epita.fr>
19353
19354 * data/bison.simple (yyparse): Do not implement @$ = @1.
19355 (YYLLOC_DEFAULT): Adjust to do it.
19356 * doc/bison.texinfo (Location Default Action): Fix.
19357
3a8b4109
AD
193582002-05-02 Akim Demaille <akim@epita.fr>
19359
19360 * src/reader.c (parse_braces): Merge into...
19361 (parse_action): this.
19362
84614e13
AD
193632002-05-02 Akim Demaille <akim@epita.fr>
19364
19365 * configure.in (ALL_LINGUAS): Remove.
19366 * po/LINGUAS, hr.po: New.
19367
fdbcd8e2
AD
193682002-05-02 Akim Demaille <akim@epita.fr>
19369
19370 Remove the so called hairy (semantic) parsers.
19371
19372 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
19373 * src/gram.h, src/gram.c (semantic_parser): Remove.
19374 (rule_t): Remove the guard and guard_line members.
19375 * src/lex.h (token_t): remove tok_guard.
19376 * src/options.c (option_table): Remove %guard and %semantic_parser
19377 support.
19378 * src/output.c, src/output.h (guards_output): Remove.
19379 (prepare): Adjust.
19380 (token_definitions_output): Don't output the `T'
19381 tokens (???).
19382 (output_skeleton): Don't output the guards.
19383 * src/files.c, src/files.c (attrsfile): Remove.
19384 * src/reader.c (symbol_list): Remove the guard and guard_line
19385 members.
19386 Adjust dependencies.
19387 (parse_guard): Remove.
19388 * data/bison.hairy: Remove.
19389 * doc/bison.texinfo (Environment Variables): Remove occurrences of
19390 BISON_HAIRY.
19391
82b6cb3f
AD
193922002-05-02 Akim Demaille <akim@epita.fr>
19393
19394 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
19395 (parse_guard): Rename the formal argument `stack_offset' as
19396 `rule_length', which is more readable.
19397 Adjust callers.
19398 (copy_at, copy_dollar): Instead of outputting the hard coded
19399 values of $$, $n and so forth, output invocation to b4_lhs_value,
19400 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
19401 Note: this patch partially drops `semantic-parser' support: it
19402 always does `rule_length - n', where semantic parsers ought to
19403 always use `-n'.
82b6cb3f
AD
19404 * data/bison.simple, data/bison.c++ (b4_lhs_value)
19405 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
19406
6cbfbcc5
AD
194072002-05-02 Akim Demaille <akim@epita.fr>
19408
19409 * configure.in (AC_INIT): Bump to 1.49b.
19410 (AM_INIT_AUTOMAKE): Short invocation.
19411
b8548114
AD
194122002-05-02 Akim Demaille <akim@epita.fr>
19413
19414 Version 1.49a.
19415
c20cd1fa
AD
194162002-05-01 Akim Demaille <akim@epita.fr>
19417
19418 * src/skeleton.h: Remove.
19419
8a9566d4
AD
194202002-05-01 Akim Demaille <akim@epita.fr>
19421
19422 * src/skeleton.h: Fix the #endif.
19423 Reported by Magnus Fromreide.
19424
8c6d399a
PE
194252002-04-26 Paul Eggert <eggert@twinsun.com>
19426
19427 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
19428 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 19429 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 19430
2b7ed18a
RA
194312002-04-25 Robert Anisko <robert@lrde.epita.fr>
19432
19433 * src/scan-skel.l: Postprocess quadrigraphs.
19434
19435 * src/reader.c (copy_character): New function, used to output
19436 single characters while replacing `[' and `]' with quadrigraphs, to
19437 avoid troubles with M4 quotes.
19438 (copy_comment): Output characters with copy_character.
19439 (read_additionnal_code): Likewise.
19440 (copy_string2): Likewise.
19441 (copy_definition): Likewise.
19442
19443 * tests/calc.at: Exercise M4 quoting.
19444
34a89c50
AD
194452002-04-25 Akim Demaille <akim@epita.fr>
19446
19447 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
19448 between `!' and the command.
19449 Reported by Paul Eggert.
19450
0dd1580a
RA
194512002-04-24 Robert Anisko <robert@lrde.epita.fr>
19452
19453 * tests/calc.at: Exercise prologue splitting.
19454
19455 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
19456 `b4_post_prologue' instead of `b4_prologue'.
19457
19458 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
19459 muscles.
19460 (output): Free pre_prologue_obstack and post_prologue_obstack.
19461 * src/files.h, src/files.c (attrs_obstack): Remove.
19462 (pre_prologue_obstack, post_prologue_obstack): New.
19463 * src/reader.c (copy_definition): Add a parameter to specify the
19464 obstack to fill, instead of using attrs_obstack unconditionally.
19465 (read_declarations): Pass pre_prologue_obstack to copy_definition if
19466 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
19467
83c1796f
PE
194682002-04-23 Paul Eggert <eggert@twinsun.com>
19469
19470 * data/bison.simple: Remove unnecessary commentary and white
19471 space differences from 1_29-branch.
19472 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
19473
19474 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
19475 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
19476 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
19477 constructors or destructors.
19478
19479 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
19480
1207eeac
AD
194812002-04-23 Akim Demaille <akim@epita.fr>
19482
19483 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
19484 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
19485 location with columns.
19486 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
19487 All reported by Paul Eggert.
19488
78ab8f67
AD
194892002-04-22 Akim Demaille <akim@epita.fr>
19490
19491 * src/reduce.c (dump_grammar): Move to...
19492 * src/gram.h, src/gram.c (grammar_dump): here.
19493 Be sure to separate long item numbers.
19494 Don't read the members of a rule's prec if its nil.
19495
133c20e2
AD
194962002-04-22 Akim Demaille <akim@epita.fr>
19497
19498 * src/output.c (table_size, table_grow): New.
19499 (MAXTABLE): Remove, replace uses with table_size.
19500 (pack_vector): Instead of dying when the table is too big, grow it.
19501
9515e8a7
AD
195022002-04-22 Akim Demaille <akim@epita.fr>
19503
19504 * data/bison.simple (yyr1): Its type is that of a token number.
19505 * data/bison.c++ (r1_): Likewise.
19506 * tests/regression.at (Web2c Actions): Adjust.
19507
23c5a174
AD
195082002-04-22 Akim Demaille <akim@epita.fr>
19509
19510 * src/reader.c (token_translations_init): 256 is now the default
19511 value for the error token, i.e., it will be assigned another
19512 number if the user assigned 256 to one of her tokens.
19513 (reader): Don't force 256 to error.
19514 * doc/bison.texinfo (Symbols): Adjust.
19515 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
19516 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
19517 etc. instead of 10, 20, 30 (which was used to `jump' over error
19518 (256) and undefined (2)).
19519
5fbb0954
AD
195202002-04-22 Akim Demaille <akim@epita.fr>
19521
19522 Propagate more token_number_t.
19523
19524 * src/gram.h (token_number_as_item_number)
19525 (item_number_as_token_number): New.
19526 * src/output.c (GENERATE_OUTPUT_TABLE): New.
19527 Use it to create output_item_number_table and
19528 output_token_number_table.
19529 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19530 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
19531 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
19532 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
19533
4f940944
AD
195342002-04-22 Akim Demaille <akim@epita.fr>
19535
19536 * src/output.h, src/output.c (get_lines_number): Remove.
19537
3ded9a63
AD
195382002-04-19 Akim Demaille <akim@epita.fr>
19539
19540 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
19541 as Lex/Flex'.
19542 (Debugging): More details about enabling the debugging features.
19543 (Table of Symbols): Describe $$, $n, @$, and @n.
19544 Suggested by Tim Josling.
19545
e0c471a9
AD
195462002-04-19 Akim Demaille <akim@epita.fr>
19547
19548 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
19549
fecc10cd
AD
195502002-04-10 Akim Demaille <akim@epita.fr>
19551
19552 * src/system.h: Rely on HAVE_LIMITS_H.
19553 Suggested by Paul Eggert.
19554
51dec47b
AD
195552002-04-09 Akim Demaille <akim@epita.fr>
19556
19557 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
19558 full stderr, and strip it according to the bison options, instead
19559 of composing the error message from different bits.
19560 This makes it easier to check for several error messages.
19561 Adjust all the invocations.
19562 Add an invocation exercising the error token.
19563 Add an invocation demonstrating a stupid error message.
19564 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
19565 Adjust the tests.
19566 Error message are for stderr, not stdout.
19567
007a50a4
AD
195682002-04-09 Akim Demaille <akim@epita.fr>
19569
19570 * src/gram.h, src/gram.c (error_token_number): Remove, use
19571 errtoken->number.
19572 * src/reader.c (reader): Don't specify the user token number (2)
19573 for $undefined, as it uselessly prevents using it.
19574 * src/gram.h (token_number_t): Move to...
19575 * src/symtab.h: here.
19576 (state_t.number): Is a token_number_t.
19577 * src/print.c, src/reader.c: Use undeftoken->number instead of
19578 hard coded 2.
19579 (Even though this 2 is not the same as above: the number of the
19580 undeftoken remains being 2, it is its user token number which
19581 might not be 2).
19582 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
19583 `user_token_number_max'.
19584 Output `undef_token_number'.
19585 * data/bison.simple, data/bison.c++: Use them.
19586 Be sure to map invalid yylex return values to
19587 `undef_token_number'. This saves us from gratuitous SEGV.
19588
19589 * tests/conflicts.at (Solved SR Conflicts)
19590 (Unresolved SR Conflicts): Adjust.
19591 * tests/regression.at (Web2c Actions): Adjust.
19592
06446ccf
AD
195932002-04-08 Akim Demaille <akim@epita.fr>
19594
19595 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
19596 Adding #line.
19597 Remove the duplicate `typedefs'.
19598 (RhsNumberType): Fix the declaration and various other typos.
19599 Use __ofile__.
19600 * data/bison.simple: Use __ofile__.
19601 * src/scan-skel.l: Handle __ofile__.
19602
62a3e4f0
AD
196032002-04-08 Akim Demaille <akim@epita.fr>
19604
19605 * src/gram.h (item_number_t): New, the type of item numbers in
19606 RITEM. Note that it must be able to code symbol numbers as
19607 positive number, and the negation of rule numbers as negative
19608 numbers.
19609 Adjust all dependencies (pretty many).
19610 * src/reduce.c (rule): Remove this `short *' pointer: use
19611 item_number_t.
19612 * src/system.h (MINSHORT, MAXSHORT): Remove.
19613 Include `limits.h'.
19614 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
19615 (shortcpy): Remove.
19616 (MAXTABLE): Move to...
19617 * src/output.c (MAXTABLE): here.
19618 (prepare_rules): Use output_int_table to output rhs.
19619 * data/bison.simple, data/bison.c++: Adjust.
19620 * tests/torture.at (Big triangle): Move the limit from 254 to
19621 500.
19622 * tests/regression.at (Web2c Actions): Ajust.
19623
19624 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
19625 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
19626 passes, but produces negative #line number, once fixed, GCC is
19627 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
19628 C), it passes.
19629 * src/state.h (state_h): Code input lines on ints, not shorts.
19630
bb88b0fc
AD
196312002-04-08 Akim Demaille <akim@epita.fr>
19632
19633 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
19634 and then the grammar.
19635
9a636f47
AD
196362002-04-08 Akim Demaille <akim@epita.fr>
19637
19638 * src/system.h: No longer using strndup.
19639
680e8701
AD
196402002-04-07 Akim Demaille <akim@epita.fr>
19641
19642 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
19643 * src/output.c (output_table_data): Return the longest number.
19644 (prepare_tokens): Output `token_number_max').
19645 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
19646 New.
19647 Use them to define yy_token_number_type/TokenNumberType.
19648 Use this type for yytranslate.
19649 * tests/torture.at (Big triangle): Push the limit from 124 to
19650 253.
19651 * tests/regression.at (Web2c Actions): Adjust.
19652
817e9f41
AD
196532002-04-07 Akim Demaille <akim@epita.fr>
19654
19655 * tests/torture.at (Big triangle): New.
19656 (GNU AWK Grammar, GNU Cim Grammar): Move to...
19657 * tests/existing.at: here.
19658
5123689b
AD
196592002-04-07 Akim Demaille <akim@epita.fr>
19660
19661 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
19662 nritems.
19663 Adjust dependencies.
19664
f3849179
AD
196652002-04-07 Akim Demaille <akim@epita.fr>
19666
19667 * src/reader.c: Normalize increments to prefix form.
19668
bd02036a
AD
196692002-04-07 Akim Demaille <akim@epita.fr>
19670
19671 * src/reader.c, symtab.c: Remove debugging code.
19672
db8837cb
AD
196732002-04-07 Akim Demaille <akim@epita.fr>
19674
19675 Rename all the `bucket's as `symbol_t'.
19676
19677 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
19678 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
19679 * src/symtab.c, src/symtab.h (bucket): Rename as...
19680 (symbol_t): this.
19681 (symbol_list_new, bucket_check_defined, bucket_make_alias)
19682 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
19683 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19684 (buckets_new, buckets_free, buckets_do): Rename as...
19685 (symbol_list_new, symbol_check_defined, symbol_make_alias)
19686 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19687 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
19688 (symbols_new, symbols_free, symbols_do): these.
19689
72a23c97
AD
196902002-04-07 Akim Demaille <akim@epita.fr>
19691
19692 Use lib/hash for the symbol table.
19693
19694 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
19695 EOF.
19696 * src/lex.c (lex): Set the `number' member of new terminals.
19697 * src/reader.c (bucket_check_defined, bucket_make_alias)
19698 (bucket_check_alias_consistence, bucket_translation): New.
19699 (reader, grammar_free, readgram, token_translations_init)
19700 (packsymbols): Adjust.
19701 (reader): Number the predefined tokens.
19702 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
19703 for predefined tokens.
19704 * src/symtab.h (bucket): Remove all the hash table related
19705 members.
19706 * src/symtab.c (symtab): Replace by...
19707 (bucket_table): this.
19708 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19709 (buckets_new, buckets_do): New.
19710
280a38c3
AD
197112002-04-07 Akim Demaille <akim@epita.fr>
19712
19713 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
19714 (start_symbol, max_user_token_number, semantic_parser)
19715 (error_token_number): Initialize.
19716 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
19717 Initialize.
19718 (reader): Don't.
19719 (errtoken, eoftoken, undeftoken, axiom): Extern.
19720
03b31c0c
AD
197212002-04-07 Akim Demaille <akim@epita.fr>
19722
19723 * src/gram.h (rule_s): prec and precsym are now pointers
19724 to the bucket giving the priority/associativity.
19725 Member `associativity' removed: useless.
19726 * src/reduce.c, src/conflicts.c: Adjust.
19727
8b3df748
AD
197282002-04-07 Akim Demaille <akim@epita.fr>
19729
19730 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
19731 Properly escape the symbols' TAG when outputting them.
19732
e601aa1d
AD
197332002-04-07 Akim Demaille <akim@epita.fr>
19734
19735 * src/lalr.h (LA): Is a bitsetv, not bitset*.
19736
b0299a2e
AD
197372002-04-07 Akim Demaille <akim@epita.fr>
19738
19739 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
19740 (LArule): this, which is an array to rule_t*.
19741 * src/print.c, src/conflicts.c: Adjust.
19742
d7e1f00c
AD
197432002-04-07 Akim Demaille <akim@epita.fr>
19744
19745 * src/gram.h (rule_t): Rename `number' as `user_number'.
19746 `number' is a new member.
19747 Adjust dependencies.
19748 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
19749
cc9305dd
AD
197502002-04-07 Akim Demaille <akim@epita.fr>
19751
19752 As a result of the previous patch, it is no longer needed
19753 to reorder ritem itself.
19754
19755 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
19756
b0940840
AD
197572002-04-07 Akim Demaille <akim@epita.fr>
19758
19759 Be sure never to walk through RITEMS, but use only data related to
19760 the rules themselves. RITEMS should be banished.
19761
19762 * src/output.c (output_token_translations): Rename as...
19763 (prepare_tokens): this.
19764 In addition to `translate', prepare the muscles `tname' and
19765 `toknum', which were handled by...
19766 (output_rule_data): this.
19767 Remove, and move the remainder of its outputs into...
19768 (prepare_rules): this new routines, which also merges content from
19769 (output_gram): this.
19770 (prepare_rules): Be sure never to walk through RITEMS.
19771 (output_stos): Rename as...
19772 (prepare_stos): this.
19773 (output): Always invoke prepare_states, after all, just don't use it
19774 in the output if you don't need it.
19775
643a5994
AD
197762002-04-07 Akim Demaille <akim@epita.fr>
19777
19778 * src/LR0.c (new_state): Display `nstates' as the name of the
19779 newly created state.
19780 Adjust to initialize first_state and last_state if needed.
19781 Be sure to distinguish the initial from the final state.
19782 (new_states): Create the itemset of the initial state, and use
19783 new_state.
19784 * src/closure.c (closure): Now that the initial state has its
19785 items properly set, there is no need for a special case when
19786 creating `ruleset'.
19787
19788 As a result, now the rule 0, reducing to $axiom, is visible in the
19789 outputs. Adjust the test suite.
19790
19791 * tests/conflicts.at (Solved SR Conflicts)
19792 (Unresolved SR Conflicts): Adjust.
19793 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
19794 * tests/conflicts.at (S/R in initial): New.
19795
b4c4ccc2
AD
197962002-04-07 Akim Demaille <akim@epita.fr>
19797
19798 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
19799 the RHS of the rules.
19800 * src/output.c (output_gram): Likewise.
19801
bba97eb2
AD
198022002-04-07 Akim Demaille <akim@epita.fr>
19803
19804 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
19805 bucket.
19806 Adjust all dependencies.
19807 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
19808 `number' of the buckets too.
19809 * src/gram.h: Include `symtab.h'.
19810 (associativity): Move to...
19811 * src/symtab.h: here.
19812 No longer include `gram.h'.
19813
c3b407f4
AD
198142002-04-07 Akim Demaille <akim@epita.fr>
19815
19816 * src/gram.h, src/gram.c (rules_rhs_length): New.
19817 (ritem_longest_rhs): Use it.
19818 * src/gram.h (rule_t): `number' is a new member.
19819 * src/reader.c (packgram): Set it.
19820 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
19821 the end of `rules', and count them out of `nrules'.
19822 (reduce_output, dump_grammar): Adjust.
19823 * src/print.c (print_grammar): It is no longer needed to check for
19824 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
19825 * tests/reduce.at (Reduced Automaton): New test.
19826
11652ab3
AD
198272002-04-07 Akim Demaille <akim@epita.fr>
19828
19829 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
19830 lacking `+ 1' to nrules, Bison reported as useless a token if it
19831 was used solely to set the precedence of the last rule...
19832
26b23c1a
AD
198332002-04-07 Akim Demaille <akim@epita.fr>
19834
19835 * data/bison.c++, data/bison.simple: Don't output the current file
19836 name in #line, to avoid useless diffs between two identical
19837 outputs under different names.
19838
18bcecb0
AD
198392002-04-07 Akim Demaille <akim@epita.fr>
19840
19841 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
19842 Normalize loops to using `< nrules + 1', not `<= nrules'.
19843
fa770c86
AD
198442002-04-07 Akim Demaille <akim@epita.fr>
19845
19846 * TODO: Update.
19847
d9b739c3
AD
198482002-04-07 Akim Demaille <akim@epita.fr>
19849
19850 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
19851 bucket.value as bucket.number.
19852
99013900
AD
198532002-04-07 Akim Demaille <akim@epita.fr>
19854
19855 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
19856 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19857 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
19858 RHS, instead of being an index in RITEMS.
19859
e966383b
PE
198602002-04-04 Paul Eggert <eggert@twinsun.com>
19861
19862 * doc/bison.texinfo: Update copyright date.
19863 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
19864 (Symbols): Warn about running Bison in one character set,
19865 but compiling and/or running in an incompatible one.
19866 Warn about character code 256, too.
19867
198682002-04-03 Paul Eggert <eggert@twinsun.com>
19869
19870 * src/bison.data (YYSTACK_ALLOC): Depend on whether
19871 YYERROR_VERBOSE is nonzero, not whether it is defined.
19872
19873 Merge changes from bison-1_29-branch.
c307773e 19874
8d6c48b9
PE
198752002-03-20 Paul Eggert <eggert@twinsun.com>
19876
19877 Merge fixes from Debian bison_1.34-1.diff.
19878
19879 * configure.in (AC_PREREQ): 2.53.
19880
e53c6322
AD
198812002-03-20 Akim Demaille <akim@epita.fr>
19882
19883 * src/conflicts.c (log_resolution): Argument `resolution' is const.
19884
9ffbeca7
PE
198852002-03-19 Paul Eggert <eggert@twinsun.com>
19886
21db0b2a
PE
19887 * src/bison.simple (YYCOPY): New macro.
19888 (YYSTACK_RELOCATE): Use it.
19889 Remove Type arg; no longer needed. All callers changed.
19890 (yymemcpy): Remove; no longer needed.
19891
9ffbeca7
PE
19892 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
19893 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
19894
642cb8f8
AD
198952002-03-19 Akim Demaille <akim@epita.fr>
19896
19897 Test and fix the #line outputs.
19898
19899 * tests/atlocal.at (GCC): New.
19900 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 19901 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
19902 (Action synch line, Epilogue synch line): New tests.
19903 * src/reader.c (parse_union_decl): Define the muscle stype_line.
19904 * data/bison.simple, data/bison.c++: Use it.
19905
3c31a486
AD
199062002-03-19 Akim Demaille <akim@epita.fr>
19907
19908 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
19909 (Solved SR Conflicts, %expect not enough, %expect right)
19910 (%expect too much): Move to...
19911 * tests/conflicts.at: this new file.
19912
0d8bed56
AD
199132002-03-19 Akim Demaille <akim@epita.fr>
19914
19915 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19916 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
19917 that we can move to enums for instance.
19918 * src/output.c (token_definitions_output): Output a list of
19919 `token-name, token-number' instead of the #define.
19920 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
19921
9208d17f
AD
199222002-03-14 Akim Demaille <akim@epita.fr>
19923
19924 Use Gettext 0.11.1.
19925
af27eacb
RA
199262002-03-09 Robert Anisko <robert@lrde.epita.fr>
19927
19928 * data/bison.c++: Make the user able to add members to the generated
19929 parser by subclassing.
19930
9101a310
RA
199312002-03-05 Robert Anisko <robert@lrde.epita.fr>
19932
19933 * src/reader.c (read_additionnal_code): `c' should be an integer, not
19934 a character.
19935 Reported by Nicolas Tisserand and Nicolas Burrus.
19936
fff9bf0b
RA
199372002-03-04 Robert Anisko <robert@lrde.epita.fr>
19938
19939 * src/reader.c: Warn about lacking semi-colons, do not complain.
19940
64dba31e
RA
199412002-03-04 Robert Anisko <robert@lrde.epita.fr>
19942
19943 * data/bison.c++: Remove a debug line.
19944
374f5a14
RA
199452002-03-04 Robert Anisko <robert@lrde.epita.fr>
19946
19947 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
19948 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
19949 provide a default implementation.
19950
bfcf1f3a
AD
199512002-03-04 Akim Demaille <akim@epita.fr>
19952
19953 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
19954 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
19955 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
19956 * tests/semantic.at (Parsing Guards): Similarly.
19957 * src/reader.at (readgram): Complain if the last rule is not ended
19958 with a semi-colon.
19959
65ccf9fc
AD
199602002-03-04 Akim Demaille <akim@epita.fr>
19961
19962 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
19963 * src/closure.c: here.
19964 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
19965 RTC.
19966 * src/warshall.h, src/warshall.c: Remove.
19967 * tests/sets.at (Broken Closure): Adjust.
19968
d0039cbc
AD
199692002-03-04 Akim Demaille <akim@epita.fr>
19970
19971 * src/output.c (output_skeleton): tempdir is const.
19972 bytes_read is unused.
19973
345cea78
AD
199742002-03-04 Akim Demaille <akim@epita.fr>
19975
19976 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19977 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
19978 Update.
19979 From Michael Hayes.
19980
564801f7
AD
199812002-03-04 Akim Demaille <akim@epita.fr>
19982
19983 * src/closure.c (closure): `r' is unused.
19984
e5352bc7
AD
199852002-03-04 Akim Demaille <akim@epita.fr>
19986
19987 * tests/sets.at (Broken Closure): Add the ending `;'.
19988 * src/reader.at (readgram): Complain if a rule is not ended with a
19989 semi-colon.
19990
914feea9
AD
199912002-03-04 Akim Demaille <akim@epita.fr>
19992
19993 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
19994 (count_sr_conflicts): Use bitset_count.
19995 * src/reduce.c (inaccessable_symbols): Ditto.
19996 (bits_size): Remove.
19997 * src/warshall.h, src/warshall.c: Convert to bitsetv.
19998
f0250de6
AD
199992002-03-04 Akim Demaille <akim@epita.fr>
20000
20001 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
20002 * src/reduce.c: Remove the `bitset_zero's following the
20003 `bitset_create's, as now it is performed by the latter.
20004
ef017502
AD
200052002-03-04 Akim Demaille <akim@epita.fr>
20006
20007 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
20008 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
20009 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
20010 latest sources from Michael.
20011
76514394
AD
200122002-03-04 Akim Demaille <akim@epita.fr>
20013
20014 * src/output.c (output): Don't free the grammar.
20015 * src/reader.c (grammar_free): New.
20016 * src/main.c (main): Call it and don't free symtab here.
20017
55024580
AD
200182002-03-04 Akim Demaille <akim@epita.fr>
20019
20020 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
20021 before returning.
20022 Reported by Benoit Perrot.
20023
f9abaa2c
AD
200242002-03-04 Akim Demaille <akim@epita.fr>
20025
20026 Use bitset operations when possible, not loops over bits.
20027
20028 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
20029 bitset_or.
20030 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
20031 * src/reduce.c (useless_nonterminals): Formatting changes.
20032 * src/warshall.c (TC): Use bitset_or.
20033
0e721e75
AD
200342002-03-04 Akim Demaille <akim@epita.fr>
20035
20036 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
20037 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
20038 Ditto.
20039
0fb1ffb1
AD
200402002-03-04 Akim Demaille <akim@epita.fr>
20041
20042 * src/lalr.c (F): Now a bitset*.
20043 Adjust all dependencies.
20044
b86796bf
AD
200452002-03-04 Akim Demaille <akim@epita.fr>
20046
20047 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
20048 Adjust all dependencies.
20049
602bbf31
AD
200502002-03-04 Akim Demaille <akim@epita.fr>
20051
20052 * src/L0.c, src/LR0.h (nstates): Be size_t.
20053 Adjust comparisons (signed vs unsigned).
20054 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
20055 bitset*.
20056 Adjust all dependencies.
20057
d8a0245c
AD
200582002-03-04 Akim Demaille <akim@epita.fr>
20059
20060 * src/closure.c (firsts): Now, also a bitset.
20061 Adjust all dependencies.
20062 (varsetsize): Remove, now unused.
20063 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
20064
34ba9743
AD
200652002-03-04 Akim Demaille <akim@epita.fr>
20066
20067 * src/print.c: Convert to use bitset.h, not hand coded iterations
20068 over ints.
20069
ed86e78c
AD
200702002-03-04 Akim Demaille <akim@epita.fr>
20071
20072 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
20073
dfdb1797
AD
200742002-03-04 Akim Demaille <akim@epita.fr>
20075
20076 * src/closure.c (ruleset): Be a bitset.
20077 (rulesetsize): Remove.
20078
7086e707
AD
200792002-03-04 Akim Demaille <akim@epita.fr>
20080
20081 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
20082 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
20083 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
20084 * src/closure.c (fderives): Be an array of bitsets.
20085
98254360
RA
200862002-02-28 Robert Anisko <robert@lrde.epita.fr>
20087
20088 * data/bison.c++: Merge the two generated headers. Insert a copyright
20089 notice in each output file.
20090
a75c057f
AD
200912002-02-28 Akim Demaille <akim@epita.fr>
20092
20093 * data/bison.c++: Copy the prologue of bison.simple to fetch
20094 useful M4 definitions, such as b4_header_guard.
20095
06b00abc
AD
200962002-02-25 Akim Demaille <akim@epita.fr>
20097
20098 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
20099 translator friendly scheme for the bgr
20100 copyright notice.
06b00abc 20101
70e7d534
AD
201022002-02-25 Akim Demaille <akim@epita.fr>
20103
20104 * src/output.c (header_output): Remove, now handled completely via
20105 M4.
20106
abe017f6
AD
201072002-02-25 Akim Demaille <akim@epita.fr>
20108
20109 * m4/m4.m4: New, from CVS Autoconf.
20110 * configure.in: Invoke it.
20111 * src/output.c (output_skeleton): Use its result instead of the
20112 hard coded name.
20113
381fb12e
AD
201142002-02-25 Akim Demaille <akim@epita.fr>
20115
20116 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
20117 Fileutils 4.1.5.
20118 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
20119 * src/output.c (output_skeleton): Use mkstemp to create a real
20120 temporary file.
20121 Move the filling of `skeleton' and its muscle to...
20122 (prepare): here.
20123 (output): Move the definition of the prologue muscle to...
20124 (prepare): here.
20125 * src/system.h (DEFAULT_TMPDIR): New.
20126
6f38107f
PE
201272002-02-14 Paul Eggert <eggert@twinsun.com>
20128
20129 Remove the support for C++ namespace cleanliness; it was
20130 causing more problems than it was curing, since it didn't work
20131 properly on some nonstandard C++ compilers. This can wait
20132 for a proper C++ parser.
20133
20134 * NEWS: Document this.
20135 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
20136 of C++, as it's treated like C now.
20137 * src/bison.simple (YYSTD): Remove.
20138 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
20139 Treat C++ just like Standard C instead of trying to support
20140 namespace cleanliness.
20141
80cce3da
AD
201422002-02-14 Akim Demaille <akim@epita.fr>
20143
20144 * tests/regression.at (else): Adjust to Andreas' change.
20145
842e8679
AD
201462002-02-14 Akim Demaille <akim@epita.fr>
20147
20148 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
20149
4bda3f10
AD
201502002-02-13 Andreas Schwab <schwab@suse.de>
20151
20152 * src/output.c (output_rule_data): Don't output NULL, it might
20153 not be defined yet.
20154
4162fa07 201552002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 20156
4162fa07
RA
20157 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
20158 (Copyright notice): Update.
b418ecd8 20159
bd16a5dc
AD
201602002-02-11 Akim Demaille <akim@epita.fr>
20161
20162 * tests/regression.at (%nonassoc and eof): Don't include
20163 nonportable headers.
20164
8d69a1a3
RA
201652002-02-08 Robert Anisko <robert@lrde.epita.fr>
20166
20167 * data/bison.c++: Correct error recovery. Make the user able to
20168 initialize the starting location.
20169
9b2d0677
AD
201702002-02-07 Akim Demaille <akim@epita.fr>
20171
20172 * tests/input.at: New.
20173
69e2658b
RA
201742002-02-07 Robert Anisko <robert@lrde.epita.fr>
20175
20176 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 20177 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
20178 directives around tables only needed for debugging.
20179
4aacc3a7
RA
201802002-02-07 Robert Anisko <robert@lrde.epita.fr>
20181
20182 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
20183 C++ parsers.
20184 (yy::b4_name::parse): Use print_.
20185
762a801e
RA
201862002-02-07 Robert Anisko <robert@lrde.epita.fr>
20187
20188 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
20189
4bb2bc3f
RA
201902002-02-07 Robert Anisko <robert@lrde.epita.fr>
20191
20192 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
20193 C++ parsers.
20194 (yy::b4_name::parse): Build verbose error messages, and use error_.
20195
6b45a3ca
RA
201962002-02-06 Robert Anisko <robert@lrde.epita.fr>
20197
20198 * data/bison.c++: Fix m4 quoting in comments.
20199
50997c6e
RA
202002002-02-06 Robert Anisko <robert@lrde.epita.fr>
20201
20202 * data/bison.c++: Adjust the parser code. Fix some muscles that were
20203 not expanded by m4.
20204
3f3eed27
AD
202052002-02-05 Akim Demaille <akim@epita.fr>
20206
20207 * data/bison.c++: Adjust to the M4 back end.
20208 More is certainly needed.
20209
be2a1a68
AD
202102002-02-05 Akim Demaille <akim@epita.fr>
20211
20212 Give a try to M4 as a back end.
20213
20214 * lib/readpipe.c: New, from wdiff.
20215 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
20216 BISON_HAIRY.
20217 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
20218 specific values. Now it is m4 that performs the lookup.
20219 * src/parse-skel.y: Remove.
20220 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
20221 * src/output.c (actions_output, guards_output)
20222 (token_definitions_output): No longer keeps track of the output
20223 line number, hence remove the second argument.
20224 (guards_output): Check against the guard member of a rule, not the
20225 action member.
20226 Adjust callers.
20227 (output_skeleton): Don't look for the skeleton location, let m4 do
20228 that.
20229 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
20230 file will be used.
20231 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
20232 (prepare): Given that for the time being changesyntax is not
20233 usable in M4, rename the muscles using `-' to `_'.
20234 Define `defines_flag', `output_parser_name' and `output_header_name'.
20235 * src/output.h (actions_output, guards_output)
20236 (token_definitions_output): Adjust prototypes.
20237 * src/scan-skel.l: Instead of scanning the skeletons, it now
20238 processes the output of m4: `__oline__' and `#output'.
20239 * data/bison.simple: Adjust to be used by M4(sugar).
20240 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
20241 to date.
20242 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
20243 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
20244 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
20245 shamelessly stolen from CVS Autoconf.
20246
beda758b
AD
202472002-02-05 Akim Demaille <akim@epita.fr>
20248
20249 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
20250 * configure.in: Check for the declarations of free and malloc.
20251 * src/muscle_tab.c: Adjust.
20252
5ece6d43
AD
202532002-02-05 Akim Demaille <akim@epita.fr>
20254
20255 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
20256 which have no values.
20257
5bb18f9a
AD
202582002-02-05 Akim Demaille <akim@epita.fr>
20259
20260 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
20261 * data/: here.
20262
894dd62e
PE
202632002-01-29 Paul Eggert <eggert@twinsun.com>
20264
20265 * src/bison.simple (YYSIZE_T): Do not define merely because
20266 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
20267 On some platforms, <alloca.h> does not declare YYSTD (size_t).
20268
82841af7
AD
202692002-01-27 Akim Demaille <akim@epita.fr>
20270
20271 Fix `%nonassoc and eof'.
20272
20273 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
20274 which were not properly copied! Replace
20275 memcpy (res->errs, src->errs, src->nerrs);
20276 with
20277 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
20278 !!!
20279 * tests/regression.at (%nonassoc and eof): Adjust to newest
20280 Autotest: `.' is not in the PATH.
20281
318b76e9
AD
202822002-01-27 Akim Demaille <akim@epita.fr>
20283
20284 * tests/sets.at (AT_EXTRACT_SETS): New.
20285 (Nullable): Use it.
20286 (Firsts): New.
20287
30d2f3d5
AD
202882002-01-26 Akim Demaille <akim@epita.fr>
20289
20290 * tests/actions.at, tests/calc.at, tests/headers.at,
20291 * tests/torture.at: Adjust to the newest Autotest which no longer
20292 forces `.' in the PATH.
20293
30f8c395
AD
202942002-01-25 Akim Demaille <akim@epita.fr>
20295
20296 * tests/regression.at (%nonassoc and eof): New.
20297 Suggested by Robert Anisko.
20298
29ae55f1
AD
202992002-01-24 Akim Demaille <akim@epita.fr>
20300
20301 Bison dumps core when trying to complain about broken input files.
20302 Reported by Cris van Pelt.
20303
20304 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
20305 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
20306 into...
20307 (Invalid inputs): Strengthen: exercise parse_percent_token.
20308
2b548aa6
RA
203092002-01-24 Robert Anisko <robert.anisko@epita.fr>
20310
20311 * src/Makefile.am: Add bison.c++.
20312 * src/bison.c++: New skeleton.
20313
bb0146c2
AD
203142002-01-21 Paolo Bonzini <bonzini@gnu.org>
20315
20316 * po/it.po: New.
20317
bec30531
AD
203182002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
20319
20320 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
20321
fc6edc45
MA
203222002-01-20 Marc Autret <marc@gnu.org>
20323
20324 * src/files.c (compute_output_file_names): Fix
20325
5e5d5415
MA
203262002-01-20 Marc Autret <marc@gnu.org>
20327
20328 * tests/output.at: New test.
20329 * src/files.c (compute_base_names): Don't map extensions when
20330 the YACC flag is set, use defaults.
20331 Reported by Evgeny Stambulchik.
20332
44ea3fbd
MA
203332002-01-20 Marc Autret <marc@gnu.org>
20334
ba0fe3c7
PE
20335 * src/system.h: Need to define __attribute__ away for non-GCC
20336 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
20337 Suggested by Albert Chin-A-Young.
20338
338963d1
TVH
203392002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
20340
20341 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
20342 canonical definition.
20343 * src/system.h: Use the canonical definition for PARAMS (avoids
20344 a conflict with the macro from lib/hash.h).
20345
c57b2479
AD
203462002-01-11 Akim Demaille <akim@epita.fr>
20347
20348 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 20349 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 20350
b85810ae
AD
203512002-01-09 Akim Demaille <akim@epita.fr>
20352
20353 * src/files.c, src/files.h (output_infix): New.
20354 (tab_extension): Remove.
20355 (compute_base_names): Compute the former, drop the latter.
20356 * src/output.c (prepare): Insert the muscles `output-infix', and
20357 `output-suffix'.
20358 * src/parse-skel.y (string, string.1): New.
20359 (section.header): Use it.
20360 (section.yacc): Remove.
20361 (prefix): Remove too.
20362 * src/scan-skel.l: Adjust.
20363 * src/bison.simple, src/bison.hairy: Adjust.
20364
cae60122
AD
203652002-01-09 Akim Demaille <akim@epita.fr>
20366
20367 * configure.in (WERROR_CFLAGS): Compute it.
20368 * src/Makefile.am (CFLAGS): Pass it.
20369 * tests/atlocal.in (CFLAGS): Idem.
20370 * src/files.c: Fix a few warnings.
20371 (get_extension_index): Remove, unused.
20372
ae404801
AD
203732002-01-08 Akim Demaille <akim@epita.fr>
20374
20375 * src/getargs.c (AS_FILE_NAME): New.
20376 (getargs): Use it to convert DOSish file names.
20377 * src/files.c (base_name): Rename as full_base_name to avoid
20378 clashes with `base_name ()'.
20379 (filename_split): New.
20380 (compute_base_names): N-th rewrite, using filename_split.
20381
22312b71
AD
203822002-01-08 Akim Demaille <akim@epita.fr>
20383
20384 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
20385 New, stolen from the Fileutils 4.1.
20386 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20387 * configure.in: Check for the presence of memrchr, and of its
20388 prototype.
20389
a67cef01
TVH
203902002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
20391
20392 * lib/hash.h (__P): Added definition for this macro.
20393 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
20394 BUILT_SOURCES, to ensure they are generated first.
20395 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
20396 %error-verbose to allow bootstrapping with bison 1.30x.
20397
2b25d624
AD
203982002-01-06 Akim Demaille <akim@epita.fr>
20399
20400 * src/reader.c (parse_braces): Don't fetch the next char, the
20401 convention is to fetch on entry.
20402 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
20403 'switch' without a following semicolon.
20404 * tests/regression.at (braces parsing): New.
20405
3460813b
AD
204062002-01-06 Akim Demaille <akim@epita.fr>
20407
20408 Bison is dead wrong in its RR conflict reports.
20409
20410 * tests/torture.at (GNU Cim Grammar): New.
20411 * src/conflicts.c (count_rr_conflicts): Fix.
20412
73784c64
AD
204132002-01-06 Akim Demaille <akim@epita.fr>
20414
20415 Creating package.m4 from configure.ac causes too many problems.
20416
20417 * tests/Makefile.am (package.m4): Create it by hand,
20418 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
20419
25d81090
AD
204202002-01-06 Akim Demaille <akim@epita.fr>
20421
20422 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
20423 skeleton.h.
20424
a9b8959e
PE
204252002-01-04 Paul Eggert <eggert@twinsun.com>
20426
20427 * doc/bison.texinfo (Debugging):
20428 Remove YYSTDERR; it's no longer defined or used.
20429 Also, s/cstdio.h/cstdio/.
20430
25d81090
AD
204312002-01-03 Akim Demaille <akim@epita.fr>
20432
20433 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
20434
1109455c
AD
204352002-01-03 Akim Demaille <akim@epita.fr>
20436
20437 * src/parse-skel.y (process_skeleton): Don't bind the parser's
20438 tracing code to --trace, wait for a better --trace option, with
20439 args.
20440
7ea5e977
AD
204412002-01-03 Akim Demaille <akim@epita.fr>
20442
20443 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
20444 The ISO C++ standard is extremely clear about it: stderr is
20445 considered a macro, not a regular symbol (see table 94 `Header
20446 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
20447 Therefore std:: does not apply to it. It still does with fprintf.
20448 Also, s/cstdio.h/cstdio/.
20449
fab5b110
AD
204502002-01-03 Akim Demaille <akim@epita.fr>
20451
20452 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
20453 for non system headers.
20454
aed7fd9b
AD
204552002-01-02 Akim Demaille <akim@epita.fr>
20456
20457 Equip the skeleton chain with location tracking, runtime trace,
20458 pure parser and scanner.
20459
20460 * src/parse-skel.y: Request a pure parser, locations, and prefix
20461 renaming.
20462 (%union): Having several members with the same type does not help
20463 type mismatches, simplify.
20464 (YYPRINT, yyprint): New.
20465 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
20466 (skel_error): this.
20467 Handle locations.
20468 * src/scan-skel.l: Adjust to these changes.
20469 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
20470 (LOCATION_PRINT, skel_control_t): New.
20471
24fad99e
AD
204722001-12-30 Akim Demaille <akim@epita.fr>
20473
20474 * src/parse-skel.y: Get rid of the shift/reduce conflict:
20475 replace `gb' with BLANKS.
20476 * src/scan-skel.l: Adjust.
20477
a4b36db4
AD
204782001-12-30 Akim Demaille <akim@epita.fr>
20479
20480 * src/system.h: We don't need nor want bcopy.
20481 Throw away MS-DOS crap: we don't need getpid.
20482 * configure.in: We don't need strndup. It was even causing
20483 problems: because Flex includes the headers *before* us,
20484 _GNU_SOURCE is not defined by config.h, and therefore strndup was
20485 not visible.
20486 * lib/xstrndup.c: New.
20487 * src/scan-skel.l: Use it.
20488 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
20489 * src/parse-skel.y: Use %directives instead of #defines.
20490
1239777d
AD
204912001-12-30 Akim Demaille <akim@epita.fr>
20492
20493 * src/skeleton.h: New.
20494 * src/output.c (output_parser, output_master_parser): Remove, dead
20495 code.
20496 * src/output.h (get_lines_number, actions_output, guards_output)
20497 (token_definitions_output): Prototype them.
20498 * src/parse-skel.y: Add the license notice.
20499 Include output.h and skeleton.h.
20500 (process_skeleton): Returns void, and takes a single parameter.
20501 * src/scan-skel.l: Add the license notice.
20502 Include skeleton.h.
20503 Don't use %option yylineno: it seems that then Flex imagines
20504 REJECT has been used, and therefore it won't reallocate its
20505 buffers (which makes no other sense to me than a bug). It results
20506 in warnings for `unused: yy_flex_realloc'.
20507
9b3add5b
RA
205082001-12-30 Robert Anisko <robert.anisko@epita.fr>
20509
20510 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20511 (MUSCLE_INSERT_PREFIX): ...to there.
20512 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20513 (MUSCLE_INSERT_PREFIX): Move from here...
20514
20515 * src/bison.hairy: Add a section directive. Put braces around muscle
20516 names. This parser skeleton is still broken, but Bison should not
20517 choke on a bad muscle 'syntax'.
20518 * src/bison.simple: Add a section directive. Put braces around muscle
20519 names.
20520
20521 * src/files.h (strsuffix, stringappend): Add declarations.
20522 (tab_extension): Add declaration.
20523 (short_base_name): Add declaration.
20524
20525 * src/files.c (strsuffix, stringappend): No longer static. These
20526 functions are used in the skeleton parser.
20527 (tab_extension): New.
20528 (compute_base_names): Use the computations done in this function
fab5b110 20529 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
20530 names.
20531 (short_base_name): No longer static.
20532
20533 * src/output.c (output_skeleton): New.
20534 (output): Disable call to output_master_parser, and give a try to
20535 a new skeleton handling system.
20536 (guards_output, actions_output): No longer static.
20537 (token_definitions_output, get_lines_number): No longer static.
20538
20539 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
20540
fab5b110 20541 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
20542 parse-skel.y.
20543
20544 * src/parse-skel.y: New file.
20545 * src/scan-skel.l: New file.
20546
b5b61c61
AD
205472001-12-29 Akim Demaille <akim@epita.fr>
20548
20549 %name-prefix is broken.
20550
20551 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
20552 Adjust all dependencies.
20553 * tests/headers.at (export YYLTYPE): Strengthen this test: use
20554 %name-prefix.
20555
20556 Renaming yylval but not yylloc is not consistent. Now we do.
20557
20558 * src/bison.simple: Prefix yylloc if used.
20559 * doc/bison.texinfo (Decl Summary): Document that.
20560
8c9a50be
AD
205612001-12-29 Akim Demaille <akim@epita.fr>
20562
20563 * doc/bison.texinfo: Promote `%long-directive' over
20564 `%long_directive'.
20565 Remove all references to fixed-output-files, yacc is enough.
20566
d99361e6
AD
205672001-12-29 Akim Demaille <akim@epita.fr>
20568
20569 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
20570 user prologue. These are defaults.
20571 * tests/actions.at (Mid-rule actions): Make sure the user can
20572 define YYDEBUG and YYERROR_VERBOSE.
20573
b9cecb91
AD
205742001-12-29 Akim Demaille <akim@epita.fr>
20575
20576 * src/output.c (header_output): Don't forget to export YYLTYPE and
20577 yylloc.
20578 * tests/headers.at (export YYLTYPE): New, make sure it does.
20579 * tests/regression.at (%union and --defines, Invalid CPP headers):
20580 Move to...
20581 * tests/headers.at: here.
20582
aea13e97
AD
205832001-12-29 Akim Demaille <akim@epita.fr>
20584
20585 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
20586
931394cb
AD
205872001-12-29 Akim Demaille <akim@epita.fr>
20588
20589 * tests/actions.at (Mid-rule actions): Output on a single line
20590 instead of several.
20591
704a47c4
AD
205922001-12-29 Akim Demaille <akim@epita.fr>
20593
20594 * doc/bison.texinfo: Formatting changes.
20595
091e20bb
AD
205962001-12-29 Akim Demaille <akim@epita.fr>
20597
20598 Don't store the token defs in a muscle, just be ready to output it
20599 on command. Now possible via `symbols'. Fixes a memory leak.
20600
20601 * src/output.c (token_definitions_output): New.
20602 (output_parser, header_output): Use it.
20603 * src/reader.c (symbols_save): Remove.
20604
cce71710
AD
206052001-12-29 Akim Demaille <akim@epita.fr>
20606
20607 * src/bison.simple: Do not provide a default for YYSTYPE and
20608 YYLTYPE before the user's prologue. Otherwise it's hardly... a
20609 default.
20610
82c035a8
AD
206112001-12-29 Akim Demaille <akim@epita.fr>
20612
20613 Mid-rule actions are simply... ignored!
20614
20615 * src/reader.c (readgram): Be sure to attach mid-rule actions to
20616 the empty-rule associated to the dummy symbol, not to the host
20617 rule.
20618 * tests/actions.at (Mid-rule actions): New.
20619
8419d367
AD
206202001-12-29 Akim Demaille <akim@epita.fr>
20621
20622 Memory leak.
20623
20624 * src/reader.c (reader): Free grammar.
20625
375d5806
AD
206262001-12-29 Akim Demaille <akim@epita.fr>
20627
20628 Memory leak.
20629
20630 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
20631 since it allocates it for each state, although only one is needed.
20632 (allocate_storage): Do it here.
20633
f51cb8ff
AD
206342001-12-29 Akim Demaille <akim@epita.fr>
20635
20636 * src/options.h, src/options.c (create_long_option_table): Rename
20637 as...
20638 (long_option_table_new): this, with a clearer prototype.
20639 (percent_table): Remove, unused,
20640 * src/getargs.c (getargs): Adjust.
20641
29e88316
AD
206422001-12-29 Akim Demaille <akim@epita.fr>
20643
20644 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
20645 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
20646 as states.
20647
b9f71f19
AD
206482001-12-29 Akim Demaille <akim@epita.fr>
20649
20650 * src/lalr.c (build_relations): Rename `states' as `states1'.
20651 Sorry, I don't understand exactly what it is, no better name...
20652
1a2b5d37
AD
206532001-12-29 Akim Demaille <akim@epita.fr>
20654
20655 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
20656 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
20657 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
20658 as rules.
20659
1cca533e
AD
206602001-12-29 Akim Demaille <akim@epita.fr>
20661
20662 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
20663 ago.
20664
c03ae966
AD
206652001-12-29 Akim Demaille <akim@epita.fr>
20666
20667 * src/reader.c, src/reader.h (user_toknums): Remove.
20668 Adjust all users to use symbols[i]->user_token_number.
20669
5a670b1e
AD
206702001-12-29 Akim Demaille <akim@epita.fr>
20671
20672 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
20673 Adjust all users to use symbols[i]->prec or ->assoc.
20674
ad949da9
AD
206752001-12-29 Akim Demaille <akim@epita.fr>
20676
20677 * src/reader.c, src/reader.h (tags): Remove.
20678 Adjust all users to use symbols[i]->tag.
20679
0e78e603
AD
206802001-12-29 Akim Demaille <akim@epita.fr>
20681
20682 * src/gram.h, src/gram.c (symbols): New, similar to state_table
20683 and rule_table.
20684 * src/reader.c (packsymbols): Fill this table.
20685 Drop sprec.
20686 * src/conflicts.c (resolve_sr_conflict): Adjust.
20687 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
20688 single table.
20689 Use symbols[i]->tag instead of tags[i].
20690
213e640e
AD
206912001-12-29 Akim Demaille <akim@epita.fr>
20692
20693 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
20694 In addition, put a comment in there, to replace...
20695 * tests/regression.at (%union and C comments): Remove.
20696
e7b8bef1
AD
206972001-12-29 Akim Demaille <akim@epita.fr>
20698
20699 * tests/regression.at (Web2c Actions): Blindly move the actual
20700 output as expected output. The contents *seem* right to me, but I
20701 can't pretend reading perfectly parser tables... Nonetheless, all
20702 the other tests pass correctly, the table look OK, even though the
20703 presence of `$axiom' is to be noted: AFAICS it is useless (but
20704 harmless).
20705
b68e7744
AD
207062001-12-29 Akim Demaille <akim@epita.fr>
20707
20708 * src/reader.c (readgram): Don't add the rule 0 if there were no
20709 rules read. In other words, add it _after_ having performed
20710 grammar sanity checks.
20711 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
20712
78d5bae9
AD
207132001-12-29 Akim Demaille <akim@epita.fr>
20714
20715 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
20716 visible, and some states have now a different number.
20717
ff442794
AD
207182001-12-29 Akim Demaille <akim@epita.fr>
20719
20720 * src/reader.c (readgram): Bind the initial rule's lineno to that
20721 of the first rule.
20722 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20723 (Solved SR Conflicts): Adjust rule 0's line number.
20724
610ab194
AD
207252001-12-29 Akim Demaille <akim@epita.fr>
20726
20727 Fix the `GAWK Grammar' failure.
20728
20729 * src/LR0.c (final_state): Initialize to -1 so that we do compute
20730 the reductions of the first state which was mistakenly confused
20731 with the final state because precisely final_state was initialized
20732 to 0.
20733 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
20734 now noticed by Bison.
20735 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
20736 have a reduction on $default.
20737
29d29c8f
AD
207382001-12-29 Akim Demaille <akim@epita.fr>
20739
20740 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
20741 rule line numbers.
20742 * src/closure.c (print_closure): Likewise.
20743 * src/derives.c (print_derives): Likewise.
20744 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
20745 now.
20746
7c6b64d0
AD
207472001-12-29 Akim Demaille <akim@epita.fr>
20748
20749 * src/lalr.c (lookaheads_print): New.
20750 (lalr): Call it when --trace-flag.
20751 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
20752 are dumped.
20753
3d4daee3
AD
207542001-12-29 Akim Demaille <akim@epita.fr>
20755
20756 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
20757 when walking through ritem, even via rule->rhs.
20758 * src/reduce.c (dump_grammar, useful_production, reduce_output)
20759 (useful_production, useless_nonterminals): Likewise.
20760 (reduce_grammar_tables): Likewise, plus update nritems.
20761 * src/nullable.c (set_nullable): Likewise.
20762 * src/lalr.c (build_relations): Likewise.
20763 * tests/sets.at (Nullable): Adjust.
20764 Fortunately, now, the $axiom is no longer nullable.
20765
9e7f6bbd
AD
207662001-12-29 Akim Demaille <akim@epita.fr>
20767
20768 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
20769 the 0-sentinel.
20770 * src/gram.c (ritem_longest_rhs): Likewise.
20771 * src/reduce.c (nonterminals_reduce): Likewise.
20772 * src/print_graph.c (print_graph): Likewise.
20773 * src/output.c (output_rule_data): Likewise.
20774 * src/nullable.c (set_nullable): Likewise.
20775
255ef638
AD
207762001-12-29 Akim Demaille <akim@epita.fr>
20777
20778 * src/output.c: Comment changes.
20779
0d8a7363
AD
207802001-12-27 Paul Eggert <eggert@twinsun.com>
20781
20782 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
20783 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
20784 Sparc, as they were causing more porting problems than the
20785 (minor) performance improvement was worth.
20786
20787 Also, catch up with 1.31's YYSTD.
20788
3db472b9
AD
207892001-12-27 Akim Demaille <akim@epita.fr>
20790
20791 * src/output.c (output_gram): Rely on nritems, not the
20792 0-sentinel. See below.
20793 Use -1 as separator, not 0.
20794 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
20795 Rely on -1 as separator in yyrhs, instead of 0.
20796 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
20797 twice `Now at end of input', therefore there are two lines less to
20798 expect.
20799
b365aa05
AD
208002001-12-27 Akim Demaille <akim@epita.fr>
20801
20802 * tests/regression.at (Unresolved SR Conflicts):
20803 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
20804 below.
20805
30171f79
AD
208062001-12-27 Akim Demaille <akim@epita.fr>
20807
20808 * src/LR0.c (new_state): Recognize the final state by the fact it
20809 is reached by eoftoken.
20810 (insert_start_shifting_state, insert_eof_shifting_state)
20811 (insert_accepting_state, augment_automaton): Remove, since now
20812 these states are automatically computed from the initial state.
20813 (generate_states): Adjust.
20814 * src/print.c: When reporting a rule number to the user, substract
20815 1, so that the axiom rule is rule 0, and the first user rule is 1.
20816 * src/reduce.c: Likewise.
20817 * src/print_graph.c (print_core): For the time being, just as for
20818 the report, depend upon --trace-flags to dump the full set of
20819 items.
20820 * src/reader.c (readgram): Once the grammar read, insert the rule
20821 0: `$axiom: START-SYMBOL $'.
20822 * tests/set.at: Adjust: rule 0 is now displayed, and since the
20823 number of the states has changed (the final state is no longer
20824 necessarily the last), catch up.
20825
75142d45
AD
208262001-12-27 Akim Demaille <akim@epita.fr>
20827
20828 Try to make the use of the eoftoken valid. Given that its value
20829 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
20830 is used instead of > 0 where appropriate, (ii), depend upon nritems
20831 instead of the 0-sentinel.
20832
20833 * src/gram.h, src/gram.c (nritems): New.
20834 Expected to be duplication of nitems, but for the time being...
20835 * src/reader.c (packgram): Assert nritems and nitems are equal.
20836 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
20837 * src/closure.c (print_closure, print_fderives): Likewise.
20838 * src/gram.c (ritem_print): Likewise.
20839 * src/print.c (print_core, print_grammar): Likewise.
20840 * src/print_graph.c: Likewise.
20841
b7c49edf
AD
208422001-12-27 Akim Demaille <akim@epita.fr>
20843
20844 * src/main.c (main): If there are complains after grammar
20845 reductions, then output the report anyway if requested, then die.
20846 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
20847 * src/reader.c (eoftoken): New.
20848 (parse_token_decl): If the token being defined has value `0', it
20849 is the eoftoken.
20850 (packsymbols): No longer hack `tags' to insert `$' by hand.
20851 Be sure to preserve the value of the eoftoken.
20852 (reader): Make sure eoftoken is defined.
20853 Initialize nsyms to 0: now eoftoken is created just like the others.
20854 * src/print.c (print_grammar): Don't special case the eof token.
20855 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
20856 lie anyway, albeit pleasant.
20857 * tests/calc.at: Exercise error messages with eoftoken.
20858 Change the grammar so that empty input is invalid.
20859 Adjust expectations.
20860 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
20861
ec2da99f
AD
208622001-12-27 Akim Demaille <akim@epita.fr>
20863
20864 * configure.in: Check the protos of strchr ans strspn.
20865 Replace strchr if needed.
20866 * src/system.h: Provide the protos of strchr, strspn and memchr if
20867 missing.
20868 * lib/strchr.c: New.
20869 * src/reader.c (symbols_save): Use strchr.
20870
8adfa272
AD
208712001-12-27 Akim Demaille <akim@epita.fr>
20872
20873 * src/print.c, src/print_graph.c (escape): New.
20874 Use it to quote the TAGS outputs.
20875 * src/print_graph.c (print_state): Now errors are in red, and
20876 reductions in green.
20877 Prefer high to wide: output the state number on a line of its own.
20878
80dac38c
AD
208792001-12-27 Akim Demaille <akim@epita.fr>
20880
20881 * src/state.h, src/state.c (reductions_new): New.
20882 * src/LR0.c (set_state_table): Let all the states have a
20883 `reductions', even if reduced to 0.
20884 (save_reductions): Adjust.
20885 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
20886 * src/print.c (print_reductions, print_actions): Adjust.
20887 * src/output.c (action_row): Adjust.
20888
2cec70b9
AD
208892001-12-27 Akim Demaille <akim@epita.fr>
20890
20891 * src/state.h, src/state.c (errs_new, errs_dup): New.
20892 * src/LR0.c (set_state_table): Let all the states have an errs,
20893 even if reduced to 0.
20894 * src/print.c (print_errs, print_reductions): Adjust.
20895 * src/output.c (output_actions, action_row): Adjust.
20896 * src/conflicts.c (resolve_sr_conflict): Adjust.
20897
13ca549a
AD
208982001-12-27 Akim Demaille <akim@epita.fr>
20899
20900 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
20901
5092aba5
AD
209022001-12-27 Akim Demaille <akim@epita.fr>
20903
20904 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
20905 * src/print.c: here.
20906 (lookaheadset, shiftset): New, used as additional storage by
20907 print_reductions.
20908 (print_results): Adjust.
20909 (print_shifts, print_gotos, print_errs): New, extracted from...
20910 (print_actions): here.
20911 * src/print_graph.c (print_actions): Remove dead code.
20912
11e2beca
AD
209132001-12-27 Akim Demaille <akim@epita.fr>
20914
20915 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
20916 `$n' and `@n'.
20917
dac3c910
AD
209182001-12-27 Akim Demaille <akim@epita.fr>
20919
20920 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
20921 (build_relations): Adjust.
20922
d0b0fefa
AD
209232001-12-27 Akim Demaille <akim@epita.fr>
20924
20925 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
20926 duplication.
20927
adc8c848
AD
209282001-12-27 Akim Demaille <akim@epita.fr>
20929
20930 * src/reader.c (packgram): Catch nitems overflows.
20931
14d293ac
AD
209322001-12-27 Akim Demaille <akim@epita.fr>
20933
20934 * src/files.c, src/files.h (guard_obstack): Remove.
20935 * src/output.c (output): Adjust.
20936 * src/reader.c (parse_braces): New, factoring...
20937 (copy_action, copy_guard): these two which are renamed as...
20938 (parse_action, parse_guard): these.
20939 As a voluntary consequence, using braces around guards is now
20940 mandatory.
20941
f499b062
AD
209422001-12-27 Akim Demaille <akim@epita.fr>
20943
20944 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
20945 * src/reader.c (symbol_list): `guard' and `guard_line' are new
20946 members.
20947 (symbol_list_new): Adjust.
20948 (copy_action): action_line is the first line, not the last.
20949 (copy_guard): Just as for actions, store the `action' only, not
20950 the switch/case/break flesh.
20951 Don't parse the user action that might follow the guard, let...
20952 (readgram): do it, i.e., now, there can be an action after a
20953 guard.
20954 In other words the guard is just explicitly optional.
20955 (packgram): Adjust.
20956 * src/output.c (guards_output): New.
20957 (output_parser): Call it when needed.
20958 (output): Also free the guard and attrs obstacks.
20959 * src/files.c, src/files.h (obstack_save): Remove.
20960 (output_files): Remove.
20961 As a result, if one needs the former `.act' file, using an
20962 appropriate skeleton which requires actions and guards is now
20963 required.
20964 * src/main.c (main): Adjust.
20965 * tests/semantic.at: New.
20966 * tests/regression.at: Use `input.y' as input file name.
20967 Avoid 8+3 problems by requiring input.c when the test needs the
20968 parser.
20969
d945f5cd
AD
209702001-12-27 Akim Demaille <akim@epita.fr>
20971
20972 * src/reader.c (symbol_list_new): Be sure to initialize all the
20973 fields.
20974
d200e455
AD
209752001-12-27 Akim Demaille <akim@epita.fr>
20976
20977 All the hacks using a final pseudo state are now useless.
20978
20979 * src/LR0.c (set_state_table): state_table holds exactly nstates.
20980 * src/lalr.c (nLA): New.
20981 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
20982 instead of lookaheadsp from the pseudo state (nstate + 1).
20983
f9507c28
AD
209842001-12-27 Akim Demaille <akim@epita.fr>
20985
20986 * src/output.c (action_row, token_actions): Use a state_t instead
20987 of a integer, and nlookaheads instead of the following state's
20988 lookaheadsp.
20989
065fbd27
AD
209902001-12-27 Akim Demaille <akim@epita.fr>
20991
20992 * src/conflicts.c (log_resolution, flush_shift)
20993 (resolve_sr_conflict, set_conflicts, solve_conflicts)
20994 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
20995 (conflicts_print, print_reductions): Use a state_t instead of an
20996 integer when referring to a state.
20997 As much as possible, depend upon nlookaheads, instead of the
20998 `lookaheadsp' member of the following state (since lookaheads of
20999 successive states are successive, the difference between state n + 1
21000 and n served as the number of lookaheads for state n).
21001 * src/lalr.c (add_lookback_edge): Likewise.
21002 * src/print.c (print_core, print_actions, print_state)
21003 (print_results): Likewise.
21004 * src/print_graph.c (print_core, print_actions, print_state)
21005 (print_graph): Likewise.
21006 * src/conflicts.h: Adjust.
21007
1b177bd7
AD
210082001-12-27 Akim Demaille <akim@epita.fr>
21009
21010 * src/bison.hairy: Formatting/comment changes.
21011 ANSIfy.
21012 Remove `register' indications.
21013 Add plenty of `static'.
21014
7742ddeb
AD
210152001-12-27 Akim Demaille <akim@epita.fr>
21016
21017 * src/output.c (prepare): Drop the muscle `ntbase' which
21018 duplicates ntokens.
21019 * src/bison.simple: Formatting/comment changes.
21020 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
21021 is an undocumented synonym.
21022
1fa14068
AD
210232001-12-22 Akim Demaille <akim@epita.fr>
21024
21025 * src/output.c (output_table_data): Change the prototype to use
21026 `int' for array ranges: some invocations do pass an int, not a
21027 short.
21028 Reported by Wayne Green.
21029
b9752825
AD
210302001-12-22 Akim Demaille <akim@epita.fr>
21031
21032 Some actions of web2c.y are improperly triggered.
21033 Reported by Mike Castle.
21034
21035 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
21036 * tests/regression.at (Web2c): Rename as...
21037 (Web2c Report): this.
21038 (Web2c Actions): New.
21039
776209d6
AD
210402001-12-22 Akim Demaille <akim@epita.fr>
21041
21042 Reductions in web2c.y are improperly reported.
21043 Reported by Mike Castle.
21044
21045 * src/conflicts.c (print_reductions): Fix.
21046 * tests/regression.at (Web2c): New.
21047
275fc3ad
AD
210482001-12-18 Akim Demaille <akim@epita.fr>
21049
21050 Some host fail on `assert (!"foo")', which expands to
21051 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
21052 Reported by Nelson Beebee.
21053
21054 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
21055 `#define it_succeeded 0' and `assert (it_succeeded)'.
21056
897668ee
MA
210572001-12-17 Marc Autret <autret_m@epita.fr>
21058
21059 * src/bison.simple: Don't hard code the skeleton line and filename.
21060 * src/output.c (output_parser): Rename 'line' as 'output_line'.
21061 New line counter 'skeleton_line' (skeleton-line muscle).
21062
ab3399e0
PE
210632001-12-17 Paul Eggert <eggert@twinsun.com>
21064
21065 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
21066 YYDEBUG must be defined to a nonzero value.
21067
21068 * src/bison.simple (yytname): Do not assume that the user defines
21069 YYDEBUG to a properly parenthesized expression.
21070
3877f72b
AD
210712001-12-17 Akim Demaille <akim@epita.fr>
21072
21073 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
21074 nlookaheads is a new member.
21075 Adjust all users.
21076 * src/lalr.h (nlookaheads): Remove this orphan declaration.
21077 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
21078 state.
776209d6 21079
331dbc1b
AD
210802001-12-17 Akim Demaille <akim@epita.fr>
21081
21082 * src/files.h, src/files.c (open_files, close_files): Remove.
21083 * src/main.c (main): Don't open/close files, nor invoke lex_free,
21084 let...
21085 * src/reader.c (reader): Do it.
776209d6 21086
be750e4c
AD
210872001-12-17 Akim Demaille <akim@epita.fr>
21088
21089 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 21090
709ae8c6
AD
210912001-12-17 Akim Demaille <akim@epita.fr>
21092
21093 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
21094 (flush_reduce): New.
21095 (resolve_sr_conflict): Adjust.
776209d6 21096
f87685c3
AD
210972001-12-17 Akim Demaille <akim@epita.fr>
21098
21099 * src/output.c (output_obstack): Be static and rename as...
21100 (format_obstack): this, to avoid any confusion with files.c's
21101 output_obstack.
21102 * src/reader.h (muscle_obstack): Move to...
21103 * src/output.h: here, since it's defined in output.c.
21104
837491d8
AD
211052001-12-17 Akim Demaille <akim@epita.fr>
21106
21107 * src/output.c (action_row, save_column, default_goto)
21108 (sort_actions, matching_state, pack_vector): Better variable
21109 locality.
21110
796d61fb
AD
211112001-12-17 Akim Demaille <akim@epita.fr>
21112
21113 * src/output.c: Various formatting changes.
776209d6 21114
64d15509
AD
211152001-12-17 Akim Demaille <akim@epita.fr>
21116
21117 * src/files.c (output_files): Free the output_obstack.
21118 * src/main.c (main): Call print and print_graph conditionally.
21119 * src/print.c (print): Work unconditionally.
21120 * src/print_graph.c (print_graph): Work unconditionally.
21121 * src/conflicts.c (log_resolution): Output only if verbose_flag.
21122
fbc8ecb7
MA
211232001-12-16 Marc Autret <autret_m@epita.fr>
21124
21125 * src/output.c (actions_output): Fix. When we use %no-lines,
21126 there is one less line per action.
21127
f0440388
MA
211282001-12-16 Marc Autret <autret_m@epita.fr>
21129
21130 * src/bison.simple: Remove a useless #line directive.
21131 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
21132 * src/output.c (get_lines_number): New.
776209d6 21133 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
21134 output muscles.
21135 Fix line numbering.
21136 (actions_output): Computes the number of lines taken by actions.
21137 (output_master_parser): Insert new skeleton which is the name of
21138 the output parser file name.
21139
a79986b8
MA
211402001-12-15 Marc Autret <autret_m@epita.fr>
21141
21142 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
21143
4ec8e00f
MA
211442001-12-15 Marc Autret <autret_m@epita.fr>
21145
21146 * src/output.c (output_gram): Keep track of the hairy one.
21147
1a4648ff
AD
211482001-12-15 Akim Demaille <akim@epita.fr>
21149
21150 Make `make distcheck' work.
21151
21152 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
21153 system.h which uses libgettext.h.
21154
9c2c67e6
AD
211552001-12-15 Akim Demaille <akim@epita.fr>
21156
21157 * src/nullable.c (set_nullable): Useless rules must be skipped,
21158 otherwise, since we range over their symbols, we might look at a
21159 nonterminal which no longer ``exists'', i.e., it is not counted in
21160 `nvars', hence we overflow our arrays.
21161
93ede233
AD
211622001-12-15 Akim Demaille <akim@epita.fr>
21163
21164 The header can also be produced directly, without any obstack!
21165 Yahoo!
21166
21167 * src/files.c, src/files.h (defines_obstack): Remove.
21168 (compute_header_macro): Global.
21169 (defines_obstack_save): Remove.
21170 * src/reader.c (parse_union_decl): No longer output to
21171 defines_obstack: its content can be found in the `stype' muscle
21172 anyway.
21173 (output_token_translations): Merge into...
21174 (symbols_output): this.
21175 Rename as...
21176 (symbols_save): this.
21177 (reader): Adjust.
21178 * src/output.c (header_output): New.
21179 (output): Call it.
21180
2666f928
AD
211812001-12-15 Akim Demaille <akim@epita.fr>
21182
21183 * src/reader.c (parse_union_decl): Instead of handling two obstack
21184 simultaneously, use one to define the `stype' muscle, and use the
21185 value of the latter to fill defines_obstack.
21186 (copy_comment): Remove.
21187 (copy_comment2): Work for a single obstack.
21188 Rename as...
21189 (copy_comment): this.
21190
428046f8
AD
211912001-12-15 Akim Demaille <akim@epita.fr>
21192
21193 * src/lex.c, src/lex.h (xgetc): No longer static.
21194 * src/reader.c (parse_union_decl): Revamp.
21195
ea52d706
AD
211962001-12-15 Akim Demaille <akim@epita.fr>
21197
21198 Still making progress in separating Bison into (i) input, (ii)
21199 process, (iii) output: now we can directly output the parser file
21200 without using table_obstack at all.
21201
21202 * src/files.c, src/files.h (table_obstack): Bye bye.
21203 (parser_file_name): New.
21204 * src/files.c (compute_output_file_names): Compute it.
21205 * src/output.c (actions_output, output_parser)
21206 (output_master_parser): To a file instead of an obstack.
21207
3f96f4dc
AD
212082001-12-15 Akim Demaille <akim@epita.fr>
21209
21210 Attach actions to rules, instead of pre-outputting them to
21211 actions_obstack.
21212
21213 * src/gram.h (rule_t): action and action_line are new members.
21214 * src/reader.c (symbol_list): Likewise.
21215 (copy_action): Save the actions within the rule.
21216 (packgram): Save them in rule_table.
21217 * src/output.c (actions_output): New.
21218 (output_parser): Use it on `%%actions'.
21219 (output_rule_data): Don't free rule_table.
21220 (output): Do it.
21221 (prepare): Don't save the `action' muscle.
21222 * src/bison.simple: s/%%action/%%actions/.
21223
51576fb3
AD
212242001-12-15 Akim Demaille <akim@epita.fr>
21225
21226 * src/reader.c (copy_action): When --yacc, don't append a `;'
21227 to the user action: let it fail if lacking.
dee049eb 21228 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 21229
2648a72d
AD
212302001-12-14 Akim Demaille <akim@epita.fr>
21231
21232 * src/lex.c (literalchar): Simply return the char you decoded, non
21233 longer mess around with obstacks and int pointers.
21234 Adjust all callers.
21235
92790e5b
AD
212362001-12-14 Akim Demaille <akim@epita.fr>
21237
21238 * src/lex.c (literalchar): Don't escape the special characters,
21239 just decode them, and keep them as char (before, eol was output as
21240 the 2 char string `\n' etc.).
21241 * src/output.c (output_rule_data): Use quotearg to output the
21242 token strings.
21243
927c1557
PE
212442001-12-13 Paul Eggert <eggert@twinsun.com>
21245
21246 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
21247 Do not infringe on the global user namespace when using C++.
21248 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
21249 All uses of `fprintf' and `stderr' changed.
21250
21251 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
21252
ed8e1f68
AD
212532001-12-13 Akim Demaille <akim@epita.fr>
21254
21255 The computation of nullable is broken: it doesn't handle empty
21256 RHS's properly.
21257
21258 * tests/torture.at (GNU AWK Grammar): New.
21259 * tests/sets.at (Nullable): New.
21260 * src/nullable.c (set_nullable): Instead of blindly looping over
21261 `ritems', loop over the rules, and then over their rhs's.
21262
21263 Work around Autotest bugs.
21264
21265 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
21266 frame, because Autotest understand lines starting with a `+' as
21267 traces from the shell. Then, they are not processed properly.
21268 Admittedly an Autotest bug, but we don't have time to wait for
21269 Autotest to catch up.
21270 * tests/regression.at (Broken Closure): Adjust to the new table
21271 frames.
21272 Move to...
21273 * tests/sets.at: here.
21274
cb581495
AD
212752001-12-13 Akim Demaille <akim@epita.fr>
21276
21277 * src/closure.c (closure): Use nrules instead of playing tricks
21278 with BITS_PER_WORD.
21279
2e729273
AD
212802001-12-13 Akim Demaille <akim@epita.fr>
21281
21282 * src/print.c (print_actions): Output the handling of `$' as the
21283 traces do: shifting the token EOF. Before EOF was treated as a
21284 nonterminal.
21285 * tests/regression.at: Adjust some tests.
21286 * src/print_graph.c (print_core): Complete the set of items via
21287 closure. The next-to-final and final states are still unsatisfying,
21288 but that's to be addressed elsewhere.
21289 No longer output the rule numbers, but do output the state number.
21290 A single loop for the shifts + gotos is enough, but picked a
21291 distinct color for each.
21292 (print_graph): Initialize and finalize closure.
21293
107f7dfb
AD
212942001-12-13 Akim Demaille <akim@epita.fr>
21295
21296 * src/reader.c (readgram): Remove dead code, an strip useless
21297 braces.
21298 (get_type): Remove, unused.
21299
9b53a24f
AD
213002001-12-12 Akim Demaille <akim@epita.fr>
21301
21302 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
21303 on that of lib/error.c.
21304
dbfb6dcd
AD
213052001-12-12 Akim Demaille <akim@epita.fr>
21306
21307 Some hosts don't like `/' in includes.
21308
21309 * src/system.h: Include libgettext.h without qualifying the path.
21310 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
21311 $(top_srcdir).
21312
c25fb648
MA
213132001-12-11 Marc Autret <autret_m@epita.fr>
21314
21315 * src/output.c (output_parser): Remove useless muscle.
21316
710ddc4f
MA
213172001-12-11 Marc Autret <autret_m@epita.fr>
21318
21319 * src/bison.simple: Remove #line just before %%epilogue. It
21320 is now handled in ...
21321 * src/reader.c (read_additionnal_code): Add the output of a
21322 #line for the epilogue.
21323
e83d80b8
MA
213242001-12-10 Marc Autret <autret_m@epita.fr>
21325
927c1557 21326 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
21327 replace precedent remove.
21328 * src/bison.simple: Remove #line before %%prologue because
21329 %%input-line is wrong at this time.
21330
971d5158
MA
213312001-12-10 Marc Autret <autret_m@epita.fr>
21332
21333 * src/reader.c (symbols_output): Clean up.
927c1557 21334 * src/output.c (output_gram, output): Clean up.
971d5158 21335
5edafffd
AD
213362001-12-10 Akim Demaille <akim@epita.fr>
21337
21338 * src/lalr.c (initialize_lookaheads): New. Extracted from...
21339 * src/LR0.c (set_state_table): here.
21340 * src/lalr.c (lalr): Call it.
21341
0279f8e9
AD
213422001-12-10 Akim Demaille <akim@epita.fr>
21343
21344 * src/state.h (shifts): Remove the `number' member: shifts are
21345 attached to state, hence no longer need to be labelled with a
21346 state number.
21347
190c4f5f
AD
213482001-12-10 Akim Demaille <akim@epita.fr>
21349
21350 Now that states have a complete set of members, the linked list of
21351 shifts is useless: just fill directly the state's shifts member.
21352
21353 * src/state.h (shifts): Remove the `next' member.
21354 * src/LR0.c (first_state, last_state): Remove.
21355 Adjust the callers.
21356 (augment_automaton): Don't look for the shifts that must be added
21357 a shift on EOF: it is those of the state we looked for! But now,
21358 since shifts are attached, it is no longer needed to looking
21359 merely by its id: its number.
21360
2a73b93d
AD
213612001-12-10 Akim Demaille <akim@epita.fr>
21362
21363 * src/LR0.c (augment_automaton): Better variable locality.
21364 Remove an impossible branch: if there is a state corresponding to
21365 the start symbol being shifted, then there is shift for the start
21366 symbol from the initial state.
21367
74392f6a
AD
213682001-12-10 Akim Demaille <akim@epita.fr>
21369
21370 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
21371 only when appropriate: when insert_start_shifting_state' is not
21372 invoked.
21373 * tests/regression.at (Rule Line Numbers): Adjust.
21374
37c82725
AD
213752001-12-10 Akim Demaille <akim@epita.fr>
21376
21377 * src/LR0.c (augment_automaton): Now that all states have shifts,
21378 merge the two cases addition shifts to the initial state.
21379
6a164e0c
AD
213802001-12-10 Akim Demaille <akim@epita.fr>
21381
21382 * src/lalr.c (set_state_table): Move to...
21383 * src/LR0.c: here.
21384 * src/lalr.c (lalr): Don't call it...
21385 * src/LR0.c (generate_states): do it.
21386 * src/LR0.h (first_state): Remove, only the table is used.
21387
7215de24
AD
213882001-12-10 Akim Demaille <akim@epita.fr>
21389
21390 * src/LR0.h (first_shift, first_reduction): Remove.
21391 * src/lalr.c: Don't use first_shift: find shifts through the
21392 states.
21393
80e25d4d
AD
213942001-12-10 Akim Demaille <akim@epita.fr>
21395
21396 * src/LR0.c: Attach shifts to states as soon as they are
21397 computed.
21398 * src/lalr.c (set_state_table): Instead of assigning shifts to
21399 state, just assert that the mapping was properly done.
21400
0ab3728b
AD
214012001-12-10 Akim Demaille <akim@epita.fr>
21402
21403 * src/LR0.c (insert_start_shift): Rename as...
21404 (insert_start_shifting_state): this.
21405 (insert_eof_shifting_state, insert_accepting_state): New.
21406 (augment_automaton): Adjust.
21407 Better locality of the variables.
21408 When looking if the start_symbol is shifted from the initial
21409 state, using `while (... symbol != start_symbol ...)' sounds
21410 better than `while (... symbol < start_symbol ...)': If fail
21411 to see how the order between symbols could be relevant!
21412
78af9bbc
AD
214132001-12-10 Akim Demaille <akim@epita.fr>
21414
21415 * src/getargs.h: Don't declare `spec_name_prefix' and
21416 `spec_file_prefix', declared by src/files.h.
21417 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
21418 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
21419 * src/output.c (prepare): Adjust.
21420 * src/reader.c (symbols_output): Likewise.
21421 * src/vmsgetargs.c: Vaguely adjust, but who cares?
21422
bdef2a41
AD
214232001-12-10 Akim Demaille <akim@epita.fr>
21424
21425 * src/muscle_tab.c (muscle_init): NULL is a better default than
21426 `"0"'.
21427
3735969c
AD
214282001-12-10 Akim Demaille <akim@epita.fr>
21429
21430 * src/reader.c (reader): Calling symbols_output once is enough.
21431
49701457
AD
214322001-12-10 Akim Demaille <akim@epita.fr>
21433
21434 Now that states have a complete set of members, the linked list of
21435 reductions is useless: just fill directly the state's reductions
21436 member.
21437
21438 * src/state.h (struct reductions): Remove member `number' and
21439 `next'.
21440 * src/LR0.c (first_reduction, last_reduction): Remove.
21441 (save_reductions): Don't link the new reductions, store them in
21442 this_state.
21443 * src/lalr.c (set_state_table): No need to attach reductions to
21444 states, it's already done.
21445 * src/output.c (output_actions): No longer free the shifts, then
21446 the reductions, then the states: free all the states and their
21447 members.
21448
0edad749
AD
214492001-12-10 Akim Demaille <akim@epita.fr>
21450
21451 * src/options.c (OPTN, DRTV, BOTH): New.
21452 (option_table): Use them.
21453
0edad749
AD
21454 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
21455 the job of system.h.
21456 * src/options.c: Don't include stdio.h and xalloc.h for the same
21457 reasons.
21458
5449dd0f
AD
214592001-12-10 Akim Demaille <akim@epita.fr>
21460
21461 * src/output.c (output, prepare): Make sure the values of the
21462 muscles `action' and `prologue' are 0-terminated.
21463
a870c567
AD
214642001-12-10 Akim Demaille <akim@epita.fr>
21465
21466 Clean up GCC warnings.
21467
21468 * src/reader.c (copy_action): `buf' is not used.
21469 (parse_skel_decl): Be static.
21470 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
21471 * src/options.h (create_long_option_table): Have a real prototype.
21472 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
21473 (hash_delete_at): Return const void *.
21474 Adjust casts to preserve the const.
21475
80df8768
AD
214762001-12-10 Akim Demaille <akim@epita.fr>
21477
21478 * configure.in: Require 2.52g.
21479 M4 is not needed, but AUTOM4TE is.
21480 * m4/m4.m4: Remove.
21481 * tests/Makefile.am: Adjust.
21482
f693ad14
AD
214832001-12-10 Akim Demaille <akim@epita.fr>
21484
21485 One structure for states is enough, even though theoretically
21486 there are LR(0) states and LALR(1) states.
21487
21488 * src/lalr.h (state_t): Remove.
21489 (state_table): Be state_t **, not state_t *.
21490 * src/state.h (core, CORE_ALLOC): Rename as...
21491 (state_t, STATE_ALLOC): this.
21492 Add the LALR(1) members: shifts, reductions, errs.
21493 * src/LR0.c (state_table): Rename as...
21494 (state_hash): this, to avoid name clashes with the global
21495 `state_table'.
21496 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
21497 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
21498
74ffbcb6
AD
214992001-12-10 Akim Demaille <akim@epita.fr>
21500
21501 Bison dumps core on bash.y.
21502 Reported by Pascal Bart.
21503
21504 * src/warshall.c (bitmatrix_print): New.
21505 (TC): Use it.
ba0fe3c7 21506 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
21507 j must be the outer loop.
21508 * tests/regression.at (Broken Closure): New.
21509
07708e19
AD
215102001-12-05 Akim Demaille <akim@epita.fr>
21511
21512 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
21513 its argument.
ba1ecc07 21514 Reported by Peter Hamorsky.
07708e19 21515
92b16366
AD
215162001-12-05 Akim Demaille <akim@epita.fr>
21517
21518 * src/conflicts.c (err_table): Remove.
21519 (resolve_sr_conflict): Adjust.
21520 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
21521 Rename as...
21522 (state_t.reductions, state_t.shifts): this.
21523
076ab033
AD
215242001-12-05 Akim Demaille <akim@epita.fr>
21525
21526 * src/reduce.c (reduce_grammar_tables): No longer disable the
21527 removal of useless rules via CPP but via `if (0)', so that the
21528 compiler still check the code is valid.
21529 For instance, it should have noticed `rline' no longer exists: use
21530 the `line' member of rule_t.
21531 * src/gram.c (dummy, rline): Remove, unused.
21532
3843c413
AD
215332001-12-05 Akim Demaille <akim@epita.fr>
21534
21535 * src/output.c (pack_vector): Use assert, not berror.
21536 * src/main.c (berror): Remove, unused.
21537
43168960
AD
215382001-12-05 Akim Demaille <akim@epita.fr>
21539
21540 New experimental feature: if --verbose --trace output all the
21541 items of a state, not only its kernel.
21542
21543 * src/print.c (print_core): If `trace_flag', then invoke closure
21544 before outputting the items of the state (print_core is no longer
21545 a correct name them).
21546 (print_results): Invoke new_closure/free_closure if needed.
21547
b2872512
AD
215482001-12-05 Akim Demaille <akim@epita.fr>
21549
21550 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
21551 * src/closure.c, src/closure.h (itemsetsize): Rename as...
21552 (nitemset): for consistency with the rest of the project.
21553
23cbcc6c
AD
215542001-12-05 Akim Demaille <akim@epita.fr>
21555
21556 * src/closure.c (print_closure): Improve.
21557 (closure): Use it for printing input and output.
21558
03ec521c
AD
215592001-12-05 Akim Demaille <akim@epita.fr>
21560
21561 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
21562 indexed by nonterminals.
21563
3a7456dd
AD
215642001-12-05 Akim Demaille <akim@epita.fr>
21565
21566 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
21567 what it was!).
21568 * src/warshall.h: Remove accidental duplication of the content.
21569
1cbcf2e7
AD
215702001-12-05 Akim Demaille <akim@epita.fr>
21571
21572 * src/closure.c (set_fderives): De-obfuscate.
21573
84182270
AD
215742001-12-05 Akim Demaille <akim@epita.fr>
21575
21576 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
21577
3f6f053c
AD
215782001-12-05 Akim Demaille <akim@epita.fr>
21579
21580 * src/closure.c (set_firsts): De-obfuscate.
21581
7a5350ba
AD
215822001-12-05 Akim Demaille <akim@epita.fr>
21583
21584 * src/output.c (action_row): De-obfuscate
21585 using the good o' techniques: arrays not pointers, variable
21586 locality, BITISSET, RESETBIT etc.
21587
d954473d
AD
215882001-12-05 Akim Demaille <akim@epita.fr>
21589
21590 Pessimize the code to simplify it: from now on, all the states
21591 have a valid SHIFTS, which NSHIFTS is possibly 0.
21592
21593 * src/LR0.c (shifts_new): Be global and move to..
21594 * src/state.c, src/state.h: here.
21595 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
21596 * src/print_graph: Adjust.
21597
9839bbe5
AD
215982001-12-05 Akim Demaille <akim@epita.fr>
21599
21600 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
21601 * src/conflicts.c: Use it.
21602 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
21603 incorrectly ``simplified''.
21604
9f136c07
AD
216052001-12-05 Akim Demaille <akim@epita.fr>
21606
21607 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
21608 using the good o' techniques: arrays not pointers, variable
21609 locality, BITISSET, RESETBIT etc.
21610
b608206e
AD
216112001-12-05 Akim Demaille <akim@epita.fr>
21612
21613 * src/state.h (SHIFT_SYMBOL): New.
21614 * src/conflicts.c: Use it to deobfuscate.
21615
52afa962
AD
216162001-12-05 Akim Demaille <akim@epita.fr>
21617
21618 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
21619 (print_reductions): De-obfuscate using the good o' techniques:
21620 arrays not pointers, variable locality, BITISSET.
21621
e74dc321
AD
216222001-12-05 Akim Demaille <akim@epita.fr>
21623
21624 * src/conflicts.c (print_reductions): Arrays, not pointers.
21625 Use BITISSET.
21626
768fca83
AD
216272001-12-05 Akim Demaille <akim@epita.fr>
21628
21629 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21630
a17e599f
AD
216312001-12-05 Akim Demaille <akim@epita.fr>
21632
21633 * src/conflicts.c (print_reductions): Improve variable locality.
21634
a04bc341
AD
216352001-12-05 Akim Demaille <akim@epita.fr>
21636
21637 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21638
c8ea038e
AD
216392001-12-05 Akim Demaille <akim@epita.fr>
21640
21641 * src/conflicts.c (print_reductions): Improve variable locality.
21642
aa2aab3c
AD
216432001-12-05 Akim Demaille <akim@epita.fr>
21644
21645 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
21646 * src/lalr.c: Use them.
21647
b178c8cc
AD
216482001-12-05 Akim Demaille <akim@epita.fr>
21649
21650 * src/LR0.c (augment_automaton): Formatting changes.
21651 Better variable locality.
21652
f67d13aa
AD
216532001-12-05 Akim Demaille <akim@epita.fr>
21654
21655 * src/lalr.c (matrix_print): New.
21656 (transpose): Use it.
21657 Use arrays instead of pointers.
21658
c2713865
AD
216592001-12-05 Akim Demaille <akim@epita.fr>
21660
21661 * src/lalr.c (maxrhs): Move to...
21662 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
21663 * src/lalr.c (build_relations): Adjust.
21664
9887c18a
AD
216652001-12-05 Akim Demaille <akim@epita.fr>
21666
21667 * src/lalr.c (transpose): Free the memory allocated to the
21668 argument, as it is replaced by the results by the unique caller.
21669 (build_relations): Merely invoke transpose: it handles the memory
21670 deallocation.
21671 Improve variable locality.
21672 Avoid variables used as mere abbreviations.
21673 (compute_lookaheads): Use arrays instead of pointers.
21674
4d4f699c
AD
216752001-12-05 Akim Demaille <akim@epita.fr>
21676
21677 * src/lalr.c (initialize_F): Improve variable locality.
21678 Avoid variables used as mere abbreviations.
21679
80a69750
AD
216802001-12-05 Akim Demaille <akim@epita.fr>
21681
21682 * src/derives.c (print_derives): Display the ruleno.
21683 * src/lalr.c (initialize_F, transpose): Better variable locality
21684 to improve readability.
21685 Avoid variables used as mere abbreviations.
21686
fe961097
AD
216872001-12-05 Akim Demaille <akim@epita.fr>
21688
21689 * src/lalr.c (traverse): Use arrays instead of pointers.
21690
e3e4e814
AD
216912001-12-05 Akim Demaille <akim@epita.fr>
21692
21693 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
21694 the handling of squeue.
21695 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21696
630e182b
AD
216972001-12-05 Akim Demaille <akim@epita.fr>
21698
21699 Because useless nonterminals are now kept alive (instead of being
21700 `destroyed'), we now sometimes examine them, and store information
21701 related to them. Hence we need to know their number, and adjust
21702 memory allocations.
21703
21704 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
21705 static.
21706 * src/LR0.c (allocate_itemsets): The memory allocated to
21707 `symbol_count' was used for two different purpose: once to count
21708 the number of occurrences of each symbol, and later reassigned to
21709 `shift_symbol', containing the symbol that can be shifted from a
21710 given state.
21711 Deobfuscate, i.e., allocate, use and free `symbol_count' here
21712 only, and...
21713 (new_itemsets): Allocate `shift_symbol' here.
21714 (allocate_itemsets): symbol_count includes useless nonterminals.
21715 Make room for them.
21716 (free_storage): Use `free', not `XFREE', for pointers that cannot
21717 be null.
21718
81b51460
AD
217192001-12-05 Akim Demaille <akim@epita.fr>
21720
21721 * src/nullable.c (set_nullable): Deobfuscate the handling of
21722 ritem.
21723 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21724
3067fbef
AD
217252001-12-05 Akim Demaille <akim@epita.fr>
21726
21727 * src/gram.c, src/gram.h (ritem_print): New.
21728 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
21729 (This useless function was defined only to work around VMS linkers
21730 that can't handle compilation units with variables only).
21731 * src/reduce.c (dump_grammar): Use it to trace the construction of
21732 ritem.
21733
c2bea5f9
PE
217342001-12-04 Paul Eggert <eggert@twinsun.com>
21735
7d27c823
PE
21736 * src/bison.simple (union yyalloc): Change member names
21737 to be the same as the stack names.
21738 (yyparse): yyptr is now union yyalloc *, not char *.
21739 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
21740 and may generate better code on some machines.
c2bea5f9
PE
21741 (yystpcpy): Use prototype if __STDC__ is defined, not just
21742 if __cplusplus is defined.
35687a9d 21743
2c8a9dfa
AD
217442001-11-30 Akim Demaille <akim@epita.fr>
21745
21746 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
21747 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
21748 Gettext doesn't compile cleanly, and dies with -Werror.
21749 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
21750 Include WARNING_CFLAGS here.
21751 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
21752 before being defined.
21753
f4e421e6
AD
217542001-11-27 Paul Eggert <eggert@twinsun.com>
21755
21756 * lib/quotearg.h (quotearg_n, quotearg_n_style):
21757 First arg is int, not unsigned.
21758 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
21759 (SIZE_MAX, UINT_MAX): New macros.
21760 (quotearg_n_options): Abort if N is negative.
21761 Avoid overflow check on hosts where size_t is 64 bits and int
21762 is 32 bits, as overflow is impossible there.
21763 Fix off-by-one typo that caused unnecessary reallocation.
21764
7093d0f5
AD
217652001-11-29 Paul Eggert <eggert@twinsun.com>
21766
21767 Name space cleanup in generated parser.
21768
21769 * doc/bison.texinfo (Bison Parser): Discuss system headers
21770 and their effect on the user name space.
21771
21772 * src/bison.simple:
21773 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
21774 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
21775 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
21776
21777 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
21778 on user names when possible.
21779
21780 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
21781 Simplify test for whather <alloca.h> exists.
21782
21783 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
21784
21785 (<stdio.h>): Include if YYDEBUG.
21786
21787 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
21788 ! defined (yyoverflow) && ! defined (yymemcpy).
21789
21790 (yymemcpy, yyparse): Rename local variables as needed so that
21791 they all begin with 'yy'.
21792
21793 (yystrlen, yystpcpy): New functions.
21794
21795 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
21796 All uses changed.
21797
21798 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
21799 instead of relying on string.h functions. Use YYSTACK_ALLOC
21800 and YYSTACK_FREE instead of malloc and free.
21801
fd51e5ff
AD
218022001-11-30 Akim Demaille <akim@epita.fr>
21803
21804 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
21805 before their first uses.
21806 (YYBISON, YYPURE): Move to the top of the output.
21807
7d13ff5f
AD
218082001-11-30 Akim Demaille <akim@epita.fr>
21809
21810 * tests/reduce.at (Useless Nonterminals): Fix.
21811
892a3995
AD
218122001-11-30 Akim Demaille <akim@epita.fr>
21813
21814 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
21815 if body instead of `;' to pacify GCC's warnings.
21816
68f1e3ed
AD
218172001-11-30 Akim Demaille <akim@epita.fr>
21818
21819 Instead of mapping the LHS of unused rules to -1, keep the LHS
21820 valid, but flag the rules as invalid.
21821
21822 * src/gram.h (rule_t): `useful' is a new member.
21823 * src/print.c (print_grammar): Adjust.
21824 * src/derives.c (set_derives): Likewise.
21825 * src/reader.c (packgram, reduce_output): Likewise.
21826 * src/reduce.c (reduce_grammar_tables): Likewise.
21827 * tests/reduce.at (Underivable Rules, Useless Rules): New.
21828
d2d1b42b
AD
218292001-11-30 Akim Demaille <akim@epita.fr>
21830
21831 * src/reduce.c (reduce_output): Formatting changes.
21832 * src/print.c (print_results, print_grammar): Likewise.
21833 * tests/regression.at (Rule Line Numbers)
21834 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
21835
760b53a8
AD
218362001-11-30 Akim Demaille <akim@epita.fr>
21837
21838 * src/reduce.c (nonterminals_reduce): Instead of throwing away
21839 useless nonterminals, move them at the end of the symbol arrays.
21840 (reduce_output): Adjust.
21841 * tests/reduce.at (Useless Nonterminals): Adjust.
21842
00238958
AD
218432001-11-30 Akim Demaille <akim@epita.fr>
21844
21845 * src/reduce.c: Various comment/formatting changes.
21846 (nonterminals_reduce): New, extracted from...
21847 (reduce_grammar_tables): here.
21848 (reduce_grammar): Call nonterminals_reduce.
21849
396452de
PE
218502001-11-29 Paul Eggert <eggert@twinsun.com>
21851
21852 * src/bison.simple (YYSTACK_REALLOC): Remove.
21853 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
21854 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
21855 New macros.
21856 (union yyalloc): New type.
21857 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
21858 an arbitrary restriction on hosts where size_t is wider than int.
21859
21860 (yyparse): Don't dump core if alloca or malloc fails; instead, report
21861 a parser stack overflow. Allocate just one block of memory for all
21862 three stacks, instead of allocating three blocks; this typically is
21863 faster and reduces fragmentation.
21864
21865 Do not limit the number of items in the stack to a value that fits
21866 in 'int', as this is an arbitrary limit on hosts with 64-bit
21867 size_t and 32-bit int.
21868
147e184c
MA
218692001-11-29 Marc Autret <autret_m@epita.fr>
21870
21871 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
21872 of defining YYERROR_VERBOSE.
21873 [AT_DATA]: $4 is now out of C declarations in the prologue.
21874
426cf563
MA
218752001-11-28 Marc Autret <autret_m@epita.fr>
21876
21877 * src/reader.c (parse_dquoted_param): New.
21878 (parse_skel_decl): Use it.
21879 * src/lex.h: Add its prototype.
21880 * src/lex.c (literalchar): Become not static.
21881
c7925b99
MA
218822001-11-28 Marc Autret <autret_m@epita.fr>
21883
21884 * src/output.h: And put its extern declaration here.
21885 * src/output.c (error_verbose): Define here.
21886 (prepare): Echo name modification.
21887 * src/getargs.h: Clean its extern declaration.
21888 * src/getargs.c (error_verbose_flag): Remove.
21889 (getargs): Remove case 'e'.
21890 * src/options.c (option_table): 'error-verbose' is now seen as simple
21891 percent option.
21892 Include output.h.
21893
21894 * src/reader.c (read_declarations): Remove case tok_include.
21895 (parse_include_decl): Remove.
21896 * src/lex.h (token_t): Remove tok_include.
21897 * src/options.c (option_table): 'include' is now a simple command line
21898 option.
21899
5b5d1929
MA
219002001-11-28 Marc Autret <autret_m@epita.fr>
21901
21902 * src/bison.simple: Adjust muscle names.
21903 * src/muscle_tab.c (muscle_init): Also rename the muscles.
21904 * src/output.c (prepare): s/_/-/ for the muscles names.
21905 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
21906
8850be4b
MA
219072001-11-28 Marc Autret <autret_m@epita.fr>
21908
21909 * src/bison.simple: Fix debug.
21910 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
21911
4a38e613
AD
219122001-11-28 Akim Demaille <akim@epita.fr>
21913
21914 * src/LR0.c (shifts_new): New.
21915 (save_shifts, insert_start_shift, augment_automaton): Use it.
21916
4b35e1c1
AD
219172001-11-28 Akim Demaille <akim@epita.fr>
21918
21919 * src/closure.c (closure): `b' and `ruleno' denote the same value:
21920 keep ruleno only.
21921
d2b04478
AD
219222001-11-28 Akim Demaille <akim@epita.fr>
21923
21924 * src/closure.c (closure): Instead of looping over word in array
21925 then bits in words, loop over bits in array.
21926
2c4c30aa
AD
219272001-11-28 Akim Demaille <akim@epita.fr>
21928
21929 * src/closure.c (closure): No longer optimize the special case
21930 where all the bits of `ruleset[r]' are set to 0, to make the code
21931 clearer.
21932
576890b7
AD
219332001-11-28 Akim Demaille <akim@epita.fr>
21934
21935 * src/closure.c (closure): `r' and `c' are new variables, used to
21936 de-obfuscate accesses to RULESET and CORE.
21937
cb487d7d
AD
219382001-11-28 Akim Demaille <akim@epita.fr>
21939
21940 * src/reduce.c (reduce_print): Use ngettext.
21941 (dump_grammar): Improve the trace accuracy.
21942
6013d43f
AD
219432001-11-28 Akim Demaille <akim@epita.fr>
21944
21945 * src/reduce.c (dump_grammar): Don't translate trace messages.
21946
cb4956ee
AD
219472001-11-28 Akim Demaille <akim@epita.fr>
21948
21949 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
21950 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
21951 as all tags are free'ed afterwards.
21952 From Enrico Scholz.
21953
648185ab
PE
219542001-11-27 Paul Eggert <eggert@twinsun.com>
21955
21956 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
21957 use alloca when we didn't want to, and vice versa.
21958
68254a03
MA
219592001-11-27 Marc Autret <autret_m@epita.fr>
21960
9113b58f
AD
21961 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
21962 initialization.
68254a03
MA
21963 * src/output.c (prepare): Remove its update.
21964
04d843a2
MA
219652001-11-27 Marc Autret <autret_m@epita.fr>
21966
21967 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
21968 Use %error-verbose.
21969
d2079671 219702001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
21971
21972 * src/bison.simple: Remove YYERROR_VERBOSE using.
21973 Use %%error_verbose.
21974 (yyparse): Likewise.
21975 * src/output.c (prepare): Give its final value.
21976 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
21977 * src/getargs.h: Add its extern declaration.
21978 * src/getargs.c (error_verbose_flag): New int.
21979 (getargs): Update to catch new case.
21980 * src/options.c (option_table): 'error-verbose' is a new option.
21981 (shortopts): Update.
21982
e0327bc8
AD
219832001-11-27 Akim Demaille <akim@epita.fr>
21984
21985 * src/system.h: Use intl/libgettext.h.
21986 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
21987
000f1a3c
AD
219882001-11-27 Akim Demaille <akim@epita.fr>
21989
21990 * tests/torture.at (Exploding the Stack Size with Malloc):
21991 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
21992
26cfe0be
AD
219932001-11-27 Akim Demaille <akim@epita.fr>
21994
21995 * src/files.c: Include error.h.
21996 Reported by Hans Aberg.
21997
f6bd5427
MA
219982001-11-26 Marc Autret <autret_m@epita.fr>
21999
d2079671 22000 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
22001 (read_declarations): Add case tok_include.
22002 * src/getargs.h (include): Add its extern definition.
22003 * src/getargs.c (include): New const char *.
22004 (getargs): Add case '-I'.
22005 * src/options.c (option_table): Add include as command line and
22006 percent option.
22007 * src/lex.h (token_t): Add tok_include.
22008
2ca209c1
AD
220092001-11-26 Akim Demaille <akim@epita.fr>
22010
22011 * src/reader.c (readgram): Make sure rules for mid-rule actions
22012 have a lineno equal to that of their host rule.
22013 Reported by Hans Aberg.
22014 * tests/regression.at (Rule Line Numbers): New.
22015
0e41b407
AD
220162001-11-26 Akim Demaille <akim@epita.fr>
22017
22018 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
22019 size_ts.
22020
220212001-11-26 Akim Demaille <akim@epita.fr>
22022
22023 * src/complain.c, src/complain.h (error): Remove, provided by
22024 lib/error.[ch].
22025
e0c40012
AD
220262001-11-26 Akim Demaille <akim@epita.fr>
22027
22028 * src/reader.c (read_declarations): Don't abort on tok_illegal,
22029 issue an error message.
22030 * tests/regression.at (Invalid %directive): New.
22031 Reported by Hans Aberg.
22032
5e147124
AD
220332001-11-26 Akim Demaille <akim@epita.fr>
22034
22035 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
22036 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
22037
a034c8b8
AD
220382001-11-26 Akim Demaille <akim@epita.fr>
22039
22040 * src/conflicts.c (conflicts_print): Don't complain at all when
22041 there are no reduce/reduce conflicts, and as many shift/reduce
22042 conflicts as expected.
22043 * tests/regression.at (%expect right): Adjust.
22044
c64a20f3
AD
220452001-11-23 Akim Demaille <akim@epita.fr>
22046
22047 * lib/alloca.c: Update, from fileutils.
22048
5b0d29bb
AD
220492001-11-23 Akim Demaille <akim@epita.fr>
22050
22051 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
22052
722c4bfe
AD
220532001-11-23 Akim Demaille <akim@epita.fr>
22054
22055 * src/system.h: Include alloca.h.
22056 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
22057
6255b435
AD
220582001-11-23 Akim Demaille <akim@epita.fr>
22059
22060 * src/print_graph.c (print_actions): Remove `rule', unused.
22061 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
22062 pacify GCC's signed < unsigned warnings.
22063 * src/closure.c (itemsetsize): Likewise.
22064 * src/reader.c (symbol_list_new): Static.
22065
b29b2ed5
AD
220662001-11-23 Akim Demaille <akim@epita.fr>
22067
22068 Attaching lineno to buckets is stupid, since only one copy of each
22069 symbol is kept, only the line of the first occurrence is kept too.
22070
22071 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
22072 * src/reader.c (rline_allocated): Remove, unused.
22073 (symbol_list): Have a `line' member.
22074 (symbol_list_new): New.
22075 (readgram): Use it.
22076 * src/print.c (print_grammar): Output the rule line numbers.
22077 * tests/regression.at (Solved SR Conflicts)
22078 (Unresolved SR Conflicts): Adjust.
22079 Reported by Hans Aberg.
22080
a81b1d4a
MA
220812001-11-22 Marc Autret <autret_m@epita.fr>
22082
22083 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
22084
c1ecb3c1
MA
220852001-11-22 Marc Autret <autret_m@epita.fr>
22086
22087 * src/muscle_tab.c (muscle_init): Remove initialization of
22088 skeleton muscle.
22089 * src/output.c (output_master_parser): Do it here.
22090
fbe01355
AD
220912001-11-20 Akim Demaille <akim@epita.fr>
22092
22093 * po/sv.po: New.
22094 * configure.in (ALL_LINGUAS): Adjust.
22095 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
22096 longer contains strings to translate.
22097
81e895c0
AD
220982001-11-19 Akim Demaille <akim@epita.fr>
22099
22100 * src/conflicts.c (conflicts_print): Add a missing \n.
22101
6bb1878b
AD
221022001-11-19 Akim Demaille <akim@epita.fr>
22103
22104 * src/nullable.c (nullable_print): New.
22105 (set_nullable): Call it when tracing.
22106 Better locality of variables.
22107
d9ec2d07
AD
221082001-11-19 Akim Demaille <akim@epita.fr>
22109
22110 * src/print.c (print_actions): Better locality of variables.
22111
720e5c1b
AD
221122001-11-19 Akim Demaille <akim@epita.fr>
22113
22114 * src/derives.c (print_derives): Fix and enrich.
22115 * src/closure.c (print_fderives): Likewise.
22116
fb908786
AD
221172001-11-19 Akim Demaille <akim@epita.fr>
22118
22119 * src/closure.c (itemsetend): Remove, replaced with...
22120 (itemsetsize): new.
22121
125ecb56
AD
221222001-11-19 Akim Demaille <akim@epita.fr>
22123
22124 * src/LR0.c (kernel_end): Remove, replaced with...
22125 (kernel_size): new.
22126
d8cf039f
AD
221272001-11-19 Akim Demaille <akim@epita.fr>
22128
22129 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
22130 to clarify.
22131
7bec0760
AD
221322001-11-19 Akim Demaille <akim@epita.fr>
22133
22134 * src/closure.c (closure): Use arrays instead of pointers to clarify.
22135
c87d4863
AD
221362001-11-19 Akim Demaille <akim@epita.fr>
22137
22138 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
22139 trace messages.
22140 * src/LR0.c: Likewise.
22141 (allocate_itemsets): Use arrays instead of pointers to clarify.
22142
9bfe901c
AD
221432001-11-19 Akim Demaille <akim@epita.fr>
22144
22145 * src/getargs.c (statistics_flag): Replace with...
22146 (trace_flag): New.
22147 (longopts): Accept --trace instead of --statistics.
22148 * src/getargs.h, src/options.c: Adjust.
22149 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
22150 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
22151
97db7bd4
AD
221522001-11-19 Akim Demaille <akim@epita.fr>
22153
cc72668c 22154 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
22155 pointers to clarify the code.
22156 (save_reductions, save_shifts): Factor common parts of alternatives.
22157
2c5f66ed
AD
221582001-11-19 Akim Demaille <akim@epita.fr>
22159
22160 * src/LR0.c (new_state, get_state): Complete TRACE code.
22161 * src/closure.c: Include `reader.h' to get `tags', needed by the
22162 trace code.
22163 Rename the conditional DEBUG as TRACE.
22164 Output consistently TRACEs to stderr, not stdout.
22165 * src/derives.c: Likewise.
22166 * src/reduce.c: (inaccessable_symbols): Using if is better style
22167 than goto.
22168 Use `#if TRACE' instead of `#if 0' for tracing code.
22169
300f275f
AD
221702001-11-19 Akim Demaille <akim@epita.fr>
22171
22172 * src/system.h (LIST_FREE, shortcpy): New.
22173 * src/LR0.c: Use them.
22174 * src/output.c (free_itemsets, free_reductions, free_shifts):
22175 Remove, replaced by LIST_FREE.
22176
f59c437a
AD
221772001-11-19 Akim Demaille <akim@epita.fr>
22178
22179 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
22180 (REDUCTIONS_ALLOC): New.
22181 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
22182 allocation.
22183
6986fd9e
AD
221842001-11-19 Akim Demaille <akim@epita.fr>
22185
22186 * src/LR0.c (new_state): Complete trace code.
22187 * src/nullable.c (set_nullable): Don't translate traces.
22188
4bc30f78
AD
221892001-11-19 Akim Demaille <akim@epita.fr>
22190
22191 * src/print_graph.c (print_core): Better locality of variables.
22192 * src/print.c (print_core): Likewise.
22193
08a946e0
AD
221942001-11-19 Akim Demaille <akim@epita.fr>
22195
22196 * src/vcg.c: You do the output, so you are responsible of the
22197 handling of VCG syntax, in particular: use quotearg.
22198 * src/print_graph.c: Don't.
22199 (print_actions): Don't output the actions as part of the nodes,
22200 since that's the job of the edges.
22201 (print_state): Don't output by hand: fill the node description,
9bfe901c 22202 and ask for its output.
08a946e0 22203
f0473484
AD
222042001-11-19 Akim Demaille <akim@epita.fr>
22205
cc72668c
AD
22206 * src/bison.simple (yyparse): When verbosely reporting an error,
22207 no longer put additional quotes around token names.
f0473484
AD
22208 * tests/calc.at: Adjust.
22209
e41dc700
AD
222102001-11-19 Akim Demaille <akim@epita.fr>
22211
22212 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
22213 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
22214 * src/output.c: Adjust.
22215
652a871c
AD
222162001-11-19 Akim Demaille <akim@epita.fr>
22217
22218 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
22219 (rule_t): this.
22220 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
22221
b2ed6e58
AD
222222001-11-19 Akim Demaille <akim@epita.fr>
22223
22224 * src/gram.h (rule_t): New.
22225 (rule_table): New.
22226 (rrhs, rlhs): Remove, part of state_t.
22227 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
22228 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
22229 * src/reader.c, src/reduce.c: Adjust.
22230
edad7067
AD
222312001-11-19 Akim Demaille <akim@epita.fr>
22232
22233 * src/reader.c (symbols_output): New, extracted from...
22234 (packsymbols): Here.
22235 (reader): Call it.
22236
3feec034
AD
222372001-11-19 Akim Demaille <akim@epita.fr>
22238
22239 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
22240 (maxrhs): this new function.
22241
ddcd5fdf
AD
222422001-11-19 Akim Demaille <akim@epita.fr>
22243
cc72668c 22244 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
22245 Adjust.
22246
bb527fc2
AD
222472001-11-19 Akim Demaille <akim@epita.fr>
22248
cc72668c 22249 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
22250 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22251 * src/lalr.c: Adjust.
22252
a845a697
AD
222532001-11-19 Akim Demaille <akim@epita.fr>
22254
22255 * src/lalr.c (initialize_LA): Only initialize LA. Let...
22256 (set_state_table): handle the `lookaheads' members.
22257
f004bf6a
AD
222582001-11-19 Akim Demaille <akim@epita.fr>
22259
cc72668c
AD
22260 * src/lalr.h (lookaheads): Removed array, whose contents is now
22261 a member of...
f004bf6a
AD
22262 (state_t): this structure.
22263 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22264 Adjust.
22265
de326cc0
AD
222662001-11-19 Akim Demaille <akim@epita.fr>
22267
cc72668c
AD
22268 * src/lalr.h (consistent): Removed array, whose contents is now
22269 a member of...
de326cc0
AD
22270 (state_t): this structure.
22271 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22272 Adjust.
22273
90b4416b
AD
222742001-11-19 Akim Demaille <akim@epita.fr>
22275
cc72668c
AD
22276 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
22277 contents are now members of...
90b4416b
AD
22278 (state_t): this structure.
22279 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22280 Adjust.
22281
9703cc49
AD
222822001-11-19 Akim Demaille <akim@epita.fr>
22283
22284 * src/lalr.h (state_t): New.
22285 (state_table): Be a state_t * instead of a core **.
22286 (accessing_symbol): Remove, part of state_t.
22287 * src/lalr.c: Adjust.
22288 (set_accessing_symbol): Merge into...
22289 (set_state_table): this.
22290 * src/print_graph.c, src/conflicts.c: Adjust.
22291
d803322e
AD
222922001-11-14 Akim Demaille <akim@epita.fr>
22293
22294 * tests/calc.at, tests/output.at, tests/regression.at,
22295 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
22296 now the tests are run in private dirs, therefore AC_CLEANUP and
22297 family can be simplified to 0-ary.
22298 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
22299 use abs. path to find config.h.
22300 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
22301 stderr, there can be way too much random noise.
22302 Instead pass -Werror to GCC and rely on the exit status.
22303 Reported by Wolfram Wagner.
22304
3d76b07d
AD
223052001-11-14 Akim Demaille <akim@epita.fr>
22306
22307 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
22308 defined only if yyoverflow is defined, to avoid `warning: unused
22309 variable `yyvs1''.
22310 Reported by The Test Suite.
22311
09b503c8
AD
223122001-11-14 Akim Demaille <akim@epita.fr>
22313
22314 * src/print.c: Include reduce.h.
22315 Reported by Hans Aberg.
22316
223172001-11-14 Akim Demaille <akim@epita.fr>
22318
22319 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
22320 Revert a previous patch: these are really const.
22321 * src/conflicts.c (conflict_report): Additional useless pair of
22322 braces to pacify GCC's warnings for `if () if () {} else {}'.
22323 * src/lex.c (parse_percent_token): Replace equal_offset with
22324 arg_offset.
22325 arg is const.
22326 Be sure to strdup `arg' when used, since there is no reason for
22327 token_buffer not to change.
22328
0f37a994
AD
223292001-11-14 Akim Demaille <akim@epita.fr>
22330
22331 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
22332 definition.
22333 * src/main.c (main): Use them.
22334 Suggested by Hans Aberg.
22335
d39d93b8
AD
223362001-11-12 Akim Demaille <akim@epita.fr>
22337
22338 * src/system.h (ngettext): Now that we use ngettext, be sure to
22339 provide a default definition when NLS are not used.
22340
9edcd895
AD
223412001-11-12 Akim Demaille <akim@epita.fr>
22342
22343 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
22344 Use @kbd to denote user input.
22345 (Language and Grammar): ANSIfy the example.
22346 Adjust its layout for info/notinfo.
22347 (Location Tracking Calc): Output error messages to stderr.
22348 Output locations in a more GNUtically correct way.
22349 Fix a couple of Englishos.
22350 Adjust @group/@end group pairs.
22351
7da99ede
AD
223522001-11-12 Akim Demaille <akim@epita.fr>
22353
e3aa65c5 22354 %expect was not functioning at all.
7da99ede
AD
22355
22356 * src/conflicts.c (expected_conflicts): Set to -1.
22357 (conflict_report): Use ngettext.
22358 (conflicts_print): Check %expect and make its violation an error.
22359 * doc/bison.texinfo (Expect Decl): Adjust.
22360 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
22361 * tests/regression.at (%expect not enough, %expect right)
22362 (%expect too much): New.
22363
ba9dda1a
AD
223642001-11-12 Akim Demaille <akim@epita.fr>
22365
22366 * tests/regression.at (Conflicts): Rename as...
22367 (Unresolved SR Conflicts): this.
22368 (Solved SR Conflicts): New.
22369
337c5bd1
AD
223702001-11-12 Akim Demaille <akim@epita.fr>
22371
22372 * src/reduce.c (print_results): Rename as...
22373 (reduce_output): This.
22374 Output to OUT, passed as argument, instead of output_obstack.
22375 (dump_grammar): Likewise.
22376 (reduce_free): New.
22377 Also free V1.
22378 (reduce_grammar): No longer call reduce_output, since...
22379 * src/print.c (print_results): do it.
22380 * src/main.c (main): Call reduce_free;
22381
c73a41af
AD
223822001-11-12 Akim Demaille <akim@epita.fr>
22383
22384 * src/conflicts.c (print_reductions): Accept OUT as argument.
22385 Output to it, not to output_obstack.
22386 * src/print.c (print_actions): Adjust.
22387
0df87bb6
AD
223882001-11-12 Akim Demaille <akim@epita.fr>
22389
22390 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
22391 the result instead of using...
22392 (src_total, rrc_total, src_count, rrc_count): Remove.
22393 (any_conflicts): Remove.
22394 (print_conflicts): Split into...
22395 (conflicts_print, conflicts_output): New.
22396 * src/conflicts.h: Adjust.
22397 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 22398 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
22399 * tests/regression.at (Conflicts): New.
22400 Reported by Tom Lane.
22401
e4d3d4de
AD
224022001-11-12 Akim Demaille <akim@epita.fr>
22403
22404 * tests/regression.at (Invalid input): Remove, duplicate with
22405 ``Invalid input: 1''.
22406
6d7d248e
AD
224072001-11-12 Akim Demaille <akim@epita.fr>
22408
22409 * tests/torture.at (AT_DATA_STACK_TORTURE)
22410 (Exploding the Stack Size with Alloca)
22411 (Exploding the Stack Size with Malloc): New.
22412
e9e4c321
AD
224132001-11-12 Akim Demaille <akim@epita.fr>
22414
22415 * src/bison.simple (YYSTACK_REALLOC): New.
22416 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 22417 Reported by Per Allansson.
e9e4c321 22418
5f7e0832
AD
224192001-11-12 Pascal Bart <pascal.bart@epita.fr>
22420
22421 * src/bison.simple: Define type yystype instead of YYSTYPE, and
22422 define CPP macro, which substitute YYSTYPE by yystype.
22423 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
22424 with yyltype/YYLTYPE. This allows inclusion of the generated
22425 header within the parser if the compiler, such as GGC, accepts
22426 multiple equivalent #defines.
22427 From Akim.
22428
e3f1699f
AD
224292001-11-05 Akim Demaille <akim@epita.fr>
22430
22431 * src/reader.c (symbols_output): New, extracted from...
22432 (packsymbols): here.
22433 (reader): Adjust.
22434
65be0866
AD
224352001-11-05 Akim Demaille <akim@epita.fr>
22436
22437 * src/lex.c (parse_percent_token): s/quotearg/quote/.
22438
e4d910bf
AD
224392001-11-05 Akim Demaille <akim@epita.fr>
22440
22441 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
22442 pattern.
22443
951366c1
AD
224442001-11-05 Akim Demaille <akim@epita.fr>
22445
22446 * src/options.h (struct option_table_struct): set_flags is void*.
22447 * src/options.c (longopts): Support `--output' and `%output'.
22448 (usage): Adjust.
22449 * src/lex.h (tok_setopt): Remove, replaced with...
22450 (tok_intopt, tok_stropt): these new guys.
22451 * src/lex.c (getopt.h): Not needed.
22452 (token_buffer, unlexed_token_buffer): Not const.
22453 (percent_table): Promote `-' over `_' in directive names.
22454 Active `%name-prefix', `file-prefix', and `output'.
22455 (parse_percent_token): Accept possible arguments to directives.
22456 Promote `-' over `_' in directive names.
22457
d8988b2f
AD
224582001-11-04 Akim Demaille <akim@epita.fr>
22459
22460 * doc/bison.texinfo (Decl Summary): Split the list into
22461 `directives for grammars' and `directives for bison'.
22462 Sort'em.
22463 Add description of `%name-prefix', `file-prefix', and `output'.
22464 Promote `-' over `_' in directive names.
22465 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
22466 Simplify the description of `--name-prefix'.
22467 Promote `-' over `_' in directive names.
22468 Promote `--output' over `--output-file'.
22469 Fix the description of `--defines'.
22470 * tests/output.at: Exercise %file-prefix and %output.
22471
6468d18e
AD
224722001-11-02 Akim Demaille <akim@epita.fr>
22473
22474 * doc/refcard.tex: Update.
22475
6b7e85b9
AD
224762001-11-02 Akim Demaille <akim@epita.fr>
22477
22478 * src/symtab.h (SUNDEF): New.
22479 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
22480 stand for `uninitialized', instead of 0.
22481 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
22482 * src/lex.c (lex): Adjust.
22483
22484 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
22485 Number it 0.
22486 Let yylex return it instead of a plain 0.
22487 Reported by Dick Streefland.
22488
cd5aafcf
AD
224892001-11-02 Akim Demaille <akim@epita.fr>
22490
22491 * tests/regression.at (Mixing %token styles): New test.
22492
037ca2f1
AD
224932001-11-02 Akim Demaille <akim@epita.fr>
22494
22495 * src/reader.c (parse_thong_decl): Formatting changes.
22496 (token_translations_init): New, extracted from...
22497 (packsymbols): Here.
22498 Adjust.
22499
270a173c
AD
225002001-11-01 Akim Demaille <akim@epita.fr>
22501
22502 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
22503 Check that `9foo.y' produces correct cpp guards.
22504 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
22505 guards.
22506 Reported by Wwp.
22507
561f9a30
AD
225082001-11-01 Akim Demaille <akim@epita.fr>
22509
22510 * tests/regression.at (Invalid input: 2): New.
22511 * src/lex.c (unlexed_token_buffer): New.
22512 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
22513 too.
22514 Reported by Wwp.
22515
f987e9d2
AD
225162001-11-01 Akim Demaille <akim@epita.fr>
22517
22518 * tests/calc.at: Catch up with 1.30.
22519 * configure.in: Bump to 1.49a.
22520 Adjust to newer Autotest.
22521
0846f581
PB
225222001-10-19 Pascal Bart <pascal.bart@epita.fr>
22523
22524 * src/conflicts.c: Move global variables rrc_total and src_total ...
22525 (print_conflicts): here.
22526 * src/output.c (output): Free global variable user_toknums.
22527 * src/lex.c (token_obstack): Become static.
22528
3c1a79b3
AD
225292001-10-18 Akim Demaille <akim@epita.fr>
22530
22531 * tests/atlocal.in (GCC): Add.
22532 * tests/calc.at: s/m4_match/m4_bmatch/.
22533 s/m4_patsubst/m4_bpatsubst/.
22534 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
22535 * configure.in: AC_SUBST(GCC).
22536
5d52e7d0
MA
225372001-10-14 Marc Autret <autret_m@epita.fr>
22538
22539 * src/options.c (create_long_option_table): Fix.
22540
631aa1d3
AD
225412001-10-10 Akim Demaille <akim@epita.fr>
22542
22543 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
22544
f6ec6d13
AD
225452001-10-04 Akim Demaille <akim@epita.fr>
22546
22547 * src/reader.c (parse_union_decl): Push the caracters in
22548 union_obstack, not attrs_obstack.
22549
342b8b6e
AD
225502001-10-04 Akim Demaille <akim@epita.fr>
22551
22552 Merge in the branch 1.29.
22553
22554 * src/reader.c (packsymbols): Use a temporary obstack for
22555 `%%tokendef', since output_stack is already used elsewhere.
22556
22557 2001-10-02 Akim Demaille <akim@epita.fr>
22558
22559 Bump 1.29d.
22560
22561 2001-10-02 Akim Demaille <akim@epita.fr>
22562
22563 Version 1.29c.
22564
22565 2001-10-02 Akim Demaille <akim@epita.fr>
22566
22567 * tests/regression.at (Invalid CPP headers): New.
22568 From Alexander Belopolsky.
22569 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
22570
22571 2001-10-02 Akim Demaille <akim@epita.fr>
22572
22573 * tests/regression.at (Invalid input): New.
22574 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
22575 Reported by Shura.
22576
22577 2001-10-02 Akim Demaille <akim@epita.fr>
22578
22579 * tests/calc.at: Now that --debug works, the tests must be adjusted.
22580
22581 2001-10-02 Akim Demaille <akim@epita.fr>
22582
22583 * src/output.c (output_parser): Assert `skeleton'.
22584 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
22585 systems.
22586 From Shura.
22587
22588 2001-10-01 Marc Autret <autret_m@epita.fr>
22589
22590 * src/lex.h: Echo modifications.
22591 * src/lex.c (unlex): Parameter is now token_t.
22592 From Hans Aberg.
22593
22594 2001-10-01 Marc Autret <autret_m@epita.fr>
22595
22596 * src/main.c: Include lex.h.
22597 From Hans Aberg.
22598
22599 2001-09-29 Akim Demaille <akim@epita.fr>
22600
22601 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
22602
22603 2001-09-28 Akim Demaille <akim@epita.fr>
22604
22605 * tests/testsuite.at: Update to newer Autotest.
22606 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
22607
22608 2001-09-27 Akim Demaille <akim@epita.fr>
22609
22610 Position independent wrapper.
22611
22612 * tests/bison: Remove.
22613 * tests/bison.in: New.
22614 * configure.in: Adjust.
22615
22616 2001-09-27 Paul Eggert <eggert@twinsun.com>
22617
22618 Port quotearg fixes from tar 1.13.24.
22619
22620 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
22621 tm to be declared.
22622 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
22623 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
22624
22625 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
22626 * m4/mbrtowc.m4: New file.
22627 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
22628 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
22629
22630 2001-09-27 Akim Demaille <akim@epita.fr>
22631
22632 Bump to 1.29c.
22633
22634 2001-09-27 Akim Demaille <akim@epita.fr>
22635
22636 Version 1.29b.
22637
22638 2001-09-25 Akim Demaille <akim@epita.fr>
22639
22640 * src/system.h: Include `xalloc.h'.
22641 Remove it from the C files.
22642 * src/files.c (output_files): Free the obstacks.
22643 * src/lex.c (init_lex): Rename as...
22644 (lex_init): this.
22645 (lex_free): New.
22646 * src/main.c (main): Use it.
22647
22648 2001-09-24 Marc Autret <autret_m@epita.fr>
22649
22650 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
22651 to output informations in fout (FILE*).
22652 (open_graph, close_graph): Likewise.
22653 (output_graph, output_edge, output_node): Likewise.
22654 * src/vcg.h: Update function prototypes.
22655 * src/print_graph.c (print_graph): Open output graph file.
22656 (print_actions): Adjust.
22657 * src/files.h: Remove extern declaration.
22658 * src/files.c: Remove graph_obstack declaration.
22659 (open_files): Remove graph_obstack initialization.
22660 (output_files): Remove graph_obstack saving.
22661
22662 2001-09-24 Marc Autret <autret_m@epita.fr>
22663
22664 * src/files.c (compute_output_file_names): Fix.
22665
22666 2001-09-24 Marc Autret <autret_m@epita.fr>,
22667 Akim Demaille <akim@epita.fr>
22668
22669 * src/reader.c (reader): Remove call to free_symtab ().
22670 * src/main.c (main): Call it here.
22671 Include symtab.h.
22672 * src/conflicts.c (initialize_conflicts): Rename as...
22673 (solve_conflicts): this.
22674 * src/print.c (print_core, print_actions, print_state)
22675 (print_grammar): Dump to a file instead a `output_obstack'.
22676 (print_results): Dump `output_obstack', and then proceed with the
22677 FILE *.
22678 * src/files.c (compute_output_file_names, close_files): New.
22679 (output_files): Adjust.
22680 * src/main.c (main): Adjust.
22681
22682 2001-09-23 Marc Autret <autret_m@epita.fr>
22683
22684 * src/files.c (compute_header_macro): Computes header macro name
22685 from spec_defines_file when given.
22686
22687 2001-09-23 Marc Autret <autret_m@epita.fr>
22688
22689 * src/files.c (output_files): Add default extensions.
22690
22691 2001-09-22 Akim Demaille <akim@epita.fr>
22692
22693 * src/conflicts.c (finalize_conflicts): Rename as...
22694 (free_conflicts): this.
22695
22696 2001-09-22 Akim Demaille <akim@epita.fr>
22697
22698 * src/gram.c (gram_free): Rename back as...
22699 (dummy): this.
22700 (output_token_translations): Free `token_translations'.
22701 * src/symtab.c (free_symtab): Free the tag field.
22702
22703 2001-09-22 Akim Demaille <akim@epita.fr>
22704
22705 Remove `translations' as it is always set to true.
22706
22707 * src/gram.h: Adjust.
22708 * src/reader.c (packsymbols, parse_token_decl): Adjust
22709 * src/print.c (print_grammar): Adjust.
22710 * src/output.c (output_token_translations): Adjust.
22711 * src/lex.c (lex): Adjust.
22712 * src/gram.c: Be sure the set pointers to NULL.
22713 (dummy): Rename as...
22714 (gram_free): this.
22715
22716 2001-09-22 Akim Demaille <akim@epita.fr>
22717
22718 * configure.in: Invoke AM_LIB_DMALLOC.
22719 * src/system.h: Use dmalloc.
22720 * src/LR0.c: Be sure to have pointers initialized to NULL.
22721 (allocate_itemsets): Allocate kernel_items only if needed.
22722
22723 2001-09-22 Akim Demaille <akim@epita.fr>
22724
22725 * configure.in: Bump to 1.29b.
22726 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
22727 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
22728 need xmalloc.c in calc.y.
22729 From Pascal Bart.
22730
22731 2001-09-21 Akim Demaille <akim@epita.fr>
22732
22733 Version 1.29a.
22734 * Makefile.maint, config/config.guess, config/config.sub,
22735 * config/missing: Update from masters.
22736 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
22737 upon package.m4.
22738 * configure.in (ALL_LINGUAS): Add `tr'.
22739
22740 2001-09-21 Akim Demaille <akim@epita.fr>
22741
22742 * tests/Makefile.am (package.m4): Move to...
22743 ($(srcdir)/$(TESTSUITE)): here.
22744
22745 2001-09-20 Akim Demaille <akim@epita.fr>
22746
22747 * src/complain.c: No longer try to be standalone: use system.h.
22748 Don't assume __STDC__ is defined to 1. Just test if it is defined.
22749 * src/complain.h: Likewise.
22750 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
22751 Remove the unused variable `n'.
22752 From Albert Chin-A-Young.
22753
22754 2001-09-18 Marc Autret <autret_m@epita.fr>
22755
22756 * doc/bison.1: Update.
22757 * doc/bison.texinfo (Bison Options): Update --defines and --graph
22758 descriptions.
22759 (Option Cross Key): Update.
22760 Add --graph.
22761
22762 2001-09-18 Marc Autret <autret_m@epita.fr>
22763
22764 * tests/regression.at: New test (comment in %union).
22765
22766 2001-09-18 Marc Autret <autret_m@epita.fr>
22767
22768 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
22769 do that.
22770 Reported by Keith Browne.
22771
22772 2001-09-18 Marc Autret <autret_m@epita.fr>
22773
22774 * tests/output.at: Add tests for --defines and --graph.
22775
22776 2001-09-18 Marc Autret <autret_m@epita.fr>
22777
22778 * tests/output.at: Removes tests of %{header,src}_extension features.
22779
22780 2001-09-18 Akim Demaille <akim@epita.fr>
22781
22782 * tests/Makefile.am (package.m4): New.
22783 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
22784 (_AT_CHECK_CALC_ERROR): Likewise.
22785 Factor the `, ' part of verbose error messages.
22786
22787 2001-09-18 Marc Autret <autret_m@epita.fr>
22788
22789 * src/getargs.c (longopts): Declare --defines and --graph as options
22790 with optional arguments.
22791 * src/files.h: Add extern declarations.
22792 * src/files.c (spec_graph_file, spec_defines_file): New.
22793 (output_files): Update.
22794 Remove CPP-outed code.
22795
22796 2001-09-18 Marc Autret <autret_m@epita.fr>
22797
22798 Turn off %{source,header}_extension feature.
22799
22800 * src/files.c (compute_exts_from_gf): Update.
22801 (compute_exts_from_src): Update.
22802 (output_files): CPP-out useless code.
22803 * src/files.h: Remove {header,source}_extension extern declarations.
22804 * src/reader.c (parse_dquoted_param): CPP-out.
22805 (parse_header_extension_decl): Remove.
22806 (parse_source_extension_decl): Remove.
22807 (read_declarations): Remove cases tok_{hdrext,srcext}.
22808 * src/lex.c (percent_table): Remove {header,source}_extension entries.
22809 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
22810
22811 2001-09-10 Akim Demaille <akim@epita.fr>
22812
22813 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
22814 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
22815 (AT_CHECK_OUTPUT): this.
22816 Merely check ls' exit status, its output is useless.
22817
22818 2001-09-10 Akim Demaille <akim@epita.fr>
22819
22820 * tests/calc.at: Use m4_match.
22821 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
22822
22823 2001-09-10 Marc Autret <autret_m@epita.fr>,
22824 Akim Demaille <akim@epita.fr>
22825
22826 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
22827 enum color_e.
22828 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
22829 to `normal'.
22830 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
22831 * src/lex.h: Adjust prototype.
22832 (token_t): Add `tok_undef'.
22833 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
22834 (parse_percent_token): Now returns token_t.
22835 Add default statement in switch.
22836 (lex): Separate `c' as an input variable, from the token_t result
22837 part.
22838 (unlexed): Is a token_t.
22839
22840 2001-09-10 Akim Demaille <akim@epita.fr>
22841
22842 * configure.in: Bump to 1.29a.
22843
22844 2001-09-07 Akim Demaille <akim@epita.fr>
22845
22846 Version 1.29.
22847
22848 2001-08-30 Akim Demaille <akim@epita.fr>
22849
22850 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
22851 * m4/atconfig.m4: Remove.
22852 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
22853 * tests/bison: New.
22854 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
22855 m4_if, m4_patsubst, and m4_regexp.
22856 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
22857 `input' file instead of echo.
22858
22859 2001-08-29 Akim Demaille <akim@epita.fr>
22860
22861 Bump to 1.28e.
22862
22863 2001-08-29 Akim Demaille <akim@epita.fr>
22864
22865 Version 1.28d.
22866
22867 2001-08-29 Paul Eggert <eggert@twinsun.com>
22868
22869 * src/bison.simple (yyparse): Don't take the address of an
22870 item before the start of an array, as that doesn't conform to
22871 the C Standard.
22872
22873 2001-08-29 Robert Anisko <anisko_r@epita.fr>
22874
22875 * doc/bison.texinfo (Location Tracking Calc): New node.
22876
22877 2001-08-29 Paul Eggert <eggert@twinsun.com>
22878
22879 * src/output.c (output): Do not define const, as this now
22880 causes more problems than it cures.
22881
22882 2001-08-29 Akim Demaille <akim@epita.fr>
22883
22884 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
22885 the nodes.
22886 Be sure to tag the `detailmenu'.
22887
22888 2001-08-29 Akim Demaille <akim@epita.fr>
22889
22890 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
22891 download in a tmp dir.
22892
22893 2001-08-28 Marc Autret <autret_m@epita.fr>
22894
22895 * config/depcomp: New file.
22896
22897 2001-08-28 Marc Autret <autret_m@epita.fr>
22898
22899 * doc/bison.1 (mandoc): Adjust.
22900 From Juan Manuel Guerrero.
22901
22902 2001-08-28 Marc Autret <autret_m@epita.fr>
22903
22904 * src/print_graph.c (print_state): Fix.
22905
22906 2001-08-27 Marc Autret <autret_m@epita.fr>
22907
22908 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
22909 char * members.
22910 Echo modifications to the functions prototypes.
22911 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
22912
22913 2001-08-27 Marc Autret <autret_m@epita.fr>
22914
22915 * src/vcg.c: Include `xalloc.h'.
22916 (add_colorentry): New.
22917 (add_classname): New.
22918 (add_infoname): New.
22919 * src/vcg.h: Add new prototypes.
22920
22921 2001-08-27 Akim Demaille <akim@epita.fr>
22922
22923 * Makefile.maint: Sync. again with CVS Autoconf.
22924
22925 2001-08-27 Akim Demaille <akim@epita.fr>
22926
22927 * Makefile.maint: Formatting changes.
22928 (po-update, cvs-update, update): New targets.
22929 (AMTAR): Remove.
22930
22931 2001-08-27 Akim Demaille <akim@epita.fr>
22932
22933 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22934 * Makefile.maint: Sync. with CVS Autoconf.
22935
22936 2001-08-27 Marc Autret <autret_m@epita.fr>
22937
22938 * src/vcg.h (struct infoname_s): New.
22939 (struct colorentry_s): New.
22940 (graph_s): New fields {vertical,horizontal}_order in structure.
22941 Add `infoname' field.
22942 Add `colorentry' field;
22943 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
22944 (G_HORIZONTAL_ORDER): New.
22945 (G_INFONAME): New.
22946 (G_COLORENTRY): New.
22947 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
22948 Add output of `infoname'.
22949 Add output of `colorentry'.
22950
22951 2001-08-27 Marc Autret <autret_m@epita.fr>
22952
22953 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
22954 This one shadowed a global parameter.
22955
22956 2001-08-24 Marc Autret <autret_m@epita.fr>
22957
22958 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
22959 instead of `unsigned'.
22960 (print_state): Do not call obstack_object_size () in obstack_grow ()
22961 to avoid macro variables shadowing.
22962
22963 2001-08-23 Marc Autret <autret_m@epita.fr>
22964
22965 * src/lex.c (percent_table): Typo: s/naem/name/.
22966 Add graph option.
22967 Normalize new options declarations.
22968
22969 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
22970
22971 * tests/suite.at: Exercise %header_extension and %source_extension.
22972
22973 2001-08-16 Marc Autret <autret_m@epita.fr>
22974
22975 * src/reader.c (parse_dquoted_param): New.
22976 (parse_header_extension_decl): Use it.
22977 (parse_source_extension_decl): Likewise.
22978
22979 2001-08-16 Marc Autret <autret_m@epita.fr>
22980
22981 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
22982 (get_xxxx_str): Use assert () instead of complain ().
22983 Remove return invokations in default cases.
22984 (get_decision_str): Modify default behaviour. Remove second argument.
22985 Echo modifications on calls.
22986 (output_graph): Fix.
22987
22988 2001-08-16 Marc Autret <autret_m@epita.fr>
22989
22990 * src/getargs.c (usage): Update with ``-g, --graph''.
22991
22992 2001-08-16 Marc Autret <autret_m@epita.fr>
22993
22994 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
22995 (Option Cross Key): Likewise.
22996 * doc/bison.1: Update.
22997
1c8c2190
PB
229982001-09-25 Pascal Bart <pascal.bart@epita.fr>
22999
23000 * src/output.c (output_master_parser): Don't finish action_obstack.
23001 (output_parser): Don't care about the muscle action, here.
23002 (prepare): Copy the action_obstack in the action muscle.
23003 (output): Free action_obstack.
23004
180d45ba
PB
230052001-09-23 Pascal Bart <pascal.bart@epita.fr>
23006
23007 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
23008 will contain `%union' declaration.
23009 (parse_union_decl): Delete #line directive output.
23010 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
23011 informations about %union.
23012 (parse_union_decl): Copy the union_obstack in the muscle stype.
23013 * src/bison.simple: Add new #line directive.
23014 Add typdef %%stype YYSTYPE.
23015
c51d1a19
PB
230162001-09-23 Pascal Bart <pascal.bart@epita.fr>
23017
23018 * src/bison.simple: Add new `#line' directive.
23019
6f9344da
PB
230202001-09-22 Pascal Bart <pascal.bart@epita.fr>
23021
23022 * src/bison.simple: New `#line' directive.
23023 * src/output.c (output_parser): Support new dynamic muscle input_line.
23024
652def80
MA
230252001-09-22 Marc Autret <autret_m@epita.fr>
23026
23027 * src/output.c (output_master_parser): New.
23028 (output_parser): Be more re-entrant.
23029
25b222fa
MA
230302001-09-21 Marc Autret <autret_m@epita.fr>
23031
23032 * src/reader.c (copy_definition, parse_union_decl): Update and use
23033 `linef' muscle.
23034 (copy_action): Likewise.
23035 Use obstack_1grow ().
23036 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
23037
6bc35ae5
MA
230382001-09-21 Marc Autret <autret_m@epita.fr>
23039
23040 * src/options.c (option_table): Adjust.
23041 * src/lex.c (parse_percent_token): Fix.
23042
c0629aa1
PB
230432001-09-20 Pascal Bart <pascal.bart@epita.fr>
23044
23045 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 23046
82b6d266
PB
230472001-09-20 Pascal Bart <pascal.bart@epita.fr>
23048
23049 * src/lex.c (parse_percent_token): Change type of variable `tx', which
23050 is now an option_table_struct*.
23051 (option_strcmp): New function option_strcmp.
23052 (parse_percent_token): Call option_strcmp.
23053 * src/getargs.c (xalloc.h, options.h): Include it.
23054 (getargs): Call create_long_option_table.
23055 (getargs): Free longopts at the end of the function.
23056 (shortopts): Move in options.c.
23057 * src/options.c (create_long_option_table): New function. Convert
23058 information from option_table to option structure.
23059 * src/reader.c (options.h): Include it.
23060
23061 * src/Makefile.am: Adjust.
23062 * src/options.c (option_table): Create from longopts and percent_table.
23063 * src/getargs.c (longopts): Delete.
23064 * src/lex.c (struct percent_table_struct): Delete.
23065 (percent_table): Delete.
23066 (options.h): Include it.
23067 * src/options.c: Create.
23068 * src/options.h: Create.
23069 Declare enum opt_access_e.
23070 Define struct option_table_struct.
23071
75f5aaea
MA
230722001-09-20 Marc Autret <autret_m@epita.fr>
23073
23074 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
23075 sections of Bison.
23076
f508cb0a
PB
230772001-09-19 Pascal Bart <pascal.bart@epita.fr>
23078
23079 * src/bison.simple: s/%%filename/%%skeleton.
23080 * src/muscle_tab.c (getargs.h): Include it.
23081 (muscle_init): Insert new muscle skeleton.
23082
13105fc1
PB
230832001-09-18 Pascal Bart <pascal.bart@epita.fr>
23084
23085 * src/output.c (output_parser): Delete unused variable actions_dumped.
23086
b0c4483e
PB
230872001-09-07 Pascal Bart <pascal.bart@epita.fr>
23088
23089 * src/output.c (output): Delete call to reader_output_yylsp.
23090 * src/reader.c (reader): Likewise.
ba0fe3c7 23091 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 23092
11d82f03
MA
230932001-09-02 Marc Autret <autret_m@epita.fr>
23094
23095 * src/reader.c: Include muscle_tab.h.
23096 (parse_union_decl): Update.
23097 (parse_macro_decl): Rename parse_muscle_decl.
23098 Update to use renamed functions and variable.
23099 (read_declarations, copy_action, read_additionnal_code, : Updated
23100 with correct variables and functions names.
23101 (packsymbols, reader): Likewise.
342b8b6e 23102
11d82f03 23103 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 23104
11d82f03
MA
23105 * src/output.c: Include muscle_tab.h
23106 In all functions using macro_insert, change by using muscle_insert ().
23107 (macro_obstack): Rename muscle_obstack.
23108 Echo modifications in the whole file.
23109 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
23110 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
23111 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
23112
23113 * src/muscle_tab.h: Update double inclusion macros.
23114 (macro_entry_s): Rename muscle_entry_s.
23115 Update prototypes.
342b8b6e 23116
11d82f03
MA
23117 * src/muscle_tab.c: Include muscle_tab.h.
23118 Rename macro_tabble to muscle_table.
23119 (mhash1, mhash2, mcmp): Use muscle_entry.
23120 (macro_init): Rename muscle_init. Update.
23121 (macro_insert): Rename muscle_insert. Update.
23122 (macro_find): Rename muscle_find. Update.
23123
23124 * src/main.c: Include muscle_tab.h.
23125 (main): Call muscle_init ().
23126 * src/Makefile.am (bison_SOURCES): Echo modifications.
23127
93a37297
MA
231282001-09-02 Marc Autret <autret_m@epita.fr>
23129
f753cd62 23130 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 23131
f753cd62
MA
23132 * src/muscle_tab.c, src/muscle_tab.h: Add files.
23133
231342001-09-02 Marc Autret <autret_m@epita.fr>
23135
23136 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 23137
682d48cd
PB
231382001-09-01 Pascal Bart <pascal.bart@epita.fr>
23139
342b8b6e 23140 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
23141 filename.
23142
087c8fda
MA
231432001-09-01 Marc Autret <autret_m@epita.fr>
23144
23145 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
23146 to an explicit value to activate the feature. We do it here.
23147
dda680cb
PB
231482001-08-31 Pascal Bart <pascal.bart@epita.fr>
23149
23150 * src/output.c (prepare): Delete the `filename' muscule insertion.
23151 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
23152 (parse_union_decl): Likewise.
23153 * src/macrotab.c (macro_init): Initialize filename by infile.
23154
9e644e64
MA
231552001-08-31 Marc Autret <autret_m@epita.fr>
23156
23157 * src/bison.simple (YYLSP_NEEDED): New definition.
23158 * src/output.c (prepare): Add macro insertion of `locations_flag'
23159
17da6427
PB
231602001-08-31 Pascal Bart <pascal.bart@epita.fr>
23161
23162 * src/output.c (prepare): Delete insertion of previous muscles,
23163 and insert the `prefix' muscles.
23164 * src/macrotab.c (macro_init): Likewise.
23165 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 23166 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
23167 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
23168 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 23169 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
23170 name_prefix.
23171
e8cb70b9
PB
231722001-08-31 Pascal Bart <pascal.bart@epita.fr>
23173
23174 * src/main.c (main): Standardize.
23175 * src/output.c (output_table_data, output_parser): Likewise.
23176 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
23177
63c2d5de
MA
231782001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
23179
342b8b6e 23180 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
23181 %%epilogue.
23182 * src/output.c (output): Rename %%declarations to %%prologue.
23183 * src/bison.simple: Echo modifications.
342b8b6e 23184
d8cb5183
MA
231852001-08-31 Marc Autret <autret_m@epita.fr>
23186
23187 * src/reader.c (readgram): CleanUp.
23188 (output_token_defines): Likewise.
23189 (packsymbols): Likewise.
23190 (reader): Likewise.
23191 * src/output.c (output): CPP-out useless code.
23192
6c686258
PB
231932001-08-31 Pascal Bart <pascal.bart@epita.fr>
23194
342b8b6e 23195 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
23196 output_trailers and output_headers.
23197 * src/output.h: Remove obsolete functions prototypes of output_headers
23198 and output_trailers.
23199
8f451ef7
PB
232002001-08-30 Pascal Bart <pascal.bart@epita.fr>
23201
23202 * src/main.c: Include macrotab.h.
342b8b6e 23203 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
23204 Adjust functions prototypes.
23205 * src/macrotab.c (macro_insert): Constify key and value.
23206 (macro_find): Constify key.
23207 (macro_insert): Include 'xalloc.h'
23208 (macro_insert): Use XMALLOC.
23209 (macro_find): Constify return value.
23210 * src/output.c (output_table_data): Rename table to table_data.
23211 (output_parser): Constify macro_key, macro_value.
23212
997b6fd0 232132001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
23214
23215 * src/reader.c (parse_skel_decl): New.
342b8b6e 23216 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
23217 * src/lex.h (token_t): New token `tok_skel'.
23218 * src/lex.c (percent_table): Add skeleton option entry.
23219 Standardize.
23220
ff48177d
MA
232212001-08-29 Marc Autret <autret_m@epita.fr>
23222
23223 * src/bison.simple: Add %%user_code directive at the end.
23224 * src/reader.c (read_additionnal_code): New.
23225 (reader): Use it.
23226 * src/output.c (output_program): Remove.
23227 (output): Update.
23228
b33160bf
MA
232292001-08-28 Marc Autret <autret_m@epita.fr>
23230
23231 * src/output.c (output_actions): Clean up.
4e5caae2 23232 (output_gram): CPP-out useless code.
b33160bf
MA
23233 * src/reader.c (reader): Clean up, CPP-out useless code.
23234
d1a2daf7
PB
232352001-08-28 Pascal Bart <pascal.bart@epita.fr>
23236
342b8b6e 23237 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 23238 directive.
d1a2daf7
PB
23239 * src/bison.simple: Add `%%definitions'.
23240
2b763dfe
MA
232412001-08-28 Marc Autret <autret_m@epita.fr>
23242
23243 * config/depcomp: New file.
23244
f1a87ef6
PE
232452001-08-27 Paul Eggert <eggert@twinsun.com>
23246
23247 * src/bison.simple (yyparse): Don't take the address of an
23248 item before the start of an array, as that doesn't conform to
23249 the C Standard.
23250
82e236e2
RA
232512001-08-27 Robert Anisko <robert.anisko@epita.fr>
23252
f1a87ef6 23253 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
23254 obstack. It was done too late here.
23255
23256 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
23257 completely wrong.
23258 (reader): Initialize the macro obstack here, since we need it to grow
23259 '%define' directives.
23260
23261 * src/reader.h: Declare the macro obstack as extern.
23262
b0cfa28a
RA
232632001-08-27 Robert Anisko <robert.anisko@epita.fr>
23264
23265 * src/output.c (output_parser): Fix. Store single '%' characters in
23266 the output obstack instead of throwing them away.
23267
6fc74234
AD
232682001-08-27 Akim Demaille <akim@epita.fr>
23269
23270 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23271
9c76d118
RA
232722001-08-25 Robert Anisko <robert.anisko@epita.fr>
23273
23274 * lib/Makefile.am: Adjust.
23275
a8289c62
RA
232762001-08-25 Robert Anisko <robert.anisko@epita.fr>
23277
23278 * src/bison.simple: Update and add '%%' directives.
23279
b6610515
RA
232802001-08-25 Robert Anisko <robert.anisko@epita.fr>
23281
23282 * src/reader.c (reader): Remove calls to 'output_headers' and
23283 'output_trailers'. Remove some C output.
23284 (readgram): Disable a piece of code that was writing a default
23285 definition for 'YYSTYPE'.
23286 (reader_output_yylsp): Remove.
23287 (packsymbols): Output token defintions to a macro.
23288 (copy_definition): Disable C output.
6fc74234 23289
b6610515
RA
23290 * src/reader.c (parse_macro_decl): New function used to parse macro
23291 declarations.
23292 (copy_string2): Put the body of copy_string into this new function.
23293 Add a parameter to let the caller choose whether he wants to copy the
23294 string delimiters or not.
23295 (copy_string): Be a simple call to copy_string2 with the last argument
23296 bound to true.
23297 (read_declarations): Add case for macro definition.
23298 (copy_identifier): New.
6fc74234 23299 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
23300 rather than lex.
23301
26f609ff
RA
233022001-08-25 Robert Anisko <robert.anisko@epita.fr>
23303
23304 * src/output.c (prepare): Add prefixed names.
23305 (output_parser): Output semantic actions.
23306 (output_parser): Fix bug on '%%line' directives.
6fc74234 23307
26f609ff
RA
23308 * src/output.c (output_headers): Remove. The C code printed by this
23309 function should now be in the skeletons.
23310 (output_trailers): Remove.
23311 (output): Disable call to 'reader_output_yylsp'.
23312 (output_rule_data): Do not output tables to the table obstack.
23313
23314 * src/output.c: Remove some C dedicated output.
23315 Improve the use of macro and output obstacks.
23316 (output_defines): Remove.
6fc74234 23317
26f609ff
RA
23318 * src/output.c (output_token_translations): Associate 'translate'
23319 table with a macro. No output to the table obstack.
23320 (output_gram): Same for 'rhs' and 'prhs'.
23321 (output_stos): Same for 'stos'.
23322 (output_rule_data): Same for 'r1' and 'r2'.
23323 (token_actions): Same for 'defact'.
23324 (goto_actions): Same for 'defgoto'.
23325 (output_base): Same for 'pact' and 'pgoto'.
23326 (output_table): Same for 'table'.
23327 (output_check): Same for 'check'.
6fc74234 23328
26f609ff
RA
23329 * src/output.c (output_table_data): New function.
23330 (output_short_table): Remove.
23331 (output_short_or_char_table): Remove.
6fc74234 23332
26f609ff
RA
23333 * src/output.c (output_parser): Replace most of the skeleton copy code
23334 with something new. Skeletons are now processed character by character
23335 rather than line by line, and Bison looks for '%%' macros. This is the
23336 first step in making Bison's output process (a lot) more flexible.
23337 (output_parser): Use the macro table.
23338
6f43b113
RA
233392001-08-25 Robert Anisko <robert.anisko@epita.fr>
23340
23341 * src/main.c (main): Initialize the macro table.
23342
dd3127cf
RA
233432001-08-25 Robert Anisko <robert.anisko@epita.fr>
23344
23345 * src/lex.c (percent_table): Add tok_define.
23346 * src/lex.h: Add tok_define.
23347
aa321494
RA
233482001-08-25 Robert Anisko <robert.anisko@epita.fr>
23349
23350 * src/macrotab.c: New file.
23351 * src/macrotab.h: New file.
23352 * src/Makefile.am: Update.
23353
68bd3b6b
RA
233542001-08-25 Robert Anisko <robert.anisko@epita.fr>
23355
23356 * lib/hash.c: New file.
23357 * lib/hash.h: New file.
23358 * lib/Makefile.am: Update.
23359
45f8dd1e
AD
233602001-08-15 Akim Demaille <akim@epita.fr>
23361
23362 Version 1.28c.
23363
40a64a7a 233642001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
23365
23366 * src/reader.c (readgram): Indent output macro YYSTYPE.
23367 (packsymbols): Likewise.
23368 (output_token_defines): Likewise.
23369 * src/files.c: Standardize.
23370 (compute_header_macro): New.
23371 (defines_obstack_save): New. Use compute_header_macro.
23372 (output_files): Update. Use defines_obstack_save.
23373
f9a8293a
AD
233742001-08-15 Akim Demaille <akim@epita.fr>
23375
23376 * doc/bison.texinfo (Table of Symbols): Document
23377 YYSTACK_USE_ALLOCA.
23378
150ca7a7
AD
233792001-08-15 Akim Demaille <akim@epita.fr>
23380
23381 * missing: Update from CVS Automake.
23382 * config/config.guess, config/config.sub, config/texinfo.tex:
23383 Update from gnu.org.
23384
69b5cec4
AD
233852001-08-15 Akim Demaille <akim@epita.fr>
23386
23387 * Makefile.maint: Sync with CVS Autoconf.
23388
f2b5126e
PB
233892001-08-14 Pascal Bart <pascal.bart@epita.fr>
23390
69b5cec4 23391 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
23392 `fdl.texi'.
23393 * doc/fdl.texi: Add to package.
23394
4ecbf796
MA
233952001-08-14 Marc Autret <autret_m@epita.fr>
23396
23397 Turn on %{source,header}_extension features.
23398
69b5cec4 23399 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
23400 source_extension.
23401 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 23402 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
23403 between options.
23404
95fb5662
MA
234052001-08-14 Marc Autret <autret_m@epita.fr>
23406
23407 * src/files.c (compute_base_names): Add extensions computing when
23408 `--file-prefix' used.
23409 Standardize function calls.
23410
78d09da9
MA
234112001-08-13 Marc Autret <autret_m@epita.fr>
23412
69b5cec4 23413 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
23414 defining it (defined but null disables alloca).
23415
5a009f2c
MA
234162001-08-13 Marc Autret <autret_m@epita.fr>
23417
23418 * src/bison.simple (_yy_memcpy): CPP reformat.
23419
1e41465a
PB
234202001-08-13 Pascal Bart <pascal.bart@epita.fr>
23421
23422 * tests/atconfig.in (CPPFLAGS): Fix.
23423
c67a198d
PB
234242001-08-10 Pascal Bart <pascal.bart@epita.fr>
23425
79282c6c 23426 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
23427 `gpl.texi'.
23428 * doc/gpl.texi: Add to package.
23429
09a6de7e
MA
234302001-08-10 Marc Autret <autret_m@epita.fr>
23431
23432 * src/print_graph.h: Fix.
23433 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
23434
b77b9ee0
AD
234352001-08-10 Akim Demaille <akim@epita.fr>
23436
23437 * src/system.h: Provide default declarations for stpcpy, strndup,
23438 and strnlen.
23439
3e259915
MA
234402001-08-10 Robert Anisko <anisko_r@epita.fr>
23441
23442 * doc/bison.texinfo (Locations): Update @$ stuff.
23443
ca96bc2d
MA
234442001-08-09 Robert Anisko <anisko_r@epita.fr>
23445
23446 * src/bison.simple (YYLLOC_DEFAULT): Update.
23447 (yyparse): Adjust.
23448
fdc6758b
MA
234492001-08-08 Marc Autret <autret_m@epita.fr>
23450
b77b9ee0 23451 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
23452 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
23453 Reported by Fabrice Bauzac.
957d4dbf 23454
600cad3b
MA
234552001-08-08 Marc Autret <autret_m@epita.fr>
23456
23457 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
23458 * src/vcg.c (output_node): Fix.
23459 * src/vcg.h: Cleanup.
23460 * src/print_graph.c: Add comments.
b77b9ee0 23461 (node_output_size): New global variable. Simplify the formatting of
600cad3b 23462 the VCG graph output.
b77b9ee0 23463 (print_actions): Unused code is now used. It notifies the final state
600cad3b 23464 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 23465 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
23466 blue.
23467 Get the current node name and node_obstack by argument.
23468 (node_obstack): New variable.
23469 (print_state): Manage node_obstack.
23470 (print_core): Use node_obstack given by argument.
23471 A node is not only computed here but in print_actions also.
23472 (print_graph): CPP out useless code instead of commenting it.
23473
976e528f
AD
234742001-08-07 Pascal Bart <pascal.bart@epita.fr>
23475
23476 * tests/atconfig.in (CPPFLAGS): Fix.
23477
20e8e5ca
AD
234782001-08-07 Akim Demaille <akim@epita.fr>
23479
23480 * src/print_graph.c (quote): New.
23481 (print_core): Use it.
23482
957d4dbf 234832001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 23484
3e3da797
AD
23485 * src/vcg.c (complain.h): Include it.
23486 Unepitaize `return' invocations.
c4b66126 23487 [NDEBUG] (main): Remove.
79282c6c 23488 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
23489 * src/files.c (open_files): Initialize graph_obstack.
23490 * src/print_graph.c (print_actions): CPP out useless code.
23491 (print_core): Don't output the last `\n' in labels.
23492 Use `quote'.
23493 * src/files.c (output_files): Output the VCG file.
23494 * src/main.c (main): Invoke print_graph ();
3e3da797 23495
957d4dbf 234962001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
23497
23498 Automaton VCG graph output.
23499 Using option ``-g'' or long option ``--graph'', you can generate
23500 a gram_filename.vcg file containing a VCG description of the LALR (1)
23501 automaton of your grammar.
23502
23503 * src/main.c: Call to print_graph() function.
23504 * src/getargs.h: Update.
23505 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
23506 (graph_flag): New flag.
23507 (longopts): Update.
23508 (getargs): Add case `g'.
23509 * src/files.c (graph_obstack): New obstack struct.
23510 (open_files): Initialize new obstack.
23511 (output_files): Saves graph_obstack if required.
23512 * src/files.h (graph_obstack): New extern declaration.
23513 * src/Makefile.am: Add new source files.
23514
927c1557 235152001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
23516
23517 * src/print_graph.c, src/print_graph.h (graph): New.
23518 * src/vcg.h: New file.
23519 * src/vcg.c: New file, VCG graph handling.
23520
7333d403
AD
235212001-08-06 Marc Autret <autret_m@epita.fr>
23522
23523 Add of %source_extension and %header_extension which specify
23524 the source or/and the header output file extension.
23525
23526 * src/files.c (compute_base_names): Remove initialisation of
23527 src_extension and header_extension.
23528 (compute_exts_from_gf): Update.
23529 (compute_exts_from_src): Update.
23530 (output_files): Update.
23531 * src/reader.c (parse_header_extension_decl): New.
23532 (parse_source_extension_decl): New.
23533 (read_declarations): New case statements for the new tokens.
23534 * src/lex.c (percent_table): Add entries for %source_extension
23535 and %header_extension.
23536 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
23537
84163231
AD
235382001-08-06 Marc Autret <autret_m@epita.fr>
23539
23540 * configure.in: Bump to 1.28c.
23541 * doc/bison.texinfo: Texinfo thingies.
23542
8303fc42
AD
235432001-08-04 Pascal Bart <pascal.bart@epita.fr>
23544
23545 * tests/atconfig.in (CPPFLAGS): Add.
23546 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
23547
70a84437
AD
235482001-08-03 Akim Demaille <akim@epita.fr>
23549
23550 Version 1.28b.
23551
2ce10144
AD
235522001-08-03 Akim Demaille <akim@epita.fr>
23553
23554 * tests/Makefile.am (check-local): Ship testsuite.
23555 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
23556 Include `string.h'.
23557
1e3e4bc1
AD
235582001-08-03 Akim Demaille <akim@epita.fr>
23559
23560 * configure.in: Try using -Wformat when compiling.
23561
42b45b7f
AD
235622001-08-03 Akim Demaille <akim@epita.fr>
23563
23564 * configure.in: Bump to 1.28b.
23565
8f13fe33
AD
235662001-08-03 Akim Demaille <akim@epita.fr>
23567
23568 * src/complain.c: Adjust strerror_r portability issues.
23569
b37ba92c
AD
235702001-08-03 Akim Demaille <akim@epita.fr>
23571
23572 Version 1.28a.
23573
b0ce6046
AD
235742001-08-03 Akim Demaille <akim@epita.fr>
23575
23576 * src/getargs.c, src/getarg.h (skeleton)): Constify.
23577 * src/lex.c (literalchar): Avoid name clashes on `buf'.
23578 * src/getargs.c: Include complain.h.
23579 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
23580 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
23581
d01c415b
AD
235822001-08-03 Akim Demaille <akim@epita.fr>
23583
23584 * src/reader.c (readgram): Display hidden chars in error messages.
23585
459dd1a6
AD
235862001-08-03 Akim Demaille <akim@epita.fr>
23587
23588 Update to gettext 0.10.39.
23589
53b74c0c
AD
235902001-08-03 Akim Demaille <akim@epita.fr>
23591
23592 * lib/strspn.c: New.
23593
234a3be3
AD
235942001-08-01 Marc Autret <autret_m@epita.fr>
23595
23596 * doc/bison.texinfo: Update.
23597 * doc/bison.1 (mandoc): Update.
23598 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
23599 * src/files.c: Support output files extensions computing.
23600 (src_extension): New static variable.
23601 (header_extension): New static variable.
23602 (tr): New function.
23603 (get_extension_index): New function, gets the index of an extension
23604 filename in a string.
23605 (compute_exts_from_gf): New function, computes extensions from the
23606 grammar file extension.
23607 (compute_exts_from_src): New functions, computes extensions from the
23608 C source file extension, file given by ``-o'' option.
23609 (compute_base_names): Update.
23610 (output_files): Update.
23611
847bf1f5
AD
236122001-08-01 Robert Anisko <anisko_r@epita.fr>
23613
d995fee7 23614 * doc/bison.texi: Document @$.
847bf1f5
AD
23615 (Locations): New section.
23616
d074a105
AD
236172001-07-18 Akim Demaille <akim@epita.fr>
23618
23619 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
23620 * config/prev-version.txt, config/move-if-change: New.
23621 * Makefile.am: Adjust.
23622
3419715d
AD
236232001-07-08 Pascal Bart <pascal.bart@epita.fr>
23624
23625 * src/bison.simple (yyparse): Suppress warning `comparaison
23626 between signed and unsigned'.
23627
62ab6972
AD
236282001-07-05 Pascal Bart <pascal.bart@epita.fr>
23629
23630 * src/getargs.h (raw_flag): Remove.
23631 * src/getargs.c: Die on `-r'/`--raw'.
23632 * src/lex.c (parse_percent_token): Die on `%raw'.
23633 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
23634 * tests/calc.at: Suppress test with option `--raw'.
23635
1e24cc5b
AD
236362001-07-14 Akim Demaille <akim@epita.fr>
23637
23638 * config/: New.
23639 * configure.in: Require Autoconf 2.50.
23640 Update to gettext 0.10.38.
23641
32dfccf8
AD
236422001-03-16 Akim Demaille <akim@epita.fr>
23643
23644 * doc/bison.texinfo: ANSIfy the examples.
23645
cd5bd6ac
AD
236462001-03-16 Akim Demaille <akim@epita.fr>
23647
23648 * getargs.c (skeleton): New variable.
23649 (longopts): --skeleton is a new option.
23650 (shortopts, getargs): -S is a new option.
23651 * getargs.h: Declare skeleton.
23652 * output.c (output_parser): Use it.
23653
5141b016
AD
236542001-03-16 Akim Demaille <akim@epita.fr>
23655
23656 * m4/strerror_r.m4: New.
23657 * m4/error.m4: Run AC_FUNC_STRERROR_R.
23658 * lib/error.h, lib/error.c: Update.
23659
447992b9
AD
236602001-03-16 Akim Demaille <akim@epita.fr>
23661
23662 * src/getargs.c (longopts): Clean up.
23663
274d42ce
AD
236642001-02-21 Akim Demaille <akim@epita.fr>
23665
23666 * src/reader.c (gensym): `gensym_count' is your own.
23667 Use a static buf to create the symbol name, as token_buffer is no
23668 longer a buffer.
23669
22c821f3
AD
236702001-02-08 Akim Demaille <akim@epita.fr>
23671
23672 * src/conflicts.c (conflict_report): Be sure not to append to res
23673 between two calls, which could happen if both first sprintf were
23674 skipped, but not the first cp += strlen.
23675
18569462
AD
236762001-02-08 Akim Demaille <akim@epita.fr>
23677
23678 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
23679 New, from fileutils 4.0.37.
23680 * configure.in: Require Autoconf 2.49c. I took some time before
23681 making this decision. This is the only way out for portability
23682 issues in Bison, it would mean way too much duplicate effort to
23683 import in Bison features implemented in 2.49c since 2.13.
23684 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
23685
0d8f3c8a
AD
236862001-02-02 Akim Demaille <akim@epita.fr>
23687
23688 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 23689 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 23690
f17bcd1f
AD
236912001-01-19 Akim Demaille <akim@epita.fr>
23692
23693 Get rid of the ad hoc handling of token_buffer in the scanner: use
23694 the obstacks.
23695
23696 * src/lex.c (token_obstack): New.
23697 (init_lex): Initialize it. No longer call...
23698 (grow_token_buffer): this. Remove it.
23699 Adjust all the places which used it to use the obstack.
23700
511e79b3
AD
237012001-01-19 Akim Demaille <akim@epita.fr>
23702
23703 * src/lex.h: Rename all the tokens:
23704 s/\bENDFILE\b/tok_eof/g;
23705 s/\bIDENTIFIER\b/tok_identifier/g;
23706 etc.
23707 Let them be enums, not #define, to ease debugging.
23708 Adjust all the code.
23709
0d6508ef
AD
237102001-01-18 Akim Demaille <akim@epita.fr>
23711
23712 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
23713 * src/lex.c (maxtoken, grow_token_buffer): Static.
23714
6deb4447
AD
237152001-01-18 Akim Demaille <akim@epita.fr>
23716
23717 Since we now use obstacks, more % directives can be enabled.
23718
23719 * src/lex.c (percent_table): Also accept `%yacc',
23720 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
23721 `%debug'.
23722 Handle the actions for `%semantic_parser' and `%pure_parser' here,
23723 instead of returning a token.
23724 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
23725 * src/reader.c (read_declarations): Adjust.
23726 * src/files.c (open_files): Don't call `compute_base_names', don't
23727 compute `attrsfile' since they depend upon data which might be
23728 *in* the input file now.
23729 (output_files): Do it here.
23730 * src/output.c (output_headers): Document the fact that this patch
23731 introduces a guaranteed SEGV for semantic parsers.
23732 * doc/bison.texinfo: Document them.
23733 * tests/suite.at: Exercise these %options.
23734
ff4423cc
AD
237352000-12-20 Akim Demaille <akim@epita.fr>
23736
23737 Also handle the output file (--verbose) with obstacks.
23738
23739 * files.c (foutput): Remove.
23740 (output_obstack): New.
23741 Adjust all dependencies.
23742 * src/conflicts.c: Return a string.
23743 * src/system.h (obstack_grow_string): Rename as...
23744 (obstack_sgrow): this. Be ready to work with non literals.
23745 (obstack_fgrow4): New.
23746
956dba3a
AD
237472000-12-20 Akim Demaille <akim@epita.fr>
23748
23749 * src/files.c (open_files): Fix the computation of short_base_name
23750 in the case of `-o foo.tab.c'.
23751
337bab46
AD
237522000-12-20 Akim Demaille <akim@epita.fr>
23753
23754 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
23755 (copy_dollar): Now that everything uses obstacks, get rid of the
23756 FILE * parameters.
23757
5d3214b8
AD
237582000-12-20 Akim Demaille <akim@epita.fr>
23759
23760 * src/files.c (open_files): Actually the `.output' file is based
23761 on the short_base_name, not base_name.
23762 * tests/suite.at (Checking output file names): Adjust.
23763
29092a57
AD
237642000-12-20 Akim Demaille <akim@epita.fr>
23765
23766 * src/bison.s1: Remove, we now use directly...
23767 * src/bison.simple: this.
23768 * src/Makefile.am: Use pkgdata instead of data.
23769
ea5607fd
AD
237702000-12-20 Akim Demaille <akim@epita.fr>
23771
23772 * src/files.c (guard_obstack): New.
23773 (open_files): Initialize it.
23774 (output_files): Dump it...
23775 * src/files.h: Export it.
23776 * src/reader.c (copy_guard): Use it.
23777
27110317
AD
237782000-12-19 Akim Demaille <akim@epita.fr>
23779
23780 * src/files.c (outfile, defsfile, actfile): Removed as global
23781 vars.
23782 (open_files): Don't compute them.
23783 (output_files): Adjust.
23784 (base_name, short_base_name): Be global.
23785 Adjust dependencies.
23786
19c50364
AD
237872000-12-19 Akim Demaille <akim@epita.fr>
23788
23789 * src/files.c (strsuffix): New.
23790 (stringappend): Be just like strcat but allocate.
23791 (base_names): Eve out from open_files.
23792 Try to simplify the rather hairy computation of base_name and
23793 short_base_name.
23794 (open_files): Use it.
23795 * tests/suite.at (Checking output file names): New test.
23796
573c1d9f
AD
237972000-12-19 Akim Demaille <akim@epita.fr>
23798
23799 * src/system.h (obstack_grow_literal_string): Rename as...
23800 (obstack_grow_string): this.
23801 * src/output.c (output_parser): Recognize `%% actions' instead of
23802 `$'.
23803 * src/bison.s1: s/$/%% actions/.
23804 * src/bison.hairy: Likewise.
23805
ef7ddedd
AD
238062000-12-19 Akim Demaille <akim@epita.fr>
23807
23808 * src/output.c (output_parser): Compute the `#line' lines when
23809 there are.
23810 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
23811 Suggested by Hans Aberg.
23812
ff61dabd
AD
238132000-12-19 Akim Demaille <akim@epita.fr>
23814
23815 Let the handling of the skeleton files be local to the procedures
23816 that use it.
23817
23818 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
23819 longer static.
23820 (fparser, open_extra_files): Remove.
23821 (open_files, output_files): Don't take care of fparser.
23822 * src/files.h: Adjust.
23823 * src/output.c (output_parser): Open and close the file to the
23824 skeleton.
23825 * src/reader.c (read_declarations): When %semantic_parser, open
23826 fguard.
23827
55b96341
AD
238282000-12-19 Akim Demaille <akim@epita.fr>
23829
23830 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
23831 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
23832
358c15b7
AD
238332000-12-19 Akim Demaille <akim@epita.fr>
23834
23835 * src/files.c (open_files): Yipee! We no longer need all the code
23836 looking for `/tmp' since we have no tmp file.
23837
7de3329e
AD
238382000-12-19 Akim Demaille <akim@epita.fr>
23839
23840 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
23841 New macros.
23842 * src/files.c (open_files): Less dependency on MSDOS etc.
23843
3abcd459
AD
238442000-12-14 Akim Demaille <akim@epita.fr>
23845
23846 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
23847 Provide a default definition.
23848 Use it when executing the default @ action.
23849 * src/reader.c (reader_output_yylsp): No longer include
23850 `timestamp' and `text' in the default YYLTYPE.
23851
2a91a95e
AD
238522000-12-12 Akim Demaille <akim@epita.fr>
23853
23854 * src/reader.c (copy_definition, parse_union_decl, copy_action)
23855 (copy_guard): Quote the file names.
23856 Reported by Laurent Mascherpa.
23857
14d3eb9b
AD
238582000-12-12 Akim Demaille <akim@epita.fr>
23859
23860 * src/output.c (output_headers, output_program, output): Be sure
23861 to escape special characters when outputting filenames.
23862 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
23863 (output_headers): Don't depend on them, Use ACTSTR.
23864
d7045ec6
AD
238652000-11-17 Akim Demaille <akim@epita.fr>
23866
23867 * lib/obstack.h: Formatting changes.
23868 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
23869 prevents type checking.
23870 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
23871 cast the value to (void *): assigning a `foo *' to a `void *'
23872 variable is valid.
23873 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
23874 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
23875 append characters.
23876
6fd54b73
AD
238772000-11-17 Akim Demaille <akim@epita.fr>
23878
23879 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
23880 as...
23881 (suite.m4, regression.m4, calc.m4): these.
23882 * tests/atgeneral.m4: Update from CVS Autoconf.
23883
4c50eae6
AD
238842000-11-17 Akim Demaille <akim@epita.fr>
23885
23886 * tests/regression.m4 (%union and --defines): New test,
23887 demonstrating a current bug in the obstack implementation.
23888
a35f64ea
AD
238892000-11-17 Akim Demaille <akim@epita.fr>
23890
23891 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
23892 macros.
23893 Use them to declare the variables which are global or local to
23894 `yyparse'.
23895
7de23534
AD
238962000-11-17 Akim Demaille <akim@epita.fr>
23897
23898 * acconfig.h: Remove, no longer used.
23899
aa7815f5
AD
239002000-11-07 Akim Demaille <akim@epita.fr>
23901
23902 * src: s/Copyright (C)/Copyright/g.
23903
5af1f549
AD
239042000-11-07 Akim Demaille <akim@epita.fr>
23905
23906 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
23907 defining.
23908 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
23909
553e2b22
AD
239102000-11-07 Akim Demaille <akim@epita.fr>
23911
23912 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
23913 Merge in a single CPP if/else.
23914
8a4f41d6
AD
239152000-11-07 Akim Demaille <akim@epita.fr>
23916
23917 * src/output.c (output): Remove useless variables.
23918 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
23919 argument `data' for consistency with the prototypes.
23920 Qualify it `const'.
23921 (obstack_copy, obstack_copy0): Rename the second argument as
23922 `address' for consistency. Qualify it `const'.
23923 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
23924 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
23925 `const' their input argument (`data' or `address').
23926 Adjust the corresponding macros to include `const' in casts.
23927
095a3fb5
AD
239282000-11-03 Akim Demaille <akim@epita.fr>
23929
23930 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
23931 s/PFILE1/BISON_HAIRY/.
23932 Adjust dependencies.
23933
d1cdce7c
AD
239342000-11-03 Akim Demaille <akim@epita.fr>
23935
090c5ebf 23936 For some reason, this was not applied.
d1cdce7c
AD
23937
23938 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23939 `unlink': it's no longer used.
23940
9311529b
AD
239412000-11-03 Akim Demaille <akim@epita.fr>
23942
23943 * src/files.c (skeleton_find): New function, eved out of...
23944 (open_files, open_extra_files): here.
23945
d8880f69
AD
239462000-11-03 Akim Demaille <akim@epita.fr>
23947
23948 Don't use `atexit'.
23949
23950 * src/files.c (obstack_save): New function.
23951 (done): Rename as...
23952 (output_files): this.
23953 Use `obstack_save'.
23954 * src/main.c (main): Don't use `atexit' to register `done', since
23955 it no longer has to remove tmp files, just call `output_files'
23956 when there are no errors.
23957
0dbb648e
AD
239582000-11-02 Akim Demaille <akim@epita.fr>
23959
23960 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23961 `unlink': it's no longer used.
23962 * src/files.h: Formatting changes.
23963
896fe5c1
AD
239642000-11-02 Akim Demaille <akim@epita.fr>
23965
23966 Remove the last uses of mktemp and unlink/delete.
23967
23968 * src/files.c (fdefines, ftable): Removed.
23969 (defines_ostack, table_obstack): New.
23970 Adjust dependencies of the former into uses of the latter.
23971 * src/output.c (output_short_or_char_table, output_short_table):
23972 Convert to using obstacks.
23973 * src/reader.c (copy_comment2): Accept one FILE * and two
23974 obstacks.
23975 (output_token_defines, reader_output_yylsp): Use obstacks.
23976 * src/system.h (obstack_fgrow3): New.
1f65350a 23977 * po/POTFILES.in: Adjust.
896fe5c1 23978
dd60faec
AD
239792000-11-01 Akim Demaille <akim@epita.fr>
23980
23981 Change each use of `fattrs' into a use of `attrs_obstack'.
23982
23983 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
23984 * src/files.c (fattrs): Remove.
23985 (attrs_obstack): New.
23986 Adjust all dependencies.
23987 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
23988
8c7ebe49
AD
239892000-11-01 Akim Demaille <akim@epita.fr>
23990
23991 Introduce obstacks.
23992 Change each use of `faction' into a use of `action_obstack'.
23993
23994 * lib/obstack.h, lib/obstack.c: New files.
23995 * src/files.c (faction): Remove.
23996 (action_obstack): New.
23997 Adjust all dependencies.
23998
77aee789
AD
239992000-10-20 Akim Demaille <akim@epita.fr>
24000
24001 * lib/quote.h (PARAMS): New macro. Use it.
24002
43591cec
AD
240032000-10-16 Akim Demaille <akim@epita.fr>
24004
24005 * src/output.c (output_short_or_char_table): New function.
24006 (output_short_table, output_token_translations): Use it.
24007 (goto_actions): Use output_short_table.
24008
1e9798d5
AD
240092000-10-16 Akim Demaille <akim@epita.fr>
24010
24011 * src/symtab.c (bucket_new): New function.
24012 (getsym): Use it.
24013
24014 * src/output.c (output_short_table): New argument to display the
24015 comment associated with the table.
24016 Adjust dependencies.
24017 (output_gram): Use it.
24018 (output_rule_data): Nicer output layout for YYTNAME.
24019
f282676b
AD
240202000-10-16 Akim Demaille <akim@epita.fr>
24021
24022 * src/lex.c (read_typename): New function.
24023 (lex): Use it.
24024 * src/reader.c (copy_dollar): Likewise.
24025
550a72a3
AD
240262000-10-16 Akim Demaille <akim@epita.fr>
24027
24028 * src/reader.c (copy_comment2): Expect the input stream to be on
24029 the `/' which is suspected to open a comment, instead of being
24030 called after `//' or `/*' was read.
24031 (copy_comment, copy_definition, parse_union_decl, copy_action)
24032 (copy_guard): Adjust.
24033
131e2fef
AD
240342000-10-16 Akim Demaille <akim@epita.fr>
24035
24036 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
24037 `read_signed_integer'.
24038
79282c5a
AD
240392000-10-16 Akim Demaille <akim@epita.fr>
24040
24041 * src/reader.c (copy_dollar): New function.
24042 (copy_guard, copy_action): Use it.
24043
ff4a34be
AD
240442000-10-16 Akim Demaille <akim@epita.fr>
24045
24046 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
24047 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
24048 New files, from Fileutils 4.0.27.
24049 * src/main.c (printable_version): Remove.
24050 * src/lex.c, src/reader.c: Use `quote'.
24051
240522000-10-04 Akim Demaille <akim@epita.fr>
24053
24054 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
24055
14ded682
AD
240562000-10-04 Akim Demaille <akim@epita.fr>
24057
24058 * doc/bison.texinfo: Various typos spotted by Neil Booth.
24059
8e03724b
AD
240602000-10-04 Akim Demaille <akim@epita.fr>
24061
24062 When a literal string is used to define two different tokens,
24063 `bison -v' segfaults.
24064 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
24065
24066 * tests/regression.m4: New file.
24067 Include the core of the sample provided by Piotr Gackiewicz.
24068 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
24069 properly.
24070
a9e64249
AD
240712000-10-04 Akim Demaille <akim@epita.fr>
24072
24073 * src/reader.c (parse_expect_decl): Keep `count' within the size
24074 of `buffer'.
24075 From Neil Booth.
24076
da9abf43
AD
240772000-10-02 Paul Eggert <eggert@twinsun.com>
24078
24079 * bison.s1 (yyparse): Assign the default value
24080 unconditionally, to avoid a GCC warning and make the parser a
24081 tad smaller.
24082
c33638bb
AD
240832000-10-02 Akim Demaille <akim@epita.fr>
24084
24085 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
24086 options.
24087
444c570a
AD
240882000-10-02 Akim Demaille <akim@epita.fr>
24089
24090 * src/derives.c, src/print.c, src/reduce.c: To ease the
24091 translation, move some `\n' out of the translated strings.
24092
89cab50d
AD
240932000-10-02 Akim Demaille <akim@epita.fr>
24094
24095 The location tracking mechanism is precious for parse error
24096 messages. Nevertheless, it is enabled only when `@n' is used in
24097 the grammar, which is a different issue (you can use it in error
24098 message, but not in the grammar per se). Therefore, there should
24099 be another means to enable it.
24100
24101 * src/getargs.c (getargs): Support `--locations'.
24102 (usage): Report it.
24103 * src/getargs.h (locationsflag): Export it.
24104 * src/lex.c (percent_table): Support `%locations'.
24105 * src/reader.c (yylsp_needed): Remove this variable, now replaced
24106 with `locationsflag'.
24107 * doc/bison.texinfo: Document `--locations' and `%locations'.
24108 Sort the options.
24109 * tests/calc.m4: Test it.
24110
24111 For regularity of the names, replace each
24112 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
24113 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
24114 In addition replace each `flag' with `_flag'.
24115
d6c2cba0
AD
241162000-10-02 Akim Demaille <akim@epita.fr>
24117
24118 Also test parse error messages, including with YYERROR_VERBOSE.
24119
24120 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
24121 associative).
24122 Use it to check the computations.
24123 Use it to check `nonassoc' is honored.
24124 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
24125 `--yyerror-verbose'.
24126 (_AT_CHECK_CALC): Adjust to this option.
24127 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
24128
5a35a6cb
AD
241292000-10-02 Akim Demaille <akim@epita.fr>
24130
24131 Test also `--verbose', `--defines' and `--name-prefix'. Testing
24132 the latter demonstrates a flaw in the handling of non debugging
24133 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
24134 was used in order to simplify:
24135
24136 #if YYDEBUG
24137 if (yydebug)
24138 {
24139 ...
24140 }
24141 #endif
24142
24143 into
24144
24145 if (yydebug)
24146 {
24147 ...
24148 }
24149
24150 unfortunately this leads to a CPP conflict when
24151 `--name-prefix=foo' is used since it produces `#define yydebug
24152 foodebug'.
24153
24154 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
24155 (YYDPRINTF): New macro.
24156 Spread its use.
24157 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
24158 the bison options.
24159 Also test `--verbose', `--defines' and `--name-prefix'.
24160
71da9eea
AD
241612000-10-02 Akim Demaille <akim@epita.fr>
24162
24163 Improve the readability of the produced parsers.
24164
24165 * src/bison.s1: Formatting changes.
24166 Improve the comment related to the `$' mark.
24167 (yydefault): Don't fall through to `yyresume': `goto' there.
24168 * src/output.c (output_parser): When the `$' is met, skip the end
24169 of its line.
24170 New variable, `number_of_dollar_signs', to check there's exactly
24171 one `$' in the parser skeleton.
24172
95e36146
AD
241732000-10-02 Akim Demaille <akim@epita.fr>
24174
24175 * lib/xstrdup.c: New file, from the fileutils.
24176 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
24177 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
24178 instead of strlen + xmalloc + strcpy.
24179 * src/symtab.c (copys): Remove, use xstrdup instead.
24180
d7020c20
AD
241812000-10-02 Akim Demaille <akim@epita.fr>
24182
24183 * src/gram.h (associativity): New enum type which replaces the
24184 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
24185 `right_assoc', `left_assoc' and `non_assoc'.
24186 Adjust all dependencies.
24187 * src/reader.c: Formatting changes.
24188 (LTYPESTR): Don't define it, use it as a literal in
24189 `reader_output_yylsp'.
24190 * src/symtab.h (symbol_class): New enum type which replaces the
24191 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
24192 `sunknown', `stoken and `snterm'.
24193
1916f98e
AD
241942000-10-02 Akim Demaille <akim@epita.fr>
24195
24196 * src/getargs.c (fixed_outfiles): Rename as...
24197 (yaccflag): for consistency and accuracy.
24198 Adjust dependencies.
24199
d7913476
AD
242002000-10-02 Akim Demaille <akim@epita.fr>
24201
24202 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
24203 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
24204 difficult and introduced a lot of core dump. It turns out that
24205 Bison used an implementation of `xmalloc' based on `calloc', and
24206 at various places it does depend upon the initialization to 0. I
24207 have not tried to isolate the pertinent places, and all the former
24208 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
24209 someone should address this issue.
24210
24211 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
24212 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
24213 files.
24214 Adjust dependencies.
24215 * src/warshall.h: New file.
24216 Propagate.
24217
340ef489
AD
242182000-10-02 Akim Demaille <akim@epita.fr>
24219
24220 Various anti-`extern in *.c' changes.
24221
24222 * src/system.h: Include `assert.h'.
24223
b2ca4022
AD
242242000-10-02 Akim Demaille <akim@epita.fr>
24225
24226 * src/state.h (nstates, final_state, first_state, first_shift)
24227 (first_reduction): Move their exportation from here...
24228 * src/LR0.h: to here.
24229 Adjust dependencies.
24230 * src/getargs.c (statisticsflag): New variable.
24231 Add support for `--statistics'.
24232 Adjust dependencies.
24233
24234 Remove a lot of now useless `extern' statements in most files.
24235
403b315b
AD
242362000-10-02 Akim Demaille <akim@epita.fr>
24237
24238 * src/LR0.h: New file.
24239 Propagate its use.
24240
07a58c13
AD
242412000-10-02 Akim Demaille <akim@epita.fr>
24242
24243 * src/print.h: New file.
24244 Propagate its use.
24245 * src/print.c: Formatting and ordering changes.
24246 (verbose, terse): Replace with...
24247 (print_results): this new function.
24248 Adjust dependencies.
24249
0619caf0
AD
242502000-10-02 Akim Demaille <akim@epita.fr>
24251
24252 * src/conflicts.c (conflict_report): New function.
24253 (conflict_log, verbose_conflict_log): Replace with...
24254 (print_conflicts): this function.
24255 Adjust dependencies.
24256 * src/conflicts.h: New file.
24257 Propagate its inclusion.
24258
3519ec76
AD
242592000-10-02 Akim Demaille <akim@epita.fr>
24260
24261 * src/nullable.h: New file.
24262 Propagate its inclusion.
24263 * src/nullable.c: Formatting changes.
24264
015acc48
AD
242652000-10-02 Akim Demaille <akim@epita.fr>
24266
24267 * src/reduce.h: New file.
24268 Propagate its inclusion.
24269 * src/reduce.c: Topological sort and other formatting changes.
24270 (bool, TRUE, FALSE): Move their definition to...
24271 * src/system.h: here.
24272
8963a27b
AD
242732000-10-02 Akim Demaille <akim@epita.fr>
24274
24275 * src/files.c: Formatting changes.
24276 (tryopen, tryclose, openfiles): Rename as...
24277 (xfopen, xfclose, open_files): this.
24278 (stringappend): static.
24279 * src/files.h: Complete the list of exported symbols.
24280 Propagate its use.
24281
a70083a3
AD
242822000-10-02 Akim Demaille <akim@epita.fr>
24283
24284 * src/reader.h: New file.
24285 Propagate its use instead of tedious list of `extern' and
24286 prototypes.
24287 * src/reader.c: Formatting changes, topological sort,
24288 s/register//.
24289
abadc117
AD
242902000-10-02 Akim Demaille <akim@epita.fr>
24291
24292 * src/lex.h: Prototype `lex.c' exported functions.
24293 * src/reader.c: Adjust.
24294 * src/lex.c: Formatting changes.
24295 (safegetc): Rename as...
24296 (xgetc): this.
24297
720d742f
AD
242982000-10-02 Akim Demaille <akim@epita.fr>
24299
24300 * src/lalr.h: New file.
24301 Propagate its inclusion instead of prototypes and `extern'.
24302 * src/lalr.c: Formatting changes, topological sorting etc.
24303
f2acea59
AD
243042000-10-02 Akim Demaille <akim@epita.fr>
24305
24306 * src/output.c (token_actions): Introduce a temporary array,
24307 YYDEFACT, that makes it possible for this function to use
24308 output_short_table.
24309
d019d655
AD
243102000-10-02 Akim Demaille <akim@epita.fr>
24311
24312 `user_toknums' is output as a `short[]' in `output.c', while it is
24313 defined as a `int[]' in `reader.c'. For consistency with the
24314 other output tables, `user_toknums' is now defined as a table of
24315 shorts.
24316
24317 * src/reader.c (user_toknums): Be a short table instead of an int
24318 table.
24319 Adjust dependencies.
24320
24321 Factor the short table outputs.
24322
24323 * src/output.c (output_short_table): New function.
24324 * src/output.c (output_gram, output_stos, output_rule_data)
24325 (output_base, output_table, output_check): Use it.
24326
6c89f1c1
AD
243272000-10-02 Akim Demaille <akim@epita.fr>
24328
24329 * src/output.c (output): Topological sort of the functions, in
24330 order to get rid of the `static' prototypes.
24331 No longer use `register'.
24332 * src/output.h: New file.
24333 Propagate its inclusion in files explicitly prototyping functions
24334 from output.c.
24335
d9efd181
AD
243362000-09-21 Akim Demaille <akim@epita.fr>
24337
24338 * src/atgeneral.m4: Update from Autoconf.
24339
c29240e7 243402000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
24341
24342 * src/closure.h: New file.
24343 * src/closure.c: Formatting changes, topological sort over the
24344 functions, use of closure.h.
24345 (initialize_closure, finalize_closure): Rename as...
24346 (new_closure, free_closure): these. Adjust dependencies.
24347 * src/LR0.c: Formatting changes, topological sort, use of
24348 cloture.h.
24349 (initialize_states): Rename as...
24350 (new_states): this.
24351 * src/Makefile.am (noinst_HEADERS): Adjust.
24352
499daa50
AD
243532000-09-20 Akim Demaille <akim@epita.fr>
24354
24355 * src/acconfig.h: Don't protect config.h against multiple
24356 inclusion.
24357 Don't define PARAMS.
24358 * src/system.h: Define PARAMS.
24359 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
24360 purpose of config.h. system.h must not try to fix wrong
24361 definitions in config.h.
24362
cc84fd5d
AD
243632000-09-20 Akim Demaille <akim@epita.fr>
24364
24365 * src/derives.h: New file.
24366 * src/main.c, src/derives.h: Use it.
24367 Formatting changes.
24368 * src/Makefile.am (noinst_HEADERS): Adjust.
24369
db5b3a89
AD
243702000-09-20 Akim Demaille <akim@epita.fr>
24371
24372 * tests/atgeneral.m4: Update from Autoconf.
24373 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
24374 (AT_CHECK_CALC): New macros.
24375 Use these macros to test bison with options `', `--raw',
24376 `--debug', `--yacc', `--yacc --debug'.
24377
ceed8467
AD
243782000-09-19 Akim Demaille <akim@epita.fr>
24379
24380 * src/output.c: Formatting changes.
24381 * src/machine.h: Remove, leaving its contents in...
24382 * src/system.h: here.
24383 Include stdio.h.
24384 Adjust all dependencies on stdio.h and machine.h.
24385 * src/getargs.h: New file.
24386 Let all `extern' declarations about getargs.c be replaced with
24387 inclusion of `getargs.h'.
24388 * src/Makefile.am (noinst_HEADERS): Adjust.
24389
24390 * tests/calc.m4 (yyin): Be initialized in main, not on the global
24391 scope.
24392 (yyerror): Returns void, not int.
24393 * doc/bison.texinfo: Formatting changes.
24394
05a1d24b
AD
243952000-09-19 Akim Demaille <akim@epita.fr>
24396
24397 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
24398 portable.
24399
cbd25751
AD
244002000-09-18 Akim Demaille <akim@epita.fr>
24401
24402 * configure.in: Append WARNING_CFLAGS to CFLAGS.
24403 * src/Makefile.am (INCLUDES): Don't.
24404 Be ready to fetch headers in lib/.
24405
13863333
AD
244062000-09-18 Akim Demaille <akim@epita.fr>
24407
24408 * doc/bison.texinfo: Update the copyright.
24409 ANSIfy and GNUify the examples.
24410 Remove the old menu.
24411
0d533154
AD
244122000-09-18 Akim Demaille <akim@epita.fr>
24413
24414 First set of tests: use the `calc' example from the documentation.
24415
24416 * src/bison.s1 (yyparse): Condition the code using `yytname' which
24417 is defined only when YYDEBUG is.
24418 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
24419 * src/files.c (tryopen, tryclose): Formatting changes.
24420 Move to the top and be static.
24421 * src/reader.c (read_signed_integer): Likewise.
24422 * tests/calc.m4: New file.
24423 * Makefile.am, suite.m4: Adjust.
24424 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
24425
e79137ac
AD
244262000-09-18 Akim Demaille <akim@epita.fr>
24427
24428 Add support for an Autotest test suite for Bison.
24429
24430 * m4/m4.m4, m4/atconfig.m4: New files.
24431 * m4/Makefile.am (EXTRA_DIST): Adjust.
24432 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
24433 files.
24434 * src/getargs.c: Display a more standard --version message.
24435 * src/reader.c (reader): Formatting changes.
24436 No longer depend upon VERSION_STRING.
24437 * configure.in: No longer use `dnl'.
24438 Set up the test suite and the new directory `tests/.
24439 (VERSION_STRING): Remove.
24440
27821bff
AD
244412000-04-14 Akim Demaille <akim@epita.fr>
24442
24443 * src/reader.c (copy_comment2): New function, same as former
24444 `copy_comment', but outputs into two FILE *.
24445 (copy_comment): Use it.
24446 (parse_union_decl): Use it.
24447 (get_type, parse_start_decl): Use the same `invalid' message.
24448 (parse_start_decl, parse_union_decl): Use the same `multiple'
24449 message.
24450 (parse_union_decl, copy_guard, copy_action): Use the same
24451 `unmatched' message.
24452 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
24453
cfe5fbc0
AD
244542000-03-31 Akim Demaille <akim@epita.fr>
24455
24456 * src/files.c (tryopen, tryclose): Move to the top.
24457 Be static.
24458
cb7db13e
AD
244592000-03-31 Akim Demaille <akim@epita.fr>
24460
24461 * src/main.c (main): Don't call `done', exit does it.
24462
a0f6b076
AD
244632000-03-31 Akim Demaille <akim@epita.fr>
24464
36281465
AD
24465 * allocate.c: s/return (foo)/return foo/.
24466 * lalr.c: Likewise.
24467 * LR0.c: Likewise.
24468 * output.c: Likewise.
24469 * reader.c: Likewise.
24470 * symtab.c: Likewise.
24471 * vmsgetargs.c: Likewise.
24472
244732000-03-31 Akim Demaille <akim@epita.fr>
24474
24475 Clean up the error reporting functions.
a0f6b076
AD
24476
24477 * src/report.c: New file.
24478 * src/report.h: Likewise.
24479 * src/Makefile.am: Adjust.
24480 * m4/error.m4: New file.
24481 * m4/Makefile.am: Adjust.
24482 * configure.in (jm_PREREQ_ERROR): Call it.
24483 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
24484 Remove.
24485 (fatal, fatals): Remove. All callers use complain.c::fatal.
24486 (warn, warni, warns, warnss, warnss): Remove. All callers use
24487 complain.c::complain.
24488 (toomany): Remove, use fatal instead.
24489 * src/files.c (done): No argument, use complain_message_count.
24490 * src/main.c (main): Register `done' to `atexit'.
24491
24492 * src/getargs.c (usage): More `fputs', less `fprintf'.
24493
18539825
AD
244942000-03-28 Akim Demaille <akim@epita.fr>
24495
24496 * lib/: New directory.
24497 * Makefile.am (SUBDIRS): Adjust.
24498 * configure.in: Adjust.
24499 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
24500 useless.
24501 * src/alloca.c: Moved to lib/.
24502 * src/getopt.c: Likewise.
24503 * src/getopt1.c: Likewise.
24504 * src/getopt.h: Likewise.
24505 * src/ansi2knr.c: Likewise.
24506 * src/ansi2knr.1: Likewise.
24507 * src/Makefile.am: Adjust.
24508 * lib/Makefile.am: New file.
24509
9f306f2a
AD
245102000-03-28 Akim Demaille <akim@epita.fr>
24511
24512 * src/getargs.c (usage): Refresh the help message.
24513
0ba347b6
AD
245142000-03-17 Akim Demaille <akim@epita.fr>
24515
24516 * src/getopt1.c: Updated from textutils 2.0e
24517 * src/getopt.c: Likewise.
24518 * src/getopt.h: Likewise.
24519
dbe7f271
AD
245202000-03-17 Akim Demaille <akim@epita.fr>
24521
24522 * src/Makefile.am (bison.simple): Fix the awk program: quote only
24523 the file name, not the whole `#line LINE FILE'.
24524
75bbe78d
AD
245252000-03-17 Akim Demaille <akim@epita.fr>
24526
24527 On syntax errors, report the token on which we choked.
24528
aa5fd0ee
AD
24529 * src/bison.s1 (yyparse): In the label yyerrlab, when
24530 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 24531
7b306f52
AD
245322000-03-17 Akim Demaille <akim@epita.fr>
24533
aa5fd0ee 24534 * src/reader.c (copy_at): New function.
7b306f52
AD
24535 (copy_guard): Use it.
24536 (copy_action): Use it.
24537
e87b5700
AD
245382000-03-17 Akim Demaille <akim@epita.fr>
24539
24540 Be kind to translators, save some useless translations.
24541
aa5fd0ee 24542 * src/main.c (banner): New function.
e87b5700
AD
24543 (fatal_banner): Use it.
24544 (warn_banner): Use it.
24545
ae3c3164
AD
245462000-03-17 Akim Demaille <akim@epita.fr>
24547
aa5fd0ee
AD
24548 * src/reader.c (copy_definition): Use copy_string and
24549 copy_comment. Removed now unused `match', `ended',
24550 `cplus_comment'.
ae3c3164
AD
24551 (copy_comment, copy_string): Moved, to be visible from
24552 copy_definition.
24553
4dc58e7c
AD
245542000-03-17 Akim Demaille <akim@epita.fr>
24555
aa5fd0ee
AD
24556 * src/reader.c (copy_string): Declare `static inline'. No
24557 problems with inline, since it is checked by configure.
4dc58e7c
AD
24558 (copy_comment): Likewise.
24559
0a6384c4
AD
245602000-03-17 Akim Demaille <akim@epita.fr>
24561
aa5fd0ee 24562 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 24563
3cef001a
AD
245642000-03-17 Akim Demaille <akim@epita.fr>
24565
aa5fd0ee 24566 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
24567 (copy_action): Use it. Removed now unused `match', `ended',
24568 `cplus_comment'.
24569 (copy_guard): Likewise.
24570
ca36d2ef
AD
245712000-03-17 Akim Demaille <akim@epita.fr>
24572
aa5fd0ee 24573 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
24574 (copy_action): Use it.
24575 (copy_guard): Likewise.
24576
6666f98f
AD
245772000-03-17 Akim Demaille <akim@epita.fr>
24578
24579 Change the handling of @s so that they behave exactly like $s.
24580 There is now a pseudo variable @$ (readble and writable), location
24581 of the lhs of the rule (by default ranging from the location of
24582 the first symbol of the rhs, to the location of the last symbol,
24583 or, if the rhs is empty, YYLLOC).
24584
24585 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
24586 yyval.
24587 (yyparse): When providing a default semantic action, provide a
24588 default location action.
24589 (after the $): No longer change `*YYLSP', just stack YYLOC the
24590 same way you stack YYVAL.
24591 * src/reader.c (read_declarations): Use warns.
24592 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
24593 (copy_action, case '@'): Likewise.
24594 Use a standard error message, to save useless work from
24595 translators.
24596
41aca2e0
AD
245972000-03-17 Akim Demaille <akim@epita.fr>
24598
aa5fd0ee
AD
24599 * src/bison.s1: Formatting and cosmetics changes.
24600 * src/reader.c: Likewise.
41aca2e0
AD
24601 Update the Copyright notice.
24602
dc08c1d5
AD
246032000-03-17 Akim Demaille <akim@epita.fr>
24604
aa5fd0ee
AD
24605 * src/bison.s1 (#line): All set to `#line' only, since the
24606 Makefile now handles them.
dc08c1d5 24607
9ee3c97b
AD
246082000-03-16 Akim Demaille <akim@epita.fr>
24609
24610 * src/output.c (output_rule_data): Output the documentation of
24611 some of the tables.
24612 (Copyright notice): Update.
24613 Formatting changes.
24614
0de741ca
AD
246152000-03-16 Akim Demaille <akim@epita.fr>
24616
24617 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
24618 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
24619 One `#if YYDEBUG' remains, since it uses variables which are
24620 defined only if `YYDEBUG != 0'.
24621
bb10be54
AD
246222000-03-16 Akim Demaille <akim@epita.fr>
24623
24624 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
24625 and related variables so that the similarities are highlighted.
24626
b07b484a
AD
246272000-03-16 Akim Demaille <akim@epita.fr>
24628
24629 * src/bison.s1: Properly indent CPP directives.
24630
361f60b3
AD
246312000-03-16 Akim Demaille <akim@epita.fr>
24632
24633 * src/bison.s1: Properly indent the `alloca' CPP section.
24634
8c44d3ec
AD
246352000-03-16 Akim Demaille <akim@epita.fr>
24636
24637 Do not hard code values of directories in `configure.in'.
24638 Update the `configure' tool chain.
24639
24640 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
24641 src/makefile.am.
24642 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
24643 (AC_OUTPUT): Add m4/Makefile.
24644 Bump to bison 1.28a, 1.29 has never been released.
24645 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
24646 handled via src/Makefile.am.
24647 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
24648 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
24649 autoheader.
24650 * Makefile.am (SUBDIRS): Add m4.
24651 (ACLOCAL_AM_FLAGS): New variable.
24652 (AUTOMAKE_OPTIONS): Add check-news.
24653 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
24654 the proper line number and file name.
24655 (DEFS): Propagate the location of bison library files and of the
24656 locale files.
24657 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
24658 builddir.
24659 * acinclude.m4: Remove, replaced by the directory m4.
24660 * m4/Makefile.am (EXTRA_DIST): New variable.
24661 * m4/gettext.m4: New file, from the fileutils.
24662 * m4/lcmessage.m4: Likewise
24663 * m4/progtest.m4: Likewise.
24664 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
24665
f95997e7
AD
246662000-03-10 Akim Demaille <akim@epita.fr>
24667
24668 * src/closure.c:
24669 Formatting changes of various comments.
24670 Respect the GNU coding standards at various places.
24671 Don't use `_()' when no translation is needed.
24672
246731999-12-13 Jesse Thilo <jthilo@gnu.org>
24674
24675 * src/files.c:
24676 OS/2 honors TMPDIR environment variable.
24677
246781999-12-13 Jesse Thilo <jthilo@gnu.org>
24679
24680 * doc/bison.texinfo: Tweaked spelling and grammar.
24681 Updated ISBN.
24682 Removed reference to price of printed copy.
24683 Mention BISON_SIMPLE and BISON_HAIRY.
24684
246851999-12-13 Jesse Thilo <jthilo@gnu.org>
24686
24687 * configure.in, NEWS:
24688 Bison 1.29 released.
24689
246901999-10-27 Jesse Thilo <jthilo@gnu.org>
24691
24692 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
24693 Added reference card.
24694
246951999-07-26 Jesse Thilo <jthilo@gnu.org>
24696
24697 * po/ru.po: Added Russian translation.
24698
246991999-07-26 Jesse Thilo <jthilo@gnu.org>
24700
24701 * configure.in: Added Russian translation.
24702
247031999-07-06 Jesse Thilo <jthilo@gnu.org>
24704
24705 * configure.in, NEWS, README:
24706 Released version 1.28.
24707
247081999-06-14 Jesse Thilo <jthilo@gnu.org>
24709
24710 * src/system.h:
24711 Squashed redefinition warning on some systems.
24712
24713 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
24714 Have configure build version string instead of relying on ANSI string
24715 concatentation.
24716
247171999-06-14 Jesse Thilo <jthilo@gnu.org>
24718
24719 * po/POTFILES.in: Got rid of version.c.
24720
247211999-06-14 Jesse Thilo <jthilo@gnu.org>
24722
24723 * acconfig.h, configure.in:
24724 Have configure build version string instead of relying on ANSI string
24725 concatentation.
24726
247271999-06-08 Jesse Thilo <jthilo@gnu.org>
24728
24729 * doc/bison.1:
24730 Dropped mention of `+' for long-named options.
24731
247321999-05-30 Jesse Thilo <jthilo@gnu.org>
24733
24734 * src/files.c: Added <unistd.h> for unlink().
24735
24736 * src/Makefile.am, src/system.h:
24737 I18n fixes.
24738
247391999-05-30 Jesse Thilo <jthilo@gnu.org>
24740
24741 * README: Added a FAQ list.
24742
24743 * configure.in, acconfig.h:
24744 I18n fixes.
24745
247461999-05-30 Jesse Thilo <jthilo@gnu.org>
24747
24748 * doc/FAQ, doc/Makefile.am:
24749 Added a FAQ list.
24750
247511999-05-19 Jesse Thilo <jthilo@gnu.org>
24752
24753 * src/alloc.h, src/symtab.h, src/version.c:
24754 Protected inclusion of "config.h" with HAVE_CONFIG_H.
24755
247561999-04-18 Jesse Thilo <jthilo@gnu.org>
24757
24758 * src/.cvsignore, src/Makefile.am:
24759 Reorganized: sources in `src', documentation in `doc'.
24760
24761 * src/lex.c (literalchar):
24762 fixed the code for escaping double quotes (thanks
24763 Jonathan Czisny.)
24764
247651999-04-18 Jesse Thilo <jthilo@gnu.org>
24766
24767 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
24768 Adjusted paths to reflect directory reorganization.
24769
247701999-04-18 Jesse Thilo <jthilo@gnu.org>
24771
24772 * doc/.cvsignore, doc/Makefile.am:
24773 Reorganized: sources in `src', documentation in `doc'.
24774
247751999-04-18 Jesse Thilo <jthilo@gnu.org>
24776
24777 * configure.in:
24778 Updated AC_INIT file to reflect directory reorganization.
24779
24780 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
24781 Reorganized: sources in `src', documentation in `doc'.
24782
247831999-04-13 Jesse Thilo <jthilo@gnu.org>
24784
24785 * src/allocate.c:
24786 Don't declare calloc() and realloc() if not necessary.
24787
247881999-04-13 Jesse Thilo <jthilo@gnu.org>
24789
24790 * configure.in, acconfig.h, acinclude.m4:
24791 Don't declare calloc() and realloc() if not necessary.
24792
247931999-03-23 Jesse Thilo <jthilo@gnu.org>
24794
24795 * po/.cvsignore: Added i18n support.
24796
247971999-03-23 Jesse Thilo <jthilo@gnu.org>
24798
24799 * acconfig.h, configure.in, Makefile.am:
24800 Added i18n support.
24801
248021999-03-22 Jesse Thilo <jthilo@gnu.org>
24803
24804 * src/bison.s1: Fixed #line numbers.
24805
248061999-03-15 Jesse Thilo <jthilo@gnu.org>
24807
24808 * po/es.po, po/fr.po, po/nl.po, po/de.po:
24809 Added PO files from Translation Project.
24810
248111999-03-03 Jesse Thilo <jthilo@gnu.org>
24812
24813 * Makefile.am:
24814 Added support for non-ANSI compilers (ansi2knr).
24815
248161999-02-16 Jesse Thilo <jthilo@gnu.org>
24817
24818 * configure.in: Bumped version number to 1.27.
24819
24820 * Makefile.am:
24821 Added `bison.simple' to list of files removed by `make distclean'.
24822
248231999-02-12 Jesse Thilo <jthilo@gnu.org>
24824
24825 * src/files.c, src/files.h:
24826 Defined locations of parser files in config.h instead of Makefile.
24827
248281999-02-12 Jesse Thilo <jthilo@gnu.org>
24829
24830 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
24831 Defined locations of parser files in config.h instead of Makefile.
24832
248331999-02-09 Jesse Thilo <jthilo@gnu.org>
24834
24835 * Makefile.am:
24836 Removed inappropriate use of $< macro.
24837
248381999-02-05 Jesse Thilo <jthilo@gnu.org>
24839
24840 * po/Makefile.in.in, po/POTFILES.in:
24841 Add `po' directory skeleton.
24842
248431999-01-27 Jesse Thilo <jthilo@gnu.org>
24844
24845 * README: Document help-bison list.
24846
24847 * configure.in: Add check for mkstemp().
24848
248491999-01-20 Jesse Thilo <jthilo@gnu.org>
24850
24851 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
24852 Hush a few compiler warnings.
24853
24854 * src/files.c:
24855 Add tryclose(), which verifies that fclose was successful.
24856 Hush a couple of compiler warnings.
24857
248581999-01-20 Jesse Thilo <jthilo@gnu.org>
24859
24860 * Makefile.am, OChangeLog:
24861 ChangeLog is now automatically generated. Include the old version as
24862 OChangeLog.
24863
248641999-01-14 Jesse Thilo <jthilo@gnu.org>
24865
24866 * 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:
24867 Update FSF address.
24868
248691999-01-14 Jesse Thilo <jthilo@gnu.org>
24870
24871 * doc/bison.texinfo: Fix formatting glitch.
24872
24873 * doc/bison.texinfo: Update FSF address.
24874
248751999-01-14 Jesse Thilo <jthilo@gnu.org>
24876
24877 * acconfig.h: Update FSF address.
24878
248791999-01-08 Jesse Thilo <jthilo@gnu.org>
24880
24881 * src/system.h:
24882 Don't define PACKAGE here, since config.h defines it.
24883
248841998-12-30 Jesse Thilo <jthilo@gnu.org>
24885
24886 * src/reader.c: Update copyright date.
24887
24888 * src/main.c:
24889 Ditch sprintf to statically-sized buffers in fatal/warn functions in
24890 favor of output directly to stderr (avoids buffer overruns).
24891
24892 * src/reader.c: Some checks for premature EOF.
24893
24894 * 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:
24895 Use prototypes if the compiler understands them.
24896
24897 * src/files.c: Honor TMPDIR on Unix hosts.
24898 Use prototypes if the compiler understands them.
24899
24900 * src/reader.c:
24901 Fix a couple of buffer overrun bugs.
24902 Use prototypes if the compiler understands them.
24903
24904 * src/system.h: Include unistd.h and ctype.h.
24905 Use #ifdef instead of #if for NLS symbols.
24906
249071998-12-30 Jesse Thilo <jthilo@gnu.org>
24908
24909 * doc/bison.texinfo:
24910 Delete comment "consider using @set for edition number, etc..." since
24911 we now are doing so.
24912
249131998-12-30 Jesse Thilo <jthilo@gnu.org>
24914
24915 * configure.in:
24916 Use prototypes if the compiler understands them.
24917
24918 * NEWS: Document 1.26 highlights.
24919
24920 * Makefile.am: Require Automake 1.3 or later.
24921
24922 * acconfig.h:
24923 Use prototypes if the compiler understands them.
24924
249251998-12-29 Jesse Thilo <jthilo@gnu.org>
24926
24927 * src/version.c:
24928 Use VERSION symbol from automake for version number.
24929
249301998-12-29 Jesse Thilo <jthilo@gnu.org>
24931
24932 * acconfig.h, configure.in, version.cin:
24933 Use VERSION symbol from automake for version number.
24934
249351998-11-28 Jesse Thilo <jthilo@gnu.org>
24936
24937 * Makefile.am:
24938 Distribute original version of simple parser (bison.s1), not built
24939 version (bison.simple).
24940
249411998-11-28 Jesse Thilo <jthilo@gnu.org>
24942
24943 * doc/bison.texinfo: Add info dir entry.
24944
24945 * doc/bison.texinfo:
24946 Let automake put version number into documentation.
24947
249481998-11-26 Jesse Thilo <jthilo@gnu.org>
24949
24950 * src/bison.cld, src/build.com, src/vmshlp.mar:
24951 Add non-RCS files from /gd/gnu/bison.
24952
249531998-11-26 Jesse Thilo <jthilo@gnu.org>
24954
24955 * doc/bison.1:
24956 Document the BISON_HAIRY and BISON_SIMPLE variables.
24957
249581998-11-25 Jesse Thilo <jthilo@gnu.org>
24959
24960 * src/version.c: Build version.c automatically.
24961
24962 * src/reader.c:
24963 Fix token numbering (used to start at 258, not 257).
24964
24965 * src/system.h: Include config.h.
24966
24967 * src/getargs.c: Update bug report address.
24968
24969 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
24970 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
24971
249721998-11-25 Jesse Thilo <jthilo@gnu.org>
24973
24974 * Makefile.am:
24975 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24976
24977 * configure.in, version.cin:
24978 Build version.c automatically.
24979
24980 * AUTHORS: Add AUTHORS file.
24981
24982 * README: Update bug report address.
24983
24984 * bison.simple:
24985 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24986
24987 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
24988 Add automake stuff.
24989
249901998-11-25 Jesse Thilo <jthilo@gnu.org>
24991
24992 * doc/bison.texinfo: Clean up some formatting.
24993
249941998-05-05 Richard Stallman <rms@gnu.org>
24995
24996 * doc/bison.texinfo:
24997 Explain better why to make a pure parser.
24998
249991998-01-05 Richard Stallman <rms@gnu.org>
25000
25001 * src/files.c (openfiles):
25002 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
25003 find a temporary directory, if possible. Do not unlink files while
25004 they are open.
25005
250061997-08-25 Richard Stallman <rms@gnu.org>
25007
25008 * src/reader.c (stack_offset;):
25009 Change some warni to warns.
25010
25011 * src/lex.c (literalchar): Use warns, not warni.
25012
250131997-06-28 Richard Stallman <rms@gnu.org>
25014
25015 * src/bison.s1: Add a Bison version comment.
25016
25017 * src/main.c (fatal, warn, berror):
25018 Use program_name.
25019
250201997-06-28 Richard Stallman <rms@gnu.org>
25021
25022 * Makefile.in (bison_version): New variable.
25023 (dist): Use that variable.
25024 (bison.s1): Substitute the Bison version into bison.simple.
25025
25026 * bison.simple: Add a Bison version comment.
25027
250281997-06-18 Richard Stallman <rms@gnu.org>
25029
25030 * src/main.c (fatal, warn, berror):
25031 Make error messages standard.
25032 (toomany): Improve error message text.
25033
25034 * 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:
25035 new.h renamed to alloc.h.
25036
250371997-06-18 Richard Stallman <rms@gnu.org>
25038
25039 * Makefile.in: new.h renamed to alloc.h.
25040
250411997-05-24 Richard Stallman <rms@gnu.org>
25042
25043 * src/lex.c (literalchar):
25044 Fix the code for escaping \, " and '.
25045
25046 (lex): Avoid trouble when there are many chars
25047 to discard in a char literal with just several chars in it.
25048
250491997-05-17 Richard Stallman <rms@gnu.org>
25050
25051 * src/bison.s1:
25052 Use malloc, if using alloca is troublesome.
25053 (YYSTACK_USE_ALLOCA): New flag macro.
25054 Define it for some systems and compilers.
25055 (YYSTACK_ALLOC): New macro.
25056 (yyparse): Use YYSTACK_ALLOC to allocate stack.
25057 If it was malloc'd, free it.
25058
250591997-05-17 Richard Stallman <rms@gnu.org>
25060
25061 * bison.simple:
25062 Use malloc, if using alloca is troublesome.
25063 (YYSTACK_USE_ALLOCA): New flag macro.
25064 Define it for some systems and compilers.
25065 (YYSTACK_ALLOC): New macro.
25066 (yyparse): Use YYSTACK_ALLOC to allocate stack.
25067 If it was malloc'd, free it.
25068
250691997-04-23 Richard Stallman <rms@gnu.org>
25070
25071 * src/bison.s1:
25072 (alloca) [__hpux]: Always define as __builtin_alloca.
25073
250741997-04-23 Richard Stallman <rms@gnu.org>
25075
25076 * bison.simple:
25077 (alloca) [__hpux]: Always define as __builtin_alloca.
25078
250791997-04-22 Richard Stallman <rms@gnu.org>
25080
25081 * src/bison.s1:
25082 [__hpux]: Include alloca.h (right for HPUX 10)
25083 instead of declaring alloca (right for HPUX 9).
25084
25085 * src/bison.s1 (__yy_memcpy):
25086 Declare arg `count' as unsigned int.
25087 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
25088
250891997-04-22 Richard Stallman <rms@gnu.org>
25090
25091 * bison.simple:
25092 [__hpux]: Include alloca.h (right for HPUX 10)
25093 instead of declaring alloca (right for HPUX 9).
25094
25095 * bison.simple (__yy_memcpy):
25096 Declare arg `count' as unsigned int.
25097 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
25098
250991997-01-03 Richard Stallman <rms@gnu.org>
25100
25101 * src/allocate.c: [__STDC__ or _MSC_VER]:
25102 Declare calloc and realloc to return void *.
25103
251041997-01-02 Richard Stallman <rms@gnu.org>
25105
25106 * src/system.h:
25107 [_MSC_VER]: Include stdlib.h and process.h.
25108 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
25109
25110 * src/main.c (main): Return FAILURE as a value.
25111 (printable_version): Declare arg as int, not char.
25112
251131997-01-02 Richard Stallman <rms@gnu.org>
25114
25115 * Makefile.in (dist):
25116 Explicitly check for symlinks, and copy them.
25117
251181996-12-19 Richard Stallman <rms@gnu.org>
25119
25120 * src/files.c:
25121 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
25122
251231996-12-18 Paul Eggert <eggert@gnu.org>
25124
25125 * src/bison.s1 (yyparse):
25126 If __GNUC__ and YYPARSE_PARAM are both defined,
25127 declare yyparse to have a void * argument.
25128
251291996-12-18 Paul Eggert <eggert@gnu.org>
25130
25131 * bison.simple (yyparse):
25132 If __GNUC__ and YYPARSE_PARAM are both defined,
25133 declare yyparse to have a void * argument.
25134
251351996-12-17 Richard Stallman <rms@gnu.org>
25136
25137 * src/reduce.c (nbits): Add some casts.
25138
251391996-08-12 Richard Stallman <rms@gnu.org>
25140
25141 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
25142
251431996-08-12 Richard Stallman <rms@gnu.org>
25144
25145 * bison.simple: Test _MSDOS as well as _MSDOS_.
25146
251471996-07-31 Richard Stallman <rms@gnu.org>
25148
25149 * src/bison.s1:
25150 [__sun && __i386]: Include alloca.h.
25151
251521996-07-31 Richard Stallman <rms@gnu.org>
25153
25154 * bison.simple:
25155 [__sun && __i386]: Include alloca.h.
25156
251571996-07-30 Richard Stallman <rms@gnu.org>
25158
25159 * src/bison.s1: Comment change.
25160
25161 * src/bison.s1: Test _MSDOS_, not MSDOS.
25162
251631996-07-30 Richard Stallman <rms@gnu.org>
25164
25165 * bison.simple: Comment change.
25166
25167 * bison.simple: Test _MSDOS_, not MSDOS.
25168
251691996-06-01 Richard Stallman <rms@gnu.org>
25170
25171 * 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:
25172 Insert `_' macro around many string constants.
25173
25174 * src/main.c:
25175 Insert `_' macro around many string constants.
25176
25177 (main): Call setlocale, bindtextdomain and textdomain.
25178
25179 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
25180 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
25181 [ENABLE_NLS]: Include libintl.h.
25182 [ENABLE_NLS] (gettext): Define.
25183 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
25184 (N_, PACKAGE, LOCALEDIR): New macros.
25185
251861996-06-01 Richard Stallman <rms@gnu.org>
25187
25188 * POTFILES.in: New file.
25189
25190 * Makefile.in (allocate.o):
25191 Define target explicitly.
25192
25193 * Makefile.in (CFLAGS): Set to @CFLAGS@.
25194 (LDFLAGS): Set to @LDFLAGS@.
25195 (configure): Run autoconf only if preceding `cd' succeeds.
25196 (bison.s1): Redirect output to temporary file then move the
25197 temporary to the target, rather than redirecting directly to bison.s1.
25198 (clean): Remove config.status and config.log.
25199 (distclean): Don't remove config.status here.
25200
252011996-05-12 Richard Stallman <rms@gnu.org>
25202
25203 * src/bison.s1:
25204 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25205
252061996-05-12 Richard Stallman <rms@gnu.org>
25207
25208 * bison.simple:
25209 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25210
252111996-05-11 Richard Stallman <rms@gnu.org>
25212
25213 * src/bison.s1 (__yy_memcpy):
25214 Really reorder the args, as was supposedly done on Feb 14 1995.
25215 (yyparse): Calls changed accordingly.
25216
252171996-05-11 Richard Stallman <rms@gnu.org>
25218
25219 * Makefile.in (dist): Don't use $(srcdir).
25220
25221 * bison.simple (__yy_memcpy):
25222 Really reorder the args, as was supposedly done on Feb 14 1995.
25223 (yyparse): Calls changed accordingly.
25224
252251996-01-27 Richard Stallman <rms@gnu.org>
25226
25227 * src/output.c (output_rule_data):
25228 Test YYERROR_VERBOSE in the conditional
25229 around the definition of ttyname.
25230
252311995-12-29 Richard Stallman <rms@gnu.org>
25232
25233 * src/bison.s1:
25234 Fix line numbers in #line commands.
25235
252361995-12-29 Richard Stallman <rms@gnu.org>
25237
25238 * bison.simple:
25239 Fix line numbers in #line commands.
25240
252411995-12-27 Richard Stallman <rms@gnu.org>
25242
25243 * src/bison.s1 (YYPARSE_PARAM_DECL):
25244 In C++, make it always null.
25245 (YYPARSE_PARAM_ARG): New macro.
25246 (yyparse): Use YYPARSE_PARAM_ARG.
25247
252481995-12-27 Richard Stallman <rms@gnu.org>
25249
25250 * bison.simple (YYPARSE_PARAM_DECL):
25251 In C++, make it always null.
25252 (YYPARSE_PARAM_ARG): New macro.
25253 (yyparse): Use YYPARSE_PARAM_ARG.
25254
252551995-11-29 Richard Stallman <rms@gnu.org>
25256
25257 * doc/bison.texinfo:
25258 Describe literal string tokens, %raw, %no_lines, %token_table.
25259
252601995-11-29 Daniel Hagerty <hag@gnu.org>
25261
25262 * doc/bison.texinfo: Fixed update date
25263
252641995-10-16 Richard Stallman <rms@gnu.org>
25265
25266 * src/version.c: Version 1.25.
25267
252681995-10-16 Richard Stallman <rms@gnu.org>
25269
25270 * NEWS: *** empty log message ***
25271
252721995-10-16 Richard Stallman <rms@gnu.org>
25273
25274 * doc/bison.1, doc/bison.rnh:
25275 Add new options.
25276
252771995-10-15 Richard Stallman <rms@gnu.org>
25278
25279 * src/vmsgetargs.c, src/getargs.c:
25280 Added -n, -k, and -raw switches.
25281 (noparserflag, toknumflag, rawtoknumflag): New variables.
25282
25283 * src/symtab.h (SALIAS):
25284 New #define for adding aliases to %token.
25285 (struct bucket): Added `alias' field.
25286
25287 * src/reduce.c (reduce_grammar):
25288 Revise error message.
25289 (print_notices): Remove final `.' from error message.
25290
25291 * src/reader.c (reader_output_yylsp):
25292 New function.
25293 (readgram): Use `#if 0' around code that accepted %command
25294 inside grammar rules: The documentation doesn't allow it,
25295 and it will fail since the %command processors scan for the next %.
25296 (parse_token_decl): Extended the %token
25297 declaration to allow a multi-character symbol as an alias.
25298 (parse_thong_decl): New function.
25299 (read_declarations): Added %thong declarations.
25300 (read_declarations): Handle NOOP to deal with allowing
25301 % declarations as another means to specify the flags.
25302 (readgram): Allow %prec prior to semantics embedded in a rule.
25303 (skip_to_char, read_declarations, copy_definition)
25304 (parse_token_decl, parse_start_decl, parse_type_decl)
25305 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
25306 (get_type_name, copy_guard, copy_action, readgram)
25307 (get_type, packsymbols): Revised most error messages.
25308 Changed `fatal' to `warnxxx' to avoid aborting for error.
25309 Revised and use multiple warnxxx functions to avoid using VARARGS1.
25310 (read_declarations): Improve the error message for
25311 an invalid character. Do not abort.
25312 (read_declarations, copy_guard, copy_action): Use
25313 printable_version to avoid unprintable characters in printed output.
25314 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
25315 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
25316 Allow the type of a non-terminal can be given
25317 more than once, as long as all specifications give the same type.
25318
25319 * src/output.c:
25320 (output_headers, output_trailers, output, output_gram)
25321 (output_rule_data): Implement noparserflag variable.
25322 Implement toknumflag variable.
25323 (output): Call reader_output_yylsp to output LTYPESTR.
25324
25325 * src/main.c (main):
25326 If reader sees an error, don't process the grammar.
25327 (fatals): Updated to not use VARARGS1.
25328 (printable_version, int_to_string, warn, warni, warns, warnss)
25329 (warnsss): New error reporting functions. Avoid abort for error.
25330
25331 * src/lex.h:
25332 Added THONG and NOOP for alias processing.
25333 Added SETOPT for the new code that allows setting options with %flags.
25334
25335 * src/lex.c:
25336 Include getopt.h. Add some extern decls.
25337 (safegetc): New function to deal with EOF gracefully.
25338 (literalchar); new function to deal with reading \ escapes.
25339 (lex): Use literalchar.
25340 (lex): Implemented "..." tokens.
25341 (literalchar, lex, parse_percent_token): Made tokenbuffer
25342 always contain the token. This includes growing the token
25343 buffer while reading an integer.
25344 (parse_percent_token): Replaced if-else statement with percent_table.
25345 (parse_percent_token): Added % declarations as another
25346 way to specify the flags -n, -l, and -r. Also added hooks for
25347 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
25348 major changes to files.c.
25349 (lex) Retain in the incoming stream a character following
25350 an incorrect '/'.
25351 (skip_white_space, lex): Revised most error messages
25352 and changed fatal to warn to avoid aborting.
25353 (percent_table): Added %thong declarations.
25354
25355 * src/gram.h: Comment changes.
25356
25357 * src/files.c (openfiles, open_extra_files, done):
25358 Add faction flag
25359 and actfile file. Handle noparserflag. Both for -n switch.
25360
25361 * src/conflicts.c (resolve_sr_conflict):
25362 Remove use of alloca.
25363
253641995-06-01 Jim Meyering <meyering@gnu.org>
25365
25366 * doc/bison.texinfo: *** empty log message ***
25367
253681995-05-06 Richard Stallman <rms@gnu.org>
25369
25370 * src/bison.s1: Comment change.
25371
253721995-05-06 Richard Stallman <rms@gnu.org>
25373
25374 * bison.simple: Comment change.
25375
253761995-05-03 Richard Stallman <rms@gnu.org>
25377
25378 * src/version.c: Version now 1.24.
25379
25380 * src/bison.s1: Change distribution terms.
25381
25382 * src/version.c: Version now 1.23.
25383
253841995-05-03 Richard Stallman <rms@gnu.org>
25385
25386 * doc/bison.texinfo:
25387 Rewrite "Conditions for Using Bison".
25388 Update version to 1.24.
25389
253901995-05-03 Richard Stallman <rms@gnu.org>
25391
25392 * bison.simple: Change distribution terms.
25393
253941995-02-23 Richard Stallman <rms@gnu.org>
25395
25396 * src/files.c: Test __VMS_POSIX as well as VMS.
25397
253981995-02-14 Jim Meyering <meyering@gnu.org>
25399
25400 * src/bison.s1 (__yy_memcpy):
25401 Renamed from __yy_bcopy to avoid
25402 confusion. Reverse FROM and TO arguments to be consistent with
25403 those of memcpy.
25404
254051995-02-14 Jim Meyering <meyering@gnu.org>
25406
25407 * bison.simple (__yy_memcpy):
25408 Renamed from __yy_bcopy to avoid
25409 confusion. Reverse FROM and TO arguments to be consistent with
25410 those of memcpy.
25411
254121994-11-10 David J. MacKenzie <djm@gnu.org>
25413
25414 * NEWS: reformat
25415
25416 * NEWS: New file.
25417
25418 * Makefile.in (DISTFILES): Include NEWS.
25419
25420 * Makefile.in (DISTFILES):
25421 Include install-sh, not install.sh.
25422
25423 * configure.in: Update to Autoconf v2 macro names.
25424
254251994-10-05 David J. MacKenzie <djm@gnu.org>
25426
25427 * Makefile.in: fix typo
25428
25429 * Makefile.in (prefix, exec_prefix):
25430 Let configure set them.
25431
254321994-09-28 David J. MacKenzie <djm@gnu.org>
25433
25434 * Makefile.in: Set datadir to $(prefix)/share.
25435
254361994-09-15 Richard Stallman <rms@gnu.org>
25437
25438 * src/bison.s1:
25439 Update copyright notice and GPL version.
25440
254411994-09-15 Richard Stallman <rms@gnu.org>
25442
25443 * bison.simple:
25444 Update copyright notice and GPL version.
25445
254461994-07-12 Richard Stallman <rms@gnu.org>
25447
25448 * src/reduce.c, src/reader.c:
25449 entered into RCS
25450
254511994-05-05 David J. MacKenzie <djm@gnu.org>
25452
25453 * Makefile.in: entered into RCS
25454
254551994-03-26 Richard Stallman <rms@gnu.org>
25456
25457 * src/bison.s1: entered into RCS
25458
254591994-03-26 Richard Stallman <rms@gnu.org>
25460
25461 * bison.simple: entered into RCS
25462
254631994-03-25 Richard Stallman <rms@gnu.org>
25464
25465 * src/main.c: entered into RCS
25466
254671994-03-24 Richard Stallman <rms@gnu.org>
25468
25469 * src/conflicts.c: entered into RCS
25470
254711994-01-02 Richard Stallman <rms@gnu.org>
25472
25473 * Makefile.in: *** empty log message ***
25474
254751993-11-21 Richard Stallman <rms@gnu.org>
25476
25477 * src/bison.s1: *** empty log message ***
25478
254791993-11-21 Richard Stallman <rms@gnu.org>
25480
25481 * doc/bison.texinfo: entered into RCS
25482
25483 * doc/bison.texinfo: *** empty log message ***
25484
254851993-11-21 Richard Stallman <rms@gnu.org>
25486
25487 * bison.simple: *** empty log message ***
25488
254891993-10-25 David J. MacKenzie <djm@gnu.org>
25490
25491 * doc/bison.texinfo: *** empty log message ***
25492
254931993-10-19 Richard Stallman <rms@gnu.org>
25494
25495 * src/bison.s1: *** empty log message ***
25496
254971993-10-19 Richard Stallman <rms@gnu.org>
25498
25499 * bison.simple: *** empty log message ***
25500
255011993-10-14 Richard Stallman <rms@gnu.org>
25502
25503 * src/bison.s1: *** empty log message ***
25504
255051993-10-14 Richard Stallman <rms@gnu.org>
25506
25507 * bison.simple: *** empty log message ***
25508
255091993-09-14 David J. MacKenzie <djm@gnu.org>
25510
25511 * doc/bison.texinfo: *** empty log message ***
25512
255131993-09-13 Noah Friedman <friedman@gnu.org>
25514
25515 * Makefile.in: *** empty log message ***
25516
255171993-09-10 Richard Stallman <rms@gnu.org>
25518
25519 * src/conflicts.c: *** empty log message ***
25520
25521 * src/system.h: entered into RCS
25522
255231993-09-10 Richard Stallman <rms@gnu.org>
25524
25525 * doc/bison.1: entered into RCS
25526
255271993-09-06 Noah Friedman <friedman@gnu.org>
25528
25529 * src/version.c: entered into RCS
25530
255311993-09-06 Noah Friedman <friedman@gnu.org>
25532
25533 * Makefile.in: *** empty log message ***
25534
255351993-07-30 David J. MacKenzie <djm@gnu.org>
25536
25537 * Makefile.in: *** empty log message ***
25538
255391993-07-24 Richard Stallman <rms@gnu.org>
25540
25541 * src/bison.s1: *** empty log message ***
25542
255431993-07-24 Richard Stallman <rms@gnu.org>
25544
25545 * bison.simple: *** empty log message ***
25546
255471993-07-08 David J. MacKenzie <djm@gnu.org>
25548
25549 * Makefile.in: *** empty log message ***
25550
255511993-07-04 Richard Stallman <rms@gnu.org>
25552
25553 * src/bison.s1: *** empty log message ***
25554
255551993-07-04 Richard Stallman <rms@gnu.org>
25556
25557 * bison.simple: *** empty log message ***
25558
255591993-06-26 David J. MacKenzie <djm@gnu.org>
25560
25561 * src/getargs.c: entered into RCS
25562
255631993-06-26 David J. MacKenzie <djm@gnu.org>
25564
25565 * doc/bison.texinfo: *** empty log message ***
25566
25567 * doc/bison.1: New file.
25568
255691993-06-25 Richard Stallman <rms@gnu.org>
25570
25571 * src/getargs.c: New file.
25572
255731993-06-16 Richard Stallman <rms@gnu.org>
25574
25575 * src/bison.s1: *** empty log message ***
25576
255771993-06-16 Richard Stallman <rms@gnu.org>
25578
25579 * bison.simple: *** empty log message ***
25580
255811993-06-03 Richard Stallman <rms@gnu.org>
25582
25583 * src/bison.s1: New file.
25584
255851993-06-03 Richard Stallman <rms@gnu.org>
25586
25587 * doc/bison.texinfo: *** empty log message ***
25588
255891993-06-03 Richard Stallman <rms@gnu.org>
25590
25591 * bison.simple: New file.
25592
255931993-05-19 Richard Stallman <rms@gnu.org>
25594
25595 * doc/bison.texinfo: New file.
25596
255971993-05-07 Noah Friedman <friedman@gnu.org>
25598
25599 * Makefile.in: *** empty log message ***
25600
256011993-04-28 Noah Friedman <friedman@gnu.org>
25602
25603 * src/reader.c: *** empty log message ***
25604
256051993-04-23 Noah Friedman <friedman@gnu.org>
25606
25607 * src/alloc.h: entered into RCS
25608
256091993-04-20 David J. MacKenzie <djm@gnu.org>
25610
25611 * src/version.c: *** empty log message ***
25612
25613 * src/files.c, src/allocate.c:
25614 entered into RCS
25615
25616 * src/reader.c: *** empty log message ***
25617
25618 * src/lex.c: entered into RCS
25619
25620 * src/conflicts.c: New file.
25621
25622 * src/symtab.c: entered into RCS
25623
25624 * src/alloc.h: New file.
25625
25626 * src/LR0.c: entered into RCS
25627
256281993-04-18 Noah Friedman <friedman@gnu.org>
25629
25630 * src/reader.c: New file.
25631
25632 * src/version.c: *** empty log message ***
25633
256341993-04-18 Noah Friedman <friedman@gnu.org>
25635
25636 * Makefile.in: *** empty log message ***
25637
256381993-04-17 Noah Friedman <friedman@gnu.org>
25639
25640 * Makefile.in: *** empty log message ***
25641
256421993-04-15 Richard Stallman <rms@gnu.org>
25643
25644 * src/main.c, src/files.c:
25645 New file.
25646
256471993-04-15 Noah Friedman <friedman@gnu.org>
25648
25649 * configure.in: entered into RCS
25650
25651 * configure.in: *** empty log message ***
25652
25653 * configure.in: New file.
25654
256551993-04-14 Richard Stallman <rms@gnu.org>
25656
25657 * Makefile.in: New file.
25658
256591993-04-13 Richard Stallman <rms@gnu.org>
25660
25661 * src/version.c: New file.
25662
256631993-03-25 Richard Stallman <rms@gnu.org>
25664
25665 * src/output.c: entered into RCS
25666
256671992-09-25 Richard Stallman <rms@gnu.org>
25668
25669 * configure.bat: entered into RCS
25670
256711992-06-22 Richard Stallman <rms@gnu.org>
25672
25673 * src/vmsgetargs.c: entered into RCS
25674
256751992-06-22 Richard Stallman <rms@gnu.org>
25676
25677 * doc/bison.rnh: entered into RCS
25678
256791992-04-20 David J. MacKenzie <djm@gnu.org>
25680
25681 * README: entered into RCS
25682
256831992-01-22 Richard Stallman <rms@gnu.org>
25684
25685 * src/machine.h: entered into RCS
25686
256871991-12-21 Richard Stallman <rms@gnu.org>
25688
25689 * src/lalr.c, src/closure.c:
25690 entered into RCS
25691
256921991-12-20 Richard Stallman <rms@gnu.org>
25693
25694 * src/state.h: entered into RCS
25695
256961991-12-18 Richard Stallman <rms@gnu.org>
25697
25698 * src/print.c, src/nullable.c, src/derives.c:
25699 entered into RCS
25700
257011991-11-03 David J. MacKenzie <djm@gnu.org>
25702
25703 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
25704 entered into RCS
25705
257061988-09-09 Richard Stallman <rms@gnu.org>
25707
25708 * src/bison.hairy: entered into RCS
25709
257101987-12-16 Richard Stallman <rms@gnu.org>
25711
25712 * REFERENCES: entered into RCS
dc546b0f 25713
f294a2c2 25714
04098407 25715 -----
f294a2c2 25716
7d424de1
PE
25717 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
25718 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
25719 2008, 2009, 2010 Free Software Foundation, Inc.
f294a2c2 25720
04098407
PE
25721 Copying and distribution of this file, with or without
25722 modification, are permitted provided the copyright notice and this
25723 notice are preserved.