]> git.saurik.com Git - bison.git/blame - ChangeLog
Fix portability problem on OpenBSD 4.7.
[bison.git] / ChangeLog
CommitLineData
95aed8db
PE
12010-10-08 Paul Eggert <eggert@cs.ucla.edu>
2
8ff146cd
PE
3 Fix portability problem on OpenBSD 4.7.
4
5 Jim Meyering reported this in
6 <http://lists.gnu.org/archive/html/bug-bison/2010-10/msg00007.html>.
7 * data/yacc.c: Use EXIT_SUCCESS as a witness for stdlib.h,
8 not _STDLIB_H. EXIT_SUCCESS has been defined by the standard
9 for quite some time.
10 * src/parse-gram.c, src/parse-gram.h: Regenerate.
11 * tests/regression.at: Tamper with the renamed witness.
12
95aed8db
PE
13 Adjust to recent changes to gnulib bootstrap.
14
15 * .cvsignore, build-aux/.cvsignore, doc/.cvsignore, etc/.cvsignore:
16 * examples/calc++/.cvsignore, lib/.cvsignore, m4/.cvsignore:
17 * po/.cvsignore, runtime-po/.cvsignore, src/.cvsignore:
18 * tests/.cvsignore: Remove; I don't use CVS to maintain Bison
19 anymore and don't know of anybody else who does. If someone needs
20 these files, they can resurrect them.
21 * .gitignore, build-aux/.gitignore, doc/.gitignore, lib/.gitignore:
22 * m4/.gitignore, po/.gitignore, runtime-po/.gitignore:
23 Omit leading '/', since bootstrap omits it.
24 Adjust file names to match current contents better.
25 * bootstrap: Sync from gnulib: this contains the new gnulib_mk_hook
26 installed just for us.
27 * bootstrap.conf (excluded_files): Don't exclude codeset.m4,
28 glibc21.m4, inttypes_h.m4, size_max.m4, xsize.m4, as they are now
29 needed somehow. Don't have time to look into why.
30 (gnulib_modules): Change malloc to malloc-gnu. Do we really assume
31 the GNU malloc behavior, where malloc (0) != NULL unless we're
32 out of storage? If not, we can omit malloc-gnu; but for now I left
33 it in to be safe.
34 (vc_ignore): Remove.
35 (gnulib_mk_hook): New function.
36 * README-hacking: Renamed from HACKING, since gnulib bootstrap now
37 uses that convention.
38
39f5757a
PH
392010-09-09 Paul Hilfinger <hilfinger@cs.berkeley.edu>
40
41 * data/glr.c (yySymbol): Define as int to avoid compiler warnings about
42 possible change of value.
43
d467f443
PH
442010-09-08 Paul Hilfinger <hilfinger@cs.berkeley.edu>
45
46 * data/glr.c (yy_reduce_print): Change yyrhsVals to yyvsp to remove
47 compiler errors when using %debug.
48 Add declaration of yylow when locations in use to avoid compilation
49 error.
50 (yyglrReduce): Conditionalize message "Parse ... rejected by rule..."
51 on whether we are in split mode, for consistency with behavior of
52 non-GLR parsing.
53
c49784f5
AD
542010-09-01 Akim Demaille <demaille@gostai.com>
55
56 Address GCC warnings about shadowed local variables (yyflag).
57 * data/glr.c (YYCHK): Rename yyflag as yychk_flag.
58 (yyprocessOneStack): Reduce the scope of yyaction, yyconflicts,
59 yyrule, and yyflag.
60
64877e5e
JD
612010-08-05 Joel E. Denny <joeldenny@joeldenny.org>
62
63 Version 2.4.3.
64 * NEWS (2.4.3): Set date.
65
83af6585
JD
662010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
67
68 maint: add gettext version to release announcements.
69 Suggested by Paul Hilfinger at
70 <http://lists.gnu.org/archive/html/bison-patches/2010-07/msg00019.html>
71 <http://lists.gnu.org/archive/html/bison-patches/2010-08/msg00002.html>.
72 * cfg.mk (bootstrap-tools): Add gettext.
73
93d7dde9
JD
742010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
75
76 doc: fix -W and %expect documentation some.
77 * NEWS (2.4.3): Mention that there are documentation fixes.
78 * doc/bison.texinfo (Expect Decl): Make it clear that %expect
79 turns conflicts into errors not warnings.
80 (Shift/Reduce): Likewise.
81 (Bison Options): Don't mention -Wsyntax. It doesn't exist.
82
2bfcac9a
JD
832010-08-01 Joel E. Denny <joeldenny@joeldenny.org>
84
85 -Werror: fix for rules useless in parser after conflicts.
86 * NEWS (2.4.3): Document fix.
87 * src/complain.c (error_message): Extend to handle incomplete
88 error messages so warn and warn_at can be used in more cases.
89 * src/gram.c (grammar_rules_useless_report): Use warn_at so that
90 -Werror is always obeyed.
91 * src/reduce.c (reduce_print): Use warn so that the "warnings
92 being treated as errors" message is printed consistently before
93 the first warning message. This makes testing easier.
94 * tests/local.at (AT_BISON_WERROR_MSG): New macro.
95 (AT_BISON_CHECK_NO_XML): Extend to check -Werror and
96 --warnings=error when warnings appear in bison's stderr.
97
c61d4fa1
JD
982010-07-29 Joel E. Denny <joeldenny@joeldenny.org>
99
100 maint: enable gnits only at stable releases.
101 * configure.ac (AM_INIT_AUTOMAKE): Underscore or dash in a
102 version string should disable gnits. Explain in comments.
103
825c88e8
JD
1042010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
105
106 i18n: update.
107 * po/POTFILES.in: Add src/graphviz.c.
108
343c3db8
JD
1092010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
110
111 i18n: fix for gnulib.
112 * po/POTFILES.in: Add remaining gnulib files that have
113 translatable strings.
114
42765f8e
JD
1152010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
116
117 build: fix our adjustments for gnulib files in lib.
118 * configure.ac: For prepending lib/ to the values of config
119 variables, fix detection of empty values. Also, due to recent
120 gnulib changes, add LIBUNISTRING_UNITYPES_H and
121 LIBUNISTRING_UNIWIDTH_H to the list of those variables.
122
e35bc778
JD
1232010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
124
125 maint: use announce-gen's new --mail-headers.
126 * HACKING (Announce): Update instructions.
127 * cfg.mk (announcement_Cc_): Define.
128 * configure.ac (AM_GNU_GETTEXT_VERSION): Update to 0.18 as
129 required by latest gnulib.
130 * gnulib: Update to latest.
131
b6ca79e8
JD
1322010-07-24 Joel E. Denny <joeldenny@joeldenny.org>
133
134 tests: handle Valgrind that complains about >&-.
135 * tests/output.at (AT_CHECK_OUTPUT): Extend to accept pre-tests.
136 (Output files: -dv >&-): Skip test group if running
137 maintainer-check-valgrind.
138
ca2a6d15
PH
1392010-07-23 Paul Hilfinger <hilfingr@EECS.Berkeley.EDU>
140
141 * NEWS: Describe new semantic-predicate feature.
142 * data/c.m4 (b4_predicate_case): New definition.
143 * data/java.m4 (b4_predicate_case): New definition.
144 * data/glr.c (yyimmediate): Add definition.
145 (yydoAction): Remove comment, now obsolete.
146 Do YY_REDUCE_PRINT here.
147 (yyglrReduce): Alter comment to indicate that semantic values
148 need not be deferred.
149 Remove YY_REDUCE_PRINT from here; done in yydoAction.
150 (yyprocessOneStack): Pass immediate flag.
151 Delete stacks rejected by predicates in newly split-off parsers.
152 Change handling of yyerr so that only current stack gets deleted
153 when semantic predicate fails.
154 (yyfillin): Don't crash if a semantic value is unresolved (as may
155 happen in predicate rules).
156 Copy lr state as well in debugging mode.
157 Update comment on setting of yysval to include yyloc as well.
158 (yy_reduce_print): Add yynormal argument. Perform fillin properly.
159 Report unresolved RHS values.
160 (yyimmediate): New table.
161 * src/gram.h (struct rule): Add is_predicate field.
162 * src/output.c (user_actions_output): Use b4_predicate_case for
163 predicates.
164 (prepare_symbols): Output yyimmediate.
165 * src/scan-gram.l: Add %? token, SC_PREDICATE state.
166 * src/scan-code.l (code_props_rule_action_init): Add is_predicate
167 argument.
168 * src/scan-code.h (struct code_props): Add is_predicate field.
169 (code_props_rule_action_init): New interface.
170 * src/parse-gram.y (%?{...}): New token.
171 (rhs): Add %?{...} rule.
172 * src/parse-gram.c: Regenerate.
173 * src/parse-gram.h: Regenerate.
174 * src/reader.c (grammar_current_rule_action_append): Add
175 immediate argument.
176 (grammar_midrule_action): Use new interface for
177 code_props_rule_action_init.
178 (grammar_current_rule_action_append): Ditto.
179 (packgram): Transfer is_predicate value.
180 * src/reader.h (grammar_current_rule_action_append): New interface.
181 * doc/bison.texinfo: Document semantic predicates (%?).
c49784f5 182
ca2a6d15
PH
183 * data/glr.c (yylhsNonterm, yyisDefaultedState,yyDefaultAction)
184 (yygetLRActions,yynewGLRStackItem,yyaddDeferredAction,yyinitStateSet)
185 (yyinitGLRStack,yyexpandGLRStack,yyupdateSplit,yymarkStackDeleted)
186 (yyundeleteLastStack,yyglrShift,yyglrShiftDefer,yydoAction,yyglrReduce)
187 (yyidenticalOptions,yymergeOptionSets,yyresolveStates,yyresolveAction)
188 (yyresolveLocations,yyresolveValue,yyreducePrint): Update parameter
189 names in comments and mention all parameters.
190 (struct yyGLRState): Fix description of yyposn field.
191 (yyresolveLocations): Correct comment so as not to imply action when
192 yyn1==0.
c49784f5 193
7d424de1
PE
1942010-06-17 Paul Eggert <eggert@cs.ucla.edu>
195
804e83b2
PE
196 Update from GFDL GFDL 1.2 to 1.3.
197 * doc/bison.texinfo: Update GFDL version number.
198 * doc/fdl.texi: Update to version 1.3, taken from:
199 http://www.gnu.org/licenses/fdl.texi
200
7d424de1
PE
201 Do not use date ranges in copyright notices.
202 See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices
203
204 * HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha:
205 * TODO, bootstrap, bootstrap.conf:
206 * build-aux/update-b4-copyright, cfg.mk, configure.ac:
207 * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4:
208 * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc:
209 * data/java-skel.m4, data/java.m4, data/lalr1.cc:
210 * data/lalr1.java, data/local.mk, data/location.cc:
211 * data/stack.hh, data/variant.hh, data/xslt/bison.xsl:
212 * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl:
213 * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint:
214 * djgpp/README.in, djgpp/config.bat, djgpp/config.sed:
215 * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat:
216 * djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h:
217 * djgpp/testsuite.sed, doc/bison.texinfo, doc/local.mk:
218 * doc/refcard.tex, etc/README, etc/bench.pl.in, etc/local.mk:
219 * examples/calc++/Makefile.am, examples/extexi:
220 * examples/local.mk, lib/abitset.c, lib/abitset.h:
221 * lib/bbitset.h, lib/bitset.c, lib/bitset.h:
222 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
223 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
224 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
225 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
226 * lib/libiberty.h, lib/local.mk, lib/main.c, lib/timevar.c:
227 * lib/timevar.def, lib/timevar.h, lib/vbitset.c:
228 * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4:
229 * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4:
230 * src/AnnotationList.c, src/AnnotationList.h:
231 * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c:
232 * src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c:
233 * src/assoc.h, src/closure.c, src/closure.h, src/complain.c:
234 * src/complain.h, src/conflicts.c, src/conflicts.h:
235 * src/derives.c, src/derives.h, src/files.c, src/files.h:
236 * src/flex-scanner.h, src/getargs.c, src/getargs.h:
237 * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c:
238 * src/ielr.h, src/lalr.c, src/lalr.h, src/local.mk:
239 * src/location.c, src/location.h, src/main.c:
240 * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c:
241 * src/named-ref.h, src/nullable.c, src/nullable.h:
242 * src/output.c, src/output.h, src/parse-gram.y:
243 * src/print-xml.c, src/print-xml.h, src/print.c, src/print.h:
244 * src/print_graph.c, src/print_graph.h, src/reader.c:
245 * src/reader.h, src/reduce.c, src/reduce.h, src/relation.c:
246 * src/relation.h, src/scan-code.h, src/scan-code.l:
247 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
248 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
249 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
250 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
251 * tests/actions.at, tests/atlocal.in, tests/c++.at:
252 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
253 * tests/existing.at, tests/glr-regression.at:
254 * tests/headers.at, tests/input.at, tests/java.at:
255 * tests/local.at, tests/local.mk, tests/named-refs.at:
256 * tests/output.at, tests/push.at, tests/reduce.at:
257 * tests/regression.at, tests/sets.at, tests/skeletons.at:
258 * tests/synclines.at, tests/testsuite.at, tests/torture.at:
259 Don't use date ranges in copyright notices.
260
38435078
AD
2612010-05-11 Akim Demaille <demaille@gostai.com>
262
263 lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
264 * data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
265 header file to the implementation file, after the user %code
266 sections.
267 * NEWS (2.5): Document this.
268
e944aaff
AD
2692010-05-11 Akim Demaille <demaille@gostai.com>
270
271 doc: please Emacs.
272 * doc/bison.texinfo (Local Variables): Move this after the
273 LocalWords, since the latter are looked for in the whole document,
274 while the former are looked for only at its end.
275 Require american spell checking.
276
86e5b440
AD
2772010-05-10 Akim Demaille <demaille@gostai.com>
278
279 doc: fix lalr1.cc documentation.
280 * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature.
281 (C++ Bison Interface): Fix lalr1.cc skeleton name.
282 (C++ Parser Interface): Fix semantic_type and location_type names.
283 Document yy::parser::token.
284 Reported by Jerry Quinn.
285
bb9191dd
AD
2862010-05-10 Akim Demaille <demaille@gostai.com>
287
288 c++: use YYRHSLOC.
289 * data/lalr1.cc (YYRHSLOC): New.
290 (YYLLOC_DEFAULT): Use it.
291 * data/glr.cc: If location_type was user defined, do not include
292 location.hh, and do not produce location.hh and position.hh.
293 * tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC.
294 Check that glr.cc supports user defined location_type.
295 * NEWS: Document this.
296
8aec287e
AD
2972010-05-07 Akim Demaille <demaille@gostai.com>
298
299 doc: fix typo.
300 * tests/synclines.at: here.
301
c826013f
AD
3022010-05-04 Akim Demaille <demaille@gostai.com>
303
304 tests: enhance AT_SYNCLINES_COMPILE.
305 * tests/synclines.at (AT_SYNCLINES_COMPILE): More distcc patterns.
306 (AT_TEST_SYNCLINE): Remove GCC 4.5 protection which is already
307 taken care of in AT_SYNCLINES_COMPILE.
308
7789b6e3
AD
3092010-05-04 Akim Demaille <demaille@gostai.com>
310
311 lalr1.cc: don't generate location.hh when location_type is defined
312 * data/bison.m4 (b4_percent_define_get): Accept a default value.
313 * data/c++.m4: Do not provide a default value for the %define
314 variable location_type, rather, use b4_percent_define_get with a
315 default argument where its value is needed.
316 * data/lalr1.cc: Do not load location.cc (which outputs both
317 location.hh and position.hh) if the user defined location_type.
318 Do not include location.hh either.
319
19ad326b
AD
3202010-05-04 Akim Demaille <demaille@gostai.com>
321
322 lalr1.cc: minor refactoring.
323 * data/lalr1.cc: Don't issue empty namespaces.
324
f5da8149
AD
3252010-05-04 Akim Demaille <demaille@gostai.com>
326
327 tests: fix %printer.
328 Currently, there is no check that %printer ... <foo> (nor
329 %destructor) is about an existing <foo> type. This C++ test had
330 it wrong (<::std::string> vs. <std::string>).
331
332 * tests/c++.at (AT_CHECK_VARIANTS): In list.yy, redefine the
333 pretty-printing of lists into something better for parser traces.
334 Update the expected output.
335 Fix correspondance between %type/%token and %printer.
336
49976d5c
AD
3372010-05-04 Akim Demaille <demaille@gostai.com>
338
339 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
340 * tests/calc.at (Span): Instead of begin/end, as in the built-in
341 location class, use first and last.
342 Define YYLLOC_DEFAULT to adjust to these changes.
343 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
344 location_type changes.
345
bc81de36
JD
3462010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
347
348 tests: fix maintainer-xml-check.
349 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
350 Update output to include comments now produced by --graph.
351 (xsl:template match="automaton"): As for --graph, name the
352 digraph after the grammar file.
353 * src/print-xml.c (escape_bufs): Enlarge array.
354 (print_xml): Add bug-report and url attributes to
355 bison-xml-report element.
356
b7666378
JD
3572010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
358
359 In DOT output, convert from "/*" comments to "//" comments.
360 This handles the possibility that a "*/" might appear in
361 variable portions of those comments at some point in the future.
362 * src/graphviz.c (start_graph): Implement.
363
9b5049bd
JD
3642010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
365
366 Document that undefined %prec identifier warnings will remain.
367 * NEWS (2.4.3): Here.
368 (2.4.2): Here.
369
02354690
JD
3702010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
371
372 Revert 2009-12-30 change for undefined %prec token complaints.
373 That is, keep them as warnings because that should be sufficient
374 to satisfy POSIX without creating backward compatibility issues.
375 Suggested by Richard Stallman at
376 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
377 * NEWS (2.5): Remove mention of complaint.
56e92e0b
JD
378 * src/reader.c (grammar_rule_check): Convert complaint back to
379 warning.
02354690
JD
380 * tests/input.at (%prec's token must be defined): Update.
381
a7ddefd1
JD
3822010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
383
384 build: don't require src/bison during bootstrap.
385 Suggested by Eric Blake at
386 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
387 * bootstrap.conf (bootstrap_epilogue): New function to make sure
388 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
389
c1bd4b2b
JD
3902010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
391
392 i18n: fix untranslatable string.
393 Reported by Goran Uddeborg at
394 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
395 * src/muscle-tab.c (muscle_percent_define_insert): Here.
396
67f1a2c2
AD
3972010-04-13 Akim Demaille <demaille@gostai.com>
398
399 tests: calc: minor refactoring.
400 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
401
4f756f88
AD
4022010-04-13 Akim Demaille <demaille@gostai.com>
403
404 tests: calc: simplify location management.
405 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
406 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
407 define the appropriate AT_LOC accessors.
408 * tests/calc.at: Use AT_LOC accessors.
409
24bb8c8c
AD
4102010-04-13 Akim Demaille <demaille@gostai.com>
411
412 test location_type.
413 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
414 Define AT_LOCATION_TYPE_IF.
415 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
416 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
417 used, provide a user location type and use it.
418 (Simple LALR1 C++ Calculator): Add a test case for location_type.
419
af129079
AD
4202010-04-13 Akim Demaille <demaille@gostai.com>
421
422 tests: check fclose's return value.
423 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
424
36dc3637
AD
4252010-04-13 Akim Demaille <demaille@gostai.com>
426
427 tests: don't depend on the actual location type.
428 * tests/calc.at: Use yy::parser::location_type rather than
429 yy::location, since the former is always right, and might point to
430 another type than the latter.
431
c499231d
AD
4322010-04-13 Akim Demaille <demaille@gostai.com>
433
434 formatting changes.
435 * tests/calc.at: Formatting changes.
436
7799ef15
AD
4372010-04-13 Akim Demaille <demaille@gostai.com>
438
439 lalr1.cc: remove useless forward declaration.
440 * data/lalr1.cc: Include location.hh before stack.hh.
441 Remove the useless forward declarations of position and location.
442 Reported by Chris Morley.
443 * data/glr.cc: Likewise.
444
06cb07d5
JD
4452010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
446
447 * NEWS (2.4.3): Mention fix for Sun Studio C++.
448
4586c8cd
JD
4492010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
450
451 tests: fix for newer Sun Studio C++.
452 Reported by Dagobert Michelsen at
453 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
454 * THANKS (Dagobert Michelsen): Add.
455 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
456 Autoconf macro for handling the restrict keyword.
457 * gnulib: Update to latest, which no longer overrides that macro
458 from Autoconf.
459
44c2b42d
JD
4602010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
461
462 portability: fix pointer arithmetic to conform to C standard.
463 Reported by Tys Lefering at
464 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
465 This fix is already implemented in glr.c and does not apply to
466 lalr1.java.
467 * data/lalr1.cc (yy::parser::parse): Increase size of
468 yyerror_range and adjust subscripting so you don't have to
469 subtract one from the beginning of the array.
470 * data/yacc.c (b4_declare_parser_state_variables,
471 yyparse, yypush_parse): Likewise.
472
218287f5
AD
4732010-04-05 Akim Demaille <demaille@gostai.com>
474
475 remove useless include.
476 * src/graphviz.h: Don't include stdbool.h.
477
8176ab33
AD
4782010-04-05 Akim Demaille <demaille@gostai.com>
479
480 graph: sign the output file.
481 * src/graphviz.c (start_graph): Issue comments about Bison.
482 Suggested by Tys Lefering.
483
4ad3921d
JD
4842010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
485
486 portability: fix test suite for GCC 4.5's new #error message.
487 Reported by Tys Lefering at
488 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
489 * NEWS (2.4.3): Mention.
490 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
491
10a697de
AD
4922010-03-30 Akim Demaille <demaille@gostai.com>
493
494 fix comments.
495 * src/graphviz.h: Add missing license notice.
496 Document.
497
d6b347e4
AD
4982010-03-25 Akim Demaille <demaille@gostai.com>
499
500 tests: fix 250: parse.error=verbose overflow.
501 * tests/regression.at (parse.error=verbose overflow): Avoid the
502 double inclusion of stdlib.h as it triggers hard errors.
503
b8675840
JD
5042010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
505
506 portability: fix for BSD make.
507 Reported by Johan van Selst at
508 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
509 * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in
510 this dependency list as in package.m4's target rule.
511
8b9e021f
JD
5122010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
513
514 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
515 Reported by Johan van Selst at
516 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
517 * NEWS (2.4.3): New.
518 * THANKS (Johan van Selst): Add.
519 * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
520 targets so that gnulib's new c++defs.h is matched.
521 * gnulib: Update to latest.
522
96a381c5
JD
5232010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
524
525 maint: update for changes to gnulib's announce-gen.
526 * HACKING (Announce): RELEASE_TYPE=major must now be written
527 RELEASE_TYPE=stable.
528
e19a049c
JD
5292010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
530
531 Version 2.4.2.
532 * NEWS (2.4.2): Set version and date. For the recent test suite
533 portability fixes, don't be so optimistic about their success
534 given the lack of feedback on the affected platforms.
535
890aeb28
JD
5362010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
537
538 tests: fix maintainer-xml-check for recent changes.
539 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
540 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
541 output file whose name conflicts with a previous output file
542 is now never generated.
543
f39ab286
JD
5442010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
545
546 portability: fix several issues with M4 subprocess.
547
548 M4's output pipe was not being drained upon fatal errors during
549 scan_skel. As a result, broken-pipe messages from M4 were seen
550 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
551 failure in the test suite. The problem was that, on platforms
552 where the default disposition for SIGPIPE is ignore instead of
553 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
554 then reported it. However, there's some sort of race condition,
555 because the new test group occasionally succeeded.
556 Reported by Albert Chin at
557 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
558
559 There were also problems with the test suite livelocking on
560 Tru64 5.1b. Reported by Didier Godefroy at
561 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
562 Switching to create_pipe_bidi suggested by Akim Demaille.
563
564 To attempt to solve both of these problems, switch to gnulib's
565 create_pipe_bidi and register M4 process as a slave. Along the
566 way, clean up file name conflict handling, which was affected by
567 the broken-pipe problem before the switch.
568 * NEWS (2.4.2): Document.
569 * THANKS (Didier Godefroy): Add.
570 * bootstrap.conf (gnulib_modules): Add pipe.
571 * gnulib: Update to latest to make sure we have all the latest
572 fixes.
573 * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and
574 subpipe.c.
575 * po/POTFILES.in (lib/subpipe.c): Remove.
576 * src/files.c (compute_output_file_names): Update invocations
577 of output_file_name_check.
578 (output_file_name_check): In the case that the grammar file
579 would be overwritten, use complain instead of fatal, but replace
580 the output file name with /dev/null. Use the /dev/null solution
581 for the case of two conflicting output files as well because it
582 seems safer in case Bison one day tries to open both files at
583 the same time.
584 * src/files.h (output_file_name_check): Update prototype.
585 * src/output.c (output_skeleton): Use create_pipe_bidi and
586 wait_subprocess. Assert that scan_skel completely drains the
587 pipe.
588 * src/scan-skel.l (at_directive_perform): Update
589 output_file_name_check invocation.
590 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
591 grammar file actually isn't overwritten.
592 (Conflicting output files: -o foo.y): Update expected output.
593 * tests/skeletons.at (Fatal errors but M4 continues producing
594 output): New test group.
595
e32050b0
JD
5962010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
597
598 Update POTFILES.
599 * HACKING (Release Procedure): Add reminder about keeping
600 POTFILES files up-to-date.
601 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
602
efc4ed4a
JD
6032010-02-01 Joel E. Denny <jdenny@clemson.edu>
604
605 Code cleanup.
606 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
607 which is already defined in atconfig.
608
95611b56
JD
6092010-01-22 Joel E. Denny <jdenny@clemson.edu>
610
611 tests: fix missing include caught by g++ 4.4.1.
612 Reported by Tys Lefering.
613 * HACKING (Release checks): Add note about trying a recent GCC.
614 * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include
615 cstdlib for abort.
616 (_AT_DATA_EXPECT2_Y): Likewise.
617
d6e40cba
JD
6182010-01-21 Joel E. Denny <jdenny@clemson.edu>
619
620 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
621
80b70223
JD
6222010-01-21 Joel E. Denny <jdenny@clemson.edu>
623
624 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
625 * HACKING (Release Procedure): Update notes on copyright years.
626 * Makefile.am (update-package-copyright-year): New target rule.
627 * build-aux/update-package-copyright-year: New file.
628 * cfg.mk (update-copyright): Add update-package-copyright-year
629 as a dependency.
630
3320a276
JD
6312010-01-19 Joel E. Denny <jdenny@clemson.edu>
632
633 * bootstrap: Import improvements from latest gnulib.
634
e30c0477
JD
6352010-01-19 Joel E. Denny <jdenny@clemson.edu>
636
637 build: require Automake 1.11.1 to avoid a security flaw.
638 * HACKING (Release Procedure): Don't document Automake security
639 flaw here.
640 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
641 why here.
642
a538eeb1
JD
6432010-01-19 Joel E. Denny <jdenny@clemson.edu>
644
645 gnulib: update to latest.
646
d6bdb90a
JD
6472010-01-19 Joel E. Denny <jdenny@clemson.edu>
648
649 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
650
326e5cf8
JD
6512010-01-15 Joel E. Denny <jdenny@clemson.edu>
652
653 Thank the developer of the initial push parser implementation.
654 This unfortunate oversight is several years old.
655 * THANKS (Odd Arild Olsen): Add.
656
fca9c5ef
JD
6572010-01-04 Joel E. Denny <jdenny@clemson.edu>
658
659 Fix some comments concerning LR(0) versus LALR(1).
660
661 Stop equating LR(0) with nondeterminism and LALR(1) with
662 determinism. That is, if all states are consistent, then LR(0)
663 tables are deterministic. On the other hand, LALR(1) tables
664 might be nondeterministic before conflict resolution, and GLR
665 permits LALR(1) tables to remain nondeterministic.
666 * src/LR0.c, src/LR0.h: Here.
667 * src/lalr.c, src/lalr.h: Here.
668 * src/main.c (main): Here.
669 * src/state.c, src/state.h: Here.
670
671 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
672 parser tables.
673
e141f4d4
JD
6742010-01-04 Joel E. Denny <jdenny@clemson.edu>
675
676 maint: run "make update-copyright"
677
882be728
JD
6782009-12-30 Joel E. Denny <jdenny@clemson.edu>
679
680 POSIX: complain if %prec's token was not defined.
681 * NEWS (2.5): Document.
682 * src/reader.c (grammar_rule_check): Convert warning to
683 complaint.
684 * tests/input.at (%prec's token must be defined): Update.
685
8bb3a2e7
JD
6862009-12-30 Joel E. Denny <jdenny@clemson.edu>
687
688 POSIX: warn if %prec's token was not defined.
689 Reported by Florian Krohm at
690 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
691 * NEWS (2.4.2): Document.
692 * src/reader.c (grammar_rule_check): Implement.
693 (grammar_current_rule_prec_set): Add comments explaining that we
694 here assume a %prec identifier is a token, but we still manage
695 to support POSIX.
696 * tests/input.at (%prec's token must be defined): New test
697 group.
698
505e1551
JD
6992009-12-31 Joel E. Denny <jdenny@clemson.edu>
700
701 * HACKING (Release Procedure): Recommend a secure automake.
702
b8d19cf8
JD
7032009-12-29 Joel E. Denny <jdenny@clemson.edu>
704
705 portability: `<' and `>' are not always defined on addresses.
706 Specifically, don't sort objects by their memory addresses when
707 they're not allocated in the same array or other object. Though
708 I haven't found a test case where that fails on my platform, C
709 says the behavior is undefined.
710 * src/AnnotationList.c (AnnotationList__insertInto): Remove
711 FIXME. Use new id field of InadequacyList nodes rather than
712 their memory addresses when sorting.
713 (AnnotationList__compute_from_inadequacies): Add
714 inadequacy_list_node_count argument to pass to
715 InadequacyList__new_conflict.
716 * src/AnnotationList.h
717 (AnnotationList__compute_from_inadequacies): Update prototype
718 and documentation for new argument.
719 * src/InadequacyList.c (InadequacyList__new_conflict): Add
720 node_count argument and use it to assign a unique ID.
721 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
722 (InadequacyList): Add id field.
723 (InadequacyList__new_conflict): Update prototype and
724 documentation for new argument.
725 * src/ielr.c (ielr_compute_annotation_lists): Update
726 AnnotationList__compute_from_inadequacies invocation.
727
df222dfa
JD
7282009-12-20 Joel E. Denny <jdenny@clemson.edu>
729
730 Fix handling of yychar manipulation in user semantic actions.
731 The problem was that yacc.c didn't always update the yychar
732 translation afterwards. However, other skeletons appear to be
733 fine. glr.c appears to already translate yychar before every
734 use. lalr1.cc does not define yychar and does not document its
735 replacement, yyla, for users. It does provide yyclearin, but
736 that does not manipulate yyla and thus requires no translation
737 update. In lalr1.java, yychar is out of scope during semantic
738 actions.
739 * NEWS (2.5): Document.
740 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
741 yytoken here.
742 (yyparse, yypush_parse): Instead, translate before every use of
743 yytoken, and add comments explaining this approach.
744 * tests/actions.at (Destroying lookahead assigned by semantic
745 action): New test group checking that translation happens before
746 lookahead destructor calls at parser return. Previously,
747 incorrect destructors were called.
748 * tests/conflicts.at (parse.error=verbose and consistent
749 errors): New test group checking that translation happens at
750 syntax error detection before the associated verbose error
751 message and the associated lookahead destructor calls. While
752 the destructor call is fixed by this patch, the verbose error
753 message is currently incorrect due to another bug (see
754 comments in test group), so this is an expected failure for now.
755
4395a9ff
JD
7562009-12-21 Joel E. Denny <jdenny@clemson.edu>
757
758 YYFAIL: warn about uses and remove from lalr1.java.
759 * NEWS (2.5): Document.
760 * data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
761 and make it private. Update all uses.
762 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
763
1625df5b
JD
7642009-12-21 Joel E. Denny <jdenny@clemson.edu>
765
766 YYFAIL: deprecate.
767 * NEWS (2.4.2): Document deprecation and the phase-out plan.
768 * data/lalr1.java (parser::YYStack::YYFAIL): Add comment about
769 deprecation.
770 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
771 YYFAIL from GCC cpp's -Wunused-macros.
772 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
773 documentation.
774 (LocalWords): Remove YYFAIL.
775
5335b65a
JD
7762009-12-20 Joel E. Denny <jdenny@clemson.edu>
777
778 tests: cleanup.
779 * tests/c++.at (Syntax error discarding no lookahead): Don't
780 ignore stderr. Instead, eliminate remaining warnings.
781
d59beda0
JD
7822009-12-18 Joel E. Denny <jdenny@clemson.edu>
783
784 lalr1.cc: don't discard non-existent lookahead on syntax error.
785 * data/lalr1.cc (parser::parse): Check yyempty first.
786 * tests/c++.at (Syntax error discarding no lookahead): New test
787 group.
788
387b4d50
JD
7892009-12-17 Joel E. Denny <jdenny@clemson.edu>
790
791 Code cleanup.
792 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
793 function, which is no longer used.
794
a603c6e0
JD
7952009-12-16 Joel E. Denny <jdenny@clemson.edu>
796
797 Add gcc's -Wundef to test suite and fix another warning from it.
798 * NEWS (2.4.2): Update description of -Wundef fix.
799 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
800 (WARN_CFLAGS_TEST): New substitution.
801 * data/glr.c: Avoid warning about __STRICT_ANSI__.
802 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
803 WARN_CFLAGS.
804 (NO_WERROR_CFLAGS): Likewise.
805 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
806
19750d31
JD
8072009-12-16 Joel E. Denny <jdenny@clemson.edu>
808
809 * data/yacc.c: Reformat m4 a little.
810
c938d650
JD
8112009-12-16 Joel E. Denny <jdenny@clemson.edu>
812
813 Document gcc -Wundef fix.
814 * NEWS (2.4.2): Here.
815 * THANKS (Jonathan Nieder): Add.
816
fcd32abd
JN
8172009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
818
819 Simplify y.tab.c when location tracking is disabled.
820 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
821 tracking is not enabled. Instead, unconditionally define
822 YY_LOCATION_PRINT as a no-op for backward compatibility.
823
ae93128c
JN
8242009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
825
826 Avoid warnings from gcc -Wundef y.tab.c.
827 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
828 defined before using them.
829 * data/lalr1.cc: Likewise.
830 * data/yacc.c: Likewise.
831
c843aaab
JD
8322009-12-15 Joel E. Denny <jdenny@clemson.edu>
833
834 autoconf: update to latest for fix of M4 detection.
835 Reported by Eric Blake.
836 * submodules/autoconf: Update.
837
5c99151a
JD
8382009-12-15 Joel E. Denny <jdenny@clemson.edu>
839
840 portability: use -DGNULIB_POSIXCHECK.
841 Reported by Eric Blake. See discussions at
842 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
843 and
844 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
845 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
846 * bootstrap.conf (gnulib_modules): Add all the printf modules
847 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
848 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
849 (excluded_files): Remove m4/printf-posix.m4.
850 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
851 lib/libbison.a so gnulib libraries can be linked.
852
75f94c6d
JD
8532009-12-15 Joel E. Denny <jdenny@clemson.edu>
854
855 gnulib: update for fix of fprintf-posix, which we'll use soon.
856 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
857 targets so that gnulib's new arg-nonnull.h and link-warning.h
858 are matched.
859 * gnulib: Update.
860
ca01f454
JD
8612009-12-14 Joel E. Denny <jdenny@clemson.edu>
862
863 Enable assertion output and --disable-assert for configure.
864 * bootstrap.conf (gnulib_modules): Add assert module.
865 * src/system.h (aver): Define as assert, and summarize the
866 discussion on this issue.
867
9dc3ee6d
JD
8682009-12-14 Joel E. Denny <jdenny@clemson.edu>
869
870 Expand GLR acronym in summary of Bison.
871 Based on discussion with Akim Demaille starting at
872 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
873 * doc/bison.texinfo (Introduction): Here.
874 * src/getargs.c (usage): Here.
875
d013372c
AR
8762009-10-03 Alex Rozenman <rozenman@gmail.com>
877
878 Document named references.
879 * doc/bison.texinfo (Actions): Add new example and xref to
880 Using Named References node.
881 (Using Named References): New node.
882
5297ebb3
JD
8832009-10-16 Joel E. Denny <jdenny@clemson.edu>
884
885 cleanup.
886 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
887 of char*.
888 (Sbitset__isEmpty): Use Sbitset instead of char*.
889 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
890 instead of char. This helps to avoid casting errors.
891 (Sbitset__or): Use Sbitset instead of char*.
892
175620d3
JD
8932009-10-16 Joel E. Denny <jdenny@clemson.edu>
894
895 portability: don't assume 8-bit bytes.
896 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
897 * src/Sbitset.h (Sbitset__nbytes): Here.
898 (Sbitset__byteAddress): Here.
899 (Sbitset__bit_mask): Here.
900 (Sbitset__last_byte_mask): Here.
901 (Sbitset__ones): Here.
902 (SBITSET__FOR_EACH): Here.
903
786578e3
JD
9042009-10-11 Joel E. Denny <jdenny@clemson.edu>
905
906 portability: use va_start and va_end in the same function.
907 * src/complain.c (error_message): Move va_end from here...
908 (ERROR_MESSAGE): ... to here.
909
416a9da6
JD
9102009-10-08 Joel E. Denny <jdenny@clemson.edu>
911
912 * data/bison.m4: Update comments for rename to muscle-tab.h.
913
10659d0e
JD
9142009-10-07 Joel E. Denny <jdenny@clemson.edu>
915
916 Minor code cleanup.
917 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
918 replace all uses with UNIQSTR_CONCAT.
919 * src/uniqstr.c (uniqstr_vsprintf): New function.
920 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
921 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
922 macros.
923
3c5362b8
JD
9242009-10-06 Joel E. Denny <jdenny@clemson.edu>
925
926 * TODO (Complaint submessage indentation): New.
927
b143f404
JD
9282009-10-04 Joel E. Denny <jdenny@clemson.edu>
929
930 Minor code cleanup.
931 * src/parse-gram.y: Clean up sorting of declarations.
932 Use types to simplify %printer declarations where possible.
933 Provide %printer for BRACKETED_ID and symbol.prec.
934 * src/symtab.c: Whitespace change.
935
7439c5c0
JD
9362009-10-04 Joel E. Denny <jdenny@clemson.edu>
937
938 tests: skip tests of file names that platform does not support.
939 Reported by Michael Raskin at
940 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
941 * THANKS (Michael Raskin): Add.
942 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
943 to fail at least for file names containing ":" or "\".
944
45319f13
JD
9452009-09-23 Joel E. Denny <jdenny@clemson.edu>
946
947 yysyntax_error: avoid duplicate lookahead collection.
948 Except when memory reallocation is required, this change
949 eliminates the need to invoke yysyntax_error twice and thus to
950 repeat the collection of lookaheads. It also prepares for
951 future extensions that will make those repetitions more
952 expensive and that will require additional memory management in
953 yysyntax_error. Finally, it fixes an obscure bug already
954 exercised in the test suite.
955 * data/yacc.c (yysyntax_error): Add arguments for message
956 buffer variables stored in the parser. Instead of size, return
957 status similar to yyparse status but indicating success of
958 message creation. Other than the actual reallocation of the
959 message buffer, import and clean up memory management code
960 from...
961 (yyparse, yypush_parse): ... here.
962 * tests/regression.at (parse.error=verbose overflow): No longer
963 an expected failure.
964
52cea04a
JD
9652009-09-23 Joel E. Denny <jdenny@clemson.edu>
966
967 yysyntax_error: test memory management more.
968 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
969 * tests/regression.at (parse.error=verbose and
970 YYSTACK_USE_ALLOCA): New test group.
971 (parse.error=verbose overflow): New test group that reveals an
972 obscure bug. Expected fail for now.
973
37318e2f
JD
9742009-10-04 Joel E. Denny <jdenny@clemson.edu>
975
976 benchmarks: use %debug consistently among grammars.
977 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
978 %debug by default. It can affect the timings even if yydebug=0.
979 (generate_grammar_calc): For consistency with other grammars,
980 use YYDEBUG environment variable to set yydebug.
981
f74d6d25
JD
9822009-10-03 Joel E. Denny <jdenny@clemson.edu>
983
984 Remove dead code.
985 * src/symtab.c (symbol_pack): Here because every symbol's number
986 is always defined by this time.
987
5b1ff423
AR
9882009-10-03 Alex Rozenman <rozenman@gmail.com>
989
990 Add additional space after periods in NEWS.
991 * NEWS (2.5): here.
992
47eced30
JD
9932009-09-29 Joel E. Denny <jdenny@clemson.edu>
994
995 Use the correct conversion specifier for size_t.
996 Reported by Jim Meyering.
997 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
998 because Sbitset__Index is size_t.
999 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
1000
d8f68fc2
JD
10012009-09-27 Joel E. Denny <jdenny@clemson.edu>
1002
1003 tests: don't abuse AT_BISON_CHECK.
1004 * tests/regression.at (parse-gram.y: LALR = IELR): Move
1005 additional shell commands outside of AT_BISON_CHECK.
1006
43aabb70
JD
10072009-09-26 Joel E. Denny <jdenny@clemson.edu>
1008
1009 tests: check that parse-gram.y's IELR and LALR are identical.
1010 * tests/atlocal.in (abs_top_srcdir): New shell variable.
1011 * tests/regression.at (parse-gram.y: LALR = IELR): New test
1012 group.
1013
66381412
AR
10142009-09-19 Alex Rozenman <rozenman@gmail.com>
1015
1016 Keep sub-messages aligned. Fix strings for translation.
5b1ff423
AR
1017 * src/location.h (location_print): Add return value.
1018 * src/location.c (location_print): Return number of printed
66381412 1019 characters.
5b1ff423
AR
1020 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
1021 new functions.
1022 * src/complain.cpp (indent_ptr): New static variable.
1023 (error_message, complain_at_indent, warn_at_indent): Implement
1024 the alignment mechanism.
1025 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
1026 for translations. Use new alignment mechanism.
1027 * tests/named-ref.at: Adjust test-cases.
66381412
AR
1028 * NEWS (2.5): Add an announcement about named references.
1029
a6ca4ce2
AD
10302009-09-17 Akim Demaille <demaille@gostai.com>
1031
1032 doc: fixes.
1033 * doc/bison.texinfo: here.
1034 Reported by Alex Rozenman.
1035
3cdc21cf
AD
10362009-09-16 Akim Demaille <demaille@gostai.com>
1037
1038 doc: lalr1.cc and variants.
1039 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
1040 "variant" %define variables.
1041 (C++ Semantic Values): Split into...
1042 (C++ Unions, C++ Variants): these.
1043 The latter is new.
1044 (C++ Parser Interface): Fix type names.
1045 Document parser::syntax_error.
1046 Document the fact that locations are not mandatory.
1047 (C++ Scanner Interface): Split into...
1048 (Split Symbols, Complete Symbols): these.
1049 The later is new.
1050 (Calc++ Parsing Driver): Use variants.
1051 Add more comments.
1052 Adjust style.
1053 (Calc++ Parser): Declare all the tokens, no
1054 longer accept raw characters.
1055 Remove %union.
1056 Adjust types and printers.
1057 Remove destructors.
1058 (Calc++ Scanner): Use make_<SYMBOL> functions.
1059 Use strerror in error message.
1060
f50bfcd6
AD
10612009-09-16 Akim Demaille <demaille@gostai.com>
1062
1063 doc: spell checking.
1064 * doc/bison.texinfo: here.
1065
6b5a0de9
AD
10662009-09-16 Akim Demaille <demaille@gostai.com>
1067
1068 doc: comment changes.
1069 * doc/bison.texinfo: Comment changes.
1070
2b08bceb
AD
10712009-09-16 Akim Demaille <demaille@gostai.com>
1072
1073 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
1074 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
1075 constructor to take a token_type instead of the (internal) symbol
1076 number.
1077 Call yytranslate_.
1078 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
1079 don't call yytranslate_ here.
1080
c981ce9b
AD
10812009-09-16 Akim Demaille <demaille@gostai.com>
1082
1083 TODO: statistics.
1084 * TODO (Figures): New.
1085
00d80a9c
JD
10862009-09-13 Joel E. Denny <jdenny@clemson.edu>
1087
1088 tests: clean up push.at test group titles.
1089 * tests/push.at: Remove "Push Parsing: " from test group titles
1090 because these are already under the banner "Push Parsing Tests".
1091
f64e406b
AR
10922009-09-12 Alex Rozenman <rozenman@gmail.com>
1093
1094 Provide an additional sub-message for clarity.
1095 Add "symbol not found in production" error message when
1096 an "invalid reference" is detected in named references
1097 resolution.
1098 * src/scan-code.l: Update "invalid reference" case.
1099 * tests/named-ref.at: Adjust test-cases.
1100
bb31eb56
JD
11012009-09-10 Joel E. Denny <jdenny@clemson.edu>
1102
1103 Clean up yacc.c a little.
1104 * data/yacc.c: Clean up M4 for readability, and make output
1105 whitespace more consistent. For the main parse function
1106 comment, instead of saying "yyparse or yypush_parse", say either
1107 "yyparse" or "yypush_parse" depending on which it actually is.
1108
2d399888
JD
11092009-09-10 Joel E. Denny <jdenny@clemson.edu>
1110
1111 Fix --enable-gcc-warnings.
1112 * src/parse-gram.y (%printer <param>): Handle param_none.
1113
ff601366
AD
11142009-09-09 Akim Demaille <demaille@gostai.com>
1115
1116 lalr1.cc: syntax_error as exceptions.
1117 It is common to use sort of factories in the user actions. These
1118 factories may check some "syntactic" constraints that are not
1119 enforced by the grammar itself. This is possible using YYERROR
1120 within the action itself. Provide the user with a means to throw
1121 a syntax_error exception.
1122
1123 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
1124 Declare and define yy::parser::syntax_error.
1125 * data/lalr1.cc: Include stdexcept.
1126 (yy::parser::parse): Wrap the user action within a try/catch.
1127 * data/glr.cc: Include stdexcept.
1128
29660062
AD
11292009-09-09 Akim Demaille <demaille@gostai.com>
1130
1131 lalr1.cc: add missing "inline".
1132 * data/c++.m4 (b4_public_types_define): Add missing inline to
1133 implementations provided in headers.
1134
2055a44e
AD
11352009-09-09 Akim Demaille <demaille@gostai.com>
1136
1137 %param: documentation.
1138 * NEWS (2.6): Document %param, %lex-param, and %parse-param
1139 changes.
1140 * doc/bison.texinfo: Document that %lex-param and %parse-param
1141 are n-ary.
1142 Changes some examples to demonstrate it.
1143 (Calc++ Parser): Use %param.
1144
dd875058
AD
11452009-09-09 Akim Demaille <demaille@gostai.com>
1146
1147 Regen.
1148
f71db70b
AD
11492009-09-09 Akim Demaille <demaille@gostai.com>
1150
1151 style changes.
1152 * src/parse-gram.y (add_param): Scope changes.
1153
eaca4c11
AD
11542009-09-09 Akim Demaille <demaille@gostai.com>
1155
1156 %parse: support several arguments.
1157 * src/parse-gram.y (current_param): New.
1158 (param_type): Add param_none.
1159 (params): New nonterminal.
1160 Use it.
1161
b18cdd91
AD
11622009-09-09 Akim Demaille <demaille@gostai.com>
1163
1164 Regen.
1165
a7706735
AD
11662009-09-09 Akim Demaille <demaille@gostai.com>
1167
1168 %param.
1169 Provide a means to factor lex-param and parse-param common
1170 declarations.
1171
1172 * src/parse-gram.y (param_type): New.
1173 Define a %printer for it.
1174 (add_param): Use it.
1175 (%parse-param, %lex-param): Merge into...
1176 (%parse): this new token.
1177 Adjust the grammar to use it.
1178 * src/scan-gram.l (RETURN_VALUE): New.
1179 (RETURN_PERCENT_FLAG): Use it.
1180 (RETURN_PERCENT_PARAM): New.
1181 Use it to support %parse-param, %lex-param and %param.
1182
9789acf0
JD
11832009-09-03 Joel E. Denny <jdenny@clemson.edu>
1184
1185 Use aver not assert.
1186 * src/output.c: Don't include assert.h.
1187 (output_skeleton): Use aver not assert.
1188 * src/system.h (aver): In documentation of why, add links to
1189 Paul Eggert's explanations in the mailing lists.
1190
61bc57e5
AR
11912009-09-05 Alex Rozenman <rozenman@gmail.com>
1192
1193 Use "Unresolved reference" error message when no symbols were found
1194 in a symbolic reference resolution. Remove .expr and -expr from
1195 the shown reference when the reference is unresolved.
1196 * src/scan-code.l: Change the error message, adjust location columns,
1197 rename variable "exact_mode" to "explicit_bracketing".
1198 * tests/named-ref.at: Adjust existing tests and add a new one.
1199
f4c75eaf
AD
12002009-09-04 Akim Demaille <demaille@gostai.com>
1201
1202 Adjust synclines in src/parse-gram.[ch].
1203 * tests/bison.in: Do some magic (including working around issues
1204 with ylwrap) when this wrapper is used to compile
1205 src/parse-gram.y.
1206
c6abeab1
JD
12072009-09-03 Joel E. Denny <jdenny@clemson.edu>
1208
1209 Complain about unused %define variables and %code qualifiers.
1210 * NEWS (2.5): Document.
1211 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
1212 * doc/bison.texinfo (Decl Summary): Document complaint, and
1213 improve %define documentation a little otherwise.
1214 * tests/input.at (Reject unused %code qualifiers): Update.
1215 (%define errors): Update.
1216 (%define, --define, --force-define): Update.
1217 (%define backward compatibility): Update.
1218 (Unused %define api.pure): Update.
1219 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
1220
82db7cdb
JD
12212009-09-03 Joel E. Denny <jdenny@clemson.edu>
1222
1223 Don't suppress warnings about unused parse.error.
1224 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
1225 %define variable parse.error unless b4_error_verbose_flag is
1226 actually expanded in a skeleton.
1227
2755de8f
AD
12282009-09-03 Akim Demaille <demaille@gostai.com>
1229
1230 * NEWS (2.4.2): Add "Internationalization" item.
1231
1deef26d
AD
12322009-09-03 Akim Demaille <demaille@gostai.com>
1233
1234 bootstrap: fix/improve find_tool.
1235 * bootstrap (find_tool): Improve error messages.
1236 Fix typo about find_tool_names.
1237
2646cd54
JD
12382009-08-29 Joel E. Denny <jdenny@clemson.edu>
1239
1240 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
1241 See
1242 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
1243 * src/scan-code.h (code_props_rule_action_init): Rename
1244 named_ref arg to name so it doesn't shadow named_ref type. This
1245 makes it consistent with the function definition in scan-code.l
1246 anyway.
1247
cf499cff
JD
12482009-08-28 Joel E. Denny <jdenny@clemson.edu>
1249
1250 %define: accept unquoted values.
1251 * NEWS (2.5): Group all %define changes together, and document
1252 this one. Remove quotes in IELR and canonical LR entry.
1253 * doc/bison.texinfo: Remove quotes in most examples throughout.
1254 (Decl Summary): Update %define documentation.
1255 (Table of Symbols): Likewise.
1256 * src/ielr.c (LrType): Update documentation.
1257 * src/parse-gram.y (content.opt): Add production for ID.
1258 * tests/actions.at: Remove quotes in most tests.
1259 * tests/calc.at: Likewise.
1260 * tests/existing.at: Likewise.
1261 * tests/input.at: Likewise.
1262 * tests/local.at: Likewise.
1263 * tests/push.at: Likewise.
1264 * tests/reduce.at: Likewise.
1265 * tests/torture.at: Likewise.
1266
6ba96404
JD
12672009-08-28 Joel E. Denny <jdenny@clemson.edu>
1268
1269 %define lr.type: make values lowercase IDs.
1270 That is, "LALR" => "lalr", "IELR" => "ielr", and
1271 "canonical LR" => "canonical-lr".
1272 * NEWS (2.5): Update documentation.
1273 * doc/bison.texinfo (Decl Summary): Likewise.
1274 * src/ielr.c (ielr): Use new values.
1275 * src/ielr.h (ielr): Update documentation.
1276 * src/reader.c (prepare_percent_define_front_end_variables): Use
1277 and validate new values.
1278 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
1279 grammars.
1280 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
1281
4413bbd3
EB
12822009-08-27 Eric Blake <ebb9@byu.net>
1283
1284 scan-gram: avoid portability trap with ctype usage.
1285 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
1286 Avoid compiler warning.
1287
b70c7fb4
JD
12882009-08-27 Joel E. Denny <jdenny@clemson.edu>
1289
1290 tests: use perl for printing special sequences to files.
1291 And skip tests if perl is not available. This is better than
1292 playing tricks with shell portability. Suggested by Akim
1293 Demaille.
1294 * tests/input.at (Bad character literals): Use it here for
1295 omitting final newlines.
1296 (Bad escapes in literals): Use it here for special characters.
1297
d1cc31c5
JD
12982009-08-26 Joel E. Denny <jdenny@clemson.edu>
1299
1300 tests: show a use of %define lr.default-reductions "consistent"
1301 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
1302 prevents the omission of expected tokens for %error-verbose.
1303
3bed3a75
AD
13042009-08-26 Akim Demaille <demaille@gostai.com>
1305
1306 tests: portability fix.
1307 * tests/input.at (Bad escapes in literals): Don't expect "echo
1308 '\0'" to output \ then 0.
1309
aa0cb40d
JD
13102009-08-26 Joel E. Denny <jdenny@clemson.edu>
1311
1312 Actually handle the yytable zero value correctly this time.
1313 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
1314 zero values in the YYTABLE comments.
1315 * data/glr.c (yytable_value_is_error): Don't check for zero
1316 value.
1317 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
1318 * data/yacc.c (yytable_value_is_error): Likewise.
1319 * data/lalr1.java (yy_table_value_is_error_): Likewise.
1320 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
1321 * src/tables.h: In header comments, explain why it's useless to
1322 check for a zero value in yytable.
1323
f2b30bdf
JD
13242009-08-25 Joel E. Denny <jdenny@clemson.edu>
1325
1326 More fixes related to last two patches.
1327 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
1328 comments: zero indicates syntax error not default action.
1329 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
1330 defined.
1331 * data/glr.c (yyis_pact_ninf): Rename to...
1332 (yypact_value_is_default): ... this.
1333 (yyisDefaultedState): Update for rename.
1334 (yyis_table_ninf): Rename to...
1335 (yytable_value_is_error): ... this, and check for value zero
1336 besides just YYTABLE_NINF.
1337 (yygetLRActions): Check for default value from yypact. It
1338 appears that this check is always performed before this function
1339 is invoked, and so adding the check here is probably redundant.
1340 However, the code may evolve after this subtlety is forgotten.
1341 Also, update for rename to yytable_value_is_error. Because that
1342 macro now checks for zero, a different but equivalent branch of
1343 the if-then-else here is evaluated.
1344 (yyreportSyntaxError): Update for rename to
1345 yytable_value_is_error. The zero condition was mishandled
1346 before.
1347 (yyrecoverSyntaxError): Update for renames. No behavioral
1348 changes.
1349 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1350 New function.
1351 (yy_table_value_is_error_): New function.
1352 (parse): Use new functions where possible. No behavioral
1353 changes.
1354 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1355 The zero condition was mishandled before.
1356 * data/yacc.c (yyis_pact_ninf): Rename to...
1357 (yypact_value_is_default): ... this.
1358 (yyis_table_ninf): Rename to...
1359 (yytable_value_is_error): ... this, and check for value zero
1360 besides just YYTABLE_NINF.
1361 (yysyntax_error): Update for rename to yytable_value_is_error.
1362 The zero condition was mishandled before.
1363 (yyparse): Update for renames. No behavioral changes.
1364 * src/tables.h: Improve comments about yypact, yytable, etc.
1365 more. Most importantly, say yytable value of zero means syntax
1366 error not default action.
1367
53f036ce
JD
13682009-08-25 Joel E. Denny <jdenny@clemson.edu>
1369
1370 Fix %error-verbose for conflicts resolved by %nonassoc.
1371 * NEWS (2.5): Document.
1372 * data/glr.c (yyreportSyntaxError): Fix this by checking
1373 yyis_table_ninf.
1374 * data/yacc.c (yysyntax_error): Likewise.
1375 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1376 yytable_ninf_.
1377 * data/lalr1.java (yysyntax_error): Likewise.
1378 * tests/conflicts.at (%nonassoc and eof): Update expected output
1379 and remove FIXME.
1380
87412882
JD
13812009-08-25 Joel E. Denny <jdenny@clemson.edu>
1382
1383 Some code and documentation improvements.
1384 * data/c.m4 (b4_table_value_equals): New macro to capture
1385 some repeated code.
1386 * data/glr.c (yyis_pact_ninf): Use it here.
1387 (yyis_table_ninf): Likewise.
1388 (yyreportSyntaxError): Improve internal comments.
1389 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1390 Use it everywhere possible.
1391 (yyis_table_ninf): Likewise.
1392 (yysyntax_error): Improve internal comments.
1393 * data/lalr1.cc (yysyntax_error_): Likewise.
1394 * data/lalr1.java (yysyntax_error): Likewise.
1395 * src/tables.h: Improve comments about yypact, yytable, etc.
1396
e6c849d8
JD
13972009-08-21 Joel E. Denny <jdenny@clemson.edu>
1398
1399 Use locale when quoting.
1400 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1401 quote rather than implementing quoting here.
1402
d8911864
EB
14032009-08-20 Eric Blake <ebb9@byu.net>
1404
b0778bdd
EB
1405 Make previous patch more robust.
1406 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1407 argmatch.h.
1408 (output_skeleton): Use it.
1409 Suggested by Akim Demaille.
1410
d8911864
EB
1411 Import latest m4/m4.m4.
1412 * submodules/autoconf: Update to autoconf 2.64.
1413 * configure.ac (M4_GNU_OPTION): New define.
1414 * src/output.c (output_skeleton): Use it to resolve FIXME.
1415 * NEWS: Mention this.
1416
c2724603
JD
14172009-08-19 Joel E. Denny <jdenny@clemson.edu>
1418
1419 Fix complaints about escape sequences.
1420 Discussed starting at
1421 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1422 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1423 For a \0 and similar escape sequences meaning the null
1424 character, report an invalid escape sequence instead of an
1425 invalid null character because the latter does not actually
1426 appear in the user's input.
1427 In all escape sequence complaints, don't escape the initial
1428 backslash, and don't quote when the sequence appears at the end
1429 of the complaint line unless there's whitespace that quotearg
1430 won't escape.
1431 Consistently say "invalid" not "unrecognized".
1432 Consistently prefer "empty character literal" over "extra
1433 characters in character literal" warning for invalid escape
1434 sequences; that is, consistently discard those sequences.
1435 * tests/input.at (Bad escapes in literals): New.
1436
17aed602
AD
14372009-08-19 Akim Demaille <demaille@gostai.com>
1438
1439 doc: fixes.
1440 * doc/bison.texinfo: Fix minor Texinfo errors.
1441
9142239a
AD
14422009-08-19 Akim Demaille <demaille@gostai.com>
1443
1444 tests: distcc compliance.
1445 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
1446 error messages from the output.
1447
171ad99d
AD
14482009-08-19 Akim Demaille <demaille@gostai.com>
1449
1450 variables: simplify the upgrade of namespace into api.namespace.
1451
1452 This patch simplifies "variables: rename namespace as
1453 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
1454 Suggested by Joel E. Denny in
1455 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
1456
1457 * src/muscle-tab.c (muscle_percent_variable_update): New.
1458 (muscle_percent_define_insert): Use it in replacement of the
1459 previous tr invocation.
1460 Remove variable_tr, no longer needed.
1461 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1462 Remove.
1463 * data/c++.m4: No longer handle namespace -> api.namespace.
1464 * tests/input.at (%define backward compatibility): Check that
1465 namespace is treated as api.namespace.
1466
d59e456d
AD
14672009-08-19 Akim Demaille <demaille@gostai.com>
1468
1469 doc: %initial-action to initialize yylloc.
1470 Reported by Bill Allombert.
1471 * doc/bison.texinfo: Set fill-column to 76.
1472 (Location Type): Document the use of %initial-action to initialize
1473 yylloc.
1474
ceb8b8e6
AD
14752009-08-19 Akim Demaille <demaille@gostai.com>
1476
1477 lalr1.cc: use state_type.
1478 * data/lalr1.cc (yysyntax_error_): Use state_type.
1479 Move argument names into yy*.
1480
7580c379
AD
14812009-08-19 Akim Demaille <demaille@gostai.com>
1482
1483 lalr1.cc: get rid of yyparse's yystate.
1484 yystate and yystack_[0].state are equal, keep only the latter.
1485 The former was also used as a temporary variable to compute the
1486 post-reduction state. Move this computation into an auxiliary
1487 function.
1488
1489 * data/glr.c (yyLRgotoState): Fuse variable definition and first
1490 assignment.
1491 * data/lalr1.cc (yy_lr_goto_state_): New.
1492 (yyparse): Use it.
1493 Replace remaining uses of yystate by yystate_[0].state.
1494 Remove the former.
1495
c4dc4c46
AD
14962009-08-19 Akim Demaille <demaille@gostai.com>
1497
1498 lalr1.cc: destroy $$ when YYERROR is called.
1499 * data/lalr1.cc (yyreduce): Compute the resulting state before
1500 running the user action so that yylhs is a valid symbol.
1501 (yyerrorlab): Since yylhs is complete (it knows its type), we can
1502 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
1503 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
1504
c67e466f
JD
15052009-08-18 Joel E. Denny <jdenny@clemson.edu>
1506
1507 maint: update for gnulib's recent update-copyright changes
1508 * gnulib: Update.
1509 * .x-update-copyright (COPYING): Add as it's no longer implied
1510 when .x-update-copyright is present.
1511 * cfg.mk (update-copyright-local): Remove, now ignored.
1512 (update-copyright): Declare update-b4-copyright as a dependency.
1513
af6d2358
AD
15142009-08-17 Akim Demaille <demaille@gostai.com>
1515
1516 build: require gettext 0.17.
1517
1518 Suggested by Bruno Haible.
1519 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1520 * configure.ac: require gettext 0.17 to ensure compatibility with
1521 gnulib.
1522
91a2b9b1
AD
15232009-08-17 Akim Demaille <demaille@gostai.com>
1524
1525 build: lower gettext requirements.
1526
1527 Bison was uselessly requiring the formatstring macros from
1528 gettext, which resulted in mo files not being installed on systems
1529 that perfectly supported Bison mo files. Lower the requirement.
1530 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1531
b0778bdd
EB
1532 * configure.ac: Require need-ngettext instead of
1533 need-formatstring-macros.
1534 Reported by Martin Jabocs.
1535 Suggested by Bruno Haible.
1536 * INSTALL: Restructure.
1537 (Internationalization): New.
91a2b9b1 1538
585935e8
JD
15392009-08-14 Joel E. Denny <jdenny@clemson.edu>
1540
1541 maint: fix use of copyright year intervals.
1542 * gnulib: Update.
1543 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1544 as now recommended in gnulib/NEWS.
1545 * build-aux/update-b4-copyright: Fix.
1546 * cfg.mk (update-copyright-env): Configure update-copyright.
1547
83b60c97
JD
15482009-08-13 Joel E. Denny <jdenny@clemson.edu>
1549
1550 Make it easier to write deterministic tests.
1551 Continues Akim's work from his 2009-06-10 commits.
1552 * src/reader.c (check_and_convert_grammar): Don't add any
1553 symbols after the first symbols_do invocation.
1554 * src/symtab.c (symbols_sorted): New static global.
1555 (user_token_number_redeclaration): Update comments.
1556 (symbol_from_uniqstr): If a new symbol is being created, assert
1557 that symbols_sorted hasn't been allocated yet.
1558 (symbols_free): Free symbols_sorted.
1559 (symbols_cmp, symbols_cmp_qsort): New functions.
1560 (symbols_do): Sort symbol_table into symbols_sorted on first
1561 invocation.
1562 * tests/input.at (Numbered tokens): Recombine tests now that the
1563 output should be deterministic across multiple numbers.
1564
28169bab
AD
15652009-08-12 Akim Demaille <demaille@gostai.com>
1566
1567 tests: GCC 4.5 compliance.
1568 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
1569 messages about #error.
1570
9f14e187
AD
15712009-08-12 Akim Demaille <demaille@gostai.com>
1572
1573 build: fix the generation of the documentation.
1574 Some of our targets use "bison --help", but they can't depend on
1575 "bison" itself (to avoid additional requirements on the user), so
1576 they used to call "make src/bison" in the commands. Then
1577 concurrent builds may fail: one make might be aiming one of its
1578 jobs at compiling src/bison, and another job at generating the man
1579 page. If the latter is faster than the former, then we have two
1580 makes that concurrently try to compile src/bison.
1581
1582 This might also be a more convincing explanation for the failure
1583 described in the patch "build: fix paths".
1584
1585 * Makefile.am (SUFFIXES): Initialize.
1586 * build-aux/move-if-change: New, symlink to gnulib's.
1587 * build-aux/local.mk: Ship it.
1588 * doc/common.x: Remove, merged into...
1589 * doc/bison.x: here.
1590 * doc/local.mk (doc/bison.help): New.
1591 ($(CROSS_OPTIONS_TEXI)): Depend on it.
1592 Use src/bison.
1593 (.x.1): Replace with...
1594 (doc/bison.1): this explicit, simpler, target.
1595 (common_dep): Remove, inlined where appropriate.
1596 (SUFFIXES, PREPATH): Remove, unused.
1597
d1b55e81
AD
15982009-08-12 Akim Demaille <demaille@gostai.com>
1599
1600 gnulib: improve prefixing.
1601 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
1602 change the value of...
1603 (gl_LIBOBJS): this.
1604 Adjust more variables.
1605 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
1606 gl_LIBOBJS.
1607 (prefix): Also transform rules whose targets have slashes.
1608 Use $prefix liberally.
1609 Map @MKDIR_P@ to $(MKDIR_P).
1610 Prefix directories that are mkdir'd.
1611
838205d5
AD
16122009-08-12 Akim Demaille <demaille@gostai.com>
1613
1614 build: fix paths.
1615 When using $(top_builddir) inconsistently, Make (including GNU
1616 Make) is sometimes confused. As a result it may want to build
1617 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
1618 file, different names) concurrently, which, amusingly enough,
1619 might end with:
1620
1621 ranlib lib/libbison.a
1622 ranlib lib/libbison.a
1623 make[2]: *** [lib/libbison.a] Segmentation fault
1624
1625 on OS X.
1626
1627 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
1628 needed.
1629
67af7198
AD
16302009-08-12 Akim Demaille <demaille@gostai.com>
1631
1632 distcheck: fix.
1633
b0778bdd 1634 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
67af7198 1635
c467dc42
JD
16362009-08-10 Joel E. Denny <jdenny@clemson.edu>
1637
1638 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
1639
dfaa4860
JD
16402009-08-10 Joel E. Denny <jdenny@clemson.edu>
1641
1642 Miscellaneous code readability improvements.
1643
1644 * src/reader.c (reader): Move %define front-end variable
1645 defaults and checking into...
1646 (prepare_percent_define_front_end_variables): ... this new
1647 function.
1648
1649 * src/scan-gram.l (INITIAL): For consistency with string
1650 literals, don't store open quote on character literal. It's
1651 discarded before returning anyway.
1652 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1653 Make length test more readable, and make the character stored
1654 for an empty literal more obvious while consistent with the
1655 previous behavior.
1656
1657 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1658 USER_NUMBER_HAS_STRING_ALIAS throughout.
1659 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1660 that is repeated in symtab.h. Improve argument names to make it
1661 clear which side of the symbol-string alias pair is which.
1662 (symbol_check_alias_consistency): Improve local variable names
1663 for the same purpose.
1664 * src/symtab.h (struct symbol): Make comments about aliases
1665 clearer.
1666 (symbol_make_alias): Improve comments and argument name.
1667 * src/output.c (token_definitions_output): Update for rename to
1668 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1669
ce268795
AR
16702009-08-08 Alex Rozenman <rozenman@gmail.com>
1671
1672 Convert "misleading reference" messages to warnings.
1673 * src/scan-code.l: New function 'show_sub_messages', more
1674 factoring.
1675 * tests/named-ref.at: Adjust tests.
1676
401b73af
JD
16772009-08-06 Joel E. Denny <jdenny@clemson.edu>
1678
1679 maint: run "make update-copyright"
1680
a1a9422d
JD
16812009-08-06 Joel E. Denny <jdenny@clemson.edu>
1682
1683 maint: make update-b4-copyright easier to use
1684 * build-aux/update-b4-copyright: In warnings, report line
1685 numbers rather than character positions.
1686 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1687 that update-copyright runs it.
1688 * gnulib: Update.
1689
0b61a8ec
JD
16902009-08-05 Joel E. Denny <jdenny@clemson.edu>
1691
1692 maint: clean up update-b4-copyright code
1693 * build-aux/update-b4-copyright: Do not accept 2-digit
1694 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1695 Don't accept a `[' in a b4_copyright argument.
1696 Format code more consistently.
1697 Don't assume b4*copyright never occurs.
1698
269e222e
JD
16992009-08-04 Joel E. Denny <jdenny@clemson.edu>
1700
1701 maint: automate b4_copyright updates.
1702 * Makefile.am (update-b4-copyright): New target rule.
1703 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
1704 * build-aux/update-b4-copyright: New.
1705 * data/yacc.c: Remove stray characters around b4_copyright
1706 invocations.
1707
35905f2b
JD
17082009-08-04 Joel E. Denny <jdenny@clemson.edu>
1709
1710 maint: automate annual package-wide copyright-year update.
1711 * .x-update-copyright: New.
1712 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1713 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1714 update-copyright. Remove gnumakefile, which is implied by
1715 maintainer-makefile.
1716 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1717 * gnulib: Update.
1718 * maint.mk: Remove, now copied from gnulib.
1719 * examples/extexi: Add missing "(C)" in copyright statement so
1720 update-copyright can recognize it.
1721 * src/LR0.h: Likewise.
1722 * src/print.h: Likewise.
1723 * src/print_graph.h: Likewise.
1724 * src/gram.c: Add missing comma in copyright statement.
1725 * src/gram.h: Likewise.
1726
b30e18dc
JD
17272009-08-04 Joel E. Denny <jdenny@clemson.edu>
1728
1729 Fix "make distcheck".
1730 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1731 of just calc.stamp.
1732
8d90395d
JD
17332009-08-01 Joel E. Denny <jdenny@clemson.edu>
1734
1735 Pacify "gcc -Wunused" for the input function from Flex.
1736 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1737 and later.
1738 * src/scan-code.l: Add "%option noinput", which I cannot find in
1739 the Flex manual, but which Flex has supported since at least as
1740 far back as 2.5.4. However, if any of our developers still use
1741 Flex 2.5.4, they'll need to stop configuring with
1742 --enable-gcc-warnings because "%option noinput" didn't work
1743 correctly until Flex 2.5.6.
1744 * src/scan-gram.l: Likewise.
1745 * src/scan-skel.l: Likewise.
1746
ba4184ec
AR
17472009-07-31 Alex Rozenman <rozenman@gmail.com>
1748
1749 Fix --enable-gcc-warnings problems.
1750 * src/reader.c: Adjust variable names.
1751 * src/scan-code.l: Fix prototypes and adjust names.
1752 * src/named-ref.c: Remove redundant "if".
1753
91a2af97
JD
17542009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1755
1756 Fix a --enable-gcc-warnings problem.
1757 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1758 variable.
1759
3208e3f4
JD
17602009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1761
1762 Warn about character literals not of length one.
1763 * NEWS (2.5): Document.
1764 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1765 the length.
1766 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1767 * tests/input.at (Bad character literals): New test group.
1768
5add20ab 17692009-07-24 Alex Rozenman <rozenman@gmail.com>
13cdf208
AR
1770
1771 Fix some memory leaks.
1772 * src/named-ref.c: Add a pointer check (named_ref_free).
1773 * src/scan-code.l: New function (variant_table_free). Called in
1774 code_scanner_free.
1775 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1776
e459fb0e
JD
17772009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1778
1779 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1780
c4be5517
JD
17812009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1782
1783 Some M4 cleanup in the testsuite.
1784 Suggested by Eric Blake at
1785 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1786 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1787 complicate the code by distinguishing between a missing value
1788 and an empty string value for an optional argument. This fix is
1789 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1790 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1791 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1792 arguments are not needed because of the following changes.
1793 Fix stale comments.
1794 Bison developers should use GNU M4 and should not use
1795 POSIXLY_CORRECT when building the test suite, so do not
1796 complicate the code by avoiding $10 and above.
1797 Do not quote an empty string value for an optional argument, and
1798 do not distinguish between a missing value and an empty string
1799 value.
1800
feeb56cd
JD
18012009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1802
1803 Revert unnecessary column realignment in --help output.
1804 Reported by Akim Demaille at
1805 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1806 * src/getargs.c (usage): Here.
1807
5add20ab 18082009-07-04 Alex Rozenman <rozenman@gmail.com>
629e4def
AR
1809
1810 Alphabetical order in src/local.mk.
1811 * src/local.mk: Adjust.
1812
5add20ab 18132009-07-04 Alex Rozenman <rozenman@gmail.com>
872b52bc
AR
1814
1815 Style changes and factoring.
1816 * src/named-ref.h: Add comments.
1817 * src/parse-gram.y: Readability and style changes.
1818 * src/reader.c: Factoring: assign_named_ref function.
1819 * src/scan-code.l: Factoring and style changes. Rename
1820 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1821 Use "unsigned" type for variant index. Improve readablity.
1822 * src/scan-gram.l: Change error messages and add comments.
1823 * src/symlist.h: symbol_list_null: New function decl.
1824 * src/symlist.c: symbol_list_null: Implement here.
1825 * tests/named-refs.at: Adjust for new error messages.
1826
83ea2423
EB
18272009-06-29 Eric Blake <ebb9@byu.net>
1828
1829 scan-code: avoid compiler warnings
1830 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1831
5ece73ea
AD
18322009-06-29 Akim Demaille <demaille@gostai.com>
1833
1834 build: avoid concurrent extraction of calc++.
1835 * examples/calc++/Makefile.am (calc.stamp): New.
1836 Depend on it to create the sources of calc++ so that concurrent
1837 builds don't launch several "extexi" in parallel.
1838 Not only this is inefficient, this also builds incorrect sources
1839 with several extractions mixed together.
1840
ad597a78
AD
18412009-06-29 Akim Demaille <demaille@gostai.com>
1842
1843 parse.error: fix.
1844 * data/bison.m4: Move code related to specific variables after the
1845 definition of the variable-maintaining macros so that we don't
1846 "invoke" b4_percent_define_check_values before it is defined.
1847
31b850d2
AD
18482009-06-29 Akim Demaille <demaille@gostai.com>
1849
1850 variables: parse.error
1851
1852 Implement, document, and test the replacement of %error-verbose
1853 by %define parse.error "verbose".
1854 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
1855 values of the parse.error variable.
1856 Make "simple" its default value.
1857 Check the valid values.
1858 * src/parse-gram.y: Use %define parse.error.
1859 (PERCENT_ERROR_VERBOSE): New token.
1860 Support it.
1861 * src/scan-gram.l: Support %error-verbose.
1862
1863 * doc/bison.texinfo (Decl Summary): Replace the documentation of
1864 %define error-verbose by that of %define parse.error.
1865 * NEWS: Document it.
1866
1867 * tests/actions.at, tests/calc.at: Use parse.error instead of
1868 %error-verbose.
1869
b9f1d9a4
AR
18702009-06-27 Alex Rozenman <rozenman@gmail.com>
1871
1872 Implement support for named symbol references.
1873 * src/parse-gram.y: Add new syntax (named_ref.opt).
1874 * src/reader.c: Store named refs in symbol lists.
1875 * src/reader.h: New argument for symbol_append and
1876 action_append functions.
1877 * src/scan-code.h: Add new field (named_ref) into
1878 code_props data structure. Keeps named ref of midrule
1879 actions.
1880 * src/scan-code.l: Support for named refs in semantic
1881 action code. New function 'parse_named_ref'.
1882 * src/scan-gram.l: Support bracketed id.
1883 * src/symlist.c: Store named refs in symbol lists.
1884 * src/symlist.h: New field in symbol list: named_ref.
1885 * src/named-ref.h: New file, a struct for named_ref.
1886 * src/named-ref.cp: New file, named_ref_new function.
1887 * src/local.mk: Add two new files.
1888 * tests/testsuite.at: Include new test group:
1889 * tests/named-refs.at: this new file.
1890
b5c212b6
AD
18912009-06-25 Akim Demaille <demaille@gostai.com>
1892
1893 hash: check insertion for memory exhaustion.
1894 * src/uniqstr.c (uniqstr_new): New.
1895
67501061
AD
18962009-06-24 Akim Demaille <demaille@gostai.com>
1897
1898 variables: rename namespace as api.namespace.
1899 Discussed in
1900 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
1901
1902 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1903 New.
1904 (b4_percent_define_use): New.
1905 Use it where applicable.
1906 * data/c++.m4: Replace uses of the variable "namespace" by
1907 "api.namespace".
1908 Default the latter to the former.
1909 * doc/bison.texinfo (Decl Summary): Document "namespace" as
1910 obsolete.
1911 Document api.namespace.
1912 Use @samp to document %define uses, keep @code for identifiers.
1913 * NEWS: Likewise.
1914 * tests/c++.at, tests/input.at: Test api.namespace instead of
1915 namespace. (The tests passed with namespace.)
1916
41976786
AD
19172009-06-11 Akim Demaille <demaille@gostai.com>
1918
1919 style changes.
1920 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1921 * src/print-xml.c: Style changes.
1922 * tests/conflicts.at: Comment changes.
1923
44bb9084
AD
19242009-06-11 Akim Demaille <demaille@gostai.com>
1925
1926 xml: beware of user strings used to give a %prec to rules.
1927 * tests/conflicts.at (%prec with user strings): New.
1928 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1929 XML output.
1930
04d1e39d
AD
19312009-06-11 Akim Demaille <demaille@gostai.com>
1932
1933 hash: check insertion for memory exhaustion.
1934 * src/muscle-tab.c (muscle_insert, muscle_grow)
1935 * src/state.c (state_hash_insert): Check the return value of
1936 hash_insert.
1937
a8873669
AD
19382009-06-11 Akim Demaille <demaille@gostai.com>
1939
1940 tests: honor TESTSUITEFLAGS in every check target.
1941 * tests/local.mk (RUN_TESTSUITE): New.
1942 (check-local, installcheck-local, maintainer-check-g++)
1943 (maintainer-check-posix, maintainer-check-valgrind): Use it.
1944
8893145a
AD
19452009-06-10 Akim Demaille <demaille@gostai.com>
1946
1947 deterministic test suite.
1948 Some consistency checks on symbols are performed after all the
1949 symbols were read, by an iteration over the symbol table. This
1950 traversal is nondeterministic, which can be a problem for test
1951 cases.
1952 Avoid this.
1953 Addresses another form of nondeterminism reported by Joel E. Denny.
1954 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1955
1956 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1957 test in two.
1958 Use different file names for the three tests to make the
1959 maintenance easier.
1960
92d7a23a
AD
19612009-06-10 Akim Demaille <demaille@gostai.com>
1962
1963 gnulib: update.
b0778bdd
EB
1964 * gnulib: Update to latest.
1965 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1966 * m4/.gitignore: Regen.
1967 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1968 Call xalloc_die on hash_insert failures.
1969 Requested by the new __warn_unused_result__ attribute of
1970 hash_insert.
92d7a23a 1971
12cf133f
AD
19722009-06-10 Akim Demaille <demaille@gostai.com>
1973
1974 deterministic user-token-number redeclaration errors.
1975 Address nondeterminism reported by Joel E. Denny.
1976 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1977
1978 * src/uniqstr.h: Comment changes.
1979 * src/location.h (boundary_cmp, location_cmp): New.
1980 * src/symtab.c (user_token_number_redeclaration): New.
1981 (symbol_translation): Use it.
1982 * tests/input.at (Numbered tokens): Adjust the expected output.
1983
796a2b0a
AD
19842009-05-25 Akim Demaille <demaille@gostai.com>
1985
1986 build: avoid ignored errors.
1987 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
1988 errors, they pollute the output.
1989
0b6d43c5
JD
19902009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1991
1992 Convert multiple variable definition warnings to complaints.
1993 * NEWS (2.5): Add a new entry for that change.
1994 * doc/bison.texinfo (Decl Summary): Update %define entry.
1995 (Bison Options): Update -D/--define/-F/--force-define entry.
1996 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
1997 * src/muscle-tab.h (muscle_percent_define_insert): Update
1998 comments.
1999 * tests/input.at (`%define errors'): Update.
2000 (`%define, --define, --force-define'): Update.
2001
de5ab940
JD
20022009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2003
2004 -F/--force-define and relative %define/-D/--define priorities.
2005 * NEWS (2.5): Add documentation to -D/--define entry.
2006 * build-aux/cross-options.pl: Hard-code association of
2007 --force-define with %define.
2008 * doc/bison.texinfo (Decl Summary): In %define entry,
2009 cross-reference command-line options.
2010 (Bison Options): Add documentation to -D/--define entry.
2011 (Option Cross Key): Widen column for --force-define row.
2012 * src/getargs.c (usage): Document -F/--force-define. Realign
2013 options in output.
2014 (short_options, long_options, getargs): Parse -F/--force-define,
2015 and update muscle_percent_define_insert invocations.
2016 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
2017 (muscle_percent_define_insert): Add argument with that type.
2018 * src/muscle-tab.c (muscle_percent_define_insert): Implement
2019 -F/--force-define behavior and priorities.
2020 (muscle_percent_define_ensure): Update
2021 muscle_percent_define_insert invocation.
2022 * src/parse-gram.y (prologue_declaration): Update
2023 muscle_percent_define_insert invocations.
2024 * tests/input.at (`%define, --define'): Rename to...
2025 (`%define, --define, --force-define'): ... this and extend.
2026
f8e7258f
JD
20272009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2028
2029 Update some comments to make sense for -D.
2030 * data/bison.m4 (b4_check_user_names): In header comments, say
2031 "user occurrence" instead of "grammar occurrence".
2032 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
2033 (muscle_percent_code_grow): Likewise just for consistency.
2034
b987342b
JD
20352009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2036
2037 * data/c++.m4 (b4_namespace_close): Simplify slightly.
2038
4977e0a7
JD
20392009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
2040
2041 Handle a trailing `:' in a user-supplied C++ namespace better.
2042 * data/c++.m4 (b4_namespace_close): Don't let it be printed
2043 among the closing braces here. This fix might make the
2044 generated code easier to debug, but otherwise it should be
2045 insignificant because a trailing `:' is a C++ error already.
2046
9b04dad7
AD
20472009-05-19 Akim Demaille <demaille@gostai.com>
2048
2049 remove useless variable.
2050 * src/getargs.c (skeleton_arg): Remove now useless variable.
2051 Should help the compiler see that this printf-like call is sane.
2052
4c6622c2
AD
20532009-05-15 Akim Demaille <demaille@gostai.com>
2054
2055 Rename token.prefix as api.tokens.prefix.
2056 Discussed here.
2057 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
2058
2059 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
2060 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
2061 (token.prefix): Rename as...
2062 (api.tokens.prefix): this.
2063
3c248d70
AD
20642009-05-11 Akim Demaille <demaille@gostai.com>
2065
2066 doc: use C++ headers.
2067 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
2068 headers.
2069
99c08fb6
AD
20702009-05-11 Akim Demaille <demaille@gostai.com>
2071
2072 doc: token.prefix
2073 * doc/bison.simple (Decl Summary): Document token.prefix.
2074 (Calc++ Parser): Various fixes.
2075 Formatting changes.
2076 Use token.prefix.
2077 Introduce a macro TOKEN to shorten the code and make it more
2078 readable.
2079 (Calc++ Scanner): Adjust.
2080 * NEWS (Variable token.prefix): New.
2081
84a1cb5a
AD
20822009-05-04 Akim Demaille <demaille@gostai.com>
2083
2084 bison: catch bad symbol names.
2085 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
2086 * tests/input.at: Adjust.
2087
cdf3f113
AD
20882009-05-04 Akim Demaille <demaille@gostai.com>
2089
2090 identifiers: dashes are letters.
2091 Dashes can now start identifiers (symbols and directives).
84a1cb5a 2092
cdf3f113
AD
2093 * src/scan-gram.l ({letter}): Add dash.
2094 ({id}): Remove it.
2095 * tests/input.at (Symbols): Adjust.
2096 Remove stray comment.
2097 * tests/regression.at (Invalid inputs): Adjust error message.
2098 * doc/bison.texinfo (Symbols): Update.
2099
98a345a2
JD
21002009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
2101
2102 Declare %code to be a permanent feature.
2103 * NEWS (2.4.2): Here.
2104 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
2105 experimental.
2106 (Decl Summary): Likewise.
2107
67212941
JD
21082009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2109
2110 Convert underscores to dashes in some %define variable names.
2111 For now, just api.push-pull and lr.keep-unreachable-states.
2112 Maintain old names for backward compatibility.
2113 * NEWS (2.5): Document.
2114 * data/c.m4 (b4_identification): Update comment.
2115 * data/yacc.c: Update access.
2116 * doc/bison.texinfo: Update.
2117 * etc/bench.pl.in (bench_push_parser): Update use.
2118 * src/files.c (tr): Move to...
2119 * src/getargs.c, src/getargs.h (tr): ... here because I can't
2120 think of a better place to expose it. My logic is that, for all
2121 uses of tr so far, command-line arguments can be involved, and
2122 getargs.h is already included.
2123 * src/main.c (main): Update access.
2124 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
2125 variable names to new variable names before assigning value.
2126 * src/reader.c (reader): Update setting default.
2127 * tests/calc.at: Update uses.
2128 * tests/conflicts.at (Unreachable States After Conflict
2129 Resolution): Update use.
2130 * tests/input.at (%define enum variables): Update use.
2131 (%define backward compatibility): New test group.
2132 * tests/push.at: Update uses.
2133 * tests/reduce.at: Update uses.
2134 * tests/torture.at: Update uses.
2135
ba5c6d94
JD
21362009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2137
2138 Set all front-end %define defaults in one place.
2139 * src/main.c (main): Move lr.keep_unreachable_states default...
2140 * src/reader.c (reader): ... to here.
2141
5bab9d08
JD
21422009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2143
2144 Rename lr.default_reductions to lr.default-reductions.
2145 * NEWS (2.5): Here.
2146 * doc/bison.texinfo: Here.
2147 * src/lalr.c (initialize_LA): Here.
2148 * src/print.c (print_reductions): Here.
2149 * src/reader.c (reader): Here.
2150 * src/tables.c (action_row): Here.
2151 * tests/input.at (%define enum variables): Here.
2152 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
2153
d521ee19
JD
21542009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2155
2156 Pacify ./configure --enable-gcc-warnings.
2157 * tests/input.at (Symbols): Prototype yyerror and yylex.
2158
21592009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
2160
2161 Document how `%define "var" "value"' is not M4-friendly.
2162 * src/parse-gram.y (variable): In comments here.
2163
8f0d265e
JD
21642009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2165
2166 Clean up recent patches a little.
2167 Reported by Akim Demaille.
2168 * doc/bison.texinfo (Understanding): Fix typos.
2169 * src/print.c (print_reductions): Don't use negated variable.
2170
f4909773
JD
21712009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2172
2173 List accepted values for a %define enum variable with an invalid value.
2174 Suggested by Akim Demaille at
2175 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
2176 * data/bison.m4 (_b4_percent_define_check_values): Implement.
2177 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
2178 * tests/input.at (%define lr.default_reductions invalid values): Merge
2179 into...
2180 (%define enum variables): ... here, and update output.
2181
110ef36a
JD
21822009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
2183
2184 Rename "default rule" to "default reduction".
2185 This includes changing variable names in code, changing
2186 comments, and renaming %define lr.default_rules to %define
2187 lr.default_reductions.
2188 * NEWS (2.5): Update IELR documentation.
2189 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
2190 documentation.
2191 * data/glr.c, data/lalr1.java: Sync copyright dates.
2192 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
2193 and lr.type documentation. Make some other wording
2194 improvements.
2195 (Glossary): Adjust cross-references and Default Reduction
2196 definition.
2197 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
2198 Remove a confusing comment pointed out by Akim Demaille.
2199 (initialize_LA): Adjust code.
2200 * src/print-xml.c (print_reductions): Adjust code.
2201 * src/print.c (print_reductions): Adjust code.
2202 * src/reader.c (reader): Adjust code.
2203 * src/tables.c (action_row): Adjust code.
2204 (token_actions): Adjust code.
2205 * src/tables.h: Adjust YYDEFACT documentation.
2206 * tests/input.at (%define lr.default_rules invalid values):
2207 Rename test group to...
2208 (%define lr.default_reductions invalid values): ... this, and
2209 update grammar file and expected output.
2210 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
2211 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
2212
746ee38c
AD
22132009-04-21 Akim Demaille <demaille@gostai.com>
2214
2215 tests: check the use of dashes and periods in symbols.
2216 * tests/input.at (Symbol): New test group.
2217
eb45ef3b
JD
22182009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2219
2220 Document %define lr.type and lr.default_rules.
2221 * NEWS (2.5): Add an entry.
2222 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
2223 besides just LALR(1) and GLR(1).
2224 * doc/bison.texinfo (Introduction): Likewise.
2225 (Language and Grammar): Bison is no longer limited to LALR(1)
2226 restrictions.
2227 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
2228 when trying to distinguish from GLR. Talk about LR(1) grammars
2229 rather than LALR(1) grammars.
2230 (Decl Summary): In %define api.push_pull entry, say it applies
2231 to deterministic parsers in C rather than LALR(1) parsers in C.
2232 Add lr.default_rules entry.
2233 Add lr.type entry.
2234 (Mystery Conflicts): Bison is no longer limited to LALR(1)
2235 restrictions.
2236 (Generalized LR Parsing): Same changes as for the previous GLR
2237 section.
2238 (Memory Management): Say deterministic rather than LALR(1).
2239 (Understanding): Correct some bison output.
2240 Index discussion of "accepting state".
2241 Say deterministic rather than LALR(1).
2242 (Bison Options): In --yacc entry, say deterministic rather than
2243 LALR(1).
2244 In --report, --graph, and --xml entries, just don't mention
2245 LALR(1).
2246 (C++ Parsers): Say deterministic rather than LALR(1).
2247 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
2248 (Glossary): Add Accepting State, Consistent State, Default Rule,
2249 and IELR(1) definitions.
2250 In Generalized LR (GLR) definition, make same changes as in
2251 previous GLR sections.
2252 In LALR(1) definition, say Bison uses LALR(1) by default rather
2253 than implying Bison is limited to LALR(1).
2254 (LocalWords): Add IELR.
2255
db34f798
JD
22562009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2257
2258 Finish implementing %define lr.type.
2259 Its value can be "LALR", "IELR", or "canonical LR".
2260 * lib/timevar.def (TV_IELR_PHASE1): New var.
2261 (TV_IELR_PHASE2): New var.
2262 (TV_IELR_PHASE3): New var.
2263 (TV_IELR_PHASE4): New var.
2264 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
2265 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
2266 Sbitset.h, ielr.h, and ielr.c.
2267 * src/getargs.h, src/getargs.c (enum trace, trace_args,
2268 trace_types): Add trace_ielr.
2269 * src/lalr.h, src/lalr.c (ngotos): Export it.
2270 (F): Rename to...
2271 (goto_follows): ... this, update all uses, and export it.
2272 (set_goto_map): Export it.
2273 (map_goto): Export it.
2274 (compute_lookahead_tokens): Don't free goto_follows yet. Now
2275 handled in ielr.
2276 (initialize_LA): Export it. Move lookback allocation to...
2277 (lalr): ... here because, for canonical LR, initialize_LA must
2278 be invoked but lookback and much of the rest of LALR isn't
2279 needed.
2280 * main.c (main): Instead of lalr, invoke ielr, which invokes
2281 lalr.
2282 * src/reader.c (reader): Default lr.type to "LALR".
2283 Default lr.default_rules to "accepting" if lr.type is "canonical
2284 LR". Leave the default as "all" otherwise.
2285 Check for a valid lr.type value.
2286 * src/state.h, src/state.c (struct state_list): Add state_list
2287 member.
2288 (state_new): Initialize state_list member to NULL.
2289 (state_new_isocore): New function, exported.
2290 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
2291 exercises all values of lr.type.
2292 (GNU AWK Grammar): Rename test group to...
2293 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
2294 AT_TEST_EXISTING_GRAMMAR.
2295 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
2296 (GNU pic Grammar): Rename test group to...
2297 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
2298 AT_TEST_EXISTING_GRAMMAR.
2299 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
2300 all values of lr.type.
2301 (Single State Split): New test groups using AT_TEST_LR_TYPE.
2302 (Lane Split): Likewise.
2303 (Complex Lane Split): Likewise.
2304 (Split During Added Lookahead Propagation): Likewise.
2305
7fe11bb5
JD
23062009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2307
2308 Add new files for IELR and canonical LR implementation.
2309 * src/AnnotationList.c: New.
2310 * src/AnnotationList.h: New.
2311 * src/InadequacyList.c: New.
2312 * src/InadequacyList.h: New.
2313 * src/Sbitset.c: New.
2314 * src/Sbitset.h: New.
2315 * src/ielr.c: New.
2316 * src/ielr.h: New.
2317
7254f6a8
JD
23182009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2319
2320 Implement %define lr.default_rules.
2321 Its value describes the states that are permitted to contain
2322 default rules: "all", "consistent", or "accepting".
2323 * src/reader.c (reader): Default lr.default_rules to "all".
2324 Check for a valid lr.default_rules value.
2325 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
2326 is "accepting", then only mark the accepting state as
2327 consistent.
2328 (initialize_LA): Tell state_lookahead_tokens_count whether
2329 lr.default_rules is "accepting".
2330 * src/tables.c (action_row): If lr.default_rules is not "all",
2331 then disable default rules in inconsistent states.
2332 * src/print.c (print_reductions): Use this opportunity to
2333 perform some assertions about whether lr.default_rules was
2334 obeyed correctly.
2335 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
2336 helps with checking the parser tables for a grammar.
2337 * tests/input.at (%define lr.default_rules invalid values): New
2338 test group.
2339 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
2340 AT_TEST_TABLES_AND_PARSE.
2341 (`no %define lr.default_rules'): New test group generated by
2342 AT_TEST_LR_DEFAULT_RULES.
2343 (`%define lr.default_rules "all"'): Likewise.
2344 (`%define lr.default_rules "consistent"'): Likewise.
2345 (`%define lr.default_rules "accepting"'): Likewise.
2346
72e727f2
AD
23472009-04-20 Akim Demaille <demaille@gostai.com>
2348
2349 Formatting change.
2350
90462b8d
AD
23512009-04-20 Akim Demaille <demaille@gostai.com>
2352
2353 bison: factoring.
2354 * src/output.c (token_definitions_output): Use symbol_id_get
2355 instead of duplicating its logic.
2356 * TODO (YYERRCODE): Extend.
2357
4f646c37
AD
23582009-04-20 Akim Demaille <demaille@gostai.com>
2359
71b00ed8
AD
2360 variables: prefer error-verbose to error_verbose.
2361 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
2362 instead of error_verbose.
2363 * src/scan-gram.l (%error-verbose): Map to the error-verbose
2364 variable.
2365 * doc/bison.texinfo: Promote %define error-verbose instead of
2366 %error-verbose.
2367 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
2368
23692009-04-15 Akim Demaille <demaille@gostai.com>
2370
4f646c37
AD
2371 variables: accept dashes.
2372 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
2373 underscores.
2374 * src/scan-gram.l ({id}): Also accept dashes after the initial
2375 letter.
2376 ({directive}): Use {id}.
2377 * src/parse-gram.y: Comment and formatting changes.
2378 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
2379 symbols.
2380 * src/complain.h, src/complain.c (yacc_at): New.
2381 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
2382 symbol names.
2383 * src/output.c (token_definitions_output): Do not #define token
2384 names with dashes.
2385
184e3179
AD
23862009-04-20 Akim Demaille <demaille@gostai.com>
2387
2388 Consistently refer to Yacc, not YACC.
2389 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2390
41253c3a
JD
23912009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
2392
2393 Pacify make maintainer-check-posix.
2394 * tests/input.at (%define, --define): Move bison command-line
2395 options before grammar file name.
2396
197b82ba
JD
23972009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2398
2399 Document semicolon warnings.
2400 * NEWS (2.5): Here.
2401
0c90a1f5
AD
24022009-04-14 Akim Demaille <demaille@gostai.com>
2403
2404 variables: use `parse.assert' instead of `assert'.
2405 * TODO (assert): Remove.
2406 * data/bison.m4 (b4_assert_if): Replace with...
2407 (b4_parse_assert_if): this.
2408 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
2409 * doc/bison.texinfo (Decl Summary): Document parse.assert.
2410
fa819509
AD
24112009-04-14 Akim Demaille <demaille@gostai.com>
2412
16dc0d90 2413 variables: use `parse.trace' instead of `debug'.
fa819509
AD
2414 * src/getargs.c (getargs): Map -t to %define trace.parse.
2415 * src/scan-gram.l (%debug): Map to %define trace.parse.
2416 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
2417 names to `_' in macro names.
2418 (b4_debug_if): Replace with...
2419 (b4_parse_trace_if): this.
2420 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2421 * data/yacc.c: Adjust.
2422 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
2423 Use @code to label the variable list.
2424 Document the variable parse.trace.
2425 (Tracing): Promote the parse.trace variable.
2426 * TODO: %printer is not documented.
2427
f7dae1ea
AD
24282009-04-14 Akim Demaille <demaille@gostai.com>
2429
2430 doc: minor fixes.
2431 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2432 (Table of Symbols): Remove duplicate entry for %debug.
2433
3535c071
EB
24342009-04-10 Eric Blake <ebb9@byu.net>
2435
2436 submodules: update to latest
2437 * submodules/autoconf: Use latest upstream Autoconf.
2438
cf48f675
EB
24392009-04-06 Eric Blake <ebb9@byu.net>
2440
2441 Work around autoconf 2.63b bug in testsuite.
2442 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2443 autoconf bug related to # in test.
2444
50cca368
JD
24452009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2446
2447 * NEWS (2.5): New section. Describe new -D/--define feature.
2448
3583d96b
AD
24492009-04-06 Akim Demaille <demaille@gostai.com>
2450
2451 Regen.
2452 * src/parse-gram.h, src/parse-gram.c: Regen.
2453
00f5d575
AD
24542009-04-06 Akim Demaille <demaille@gostai.com>
2455
2456 rename muscle_tab.* as muscle-tab.* for consistency.
2457 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
2458 * src/muscle-tab.h, src/muscle-tab.c: these.
2459 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
2460 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
2461
76bf5102
AD
24622009-04-06 Akim Demaille <demaille@gostai.com>
2463
2464 Makefile: introduce $(BISON).
2465 * src/local.mk (BISON): New.
2466 (YACC): Use it.
2467
bc0f5737
AD
24682009-04-06 Akim Demaille <demaille@gostai.com>
2469
2470 parser: handle %locations as %define locations.
2471 * src/getargs.h, src/getargs.c (locations_flag): Remove.
2472 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
2473 to set "locations" to true.
2474 * src/output.c (prepare): Don't output "locations".
2475 * src/scan-gram.l (%locations): Handle it as a %<flag>.
2476 * src/parse-gram.y: It's no longer a token.
2477 Don't handle it.
2478 * data/bison.m4 (b4_locations_if): Define it with
2479 b4_percent_define_if_define.
2480 * data/c.m4, data/glr.cc: Adjust.
2481
697c912f
AD
24822009-04-06 Akim Demaille <demaille@gostai.com>
2483
2484 Regen.
2485 * src/parse-gram.c: Regen.
2486
4920ae8b
AD
24872009-04-06 Akim Demaille <demaille@gostai.com>
2488
2489 muscle: factor the handling of obsolete of obsolete directives.
2490 Suggested by Joel E. Denny.
50cca368 2491
4920ae8b
AD
2492 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
2493 New, extracted from...
2494 * src/parse-gram.y (prologue_declaration: pure-parser): here.
2495 Remove it.
2496 (prologue_declaration: "%<flag>"): Use
2497 muscle_percent_define_ensure.
2498 (%error-verbose, %pure-parser): No longer tokens.
2499 * src/scan-gram.l (pure-parser): Return as a %<flag>.
2500
1d5b3c08
JD
25012009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2502
2503 Fix options documentation.
2504 * build-aux/cross-options.pl: As in --help output, write optional
2505 arguments as [=ARG] not =[ARG].
2506 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2507
62c99cf4
JD
25082009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2509
2510 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2511 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2512 requirements for a correct m4 are stricter.
2513 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
2514 * configure.ac: Update to use AC_PROG_GNU_M4.
2515 Reported by Eric Blake.
2516
1c93f35b
JD
25172009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2518
2519 Help with updating web manual.
2520 * HACKING: Incorporate instructions from gnulib/doc/README.
2521 * bootstrap.conf (gnulib_modules): Add gendocs.
2522
86cfae0a
AD
25232009-04-03 Akim Demaille <demaille@gostai.com>
2524
2525 Regen.
2526 * src/parse-gram.h, src/parse-gram.c: Regen.
2527
ba061fa6
AD
25282009-04-03 Akim Demaille <demaille@gostai.com>
2529
2530 Factor %FLAG at scan level.
2531 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
2532 definitions and associated rules, replaced by....
2533 (PERCENT_FLAG): this new token type, and rule.
2534 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
2535 Use it for %debug and %error-verbose.
2536
b19ebeb3
AD
25372009-04-03 Akim Demaille <demaille@gostai.com>
2538
2539 Regen.
2540 * src/parse-gram.h, src/parse-gram.c: Regen.
2541
001a16a9
AD
25422009-04-03 Akim Demaille <demaille@gostai.com>
2543
2544 Treat %debug as %define debug.
2545 * data/bison.m4 (b4_debug_if): New.
2546 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
2547 * data/lalr1.java: Use it instead of b4_debug_flag.
2548 * src/getargs.h, src/getargs.c (debug_flag): Remove.
2549 * src/output.c (prepare): Don't output it.
2550 * src/parse-gram.y: Treat %debug as %define debug.
2551
25522009-04-03 Akim Demaille <demaille@gostai.com>
2553
2554 Treat %error-verbose as %define error_verbose.
2555 This allows to pass -Derror_verbose on the command line. Better
2556 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
2557 ERROR_VERBOSE being defined as false or true.
2558 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
2559 on b4_percent_define_ifdef, for does not check the defined value,
2560 but only whether the symbol is defined, rely on
2561 b4_percent_define_flag_if, so that a value of "false" is processed
2562 as a false.
2563 If not defined, define the flag to "false".
2564 (b4_error_verbose_if): New.
2565 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
2566 b4_error_verbose_flag.
2567 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
2568 * src/output.c (prepare): Don't output it.
2569 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
2570
92822aff
JD
25712009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2572
2573 Fix strange %define locations for default values.
2574 Reported by Akim Demaille at
2575 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2576 and discussed again starting at
2577 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2578 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2579 because location information is bogus.
2580 Use angle brackets to delimit fake file name because square brackets
2581 look like underexpanded m4. Choose a better fake file name.
2582 Use negative line numbers.
2583 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2584 * src/location.c (location_print): If line for a boundary is negative,
2585 only print that boundary's file name.
2586 * src/location.h: Document that.
2587 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2588 defaults): Update output.
2589
e021191b
JD
25902009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2591
2592 Pacify ./configure --enable-gcc-warnings.
2593 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
2594 in lib won't compile with it.
2595 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
2596
78f65418
AD
25972009-03-31 Akim Demaille <demaille@gostai.com>
2598
2599 bootstrap: --help to stdout.
2600 * bootstrap (usage): Don't send --help to stderr.
2601 Use a here doc instead of a long string.
2602
f7e241f4
AD
26032009-03-31 Akim Demaille <demaille@gostai.com>
2604
2605 bootstrap: README-hacking no longer exists
2606 * bootstrap (checkout_only_file): Set to HACKING.
2607
31d3e510
AD
26082009-03-26 Akim Demaille <demaille@gostai.com>
2609
2610 doc: merge HACKING and README-hacking.
2611 Two files is confusing.
2612 Reported by Alexandre Duret-Lutz.
1f9d8248 2613
31d3e510
AD
2614 * README-hacking: Merge into...
2615 * HACKING (Working from the repository): here.
2616
81535bfa
AD
26172009-03-26 Akim Demaille <demaille@gostai.com>
2618
2619 doc: update README-hacking.
2620 * README-hacking: We now use git and git submodules.
2621 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2622
56f772e9
AD
26232009-03-26 Akim Demaille <demaille@gostai.com>
2624
2625 lalr1.cc: avoid GCC 4.3 warnings.
2626 GCC 4.3 now warns about "a || b && c" and asks for explicit
2627 parentheses.
2628 Reported by Alexandre Duret-Lutz.
2629 * data/location.cc: Update copyright years.
2630 (Position::operator==): Use parens to make precedence explicit.
2631 Compare lines and columns first, as they are more likely to be
2632 different, and they are faster to compare.
2633
11c073b7
AD
26342009-03-26 Akim Demaille <demaille@gostai.com>
2635
2636 gnulib: update.
2637 * gnulib: Update to latest.
2638 * src/local.mk (AM_CFLAGS): Move to...
2639 * Makefile.am: here.
2640 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
2641 AM_CFLAGS.
2642
91be6b28
AD
26432009-03-02 Akim Demaille <demaille@gostai.com>
2644
2645 Comment changes.
2646
cbf25ce7
AD
26472009-03-02 Akim Demaille <demaille@gostai.com>
2648
2649 Share b4_yytranslate_define.
2650 * data/lalr1.cc (b4_yytranslate_define): Move to...
2651 * data/c++.m4: here.
2652
882f02ed
AD
26532009-03-02 Akim Demaille <demaille@gostai.com>
2654
2655 Use locations in the variant example.
1f9d8248
AD
2656 Yes, this obfuscates the point of this example, variants only.
2657 But glr.cc cannot work (yet?) without locations. This change
2658 makes it easier to use this example with glr.cc.
11c073b7 2659
882f02ed
AD
2660 * examples/variant.yy (assert): %define it.
2661 (locations): Request them.
2662 (yylex): Bind the location to the stage.
2663
0623bacc
AD
26642009-03-02 Akim Demaille <demaille@gostai.com>
2665
2666 Dub make_TOKEN as a public type interface.
2667 * data/c++.m4 (b4_symbol_constructor_declare)
2668 (b4_symbol_constructor_define): New empty stubs.
2669 (b4_public_types_declare, b4_public_types_define): Use them.
2670 * data/lalr1.cc (b4_symbol_constructor_declare)
2671 (b4_symbol_constructor_declare_)
2672 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
2673 Move to...
2674 * data/variant.hh: here.
2675 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
2676 needed.
2677 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
2678 b4_symbol_constructor_declare, as it is now done by
2679 b4_public_types_define and b4_public_types_declare.
2680
5f5a90df
AD
26812009-03-02 Akim Demaille <demaille@gostai.com>
2682
2683 Coding style changes.
2684 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2685 (b4_symbol_constructor_declarations)
2686 (b4_symbol_constructor_definition_)
2687 (b4_symbol_constructor_definitions)
2688 (b4_yytranslate_definition): Rename as...
2689 (b4_symbol_constructor_declare_)
2690 (b4_symbol_constructor_declare)
2691 (b4_symbol_constructor_define_)
2692 (b4_symbol_constructor_define)
2693 (b4_yytranslate_define): these.
2694 * data/variant.hh (b4_variant_definition): Rename as...
2695 (b4_variant_define): this.
2696
b47b6ff7
AD
26972009-03-02 Akim Demaille <demaille@gostai.com>
2698
2699 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
2700 * data/bison.m4 (b4_percent_define_if_define): New.
2701 * data/c++.m4 (b4_variant_if): Move to...
2702 * data/bison.m4: Here, using b4_percent_define_if_define.
2703 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
2704 * data/bison.m4: Here, using b4_percent_define_if_define.
2705
1d6b689b
AD
27062009-03-02 Akim Demaille <demaille@gostai.com>
2707
2708 Dub symbol_type_base as a public type.
2709 * data/c++.m4 (b4_public_types_declare): Now define
2710 symbol_type_base and symbol_type.
2711 (b4_public_types_define): New.
2712 In both cases, the definitions are taken verbatim from lalr1.cc.
2713 * data/lalr1.cc: Adjust.
2714
4f84717d
AD
27152009-03-02 Akim Demaille <demaille@gostai.com>
2716
2717 b4_public_types_declare.
2718 * data/c++.m4 (b4_public_types_declare): New.
2719 * data/glr.cc, data/lalr1.cc: Use it.
2720
b9e4eb5b
AD
27212009-03-02 Akim Demaille <demaille@gostai.com>
2722
2723 b4_semantic_type_declare.
2724 * data/c++.m4 (b4_semantic_type_declare): New.
2725 Factors and generalizes what was in glr.cc and lalr1.cc.
2726 * data/variant.hh (b4_semantic_type_declare): Redefine it for
2727 variants.
2728 * data/lalr1.cc, data/glr.cc: Use it.
2729
6a6e7f0c
AD
27302009-02-26 Akim Demaille <demaille@gostai.com>
2731
2732 Upgrade gnulib.
2733 * gnulib: Upgrade from master.
2734 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
2735 Regen.
2736
e9e61b00
AD
27372009-02-25 Akim Demaille <demaille@gostai.com>
2738
2739 Remove useless arguments.
2740 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
2741 relevant.
2742
3eead995
AD
27432009-02-25 Akim Demaille <demaille@gostai.com>
2744
2745 Comment changes.
2746 * data/lalr1.cc: here.
2747
87f28efe
AD
27482009-02-25 Akim Demaille <demaille@gostai.com>
2749
2750 Fix glr.cc's debug level handling.
2751 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
2752 glr.c which is used.
2753 (debug_level, set_debug_level): Adjust.
2754
9be2a009
AD
27552009-02-25 Akim Demaille <demaille@gostai.com>
2756
2757 Copyright years.
2758 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2759
07a6e87d
AD
27602009-02-25 Akim Demaille <demaille@gostai.com>
2761
2762 Style changes.
2763 * etc/bench.pl.in (generate_grammar_list): Consitently use
2764 location_type, not yy::location.
2765
33c78bd2
AD
27662009-02-25 Akim Demaille <demaille@gostai.com>
2767
2768 Comment change.
2769 * data/lalr1.cc: here.
2770
49572920
AD
27712009-02-19 Akim Demaille <demaille@gostai.com>
2772
2773 Make yyparser::error public.
2774 * data/lalr1.cc: here.
2775 There is no good reason to keep it private (and it is convenient
2776 to use it from the scanner for instance). It is already public in
2777 glr.cc.
2778
88654b47
AD
27792009-02-19 Akim Demaille <demaille@gostai.com>
2780
2781 Comment changes.
2782 * data/glr.cc: here.
2783
4524c55b
AD
27842009-02-19 Akim Demaille <demaille@gostai.com>
2785
2786 Remove trailing blanks.
6a6e7f0c
AD
2787 The epilogue has its own ending \n, no need to add another.
2788
4524c55b
AD
2789 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
2790 epilogue.
2791 * data/glr.cc: dnl when extending the epilogue.
2792 Remove stray "private:".
2793
6ceccee8
AD
27942009-02-19 Akim Demaille <demaille@gostai.com>
2795
2796 Use b4_c_modern.
2797 * data/c.m4 (b4_c_function_decl): Here.
2798
9c6a8966
AD
27992009-02-19 Akim Demaille <demaille@gostai.com>
2800
2801 Comment changes.
2802 * data/lalr1.cc: here.
2803
507aa0e2
AD
28042009-02-19 Akim Demaille <demaille@gostai.com>
2805
2806 Extract variant.hh
2807 * data/variant.hh: New, extracted from...
2808 * data/lalr1.cc: here.
2809 Adjust.
2810 * data/local.mk: Adjust.
2811
51bacae6
AD
28122009-02-19 Akim Demaille <demaille@gostai.com>
2813
2814 Extract stack.hh from lalr1.cc.
2815 * data/stack.hh: New.
2816 * data/lalr1.cc: Extract from here.
2817 * data/local.mk: Adjust.
2818
06c3084f
JD
28192009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2820
2821 Add reminder about uploading public key to keys.gnupg.net.
2822 * HACKING (Release Procedure): Here.
2823
0ea583d2
AD
28242009-01-28 Akim Demaille <demaille@gostai.com>
2825
2826 * NEWS: Update information about 2.4.1 and 2.4.2.
2827
402b123d
AD
28282008-11-04 Akim Demaille <demaille@gostai.com>
2829
2830 Reformat NEWS.
2831 * NEWS: Use more outline-mode markup.
2832 Suggested by Jim Meyering.
2833
74553c98
AD
28342009-01-08 Akim Demaille <demaille@gostai.com>
2835
2836 Fix grep portability issues.
2837 Grep on Solaris does not support -q.
2838 Reported by Summum Bonum.
2839
2840 * NEWS: Add a stub for 2.4.2.
2841 * THANKS: Add Summum Bonum.
2842 * tests/atlocal.in (EGREP): New.
2843 (CC, CXX, XSLTPROC): Make it possible to override them via
2844 envvars.
2845 * tests/java.at: Use $EGREP instead of egrep.
2846 Use AT_CHECK's ignore instead of grep's -q.
2847
84eedf86
AD
28482008-12-11 Akim Demaille <demaille@gostai.com>
2849
2850 Pass the token type to yysyntax_error.
2851 * data/yacc.c (yysyntax_error): Take the transated token instead
2852 of the raw number.
2853 Adjust callers.
2854 * TODO: Update.
2855
5860cc8c
AD
28562008-12-11 Akim Demaille <demaille@gostai.com>
2857
2858 Formatting changes.
2859 * data/glr.c: Formatting changes.
2860
2b008529
AD
28612008-12-11 Akim Demaille <demaille@gostai.com>
2862
2863 Propagate i18n changes into glr.c.
2864 * TODO: Update.
2865 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
2866 building the error message format dynamically.
2867 * data/lalr1.java: Formatting changes.
2868
2cd1af95
AD
28692008-12-11 Akim Demaille <demaille@gostai.com>
2870
2871 Use testsuite -C.
2872 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
2873 Solves problems when top_srcdir is an absolute path.
2874 Suggested by Eric Blake.
2875 * configure.ac: Require Autoconf 2.62.
2876
eeb29422
AD
28772008-12-11 Akim Demaille <demaille@gostai.com>
2878
2879 Simplify the i18n of the error messages.
2880 * data/lalr1.cc: Comment changes.
2881 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
2882 lalr1.cc instead of building dynamically the format string.
2883
6617622c
AD
28842008-12-08 Akim Demaille <demaille@gostai.com>
2885
2886 Fix portability issue in the test suite.
2887 * tests/local.at (AT_MATCHES_CHECK): New.
2888 Based on Perl instead of Sed. Sed has too many portability
2889 pitfalls, not ever Sed is GNU Sed.
2890 * tests/actions.at (Fix user actions without a trailing semicolon):
2891 Use it.
2892
2ca1136c
AD
28932008-12-08 Akim Demaille <demaille@gostai.com>
2894
2895 Update data/README.
2896 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2897
6c63b895
AD
28982008-12-08 Akim Demaille <demaille@gostai.com>
2899
2900 Install autoconf as a submodule to get m4sugar.
2901 * .gitmodules: Add submodules/autoconf.
2902 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2903 submodules/autoconf.
2904
417e31d2
AD
29052008-12-08 Akim Demaille <demaille@gostai.com>
2906
2907 Test token.prefix in all the skeletons.
2908 * data/java.m4 (b4_token_enum): Use the token.prefix.
2909 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
2910 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
2911 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
2912 * tests/java.at: Comment changes.
2913 (AT_CHECK_JAVA_MINIMAL): Define the END token.
2914 (Java parser class and package names): Add token.prefix check.
2915
97abf544
AD
29162008-12-08 Akim Demaille <demaille@gostai.com>
2917
2918 Fix regeneration of atconfig.
2919 * tests/local.mk (tests/atconfig): The rule was incorrect, but
2920 remove it: now that there is no tests/Makefile.am, the top-level
2921 Makefile properly updates atconfig when needed.
2922
e8cd1ad6
DJ
29232008-12-07 Di-an Jan <dianj@freeshell.org>
2924
2925 Implement the FIXME that ends an user action with a semicolon
2926 if it seems necessary.
2927 * src/scan-code.l (flex rules section): Flag cpp directive from
2928 any `#' to the first unescaped end-of-line. Semicolon is not
2929 needed after `;', `{', '}', or cpp directives and is needed after
2930 any other token (whitespaces and comments have no effect).
2931 * tests/actions.at (Fix user actions without a trailing semicolon):
2932 New test.
2933 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2934 to make user actions complete statements.
2935 Adjust column numbers in error messages.
2936 * tests/regression.at (Fix user actions without a trailing semicolon):
2937 Remove. Covered by new test.
2938
ce9447fc
AD
29392008-12-07 Akim Demaille <demaille@gostai.com>
2940
2941 Update gnulib.
2942 * gnulib: Update from master.
2943
d333175f
EB
29442008-12-05 Eric Blake <ebb9@byu.net>
2945
2946 Avoid compiler warning.
2947 * src/output.c (muscle_insert_item_number_table): Delete unused
2948 function.
2949
215b40ac
EB
29502008-12-02 Eric Blake <ebb9@byu.net>
2951
2952 Build testsuite with newer autoconf.
2953 * tests/output.at (m4_expand): Don't override in newer autoconf,
2954 where the underlying implementation changed.
2955 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2956 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2957 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2958 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2959 since some of them contain unbalanced ')'.
2960
3bb21113
AD
29612008-12-01 Akim Demaille <demaille@gostai.com>
2962
2963 Use b4_symbol for printers and destructors everywhere.
2964 * data/bison.m4 (b4_symbol_action_location): New.
2965 * data/c.m4 (b4_symbol_actions): Remove.
2966 Adjust all callers to use by b4_symbol_foreach and the corresponding
2967 b4_symbol_printer/destructor macro.
2968 * data/glr.cc: Adjust.
2969 * data/lalr1.java: Adjust the %destructor sanity check.
2970 * src/output.c (symbol_code_props_output): Remove, we no longer
2971 need the b4_symbol_printers/destructors tables.
2972
fb7c5b1f
AD
29732008-12-01 Akim Demaille <demaille@gostai.com>
2974
2975 Use b4_symbol_case_.
2976 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
2977 b4_symbol_case_.
2978
cf6fb222
AD
29792008-12-01 Akim Demaille <demaille@gostai.com>
2980
2981 Move b4_symbol based macro to bison.m4.
2982 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
2983 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
2984 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
2985 (b4_type_foreach): Move to...
2986 * data/bison.m4: Here.
2987 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
2988 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 2989
e3c52a63
AD
29902008-12-01 Akim Demaille <demaille@gostai.com>
2991
2992 b4_symbol/type_foreach.
2993 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
2994 Use them.
2995
2bde9113
AD
29962008-12-01 Akim Demaille <demaille@gostai.com>
2997
2998 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
2999 Instead of defining complex list of tuples to define various
3000 properties of the symbols, we now prefer to define symbols as
3001 "structs" in m4: using the symbol key (its number), and the
3002 property name, b4_symbol gives it value. Use this to handle
3003 destructors and printers.
3004
2bde9113
AD
3005 * src/output.c (CODE_PROP): New.
3006 (prepare_symbol_definitions): Use it to define the printer and
3007 destructor related attributes of the symbols.
3008 * data/lalr1.cc (b4_symbol_actions): Rename as...
3009 (b4_symbol_action): this.
3010 Use b4_symbol instead of 6 arguments.
3011 (b4_symbol_printer, b4_symbol_destructor): New.
3012 Use them instead of b4_symbol_actions.
3013
44494bf6
AD
30142008-12-01 Akim Demaille <demaille@gostai.com>
3015
3016 Avoid capturing variables too easily.
3017 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
3018 v__ and p__ instead of v and p.
3019
fad814bd
AD
30202008-12-01 Akim Demaille <demaille@gostai.com>
3021
3022 Remove spurious empty line before syncline.
3023 * data/bison.m4 (b4_syncline): Don't output an empty line before
3024 the output.
3025
feda5527
AD
30262008-11-26 Akim Demaille <demaille@gostai.com>
3027
3028 Convert lib/Makefile.am into lib/local.mk.
3029 The real problem is rather gnulib.mk, which itself is extracted
3030 from a Makefile.am that gnulib expects to the "recursive". The
3031 tool prefix-gnulib-mk converts such a gnulib.mk to be
3032 non-recursive. Also, some AC_SUBST variables need to be adjusted.
3033
3034 * etc/prefix-gnulib-mk: New.
3035 * bootstrap (slurp): Use it to convert further gnulib.mk.
3036 No longer try to avoid re-creation of lib/gnulib.mk as the changes
3037 are deeper.
3038 * lib/Makefile.am: Rename as...
3039 * lib/local.mk: this.
3040 Adjust to be prefixed.
3041 * Makefile.am, configure.ac: Adjust.
3042 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
3043
56ddee7f
AD
30442008-11-26 Akim Demaille <demaille@gostai.com>
3045
3046 s/_FLAGS/FLAGS/.
3047 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
3048 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
3049 Reported by Eric Blake.
3050
728e89a0
AD
30512008-11-26 Akim Demaille <demaille@gostai.com>
3052
3053 Use b4_parser_tables_define in glr.cc.
3054 * data/glr.c: Use b4_parser_tables_define instead of defining the
3055 (deterministic integral) tables by hand.
3056
2c1bf9bd
AD
30572008-11-26 Akim Demaille <demaille@gostai.com>
3058
3059 Use b4_parser_tables_define in Java.
3060 * data/java.m4 (b4_typed_parser_table): Rename as...
3061 (b4_typed_parser_table_define): this, for consistency.
3062 Accept a comment as $4.
3063 Move $2 into yy*_.
3064 (b4_integral_parser_table): Rename as...
3065 (b4_integral_parser_table_define): this.
3066 * data/lalr1.java: Adjust all uses.
3067 Use b4_parser_tables_define instead of generation by hand.
3068
ba206cf4
AD
30692008-11-26 Akim Demaille <demaille@gostai.com>
3070
3071 Prepare the convergence bw C style and Java table generation.
3072 * data/bison.m4 (b4_tables_map, b4_tables_declare)
3073 (b4_tables_define): Rename as...
3074 (b4_integral_parser_tables_map, b4_parser_tables_declare)
3075 (b4_parser_tables_define): these.
3076 * data/c.m4 (b4_table_define): Rename as...
3077 (b4_integral_parser_table_define): this.
3078 * data/lalr1.cc: Adjust.
3079 (b4_table_define, b4_table_declare): Rename as...
3080 (b4_integral_parser_table_define)
3081 (b4_integral_parser_table_declare): these.
3082 (yyrline_): Move the comment where it is actually used.
3083 * data/yacc.c: Adjust.
3084 (yyrline): Use b4_integral_parser_table_define.
3085
d12f8e49
AD
30862008-11-26 Akim Demaille <demaille@gostai.com>
3087
3088 Regen.
3089 * src/parse-gram.h, src/parse-gram.c: Regen.
3090
0991e29b
AD
30912008-11-26 Akim Demaille <demaille@gostai.com>
3092
3093 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
3094 * data/lalr1.cc (b4_tables_map): Move to...
3095 * data/bison.m4: here.
3096 Update the comment for yytable during the flight.
3097 (b4_tables_declare, b4_tables_define): New.
3098 * data/lalr1.cc: Use them.
3099 * data/c.m4 (b4_table_define): New.
3100 * data/yacc.c: Use b4_tables_define instead of output the tables
3101 by hand.
3102 * tests/regression.at (Web2c Actions): Adjust the expected output,
3103 the order of the tables changed.
3104
3d3bc1fe
AD
31052008-11-26 Akim Demaille <demaille@gostai.com>
3106
3107 Get rid of (yy)rhs and (yy)prhs.
3108 These tables are no longer needed in the parsers, and they don't seem to
3109 be useful. They are not documented either.
feda5527 3110
3d3bc1fe
AD
3111 * src/output.c (prepare_rules): Get rid of rhs and prhs.
3112 Adjust the computation of (yy)r2.
3113
08c81469
AD
31142008-11-26 Akim Demaille <demaille@gostai.com>
3115
3116 Rule length is unsigned.
3117 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
3118
932b0c96
AD
31192008-11-26 Akim Demaille <demaille@gostai.com>
3120
3121 Get rid of lalr1-split.cc.
3122 It was no longer maintainer.
feda5527 3123
932b0c96
AD
3124 * data/lalr1-split.cc: Remove.
3125 * etc/bench.pl.in (bench_fusion_parser): Remove.
3126 Adjust.
3127
8452c667
AD
31282008-11-26 Akim Demaille <demaille@gostai.com>
3129
3130 Use yy* consistently.
3131 * data/glr.c: Now that yyrhs no longer exists as a global
3132 variable, rename local "rhs" variables into "yyrhs" for
3133 consistency.
3134
783aa653
AD
31352008-11-25 Akim Demaille <demaille@gostai.com>
3136
3137 Get rid of yyrhs and yyprhs in glr.c.
3138 * data/glr.c (yyrhs, yyprhs): Remove.
3139 Instead, use the state stack and yystos.
3140
6130b755
AD
31412008-11-25 Akim Demaille <demaille@gostai.com>
3142
3143 Flag glr tests.
3144 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
3145 as an Autotest keyword.
3146
95a7b1c9
AD
31472008-11-25 Akim Demaille <demaille@gostai.com>
3148
3149 Prefer TESTSUITE_FLAGS.
3150 TESTSUITEFLAGS is barely readable.
feda5527 3151
95a7b1c9
AD
3152 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
3153 for backward compatibility.
3154 Use the former instead of the latter.
3155
b4f18401
AD
31562008-11-25 Akim Demaille <demaille@gostai.com>
3157
3158 Get rid of yyrhs and yyprhs in larl1.java.
3159 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
3160 (yy_reduce_print): Rather, use yystos_ and the state stack.
3161
c265fd6b
AD
31622008-11-25 Akim Demaille <demaille@gostai.com>
3163
3164 Formatting changes.
3165
68dbdee8
AD
31662008-11-25 Akim Demaille <demaille@gostai.com>
3167
3168 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
3169 They were used to get the symbol types, given a rule number, when
3170 displaying the top of the stack before a reduction. But the
3171 symbol type is available from the state stack. This has two be
3172 benefits: two tables less in the parser (making it smaller), and a
3173 more consistent use of the three stacks which will help to fuse
3174 them.
feda5527 3175
68dbdee8
AD
3176 * data/yacc.c (yyprhs, yyrhs): Remove.
3177 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
3178 (yy_reduce_print): Take yyssp as argument.
3179 Use it, together with yystos, to get the symbol type.
3180 * tests/regression.at (Web2c Report): Remove these tables from the
3181 expected output.
3182
6ab1adbe
AD
31832008-11-25 Akim Demaille <demaille@gostai.com>
3184
3185 b4_tables_map.
3186 The point is to factor the generation of the tables across skeletons.
3187 This is language dependant.
feda5527 3188
6ab1adbe
AD
3189 * data/c.m4 (b4_comment_): New.
3190 Should be usable to define how to generate tables independently of
3191 the language.
3192 (b4_c_comment): New.
3193 (b4_comment): Bounce to b4_c_comment.
3194 Now support $2 = [PREFIX] for indentation.
3195 * data/lalr1.cc (b4_table_declare): Don't output a comment if
3196 there is no comment.
3197 Indent it properly when there is one.
3198 Output the ending semicolon.
3199 (b4_table_define): Space changes.
3200 Output the ending semicolon.
3201 (b4_tables_map): New.
3202 Use it twice instead of declaring and defining the (integral)
3203 tables by hand.
3204
0fddb3d5
AD
32052008-11-25 Akim Demaille <demaille@gostai.com>
3206
3207 b4_table_declare.
3208 * data/lalr1.cc (b4_table_declare): New.
3209 Use it to declare the tables defined with b4_table_define.
3210 (b4_table_define): Declare a third arg to match b4_table_declare
3211 signature.
3212 Move all the comments around invocations of b4_table_define into
3213 the invocations itselves.
3214 Move things around to have the order for declarations and
3215 definitions.
3216
c4ddc0fb
AD
32172008-11-25 Akim Demaille <demaille@gostai.com>
3218
3219 Formatting changes.
3220 * data/lalr1.java: here.
3221
e0c653e7
AD
32222008-11-25 Akim Demaille <demaille@gostai.com>
3223
3224 b4_args is more general than only C++.
3225 * data/lalr1.cc (b4_args, _b4_args): Move to...
3226 * data/bison.m4: here.
3227
4182a0a1
DJ
32282008-11-21 Di-an Jan <dianj@freeshell.org>
3229
3230 Implement no-XXX arguments for --warnings, --report, --trace.
3231 * src/getargs.c (flags_argmatch): Handles no-XXX.
3232 Fix typo in doxygen comment.
3233
01466c3e
AD
32342008-11-21 Akim Demaille <demaille@gostai.com>
3235
3236 Display the changes in cross-options.texi.
3237 * build-aux/cross-options.pl ($sep): New, to separate items.
3238 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
3239 changes.
3240
a7c09cba
DJ
32412008-11-20 Di-an Jan <dianj@freeshell.org>
3242
3243 Improves options in the manual.
3244 * doc/bison.texinfo (-g, -x): Add space before argument.
3245 (Option Cross Key): Implement FIXME: listing directives also.
3246 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
3247 (Short Option): Special case -d. Put arguments inside @option.
feda5527 3248 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
3249 src/scan-gram.l (actual name passed as the first argument)
3250 with special case for %define.
3251 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
3252 to build-aux/cross-options.pl.
3253 * src/getargs.c (usage): Document limitations of cross-options.pl.
3254 * src/scan-gram.l: Likewise.
3255
6c88b51e
JD
32562008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3257
3258 Fix unexpanded macros in GLR defines file.
3259 Reported by Csaba Raduly at
3260 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
3261 * THANKS (Csaba Raduly): Add.
3262 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
3263 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
3264 lexer in a separate module that includes the defines file.
3265 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
3266 source.
3267 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
3268 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
3269 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
3270 (AT_DATA_SOURCE_PROLOGUE): New.
3271 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
3272 (AT_DATA_SOURCE): New.
3273 (AT_FULL_COMPILE): Extend to support an additional source file.
3274
1e034807
AD
32752008-11-18 Akim Demaille <demaille@gostai.com>
3276
3277 More TODO.
3278 * TODO: More short term issues.
3279
e3dda35c
AD
32802008-11-18 Akim Demaille <demaille@gostai.com>
3281
3282 Regen.
3283 * src/parse-gram.h, src/parse-gram.c: Regen.
3284
bd187d7b
AD
32852008-11-18 Akim Demaille <demaille@gostai.com>
3286
3287 Use b4_subtract where possible.
3288 * data/lalr1.cc (b4_subtract): Move to...
3289 * data/bison.m4: here.
3290 * data/glr.c (b4_rhs_data): Use it.
3291 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
3292
6085ab0d
AD
32932008-11-18 Akim Demaille <demaille@gostai.com>
3294
3295 Remove incorrect mode specification.
3296 * data/glr.cc: Don't pretend it's C code.
3297
9ce405ce
JD
32982008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3299
3300 Simplify last patch slightly.
3301 * src/getargs.c (getargs): Here.
3302
a8beef7e
JD
33032008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3304
3305 Fix last warning from --enable-gcc-warnings.
3306 * src/getargs.c (getargs): Don't assign const address to non-const
3307 pointer.
3308
d50eea6d
JD
33092008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3310
3311 Don't let maintainer-*-check targets force a version update.
3312 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
3313 handled.
3314
f5f419de
DJ
33152008-11-17 Di-an Jan <dianj@freeshell.org>
3316
3317 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
3318 Align menus. Adjust word wrapping. Use node names for menu names.
3319 (Examples): Don't abbreviate node names.
3320 (LocalWords): Remove abbreviations.
3321 (Copying): Make description a sentence.
d50eea6d 3322 (Java Action Features): Remove period to match the rest of menu.
f5f419de 3323
d73e55e0
DJ
33242008-11-17 Di-an Jan <dianj@freeshell.org>
3325
3326 Handles several --enable-gcc-warnings.
3327 * src/getargs.c (command_line_location): Set parameters to void.
3328 * src/output.c (symbol_type_name_cmp): Make static.
3329 (symbols_by_type_name): Set parameters to void.
3330 (symbol_definitions_output): Remove unused parameter. Rename as...
3331 (prepare_symbol_definitions): this.
3332 (muscles_output): Move symbol_definitions_output to...
3333 (output): here as prepare_symbol_definitions.
3334 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 3335 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 3336
68c989de
DJ
33372008-11-17 Di-an Jan <dianj@freeshell.org>
3338
3339 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
3340 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
3341
23ce6f4c
AD
33422008-11-16 Akim Demaille <demaille@gostai.com>
3343
3344 Add missing $(EXEEXT).
3345 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
3346 "src/bison$(EXEEXT)".
3347 Reported by Di-an Jan.
3348
dd704c35
AD
33492008-11-15 Akim Demaille <demaille@gostai.com>
3350
3351 * TODO: Update.
3352
dab244d5
AD
33532008-11-15 Akim Demaille <demaille@gostai.com>
3354
3355 Formatting changes.
3356 * tests/input.at: here.
3357
4b4da9fb
AD
33582008-11-15 Akim Demaille <demaille@gostai.com>
3359
3360 Remove duplicate header inclusion.
3361 * src/LR0.c: here.
3362
4ea3f53d
AD
33632008-11-15 Akim Demaille <demaille@gostai.com>
3364
3365 * src/parse-gram.h, src/parse-gram.c: Regen.
3366
cb823b6f
AD
33672008-11-15 Akim Demaille <demaille@gostai.com>
3368
3369 Support parametric types.
b06df3c2
AD
3370
3371 There are two issues to handle: first scanning nested angle
3372 bracket pairs to support types such as std::pair< std::string,
3373 std::list<std::string> > >.
3374
3375 Another issue is to address idiosyncracies of C++: do not glue two
3376 closing angle brackets together (otherwise it's operator>>), and
3377 avoid sticking blindly a TYPE to the opening <, as it can result
3378 in '<:' which is a digraph for '['.
3379
cb823b6f
AD
3380 * src/scan-gram.l (brace_level): Rename as...
3381 (nesting): this.
3382 (SC_TAG): New.
3383 Implement support for complex tags.
b06df3c2 3384 (tag): Accept
cb823b6f
AD
3385 , but not <.
3386 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
3387 (b4_symbol_variant): Leave space around types as parameters.
3388 * examples/variant.yy: Use nested template types and leading ::.
3389 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
3390 Rename as...
3391 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
3392 * tests/c++.at: Test parametric types.
3393
7b6e6753
AD
33942008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3395
3396 Test token.prefix.
3397 This is not sufficient, but we test at least that the make_SYMBOL
3398 interface is not affected by token.prefix. A more general test
3399 will be implemented when the support of token.prefix is generalized
3400 to more skeletons.
b06df3c2 3401
7b6e6753
AD
3402 * tests/c++.at: One more variant test, using token.prefix.
3403
dddec537
AD
34042008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3405
3406 Test the make_TOKEN interface.
3407 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
3408 Factor the common code in yylex.
3409 Use it to test "%define lex_symbol".
3410
7d3e21ba
AD
34112008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3412
3413 Formatting change.
3414
4fc55348
AD
34152008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3416
3417 Simplify code for variants bench marks.
3418 * etc/bench.pl.in (&generate_grammar_list): Define and use
3419 location_type.
3420 Factor the common code in yylex.
3421
070e6509
AD
34222008-11-15 Akim Demaille <demaille@gostai.com>
3423
3424 Better error message.
3425 * bootstrap (find_tool): Fix the error message.
3426
0078681b
AD
34272008-11-15 Akim Demaille <demaille@gostai.com>
3428
3429 Update variant.yy to newest interface.
3430 * examples/variant.yy: Define lex_symbol.
3431 Adjust.
3432
ff084799
AD
34332008-11-15 Akim Demaille <demaille@gostai.com>
3434
3435 Don't use locations in variant.yy.
3436 * examples/variant.yy: Adjust to not using locations.
3437
b0d79ec6
AD
34382008-11-15 Akim Demaille <demaille@gostai.com>
3439
3440 Comment changes.
3441 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
3442 comments for the license.
3443
d4977ce3
AD
34442008-11-15 Akim Demaille <demaille@gostai.com>
3445
3446 Remove tests/Makefile.am.
3447 * tests/Makefile.am: Rename as...
3448 * tests/local.mk: this.
3449 * Makefile.am, configure.ac: Adjust.
3450 * Makefile.am (DISTCLEANFILES): Define.
3451 (maintainer-check, maintainer-xml-check, maintainer-push-check):
3452 Remove, we no longer need to bounce to the real targets.
3453
87f1149a
AD
34542008-11-15 Akim Demaille <demaille@gostai.com>
3455
3456 Comment changes.
3457
36415906
AD
34582008-11-15 Akim Demaille <demaille@gostai.com>
3459
3460 djgpp/local.mk.
3461 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
3462 * djgpp/local.mk: this new file.
3463
e2c2f696
AD
34642008-11-15 Akim Demaille <demaille@gostai.com>
3465
3466 Remove doc/Makefile.am.
3467 * doc/Makefile.am: Rename as...
3468 * doc/local.mk: this.
3469 Adjust paths
3470 * Makefile.am, configure.ac: Adjust.
3471 * Makefile.am (MOSTLYCLEANFILES): New.
3472 * src/local.mk: Adjust.
3473
2ead32e6
AD
34742008-11-15 Akim Demaille <demaille@gostai.com>
3475
3476 Move sc_tight_scope into maint.mk.
b06df3c2
AD
3477 It does not work, and I don't know how it was supposed to work: it
3478 seems to be looking for sources in the build tree. I just moved
3479 it at a better place, fixing it is still required.
3480
2ead32e6
AD
3481 * src/local.mk (echo): Remove.
3482 (sc_tight_scope): Move to...
3483 * maint.mk: here.
3484
2df9ec37
AD
34852008-11-15 Akim Demaille <demaille@gostai.com>
3486
3487 Regen.
3488 * src/parse-gram.h, src/parse-gram.h: Regen.
3489
0305d25e
AD
34902008-11-15 Akim Demaille <demaille@gostai.com>
3491
3492 Remove src/Makefile.am.
3493 * src/Makefile.am: Rename as...
3494 * src/local.mk: this.
3495 Prefix all the paths with src/.
3496 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
3497 (AM_CPPFLAGS): Find find in builddir/src.
3498 (YACC): Move the flags into...
3499 (AM_YFLAGS): here.
3500 * maint.mk (sc_tight_scope): Disable.
3501 It used to bounce to the version in src/Makefile.am which is now
3502 part of this very Makefile.
3503 * Makefile.am, configure.ac: Adjust.
3504 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
3505 include "..." to find files "here": we are no longer in src/, so
3506 qualify the includes with src/.
3507 * doc/Makefile.am (PREPATH): No longer include the top_builddir
3508 prefix.
3509 (.x.1): Adjust to be able to create src/foo from the top level
3510 Makefile, instead of going bounce to src/Makefile the creation of
3511 foo.
3512
5277c0a3
AD
35132008-11-15 Akim Demaille <demaille@gostai.com>
3514
3515 Remove useless variable.
3516 * doc/Makefile.am (srcsrcdir): Remove.
3517
6a5aa0cd
AD
35182008-11-15 Akim Demaille <demaille@gostai.com>
3519
3520 Remove data/Makefile.am.
3521 * data/Makefile.am: Rename as...
3522 * data/local.mk: this.
3523 Adjust paths.
3524 * Makefile.am, configure.ac: Adjust.
3525
7cb794dc
AD
35262008-11-15 Akim Demaille <demaille@gostai.com>
3527
3528 Remove etc/Makefile.am.
3529 * etc/Makefile.am: Rename as...
3530 * etc/local.mk: this.
3531 Adjust.
3532 * Makefile.am, configure.ac: Adjust.
3533
cd409e3b
AD
35342008-11-15 Akim Demaille <demaille@gostai.com>
3535
3536 Remove examples/local.mk.
3537 examples/calc++/Makefile.am might be interesting to keep as is, since
3538 it is an example in itself.
2df9ec37 3539
cd409e3b
AD
3540 * examples/Makefile.am: Rename as...
3541 * examples/local.mk: this.
3542 Adjust.
3543 * Makefile.am, configure.ac: Adjust.
3544
9a1e4214
AD
35452008-11-15 Akim Demaille <demaille@gostai.com>
3546
3547 Remove build-aux/Makefile.am.
3548 Recursive Makefiles are really way too slow, let's get rid of some of
3549 them.
2df9ec37 3550
9a1e4214
AD
3551 * build-aux/Makefile.am: Rename as...
3552 * build-aux/local.mk: this.
3553 Adjust paths.
3554 * Makefile.am, configure.ac: Adjust.
3555
0634493c
AD
35562008-11-15 Akim Demaille <demaille@gostai.com>
3557
3558 Provide convenience constructors for locations and positions.
3559 * data/location.cc (position::position): Accept file, line and
3560 column as arguments with default values.
3561 Always qualify initial line and column literals as unsigned.
3562 (location::location): Provide convenience constructors.
3563
fe1b448a
AD
35642008-11-15 Akim Demaille <demaille@gostai.com>
3565
b06df3c2
AD
3566 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
3567 token type.
fe1b448a
AD
3568 Using template buys us nothing, and makes it uselessly complex to
3569 construct a symbol. Besides, it could not be generalized to other
3570 languages, while make_FOO would work in C/Java etc.
2df9ec37 3571
fe1b448a
AD
3572 * data/lalr1.cc (b4_symbol_): New.
3573 (b4_symbol): Use it.
3574 (b4_symbol_constructor_declaration_)
3575 (b4_symbol_constructor_definition_): Instead of generating
3576 specializations of an overloaded template function, just generate
3577 several functions whose names are forged from the token names
3578 without the token.prefix.
3579 (b4_symbol_constructor_declarations): Generate them for all the
3580 symbols, not just by class of symbol type, now that instead of
3581 specializing a function template by the token, we generate a
3582 function named after the token.
3583 (b4_symbol_constructor_specialization_)
3584 (b4_symbol_constructor_specializations): Remove.
3585 * etc/bench.pl.in: Adjust to this new API.
3586
5679f311
AD
35872008-11-13 Akim Demaille <demaille@gostai.com>
3588
3589 %define token.prefix.
b06df3c2
AD
3590 Provide a means to add a prefix to the name of the tokens as
3591 output in the generated files. Because of name clashes, it is
3592 good to have such a prefix such as TOK_ that protects from names
3593 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 3594
5679f311
AD
3595 * data/bison.m4 (token.prefix): Empty by default.
3596 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
3597 * data/lalr1.cc (b4_symbol): Ditto.
3598
3204049e
AD
35992008-11-13 Akim Demaille <demaille@gostai.com>
3600
3601 Compute at M4 time some of the subtractions.
90290ce5 3602 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
3603 (b4_rhs_data): Use it.
3604
202598d3
AD
36052008-11-13 Akim Demaille <demaille@gostai.com>
3606
3607 symbol::token.
b06df3c2 3608 This allows the user to get the type of a token returned by yylex.
2df9ec37 3609
202598d3
AD
3610 * data/lalr1.cc (symbol::token): New.
3611 (yytoknum_): Define when %define lex_symbol, independently of
3612 %debug.
3613 (yytoken_number_): Move into...
3614 (symbol::token): here, since that's the only use.
3615 The other one is YYPRINT which was not officially supported
3616 by lalr1.cc, and anyway it did not work since YYPRINT uses this
3617 array under a different name (yytoknum).
3618
fc2476c7
AD
36192008-11-13 Akim Demaille <demaille@gostai.com>
3620
3621 YYERRCODE.
3622 * TODO (YYERRCODE): Mention the case of $undef.
3623
865f1e9f
AD
36242008-11-13 Akim Demaille <demaille@gostai.com>
3625
3626 TODO: YYPRINT.
3627 * TODO (YYPRINT): New.
3628
cb0b136a
AD
36292008-11-13 Akim Demaille <demaille@gostai.com>
3630
3631 Comment changes.
3632 * data/lalr1.cc, data/yacc.c: Fix the description of the
3633 yytranslate and yytoknum tables.
3634
2c086d29
AD
36352008-11-13 Akim Demaille <demaille@gostai.com>
3636
3637 Define make_symbol in the header.
b06df3c2
AD
3638 To reach good performances these functions should be inlined (yet
3639 this is to measure precisely). To this end they must be available
3640 to the caller.
2df9ec37 3641
2c086d29
AD
3642 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
3643 location_type with the class name.
3644 Since will now be output in the header, declare "inline".
3645 No longer use b4_symbol_constructor_specializations, but
3646 b4_symbol_constructor_definitions in the header.
3647 Don't call it in the *.cc file.
3648
1c4af381
AD
36492008-11-13 Akim Demaille <demaille@gostai.com>
3650
3651 Define yytranslate in the header for lex_symbol.
3652 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
3653 into the header file when using %define lex_symbol.
3654 (yytranslate_): Declare inline.
3655
e51b0a82
AD
36562008-11-13 Akim Demaille <demaille@gostai.com>
3657
b06df3c2
AD
3658 Define the constructors of symbol_type in
3659 b4_symbol_constructor_definitions.
e51b0a82 3660 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
3661 forthcoming patch will move elsewhere. Hence the interest of
3662 putting them together.
2df9ec37 3663
b06df3c2
AD
3664 The stack_symbol_type does not need to be moved, it is used only
3665 by the parser.
2df9ec37 3666
e51b0a82
AD
3667 * data/lalr1.cc: Move symbol_type and symbol_base_type
3668 constructors into...
3669 (b4_symbol_constructor_definitions): here.
3670 Adjust.
3671
78835571
AD
36722008-11-13 Akim Demaille <demaille@gostai.com>
3673
3674 Make it easier to move the definition of yytranslate_.
3675 Forthcoming changes will make it possible to use yytranslate_
3676 from outside the parser implementation file.
2df9ec37 3677
78835571
AD
3678 * data/lalr1.cc (b4_yytranslate_definition): New.
3679 Use it.
3680
c1e6c88c
AD
36812008-11-13 Akim Demaille <demaille@gostai.com>
3682
3683 Remove useless class specification.
3684 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
3685 to refer to the class name to use a type defined by the class for
3686 arguments of member functions.
3687
4654b0c0
AD
36882008-11-13 Akim Demaille <demaille@gostai.com>
3689
3690 Finer input type for yytranslate.
3691 This patch is debatable: the tradition expects yylex to return an int
3692 which happens to correspond to token_number (which is an enum). This
3693 allows for instance to return characters (such as '*' etc.). But this
3694 goes against the stronger typing I am trying to have with the new
3695 lex interface which return a symbol_type. So in this case, feed
3696 yytranslate_ with a token_type.
2df9ec37 3697
4654b0c0
AD
3698 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
3699 expect a token_type.
3700
dd735e4e
AD
37012008-11-13 Akim Demaille <demaille@gostai.com>
3702
3703 Honor lex-params in %define lex_symbol mode.
3704 * data/lalr1.cc: Use b4_lex_param.
3705
6659366c
AD
37062008-11-13 Akim Demaille <demaille@gostai.com>
3707
3708 Simplify names.
3709 * src/output.c (symbol_definitions_output): Rename symbol
3710 attributes type_name and has_type_name as type and has_type.
3711 * data/lalr1.cc: Adjust uses.
3712
e9805e57
AD
37132008-11-13 Akim Demaille <demaille@gostai.com>
3714
3715 Use b4_type_names for the union type.
b06df3c2
AD
3716 The union used to compute the size of the variant used to iterate
3717 over the type of all the symbols, with a lot of redundancy. Now
3718 iterate over the lists of symbols having the same type-name.
2df9ec37 3719
e9805e57
AD
3720 * data/lalr1.cc (b4_char_sizeof_): New.
3721 (b4_char_sizeof): Use it.
3722 Adjust to be called with a list of numbers instead of a single
3723 number.
3724 Adjust its caller for new-line issues.
3725
aea10ef4
AD
37262008-11-13 Akim Demaille <demaille@gostai.com>
3727
3728 Define the "identifier" of a symbol.
b06df3c2
AD
3729 Symbols may have several string representations, for instance if
3730 they have an alias. What I call its "id" is a string that can be
3731 used as an identifier. May not exist.
2df9ec37 3732
b06df3c2
AD
3733 Currently the symbols which have the "tag_is_id" flag set are
3734 those that don't have an alias. Look harder for the id.
2df9ec37 3735
aea10ef4
AD
3736 * src/output.c (is_identifier): Move to...
3737 * src/symtab.c (is_identifier): here.
3738 * src/symtab.h, src/symtab.c (symbol_id_get): New.
3739 * src/output.c (symbol_definitions_output): Use it to define "id"
3740 and "has_id".
3741 Remove the definition of "tag_is_id".
3742 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
3743 "tag_is_id" were used to produce code.
3744 We still use "tag" for documentation.
3745
2ea7730c
AD
37462008-11-11 Akim Demaille <demaille@gostai.com>
3747
3748 Locations are no longer required by lalr1.cc.
3749 * data/lalr1.cc (_b4_args, b4_args): New.
3750 Adjust all uses of locations to make them optional.
3751 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
3752 (AT_CHECK_NAMESPACE): Check the use of locations.
3753 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
3754 without locations with lalr1.cc.
3755 Test these cases.
3756 * tests/output.at: Check lalr1.cc with and without location
3757 support.
3758 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
3759 Don't use locations.
3760
7ca2266a
AD
37612008-11-11 Akim Demaille <demaille@gostai.com>
3762
3763 AT_FULL_COMPILE.
3764 * tests/local.at (AT_FULL_COMPILE): New.
3765 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
3766
1a7a65f9
AD
37672008-11-11 Akim Demaille <demaille@gostai.com>
3768
3769 Support parens in calc++.
3770 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
3771 * examples/calc++/test (run): Check the expected output.
3772 Adjust callers.
3773 Check parens too.
3774
c944f7f2
AD
37752008-11-11 Akim Demaille <demaille@gostai.com>
3776
3777 Simplify lalr1.cc since %defines is mandatory.
3778 * data/lalr1.cc: Remove useless calls to b4_defines_if.
3779
dada3cd1
AD
37802008-11-11 Akim Demaille <demaille@gostai.com>
3781
3782 TODO: yyfmt.
3783 * TODO (yysyntax_error): New item.
3784
422c18f4
AD
37852008-11-11 Akim Demaille <demaille@gostai.com>
3786
3787 Prefer M4 to CPP.
3788 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
3789 YYERROR_VERBOSE.
3790
a0ffc175
AD
37912008-11-11 Akim Demaille <demaille@gostai.com>
3792
3793 Support i18n of the parse error messages.
3794 * TODO (lalr1.cc/I18n): Remove.
3795 * data/lalr1.cc (yysyntax_error_): Support the translation of the
3796 error messages, as done in yacc.c.
3797 Stay within the yy* pseudo namespace.
3798
00a8a083
AD
37992008-11-11 Akim Demaille <demaille@gostai.com>
3800
3801 More TODO.
3802 * TODO (single stack, yysyntax_error): New.
3803
09277875
AD
38042008-11-11 Akim Demaille <demaille@gostai.com>
3805
3806 Make it possible to return a symbol_type from yylex.
3807 * data/lalr1.cc (b4_lex_symbol_if): New.
3808 (parse): When lex_symbol is defined, expected yylex to return the
3809 complete lookahead.
3810 * etc/bench.pl.in (generate_grammar_list): Extend to support this
3811 yylex interface.
3812 (bench_variant_parser): Exercise it.
3813
64c1b92a
AD
38142008-11-11 Akim Demaille <demaille@gostai.com>
3815
3816 Remove useless bench case.
3817 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
3818 no longer used.
3819
2722aa42
AD
38202008-11-11 Akim Demaille <demaille@gostai.com>
3821
3822 Improve display of directives.
3823 * etc/bench.pl.in (parse_term): Don't add useless eol.
3824
918eb7c5
AD
38252008-11-11 Akim Demaille <demaille@gostai.com>
3826
3827 Use string_cast in the bench.
3828 * etc/bench.pl.in (generate_grammar_list): Define and use
3829 string_cast.
3830
39be9022
AD
38312008-11-11 Akim Demaille <demaille@gostai.com>
3832
3833 Replace yychar with a Boolean.
3834 * data/lalr1.cc (parse::yychar): Replace by...
3835 (parse::yyempty): this.
3836
a2e3fa77
AD
38372008-11-11 Akim Demaille <demaille@gostai.com>
3838
3839 Factor the tables.
3840 * TODO: New item.
3841
aba12ad1
AD
38422008-11-11 Akim Demaille <demaille@gostai.com>
3843
3844 Let yytranslate handle the eof case.
3845 * data/lalr1.cc (yytranslate_): Handle the EOF case.
3846 Adjust callers.
3847 No longer expect yychar to be equal to yyeof_, rather, test the
3848 lookahead's (translated) kind.
3849
27cb5b59
AD
38502008-11-11 Akim Demaille <demaille@gostai.com>
3851
3852 yychar cannot be empty in yyerrlab.
3853 * TODO (yychar == yyempty_): New.
3854 * data/lalr1.cc: Remove the handling of this case.
3855 This eases forthcoming changes related to yychar and yytranslate.
3856
fce629c0
AD
38572008-11-11 Akim Demaille <demaille@gostai.com>
3858
3859 Bench: syntactic sugar for %define/#define.
3860 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
3861 (&bench_push_parser, bench_variant_parser): Use this feature.
3862 (&eat): New.
3863 Use it.
3864
ce671960
AD
38652008-11-11 Akim Demaille <demaille@gostai.com>
3866
3867 Less memory pressure on the "list" bench.
3868 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
3869 the values, to limit memory pressure.
3870
2873fdf8
AD
38712008-11-11 Akim Demaille <demaille@gostai.com>
3872
3873 Introduce make_symbol.
b06df3c2
AD
3874 make_symbol provides a means to construct a full symbol (kind,
3875 value, location) in a single shot. It is meant to be a Symbol
3876 constructor, parameterized by the symbol kind so that overloading
3877 would prevent incorrect kind/value pairs. Unfortunately
3878 parameterized constructors do not work well in C++ (unless the
3879 parameter also appears as an argument, which is not acceptable),
3880 hence the use of a function instead of a constructor.
2df9ec37 3881
2873fdf8
AD
3882 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3883 (b4_symbol_constructor_declarations)
3884 (b4_symbol_constructor_specialization_)
3885 (b4_symbol_constructor_specializations)
3886 (b4_symbol_constructor_definition_)
3887 (b4_symbol_constructor_definitions): New.
3888 Use them where appropriate to generate declaration, declaration of
3889 the specializations, and implementations of the templated
3890 overloaded function "make_symbol".
3891 (variant::variant): Always define a default ctor.
3892 Also provide a copy ctor.
3893 (symbol_base_type, symbol_type): New ctor overloads for value-less
3894 symbols.
3895 (symbol_type): Now public, so that functions such as yylex can use
3896 it.
3897
8be046d7
AD
38982008-11-11 Akim Demaille <demaille@gostai.com>
3899
3900 Inform m4 whether a tag is a valid id.
3901 * src/output.c (is_identifier): New.
3902 (symbol_definitions_output): Use it to define tag_is_id.
3903 But maybe this should be done at m4 level?
3904
de62edee
AD
39052008-11-11 Akim Demaille <demaille@gostai.com>
3906
3907 Test 214 was failing: it greps with a pattern containing [ ]*
3908 which obviously meant to catch spaces and tabs, but contained only
3909 spaces. Tabulations in sources are a nuisance, so to simplify the
3910 matter, get rid of all the tabulations in the Java sources. The
3911 other skeletons will be treated equally later.
3912
3913 * data/java.m4, data/lalr1.java: Untabify.
3914 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
3915 tabulations are no longer generated.
3916
905f0697
PB
39172008-11-11 Paolo Bonzini <bonzini@gnu.org>
3918
3919 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3920 * configure.ac: Adjust usage.
3921 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3922 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3923 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3924
09ccae9b
DJ
39252008-11-10 Di-an Jan <dianj@freeshell.org>
3926
3927 Workaround Java's ``code too large'' problem for parser tables
3928 in most cases, by using one function per initialization.
3929 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
3930 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
3931 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
3932 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
3933 (yytname_): Use b4_typed_parser_table.
3934 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
3935 ``code too large'' error.
3936
1979121c
DJ
39372008-11-10 Di-an Jan <dianj@freeshell.org>
3938
3939 * NEWS: Document them.
de62edee 3940
1979121c
DJ
3941 General Java skeleton improvements.
3942 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
3943 using gcj < 4.3 in the testsuite, according to comments in
3944 gnulib/m4/javacomp.m4.
3945 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
3946 location_type, position_type): Remove extraneous brackets from
3947 b4_percent_define_default.
3948 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
3949 m4_define and m4_define_default.
3950 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
3951 which marks the end of user code with appropriate syncline, like all
3952 the other skeletons.
3953 (b4_user_post_prologue): Add. Don't silently drop.
3954 (yylex): Remove.
3955 (parse): Inline yylex.
3956 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
3957 (%{...%}): Fix typo of %code imports.
3958 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
3959
3960 Support annotations on parser class with %define annotations.
3961 * data/lalr1.java (annotations): Add to parser class modifier.
3962 * doc/bison.texinfo (Java Parser Interface): Document
3963 %define annotations.
3964 (Java Declarations Summary): Document %define annotations.
3965 * tests/java.at (Java parser class modifiers): Test annotations.
3966
3967 Do not generate code for %error-verbose unless requested.
3968 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
3969 Make private. Make conditional on %error-verbose.
3970 (getErrorVerbose, setErrorVerbose): New.
3971 (yytnamerr_): Make conditional on %error-verbose.
3972 (yysyntax_error): Make some code conditional on %error-verbose.
3973 * doc/bison.texinfo (Java Bison Interface): Remove the parts
3974 about %error-verbose having no effect.
3975 (getErrorVerbose, setErrorVerbose): Document.
3976
3977 Move constants for token names to Lexer interface.
3978 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
3979 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
3980 (parse): Qualify EOF to Lexer.EOF.
3981 * doc/bison.texinfo (Java Parser Interface): Move documentation of
3982 EOF and token names to Java Lexer Interface.
3983 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
3984
3985 Make yyerror public.
3986 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
3987 (yyerror): Change to public. Add Javadoc comments. Use longer
3988 parameter names. Make the body rather than the declarator
3989 conditional on %locations.
3990 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
3991
3992 Allow user to add code to the constructor with %code init.
3993 * data/java.m4 (b4_init_throws): New, for %define init_throws.
3994 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
3995 Add %code init to the front of the constructor body.
3996 * doc/bison.texinfo (YYParser.YYParser): Document %code init
3997 and %define init_throws.
3998 (Java Declarations Summary): Document %code init and
3999 %define init_throws.
4000 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
4001 (Java constructor init and init_throws): Add tests.
de62edee 4002
42f832d6
AD
40032008-11-10 Akim Demaille <demaille@gostai.com>
4004
4005 Update TODO.
4006 * TODO (-D): is implemented.
4007 (associativity): Same precedence must have the same associativity.
4008 For instance, how can a * b / c be parsed if * is %left and / is
4009 %right?
4010 (YYERRORCODE, YYFAIL, YYBACKUP): New.
4011
247efe34
AD
40122008-11-10 Akim Demaille <demaille@gostai.com>
4013
4014 Formatting changes.
4015
5d731440
AD
40162008-11-10 Akim Demaille <demaille@gostai.com>
4017
4018 More information about the symbols.
4019 * src/output.c (type_names_output): Document all the symbols,
4020 including those that don't have a type-name.
4021 (symbol_definitions_output): Define "is_token" and
4022 "has_type_name".
4023 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
4024 type-name, now that they are defined too in b4_type_names.
4025
21db118b
AD
40262008-11-10 Akim Demaille <demaille@gostai.com>
4027
4028 Regen.
4029
6ed15cde
AD
40302008-11-10 Akim Demaille <demaille@gostai.com>
4031
4032 Make parser::yytranslate static.
b06df3c2
AD
4033 Small speedup (1%) on the list grammar. And makes yytranslate_
4034 available in non member functions.
de62edee 4035
6ed15cde
AD
4036 * data/lalr1.cc (yytranslate_): Does not need to be a instance
4037 function.
4038
30bb2edc
AD
40392008-11-10 Akim Demaille <demaille@gostai.com>
4040
4041 Avoid trailing spaces.
4042 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
4043 * data/lalr1.cc: Don't indent before rule and symbol actions, as
4044 they can be empty, and anyway this incorrectly indents the first
4045 action.
4046
b3a28fd4
AD
40472008-11-10 Akim Demaille <demaille@gostai.com>
4048
4049 Comment changes.
4050
914202bd
AD
40512008-11-10 Akim Demaille <demaille@gostai.com>
4052
4053 Use "enum" for integral constants.
4054 This is just nicer to read, I observed no speedup.
de62edee 4055
914202bd
AD
4056 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
4057 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
4058 (yyuser_token_number_max_, yyundef_token_): Move into...
4059 (yytranslate_): here.
4060
c17f9a4a
AD
40612008-11-10 Akim Demaille <demaille@gostai.com>
4062
4063 Shortcuts in bench directives.
4064 * etc/bench.pl.in (parse_dirs): New.
4065 Use it.
4066 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
4067 Create the benches in "benches/".
4068
b9855ea5
AD
40692008-11-10 Akim Demaille <demaille@gostai.com>
4070
4071 Formatting changes.
4072 * data/lalr1.cc: here.
4073
6e097787
AD
40742008-11-10 Akim Demaille <demaille@gostai.com>
4075
4076 Adjust verbose message to using emacs.
4077 * etc/bench.pl.in: Inform compilation-mode when we change the
4078 directory.
4079 (generate_grammar_list): Recognize %define "variant" in addition
4080 to %define variant.
4081
4c3cc7da
AD
40822008-11-10 Akim Demaille <demaille@gostai.com>
4083
4084 Classify symbols by type-name.
4085 * src/uniqstr.h (UNIQSTR_CMP): New.
4086 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
4087 (type_names_output): New.
4088 (muscles_output): Use it.
4089 * data/lalr1.cc (b4_symbol_action_): Remove.
4090 (b4_symbol_case_, b4_type_action_): New.
4091 Adjust uses of b4_symbol_action_ to use b4_type_action_.
4092
d69c9694
AD
40932008-11-10 Akim Demaille <demaille@gostai.com>
4094
4095 Change the handling of the symbols in the skeletons.
4096 Before we were using tables which lines were the symbols and which
4097 columns were things like number, tag, type-name etc. It is was
4098 difficult to extend: each time a column was added, all the numbers had
4099 to be updated (you asked for colon $2, not for "tag"). Also, it was
4100 hard to filter these tables when only a subset of the symbols (say the
4101 tokens, or the nterms, or the tokens that have and external number
4102 *and* a type-name) was of interest.
de62edee 4103
d69c9694
AD
4104 Now instead of monolithic tables, we define one macro per cell. For
4105 instance "b4_symbol(0, tag)" is a macro name which contents is
4106 self-decriptive. The macro "b4_symbol" provides easier access to
4107 these cells.
de62edee 4108
d69c9694
AD
4109 * src/output.c (type_names_output): Remove.
4110 (symbol_numbers_output, symbol_definitions_output): New.
4111 (muscles_output): Call them.
4112 (prepare_symbols): Define b4_symbols_number.
4113
5263bea9
AD
41142008-11-10 Akim Demaille <demaille@gostai.com>
4115
4116 --trace=muscles
4117 * src/getargs.h, src/getargs.c (trace_muscle): New.
4118 (trace_types, trace_args): Support it.
4119 * src/output.c (output_skeleton): Use it.
4120
4175f6bb
AD
41212008-11-10 Akim Demaille <demaille@gostai.com>
4122
4123 muscles_output.
4124 * src/output.c (muscles_output): New, extracted from...
4125 (output_skeleton): here.
4126 Adjust.
4127
1de69d6a
AD
41282008-11-10 Akim Demaille <demaille@gostai.com>
4129
4130 Formatting changes.
4131
36db78a7
AD
41322008-11-10 Akim Demaille <demaille@gostai.com>
4133
4134 Update the variant example.
4135 * examples/variant.yy: Formatting changes.
4136 One stage build.
4137
e5eb92e7
AD
41382008-11-10 Akim Demaille <demaille@gostai.com>
4139
4140 Support constructor with an argument.
4141 This improves the "list" bench by 2%.
de62edee 4142
e5eb92e7
AD
4143 * data/lalr1.cc (variant::build): Add an overloaded version with
4144 an argument.
4145 * tests/c++.at (AT_CHECK_VARIANT): Check it.
4146
76307410
AD
41472008-11-10 Akim Demaille <demaille@gostai.com>
4148
4149 Test variants.
4150 * tests/c++.at (AT_CHECK_VARIANTS): New.
4151 Use it with and without %define assert.
4152
d78f0ac9
AD
41532008-11-10 Akim Demaille <demaille@gostai.com>
4154
4155 Add %precedence support.
4156 Unfortunately it is not possible to reuse the %prec directive. This
4157 is because to please POSIX, we do not require to end the rules with a
4158 semicolon. As a result,
de62edee 4159
d78f0ac9 4160 foo: bar %prec baz
de62edee 4161
d78f0ac9
AD
4162 is ambiguous: either a rule which precedence is that of baz, or a rule,
4163 and then a declaration of the precedence of the token baz.
de62edee 4164
d78f0ac9
AD
4165 * doc/bison.texinfo: Document %precedence.
4166 (Precedence Only): New.
4167 * src/assoc.h, src/assoc.c (precedence_assoc): New.
4168 * src/conflicts.c (resolve_sr_conflict): Support it.
4169 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
4170 Parse it.
4171 * tests/calc.at: Use %precedence for NEG.
4172 * tests/conflicts.at (%precedence does not suffice)
4173 (%precedence suffices): New tests.
4174
c85be41a
AD
41752008-11-09 Akim Demaille <demaille@gostai.com>
4176
4177 Make benches in a sub dirs.
4178 * etc/bench.pl.in ($dir): New.
4179 Use it.
4180 Check the use of constructors with an argument.
4181 (bench_variant_parser): Fix.
4182
db65ca1f
AD
41832008-11-09 Akim Demaille <demaille@gostai.com>
4184
4185 fix eof condition
4186
9b0efa5b
AD
41872008-11-09 Akim Demaille <demaille@gostai.com>
4188
4189 Fix --help.
4190
432ac57a
AD
41912008-11-09 Akim Demaille <demaille@gostai.com>
4192
4193 Require the generation of parse-gram.output.
4194 * src/Makefile.am (YACC): Pass --report=all.
4195
deef2a0a
AD
41962008-11-09 Akim Demaille <demaille@gostai.com>
4197
4198 Formatting changes.
4199
df72984a
AD
42002008-11-09 Akim Demaille <demaille@gostai.com>
4201
4202 Update TODO.
4203 * TODO: Remove obsolete items.
4204 Update others.
4205
f10e19fd
AD
42062008-11-09 Akim Demaille <demaille@gostai.com>
4207
4208 Enhance bench.pl.
4209 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
4210 (@token, $grammar, $bench): New.
4211 (generate_grammar_variant): Rename as...
4212 (generate_grammar_list): this.
4213 (generate_grammar): Adjust.
4214 (bench_grammar): Rename as...
4215 (bench): this.
4216 Use it in the various bench-marking routines.
4217 (-b, -g): New options.
4218
5de9c593
AD
42192008-11-09 Akim Demaille <demaille@gostai.com>
4220
4221 Use a static hierarchy for symbols in the C++ parser.
4222 * data/lalr1.cc (symbol_base_type, symbol_type)
4223 (stack_symbol_type): Make it a static hierarchy.
4224 Adjust dependencies.
4225
757f8f98
AD
42262008-11-09 Akim Demaille <demaille@gostai.com>
4227
4228 bench.pl -d, --directive.
4229 * etc/bench.pl.in (@directive): New.
4230 (&bench_grammar): Use it.
4231 (&bench_list_grammar): New, to provide access to the "variant"
4232 grammar.
4233 Use it.
4234 (getopts): Support -d, --directive.
4235
d3be4f6d
AD
42362008-11-09 Akim Demaille <demaille@gostai.com>
4237
4238 Use inline for small operations.
4239 * data/lalr1.cc (symbol_base_type, symbol_type)
4240 (stack_symbol_type): Declare constructor and other operations as
4241 inline.
4242 (yy_destroy_): Inline.
4243
1f7d007b
AD
42442008-11-09 Akim Demaille <demaille@gostai.com>
4245
4246 Introduce a hierarchy for symbols.
4247 * data/lalr1.cc (symbol_base_type, symbol_type): New.
4248 (data_type): Rename as...
4249 (stack_symbol_type): this.
4250 Derive from symbol_base_type.
4251 (yy_symbol_value_print_): Merge into...
4252 (yy_symbol_print_): this.
4253 Rename as...
4254 (yy_print_): this.
4255 (yydestruct_): Rename as...
4256 (yy_destroy_): this.
4257 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
4258 (parser::parse): yyla is now of symbol_type.
4259 Use its type member instead of yytoken.
4260
bc0b0477
AD
42612008-11-09 Akim Demaille <demaille@gostai.com>
4262
4263 Rename data_type and stack_symbol_type.
4264 * data/lalr1.cc (data_type): Rename as...
4265 (stack_symbol_type): this.
4266
57295d14
AD
42672008-11-09 Akim Demaille <demaille@gostai.com>
4268
4269 Handle semantic value and location together.
4270 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
4271 yydata.value and yydata.location.
4272 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
4273 (YY_SYMBOL_PRINT): Now take semantic value and location as a
4274 single arg.
4275 Adjust all callers.
4276 (yydestruct_): New overload for a stack symbol.
4277
e9b0834e
AD
42782008-11-09 Akim Demaille <demaille@gostai.com>
4279
4280 Push a complete symbol, not connected parts.
4281 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
4282 state, value and location.
4283 Adjust callers.
4284
6082531a
AD
42852008-11-09 Akim Demaille <demaille@gostai.com>
4286
4287 Agregate yylval and yylloc.
4288 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
4289 (parser::yyla): this.
4290
33c195cc
AD
42912008-11-09 Akim Demaille <demaille@gostai.com>
4292
4293 Rely on the state stack to display reduction traces.
b06df3c2
AD
4294 To display rhs symbols before a reduction, we used information
4295 about the rule reduced, which required the tables yyrhs and
4296 yyprhs. Now use rely only on the state stack to get the same
4297 information.
de62edee 4298
33c195cc
AD
4299 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
4300 Use them.
4301 (parser::yyrhs_, parser::yyprhs_): Remove.
4302 (parser::yy_reduce_print_): Use the state stack.
4303
e1f93869
AD
43042008-11-09 Akim Demaille <demaille@gostai.com>
4305
4306 Fuse yyval and yyloc into yylhs.
4307 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
4308 yylhs.
4309 (parse): Replace yyval and yyloc with yylhs.value and
4310 yylhs.location.
4311 After a user action, compute yylhs.state earlier.
4312 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
4313 fresh error_token.
4314
2935744b
DJ
43152008-11-09 Di-an Jan <dianj@freeshell.org>
4316
4317 Remove unused variable.
4318 * src/output.c (type_names_output): Remove unused variable sep.
4319
bbf9ca37
PB
43202008-11-09 Paolo Bonzini <bonzini@gnu.org>
4321
4322 Change tests/output.at quoting.
4323 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
4324 expanding arguments.
4325
d9a9b96b
JD
43262008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4327
4328 Don't add a semicolon to actions for %skeleton or %language.
4329 It breaks Java test cases as reported by Akim Demaille.
4330 * src/scan-code.l: Implement.
4331
51365192
JD
43322008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4333
4334 Clean up %skeleton and %language priority implementation.
4335 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
4336 remove static qualifier because others will soon need to see it.
4337 (language_prio): Likewise.
4338 (getargs): Use command_line_prio rather than 0.
4339 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
4340 enum fields.
4341 (skeleton_prio): Extern it.
4342 (language_prio): Extern it.
4343 * src/parse-gram.y: Use grammar_prio rather than 1.
4344
9380cfd0
AD
43452008-11-07 Akim Demaille <demaille@gostai.com>
4346
4347 Moving push traces into yypush_.
4348 * data/lalr1.cc (yypush_): Now takes a optional trace message.
4349 Adjust all uses.
4350
8901f32e
AD
43512008-11-07 Akim Demaille <demaille@gostai.com>
4352
4353 The single-stack C++ parser is now the standard one.
4354 * data/lalr1.cc: Rename as...
4355 * data/lalr1-split.cc: this.
4356 * data/lalr1-fusion.cc: Rename as...
4357 * data/lalr1.cc: this.
4358 * etc/bench.pl.in: Adjust.
4359
8cdabf02
AD
43602008-11-07 Akim Demaille <demaille@gostai.com>
4361
4362 Avoid empty-if warnings.
4363 Reported by Quentin Hocquet.
de62edee 4364
8cdabf02
AD
4365 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
4366 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
4367
5a893c2b
AD
43682008-11-07 Akim Demaille <demaille@gostai.com>
4369
4370 Pass command line location to skeleton_arg and language_argmatch.
4371 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
4372 The location argument is now mandatory.
4373 Adjust all dependencies.
4374 (getargs): Use command_line_location.
4375
58697c6d
AD
43762008-11-07 Akim Demaille <demaille@gostai.com>
4377
4378 -D, --define.
4379 * src/getargs.c (usage): Document -D.
4380 Fix help string for --locations.
4381 (command_line_location): New.
4382 (short_options, long_options, getargs): Support -D, --define.
4383 (getargs): Move -d support at the right place.
4384 * doc/bison.texinfo (Bison Options): Update.
4385 * tests/input.at (%define, --define): New.
4386
9fe5a457
AD
43872008-11-07 Akim Demaille <demaille@gostai.com>
4388
4389 Initialize the muscle table before parsing the command line.
4390 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
4391 (getargs): Define file_name.
4392 * src/main.c (main): Initialize muscle_tab before calling
4393 getargs.
4394 * src/muscle_tab.c (muscle_init): No longer define file_name, as
4395 its value is not available yet.
4396
56c5eca9
AD
43972008-11-07 Akim Demaille <demaille@gostai.com>
4398
4399 Locations without columns for command line arguments.
4400 * src/location.c (location_print): Don't display negative columns.
4401 * src/location.h: Document this.
4402
9b9e0a7d
AD
44032008-11-07 Akim Demaille <demaille@gostai.com>
4404
4405 Fix --help.
4406 * src/getargs.c (usage): Fix help string for -W.
4407
74eae918
AD
44082008-11-07 Akim Demaille <demaille@gostai.com>
4409
4410 Handle more general types of option arguments.
4411 * build-aux/cross-options.pl: The argument ends at the first
4412 space, not the first non-symbol character.
4413 Use @var for each word appearing the argument description.
4414
a3d4c6fb
AD
44152008-11-07 Akim Demaille <demaille@gostai.com>
4416
4417 Destroy the variants that remain on the stack in case of error.
4418 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
4419 destructor.
4420 Display the value only if yymsg is nonnull.
4421 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
4422
2d32fc9f
AD
44232008-11-07 Akim Demaille <demaille@gostai.com>
4424
4425 Add "%define assert" to variants.
4426 This is used to help the user catch cases where some value gets
4427 ovewritten by a new one. This should not happen, as this will
4428 probably leak.
de62edee 4429
2d32fc9f
AD
4430 Unfortunately this uncovered a bug in the C++ parser itself: the
4431 lookahead value was not destroyed between two calls to yylex. For
4432 instance if the previous lookahead was a std::string, and then an int,
4433 then the value of the std::string was correctly taken (i.e., the
4434 lookahead was now an empty string), but std::string structure itself
4435 was not reclaimed.
de62edee 4436
2d32fc9f
AD
4437 This is now done in variant::build(other&) (which is used to take the
4438 value of the lookahead): other is not only stolen from its value, it
4439 is also destroyed. This incurs a new performance penalty of a few
4440 percent, and union becomes faster again.
de62edee 4441
2d32fc9f
AD
4442 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
4443 (b4_variant_if): New.
4444 (variant::built): New.
4445 Use it whereever the status of the variant changes.
4446 * etc/bench.pl.in: Check the penalty of %define assert.
4447
f6038cb8
AD
44482008-11-07 Akim Demaille <demaille@gostai.com>
4449
4450 Use "%define variant" in bench.pl.
4451 * etc/bench.pl.in: No longer use the pseudo directive %variants,
4452 just use %define variants.
4453
ccde1f98
AD
44542008-11-07 Akim Demaille <demaille@gostai.com>
4455
4456 Regen.
4457 * src/parse-gram.h, src/parse-gram.c: Regen.
4458
58bd33b7
JD
44592008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
4460
4461 Fix user actions without a trailing semicolon.
4462 Reported by Sergei Steshenko at
4463 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
4464 * THANKS (Sergei Steshenko): Add.
4465 * src/scan-code.l (SC_RULE_ACTION): Fix it.
4466 * tests/regression.at (Fix user actions without a trailing semicolon):
4467 New test case.
4468
639867b5
AD
44692008-11-04 Akim Demaille <demaille@gostai.com>
4470
4471 Use b4_copyright_years.
4472 * data/yacc.c (b4_copyright_years): New.
4473 Fix its value according to the comments in the file.
4474 Use it and undefine it.
4475
3c262606
AD
44762008-11-04 Akim Demaille <demaille@gostai.com>
4477
4478 Formatting changes.
4479 * data/lalr1-fusion.cc, src/parse-gram.y: here.
4480
a2b93d52
AD
44812008-11-04 Akim Demaille <demaille@gostai.com>
4482
4483 Formatting changes.
4484 * data/lalr1-fusion.cc: here.
4485
3a2803df
AD
44862008-11-04 Akim Demaille <demaille@gostai.com>
4487
4488 Use strict on bench.pl.
4489 * etc/bench.pl.in (&run, &generate_grammar): New.
4490 Rename the grammar generating functions for consistency.
4491 Change the interface so that the list of benches to run is passed
4492 as (optionless) arguments.
4493 (&compile): Use &run.
4494
a0d4650a
AD
44952008-11-04 Akim Demaille <demaille@gostai.com>
4496
4497 Remove spurious initial empty lines.
4498 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
4499 * data/yacc.c: End the @output lines with an @.
4500
cac9e09b
AD
45012008-11-04 Akim Demaille <demaille@gostai.com>
4502
4503 Improve the display of sizes.
4504 * etc/bench.p.in: Higher precision.
4505 Sort by decreasing size.
4506
4af4348a
AD
45072008-11-04 Akim Demaille <demaille@gostai.com>
4508
4509 Don't memcpy C++ structures.
4510 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
4511 arguments.
4512 (variant::build): New overload for
4513 copy-construction-that-destroys.
4514 (variant::swap): New.
4515 (parser::yypush_): Use it in variant mode.
4516
ef05c4d6
AD
45172008-11-04 Akim Demaille <demaille@gostai.com>
4518
4519 Better defaults for bench.pl.
4520 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
4521 default values.
4522 Adjust &verbose uses.
4523 (-q, --quiet): New.
4524
9718cfa9
AD
45252008-11-04 Akim Demaille <demaille@gostai.com>
4526
4527 Make variant.yy more complex.
4528 std::list cannot be copied via memcpy, they are more demanding than
4529 std::string. Use one std::list to strengthen the test.
de62edee 4530
9718cfa9
AD
4531 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
4532 Adjust.
4533 Create a list of strings, instead of a single large string.
4534
a6df593d
AD
45352008-11-04 Akim Demaille <demaille@gostai.com>
4536
4537 bench.pl --bench.
4538 * etc/bench.pl.in (--bench, $bench): New.
4539
006a0303
AD
45402008-11-04 Akim Demaille <demaille@gostai.com>
4541
4542 Sort methods.
4543 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
4544 Define it after as().
4545
faef3466
AD
45462008-11-04 Akim Demaille <demaille@gostai.com>
4547
4548 Useless parens.
4549 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
4550
2141aded
AD
45512008-11-04 Akim Demaille <demaille@gostai.com>
4552
4553 Issue missing synclines after user actions.
4554 * data/c.m4 (b4_case): Issue synclines on the output file.
4555
e426d17b
AD
45562008-11-04 Akim Demaille <demaille@gostai.com>
4557
4558 Remove trailing empty line.
4559 * data/lalr1-fusion.cc: Don't add an empty line after the user's
4560 epilogue.
4561
a9ce3f54
AD
45622008-11-04 Akim Demaille <demaille@gostai.com>
4563
4564 Fix output of copyright years.
4565 * data/bison.m4 (b4_copyright): Fix the indentation of the
4566 copyright year paragraph.
4567 Use b4_copyright_years when no years are given.
4568 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
4569 (b4_copyright_years): New.
4570 Use it.
4571
59c544c2
AD
45722008-11-04 Akim Demaille <demaille@gostai.com>
4573
4574 Avoid the spurious initial empty line.
4575 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
4576 the end of @output request to suppress the empty line that
4577 results.
4578
96b15448
AD
45792008-11-04 Akim Demaille <demaille@gostai.com>
4580
4581 Remove parser::rhs_number_type.
4582 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
4583 (yyrhs_): Use b4_table_define.
4584
f0633174
AD
45852008-11-04 Akim Demaille <demaille@gostai.com>
4586
4587 Fix iteration type.
4588 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
4589
417b8004
AD
45902008-11-04 Akim Demaille <demaille@gostai.com>
4591
4592 Factor the declaration of the integer tables.
4593 * data/lalr1-fusion.cc (b4_table_define): New.
4594 Use it.
4595
1a5246c6
AD
45962008-11-03 Akim Demaille <demaille@gostai.com>
4597
4598 Fix indentation of tables in lalr1.cc
4599 * data/lalr1-fusion.cc: Fix the indentation.
4600
f8a95c9c
AD
46012008-11-03 Akim Demaille <demaille@gostai.com>
4602
4603 Destroy the lhs symbols after reduction.
4604 * data/lalr1-fusion.cc (parse): After the user action, when in
4605 variant mode, destroy the lhs symbols.
4606
d7f4d823
AD
46072008-11-03 Akim Demaille <demaille@gostai.com>
4608
4609 Simplify yysyntax_error_ use.
4610 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
4611 type, but make it unnamed in the declaration when it is not used.
4612
8b9c89fb
AD
46132008-11-03 Akim Demaille <demaille@gostai.com>
4614
4615 Let yy::variant::build return an lvalue.
4616 * data/lalr1-fusion.cc (variant::build): Return a reference to the
4617 object.
4618
83243c24
AD
46192008-11-03 Akim Demaille <demaille@gostai.com>
4620
4621 Define yy::variant only when needed.
4622 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
4623 used.
4624
429b4848
AD
46252008-11-03 Akim Demaille <demaille@gostai.com>
4626
4627 Bench the three-stack lalr1.cc.
4628 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
4629 one-stack one.
4630
414c76a4
AD
46312008-11-03 Akim Demaille <demaille@gostai.com>
4632
4633 Fail on parse error in calc++.
4634 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
4635 status.
4636 * examples/calc++/test ($me, $number, $exit, run): New.
4637 Use them to propagate errors to the exit status.
4638
8a5783fd
AD
46392008-11-03 Akim Demaille <demaille@gostai.com>
4640
4641 Don't specify the skeleton twice in the example.
4642 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
4643 file does what is needed.
4644
0cc5bead
AD
46452008-11-03 Akim Demaille <demaille@gostai.com>
4646
4647 bench: Improve output.
4648 * etc/bench.pl.in (bench_grammar): Tune the printf format.
4649
5b421a4e
AD
46502008-11-03 Akim Demaille <demaille@gostai.com>
4651
4652 bench: check impact of %debug on variants.
4653 * etc/bench.pl.in (variant_grammar): Fix the computation of
4654 $variant.
4655 Generate a grammar file that can work with or without %debug.
4656 Do use the @directive.
4657 (bench_variant_parser): Check impact of %debug.
4658 (@directives): Rename all the occurrences to...
4659 (@directive): this, for consistency.
4660
d11ee647
AD
46612008-11-03 Akim Demaille <demaille@gostai.com>
4662
4663 bench: report the size too.
4664 * etc/bench.pl.in ($iterations): Defaults to -3.
4665 (&bench_grammar): Require hireswallclock.
4666 Compute and display the size of the result.
4667 More comments.
4668
e1b74b92
AD
46692008-11-03 Akim Demaille <demaille@gostai.com>
4670
4671 bench: More use of the verbosity level.
4672 * etc/bench.pl.in ($verbose, &verbose): New.
4673 Use them.
4674 More POD documentation.
4675
7e5f9c54
AD
46762008-11-03 Akim Demaille <demaille@gostai.com>
4677
4678 bench.pl: a command line interface
4679 * etc/bench.pl.in: More doc.
4680 Some fixes in the documentation.
4681 ($cflags, $iterations, &help, &getopt): New.
4682 Use them.
4683 (&variant_grammar): Let the number of stages be 10 times what is
4684 specified.
4685
7109a18d
AD
46862008-11-03 Akim Demaille <demaille@gostai.com>
4687
4688 Bench the use of Boost.Variants.
4689 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
4690 New.
4691 (&compile): Be ready to compile C++ parsers.
4692 (&bench_push_parser): Move debug information to the outermost
4693 level.
4694 * THANKS: Add Michiel De Wilde.
4695
922730fe
AD
46962008-11-03 Akim Demaille <demaille@gostai.com>
4697
4698 bench.pl: Pass directives as a list instead of as a string.
4699 * etc/bench.pl.in (&directives): New.
4700 (&triangular_grammar, &calc_grammar): Use it to format the Bison
4701 directives.
4702 (&triangular_grammar): Do use the directives (were ignored).
4703 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
4704 directives.
4705
7484f1d4
AD
47062008-11-03 Akim Demaille <demaille@gostai.com>
4707
4708 Improve genericity of bench.pl.
4709 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
4710 argument.
4711 (&bench_push_parser): New.
4712 Call it.
4713
15129f25
AD
47142008-11-03 Akim Demaille <demaille@gostai.com>
4715
4716 Add documentation to bench.pl.
4717 * etc/bench.pl.in: Comment changes.
4718
0e0ed236
AD
47192008-11-03 Akim Demaille <demaille@gostai.com>
4720
4721 Fuse the three stacks into a single one.
de62edee 4722
b06df3c2
AD
4723 In order to make it easy to perform benchmarks to ensure that
4724 there are no performance loss, lalr1.cc is forked into
4725 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
4726 lalr1.cc.
4727
4728 Meanwhile, to make sure that lalr1-fusion.cc is correctly
4729 exercized by the test suite, the user must install a symbolic link
4730 from lalr1.cc to it.
de62edee 4731
b06df3c2
AD
4732 Instead of having three stacks (state, value, location), use a
4733 stack of triples. This considerably simplifies the code (and it
4734 will be easier not to require locations as currently does the C++
4735 parser), and also gives a 10% speedup according to
4736 etc/bench (probably mainly since memory allocation is done once
4737 instead of three times).
de62edee 4738
0e0ed236
AD
4739 Another motivation is to make it easier to destruct properly
4740 semantic values: now that they are bound to their state (hence
4741 symbol type) it will be easier to call the appropriate destructor.
de62edee 4742
0e0ed236 4743 These changes should probably benefit the C parser too.
de62edee 4744
b06df3c2
AD
4745 * data/lalr1.cc: Copy as...
4746 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
4747 (b4_rhs_value, b4_rhs_location): New definitions overriding those
4748 from c++.m4.
4749 (state_stack_type, semantic_stack_type, location_stack_type)
4750 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
4751 (data_type, stack_type, yystack_): New.
4752 (YYLLOC_DEFAULT, yypush_): Adjust.
4753 (yyerror_range): Now based on data_type, not location_type.
4754
7dedf26e
AD
47552008-11-03 Akim Demaille <demaille@gostai.com>
4756
4757 Push the state, value, and location at the same time.
4758 This is needed to prepare a forthcoming patch that fuses the three
4759 stacks into one.
de62edee 4760
7dedf26e
AD
4761 * data/lalr1.cc (parser::yypush_): New.
4762 (parser::yynewstate): Change the semantics: instead of arriving to
4763 this label when value and location have been pushed, but yystate
4764 is to be pushed on the state stack, now the three of them must
4765 have been pushed before. yystate still must be the new state.
4766 This allows to use yypush_ everywhere instead of individual
4767 handling of the stacks.
4768
c4585f1e
AD
47692008-11-03 Akim Demaille <demaille@gostai.com>
4770
4771 Prefer references to pointers.
4772 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
4773 definition to use references instead of pointers.
4774 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
4775 Take the value and location as references.
4776 Adjust callers.
4777
56017c17
AD
47782008-11-03 Akim Demaille <demaille@gostai.com>
4779
4780 stack::size instead of stack::height.
4781 * data/lalr1.cc (stack::height): Rename as...
4782 (stack::size): this.
4783 Fix the output type.
4784 Comment changes.
4785
5ab8c47b
AD
47862008-11-03 Akim Demaille <demaille@gostai.com>
4787
4788 Use variants to support objects as semantic values.
b06df3c2
AD
4789 This patch was inspired by work by Michiel De Wilde. But he used
4790 Boost variants which (i) requires Boost on the user side, (ii) is
4791 slow, and (iii) has useless overhead (the parser knows the type of
4792 the semantic value there is no reason to duplicate this
4793 information as Boost.Variants do).
4794
4795 This implementation reserves a buffer large enough to store the
4796 largest objects. yy::variant implements this buffer. It was
4797 implemented with Quentin Hocquet.
de62edee 4798
5ab8c47b
AD
4799 * src/output.c (type_names_output): New.
4800 (output_skeleton): Invoke it.
4801 * data/c++.m4 (b4_variant_if): New.
4802 (b4_symbol_value): If needed, provide a definition for variants.
4803 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
4804 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
4805 (b4_char_sizeof, yy::variant): New.
4806 (parser::parse): If variants are requested, define
4807 parser::union_type, parser::variant, change the definition of
4808 semantic_type, construct $$ before running the user action instead
4809 of performing a default $$ = $1.
4810 * examples/variant.yy: New.
4811 Based on an example by Michiel De Wilde.
4812
1fa5d8bb
AD
48132008-11-03 Akim Demaille <demaille@gostai.com>
4814
4815 Parameterize the extraction of semantic values.
4816 To make future changes easier, no longer rely on ".TYPE" being the
4817 way to get a semantic value.
de62edee 4818
1fa5d8bb
AD
4819 * data/c.m4 (b4_symbol_value): New.
4820 Use it.
4821 * data/c++.m4, data/yacc.c: Use it.
4822 * data/glr.c: Use b4_symbol_value.
4823 (b4_rhs_data): New.
4824 Use it.
4825
91ba8a55
AD
48262008-11-03 Akim Demaille <demaille@gostai.com>
4827
4828 Prepare easier M4 changes.
4829 * data/lalr1.cc: Use escaped [] instead of literals to prepare
4830 future changes.
4831
c9ba9e59
JD
48322008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4833
4834 Initiate further development.
4835 * NEWS: Create an empty section for new entries.
4836 * gnulib: Update submodule to HEAD.
4837
bfb40910
JD
48382008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4839
4840 * NEWS: Version 2.4.
4841
241fda7a
JD
48422008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4843
4844 Prepare for next release.
4845 * NEWS: Briefly mention changes since 2.3b.
4846 * README: Say GNU m4 1.4.6, which we've been requiring in release
4847 announcements already, not 1.4.3, which breaks the build.
4848
ed4d67dc
JD
48492008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4850
4851 Say %language is experimental.
4852 We're thinking of extending it's effect on output file naming. See the
4853 thread at
4854 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
4855 * NEWS: Say it's experimental.
4856 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
4857 recommend it over %skeleton for now.
4858 (Bison Options): Likewise.
4859 (C++ Bison Interface): Use %skeleton not %language.
4860 (Calc++ Parser): Use %skeleton not %language.
4861 * src/getargs.c (usage): Say it's experimental.
4862
e254a580
DJ
48632008-11-01 Di-an Jan <dianj@freeshell.org>
4864 Paolo Bonzini <bonzini@gnu.org>
4865
4866 Support all Java parser class modifiers.
4867 * data/java.m4 (b4_percent_define_get3): New.
4868 (b4_final_if, b4_strictfp_if): New.
4869 * data/lalr1.java (final, strictfp, extends, implements): Support.
4870 * doc/bison.texinfo (final, strictfp, extends, implements): Add
4871 documentation.
4872 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
4873 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
4874 (AT_CHECK_JAVA_GREP): New.
4875 (Java parser class modifiers): New test.
4876 (Java parser class extends and implements): New test.
4877
4878 Model exception propagation better with throws and lex_throws.
4879 * data/java.m4 (b4_list2): New.
4880 (throws): Change default.
4881 * data/lalr1.java (yyaction): Add throws.
4882 (parse): Add lex_throws in addition to throws.
4883 * doc/bison.texinfo (throws, lex_throws): Add documentation.
4884 * tests/java.at (Java throws specifications): New test.
4885
4886 Improve documentation for Java parsers.
4887 * doc/bison.texinfo (Java Parsers): Add subsections.
4888 Don't quote first argument of %define.
4889 (Java Bison Interface): Document output files. Move documentation
4890 of parser class and merge into Java Parser Interface. Document
4891 features that error out. Document directives with no effect.
4892 Move note about Javadoc higher.
4893 (Java Semantic Values): Explicitly mention stype.
4894 Document that generic types cannot be used.
4895 (Java Location Values): Use @deftypeivar. Document constructors.
4896 Correct return value for toString.
4897 (Java Parser Interface): List undocumented constants/fields.
4898 Move documentation of fields added by %parse-param closer to list
4899 of members. Document that token names are added as fields.
4900 Document constructors accurately. Remove error method.
4901 (Java Scanner Interface): Move note on %pure-parser to Java Bison
4902 Interface. Describe %code lexer and yylex accutately.
4903 Remove documentation that does not match the code.
4904 (Java Action Features): New.
4905 (Java Differences): Add reference. Add item on semantic values.
4906 Add note about @{ ... @}. Clarify %% epilogue placement.
4907 (Java Declarations Summary): New.
4908
4909 Fix Java skeleton.
4910 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
4911 (b4_remove_comma): Quote test argument.
4912 (b4_identification): Remove "bison" field.
4913 * tests/java.at (Java parser class and package names): New test.
4914 (Java %parse-param and %lex-param): New test.
4915 (Java stype, position_class and location_class): New test.
4916
f259e4e6
PB
49172008-10-31 Di-an Jan <dianj@freeshell.org>
4918
4919 * data/lalr1.jave: Update copyright years.
4920 (YYParser): Correct name of "generated from" file in Javadoc:
4921 use b4_file_name instead of @ofile@.
4922 (Location constructor): Correct Javadoc parameter name.
4923 (yylloc): Add missing opening m4 quote after b4_location_if.
4924 This removes a stray [ in the Javadoc of Lexer.getStartPos.
4925 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
4926 (YYParser constructor): Correct Javadoc parameter name.
4927
cae5057f
JD
49282008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
4929
4930 Always put auxiliary code files in the same dir as other output files.
4931 * src/files.c (compute_file_name_parts): When the user specifies
4932 --output but not --file-prefix, extract the directory prefix from the
4933 file prefix not from the grammar file name. This affects the location
4934 of files like location.hh generated by the C++ skeleton. The includes
4935 in the other output files require this fix.
4936 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
4937 for expected output files.
4938 (Output files): Add a test for the above.
4939
4af432ba
JD
49402008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
4941
4942 * gnulib: Update submodule to HEAD.
4943
e26d4e43
JD
49442008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4945
4946 Update copyright year.
4947 * src/files.c: Here.
4948
c0ee9e21
DJ
49492008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
4950
4951 Don't overwrite the input file.
4952 * src/files.c (output_file_name_check): Fatal error if using input file
4953 for output.
4954 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
4955 argument.
4956 (Conflicting output files): Add test.
4957
482dc52f
AD
49582008-10-28 Akim Demaille <demaille@gostai.com>
4959
4960 Space changes.
4961 * data/lalr1.cc: Formatting changes.
4962
52cbbe84
AD
49632008-10-28 Akim Demaille <demaille@gostai.com>
4964
4965 Don't define debugging functions when !YYDEBUG.
4966 * data/lalr1.cc (debug_stream, set_debug_stream)
4967 (debug_level_type, debug_level, set_debug_level): Don't
4968 declare them when YYDEBUG is not defined.
4969 The implementation are already YYDEBUG-aware.
4970
0925d5bf
AD
49712008-10-28 Akim Demaille <demaille@gostai.com>
4972
4973 Prefer "continue" for empty loop bodies.
4974 * etc/bench.pl.in: Use "continue" instead of {}.
4975
cf98343c
AD
49762008-10-28 Akim Demaille <demaille@gostai.com>
4977
4978 Space and comments changes.
4979 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
4980 * data/c.m4, data/lalr1.cc: Space changes.
4981
9f467b7d
AD
49822008-10-28 Akim Demaille <demaille@gostai.com>
4983
4984 Make gnulib a submodule.
4985 * gnulib: New.
4986 * .gitmodules (gnulib): New.
4987
0f0e1ace
JD
49882008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4989
4990 Fix yyerror_range for user-defined location type in C++. Reported by
4991 Georg Sauthoff at
4992 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
4993 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
4994 * THANKS (Georg Sauthoff): Add.
4995
548e2104
JD
49962008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4997
4998 Update several administrative files mainly to facilitate releasing.
4999 * HACKING (Administrivia): Make the git-merge-changelog notes more
5000 helpful.
5001 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
5002 (Release Procedure): Update for git and add numerous details that were
5003 previously missing.
5004 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
5005 * maint.mk (announcement): Don't list bison as a bootstrap tool so
5006 that announcements don't claim we bootstrapped with whatever bison
5007 happened to be in PATH. Add flex as a bootstrap tool.
5008 * Makefile.maint: Remove, previously replaced by maint.mk.
5009 * Makefile.cfg: Remove, and migrate settings to...
5010 * cfg.mk: ... here for the sake of `make announcement'.
5011 * bootstrap.conf (gnulib_modules): Add announce-gen.
5012 * README: Say GNU Bison instead of just Bison. Suggested by Karl
5013 Berry.
5014
ddf17a6e
PB
50152008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
5016
5017 Small but important bugfixes for the Java skeleton.
5018 * data/lalr1.java (yyerror): Change Location to b4_location_type.
5019 (yy_symbol_print): Call toString on yyvaluep.
5020
e1145ad8
AD
50212008-08-29 Akim Demaille <demaille@gostai.com>
5022
5023 Clarify UPDATED use.
215b40ac 5024 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 5025 not to the release date of Bison.
215b40ac 5026 Reported by Joel E. Denny.
e1145ad8 5027
0df72d78
AD
50282008-08-29 Akim Demaille <demaille@gostai.com>
5029
5030 * README: Update FAQ pointer.
5031 Reported by Joel E. Denny.
5032
9a90b6bb
EB
50332008-08-27 Eric Blake <ebb9@byu.net>
5034
5035 Resync m4sugar from autoconf.
5036 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
5037 (m4_init): Adjust to latest m4.git changes.
5038 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
5039 effects.
5040 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
5041 (_m4_list_cmp): Reduce side effects.
5042
65015668
AD
50432008-08-27 Akim Demaille <demaille@gostai.com>
5044
5045 Check yyerrok in calc.at.
215b40ac
EB
5046 * tests/calc.at (calc.y): Use yyerrok on "( error )".
5047 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
5048 expected.
65015668 5049
98e26a92
AD
50502008-08-27 Akim Demaille <demaille@gostai.com>
5051
5052 Support yyerrok in lalr1.cc.
5053 YYBACKUP is still to import back into lalr1.cc.
215b40ac 5054 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 5055
86c0e784
JD
50562008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
5057
5058 For maintainer-check*, don't recompile for a $(VERSION) update.
5059 * cfg.mk: New file.
5060 (_is-dist-target): Override the one in GNUmakefile.
5061 * Makefile.am (EXTRA_DIST): Add cfg.mk.
5062
88511166
JD
50632008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
5064
5065 Update for recent change to gnulib.
5066 * src/parse-gram.y: Don't include strverscmp.h. It comes from
5067 string.h now.
5068
6bbb2ed5
EB
50692008-08-15 Eric Blake <ebb9@byu.net>
5070
d67c52e8
EB
5071 Remaining m4sugar merge from autoconf.
5072 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
5073 * data/m4sugar/foreach.m4: New file, copied from autoconf.
5074 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
5075 * src/output.c (output_skeleton): Tell m4 how to find it.
5076
6bbb2ed5
EB
5077 Partial m4sugar merge from autoconf: m4_map.
5078 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
5079 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
5080 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
5081 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
5082 for empty list.
5083 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
5084 Likewise.
5085 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
5086 declares it.
5087
8dce3875
JD
50882008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
5089
5090 Keep .version and PACKAGE_VERSION in sync.
5091 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
5092 dependency, and add comments justifying this in more detail. Discussed
5093 starting at
5094 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
5095
882a1fbf
EB
50962008-08-06 Eric Blake <ebb9@byu.net>
5097
a3764451
EB
5098 Partial m4sugar merge from autoconf: m4_shiftn.
5099 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
5100 (m4_shift2, m4_shift3): New macros.
5101 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
5102 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
5103 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
5104 * data/java.m4 (b4_remove_comma): Likewise.
5105
882a1fbf
EB
5106 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
5107 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
5108 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
5109 (m4_init): Consolidate wrapped text into single m4_wrap.
5110 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
5111 in wrapped text.
5112
a30e920d
EB
51132008-08-05 Eric Blake <ebb9@byu.net>
5114
dfcc5959
EB
5115 Partial m4sugar merge from autoconf: builtins, version.m4.
5116 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
5117 (m4_prepend): Remove, as it is unused and inherently quadratic,
5118 whereas m4_append is linear in newer m4.
5119 (m4_mkstemp): New builtin.
5120 (m4_symbols): Make rename conditional.
5121 (m4_version_prereq): Ensure fatal error if used in bison, which
5122 intentionally lacks version.m4.
5123
a30e920d
EB
5124 Fix comments in m4sugar.
5125 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
5126
445b7470
JD
51272008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
5128
5129 Update for recent .gitignore fix in Gnulib.
5130 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
5131 anchored .gitignore entries.
5132
a1e50014
JD
51332008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
5134
5135 Set gnu or gnits strictness.
5136 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
5137 development and gnits strictness for releases. Based on Eric Blake's
5138 suggestion at
5139 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
5140
d43f77e7
PB
51412008-07-31 Paolo Bonzini <bonzini@gnu.org>
5142
5143 * NEWS: Clarify documentation of %language.
5144
fee2ed87
PB
51452008-07-31 Paolo Bonzini <bonzini@gnu.org>
5146
5147 Support usage of git-merge-changelog.
5148 * .gitattributes: New.
5149 * HACKING: Document usage of git-merge-changelog.
5150 * bootstrap: Install git-merge-changelog entries in .git/config
5151 if appropriate.
5152
78029cd5
JD
51532008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5154
5155 Remove remaining dependence on CVS Id keyword.
5156 * ChangeLog: For the sake of people still using CVS, don't use dollars
5157 when mentioning Id.
5158 * data/xslt/bison.xsl: Remove Id from header comments, where it was
5159 unusual anyway.
5160 * data/xslt/xml2dot.xsl: Likewise.
5161 * data/xslt/xml2text.xsl: Likewise.
5162 * data/xslt/xml2xhtml.xsl: Likewise.
5163 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
5164 * doc/Makefile.am (neutralize): Remove, no longer needed.
5165 (.x.1): Don't use neutralize.
5166 (edit): Don't substitute for ID.
5167 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
5168
c53d18b1
JD
51692008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5170
5171 Fix dependence on computed configure variables.
5172 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
5173 $(top_srcdir)/configure.ac so that changes to computed variables, such
5174 as PACKAGE_VERSION, are seen.
5175 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
5176
5523ac79
JD
51772008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
5178
5179 Update copyright dates for recent changes.
5180 * Makefile.am: Here.
5181 * src/Makefile.am: Here.
5182 * src/reduce.c: Here.
5183 * tests/reduce.at: Here.
5184
8fa36911
JD
51852008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
5186
5187 Use git-version-gen for version names between releases.
5188 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
5189 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
5190 * .prev-version: New.
5191 * .version.in: Remove.
78029cd5 5192 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
5193 revision.
5194 * GNUmakefile: Remove, now copied from Gnulib.
5195 * Makefile.am: Add code suggested by comments in
5196 build-aux/git-version-gen.
5197 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
5198 .prev-version, and .version.
5199 * NEWS (2.3b+): Rename to...
5200 (?.?): ... this because we're dropping the "+" version naming scheme,
5201 but, in general, we still can't be sure of our next release name.
5202 * bootstrap: Add a quick hack to remove from .gitignore the
5203 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
5204 entry. This should really be fixed in gnulib instead.
5205 * bootstrap.conf (gnulib_modules): Add gnumakefile.
5206 * configure.ac (AC_INIT): Set version name by invoking
5207 build-aux/git-version-gen.
5208 (AC_CONFIG_FILES): Remove .version, now generated by
5209 build-aux/git-version-gen.
5210 * maint.mk: New, copied from coreutils.
5211 * doc/.cvsignore (bison.1): Add.
5212 * doc/.gitignore (/bison.1): Add.
5213 * doc/bison.1: Remove, generated.
5214 * src/.cvsignore (revision.c): Remove.
5215 * src/.gitignore (/revision.c): Remove.
5216 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
5217 (BUILT_SOURCES): Remove revision.c.
5218 (revision.c): Remove.
5219 * src/getargs.c (version): Don't print revision after the VERSION.
5220 * src/revision.h: Remove.
5221
bcf07cb7
JD
52222008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5223
5224 Fix untranslatable composition of sentences. Reported by Goran
5225 Uddeborg at
5226 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
5227 * THANKS (Goran Uddeborg): Add.
5228 * src/reduce.c (reduce_print): Report the number of nonterminals and
5229 rules useless in the grammar in separate sentences.
5230 * tests/reduce.at (Useless Rules): Update output.
5231 (Reduced Automaton): Likewise.
5232 (Underivable Rules): Likewise.
5233 (Empty Language): Likewise.
5234
9aacab9a
JD
52352008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
5236
5237 Fix some .gitignore and .cvsignore problems.
5238 * bootstrap (insert_sorted_if_absent): Replace all uses with...
5239 (insert_vc_ignore): ... this new function, which prepends `/' to all
5240 .gitignore entries before passing them to insert_sorted_if_absent.
5241 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
5242 .cvsignore files are maintained even though Bison developers run
5243 bootstrap while using Git.
5244 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
5245 unneeded by Bison.
5246 (gnulib): Add.
5247 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
5248 unneeded. Reported by Eric Blake.
5249 * lib/.gitignore (/*~): Add.
5250 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
5251 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
5252 Blake.
5253 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
5254
a9fc7990
JD
52552008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
5256
5257 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
5258 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
5259 * bootstrap.conf (gnulib_modules): Add unsetenv.
5260 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
5261 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
5262 (/setenv.m4): Add.
5263 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
5264 the first argument because it may become position-dependent, and unset
5265 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
5266 Add comments explaining these issues in more detail.
5267
0f1d6f10
JD
52682008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
5269
5270 Add .gitignore everywhere based on .cvsignore.
5271 * .gitignore: New.
5272 * build-aux/.gitignore: New.
5273 * data/.gitignore: New.
5274 * doc/.gitignore: New.
5275 * etc/.gitignore: New.
5276 * examples/.gitignore: New.
5277 * examples/calc++/.gitignore: New.
5278 * lib/.gitignore: New.
5279 * m4/.gitignore: New.
5280 * po/.gitignore: New.
5281 * runtime-po/.gitignore: New.
5282 * src/.gitignore: New.
5283 * tests/.gitignore: New.
5284
7bd1665a
JD
52852008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5286
5287 * NEWS (2.3b+): New section, empty for now.
5288 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
5289
72c5b982
JD
52902008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5291
5292 * NEWS (2.3b): Update release date since there has been a delay in
5293 getting the announcements and tarballs out.
5294
bd02cd5d
JD
52952008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5296
5297 * NEWS: Version 2.3b.
5298 * configure.ac (AC_INIT): Likewise.
5299 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
5300
9126263e
JD
53012008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5302
5303 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
5304 been doing it for years.
5305 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
5306 (Release Procedure): Add FIXME about make alpha being unmaintained.
5307
fa6aa7b3
JD
53082008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
5309
5310 * data/yacc.c: Reformat m4 a little for readability.
5311 * src/lalr.c (build_relations): Correct comment.
5312
d30b312d
JMG
53132008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5314
5315 DJGPP specific issue.
5316 * djgpp/config.sed: Fixes required to run configure scripts generated
5317 by autoconf 2.62.
5318
138d4cd9
JD
53192008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5320
5321 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
5322 coordinator@translationproject.org.
5323
8f7e2e1f
JD
53242008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5325
5326 * THANKS: Add Eric Blake.
5327
f55efa38
JD
53282008-04-23 Eric Blake <ebb9@byu.net>
5329
5330 Revert prior patch, by working around autoconf regression.
5331 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
5332 ("Output file name: ("): Uncomment test.
5333 ("Output file name: )"): Likewise.
5334 Based on an idea from Noah Misch.
5335
096c9f9d
JD
53362008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5337
5338 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
5339 2.61. Reported by Juan Manuel Guerrero at
5340 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
5341 * tests/output.at ("Output file name: ("): Comment out test case for
5342 now.
5343 ("Output file name: )"): Likewise.
5344
0f664b89
JD
53452008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5346
5347 * GNUmakefile: Update git-version-gen invocation so make dist
5348 succeeds.
5349
1cfe6375
JD
53502008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5351
5352 Update to the current gnulib CVS repository, and fix trigraph handling
5353 in Bison.
5354 * bootstrap: Update gnulib CVS repository URL.
5355 (symlink_to_dir): Encapsulate the code that guarantees the destination
5356 directory exists into...
5357 (check_dst_dir): ... this new function, and...
5358 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
5359 fail when copying files into lib/uniwidth/.
5360 * src/output.c (prepare_symbols): When writing yytname muscles, where
5361 symbol names will be encoded in C-string literals, tell quotearg to
5362 escape trigraphs. This used to be the default in gnulib.
5363 * tests/regression.at (Token definitions): Because of the change in
5364 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
5365 escapes trigraphs in symbol names. Thus, yytname no longer has
5366 trigraphs unnecessarily doubly escaped. Update test case output.
5367 Extend test case to be sure Bison's own error messages will no longer
5368 have trigraphs in symbol names unnecessarily escaped once.
5369
74c52fc8
JD
53702008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
5371
5372 Fix make dist infinite loop reported by Juan Manuel Guerrero at
5373 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
5374 * .cvsignore: Add .version.
5375 * .version.in: New.
5376 * bootstrap.conf (gnulib_modules): Add git-version-gen.
5377 * configure.ac (AC_CONFIG_FILES): Add .version.
5378 * build-aux/.cvsignore: Add git-version-gen.
5379
8e55b3aa
JD
53802008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5381
5382 * NEWS (2.3a+): Mention that -g now takes an argument.
5383 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
5384 consistency. Update the -g and -x entries now that they take
5385 arguments. Use brackets to indicate optional arguments.
5386 * src/getargs.c (usage): Explain the relationship between arguments of
5387 long and short options more completely. Document --defines and -d
5388 separately since the former takes an argument but, for POSIX Yacc, the
5389 latter does not.
5390 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 5391 (getargs): Sort cases.
8e55b3aa 5392
59c5ac72
AD
53932008-02-28 Akim Demaille <demaille@gostai.com>
5394
5395 * doc/bison.texinfo: Fix a few typos.
5396
118d4978
AD
53972008-02-28 Akim Demaille <akim@epita.fr>
5398
5399 * doc/bison.texinfo (Bison Options): Document -W.
5400 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
5401
7020f1e9
AD
54022008-02-28 Akim Demaille <akim@epita.fr>
5403
5404 * src/getargs.c (short_options): Split and sort for readability.
5405 -g and -x take optional arguments, just like their long options.
5406 * build-aux/cross-options.pl: Use /x to make the regexp easier to
5407 understand.
5408 Fix the handling of $opt which resulted in all the argument to be
5409 considered as optional.
5410
59da312b
JD
54112008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
5412
5413 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
5414 say its interface is experimental.
5415 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5416 Java.
5417 (Bison Options): In the -L and --language entry, mention Java.
5418 (Java Bison Interface): Say the interface is experimental.
5419 * src/getargs.c (usage): Mention -L and --language.
5420
5421 * NEWS (2.3a+): Say the push parsing interface is experimental.
5422 * doc/bison.texinfo (Push Decl): Likewise.
5423 (Decl Summary): Likewise in the "%define api.push_pull" entry.
5424 (Push Parser Function): Likewise.
5425 (Pull Parser Function): Likewise.
5426 (Parser Create Function): Likewise.
5427 (Parser Delete Function): Likewise.
5428 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
5429 yypull_parse, and yypush_parse entries.
5430
5431 * NEWS (2.3a+): Mention XML support, and say the schema is
5432 experimental.
5433 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
5434 * src/getargs.c (usage): Say the XML schema is experimental.
5435
5436 * NEWS (2.3a+): Say option instead of flag.
5437
2bb3ebec
WP
54382008-02-21 Wojciech Polak <polak@gnu.org>
5439
5440 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
5441 text.
5442
333e670c
JD
54432008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
5444
5445 Fix impure push parser compile error reported by Bob Rossi at
5446 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
5447 * data/yacc.c: Clean up whitespace in the output a little.
5448 (yypstate_allocated): Define for impure push parsers regardless of
5449 whether the pull interface is also requested.
5450 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
5451 check impure push parsers without the pull interface.
5452
5453 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
5454 yyerror takes arguments specified by %parse-param while yypstate_new
5455 does not.
5456 * doc/bison.texinfo (Parser Create Function): Document that
5457 yypstate_new returns 0 for multiple impure parser instances.
5458 * tests/push.at (Push Parsing: Multiple impure instances): Update
5459 expected stderr output.
5460
798096e1
JD
54612008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5462
5463 * runtime-po/POTFILES.in (push.c): Remove.
5464
9ca7f077
JD
54652008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5466
5467 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
5468 * data/push.c: Rename to...
5469 * data/yacc.c: ... this, overwriting it.
5470 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
5471 `%push-pull-parser' -> `%define api.push_pull "both"'.
5472 Remove old yacc.c tests, and update push.c tests to yacc.c.
5473
42ee26bb
JD
54742008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5475
5476 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
5477 `"%code top" blocks' instead of `%code "top" blocks'.
5478 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
5479 Clean up whitespace in the output a little.
5480
b1cc23c4
JD
54812008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5482
5483 Fix documentation problems reported by Tim Josling at
5484 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
5485 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
5486 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
5487 integers. Explain the effect of literal string aliases on error
5488 messages. Copy token 0 documentation from the C++ skeleton
5489 documentation.
5490
ab7f29f8
JD
54912008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5492
5493 Accept a token number in a %left, %right, or %nonassoc for POSIX
5494 conformance. Reported by Tim Josling at
5495 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
5496 * NEWS (2.3a+): Mention.
5497 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
5498 and code numbers are treated by precedence declarations.
5499 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
5500 of symbols.1.
5501 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
5502 of symbol.
5503 (symbol.prec): New, just like symbol but allows INT.
5504 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
5505 longer holds.
5506 * tests/regression.at (Token number in precedence declaration): New
5507 test case.
5508
a924ef36
JMG
55092008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5510
5511 DJGPP specific issues.
5512 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
5513 be changed. Copyright timestamp adjusted.
5514 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
5515 be changed. Copyright timestamp adjusted.
5516 * djgpp/config.site: Copyright timestamp adjusted.
5517 * djgpp/config_h.sed: Copyright timestamp adjusted.
5518 * djgpp/djunpack.bat: Copyright timestamp adjusted.
5519 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
5520 filename translation list.
5521 * djgpp/subpipe.c (init_subpipe): Check the environment variables
5522 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
5523 files shall be created. Before trying to use the temp dir where the
5524 environment variable points to check that the dir really exists. If
5525 not default to the cwd as temp dir. Copyright timestamp adjusted.
5526 * djgpp/subpipe.h: Copyright timestamp adjusted.
5527 * djgpp/testsuite.sed: Copyright timestamp adjusted.
5528
389c8cfd
PE
55292008-01-30 Paul Eggert <eggert@cs.ucla.edu>
5530
5531 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
5532
5d1cfef4
PE
55332008-01-09 Paul Eggert <eggert@cs.ucla.edu>
5534
5535 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
5536 Problem reported by Claudio Saavedra in
5537 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
5538
e2dcf996
WP
55392008-01-05 Wojciech Polak <polak@gnu.org>
5540
5541 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
5542 document's title with the input grammar file name.
5543
da730230
JD
55442007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
5545
5546 Automate regression testing of the XML/XSLT implementation. Discussed
5547 starting at
5548 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
5549 * configure.ac (XSLTPROC): New substitution.
5550 * Makefile.am (maintainer-xml-check): New phony target invoking...
5551 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
5552 invoking make maintainer-check with BISON_TEST_XML=1.
5553 * tests/atlocal.in (XSLTPROC): New.
5554 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
5555 not to report reachable memory when Bison is expected to have a
5556 non-zero exit status and (2) to compare XML/XSLT output with --graph
5557 and --report=all output for every working grammar when
5558 BISON_TEST_XML=1.
5559 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
5560 (AT_BISON_CHECK_XML): New.
5561 (AT_QUELL_VALGRIND): New.
5562 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
5563 (AT_CHECK): ... don't redefine this since this was the old way to
5564 quell Valgrind.
5565 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
5566 AT_BISON_CHECK invocations.
5567 * tests/c++.at: Likewise.
5568 * tests/calc.at: Likewise.
5569 * tests/conflicts.at: Likewise.
5570 * tests/cxx-type.at: Likewise.
5571 * tests/existing.at: Likewise.
5572 * tests/glr-regression.at: Likewise.
5573 * tests/headers.at: Likewise.
5574 * tests/input.at: Likewise.
5575 * tests/java.at: Likewise.
5576 * tests/output.at: Likewise.
5577 * tests/push.at: Likewise.
5578 * tests/reduce.at: Likewise.
5579 * tests/regression.at: Likewise.
5580 * tests/sets.at: Likewise.
5581 * tests/skeletons.at: Likewise.
5582 * tests/synclines.at: Likewise.
5583 * tests/torture.at: Likewise.
5584 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
5585 tends to hang xsltproc.
5586 (Big horizontal): Likewise.
5587
408476bc
JD
55882007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5589
5590 In XML output, remove redundant class attribute on symbol element.
5591 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
5592 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
5593 look up a symbol to determine whether it's a nonterminal or terminal.
5594 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
5595 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
5596
5597 Add prec/assoc information to XML output.
5598 * src/gram.c (grammar_rules_print_xml): For each rule that has a
5599 %prec, add a percent_prec attribute.
5600 * src/print-xml.c (print_grammar): For each terminal that has a
5601 precedence or associativity, add a prec or assoc attribute.
5602 (xml_indent): New.
5603 (xml_puts): Use xml_indent.
5604 (xml_printf): Use xml_indent.
5605 * src/print-xml.h (xml_indent): Prototype.
5606
5607 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
5608 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5609
d4a26c48
JD
56102007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5611
5612 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
5613 (bison:ruleByNumber): ... this for clarity.
5614 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
5615 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
5616 (xsl:template match="reduction"): Update.
5617 (xsl:template match="item"): Update.
5618 (xsl:template match="reduction"): Update.
5619
5620 In the XML output, don't print the list of rules where symbols appear.
5621 Compute it in XSLT instead. Discussed at
5622 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
5623 * data/xslt/bison.xsl (bison:ruleByLhs): New.
5624 (bison:ruleByRhs): New.
5625 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
5626 bison:ruleByRhs.
5627 (xsl:template match="terminal/rule"): Remove.
5628 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5629 bison:ruleByRhs.
5630 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5631 Remove.
5632 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
5633 bison:ruleByRhs and mode="number-link" for rule template.
5634 (xsl:template match="terminal/rule"): Remove.
5635 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5636 bison:ruleByRhs and mode="number-link" for rule template.
5637 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5638 Rewrite as...
5639 (xsl:template match="rule" mode="number-link"): ... this.
5640 * src/print-xml.c (print_grammar): Don't print the list of rules.
5641
ef1b4273
JD
56422007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5643
5644 Don't let --report affect XML output; always print all information.
5645 Discussed at
5646 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
5647 * src/conflicts.c (log_resolution): Implement.
5648 * src/print-xml.c (print_core): Implement.
5649 (print_state): Implement.
5650 (print_xml): Implement.
5651
5652 * NEWS (2.3a+): Fix quotes.
5653 * src/parse-gram.y (prologue_declaration): For consistency with -v,
5654 don't let %verbose clear the list specified by --report.
5655
0f6cd9e3
AD
56562007-11-26 Akim Demaille <akim@epita.fr>
5657
5658 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
5659
d80fb37a
JD
56602007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
5661
5662 In the XML output, list useless and unused symbols and rules with the
5663 useful ones and add a "usefulness" attribute. Discussed starting at
5664 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
5665 * src/gram.c (grammar_rules_partial_print_xml): Remove.
5666 (grammar_rules_print_xml): Print all rules instead of just those
5667 useful in the grammar, and add a "usefulness" attribute.
5668 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
5669 * src/print-xml.c (print_rules_useless_in_parser): Remove.
5670 (print_grammar): Print all nonterminals instead of just useful ones,
5671 and add a "usefulness" attribute to nonterminals and terminals.
5672 (print_xml): Don't print a separate "reductions" or
5673 "rules-useless-in-parser" element.
5674 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
5675 (reduce_xml): Remove.
5676 (reduce_token_unused_in_grammar): New.
5677 (reduce_nonterminal_useless_in_grammar): New.
5678 * src/reduce.h (reduce_xml): Remove prototype.
5679 (reduce_token_unused_in_grammar): Add prototype.
5680 (reduce_nonterminal_useless_in_grammar): Add prototype.
5681 * data/xslt/xml2text.xsl: Update for XML changes.
5682 * data/xslt/xml2xhtml.xsl: Update for XML changes.
5683 * tests/reduce.at (Useless Terminals): Update output.
5684 (Useless Rules): Update output.
5685 (Reduced Automaton): Update output.
5686
5687 Say "Terminals unused in grammar" instead of "Unused terminals".
5688 * NEWS (2.3a+): Update.
5689 * doc/bison.texinfo (Understanding): Update example output.
5690 * src/reduce.c (reduce_output): Implement.
5691 * data/xslt/xml2text.xsl: Implement.
5692 * data/xslt/xml2xhtml.xsl: Implement.
5693
1bb2bd75
JD
56942007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
5695
5696 Accept --report-file=FILE to override the default `.output' filename.
5697 * NEWS (2.3a+): Mention.
5698 * doc/bison.texinfo (Bison Options): Add an entry.
5699 * src/files.c (compute_output_file_names): Don't override
5700 spec_verbose_file if already set.
5701 * src/getargs.c (usage): Document --report-file.
5702 (REPORT_FILE_OPTION): New anonymous enum member.
5703 (long_options): Add entry for it.
5704 (getargs): Add case for it setting spec_verbose_file.
5705
5706 * build-aux/cross-options.pl: Don't record a short option just because
5707 there's an arg.
5708 * doc/.cvsignore: Add yacc.1.
5709
a005a9c4
AD
57102007-11-14 Akim Demaille <akim@epita.fr>
5711
5712 * doc/yacc.1.in: New.
5713 * configure.ac, doc/Makefile.am: Adjust.
5714 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
5715 config.h symbol.
5716 Use AC_SUBST for assignments too.
5717 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
5718
cff03fb2
JD
57192007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5720
5721 * src/gram.c: Remove comments that duplicate comments in gram.h.
5722
5723 When reporting useless rules and nonterminals, say "useless in grammar"
5724 instead of "useless", and say "useless in parser" instead of "never
5725 reduced". Discussed starting at
5726 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
5727 * NEWS (2.3a+): Mention this change.
5728 * data/xslt/xml2text.xsl: Update output text and expected input XML
5729 element names to match changes below.
5730 * data/xslt/xml2xhtml.xsl: Likewise.
5731 (xsl:template match="bison-xml-report"): Add missing entry in Table of
5732 Contents: "Rules useless in parser due to conflicts".
5733 * doc/bison.texinfo (Decl Summary): Reword a little.
5734 (Understanding): Update example output for changes below.
5735 * src/gram.c: (rule_useful_p): Rename to...
5736 (rule_useful_in_grammar_p): ... this.
5737 (rule_useless_p): Rename to...
5738 (rule_useless_in_grammar_p): ... this.
5739 (rule_never_reduced_p): Rename to...
5740 (rule_useless_in_parser_p): ... this.
5741 (grammar_rules_print): Update for renames.
5742 (grammar_rules_print_xml): Update for renames.
5743 (grammar_rules_never_reduced_report): Rename to...
5744 (grammar_rules_useless_report): ... this since it is used for either
5745 kind of useless rule.
5746 * src/gram.h: Reword comments and update function names in prototypes.
5747 * src/main.c (main): Say "rule useless in parser due to conflicts".
5748 * src/print-xml.c (print_rules_never_reduced): Rename to...
5749 (print_rules_useless_in_parser): ... this, and rename output XML
5750 element "rules-never-reduced" to "rules-useless-in-parser".
5751 (print_xml): Update for rename.
5752 * src/print.c (print_results): Say "Rules useless in parser due to
5753 conflicts".
5754 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
5755 (nonterminals_reduce): Say "nonterminal useless in grammar".
5756 (reduce_output): Say "Nonterminals useless in grammar".
5757 Say "Rules useless in grammar".
5758 (reduce_xml): Rename output XML element "useless" to
5759 "useless-in-grammar".
5760 (reduce_print): Don't report the count of grammatically useless rules
5761 as "rules never reduced" just because %yacc is specified.
5762 In the correct report of this count, say nonterminal(s) and rule(s)
5763 "useless in grammar".
5764 * tests/conflicts.at (S/R in initial): Update expected output.
5765 (Defaulted Conflicted Reduction): Likewise.
5766 (Unreachable States After Conflict Resolution): Likewise.
5767 * tests/existing.at (GNU pic Grammar): Likewise.
5768 * tests/reduce.at (Useless Nonterminals): Likewise.
5769 (Useless Rules): Likewise.
5770 (Reduced Automaton): Likewise.
5771 (Underivable Rules): Likewise.
5772 (Empty Language): Likewise.
5773
66f0441d
JD
57742007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5775
5776 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
5777 here document and before the EOF so that BSD's implementation of Bourne
5778 shell doesn't parse the delimiter as part of the here document.
5779 * doc/.cvsignore: Add cross-options.texi.
5780 * src/getargs.c (usage): Add a blank line after the warning categories.
5781
d0ee4105
PB
57822007-11-08 Paolo Bonzini <bonzini@gnu.org>
5783
5784 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
5785
e8b1fb9b
AD
57862007-11-05 Akim Demaille <akim@epita.fr>
5787
5788 Remove Id: from bison.1.
5789 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
5790 (perl -0777 -pi -e 's/\.PP\nId): New.
5791 (.x.1): Use it to ignore the version control revision.
5792
2f7a96b5
AD
57932007-11-05 Akim Demaille <demaille@gostai.com>
5794
5795 * build-aux/Makefile.am: Ship cross-options.pl.
5796 * doc/Makefile.am: Always refer to cross-options.texi with
5797 $(srcdir).
5798 (MAINTAINERCLEANFILES): Add it.
5799
f4101aa6
AD
58002007-11-04 Akim Demaille <demaille@gostai.com>
5801
5802 Generate the long/short option cross-table.
5803 * build-aux/cross-options.pl: New.
5804 * doc/Makefile.am (cross-options.texi): New.
5805 * doc/bison.texinfo: Use it.
5806
727a1401
AD
58072007-11-04 Akim Demaille <demaille@gostai.com>
5808
5809 Generate bison.1 using help2man.
5810 * doc/common.x, doc/bison.x: New.
5811 * doc/Makefile.am (bison.1, .x.1): New.
5812 The code is taken from autoconf-2.61/man/Makefile.am.
5813 * configure.ac: Look for help2man.
5814
6aeb9c57
AD
58152007-11-04 Akim Demaille <demaille@gostai.com>
5816
5817 Complete --help.
5818 * src/getargs.c (usage): Document -W, make it clear that -d,
5819 -g and -x have optional arguments.
5820
d7be4085
AD
58212007-11-04 Akim Demaille <demaille@gostai.com>
5822
5823 Find sha1sum when named gsha1sum.
5824 * bootstrap (find_tool): New.
5825 ($SHA1SUM): New.
5826
d9df47b6
JD
58272007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5828
5829 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
5830 at
5831 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
5832 * NEWS (2.3a+): Mention.
5833 * data/bison.m4 (b4_pure_if): Don't define it here.
5834 * data/c.m4 (b4_identification): Depend on individual skeletons to
5835 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
5836 values of the %define variables api.pure or api.push_pull. Define
5837 YYPURE, YYPUSH, and YYPULL accordingly.
5838 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
5839 glr.cc has already defined b4_pure_flag.
5840 * data/push.c: Define b4_pure_if based on `%define api.pure'.
5841 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 5842 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
5843 * doc/bison.texinfo (Pure Decl): Update.
5844 (Push Decl): Update.
5845 (Decl Summary): Add api.pure to %define entry.
5846 In %pure-parser entry, say it's deprecated and reference %define.
5847 (Pure Calling): Update.
5848 (Error Reporting): Update.
5849 (C++ Scanner Interface): Update.
5850 (How Can I Reset the Parser): Update.
5851 (Table of Symbols): In %pure-parser entry, say it's deprecated and
5852 reference %define.
5853 * src/getargs.c (pure_parser): Remove global variable.
5854 * src/getargs.h (pure_parser): Remove extern.
5855 * src/output.c (prepare): Don't define pure_flag muscle.
5856 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
5857 wrapper around `%define api.pure'.
5858 * tests/calc.at (Simple LALR Calculator): Update.
5859 (Simple GLR Calculator): Update.
5860 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
5861 Update.
5862 (GLR: Resolve ambiguity, pure, locations): Update.
5863 (GLR: Merge conflicting parses, pure, no locations): Update.
5864 (GLR: Merge conflicting parses, pure, locations): Update.
5865 * tests/glr-regression.at (Uninitialized location when reporting
5866 ambiguity): Update
5867 * tests/input.at (Unused %define api.pure): New test case.
5868 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
5869 AT_PURE_IF and AT_PURE_AND_LOC_IF.
5870 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5871
c373bf8b
JD
58722007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5873
5874 %define push_pull -> %define api.push_pull. Discussed starting at
5875 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
5876 * data/push.c: Expect the new name.
5877 * data/yacc.c: Likewise.
5878 * doc/bison.texinfo (Push Decl): Update.
5879 (Decl Summary): Update %define entry.
5880 (Push Parser Function): Update.
5881 (Pull Parser Function): Update.
5882 (Parser Create Function): Update.
5883 (Parser Delete Function): Update.
5884 * tests/calc.at (Simple LALR Calculator): Update.
5885 * tests/input.at (%define enum variables): Update.
5886 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5887 (Push Parsing: Multiple impure instances): Update.
5888 (Push Parsing: Unsupported Skeletons): Update.
5889 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
5890 (Exploding the Stack Size with Malloc): Update.
5891
5892 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
5893 other entries some.
5894
32f19b6b
JD
58952007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
5896
5897 For the XML output's terminal element, rename @number to @token-number,
5898 and add @symbol-number. In the nonterminal element, rename @number to
5899 @symbol-number. Discussed starting at
5900 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
5901 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
5902 renames.
5903 (xsl:template match="nonterminal"): Likewise.
5904 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
5905 (xsl:template match="nonterminal"): Likewise.
5906 * src/print-xml.c (print_grammar): Implement.
5907
255a6b90
JD
59082007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5909
5910 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
5911 2007-10-11 change, the child elements here are items not rules.
408476bc 5912 (xsl:template match="item"): New.
255a6b90
JD
5913 (xsl:template match="rule"): Update for new reduced itemset.
5914 (xsl:template match="point"): Remove.
5915 (xsl:template match="empty"): For consistency with --graph, don't
5916 output "/* empty */".
5917 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
5918 line-wrap, don't pass a negative value as first-line-length since this
5919 won't work with the following changes.
5920 (xsl:template name="line-wrap"): Simplify slightly.
5921 (xsl:template name="ws-search"): Eliminate recursion.
5922 * src/print_graph.c (print_core): Don't print a reduction's lookahead
5923 set next to an item whose dot is not at the end of the RHS even if it
5924 happens to be associated with the same rule.
5925
88c78747
JD
59262007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5927
31984206
JD
5928 Add %define lr.keep_unreachable_states.
5929 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
5930 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
5931 * src/main.c (main): Implement it.
5932 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5933 Extend to test it, and fix a typo.
5934
59352007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5936
5937 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
5938 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
5939 the example .output text.
5940 * tests/regression.at (Extra lookahead sets in report): Improve wording
5941 of comments.
5942
b7a70162
WP
59432007-10-17 Wojciech Polak <polak@gnu.org>
5944
5945 * src/print-xml.c (print_grammar): Renamed
5946 <terminal> and <nonterminal> attributes:
5947 "type" to "number" and "symbol" to "name".
5948 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
5949 Use new attribute names.
5950 (xsl:template match="nonterminal"): Likewise.
5951 * data/xslt/xml2xhtml.xsl: Likewise.
5952
a0de5091
JD
59532007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
5954
5955 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
5956 (Option Cross Key): Likewise.
5957
5958 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
5959 next to an item whose dot is not at the end of the RHS even if it
5960 happens to be associated with the same rule.
5961 * src/print.c (print_core): Likewise.
5962 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
5963 (Resolved SR Conflicts): Update output.
5964 * tests/regression.at (Extra lookahead sets in report): New test case.
5965
4c20d18d
WP
59662007-10-11 Wojciech Polak <polak@gnu.org>
5967
5968 * src/print-xml.c (print_core): Remove item set
5969 redundancy.
5970 * data/xslt/bison.xsl (bison:ruleNumber): New key.
5971 Improve processing time. Suggested by Joel E. Denny.
5972 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
5973 Write xsl:param "required" attribute as comment.
5974 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
5975 (xsl:template match="rule"): Support new reduced itemset.
5976 (xsl:template match="point"): Remove.
5977 * data/xslt/xml2xhtml.xsl: Likewise.
5978
f506ad1c
JD
59792007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5980
5981 * src/getargs.c (version): Update copyright year.
5982
21f1b063
JD
59832007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5984
5985 Make xml2dot.xsl and --graph produce the same output.
5986 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
5987 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
5988 escaped later.
5989 (xsl:template name="output-node"): Use the new escape template instead
5990 of the string-replace template directly.
5991 (xsl:template name="output-edge"): Likewise.
5992 (xsl:template name="escape"): New, escapes backslashes and newlines in
5993 addition to quotation marks.
5994 * src/graphviz.c (start_graph, output_node, output_edge): Add
5995 whitespace to output for legibility.
5996
5997 Make xml2text.xsl and --report produce the same output, and remove the
5998 XML "conflicts" element since a conflict summary is easily extracted
5999 from the automaton.
6000 * data/xslt/bison.xsl: New.
6001 (xsl:template match="state" mode="bison:count-conflicts): New.
6002 * data/xslt/xml2text.xsl: Import bison.xsl.
6003 (xsl:template match="bison-xml-report"): Instead of styling the
6004 "conflicts" element, style the "automaton" element with mode
6005 "conflicts". Unlike the former, the latter lists S/R and R/R
6006 conflicts for a state on the same line.
6007 (xsl:template match="conflicts"): Remove.
6008 (xsl:template match="conflict"): Remove.
6009 (xsl:template match="terminal"): Line-wrap the list of rules in which
6010 the terminal is used.
6011 (xsl:template match="nonterminal"): Likewise for nonterminals.
6012 (xsl:template match="automaton" mode="conflicts"): New.
6013 (xsl:template match="state" mode="conflicts"): New.
6014 (xsl:template name="line-wrap"): New.
6015 (xsl:template name="ws-search"): New.
6016 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
6017 (xsl:template match="bison-xml-report"): Instead of styling the
6018 "conflicts" element, style the "automaton" element with mode
6019 "conflicts."
6020 (xsl:template match="conflicts"): Remove.
6021 (xsl:template match="conflict"): Remove.
6022 (xsl:template match="automaton" mode="conflicts"): New.
6023 (xsl:template match="state" mode="conflicts): New.
6024 * src/conflicts.c (conflicts_output_xml): Remove.
6025 * src/conflicts.h (conflicts_output_xml): Remove prototype.
6026 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
6027 * src/print.c (print_grammar): Consistently wrap at the 66th column so
6028 the corresponding XSLT is easier. Also, never wrap between a word and
6029 the comma that follows it.
6030
793fbca5
JD
60312007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
6032
6033 Improve C++ namespace support. Discussed starting at
6034 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
6035 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
6036 b4_namespace_close): New macros that interpret the %define variable
6037 "namespace" so its value can contain "::" to indicate nested
6038 namespaces.
6039 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
6040 the above macros.
6041 * data/lalr1.cc (b4_namespace): Likewise.
6042 * data/location.cc (b4_namespace): Likewise.
6043 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
6044 inside a new table in the general %define entry. Document `%define
6045 namespace' there as well. Point the %name-prefix entry to it since it
6046 explains it more completely in the case of C++.
6047 (C++ Bison Interface): Mention `%define namespace' instead of
6048 %name-prefix.
6049 (Table of Symbols): Remove the `%define push_pull' entry. The %define
6050 entry suffices.
6051 * tests/c++.at (Relative namespace references): New test case.
6052 (Absolute namespace references): New test case.
6053 (Syntactically invalid namespace references): New test case.
6054 * tests/input.at (C++ namespace reference errors): New test case.
6055
35b8730d
JD
60562007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
6057
6058 Add syncline support and location accessor to internal %define
6059 interfaces.
6060 * data/bison.m4 (b4_percent_define_get_loc): New.
6061 (b4_percent_define_get_syncline): New.
6062 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
6063 (b4_percent_define_default): Record defining location as line 1 rather
6064 than 0 for the sake of synchronizing #line's, and define
6065 b4_percent_define_syncline(VARIABLE).
6066 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
6067 * src/muscle_tab.c (muscle_syncline_grow): New.
6068 (muscle_code_grow): Use muscle_syncline_grow.
6069 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
6070 define b4_percent_define_syncline(VARIABLE).
6071 (muscle_percent_define_get_loc): New.
6072 (muscle_percent_define_get_syncline): New.
6073 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
6074 remove some unused variables.
6075 (muscle_percent_define_default): Record defining location as line 1
6076 rather than 0 for the sake of synchronizing #line's, and define
6077 b4_percent_define_syncline(VARIABLE).
6078 (muscle_percent_define_check_values): Use
6079 muscle_percent_define_get_loc.
6080 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
6081 (muscle_percent_define_get_syncline): Prototype.
6082 * tests/skeletons.at (%define Boolean variables: invalid skeleton
6083 defaults): Update output for location change.
6084 (Complaining during macro argument expansion): Extend to test
6085 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
6086
7dc4a694
JD
60872007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
6088
6089 Fix some error-reporting macro bugs.
6090 * data/bison.m4 (b4_cat): New.
6091 (b4_error, b4_error_at): Use b4_cat to send error directives directly
6092 to stdout so they don't become arguments to other macros. Update
6093 comments and add examples.
6094 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
6095 add examples.
6096 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
6097 after printing the error directive so that M4 doesn't report subsequent
6098 problems that are induced by this problem.
6099 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
6100 instead of just in them. Recognize @\n in both places. Both expand to
6101 the empty string. Needed by b4_cat.
6102 * tests/skeletons.at (Complaining during macro argument expansion):
6103 New test case.
6104 (Fatal errors make M4 exit immediately): New test case.
6105
d4bd2295
JD
61062007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
6107
6108 Implement --print-datadir.
6109 * src/getargs.c (usage): Mention.
6110 (PRINT_DATADIR_OPTION): New anonymous enum member.
6111 (long_options): Add entry for it.
6112 (getargs): Add case for it calling compute_pkgdatadir.
6113 * src/output.c (output_skeleton): Encapsulate data directory
6114 computation from here...
6115 (prepare): ... and from here...
6116 (compute_pkgdatadir): ... into this new function.
6117 * src/output.h (compute_pkgdatadir): Prototype.
6118
34cdeddf
JD
61192007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
6120
6121 * src/print-xml.c (escape_bufs): New static global variable
6122 replacing...
6123 (xml_escape_n): ... the static local variable buf here.
6124 (print_xml): Free memory for escape_bufs.
6125 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
6126
d782395d
JD
61272007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
6128
6129 Replace `%push-parser' and `%push-pull-parser' with
6130 `%define push_pull "push"' and `%define push_pull "both"'.
6131 `%define push_pull "pull"' is the default.
6132 * doc/bison.texinfo (Push Decl, Push Parser Function,
6133 Pull Parser Function, Parser Create Function, Parser Delete Function):
6134 Update declarations.
6135 (Decl Summary, Table of Symbols): Replace %push-parser and
6136 %push-pull-parser entries with a %define push_pull entry.
6137 * data/bison.m4 (b4_percent_define_check_values): New macro.
6138 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
6139 definitions...
6140 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
6141 definitions...
6142 * data/push.c: ... to here and compute them from the value of the
6143 %define variable push_pull.
6144 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
6145 parsing requests here...
6146 * data/yacc.c: ... hack this to switch to push.c any time
6147 b4_use_push_pull_flag or the %define variable push_pull is set. This
6148 will go away when we mv push.c yacc.c.
6149 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
6150 push parsing is not supported since unused %define variables are
6151 reported anyway.
6152 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
6153 * src/muscle_tab.h (muscle_percent_define_check_values): Update
6154 comments for consistency with b4_percent_define_check_values.
6155 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
6156 muscles.
6157 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
6158 Remove.
6159 (prologue_declaration): Remove %push-parser and %push-pull-parser
6160 rules.
6161 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
6162 * tests/calc.at: Update declarations.
6163 * tests/input.at (%define enum variables): New test case.
6164 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
6165 declaration.
6166 (Push Parsing: Multiple impure instances): Update declaration.
6167 (Push Parsing: Unsupported Skeletons): New test case.
6168 * tests/torture.at (Exploding the Stack Size with Alloca): Update
6169 declaration.
6170 (Exploding the Stack Size with Malloc): Update declaration.
6171
3f999f78
WP
61722007-09-24 Wojciech Polak <polak@gnu.org>
6173
6174 Add XSLT transformations.
6175
6176 * data/xslt/xml2dot.xsl: Transform XML into DOT.
6177 * data/xslt/xml2text.xsl: Transform XML into plain text.
6178 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
6179 * data/Makefile.am (xsltdir): New variable.
6180 (dist_xslt_DATA): Add xslt/*.xsl files.
6181
a4f75309
PE
61822007-09-23 Paul Eggert <eggert@cs.ucla.edu>
6183
6184 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
6185 Problem reported by Wojciech Polak.
6186 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
6187 (xml_printf): Undo change I made on 21 September; that is,
6188 indent 2 spaces, not 1.
6189
ad5feac4
JD
61902007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
6191
6192 Pacify ./configure --enable-gcc-warnings.
6193 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
6194 `char const *' instead of `char *'.
6195 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
6196 local variable `sep'.
6197
41d7a5f2
PE
61982007-09-21 Paul Eggert <eggert@cs.ucla.edu>
6199
6200 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
6201 elsewhere.
6202 * src/print-xml.c: Prefer "const" after types; that's more consistent.
6203 (xml_printf): Indent just 1 space for level.
6204 (e_char, xlate_char): Remove.
6205 (xml_escape_string): Rewrite to avoid undefined behavior (used
6206 storage that was freed from the stack).
6207 (xml_escape_n): Don't bother checking for subscript error.
6208
3f999f78
WP
62092007-09-21 Wojciech Polak <polak@gnu.org>
6210
6211 Add Bison XML Automaton Report.
41d7a5f2
PE
6212
6213 Add support for an -x option to generate an XML report.
6214 It is not documented yet.
6215 * src/print-xml.c: New file.
6216 * src/print-xml.h: Likewise.
6217 * lib/timevar.def (TV_XML): New var.
6218 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
6219 * src/conflicts.c: Include print-xml.h.
6220 (solved_conflicts_xml_obstack): New var.
6221 (log_resolution, conflicts_solve, conflicts_free):
6222 Add support for XML report.
6223 (conflicts_output_val): New function.
6224 * src/conflicts.h (conflicts_output_val): New decl.
6225 * src/files.c (spec_xml_file): New var.
6226 (compute_output_file_names, output_file_names_free): Add XML support.
6227 * src/files.h (spec_xml_file): New decl.
6228 * src/getargs.c (xml_flag): New var.
6229 (usage, short_options, long_options, getargs): Add XML support.
6230 * src/getargs.h (xml_flag): New decl.
6231 * src/gram.c: Include print-xml.h.
6232 (rule_lhs_print_xml, rule_rhs_print_xml):
6233 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
6234 New functions.
6235 * src/gram.h: Declare external ones.
6236 * src/main.c: Include print-xml.h.
6237 (main): Add XML support.
6238 * src/reduce.c: Include print-xml.h.
6239 (reduce_xml): New function.
6240 * src/reduce.h: Declare it.
6241 * src/state.c: Include print-xml.h.
6242 (state_new): Add XML support.
6243 (state_rule_lookahead_tokens_print_xml): New function.
6244 * src/state.h: Declare it.
6245 (struct state): New member solved_conflicts_xml.
6246 * src/symtab.c (symbol_class_get_string): New function.
6247 * src/symtab.h: Declare it.
6248
6d8e724d
PE
62492007-09-21 Paul Eggert <eggert@cs.ucla.edu>
6250
6251 * GNUmakefile: Switch to coreutils's version.
6252 * bootstrap: Likewise.
6253 * Makefile.cfg: Adjust to new GNUmakefile.
6254 * README-hacking: Likewise.
6255
6256 Import from gnulib:
6257
6258 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
6259 Bruno Haible <bruno@clisp.org>
6260
6261 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
6262 and is a script that invokes bison. Tighten the code. Add comments.
6263
922bdd7f
JD
62642007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
6265
6266 Spell "boolean" as "Boolean". Reported by Akim Demaille.
6267 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
6268 * doc/bison.texinfo (Decl Summary): Fix.
6269 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
6270 * tests/input.at (Boolean %define variables): Update output.
6271 * tests/skeletons.at (%define boolean variables: invalid skeleton
6272 defaults): Rename to...
6273 (%define Boolean variables: invalid skeleton defaults): ... this and
6274 update output.
6275
1b17b01d
JD
62762007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
6277
6278 In impure push mode, don't allow more than one yypstate to be allocated
6279 since multiple impure parsers would corrupt yynerrs.
6280 * data/push.c (yypstate_allocated): New static global variable
6281 initialized to 0.
6282 (yypull_parse): If yypstate_new returns 0, don't report it as memory
6283 exhaustion if yypstate_allocated is 1, but still return 2.
6284 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
6285 already 1. Otherwise, set it to 1.
6286 (yypstate_delete): Set it to 0.
6287 * tests/push.at (Push Parsing: Multiple impure instances): New test
6288 case.
6289
9987d1b3
JD
62902007-08-17 Bob Rossi <bob@brasko.net>
6291
6292 * doc/bison.texinfo (Push Decl): Document the push parser.
6293 (Table of Symbols): Ditto.
6294 (Pure Decl): Ditto.
6295 (Decl Summary): Ditto.
6296 (Multiple Parsers, Push Parser Function, Pull Parser Function,
6297 Parser Create Function, Parser Delete Function):
6298 Add new push parser symbols.
6299 (Table of Symbols): Document push-parser, push-pull-parser,
6300 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
6301
f16b0819
PE
63022007-08-15 Paul Eggert <eggert@cs.ucla.edu>
6303
6304 Update to GPLv3.
6305 * doc/gpl-3.0.texi: New file.
6306 * doc/gpl.texi: Remove.
6307 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
6308 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
6309 * README-hacking, TODO, bootstrap, bootstrap.conf:
6310 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
6311 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
6312 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
6313 * data/lalr1.cc, data/lalr1.java, data/location.cc:
6314 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
6315 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
6316 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
6317 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
6318 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
6319 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
6320 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
6321 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
6322 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
6323 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
6324 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
6325 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
6326 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
6327 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
6328 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
6329 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
6330 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
6331 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
6332 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
6333 * src/complain.c, src/complain.h, src/conflicts.c:
6334 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
6335 * src/files.h, src/flex-scanner.h, src/getargs.c:
6336 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
6337 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
6338 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
6339 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
6340 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
6341 * src/print.c, src/print.h, src/print_graph.c:
6342 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
6343 * src/reduce.h, src/relation.c, src/relation.h:
6344 * src/revision.h, src/scan-code.h, src/scan-code.l:
6345 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
6346 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
6347 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
6348 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
6349 * tests/Makefile.am, tests/actions.at, tests/c++.at:
6350 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
6351 * tests/existing.at, tests/glr-regression.at:
6352 * tests/headers.at, tests/input.at, tests/java.at:
6353 * tests/local.at, tests/output.at, tests/push.at:
6354 * tests/reduce.at, tests/regression.at, tests/sets.at:
6355 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
6356 * tests/torture.at:
6357 Update to GPLv3.
6358
728c4be2
JD
63592007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6360
6361 Get rid of broken %no-parser, -n, and --no-parser implementation and
6362 documentation.
6363 * TODO: Don't mention them.
6364 * doc/bison.1: Likewise.
6365 * doc/bison.texinfo (Decl Summary): Likewise.
6366 (Bison Options): Likewise.
6367 (Option Cross Key): Likewise.
6368 * src/getargs.c (no_parser_flag): Remove global variable.
6369 (usage): Don't print description of -n and --no-parser.
6370 (long_options): Remove --no-parser entry here.
6371 (getargs): Remove -n case in the switch here.
6372 * src/getargs.h (no_parser_flag): Remove extern.
6373 * tests/regression.at (Web2c Actions): Remove comment that mentions
6374 --no-parser.
6375
5d31a216
JD
63762007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6377
6378 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
6379 name user variables starting with `yy'. Just pass NULL instead of a
6380 dummy local &yylval to yypush_parse.
6381 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
6382 starting with `yy'.
6383
a2ea208d
JD
63842007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
6385
6386 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
6387 true since it's then always used regardless of whether yyoverflow is
6388 defined. Reported by Christian Burger at
6389 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
6390 * THANKS: Add Christian Burger.
6391
91661ebb
JD
6392 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6393 node names: say "Decl Summary" not "Bison Declaration Summary".
6394
cbd50549
JD
63952007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
6396
6397 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
6398 determine whether this function has already complained about an invalid
6399 value for a %define boolean variable, don't check whether Bison has
6400 ever examined the value. As written, the check was a tautology.
6401 Instead, record and check for this complaint using a separate muscle.
6402
eb1b0740
JD
64032007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
6404
6405 Fix push parsing memory leak reported by Brandon Lucia at
6406 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
6407 * THANKS: Add Brandon Lucia.
6408 * data/push.c (yypstate_delete): Free the stack if it was reallocated
6409 but the parse never completed and thus freed it.
6410 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
6411 * tests/testsuite.at: Include push.at.
6412 * test/push.at: New.
6413 (Push Parsing: Memory Leak for Early Deletion): New test case.
6414
9d774aff
JD
64152007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
6416
6417 Improve handling of multiple S/R conflicts in the same state and of S/R
6418 conflicts involving multiple reductions.
6419 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
6420 set for a state here or Bison will abort if it is reassigned on a
6421 later conflicted reduction in the same state.
6422 Similarly, don't finalize and assign the solved conflicts report here
6423 or it will be lost if it is reassigned on a later conflicted reduction
6424 in the same state.
6425 (set_conflicts): Instead, assign them both here after all S/R conflicts
6426 in the state have been fully examined.
6427 * src/print.c (shift_set): Rename to...
6428 (no_reduce_set): ... this.
6429 (print_reductions): Update for rename, and add %nonassoc error action
6430 tokens to no_reduce_set so that, when printing the first remaining
6431 reduction on an error action token, the reduction is enclosed in
6432 brackets.
6433 (print_results): Update for rename.
6434 * tests/conflicts.at (Solved conflicts report for multiple reductions
6435 in a state): New test case.
6436 (%nonassoc error actions for multiple reductions in a state): New test
6437 case.
6438
6439 * src/main.c (main): Don't depend on C99 features.
6440
10159d2a
JD
64412007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
6442
6443 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
6444 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
6445 uniwidth.
10159d2a 6446
953b3935
JD
64472007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
6448
6449 * bootstrap (slurp): Create target directories that don't exist.
6450 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
6451
6ce2d93a
JD
64522007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6453
6454 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
6455 than item number.
6456 * closure.c (closure): Likewise.
6457 * state.h (reductions): Comment sorting of rules.
6458 (state): Comment sorting of items.
6459
ce3448d5
JD
64602007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
6461
6462 Fix C++ test cases after recent Gnulib changes. Discussed starting at
6463 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
6464 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
6465 definition in order to avoid Gnulib headers since we don't use config.h
6466 here.
6467 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
6468 rather than AT_DATA so that config.h is included.
6469
8a86eef0
JD
64702007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
6471
6472 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
6473 instead of fprintf. Guard these functions with #if YYDEBUG instead of
6474 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
6475 and so that YYFPRINTF is guaranteed to be defined here.
6476
b1a81613
JD
64772007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6478
6479 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
6480 with...
6481 (muscle_percent_define_check_values): ... this more helpful function.
6482 Again, it's not used yet, but it will be.
6483 * src/muscle_tab.h: Likewise.
6484
71b61d4d
JD
6485 Improve some comments in parser table construction.
6486 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
6487 (generate_states): Don't mention ruleset, which is internal to closure.
6488 * src/closure.c (closure): Explain sorting of core and itemset, which
6489 is required for this function to behave correctly.
6490 * src/closure.h (closure): Mention sorting.
6491
2a6b783d
JD
64922007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
6493
6494 * src/lalr.c (state_lookahead_tokens_count): For code readability,
6495 move the check for disabled transitions to an aver since conflict
6496 resolution hasn't happened yet.
6497
6498 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
6499 labels a state as inconsistent just because it has error transitions.
6500 The original form of this check appeared in revision 1.1 of lalr.c,
6501 which was committed on 1991-12-21. Now (at least), changing the
6502 consistency label on such a state appears to have no useful effect in
6503 any of the places it is examined, which I enumerate below. The key
6504 point to understanding each item in this enumeration is that a state
6505 with an error transition is labelled consistent in the first place only
6506 if it has no rules, so the check cannot matter for states that have
6507 rules. (1) Labelling a state as inconsistent will cause set_conflicts
6508 to try to identify its conflicts, and a state must have *rules* to have
6509 conflicts. (2) Labelling a state as inconsistent will affect how
6510 action_row sets the default *rule* for the state. (3) Labelling a
6511 state as inconsistent will cause build_relations to add lookback edges
6512 to *rules* in that state.
6513 * src/state.h (struct state): Word the comment for member consistent
6514 more carefully.
6515
14462c2b
JD
65162007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
6517
6518 Don't depend on C99 features.
6519 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
6520 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
6521 * src/reader.c (check_and_convert_grammar): Fix for-loop.
6522 * src/state.c (state_mark_reachable_states): Fix for-loop.
6523 (state_remove_unreachable_states): Fix for-loop.
6524
6525 Don't widen struct state with member reachable just to temporarily
6526 record reachability. Instead, use a local bitset.
6527 * src/state.h (struct state): Remove member.
6528 * src/state.c (state_new): Don't initialize it.
6529 (state_mark_reachable_states): Rename to...
6530 (state_record_reachable_states): ... this, and use bitset.
6531 (state_remove_unreachable_states): Use bitset.
6532
5a43d418
JD
65332007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
6534
6535 * src/Makefile.am (yacc): Quote target action commands properly so
6536 that the yacc script isn't corrupt. Reported by Hans Aberg at
6537 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
6538
0c650a20
JD
6539 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
6540 the case of pure parsers. Reported by Frans Englich at
6541 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
6542 * THANKS: Add Frans Englich.
6543
61fee93e
JD
6544 * NEWS (2.3a+): In the %code entry, reference section `Bison
6545 Declaration Summary' from the manual now since the %code summary has
6546 moved there.
6547 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
6548 in the rules section must be terminated by semicolons.
6549
f124d423
JD
65502007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
6551
6552 Extend the front-end API for %define variables to more completely
6553 mirror the back-end. This will be useful in the future.
6554 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
6555 Update comments to mention the new front-end counterparts of these
6556 macros.
6557 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
6558 for muscle_string_decode and muscle_location_decode.
6559 (muscle_string_decode): New static function.
6560 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
6561 (muscle_percent_define_get, muscle_percent_define_ifdef): New
6562 functions.
6563 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
6564 muscle_percent_define_get to mimic the b4_percent_define_flag_if
6565 implementation more closely.
6566 (muscle_percent_define_invalid_value): New function.
6567 * src/muscle_tab.h (muscle_percent_define_get,
6568 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
6569 Prototype.
6570
75ad86ee
JD
65712007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
6572
6573 * NEWS (2.3a+): Mention yesterday's state-removal change.
6574 (2.3a): Remove the %language entry, which was added after 2.3a.
6575 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
6576 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
6577 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
6578 tests/existing.at: Update copyright date.
6579
5967f0cf
JD
65802007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6581
6582 If conflict resolution makes states unreachable, remove those states,
6583 report rules that are then unused, and don't report conflicts in those
6584 states.
6585 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
6586 New global function.
6587 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
6588 function.
6589 * src/main.c (main): After conflict resolution, remove the unreachable
6590 states and update all data structures that reference states by number.
6591 * src/state.c (state_new): Initialize each state's reachable member to
6592 false.
6593 (state_mark_reachable_states): New static function.
6594 (state_remove_unreachable_states): New global function.
6595 * src/state.h (struct state): Add member bool reachable.
6596 (state_remove_unreachable_states): Prototype.
6597 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6598 New test case.
6599 * tests/existing.at (GNU pic Grammar): Update test case output now that
6600 an unused rule is discovered.
6601
b09f4f48
JD
66022007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6603
6604 Minor code cleanup in parser table construction.
6605 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
6606 (new_itemsets, save_reductions): Update for rename to nitemset.
6607 * src/closure.c (nritemset): Rename to...
6608 (nitemset): ... this since the "r" appears to meaningless and isn't
6609 used in the comments.
6610 (closure): Update for rename.
6611 * src/closure.h (nritemset): Update extern to...
6612 (nitemset): ... this.
6613 * src/lalr.c (LA): Fix a typo in comments.
6614 * src/print.c (print_core): Update for rename to nitemset.
6615 * src/print_graph.c (print_graph): Likewise.
6616 * src/state.h: Fix some typos in header comments.
6617
bbb44d83
PE
66182007-04-04 Paul Eggert <eggert@cs.ucla.edu>
6619
9b33de72
PE
6620 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
6621 still sticks to ASCII. Sorry!
6622
bbb44d83
PE
6623 * README-hacking: New file, taken mostly from coreutils, with changes
6624 for Bison. Contains much of the contents of:
6625 * README-cvs: Remove.
6626 * bootstrap: Sync from gnulib.
6627 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
6628 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
6629
29553547
JD
66302007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
6631
6632 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
6633 Setzer.
6634 (Java Differences): Fix some typos.
6635 * THANKS: Add Sebastian Setzer.
6636
01b477c6
PB
66372007-03-07 Paolo Bonzini <bonzini@gnu.org>
6638
730739e4
AD
6639 * data/java.m4 (b4_single_class_if): Remove.
6640 (b4_abstract_if): Look at "%define abstract".
6641 (b4_lexer_if): New.
6642 (b4_union_name): Rename...
6643 (b4_yystype): ... to this. Map to "%define stype".
6644 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
6645 b4_maybe_throws): Fix quoting.
6646 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
6647 * data/lalr1.java (Lexer interface): Always define.
6648 (Lexer interface within parser class): Remove.
6649 (YYLexer class): New, used when "%code lexer" is present.
6650 (constructor): When "%code lexer" is used, pass %lex-param
6651 to the lexer constructor.
6652 (yylex, yyparse): Remove %lex-param from method invocations
6653 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
6654
6655 * doc/bison.texinfo (Java Bison Interface): Mention "%define
6656 abstract". Rename "%define union_name" to "%define stype".
6657 Rename method names according to previous patch.
6658 (Java Scanner Interface): Describe "%code lexer" instead of
6659 "%pure-parser" and "%define single_class".
6660 (Java Differences): Mention "%code lexer".
6661
6662 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
6663 Include scanner here, using macros from tests/local.at.
6664 (AT_DATA_CALC_Y): Remove final argument.
6665 (_AT_CHECK_JAVA_CALC): Likewise.
6666 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
6667 of %locations and %error-verbose.
6668 (main): Test with and without %lex-param.
6669 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
6670 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 6671
122bea3a
JMG
66722007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6673
6674 DJGPP spefic issue. Inhibit the use of disallowed characters for
6675 file name genertion on Win98, WinXP, etc. These are |<>":?*\
6676 and concern testsuite case 46.
6677 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
6678 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
6679 * djgpp/config.bat: Inhibit the use of disallowed characters.
6680
9611cfa2
JD
66812007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6682
6683 Miscellaneous %define and %code cleanup.
6684 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
6685 values are interpreted.
6686 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
6687 documentation a little more.
6688 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
6689 muscle_percent_define_insert, muscle_percent_code_grow): New
6690 functions/macros.
6691 * src/muscle_tab.h (muscle_percent_define_insert,
6692 muscle_percent_code_grow): Prototype.
6693 * src/parse-gram.y (prologue_declaration): Use
6694 muscle_percent_define_insert and muscle_percent_code_grow when parsing
6695 %define and %code directives.
6696
6697 Make it easy to share %define boolean variables between the front-end
6698 and back-end. Though not used yet, this will be useful in the future.
6699 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
6700 Bison uses of names rather than just skeleton uses of names.
6701 (b4_percent_define_get, b4_percent_define_ifdef): Rename
6702 b4_percent_define_skeleton_variables(VARIABLE) to
6703 b4_percent_define_bison_variables(VARIABLE).
6704 (b4_percent_code_get, b4_percent_code_ifdef): Rename
6705 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
6706 b4_percent_code_bison_qualifiers(QUALIFIER).
6707 (b4_check_user_names_wrap): Update for renames.
6708 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
6709 muscle_percent_define_default): New functions mimicking
6710 b4_percent_define_flag_if and b4_percent_define_default.
6711
6712 For %define variables, report locations for invalid values and
bbb44d83 6713 redefinitions.
9611cfa2
JD
6714 * data/bison.m4 (b4_percent_define_flag_if): Read
6715 b4_percent_define_loc(VARIABLE) to report the location of an invalid
6716 value for VARIABLE.
6717 (b4_percent_define_default): Save a special location in
6718 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
6719 must later be reported as invalid.
6720 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
6721 functions.
6722 (muscle_percent_define_insert): Record the location of VARIABLE in
6723 muscle percent_define_loc(VARIABLE), and use it to report the previous
6724 location for a redefinition.
6725 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
6726 (muscle_percent_define_default): Update like b4_percent_define_default.
6727 (muscle_grow_user_name_list): Rename to...
6728 (muscle_user_name_list_grow): ... this for consistency and use
6729 muscle_location_grow.
6730 * src/muscle_tab.h (muscle_location_grow): Prototype.
6731 * tests/input.at (%define errors): Update expected output.
6732 * tests/skeletons.at (%define boolean variables: invalid skeleton
6733 defaults): New test case.
6734
0bf92491
JD
67352007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
6736
6737 * src/print.c (lookahead_set, state_default_rule): Remove.
6738 (print_reductions): Replace state_default_rule invocation with
6739 equivalent use of yydefact, which was computed in token_actions in
6740 tables.c.
6741 (print_results): Don't allocate lookahead_set.
6742
d3b12988
PB
67432007-02-27 Paolo Bonzini <bonzini@gnu.org>
6744
6745 * data/lalr1.java: Prefix all private members with yy.
6746
f57a7536
JD
67472007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
6748
6749 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 6750 Sebastien Fricker at
f57a7536 6751 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 6752 * THANKS: Add Sebastien Fricker.
f57a7536
JD
6753 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
6754 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
6755 accept a variable number of arguments.
6756
6404a5bf
JD
67572007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
6758
6759 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
6760
e4e09639
JMG
67612007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6762
6763 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
6764 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
6765 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
6766
d7e0a1a7
PE
67672007-02-11 Paul Eggert <eggert@cs.ucla.edu>
6768
6769 Undo my 2007-02-07 change, switching back to the c-strcase module
6770 introduced in the 2007-02-03 change. Bruno Haible reported that
6771 the 2007-02-07 change would be dangerous in Turkish if we add a
6772 language whose name contains "i", since "i" is not lowercase "I"
6773 in Turkish.
6774 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
6775 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
6776 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
6777 * m4/.cvsignore: Remove strcase.m4.
6778 * src/getargs.c: Revert 2007-02-07 change, as follows.
6779 Include c-strcase.h.
6780 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
6781
deee93a1
JD
67822007-02-11 Bruno Haible <bruno@clisp.org>
6783
6784 Enable the Java related testsuite tests when the only Java compiler
6785 found is a gcj < 4.3. Discussed at
6786 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
6787 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
6788
574add85
JD
67892007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
6790
6791 * data/Makefile.am: Update copyright date.
6792 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
6793 yypstate_new returns NULL.
6794 (yypstate_new): Return NULL if malloc does.
6795 * src/reader.c (packgram): Move translation of rule actions from the
6796 beginning of packgram to...
6797 (check_and_convert_grammar): ... here right before packgram is invoked
6798 so it's easier to write more complete comments, and remove redundant
6799 code.
6800
e785ccf7
JD
68012007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
6802
6803 As in semantic actions, make @$ in %initial-action, %destructor, and
6804 %printer imply %locations.
6805 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
6806 scanning @$.
6807 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
6808 (@$ in %initial-action implies %locations,
6809 @$ in %destructor implies %locations,
6810 @$ in %printer implies %locations): ... these new test cases.
6811
1cfe1ed7
PE
68122007-02-07 Paul Eggert <eggert@cs.ucla.edu>
6813
6814 Undo most of the 2007-02-03 change, switching to the strcase module
6815 now that gnulib strcase has been fixed.
6816 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
6817 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
6818 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
6819 * m4/.cvsignore: Add strcase.m4.
6820 * src/getargs.c: Revert 2007-02-03 change, as follows.
6821 Don't include c-strcase.h.
6822 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
6823 strcasecmp has "unspecified behavior" outside the POSIX locale,
6824 but it works fine in practice if at least one argument is ASCII,
6825 as is the case in Bison.
6826
0049ec86
PB
68272007-02-07 Paolo Bonzini <bonzini@gnu.org>
6828
6829 * tests/java.at: Skip tests if only one of javac/java is present.
6830 Reported by Joel E. Denny.
6831 * tests/atlocal.in: Adjust copyright years.
6832
68332007-02-05 Paolo Bonzini <bonzini@gnu.org>
6834
6835 * data/lalr1.java (Stack): Work around old verifiers that disallow
6836 access to the private fields of an inner class, from the outer class.
6837 We can make Stack's fields public because user code doesn't have access
6838 to the instance of Stack used by parse(). Reported by Paul Eggert.
6839
2c2b7220
PE
68402007-02-03 Paul Eggert <eggert@cs.ucla.edu>
6841
6842 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
6843 the right spot for these files?
6844 * bootstrap.conf (gnulib_modules): Add c-strcase.
6845 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
6846 c-strncasecmp.c.
6847 * src/getargs.c: Include c-strcase.h.
6848 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
6849 to avoid unspecified behavior.
6850
b2b81dae
JD
68512007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
6852
6853 * doc/bison.texinfo (Decl Summary): Correct typo.
6854
c1d19e10
PB
68552007-01-30 Paolo Bonzini <bonzini@gnu.org>
6856
6857 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
6858 Complain if the value does not match empty, "true" or "false".
6859 * data/c++.m4: Adjust default definitions of %define variables.
6860 * data/java.m4: Adjust default definitions of %define variables.
6861 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
6862 to above behavior.
6863 * tests/input.at (Boolean %define variables): Test new behavior.
6864
8405b70c
PB
68652007-01-29 Paolo Bonzini <bonzini@gnu.org>
6866
6867 * NEWS: Mention java.
6868 * TODO: Remove things that are done.
6869 * bootstrap.conf: Add javacomp-script and javaexec-script.
6870 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
6871
6872 * data/Makefile.am: Add new files.
6873 * data/java-skel.m4: New.
6874 * data/java.m4: New.
6875 * data/lalr1.java: New.
6876
6877 * doc/bison.texinfo: Put "A Complete C++ Example" under
6878 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
6879 under Other Languages.
6880
6881 * src/getargs.c (valid_languages): Add Java.
6882 * src/getargs.h (struct bison_language): Update size of string fields.
6883
6884 * tests/Makefile.am: Add java.at.
6885 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
6886 * tests/java.at: New.
6887 * tests/testsuite.at: Include it.
6888
3eb82471
JD
68892007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
6890
6891 Clean up.
6892 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
6893 at_directive_argv arguments so these no longer have to be global
6894 variables. Also, update the implementation for the following changes.
6895 (fail_for_at_directive_too_many_args,
6896 fail_for_at_directive_too_few_args): Add at_directive_name argument.
6897 (at_directive_name): Remove as at_directive_argv[0] will be used for
6898 this now.
6899 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
6900 for the directive name.
6901 (at_directive_argc, at_directive_argv): Make these local within
6902 skel_lex instead of global.
6903 (INITIAL): Update directive start action for above changes.
6904 (SC_AT_DIRECTIVE_ARG): Rename to...
6905 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
6906 (SC_AT_DIRECTIVE_SKIP_WS): Update.
6907 (scan_skel): Move yylex_destroy to...
6908 (skel_scanner_free): ... here.
6909 * tests/skeletons.at (installed skeleton file name): Rename to...
6910 (installed skeleton file names): ... this.
6911
148d66d8
JD
69122007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
6913
6914 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6915 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
6916 Summary" not "Directives".
6917 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
6918 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
6919 since the former is now the more complete one.
6920 (Prologue Alternatives): Likewise and do the same for %defines.
6921 (Table of Symbols): Add summary of %code, add summary of %define, and
6922 move full %code documentation to...
6923 (Decl Summary): ... here for consistency with other entries in these
6924 sections.
6925 Move %define entry in order to keep this list alphabetized.
6926 Reword %define entry a little to put less emphasis on the skeleton
6927 concept, which most users shouldn't have to think about.
6928
665f0c24
PE
69292007-01-26 Paul Eggert <eggert@cs.ucla.edu>
6930
6931 Adjust to recent gnulib changes.
6932 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
6933 Add string.h, string_.h, unistd_.h, wchar_.h.
6934 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
6935 * src/system.h: Don't include <stpcpy.h>; this is now done by
6936 <string.h>.
6937
592d0b1e
PB
69382007-01-23 Paolo Bonzini <bonzini@gnu.org>
6939
6940 Simplify implementation of unqualified %code, implement macros for
6941 uniform treatment of boolean %define flags. Document %define.
6942 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
6943 b4_percent_code_ifdef): New.
6944 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
6945 * data/c++.m4: Define default value for global_tokens_and_yystype.
6946 * data/glr.cc: Likewise.
6947 * data/location.cc: Use b4_percent_define_flag_if.
6948
148d66d8 6949 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
6950
6951 * src/parse-gram.y (Unqualified %code): Change muscle name to
6952 b4_percent_code().
6953 (content.opt): Default to empty.
6954
a7867f53
JD
69552007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6956
6957 Implement support for relative and absolute skeleton file names.
6958 Discussed starting at
6959 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
6960 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
6961 (Bison Options): Document in --skeleton entry.
6962 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
6963 full_skeleton can't necessarily hold all of pkgdatadir.
6964 If the specified skeleton file name contains a `/', don't prepend
6965 pkgdatadir.
6966 * src/parse-gram.y (prologue_declaration): If the specified skeleton
6967 file name contains a `/', prepend the grammar file directory.
6968 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
6969 * skeletons.at: New file.
6970 (relative skeleton file names): New test case.
6971 (installed skeleton file names): New test case.
6972 * tests/testsuite.at: Include skeletons.at.
6973
6974 * bootstrap: Update copyright to 2007.
6975
830c9b18
PB
69762007-01-17 Paolo Bonzini <bonzini@gnu.org>
6977
6978 * bootstrap: Remove occurrences of .#bootmp from the files.
6979
a8c2e813
AD
69802007-01-17 Akim Demaille <akim@epita.fr>
6981
6982 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
6983 nonterminals.
6984 Use per-type %printer.
6985
279cabb6
JD
69862007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6987
6988 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
6989 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6990 djgpp/config.site, src/files.c, src/files.h, src/main.c,
6991 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
6992 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
6993 tests/glr-regression.at, tests/input.at, tests/local.at,
6994 tests/output.at, tests/torture.at: Update copyright to 2007.
6995
bb32f4f2
AD
69962007-01-16 Akim Demaille <akim@epita.fr>
6997
6998 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
6999 error code.
7000 (Calc++ Scanner): Exit with failure if we can't open the input
7001 file.
7002 Accept "-" standing for stdin.
7003 (Calc++ Top Level): Print the result only if the parsing was
7004 successful.
7005
7cff04b5
AD
70062007-01-16 Akim Demaille <akim@epita.fr>
7007
7008 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
7009
a4e25e1d
JD
70102007-01-15 Paolo Bonzini <bonzini@gnu.org>
7011 and Joel E. Denny <jdenny@ces.clemson.edu>
7012
7013 Clean up %define and %code implementation in M4 some. Most
7014 importantly, rename all related macros to be in the b4_percent_define
7015 and b4_percent_code namespaces. Also, complete support for `.' in
7016 %define variable names and %code qualifiers.
7017 * data/bison.m4 (b4_check_user_names): Check for special
7018 "SKELETON-NAMESPACE(name)" macros instead of using two nested
7019 m4_foreach loops.
7020 (b4_get_percent_define, b4_get_percent_code): Rename to...
7021 (b4_percent_define_get, b4_percent_code_get): ... these.
7022 Extend documentation with examples.
7023 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
7024 b4_percent_define_skeleton_variables and
7025 b4_percent_code_skeleton_qualifiers.
7026 Expect any value for the %define variable `foo' to be stored in the
7027 macro named `b4_percent_define(foo)'; expect any %code blocks for the
7028 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
7029 expect any unqualified %code blocks to be stored in a macro named
7030 `b4_percent_code_unqualified'.
7031 Use m4_indir so that %define variable names and %code qualifiers can
7032 contain `.', which is allowed by the grammar parser.
7033 (b4_percent_define_default): New macro to set a default value for a
7034 %define variable.
7035 (m4_wrap): Update wrapped code, and fix some underquoting.
7036 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
7037 Expect grammar uses of %define variables and %code qualifiers to be
7038 defined in b4_percent_define_user_variables and
7039 b4_percent_code_user_qualifiers.
7040 * data/c++.m4: Use b4_percent_define_default rather than
7041 m4_define_default. Fix some underquoting. Skeleton usage of %define
7042 variable define_location_comparison now implies skeleton usage of
7043 %define variable filename_type.
7044 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7045 data/push.c, data/yacc.c: Update macro names.
7046 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
7047 muscle names.
7048
e37c665c
JMG
70492007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7050
7051 DJGPP specific issues.
7052
7053 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
7054 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
7055
7d2d521f
JD
70562007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7057
7058 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
7059 run parsers in all tests so that Valgrind is invoked during
7060 maintainer-check-valgrind.
7061 (Duplicate representation of merged trees): Free all semantic values.
7062 (Duplicated user destructor for lookahead): Likewise.
7063
e0ac9b4b
JD
70642007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7065
7066 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
7067 command-line prefix.
7068 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
7069 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
7070 miss Valgrind messages.
7071 (Exploding the Stack Size with Malloc): Likewise.
7072
78143faa
JD
70732007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7074
7075 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
7076 locals. Reported by Juan Manuel Guerrero at
7077 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
7078 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
7079 Fix some indentation also.
7080 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
7081 explaining this issue.
7082
7ecec4dd
JD
70832007-01-09 Paolo Bonzini <bonzini@gnu.org>
7084 and Joel E. Denny <jdenny@ces.clemson.edu>
7085
7086 Simplify union and prologue handling, and escape union and lex/parse
7087 params with digraphs.
7088 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
7089 values to the empty string since these are no longer guaranteed
7090 initialized by the front-end.
7091 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
7092 braces around b4_user_stype since this is no longer done by the
7093 front-end.
7094 * src/files.c, src/files.h (pre_prologue_obstack,
7095 post_prologue_obstack): Remove.
7096 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
7097 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
7098 with digraphs. This fixes lex params and parse params.
7099 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
7100 * src/output.c (prepare): Remove muscle insertion of the prologues.
7101 (output): Remove freeing of pre_prologue_obstack and
7102 post_prologue_obstack.
7103 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
7104 than prologue_augment for prologue parsing so you don't need prologue
7105 obstacks.
5c80250c
JD
7106 (grammar_declaration): For %union RHS, use `braceless' instead of
7107 "{...}" so that braces are already stripped and code is escaped with
7108 digraphs.
7ecec4dd
JD
7109 * src/reader.c (prologue_augment): Remove.
7110 (reader): Remove initialization of pre_prologue_obstack and
7111 post_prologue_obstack.
7112 * src/reader.h (prologue_augment): Remove.
7113
7114 * data/c.m4: Remove stray parenthesis.
7115
16dc6a9e
JD
71162007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7117
7118 Remove quotes from variables names in %define directives and from
7119 qualifiers in %code directives, and restrict the characters that are
7120 allowed in them to M4-friendly ones. For %define, continue to support
7121 the quoted form as a deprecated feature. Discussed starting at
7122 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
7123 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
7124 %code.
7125 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
7126 (Decl Summary): In %defines entry, update mention of `%code requires'
7127 and `%code provides'.
16dc6a9e
JD
7128 (C++ Location Values): Update %define uses.
7129 (Calc++ Parser Interface): Likewise.
7130 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 7131 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
7132 * src/parse-gram.y (prologue_declaration): For %define variables, use
7133 `variable' instead of `STRING'.
7134 (grammar_declaration): For %code qualifiers, use `ID' instead of
7135 `STRING'.
7136 (variable): New nonterminal that takes an `ID' or a `STRING'.
7137 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
7138 and %define uses.
7139 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
7140 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
7141 (%define errors): Update %define uses.
7142
e9813cd4
JD
71432007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7144
7145 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
7146 instead of muscle_insert for %define values so that M4-special
7147 characters are replaced with digraphs.
7148 * tests/input.at (%define errors): Extend to check weird values.
7149
6afc30cc
JD
71502007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7151
7152 Instead of having skeletons declare all valid %define variables and
7153 %code qualifiers, provide macros that retrieve the associated values
7154 and build these lists automatically. Thus Bison will now warn when a
7155 variable or qualifier is not used by the skeleton in the current
7156 invocation regardless of whether it might sometimes be used by that
7157 skeleton in other invocations. Also, move all %define value macros to
7158 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
7159 form, which is replaced by %code.
7160 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
7161 (b4_check_user_names): ... this, and change the series of valid name
7162 arguments to a single list argument for names used in the skeleton
7163 similar to the existing list argument for names used in the grammar.
7164 Warn instead of complaining.
7165 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
7166 values and %code code, to format %code code properly, and to build
7167 lists of all %define variables and %code qualifiers used in the
7168 skeleton: b4_skeleton_percent_define_variables and
7169 b4_skeleton_percent_code_qualifiers.
7170 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
7171 Remove, and...
7172 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
7173 the skeleton names lists can finish building first. In place of
7174 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
7175 expect the lists b4_user_percent_define_variables and
7176 b4_user_percent_code_qualifiers.
7177 * data/c++.m4: Where setting default values for b4_parser_class_name,
7178 b4_location_type, b4_filename_type, b4_namespace, and
7179 b4_define_location_comparison, update their names to the
7180 b4_percent_define_ namespace.
7181 * data/glr.c: Don't use b4_check_percent_define_variables and
7182 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
7183 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
7184 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 7185 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
7186 * data/location.cc: Use b4_get_percent_define.
7187 * data/push.c: Don't use b4_check_percent_define_variables and
7188 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
7189 * data/yacc.c: Likewise, and don't call m4_exit in
7190 b4_use_push_for_pull_if or m4_wrap code will never execute.
7191 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
7192 Rename to...
7193 (muscle_grow_user_name_list): ... this for consistency with the
7194 terminology used in bison.m4.
7195 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
7196 %define variable names, and rename muscle used_percent_define_variables
7197 to user_percent_define_variables.
7198 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
7199 user_percent_code_qualifiers.
7200 (content): Remove.
7201 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
7202 {CODE} form is no longer accepted.
7203 * tests/input.at (Reject bad %code qualifiers): Rename to...
7204 (Reject unused %code qualifiers): ... this, and update test output.
7205 (%define error): Update test output.
7206
7eb8a0bc
JD
72072007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
7208
7209 Check for unrecognized %define variables similar to checking for
7210 unrecognized %code qualifiers. Check for redefined %define variables.
7211 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
7212 generalizes...
7213 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
7214 (b4_check_percent_define_variables): New, also wraps it.
7215 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
7216 variables using b4_check_percent_define_variables.
7217 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
7218 all those exercised in the test suite and all those listed in the
7219 `Default values' section of c++.m4. Are there others?
7220 * data/push.c, data/yacc.c: Declare no valid %define variables.
7221 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
7222 similar to muscle_find, but it works even when the muscle stores a
7223 const value.
7224 (muscle_grow_used_name_list): New function for constructing the used
7225 name list muscles that b4_check_for_unrecognized_names requires.
7226 * src/parse-gram.y (prologue_declaration): Warn if a variable is
7227 %define'd more than once. Define the b4_used_percent_define_variables
7228 muscle with muscle_grow_used_name_list.
7229 (grammar_declaration): Abbreviate %code code with
7230 muscle_grow_used_name_list.
7231 * tests/input.at (%define errors): New.
7232
3fc65ead
JD
72332007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7234
7235 Provide warn_at, complain_at, and fatal_at function callbacks to the
7236 skeletons, and use this for %code qualifier complaints.
7237 * data/bison.m4 (b4_error_at): New, invoked by...
7238 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
7239 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
7240 @fatal_at(...@) directives.
7241 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
7242 qualifiers in b4_used_percent_code_qualifiers and to use
7243 b4_complain_at.
7244 * src/location.c, src/location.h (boundary_set_from_string): New global
7245 function.
7246 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
7247 function.
7248 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
7249 to b4_used_percent_code_qualifiers.
7250 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
7251 function.
7252 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
7253 (lineno): Rename to...
7254 (out_lineno): ... this so I don't misunderstand it again.
7255 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
7256 here; these newlines are in the input but not the output file.
7257 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
7258 (at_directive_perform): ... this new static function, and add handling
7259 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
7260 directives.
7261 * tests/input.at (Reject bad %code qualifiers): Update test output with
7262 locations and extend.
7263
7264 * tests/output.at (Output file name: [, Output file name: ]): Remove
7265 bogus comment about these tests failing.
7266
1c7b7e1d
JD
72672007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7268
7269 Clean up b4_check_percent_code_qualifiers a little.
7270 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
7271 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
7272 documentation and add examples.
7273 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
7274 qualifiers here.
7275
08af01c2
JD
72762007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7277
7278 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
7279 unreliable -- especially when they're hidden inside another macro.
7280 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
7281 data/c.m4: Remove m4_divert(-1).
7282 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7283 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
7284 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 7285 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
7286 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
7287 pushed and popped by m4sugar, should be first on the stack.
7288
7289 Provide warn, complain, and fatal function callbacks to the skeletons.
7290 This provides more flexibility than m4_fatal, improves the error
7291 message format, and captures messages for translation. Discussed
7292 starting at
7293 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
7294 * data/bison.m4 (b4_error): New, invoked by...
7295 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
7296 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
7297 directives. Because these M4 macros might be called when the current
7298 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
7299 the previous removal of uses of m4_divert, which caused trouble.
7300 (b4_check_percent_code_qualifiers): Use b4_complain instead of
7301 m4_fatal to report unrecognized %code qualifiers.
7302 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
7303 push parser requests.
7304 * data/glr.c: Use b4_complain instead of m4_fatal to report
7305 non-deterministic push parser requests.
7306 Update @output usage to @output(...@) form.
7307 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
7308 report missing %defines. Update @output usage to @output(...@) form.
7309 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
7310 @output(...@) form.
7311 * src/main.c (main): Invoke skel_scanner_free.
7312 * src/scan-skel.h (skel_scanner_free): Prototype new function.
7313 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
7314 obstack_for_string from flex-scanner.h.
7315 (YY_DECL): Use to declare skel_lex static.
7316 (decode_at_digraphs): Remove; now handled in the new
7317 SC_AT_DIRECTIVE_ARG start condition.
7318 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
7319 functions.
7320 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
7321 at_directive_argv): New static globals.
7322 (INITIAL): Use fail_for_invalid_at.
7323 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
7324 recognize the start of a generalized `@directive(...@)' form and
7325 start...
7326 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
7327 directive args (using the new obstack_for_string), to decode the
7328 contained @ diagraphs, and to perform the directive. It recognizes
7329 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
7330 @output(...@).
7331 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
7332 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
7333 `@,'.
7334 (scan_skel): Initialize obstack_for_string on the first call.
7335 (skel_scanner_free): New function to free obstack_for_string.
7336 * tests/input.at (Reject bad %code qualifiers): Update test output.
7337
8e0a5e9e
JD
73382007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
7339
7340 Consolidate the 4 prologue alternative directives (%code, %requires,
7341 %provides, and %code-top) into a single %code directive with an
7342 optional qualifier field. Discussed at
7343 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
7344 * NEWS (2.3a+): Rewrite the existing entry for the prologue
7345 alternatives.
7346 * doc/bison.texinfo (Prologue Alternatives): Update.
7347 (Decl Summary): Update to %code "requires" and %code "provides".
7348 (Calc++ Parser): Update to %code "requires".
148d66d8 7349 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
7350 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
7351 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
7352 are replaced by b4_percent_code_provides and b4_percent_code_requires,
7353 which are skeleton-specific.
7354 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
7355 declare what %code qualifiers it supports and to complain if any other
7356 qualifiers were used in the grammar.
7357 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
7358 and b4_user_code([b4_percent_code_provides]) in place of
7359 b4_user_requires and b4_user_provides.
7360 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
7361 Add b4_user_code([b4_percent_code_top]) and
7362 b4_user_code([b4_percent_code]).
7363 Invoke b4_check_percent_code_qualifiers.
7364 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7365 PERCENT_REQUIRES): Remove.
7366 (grammar_declaration): Remove RHS's for %code-top, %provides, and
7367 %requires. Rewrite the %code RHS as the unqualified form defining the
7368 muscle b4_percent_code. Add another RHS for the qualified %code form,
7369 which defines muscles of the form b4_percent_code_QUALIFIER and the
7370 b4_used_percent_code_qualifiers muscle.
7371 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7372 PERCENT_REQUIRES): Remove.
7373 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
7374 %code "requires" and %code "provides".
7375 * tests/input.at (Reject bad %code qualifiers): New.
7376
95021767
JD
73772007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7378
7379 Use the new code_props interface for destructors and printers.
7380 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
7381 printer_location members, and change the type of the destructor and
7382 printer members to code_props.
7383 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
7384 symbol_printer_get, semantic_type_destructor_set,
7385 semantic_type_printer_set, default_tagged_destructor_set,
7386 default_tagless_destructor_set, default_tagged_printer_set,
7387 default_tagless_printer_set): Use code_props in arguments and return
7388 types in place of char const * and location.
7389 (symbol_destructor_location_get, symbol_printer_location_get): Remove
7390 since the locations are now contained in the return of
7391 symbol_destructor_get and symbol_printer_get.
7392 * src/output.c (symbol_destructors_output, symbol_printers_output):
7393 Replace with...
7394 (symbol_code_props_output): ... this to eliminate duplicate code.
7395 (output_skeleton): Update to use symbol_code_props_output.
7396 * src/reader.c (symbol_should_be_used): Update use of
7397 symbol_destructor_get.
7398 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7399 Update uses of the various _destructor_set and _printer_set functions.
7400 * src/symtab.c: (default_tagged_destructor_location,
7401 default_tagless_destructor_location, default_tagged_printer_location,
7402 default_tagless_printer_location): Remove since we...
7403 (default_tagged_destructor, default_tagless_destructor,
7404 default_tagged_printer, default_tagless_printer): ... change the type
7405 of these to code_props.
7406 (symbol_new, semantic_type_new, symbol_destructor_set,
7407 semantic_type_destructor_set, symbol_destructor_get,
7408 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
7409 symbol_check_alias_consistency, default_tagged_destructor_set,
7410 default_tagless_destructor_set, default_tagged_printer_set,
7411 default_tagless_printer_set): Update.
7412 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
7413 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
7414 code_props members.
7415 (symbol_print): Use SYMBOL_CODE_PRINT.
7416
f6857bbf
JD
74172007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7418
7419 Use the new code_props interface for rule actions.
7420 * src/symlist.h (symbol_list): Replace action, action_location, and
7421 used members with a code_props action_props member.
7422 * src/reader.c (symbol_should_be_used, grammar_rule_check,
7423 grammar_midrule_action, grammar_current_rule_merge_set,
7424 grammar_current_rule_symbol_append, packgram): Update.
7425 * src/scan-code.h (translate_rule_action): Remove, no longer used.
7426 * src/scan-code.l (handle_action_dollar): Update.
7427 (translate_rule_action): Remove, no longer used.
7428 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
7429
7c0c6181
JD
74302007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7431
7432 Use the new code_props interface in parse-gram.y.
7433 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
7434 Update all uses of translate_* functions to use the new code_props
7435 interface and to use gram_scanner_last_string_free and
7436 code_scanner_last_string_free where possible.
7437 (grammar_declaration): symbol_list_destructor_set and
7438 symbol_list_printer_set now perform the translation, so don't do it
7439 here. Use gram_scanner_last_string_free where possible.
7440 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
7441 translate_code): Remove, no longer used.
7442 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
7443 symbol_list_printer_set): Perform code translation here rather than
7444 depending on the caller to do so.
7445
7446 * src/symlist.h (struct symbol_list): Correct some documentation typos.
7447 * src/scan-gram.h (gram_last_string): Remove declaration.
7448 * src/scan-gram.l (last_string): Declare it static.
7449
28e52c0d
JD
74502007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7451
7452 Encapsulate code properties and related functionality for the various
7453 destructors, printers, and actions into a code_props structure and
7454 interface. This patch merely implements code_props in scan-code.h and
7455 scan-code.l. Future patches will rewrite other modules to use it.
7456 Discussed starting at
7457 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
7458 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
7459 consistently initialize const structs that have an empty location
7460 field.
7461 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
7462 to ensure consistency.
7463 * src/scan-code.h (code_props): New structure.
7464 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
7465 function, macro, and const global variable for initializing a
7466 code_props with no code.
7467 (code_props_plain_init, code_props_symbol_action_init,
7468 code_props_rule_action_init, code_props_translate_code): The rest of
7469 the new code_props functional interface. Among other things, the init
7470 functions set the code_props kind field so that
7471 code_props_translate_code will know whether to behave like
7472 translate_symbol_action, translate_rule_action, or translate_code.
7473 These old translate functions must remain until all other modules are
7474 updated to use the new code_props interface.
7475 (code_scanner_last_string_free): New function similar to
7476 gram_scanner_last_string_free.
7477 (code_scanner_free): Add documentation.
7478 * src/scan-code.l: Implement the new interface.
7479 (code_lex): Make it static, add a code_props* argument, and remove the
7480 rule argument.
7481 (last_string): New static global similar to the one in scan-gram.l.
7482 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
7483 instead of rule.
7484 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
7485 code_props since Bison may one day use this information for destructors
7486 and printers.
7487 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
7488 (handle_action_dollar): Use symbol_list_n_get and set used flag
7489 directly since symbol_list_n_used_set is removed.
7490 (translate_action): Add a code_props* argument and remove the rule,
7491 action, and location arguments. Pass the code_props* on to code_lex.
7492 (translate_rule_action, translate_symbol_action, translate_code):
7493 Rewrite as wrappers around the new code_props interface.
7494 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
7495 it would eventually need to break the encapsulation of code_props.
7496
96034983
JD
74972007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7498
7499 * etc/.cvsignore: New.
7500
945e396c
JD
75012007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7502
7503 Add maintainer-push-check to run maintainer-check using push parsing in
7504 place of pull parsing where available.
7505 * Makefile.am (maintainer-push-check): New.
7506 * data/bison.m4 (b4_use_push_for_pull_if): New.
7507 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
7508 appropriately based on their existing values.
7509 (yypush_parse): Don't print push-parser-specific diagnostics if push
7510 parsing is being used in place of pull parsing.
7511 * data/yacc.c: If push parsing should replace pull parsing, redirect to
7512 push.c.
7513 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
7514 variable, and insert b4_use_push_for_pull_flag into muscles.
7515 * tests/Makefile.am (maintainer-push-check): New.
7516
7d596384
JD
75172006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7518
7519 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
7520 (whether successful or failed) so that yypush_parse can be invoked
7521 again to start a new parse using the same yypstate.
7522 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
7523 check multiple yypull_parse invocations on the same yypstate. For pull
7524 mode, extend to check multiple yyparse invocations.
7525 (Exploding the Stack Size with Alloca): Extend to try with
7526 %push-pull-parser.
7527 (Exploding the Stack Size with Malloc): Likewise.
7528
7529 * tests/calc.at (Simple LALR Calculator): Don't specify
7530 %skeleton "push.c" since %push-pull-parser implies that now.
7531 * tests/headers.at (export YYLTYPE): Don't check for the push
7532 declarations. Otherwise, this test case can't be used to see if push
7533 mode can truly emulate pull mode.
7534 * tests/input.at (Torturing the Scanner): Likewise.
7535 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
7536 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
7537 AT_YACC_IF, which now includes the case of push mode since %skeleton
7538 need not be used for push mode. This will be more intuitive once
7539 push.c is renamed to yacc.c.
7540
7172e23e
JD
75412006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7542
7543 For push mode, convert yyparse from a macro to a function, invoke yylex
7544 instead of passing a yylexp argument to yypull_parse, and don't
7545 generate yypull_parse or yyparse unless %push-pull-parser is declared.
7546 Discussed starting at
7547 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
7548 * data/bison.m4 (b4_pull_if): New.
7549 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
7550 * data/push.c: Improve M4 quoting a little.
7551 (b4_generate_macro_args, b4_parenthesize): Remove.
7552 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
7553 any time a pull parser is requested.
7554 Don't #define this as a wrapper around yypull_parse. Instead, when
7555 both push and pull are requested, make it a function that does that
7556 same thing.
7557 (yypull_parse): If there's a b4_prefix, #define this to
7558 b4_prefix[pull_parse] when both push and pull are requested.
7559 Don't define this as a function unless both push and pull are
7560 requested.
7561 Remove the yylexp argument and hard-code yylex invocation instead.
7562 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
7563 %push-parser.
7564 * src/getargs.c (pull_parser): New global initialized to true.
7565 * getargs.h (pull_parser): extern it.
7566 * src/output.c (prepare): Insert pull_flag muscle.
7567 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
7568 (prologue_declaration): Set both push_parser and pull_parser = true for
7569 %push-pull-parser. Set push_parser = true and pull_parser = false for
7570 %push-parser.
7571 * src/scan-gram.l: Don't accept %push_parser as an alternative to
7572 %push-parser since there's no backward-compatibility concern here.
7573 Scan %push-pull-parser.
7574 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
7575 instead of %push-parser.
7576 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
7577 prototype it in the module that calls yyparse.
7578 * tests/input.at (Torturing the Scanner): Likewise.
7579 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
7580
2e7944cb
JD
75812006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
7582
7583 Update etc/bench.pl. Optimize push mode a little (the yyn change
7584 deserves most of the credit).
7585 * Makefile.am (SUBDIRS): Add etc subdirectory.
7586 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
7587 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
7588 yytoken, yyval, and yyloc declarations to...
7589 (yyparse or yypush_parse): ... here to improve performance. For
7590 yypush_parse invocations after the first, be sure to assign yyn its old
7591 value again.
7592 (yypstate_new): Don't bother initializing the yyresult field since the
7593 initial value isn't used.
7594 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
7595 remove the #define that, in push mode, set it to yyps->NAME.
7596 * etc/Makefile.am: New.
7597 * etc/bench.pl: Remove and build it instead from...
7598 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
7599 "tests/bison" from the build directory by default rather than just
7600 invoking "bison" from $PATH.
7601 (calc_grammar): Update push parser code: don't declare yylval globally,
7602 don't define yyparse_wrapper, and don't #define yyparse.
7603 (bench_grammar): Update to check all working combinations of yacc.c,
7604 push.c, impure, pure, pull, and push.
7605
c3d50342
JD
76062006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7607
7608 For push mode, add pull wrappers around yypush_parse.
7609 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
7610 (yypull_parse): New function wrapping yypush_parse.
7611 (yyparse): New #define wrapping yypull_parse.
7612 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
7613 is declared.
7614 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
7615 prototype yylex in the module that calls yyparse, and don't prototype
7616 yyparse there. Otherwise, the yyparse expansion won't compile.
7617 * tests/input.at (Torturing the Scanner): Likewise.
7618
94ebeba5
JD
76192006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7620
7621 Enable push parsers to operate in impure mode. Thus, %push-parser no
7622 longer implies %pure-parser. The point of this change is to move
7623 towards being able to test the push parser code by running the entire
7624 test suite as if %push-parser had been declared.
7625 * data/push.c (yypush_parse): For impure mode, remove the
7626 yypushed_char, yypushed_val, and yypushed_loc arguments.
7627 Instead, declare these as local variables initialized to the global
7628 yychar, yylval, and yylloc.
7629 For the first yypush_parse invocation only, restore the initial values
7630 of these global variables when it's time to read a token since they
7631 have been overwritten.
7632 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
7633 %push-parser.
7634 * tests/calc.at (Simple LALR(1) Calculator): Always declare
7635 %pure-parser along with %push-parser since this test case was designed
7636 for pure push parsers.
7637 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
7638 (AT_YACC_OR_PUSH_IF): New.
7639 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
7640 add a note that it's still wrong for some cases (as it has been for a
7641 while).
7642 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
7643 %push-parser no longer implies %pure-parser.
7644
a0633178
JD
76452006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7646
7647 Remove some unnecessary differences between the pull parser code and
7648 the push parser code. This patch enables yynerrs in push mode.
7649 * data/push.c: Reformat M4 a little.
7650 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
7651 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
7652 because push mode is on. Instead, if pure mode is on, move yynerrs
7653 to...
7654 (b4_declare_parser_state_variables): ... here.
7655 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
7656 to yyps->NAME so it can be used in yypush_parse.
7657 (yypush_parse): Don't omit uses of yynerrs in push mode.
7658
8646b6a3
JD
76592006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7660
7661 Fix bug such that the first pushed token's value and location are
7662 sometimes overwritten (sometimes by %initial-action) before being used.
7663 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
7664 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
7665 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
7666 more closely mimic the pull parser logic.
7667 Don't copy the pushed token to yychar, yylval, and yylloc until it's
7668 time to read a token, which is after any initialization of yylval and
7669 yylloc.
7670 (gottoken): Rename label to...
7671 (yyread_pushed_token): ... for clarity and to avoid infringing on the
7672 user namespace.
7673
9baf4d74
JD
76742006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7675
7676 Rearrange initialization of the parser state variables so that the
7677 skeleton doesn't have to have a copy for pull mode and another for push
7678 mode. This patch also fixes at least a bug such that yylloc was not
7679 initialized (with b4_location_initial_line and
7680 b4_location_initial_column) upon calling yypush_parse. However, that
7681 initialization now overwrites the first token's location;
7682 %initial-action assigning @$ already did the same thing, and both bugs
7683 will be fixed in a later patch.
7684 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
7685 (b4_declare_parser_state_variables): Remove initialization of yytoken,
7686 yyss, yyvs, yyls, and yystacksize.
7687 (yypstate_new): Remove initialization of some yypstate fields: yystate,
7688 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
7689 yylsp.
7690 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
7691 yyps->NAME so it can be used in yypush_parse.
7692 (yyparse or yypush_parse): For yypush_parse, don't print the
7693 "Starting parse" diagnostic for invocations after the first.
7694 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
7695 yypush_parse, only do it for the first invocation.
7696 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
7697 initialization to occur in yypush_parse but only on the first
7698 invocation.
7699
23522164
JD
77002006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7701
7702 * data/push.c: Add CPP guards around push parser declarations in both
7703 the header and the code file.
7704 In the code file, move the push parser declarations to the same place
7705 they appear in the header file.
7706 Clean up the M4 some, especially the inconsistent underquoting in
7707 some b4_c_function_def and b4_c_function_decl uses.
7708
bb010fe5
JD
77092006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7710
7711 Encapsulate the push parser state variables into an M4 macro so the
7712 push skeleton doesn't have to list them again for pull mode's yyparse.
7713 For push mode, remove yypush_parse's local equivalents of these
7714 variables to eliminate unnecessary copying between the two sets at
7715 run-time. This patch also fixes at least a bug related to multiple
7716 %initial-action invocations in push mode.
7717 * data/push.c (b4_declare_parser_variables): Rename to...
7718 (b4_declare_scanner_communication_variables): ... this for clarity and
7719 update both uses.
7720 (b4_declare_yyparse_variables): Remove and move its contents to the one
7721 spot where it was invoked.
7722 (b4_declare_parser_state_variables): New macro containing the parser
7723 state variables required by push mode.
7724 (struct yypstate): Replace all fields but yynew with
7725 b4_declare_parser_state_variables.
7726 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
7727 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
7728 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
7729 (yyparse or yypush_parse): For yyparse in pull mode, replace local
7730 parser state variable declarations with
7731 b4_declare_parser_state_variables.
7732 Don't initialize parser state variables when calling yypush_parse since
7733 yypstate_new already does that.
7734 Invoke the user's initial action only upon the first yypush_parse
7735 invocation.
7736 Remove all code that copies between the local parser state variables
7737 and the yypstate.
7738
2d212f8c
JD
77392006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7740
7741 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
7742 prevent a name collision in a future patch where these names will
7743 sometimes be #define'd.
7744 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
7745 since it no longer has the same name as the existing argument.
7746 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
7747
e6e704dc
JD
77482006-12-19 Paolo Bonzini <bonzini@gnu.org>
7749 and Joel E. Denny <jdenny@ces.clemson.edu>
7750
7751 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
7752 that the argument is case-insensitive, and there's no `=' here.
7753 For the %skeleton entry, mention that %language is better.
7754 (Bison Options): Likewise for --language and --skeleton. Move the
7755 --skeleton entry so that the `Tuning the parser' section is sorted
7756 alphabetically on long options.
7757 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
7758 %language directive in detail here; cross-reference the %language
7759 documentation instead.
7760 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
7761 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 7762 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
7763 * examples/extexi (normalize): Instead of replacing every %require
7764 argument with the current Bison version, just substitute for
7765 `@value{VERSION}'. This guarantees that we're testing what actually
7766 appears in the documentation.
7767 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
7768 rather than `@VERSION@'.
7769
0e021770
PE
77702006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7771
fd575f05
PE
7772 * NEWS: Reword the %language news a bit, and put it earlier.
7773
0e021770
PE
7774 * src/getargs.c (skeleton_arg): Last arg is now location const *.
7775 Rewrite to simplify the logic.
7776 (language_argmatch): Likewise.
fd575f05
PE
7777 (program_name): We now own this var.
7778 * src/getargs.h (struct bison_language): Use char[] rather than
7779 const char *.
0e021770
PE
7780
7781 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
7782 Java is supported.
7783 * src/complain.c (program_name): Remove decl; no longer needed.
7784 * src/main.c (program_name): Remove; now belongs to getargs.
7785
77862006-12-18 Paolo Bonzini <bonzini@gnu.org>
7787
7788 * NEWS: Document %language.
7789
7790 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
7791
7792 * data/c-skel.m4, data/c++-skel.m4: New files.
7793 * data/glr.c: Complain on push parsers.
7794
7795 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
7796 over %skeleton.
148d66d8 7797 (Decl Summary): Document %language and %skeleton.
0e021770
PE
7798 (Command line): Document -L.
7799
7800 * examples/extexi: Rewrite %require directive.
7801 * examples/calc++/Makefile.am: Pass VERSION to extexi.
7802
7803 * src/files.c (compute_exts_from_gc): Look in language structure
7804 for .y extension.
7805 (compute_file_name_parts): Check whether .tab should be added.
7806 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
7807 (language, skeleton_arg, language_argmatch): New.
7808 (long_options): Add --language.
7809 (getargs): Use skeleton_arg, add -L/--language.
7810 * src/getargs.h: Include location.h.
7811 (struct bison_language, language, skeleton_arg, language_argmatch): New.
7812 * src/output.c (prepare): Pick default skeleton from struct language.
7813 Don't dispatch C skeletons here.
7814 * src/parse-gram.y (PERCENT_LANGUAGE): New.
7815 (prologue_declaration): Add "%language" rule, use skeleton_arg.
7816 * src/scan-gram.l ("%language"): New rule.
7817
7818 * tests/calc.at: Test %skeleton and %language.
7819 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
7820 (AT_GLR_IF): Look for %skeleton "glr.cc".
7821 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
7822 (AT_YACC_IF): Reject %language.
7823
5691bf57
PE
78242006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7825
db06f0ce
PE
7826 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
7827 since it wasn't used; only the typedef name 'semantic_type' is needed.
7828 Also, omit trailing white space.
7829
5691bf57
PE
7830 * bootstrap: Sync from coreutils.
7831 (gnulib_extra_files): Add build-aux/announce.gen.
7832 (slurp): Adjust .gitignore files like .cvsignore files.
7833 * build-aux/announce-gen: Remove from CVS, since bootstrap
7834 now creates this.
7835
791934e4
JD
78362006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
7837
7838 Make %push-parser imply %pure-parser. This fixes several bugs; see
7839 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
7840 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
7841 pure_parser = true.
7842 * data/push.c: Don't bother testing b4_push_if when deciding whether
7843 to expand b4_declare_parser_variables globally.
7844 (yypush_parse): Likewise in here.
7845
7846 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
7847 (yy_reduce_print): Reformat M4 for readability.
7848
ee5abb37
JD
78492006-12-15 Bob Rossi <bob@brasko.net>
7850 and Joel Denny <jdenny@ces.clemson.edu>
7851
7852 * data/push.c (yypstate): Add typedef, and update all uses of
7853 struct yypstate to just yypstate.
7854 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
7855
16ca01f9
JD
78562006-12-14 Bob Rossi <bob@brasko.net>
7857
7858 * data/push.c (yypush_parse): Declare prototype regardless of
7859 %locations option.
7860
ab8e7e1a
JD
78612006-12-14 Bob Rossi <bob@brasko.net>
7862
7863 * data/push.c (yyparse): Remove the prototype and the #define when in
7864 push-parser mode.
7865
9bf32be3
JD
78662006-12-13 Bob Rossi <bob@brasko.net>
7867
7868 * data/push.c (yypstate_init): Rename to...
7869 (yypstate_new): ... this and use b4_c_function_def.
7870 (yypstate_delete): New.
7871 (yypush_parse): Change parameters yynval and yynlloc to be const.
7872 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
7873 yypstate_delete functions.
7874
f02e2948
JD
78752006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
7876
7877 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
7878 strange test case titles. Reported by Bob Rossi.
7879
38eb7751
PE
78802006-12-13 Paul Eggert <eggert@cs.ucla.edu>
7881
7882 * TODO: Add pointer to Sylvain Schmitz's work on static detection
7883 of potential ambiguities in GLR grammers.
7884
bd9d212b
JD
78852006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
7886
7887 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
7888 `bison ', use m4_index instead of m4_substr since chopping up a string
7889 containing M4-special characters causes problems here.
7890
7891 Fix a couple of bugs related to special characters in user-specified
7892 file names, and make it easier for skeletons to compute output file
7893 names with the same file name prefix as Bison-computed output file
7894 names.
7895 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
7896 b4_parser_file_name and b4_spec_defines_file instead of
7897 @output_parser_name@ and @output_header_name@, which are now redundant.
7898 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
7899 b4_parser_file_name, b4_spec_defines_file, and the new
7900 @basename(FILENAME@) instead of @output_parser_name@ and
7901 @output_header_name@, which inappropriately escaped the file names as
7902 C string literals.
7903 * src/files.c (all_but_ext): Remove static qualifier.
7904 (compute_output_file_names): Move `free (all_but_ext)' to...
7905 (output_file_names_free): ... here since all_but_ext is needed later.
7906 * src/files.h (all_but_ext): Extern.
7907 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
7908 exactly what MUSCLE_INSERT_STRING used to do.
7909 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
7910 characters are escaped properly.
7911 * src/output.c (prepare): Define muscle file_name_all_but_ext as
7912 all_but_ext.
7913 For pkgdatadir muscle, maintain previous functionality by using
7914 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
7915 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
7916 digraphs would never be expanded. Hopefully no one has M4-special
7917 characters in his Bison installation path.
7918 * src/scan-skel.l: Don't parse @output_header_name@ and
7919 @output_parser_name@ anymore since they're now redundant.
7920 In @output, use decode_at_digraphs.
7921 Parse a new @basename command that invokes last_component.
7922 (decode_at_digraphs): New.
7923 (BASE_QPUTS): Remove unused.
7924 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
7925 (Output file name): New tests.
7926
3f7ca628
JD
79272006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
7928
7929 Warn about output files that are generated by the skeletons and that
7930 conflict with other output files.
7931 * data/glr.c: Don't generate the header file here when glr.cc does.
7932 * src/files.c (file_names, file_names_count): New static globals.
7933 (compute_output_file_names): Invoke output_file_name_check for files
7934 not generated by the skeletons and remove existing checks.
7935 (output_file_name_check): New function that warns about conflicting
7936 output file names.
7937 (output_file_names_free): Free file_names.
7938 * src/files.h (output_file_name_check): Declare.
7939 * src/scan-skel.l: Invoke output_file_name_check for files generated by
7940 the skeletons.
7941 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
7942 (Conflicting output files): New tests.
7943
178e123e
PE
79442006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7945
7946 * doc/bison.texinfo: Fix a couple of typos.
7947
79482006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
7949
7950 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
7951 Rename to...
7952 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
7953 update all uses.
7954 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
7955 (yypush_parse): Rename yypvars argument to yyps and remove redundant
7956 local pv.
7957 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
7958 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
7959
ea17f233
JD
79602006-12-07 Bob Rossi <bob@brasko.net>
7961 and Joel Denny <jdenny@ces.clemson.edu>
7962
7963 * data/push.c (yypvarsinit): Change return type from void* to struct
7964 yypvars*. No longer cast to void* on return.
7965 (struct yypvars): Remove yylen since it need not be remembered between
7966 yypushparse invocations.
7967 (yypushparse): Don't copy between yylen and pv->yylen.
7968
55a30bda
JD
79692006-12-05 Bob Rossi <bob@brasko.net>
7970
7971 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
7972 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
7973 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
7974 (struct yypvars): Remove b4_declare_parser_variables.
7975 (yypvarsinit): Remove init code for removed variables.
7976 (global scope): Do not declare b4_declare_parser_variables if
7977 push or pure mode.
7978 (yypushparse): Add b4_declare_parser_variables.
7979 Init new local variables, and remove init code for removed
7980 yypvars variables.
7981 (yyparse): Delete.
7982 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
7983 and yyparse for other modes.
7984 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
7985 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
7986 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
7987 (AT_PURE_LEX_IF): True if pure or push parser.
7988
85894313
JD
79892006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
7990
7991 Document Yacc prologue alternatives and default %destructor's and
7992 %printer's as experimental. Don't mention Java yet. Discussed at
7993 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
7994 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
7995 (2.3a): Annotate this entry to say the old forms of these features were
7996 also experimental.
7997 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 7998 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
7999 of Java (we'll want this back eventually).
8000
02975b9a
JD
80012006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
8002
8003 Support a file name argument to %defines. Deprecate `=' in
8004 %file-prefix, %name-prefix, and %output. Discussed at
8005 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
8006 * NEWS (2.3a+): Mention.
148d66d8 8007 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
8008 form of %defines, and remove `=' from entries for %file-prefix,
8009 %name-prefix, and %output.
8010 * src/parse-gram.y (prologue_declaration): Implement.
8011 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
8012 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
8013 all but one occurrence of %name-prefix.
8014 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
8015 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
8016 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
8017 occurrence of each of %file-prefix and %output. Add check for %defines
8018 with argument.
8019 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
8020 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
8021 Remove the `=' from %output.
8022
287b314e
JD
80232006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
8024
8025 Don't escape $ in test case titles since Autoconf 2.61 now does that
8026 correctly.
8027 * tests/actions.at (Default %printer and %destructor are not for error
8028 or $undefined): Here.
8029 (Default %printer and %destructor are not for $accept): Here.
8030 * tests/input.at (Invalid $n and @n): Here.
8031
3ebecc24
JD
80322006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
8033
8034 Rename <!> to <>. Discussed starting at
8035 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
8036 * NEWS (2.3a+): Update.
148d66d8 8037 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
8038 Update.
8039 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
8040 * src/scan-gram.l (INITIAL): Implement.
8041 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
8042 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
8043 comment.
8044 * tests/actions.at (Default tagless %printer and %destructor,
8045 Default tagged and per-type %printer and %destructor,
8046 Default %printer and %destructor are not for error or $undefined,
8047 Default %printer and %destructor are not for $accept,
8048 Default %printer and %destructor for mid-rule values): Update.
8049 * tests/input.at (Default %printer and %destructor redeclared,
8050 Unused values with default %destructor): Update.
8051
26b8a438
JD
80522006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
8053
8054 Don't let %prec take a nonterminal.
8055 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
8056 token.
8057 * tests/input.at (%prec takes a token): New test checking that %prec
8058 won't take a nonterminal.
8059
07c39ae9
JD
80602006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
8061
405d53b7
JD
8062 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
8063 it was double-quoted.
07c39ae9
JD
8064 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
8065 grammar is maintained with Bison's highest standards.
8066 * src/getargs.c: Fix some typos in Doxygen comments.
8067
580b8926
JD
80682006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
8069
8070 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
8071 later. Reported by Paul Eggert in
8072 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
8073 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
8074 * src/scan-code.l (translate_action): Don't bother invoking
8075 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
8076 (code_scanner_free): Instead of invoking
8077 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
8078 which frees more.
8079 * src/scan-gram.l (gram_scanner_free): Likewise.
8080 * src/scan-skel.l (scan_skel): Likewise.
8081
4502eadc
JD
80822006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
8083
8084 * src/files.c (tr): Change return type to void.
8085 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
8086 has been called previously for the same key.
8087 (muscle_find): Return storage instead of value so that
8088 --enable-gcc-warnings doesn't produce warnings that the return discards
8089 const. aver that the value and storage are the same since storage
8090 could potentially be NULL when value is not.
8091 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
8092 same as 0.
8093
7746c8f6
PE
80942006-11-08 Paul Eggert <eggert@cs.ucla.edu>
8095
8096 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
8097 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
8098 us a slightly cleaner distribution, and also works.
8099 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
8100 gnulib changes.
8101
eb095650
PE
81022006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
8103 and Paul Eggert <eggert@cs.ucla.edu>
8104
8105 Don't let Bison leak memory except when it complains.
8106 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
8107 (spec_defines_file, dir_prefix): Now char *, not const char *,
8108 since they are freed.
8109 * src/files.c: Likewise.
8110 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
8111 Likewise.
8112 (tr): Now operates in-place. All uses changed.
8113 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
8114 values.
8115 (compute_file_name_parts, compute_output_file_names): Don't store
8116 read-only data in variables that will be freed.
8117 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
8118 src_extension, and header_extension.
8119 (output_file_names_free): New public function to free
8120 spec_verbose_file, spec_graph_file, spec_defines_file,
8121 parser_file_name, and dir_prefix.
8122 * src/getargs.c (getargs): Don't store read-only data in variables that
8123 will be freed.
8124 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
8125 (which previously existed but was unused), and quotearg_free.
8126 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
8127 * src/muscle_tab.c: Likewise.
8128 (muscle_entry): Make the value char const *,
8129 and add a new storage member that is char * and can be freed.
8130 (muscle_entry_free): New private function.
8131 (muscle_init): Use it instead of free.
8132 (muscle_insert, muscle_grow): Update and use new storage member.
8133 (muscle_code_grow): Free the string passed to muscle_grow
8134 since it's not needed anymore.
8135 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
8136 add a new `char *code' member.
8137 ("{...}"): Declare semantic type as code.
8138 * src/scan-code.h (translate_rule_action):
8139 (translate_symbol_action, translate_code, translate_action): Return
8140 `char const *' rather than `char *' since external code should not free
8141 these strings.
8142 * src/scan-code.l: Likewise.
8143 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
8144 which is "{...}" in the parser.
8145 * tests/Makefile.am (maintainer-check-valgrind): Set
8146 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
8147 Valgrind.
8148 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
8149 complain.
8150 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
8151 expecting a non-zero exit status sets --leak-check=summary and
8152 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
8153 this case, and we don't want to hear about it.
8154
ac564be4
PE
81552006-11-08 Paul Eggert <eggert@cs.ucla.edu>
8156
8157 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
8158 instead of from the template, to simplify configuration a bit.
8159 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
8160 and m4/wint_t.m4, as they are needed with the latest gnulib.
8161
17bd8a73
JD
81622006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8163
8164 Disable unset/unused mid-rule value warnings by default, and recognize
8165 --warnings=midrule-values to enable them. Discussed starting at
8166 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
8167 * NEWS (2.3a+): Mention.
8168 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
8169 warnings): Add entry for midrule-values subargument.
8170 * src/reader.c (symbol_should_be_used): Don't return true just because
8171 the value is a set/used mid-rule value unless
8172 --warnings=midrule-values was specified.
8173 * tests/input.at (Unused values, Unused values before symbol
8174 declarations): Run tests with and without --warnings=midrule-values.
8175
8176 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
8177 than LIST_FREE directly.
8178
89eb3c76
JD
81792006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8180
8181 Finish implementing --warnings=error, which should not be implied by
8182 --warnings=all (or by its synonyms -W and --warnings without
8183 subarguments).
8184 * src/complain.c (set_warning_issued): New function to report that
8185 warnings are being treated as errors and to record an error if so.
8186 Invoke...
8187 (warn_at, warn): ... here.
8188 * src/getargs.c (warnings_args, warnings_types): Reorder so that
8189 "error - warnings are errors" does not appear above "all - all of the
8190 above".
8191 (getargs): For -W and --warnings without subarguments, don't let
8192 FLAGS_ARGMATCH set warnings_error in warnings_flag.
8193 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
8194
ba7560e2
JD
81952006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8196
8197 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
8198 empty subargument list. For example: `bison --warnings= parser.y'.
8199
31283fc3
JD
82002006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8201
8202 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
8203 the parser header file so that gcc doesn't warn.
8204
12e35840
JD
82052006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8206
8207 Split the default %destructor/%printer into two kinds: <*> and <!>.
8208 Discussed starting at
8209 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
8210 * NEWS (2.3a+): Mention.
8211 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
8212 previous change today related to mid-rules.
148d66d8 8213 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 8214 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
8215 (TYPE_TAG_ANY): Add as <*>.
8216 (TYPE_TAG_NONE): Add as <!>.
8217 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
8218 for <*> and <!>.
8219 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
8220 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
8221 * src/symlist.c (symbol_list_default_new): Split into tagged and
8222 tagless versions.
8223 (symbol_list_destructor_set, symbol_list_printer_set): Split
8224 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
8225 SYMLIST_DEFAULT_TAGLESS.
8226 * src/symlist.h: Update symbol_list_default*_new prototypes.
8227 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
8228 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
8229 * src/symtab.c (default_destructor, default_destructor_location,
8230 default_printer, default_printer_location): Split each into tagged and
8231 tagless versions.
8232 (symbol_destructor_get, symbol_destructor_location_get,
8233 symbol_printer_get, symbol_printer_location_get): Implement tagged
8234 default and tagless default cases.
8235 (default_destructor_set, default_printer_set): Split each into tagged
8236 and tagless versions.
8237 * src/symtab.h: Update prototypes.
8238 * tests/actions.at (Default %printer and %destructor): Rename to...
8239 (Default tagless %printer and %destructor): ... this, and extend.
8240 (Per-type %printer and %destructor): Rename to...
8241 (Default tagged and per-type %printer and %destructor): ... this, and
8242 extend.
8243 (Default %printer and %destructor for user-defined end token): Extend.
8244 (Default %printer and %destructor are not for error or $undefined):
8245 Update.
8246 (Default %printer and %destructor are not for $accept): Update.
8247 (Default %printer and %destructor for mid-rule values): Extend.
8248 * tests/input.at (Default %printer and %destructor redeclared): Extend.
8249 (Unused values with default %destructor): Extend.
8250
f91b1629
JD
82512006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8252
8253 Don't apply the default %destructor/%printer to an unreferenced midrule
8254 value. Mentioned at
8255 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
8256 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
8257 like $@n instead of just @n so that the default %destructor/%printer
8258 logic doesn't see them as user-defined symbols.
8259 (symbol_is_dummy): Check for both forms of the name.
8260 * src/reader.c (packgram): Remove the `$' from each midrule symbol
8261 name for which the midrule value is referenced in any action.
8262 * tests/actions.at (Default %printer and %destructor for mid-rule
8263 values): New test.
8264 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
8265 for change to dummy symbol names.
8266
519d0004
JD
82672006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
8268
8269 Warn about unset midrule $$ if the corresponding $n is used.
8270 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
8271 $n usage.
8272 (packgram): Before invoking grammar_rule_check on any rule, make sure
8273 all actions have already been scanned in order to set `used' flags.
8274 Otherwise, checking that a midrule's $$ is set will not always work
8275 properly because the midrule check must forward-reference the midrule's
8276 parent rule.
8277 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
8278 warning.
8279
a501eca9
JD
82802006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
8281
8282 More improvements to the documentation of the prologue alternatives:
8283 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
8284 Bison manual.
8285 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
8286 some text to clarify the relative importance of the new directives and
8287 to show how these directives may be viewed as code labels.
8288
2cbe6b7f
JD
82892006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
8290
8291 Similar to the recently removed %before-header, add %code-top as the
8292 alternative to the pre-prologue. Mentioned at
8293 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
8294 Also, let the prologue alternatives appear in the grammar section.
8295 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
8296 (prologue_declaration): Move the existing prologue alternatives to...
8297 (grammar_declaration): ... here and add %code-top.
8298 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
8299
8300 Clean up and extend documentation for the prologue alternatives.
8301 * NEWS (2.3a+): Describe prologue alternatives.
8302 * doc/bison.texinfo (Prologue): Move discussion of prologue
8303 alternatives to...
8304 (Prologue Alternatives): ... this new section, and extend it to discuss
8305 all 4 directives in detail.
148d66d8
JD
8306 (Table of Symbols): Clean up discussion of prologue alternatives and
8307 add %code-top.
2cbe6b7f 8308
e557d3ea
JMG
83092006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8310
8311 DJGPP specific issues.
8312
8313 * djgpp/config.bat: config.hin has been moved to lib. Adjust
8314 config.bat accordingly.
8315 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
8316 * djgpp/config.site: Likewise.
8317
136a0f76
PB
83182006-10-16 Paolo Bonzini <bonzini@gnu.org>
8319
27bd5d67
PB
8320 Replace %*-header with %provides, %requires, %code. See discussion at
8321 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
8322
136a0f76
PB
8323 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
8324 (b4_user_start_header): Remove.
8325 * data/glr.c: Use new macros instead of b4_*start_header
8326 and b4_*end_header.
8327 * data/glr.cc: Likewise.
8328 * data/lalr1.cc: Likewise.
8329 * data/push.c: Likewise.
8330 * data/yacc.c: Likewise.
8331
8332 * doc/bison.texinfo: Remove %before-header, rename
8333 %{start,end,after}-header to %requires, %provides, %code.
8334
8335 * src/parse-gram.y: Likewise (also rename token names accordingly).
8336 * src/scan-gram.l: Likewise.
8337 * tests/actions.at: Likewise.
8338
10f429ef
PE
83392006-10-14 Paul Eggert <eggert@cs.ucla.edu>
8340
8341 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
8342 Problem reported by Joel E. Denny.
8343
83442006-10-14 Jim Meyering <jim@meyering.net>
8345
8346 (Sync from coreutils.)
8347 Work also when the working directory (with e.g. coreutils sources)
8348 is version controlled with git, rather than CVS.
8349 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
8350 rather than CVS.
8351 In messages and comments, say e.g., "checked-out sources",
8352 rather than "CVS sources".
8353 (version_controlled_file): New function. Work for git as well as
8354 for CVS. Don't use grep's -q option.
8355 (slurp): Call it here, in place of CVS-specific code.
8356
c4bd5bf7
JD
83572006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
8358
8359 Fix testsuite for ./configure --enable-gcc-warnings:
8360 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
8361 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
8362 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
8363 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
8364 * test/regression.at (Diagnostic that expects two alternatives):
8365 Likewise.
8366
46356ea4
PE
83672006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8368
231ed89a
PE
8369 * bootstrap.conf (gnulib_modules): Add config-h.
8370 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
8371 worry about HAVE_CONFIG_H.
8372 * lib/abitset.c: Likewise.
8373 * lib/bitset.c: Likewise.
8374 * lib/bitset_stats.c: Likewise.
8375 * lib/bitsetv-print.c: Likewise.
8376 * lib/bitsetv.c: Likewise.
8377 * lib/ebitset.c: Likewise.
8378 * lib/get-errno.c: Likewise.
8379 * lib/lbitset.c: Likewise.
8380 * lib/subpipe.c: Likewise.
8381 * lib/timevar.c: Likewise.
8382 * lib/vbitset.c: Likewise.
8383 * lib/bitset.c: Include "bitset.h" first, to test interface.
8384 * lib/bitset_stats.c: Include "bitset_stats.h" first.
8385 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
8386 * lib/bitsetv.c: Include "bitsetv.h" first.
8387 * lib/get-errno.c: Include "get-errno.h" first.
8388 * m4/.cvsignore: Add config-h.m4.
8389 * tests/actions.at (Default %printer and %destructor for ...):
8390 Adjust expected line numbers in output to reflect removal of #if
8391 HAVE_CONFIG_H lines.
8392 * tests/glr-regression.at (Missed %merge type warnings when ...):
8393 Likewise.
8394 * tests/regression.at (Braced code in declaration in rules section):
8395 Likewise.
8396 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
8397 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
8398 Include <config.h> unconditionally.
8399
46356ea4
PE
8400 * bootstrap: Sync from coreutils, as follows:
8401
8402 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8403
8404 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
8405 variable was sometimes used without being initialized. This
8406 messed up the installation of the INSTALL file in some cases.
8407
8408 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8409
8410 * bootstrap (usage, main program, symlink_to_gnulib): Add option
8411 --copy. Inspired by a suggestion from Bruno Haible.
8412
8413 2006-10-03 Jim Meyering <jim@meyering.net>
8414
8415 * bootstrap: Undo last change to this file, since now gnulib-tool
8416 sticks with the automake default in generating dependencies.
8417
dd4bf078
PE
84182006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8419
cf2a5f7c
PE
8420 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
8421 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
8422
8423 * doc/bison.1: Add copyright notice.
8424
8425 * data/glr.c: Don't include <stdarg.h>; not used.
8426
35fe0834
PE
8427 * NEWS: The -g and --graph options now output graphs in Graphviz
8428 DOT format, not VCG format.
8429 * doc/bison.1: Likewise.
8430 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
8431 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
8432 of this change in
8433 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
8434 * TODO: Remove Graphviz entry.
8435 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
8436 remove vcg.c, vcg.h, vcg_defaults.h.
8437 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
8438 * src/graphviz.c, src/graphviz.h: New files.
8439 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
8440 * src/files.h: Make comment more generic.
8441 * src/main.c (main): Likewise.
8442 * src/print_graph.h: Likewise.
8443 * src/getargs.c (usage): Make usage description more generic.
8444 * src/print_graph.c: Include graphviz.h rather than vcg.h.
8445 (static_graph, fgraph): Remove. All uses changed to pass
8446 arguments instead of sharing a static var.
8447 (print_core, print_actions, print_state, print_graph):
8448 Output graphviz format rather than VCG format.
8449 * tests/.cvsignore: Remove *.vcg; add *.dot.
8450 * tests/output.at: Expect *.dot files, not *.vcg files.
8451
dd4bf078
PE
8452 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
8453 accommodates the 2006-10-08 change.
8454
efdd7421
PE
84552006-10-11 Bob Rossi <bob@brasko.net>
8456
8457 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
8458 (b4_yyssa, b4_yyerror_range): New macros.
8459 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
8460 (yypvarsinit): Remove init of removed fields.
8461 (yypushparse): Remove use of removed fields; use new macros instead.
8462
96a1981a
PE
84632006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8464
8465 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
8466 in a push parser. Reindent slightly to match yacc.c better.
8467
84682006-10-11 Bob Rossi <bob@brasko.net>
8469
46356ea4
PE
8470 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
8471 yymsg_alloc fields.
8472 (yypvarsinit, yypushparse): Remove init of removed fields.
8473 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 8474
c1630a8b
PE
84752006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8476
8477 * THANKS: Add Paolo Bonzini and Bob Rossi.
8478
90b9908d
PB
84792006-10-08 Paolo Bonzini <bonzini@gnu.org>
8480
8481 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
8482 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
8483 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
8484 b4_define_user_cde and uses): Remove.
8485 (b4_comment, b4_prefix, b4_sync_start): New.
8486 * data/bison.m4: New file, with most of the content removed from c.m4.
8487 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
8488 * src/output.c (output_skeleton): Pass bison.m4.
8489 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
8490 only if specified.
8491
cf806753
PE
84922006-10-05 Paul Eggert <eggert@cs.ucla.edu>
8493
8494 Fix test failure reported by Tom Lane in
8495 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
8496 and try to make such failures easier to catch in the future.
8497 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
8498 that's now the caller's responsibility.
8499 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
8500 Set yychar = YYEOF if it's negative.
8501 * tests/actions.at (yylex): Abort if asked to read past EOF.
8502 * tests/conflicts.at (yylex): Likewise.
8503 * tests/cxx-type.at (yylex): Likewise.
8504 * tests/glr-regression.at (yylex): Likewise.
8505 * tests/input.at (yylex): Likewise.
8506 * tests/regression.at (yylex): Likewise.
8507 * tests/torture.at (yylex): Likewise.
8508
0e2f006a
PE
85092006-10-01 Paul Eggert <eggert@cs.ucla.edu>
8510
8511 Fix problems with translating English-language diagnostics.
8512 * bootstrap: Fix bug introduced in recent bootstrap changes, with
8513 respect to bison-runtime pot generation. The YY_ stuff
8514 wasn't being captured.
8515 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
8516 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
8517 * runtime-po/POTFILES.in: Add data/push.c.
8518
e3ddc1e3
PE
85192006-09-29 Paul Eggert <eggert@cs.ucla.edu>
8520
8521 Merge bootstrap changes from coreutils.
8522
8523 2006-09-28 Jim Meyering <jim@meyering.net>
8524
8525 Automatically generated dependencies are important even
8526 when all of the sources in a directory come from gnulib.
8527 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
8528 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
8529
8530 2006-09-23 Jim Meyering <jim@meyering.net>
8531
8532 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
8533
8534 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8535
8536 * bootstrap: Add support for --force.
8537 (usage): New function. Describe usage less tersely.
8538 (CVS_only_file): New var.
8539
01e972b3
PE
85402006-09-21 Paul Eggert <eggert@cs.ucla.edu>
8541
8542 * data/push.c (YYPUSH_MORE): Make it an enum instead.
8543 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
8544 Adjust white space and comments to match GNU style better.
8545
c63d3e90
PE
85462006-09-20 Bob Rossi <bob@brasko.net>
8547
8548 * data/push.c (yyresult_get): Remove function.
8549 (YYPUSH_MORE): Add #define.
8550 (yypushparse): Modify return value.
8551
e70f46d1
PE
85522006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8553
8554 * stamp-h.in: Remove; no longer needed.
8555 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
8556 Remove config.h, config.hin, intl (no longer created).
8557 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
8558 stamp-h1.
8559
8560 Sync bootstrap from coreutils, as follows:
8561
8562 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
8563
8564 * bootstrap (symlink_to_gnulib): New function.
8565 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
8566 to copies-of-gnulib.
8567 (cp_mark_as_generated, slurp, gnulib_files):
8568 Avoid making a copy if it's the same as the old version.
8569 (gnulib_files): Add support for this variable (used by Bison).
8570
a92be413
PE
85712006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8572
8573 * src/getargs.c (usage): Rework to use conventions similar to
8574 coreutils, to make translation a bit easier and the code a bit
8575 smaller. Problem reported by Tim Van Holder.
8576
4f82b42a
PE
85772006-09-15 Paul Eggert <eggert@cs.ucla.edu>
8578
3b2942e6
PE
8579 Use some of gnulib's new modules, taken from coreutils.
8580
8581 * bootstrap: Sync from coreutils, except add support for gnulib_files.
8582 * bootstrap.conf: New file.
8583 (gnulib_modules): Add configmake, inttypes, unistd.
8584 (XGETTEXT_OPTIONS): Add complain, complain_at,
8585 fatal, fatal_at, warn, warn_at, unexpected_end.
8586 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
8587 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
8588 (gl_EARLY): Add.
8589 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
8590 (gl_INIT): Add
8591 (GNULIB_AUTOCONF_SNIPPET): Remove.
8592 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
8593 the pickiest.
8594 * lib/.cvsignore: Add inttypes_.h.
8595 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
8596 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
8597 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
8598 no-longer-necessary initializations.
8599 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
8600 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
8601 use the unistd module.
8602 * src/system.h: Likewise.
8603 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
8604 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
8605 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
8606 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
8607 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
8608 * src/system.h: Include inttypes.h unconditionally, now that we
8609 use the inttypes module. Don't bother to include stdint.h, since
8610 inttypes.h now does that for us.
8611 (LOCALEDIR): Remove, now that we use the configmake module.
8612 * src/getargs.c: Include configmake.h.
8613 * src/main.c: Likewise.
8614 * src/output.c: Likewise.
8615 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
8616 not from $abs_top_builddir, since config.h moved.
8617
8618
4f82b42a
PE
8619 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
8620 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
8621
8622 * src/parse-gram.y (symbol_declaration): Don't put statements
8623 before declarations; it's not portable to C89.
8624 * src/scan-code.l (handle_action_at): Likewise.
8625
8626 * src/scan-code.l: Always initialize braces_level; the old code
8627 left it uninitialized and therefore had undefined behavior.
8628
8629 Don't attempt to redefine 'assert', since it runs afoul of
8630 systems where standard headers (mistakenly) include <assert.h>.
8631 Instead, define and use our own alternative, called 'aver'.
8632 * src/reader.c: Don't include assert.h, since we no longer
8633 use assert.
8634 * src/scan-code.l: Likewise.
8635 * src/system.h (assert): Remove, replacing with....
8636 (aver): New function, taking a bool arg. All uses changed.
8637 * src/tables.c (pack_vector): Ensure that aver arg is bool,
8638 not merely an integer.
8639
31c10e38
PE
86402006-09-15 Bob Rossi <bob@brasko.net>
8641
d6bdb90a
JD
8642 Add support for push parsing. Based on the original work of
8643 Odd Arild Olsen <oao@fibula.no>.
31c10e38
PE
8644 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
8645 * data/c.m4 (YYPUSH): New.
8646 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
d6bdb90a 8647 * data/push.c: New file.
31c10e38
PE
8648 * src/getargs.c (push_parser): New var.
8649 * src/getargs.h (push_parser): New declaration.
8650 * src/output.c (prepare): Add macro insertion of `push_flag'.
8651 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
8652 (prologue_declaration): Parse %push-parser.
8653 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
8654 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
8655 list of removed lines from the traces observed.
8656 (AT_CHECK_CALC_LALR): Added push parser tests.
8657
fa7b79c0
PE
86582006-09-13 Paul Eggert <eggert@cs.ucla.edu>
8659
21fe08ca
PE
8660 * NEWS: Version 2.3a.
8661 * configure.ac (AC_INIT): Likewise.
8662
e8ec4d9b
PE
8663 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
8664 "#define YYSTYPE int" that caused "make maintainer-check" to fail
8665 due to header ordering dependencies. I don't know why the #define
8666 was there.
8667
fa7b79c0
PE
8668 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
8669 runtime cost when YYDEBUG is not defined, and so that some tests
8670 that used to fail now work. Problem and initial suggestion by
8671 Paolo Bonzini.
8672 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
8673 * data/glr.cc (b4_parser_class_name):
8674 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
8675 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
8676 (yydebug_) [YYDEBUG]: New member.
8677 (yycdebug_): Now defined only if YYDEBUG.
8678 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
8679 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
8680 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
8681 if YYYDEBUG.
8682 (debug_stream, set_debug_stream, debug_level, set_debug_level):
8683 Define only if YYDEBUG.
8684 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
8685 set_debug_level.
8686 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
8687 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
8688 AT_CHECK_CALC_GLR_CC that are working now.
8689
4ec13d60
PE
86902006-09-12 Paul Eggert <eggert@cs.ucla.edu>
8691
8692 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
8693 We don't need them in glr.cc, and glr.c defines them.
8694 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
8695 assumes that defining it to anything is the same as defining
8696 it to 1. Problem reported by Paolo Bonzini.
8697
8e1687ae
PE
86982006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
8699
8700 * data/c.m4 (b4_null, b4_case): Define.
8701 * src/output.c (prepare_symbols): Use b4_null.
8702 (user_actions_output): Use b4_case.
8703
3dc5e96b
PE
87042006-09-11 Paul Eggert <eggert@cs.ucla.edu>
8705
aef3da86
PE
8706 * data/glr.c (b4_shared_declarations): Put start-header first,
8707 before any #includes that we generate, so that feature-test
8708 macros work. Problem reported by Michael Deutschmann in
8709 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
8710 * data/lalr1.cc: Likewise.
8711 * doc/bison.texinfo (Prologue): Document that feature-test macros
8712 should be defined before any Bison declarations.
8713 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
8714 that depend on location.hh after, not before, Bison decls, since
8715 we now include location.hh after the first user prologue.
8716
3dc5e96b
PE
8717 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
8718 Sander Brandenburg in
8719 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
8720 Also, fix minor white space and comment issues.
aef3da86
PE
8721 (Prologue): Mention that it's better to define feature-test macros
8722 before Bison declarations. Problem reported by Michael Deutschmann.
8723
8724 * README-cvs: Fix typo: "&" should be "&&". Problem reported
8725 by Jim Meyering.
8726 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
8727 This adjusts to recent gnulib changes.
3dc5e96b 8728
b2a0b7ca
JD
87292006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8730
8731 Finish implementation of per-type %destructor/%printer. Discussed
8732 starting at
8733 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
8734 and
8735 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
8736 * NEWS (2.3+): Add a description of this feature to the default
8737 %destructor/%printer description.
8738 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
8739 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
8740 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
8741 list node contains a semantic type.
8742 * src/symtab.c, src/symtab.h: Extend with a table that associates
8743 semantic types with their %destructor's and %printer's.
8744 (semantic_type_from_uniqstr, semantic_type_get,
8745 semantic_type_destructor_set, semantic_type_printer_set): New functions
8746 composing the public interface of that table.
8747 (symbol_destructor_get, symbol_destructor_location_get,
8748 symbol_printer_get, symbol_printer_location_get): If there's no
8749 per-symbol %destructor/%printer, look up the per-type before trying
8750 the default.
8751 * tests/actions.at (Per-type %printer and %destructor): New test case.
8752 * tests/input.at (Default %printer and %destructor redeclared):
8753 Extend to check that multiple occurrences of %symbol-default in a
8754 single %destructor/%printer declaration is an error.
8755 (Per-type %printer and %destructor redeclared, Unused values with
8756 per-type %destructor): New test cases.
8757
3be03b13
JD
87582006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8759
8760 Require default %destructor/%printer to be declared using
8761 %symbol-default instead of an empty symbol list, and start working on
8762 new per-type %destructor/%printer. Discussed at
8763 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
8764 * NEWS (2.3+): Add %symbol-default to example.
8765 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 8766 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
8767 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
8768 (generic_symlist, generic_symlist_item): New nonterminals for creating
8769 a list in which each item is a symbol, semantic type, or
8770 %symbol-default.
8771 (grammar_declaration): Use generic_symlist in %destructor and %printer
8772 declarations instead of symbols.1 or an empty list.
8773 (symbol_declaration, precedence_declaration, symbols.1): Update actions
8774 for changes to symbol_list.
8775 * src/reader.c: Update for changes to symbol_list.
8776 * src/scan-code.l: Likewise.
8777 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
8778 * src/symlist.c, src/symlist.h: Extend such that a list node may
8779 represent a semantic type or a %symbol-default in addition to just an
8780 ordinary symbol. Add switched functions for setting %destructor's and
8781 %printer's.
8782 * tests/actions.at, tests/input.at: Add %symbol-default to all default
8783 %destructor/%printer declarations.
8784
3508ce36
JD
87852006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
8786
8787 Whether the default %destructor/%printer applies to a particular symbol
8788 isn't a question of whether the user *declares* that symbol (in %token,
8789 for example). It's a question of whether the user by any means
8790 *defines* the symbol at all (by simply using a char token, for
8791 example). $end is defined by Bison whereas any other token with token
8792 number 0 is defined by the user. The error token is always defined by
8793 Bison regardless of whether the user declares it with %token, but we
8794 may one day let the user define error as a nonterminal instead.
8795 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
8796 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
8797 the meaning of "user-defined".
8798 * tests/actions.at (Default %printer and %destructor for user-declared
8799 end token): Rename to...
8800 (Default %printer and %destructor for user-defined end token): ...
8801 this.
8802
8803 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
8804 computation of whether to apply the default, don't maintain a list of
8805 every Bison-defined symbol. Instead, just check for a first character
8806 of '$', which a user symbol cannot have, and check for the error token.
8807
9350499c
JD
88082006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
8809
8810 Don't apply the default %destructor or %printer to the error token,
8811 $undefined, or $accept. This change fits the general rule that the
8812 default %destructor and %printer are only for user-declared symbols,
8813 and it solves several difficulties that are described in the new test
8814 cases listed below.
8815 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
8816 * tests/actions.at (Default %printer and %destructor are not for error
8817 or $undefined, Default %printer and %destructor are not for $accept):
8818 New test cases.
8819
4d7370cb
JD
88202006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
8821
8822 Allow %start after the first rule.
8823 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
8824 when parsing the first rule.
8825 (check_and_convert_grammar): Search for it here after all grammar
8826 declarations have been parsed. Skip midrules, which have dummy LHS
8827 nonterminals.
8828 * src/symtab.c (symbol_is_dummy): New function.
8829 * src/symtab.h (symbol_is_dummy): Declare it.
8830 * tests/input.at (%start after first rule): New test.
8831
6d0ef4ec
JD
88322006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8833
8834 Redo some of the previous commit: add back the ability to use
8835 non-aliased/undeclared string literals since it might be useful to
8836 those declaring %token-table.
8837 * src/reader.c (check_and_convert_grammar): Undo changes in previous
8838 commit: don't worry about complaints from symbols_pack.
8839 * src/symtab.c (symbol_new, symbol_class_set,
8840 symbol_check_alias_consistency): Undo changes in previous commit: count
8841 each string literal as a new symbol and token, assign it a symbol
8842 number, and don't complain about non-aliased string literals.
8843 (symbols_pack): Since symbol_make_alias still does not decrement symbol
8844 and token counts but does still set aliased tokens to the same number,
8845 symbol_pack_processor now leaves empty slots in the symbols array.
8846 Remove those slots.
8847 * tests/regression.at (Undeclared string literal): Remove test case
8848 added in previous commit since non-aliased string literals are allowed
8849 again.
8850 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
8851 remove unnecessary string literal declarations.
8852 * tests/sets.at (Firsts): Likewise.
8853
965537bc
JD
88542006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8855
8856 Don't allow an undeclared string literal, but allow a string literal to
8857 be used before its declaration.
8858 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
8859 symbols_pack complained.
8860 * src/symtab.c (symbol_new): Don't count a string literal as a new
8861 symbol.
8862 (symbol_class_set): Don't count a string literal as a new token, and
8863 don't assign it a symbol number since symbol_make_alias does that.
8864 (symbol_make_alias): It's not necessary to decrement the symbol and
8865 token counts anymore. Don't assume that an alias declaration occurs
8866 before any uses of the identifier or string, and thus don't assert that
8867 one of them has the highest symbol number so far.
8868 (symbol_check_alias_consistency): Complain if there's a string literal
8869 that wasn't declared as an alias.
8870 (symbols_pack): Bail if symbol_check_alias_consistency failed since
8871 symbol_pack asserts that every token has been assigned a symbol number
8872 although undeclared string literals have not.
8873 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 8874 string literal): New test cases.
965537bc
JD
8875 (Characters Escapes, Web2c Actions): Declare string literals as
8876 aliases.
8877 * tests/sets.at (Firsts): Likewise.
8878
47aee066
JD
88792006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
8880
8881 In the grammar scanner, STRING_FINISH unclosed constructs and return
8882 them to the parser in order to improve error messages.
8883 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
8884 SC_BRACED_CODE, SC_PROLOGUE): Implement.
8885 * tests/input.at (Unclosed constructs): New test case.
8886 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
8887 seen.
8888
8889 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
8890 unused global.
8891
1f6b3679
JD
88922006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
8893
8894 Handle string aliases for character tokens correctly.
8895 * src/symtab.c (symbol_user_token_number_set): If the token has an
8896 alias, check and set its alias's user token number instead of its own,
8897 which is set to indicate the alias. Previously, every occurrence of
8898 the character token in the grammar overwrote that alias indicator with
8899 the character code.
8900 * tests/input.at (String aliases for character tokens): New test.
8901
219741d8
JD
89022006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
8903
8904 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
8905
11daa4e7
PE
89062006-08-11 Paul Eggert <eggert@cs.ucla.edu>
8907
8908 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
8909 to prevent failures when building on older platforms.
8910 Check for autopoint failure.
8911 Set XGETTEXT_OPTIONS to values that check for C format strings,
8912 so that translators are warned about them (this also helps
8913 prevent core dumps).
8914
8915 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
8916 function, since it simplifies our code a bit.
8917
8918 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
8919 rather than -W, so we don't get bogus warnings about sign comparisons.
8920 Add -Wpointer-arith, since that warning is useful (it reports code
8921 that does not conform to C89 and that some compilers reject).
8922 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
8923 since it's no longer needed.
8924
f9bfc42a
JD
89252006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
8926
8927 Clean up scanners a bit.
8928 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
8929 definitions so gcc won't warn when obstack_for_string is unused.
8930 * src/scan-code.l: config.h and system.h are already #include'd by
8931 scan-code-c.c, so get rid of them here.
8932 * src/scan-gram.l: Likewise.
8933 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
8934 definitions rather than duplicating the rest of it.
8935 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
8936
06e8700a
JD
89372006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
8938
8939 Suppress signed/unsigned comparison warnings for yycheck.
8940 * data/c.m4 (b4_safest_int_type): New macro.
8941 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
8942 a signed int type, cast it to b4_safest_int_type first.
8943 * data/yacc.c: Likewise.
8944 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
8945 also overwritten.
8946
9c437126
PE
89472006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
8948
8949 * doc/bison.texinfo: Fix some typos.
8950
284d8a13
PE
89512006-08-02 Paul Eggert <eggert@cs.ucla.edu>
8952
8953 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
8954 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
8955
8956 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
8957 the latest gnulib does this a different way.
8958 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
8959 translation was patched, so stop omitting it.
8960
ec5479ce
JD
89612006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8962
8963 Enable declaration of default %printer/%destructor. Make the parser
8964 use these for all user-declared grammar symbols for which the user does
8965 not declare a specific %printer/%destructor. Thus, the parser uses it
8966 for token 0 if the user declares it but not if Bison generates it as
8967 $end. Discussed starting at
8968 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
8969 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
8970 and
8971 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
8972 * NEWS (2.3+): Mention.
8973 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
8974 declare a %destructor for a mid-rule's semantic value. It's just
8975 impossible to declare one specific to it.
8976 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
8977 code. Describe default %destructor form.
8978 * src/parse-gram.y (grammar_declaration): Parse default
8979 %printer/%destructor declarations.
8980 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
8981 and symbol_destructor_location_get rather than accessing the destructor
8982 and destructor_location members of struct symbol.
8983 (symbol_printers_output): Likewise but for %printer's.
8984 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
8985 again.
8986 * src/symtab.c (default_destructor, default_destructor_location,
8987 default_printer, default_printer_location): New static global
8988 variables to record the default %destructor and %printer.
8989 (symbol_destructor_get, symbol_destructor_location_get,
8990 symbol_printer_get, symbol_printer_location_get): New functions to
8991 compute the appropriate %destructor and %printer for a symbol.
8992 (default_destructor_set, default_printer_set): New functions to set the
8993 default %destructor and %printer.
8994 * src/symtab.h: Prototype all those new functions.
8995 * tests/actions.at (Default %printer and %destructor): New test to
8996 check that the right %printer and %destructor are called, that they're
8997 not called for $end, and that $$ and @$ work correctly.
8998 (Default %printer and %destructor for user-declared end token): New
8999 test to check that the default %printer and %destructor are called for
9000 a user-declared end token.
9001 * tests/input.at (Default %printer and %destructor redeclared, Unused
9002 values with default %destructor): New tests to check related grammar
9003 warnings and errors.
9004
868d2d96
JD
90052006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
9006
9007 Clean up handling of %destructor for the end token (token 0).
9008 Discussed starting at
9009 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
9010 and
9011 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
9012
9013 Make the skeletons consistent in how they pop the end token and invoke
9014 its %destructor.
9015 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
9016 state, which has token number 0, since this would invoke the
9017 %destructor for the end token.
9018 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
9019 until after shifting the end token, or else it won't be popped.
9020 * data/yacc.c (yyparse): Likewise.
9021
9022 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
9023 it's the end token. Upon termination, destroy an unshifted lookahead
9024 even when it's the end token.
9025 * data/lalr1.cc (yy::parser::parse): Likewise.
9026 * data/yacc.c (yyparse): Likewise.
9027
9028 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
9029 value warnings for the end token when the user gives the end token a
9030 %destructor.
9031
9032 * tests/actions.at (Printers and Destructors): Test all the above.
9033
62a9592d
PE
90342006-07-24 Paul Eggert <eggert@cs.ucla.edu>
9035
9036 Update to latest gnulib and gettext versions.
9037 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
9038 Add fopen-safer.
9039 (gnulib_files): Add m4/warning.m4. Don't worry about files
9040 overwritten by autopoint.
9041 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
9042 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
9043 rejects them.
9044 Don't use autoreconf; instead, invoke autopoint etc. by hand,
9045 so that we can remove the intl files at a better time.
9046 (intl_files_to_remove): Remove aclocal.m4, since it gets
9047 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
9048 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
9049 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
9050 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
9051 Remove datarootdir hack; no longer needed.
9052 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
9053 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
9054 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
9055 strdup.h.
9056 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
9057 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
9058
10d6970f
PE
90592006-07-20 Paul Eggert <eggert@cs.ucla.edu>
9060
9061 * bootstrap: Adjust to today's change to gnulib-tool by invoking
9062 it with --assume-autoconf='latest-stable'.
9063
50a33993
JD
90642006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
9065
9066 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
9067 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
9068 YYSTYPE' and `{'.
9069 * src/muscle_tab.h (muscle_grow): Replace the header comments with
9070 those from muscle_tab.c since the old ones are misleading.
9071
2ce4ed68
AD
90722006-07-13 Akim Demaille <akim@epita.fr>
9073
9074 Support %define "KEY" {VALUE}.
9075 * src/scan-code.h, src/scan-code.l (translate_action)
9076 (translate_rule_action, translate_symbol_action, translate_code):
9077 Return char *, not const char *.
9078 * src/parse-gram.y (declaration): Rename as...
9079 (prologue_declaration): this.
9080 (string_content): Remove this nonterminal, use STRING.
9081 (braceless, content, content.opt): New nonterminal.
9082 Use them.
9083 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
9084 as value.
9085 * src/scan-gram.l (getargs.h): Don't include it.
9086
db7e5eb5
PE
90872006-07-12 Paul Eggert <eggert@cs.ucla.edu>
9088
9089 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
9090 rather than a for-loop that declares a local bool variable. This
9091 should work around a compatibility problem with a Cray x1e C++
9092 compiler reported by Hung Nguyen in
9093 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
9094 The for-loop was introduced in the 2004-11-17 change but I don't
9095 know why it was needed.
9096
a5d80ba5
AD
90972006-07-12 Akim Demaille <akim@epita.fr>
9098
9099 * data/c.m4: Comment changes.
9100
23eb2a69
AD
91012006-07-10 Akim Demaille <akim@lrde.epita.fr>
9102
9103 * src/complain.c (error_message, ERROR_MESSAGE): New.
9104 To factor...
9105 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
9106 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
9107
ddc8ede1
PE
91082006-07-09 Paul Eggert <eggert@cs.ucla.edu>
9109
9110 * NEWS: Instead of %union, you can define and use your own union type
9111 YYSTYPE if your grammar contains at least one <type> tag.
9112 Your YYSTYPE need not be a macro; it can be a typedef.
9113 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
9114 (Union Decl, Decl Summary): Document this.
9115 * data/glr.c (YYSTYPE): Implement this.
9116 * data/glr.cc (YYSTYPE): Likewise.
9117 * data/lalr1.cc (YYSTYPE): Likewise.
9118 * data/yacc.c (YYSTYPE): Likewise.
9119 * src/output.c (prepare): Output tag_seen_flag.
9120 * src/parse-gram.y (declaration, grammar_declaration):
9121 Use 'union_seen' rather than 'typed' to determine whether
9122 %union has been seen, since grammars can now be typed without
9123 %union.
9124 (symbol_declaration, type.opt, symbol_def):
9125 Keep track of whether a tag has been seen.
9126 * src/reader.c (union_seen, tag_seen): New vars.
9127 (typed): remove.
9128 * src/reader.h (union_seen, tag_seen, typed): Likewise.
9129 * src/scan-code.l (untyped_var_seen): New variable.
9130 (handle_action_dollar): Adjust to above changes.
9131 (handle_action_dollar, handle_action_at):
9132 Improve overflow checking for outlandish numbers.
9133 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
9134 avoid new diagnostics generated by above changes.
9135 * tests/regression.at (YYSTYPE typedef): Add test to check
9136 for type tags without %union.
9137
9138 * src/symlist.c (symbol_list_length): Return int, not unsigned
9139 int, since callers expect int. This may need to get revisited
9140 once we have proper integer overflow checking.
9141
9142 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
9143 object is now static.
9144
9145 * src/getargs.c (flags_argmatch): Return void, not int,
9146 to pacify ./configure --enable-gcc-warnings.
9147
9148 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
9149 since last_string is already defined to FLEX_PREFIX (last_string).
9150
7b42569e
AD
91512006-07-09 Akim Demaille <akim@lrde.epita.fr>
9152
9153 Implement --warnings/-W.
9154 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
9155 replaced by...
9156 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
9157 Adjust callers.
9158 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
9159 (warnings_args, warnings_types): New.
9160 (getargs, short_options, long_options): Accept -W/--warnings.
9161 Sort the options by alphabetical order, upper case letter right
9162 before its lower case.
9163
3b452f4e
JD
91642006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
9165
9166 Change %merge result type clash warnings to errors. Discussed at
9167 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
9168 * src/reader.c (record_merge_function_type): Use complain_at.
9169 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9170 declared later): Update test case results.
9171
b8a41559
AD
91722006-07-09 Akim Demaille <akim@lrde.epita.fr>
9173
9174 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
9175 to be in alphabetical order.
9176 (trace_args): Spelling fixes.
9177
cd9e1ba2
PE
91782006-07-09 Paul Eggert <eggert@cs.ucla.edu>
9179
9180 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
9181 so they don't collide with user-defined macros.
9182 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
9183 this was never guaranteed, and now that we're using gnulib stdint,
9184 which defines int_fast16_t to long int, the problem is exposed.
9185
cb48f191
PE
91862006-07-08 Paul Eggert <eggert@cs.ucla.edu>
9187
b8445a15
PE
9188 * data/c.m4 (b4_basename): Simplify a bit, since we don't
9189 need the full POSIX semantics (and weren't implementing them
9190 anyway).
9191
cb48f191
PE
9192 Adjust to Autoconf 2.60 and today's gnulib.
9193 * bootstrap (gnulib_modules): Add stdint.
9194 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
9195 no longer copies it.
9196 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
9197 since stdint needs the former and wcwidth (which is now required
9198 by mbswidth) needs the latter.
9199 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
9200 work around a compatibility glitch between gettext 0.14.6 and
9201 Autoconf 2.60.
9202 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
9203 Do not check for uintptr_t, since new stdint module does the right
9204 thing.
9205 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
9206 Add stdint.h, stdint_.h, wcwidth.h.
9207 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
9208 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
9209 stdint.m4, wchar_t.m4, wcwidth.m4.
9210 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
9211 usual order for ../lib/*.h files.
9212 (file_name_split): Use last_component, not base_name, to adjust
9213 to gnulib changes.
9214 * src/parse-gram.h: Include <strverscmp.h> in the usual order
9215 for ../lib/*.h files.
9216 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
9217 Define unconditionally, since we now assume the stdint module.
9218 * src/scan-skel.l: Include <dirname.h>.
9219 (BASE_QPUTS): Use last_component, not base_name.
9220 * src/system.h: Include <unlocked-io.h> in the usual order
9221 for ../lib/*.h files. Include <stdint.h> unconditionally,
9222 since we now use the stdint module.
9223 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
9224 HAVE_UINTPTR_T, since we now use the stdint module.
9225 (base_name): Remove decl, since files now include <dirname.h>
9226 to get the decl.
9227
cd48d21d
AD
92282006-07-08 Akim Demaille <akim@lrde.epita.fr>
9229
9230 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
9231 New, default to 1.
9232 * data/yacc.c, data/glr.c, data/location.cc: Use them.
9233 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
9234 default.
9235 * tests/calc.at: Adjust.
9236
8ec0a172
AD
92372006-07-08 Akim Demaille <akim@lrde.epita.fr>
9238
b8445a15 9239 * data/c.m4 (b4_basename): New.
8ec0a172
AD
9240 (b4_syncline): Also output the location of its invocation (from
9241 the skeleton).
9242 (b4_user_action, b4_define_user_action, b4_user_actions)
9243 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
9244 (b4_user_stype): New.
9245 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
9246
4a678af8
JD
92472006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
9248
9249 In the grammar file, the first column is 1 not 0 on the first line as
9250 on every other line.
9251 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
9252 * tests/input.at (Torturing the Scanner): Update output.
9253
9254 * src/scan-gram.l (scanner_cursor): Declare it static.
9255
dd60572a
JD
92562006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
9257
9258 In warnings, say "previous declaration" rather than "first
9259 declaration".
9260 * src/symtab.c (redeclaration): Do that here.
9261 * src/reader.c (record_merge_function_type): In the case of a result
9262 type clash, report the previous declaration rather than the very first
9263 one in the grammar file.
9264 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9265 declared later): Add a third declaration to check this behavior.
9266 * tests/input.at (Incompatible Aliases): Update output.
9267
2073e1b6
AD
92682006-06-27 Akim Demaille <akim@epita.fr>
9269
9270 * doc/Doxyfile.in: New.
9271 * doc/Makefile.am: Use it.
9272 * src/lalr.h, src/symtab.h: Initial doxygenation.
9273
8ee5b538
JD
92742006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9275
9276 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
9277 declared after the %merge. This continues the effort of the previous
9278 patch.
8ee5b538
JD
9279 * src/reader.c (get_merge_function): Don't set the merger type yet.
9280 (record_merge_function_type): New function for setting the merger type
9281 and checking for clashes.
9282 (grammar_current_rule_merge_set): Set the location of the %merge for
9283 the current rule.
9284 (packgram): Invoke record_merge_function_type for each rule now that
9285 all symbol type declarations have been parsed.
9286 * src/reader.h (merger_list.type_declaration_location): New member
9287 storing the location of the first %merge from which the type for this
9288 merging function was derived.
9289 * src/symlist.h (symbol_list.merger_declaration_location): New member
9290 storing the location of a rule's %merge, if any.
9291 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9292 declared later): New test to catch the error fixed by the above patch.
9293
ffa4ba3a
JD
92942006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9295
9296 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
9297 declarations appear after the rules. Discussed at
9298 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
9299 and
9300 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
9301 Don't mistake the type of $$ in a midrule to be that of its parent
9302 rule's $$.
ffa4ba3a
JD
9303 * src/reader.c (grammar_current_rule_end): Don't invoke
9304 grammar_rule_check yet since not all symbol declarations may have been
9305 parsed yet.
9306 (grammar_midrule_action): Likewise.
9307 Don't record whether the midrule's $$ has been used yet since actions
9308 haven't been translated yet.
9309 Record the midrule's parent rule and its RHS index within the parent
9310 rule.
9311 (grammar_current_rule_action_append): Don't translate the action yet
9312 since not all symbol declarations may have been parsed yet and, thus,
9313 warnings about types for $$, $n, @$, and @n can't be reported yet.
9314 (packgram): Translate the action and invoke grammar_rule_check now that
9315 all symbol declarations have been parsed.
9316 * src/scan-code.l (handle_action_dollar): Now that this is invoked
9317 after parsing the entire grammar file, the symbol list here in the case
9318 of a midrule is actually the midrule's empty RHS, so reference its
9319 parent rule's RHS where necessary.
9320 On the other hand, now that you can already know it's a midrule, you
9321 aren't forced to think $$ has the same type as its parent rule's $$.
9322 (handle_action_at): In the case of a midrule, reference the parent rule
9323 where necessary.
9324 * src/symlist.c (symbol_list_new): Initialize new midrule-related
9325 members.
9326 (symbol_list_length): Now that this is invoked after all rules have
9327 been parsed, a NULL symbol (rather than a NULL symbol list node)
9328 terminates a rule. symbol_list_print already does this correctly.
9329 * src/symlist.h (symbol_list.midrule_parent_rule,
9330 symbol_list.midrule_parent_rhs_index): New members so that midrules can
9331 remember their relationships with their parents.
9332 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
9333 fixed by the above patch.
9334 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
9335 implementing...
9336 (Unused values): ... this old test case and...
9337 (Unused values before symbol declarations): ... this new test case.
9338 This one is the same as `Unused values' except that all symbol
9339 declarations appear after the rules in order to catch the rest of the
9340 errors fixed by the above patch.
9341
e256e17f
JD
93422006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9343
300a1930
JD
9344 More cleanup.
9345 * src/reader.c (current_rule): Declare it static since it's no longer
9346 used outside this file.
9347 (grammar_current_rule_action_append): Remove redundant arguments from
9348 translate_rule_action invocation.
9349 * src/reader.h (current_rule): Remove this unused extern.
9350 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
9351 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 9352
381ecb06
JD
93532006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
9354
9355 Clean up yesterday's patch.
9356 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
9357 to...
9358 * src/reader.c (grammar_current_rule_action_append): ... here for
9359 consistency with grammar_current_rule_symbol_append.
9360 * tests/regression.at (Braced code in declaration in rules section):
9361 Make yyerror and yylex static as usual.
9362
4210cd0b
JD
93632006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
9364
9365 Fix bug that mistakes braced code in a declaration in the rules section
9366 to be a rule action. Mentioned at
9367 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
9368 * src/scan-gram.l: Move midrule action detection from the start of the
9369 scanning of any braced code to...
9370 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
9371 action. For readability, use $2 and @2 rather than the equivalent
9372 global variables.
9373 * tests/regression.at (Braced code in declaration in rules section):
9374 New test to catch the error fixed by the above patch.
9375
9376 Work on code readability some.
9377 * src/scan-code.l (current_rule): Get rid of this misleading and
9378 redundant declaration: it's actually extern'ed in reader.h.
9379 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
9380 translate_action): Add a rule argument and use it instead of the global
9381 current_rule.
9382 (translate_rule_action): This already receives current_rule through an
9383 argument, so pass it on to translate_action instead of assigning
9384 current_rule to current_rule.
9385 (translate_symbol_action, translate_code): Pass rule = NULL to
9386 translate_action.
9387
34f98f46
JD
93882006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
9389
9390 Rename %before-definitions to %start-header and %after-definitions to
9391 %end-header. Don't use these declarations to separate pre-prologue
9392 blocks from post-prologue blocks. Add new order-independent
9393 declarations %before-header and %after-header as alternatives to the
9394 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
9395 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
9396 * NEWS (2.3+): Update for these changes.
9397 * data/glr.c (b4_before_definitions): Update to...
9398 (b4_start_header): ... this.
9399 (b4_after_definitions): Update to...
9400 (b4_end_header): ... this.
9401 * data/glr.cc: Likewise.
9402 * data/lalr1.cc: Likewise.
9403 * data/yacc.c: Likewise.
9404 * doc/bison.texinfo (The prologue): Update names, and replace remaining
9405 prologue blocks with %*-header declarations.
9406 (Calc++ Parser): Likewise.
91661ebb 9407 (Decl Summary): Update names.
148d66d8 9408 (Table of Symbols): Update description.
34f98f46
JD
9409 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
9410 (PERCENT_END_HEADER): ... this.
9411 (PERCENT_BEFORE_DEFINITIONS): Update to...
9412 (PERCENT_START_HEADER): ... this.
9413 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9414 (declaration): Update token names and m4 macro names.
9415 When parsing %end-header and %start-header, invoke translate_code
9416 before muscle_code_grow, and no longer set global booleans to remember
9417 whether these declarations have been seen.
9418 Parse new %after-header and %before-header.
9419 * src/reader.c (before_definitions, after_definitions): Remove.
9420 (prologue_augment): Accept a new bool argument to specify whether to
9421 augment the pre-prologue or post-prologue.
9422 * src/reader.h (before_definitions, after_definitions): Remove these
9423 extern's.
9424 (prologue_augment): Add new bool argument.
9425 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
9426 (PERCENT_END_HEADER): ... this.
9427 (PERCENT_BEFORE_DEFINITIONS): Update to...
9428 (PERCENT_START_HEADER): ... this.
9429 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9430 * tests/actions.at (Printers and Destructors): Update names.
9431
31b2b07e
JD
94322006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
9433
9434 Add comparison operators for C++ location classes. Discussed at
9435 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
9436 * data/c++.m4 (b4_define_location_comparison): New boolean %define
9437 declaration indicating whether filename_type has an operator==. If
9438 filename_type is `std::string', it defaults to `1', `0' otherwise.
9439 * data/location.cc: Iff b4_define_location_comparison is `1', add
9440 operator== and operator!= for class position and for class location.
9441
9442 Some minor fixes.
9443 * src/scan-action.l: Remove unused file.
9444 * src/symtab.c (symbol_printer_set): Use printer_location not
9445 destructor_location.
9446 * src/symtab.h (struct symbol): Replace incorrect source comment for
9447 printer members.
9448 * tests/input.at (Incompatible Aliases): Update output with correct
9449 printer location.
9450
9bc0dd67
JD
94512006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
9452
9453 Don't put the pre-prologue in the header file. For the yacc.c code
9454 file and the glr.c header and code files, move the pre-prologue before
9455 the token definitions. Add new %before-definitions and
9456 %after-definitions to declare code that will go in both the header file
9457 and code file. Discussed at
9458 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
9459 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
9460 and
9461 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
9462 * NEWS (2.3+): Describe these changes.
9463 * data/glr.c (b4_pre_prologue): Move from within to before...
9464 (b4_shared_declarations): ... this.
9465 Add new b4_before_definitions before b4_token_enums.
9466 Add new b4_after_definitions at the end.
9467 * data/glr.cc (b4_pre_prologue): Replace with...
9468 (b4_before_definitions): ... this in the header file.
9469 (b4_after_definitions): New near the end of the header file.
9470 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
9471 code file right before including the header file.
9472 (b4_before_definitions): New in the previous position of
9473 b4_pre_prologue in the header file.
9474 (b4_after_definitions): New near the end of the header file.
9475 * data/yacc.c: Clean up some m4 quoting especially in the header file.
9476 (b4_token_enums_defines): In the code file, move to right before
9477 YYSTYPE for consistency with the header file.
9478 (b4_before_definitions): New right before b4_token_enums_defines in
9479 both the header and code file.
9480 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
9481 header and code file.
9482 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
9483 of prologues for %union dependencies.
91661ebb
JD
9484 (Decl Summary): In %defines description, mention the effect of
9485 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
9486 (Calc++ Parser): Forward declare driver in a %before-definitions rather
9487 than in the pre-prologue so that make check succeeds.
148d66d8 9488 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
9489 %after-definitions.
9490 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
9491 %before-definitions.
9492 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
9493 (declaration): Parse those declarations and append to
9494 b4_before_definitions and b4_after_definitions, respectively.
9495 * src/reader.c (before_definitions, after_definitions): New bools to
9496 track whether those declarations have been seen.
9497 (prologue_augment): Add to the post-prologue if %union,
9498 %before-definitions, or %after-definitions has been seen.
9499 * src/reader.h (before_definitions, after_definitions): New extern's.
9500 * src/scan-gram.l: Scan the new declarations.
9501 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
9502 prologue block in a %before-definitions or a %after-definitions based
9503 on whether the %union is declared.
9504 * tests/regression.at (Early token definitions with --yacc, Early token
9505 definitions without --yacc): Move tests for token definitions into the
9506 post-prologue since token names are no longer defined in the
9507 pre-prologue.
9508
203b9274
AD
95092006-06-20 Akim Demaille <akim@epita.fr>
9510
9511 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
9512 (symbol_get): Use it.
9513 * src/parse-gram.y: Use it.
9514
a7ee59cf
JD
95152006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
9516
9517 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
9518 build succeeds when configured with --enable-gcc-warnings.
9519
5a2baae7
PE
95202006-06-19 Paul Eggert <eggert@cs.ucla.edu>
9521
33ad1a9c
PE
9522 * src/parse-gram.y (char_name): New function.
9523 (CHAR, STRING, string_content): For %printer, properly escape.
9524 (ID): Prefer fputs to fprintf.
9525 (id): Reindent to be consistent with other rules.
9526 Properly quote char.
9527
5a2baae7
PE
9528 The Translation Project changed its way of publishing translations
9529 to maintainers. I haven't received any responses to my request
9530 for supporting the old way, or for documenting the new way. I
9531 have modified 'bootstrap' to use screen scraping
9532 (in this case, HTML scraping). This is unreliable and inelegant,
9533 but I don't see any better way. Yuck.
9534 * bootstrap (TP_URL, WGET_COMMAND): New vars.
9535 (get_translations): New function, which uses HTML scraping to
9536 deduce locations of latest translations.
9537 Use this function to grab both bison and bison-runtime .po files.
9538 Don't bother priming the pump for the runtime-po domain any more,
9539 as it's now translated better than bison is.
9540
58d7a1a1
AD
95412006-06-19 Akim Demaille <akim@epita.fr>
9542
9543 * src/scan-gram.l: No longer "parse" things after `%union' until
9544 `{'. Rather, return a single "%union" token.
9545 No longer make symbols: return strings, and leave the conversion
9546 to symbols to the parser.
9547 (SC_PRE_CODE, token_type): Remove.
9548 * src/parse-gram.y (%union): New field `character'.
9549 Sort tokens.
9550 (CHAR): New token.
9551 (ID, ID_COLON): Now that the scanner no longer makes them
9552 identifiers, adjust all uses to invoke symbol_get.
9553 (id_colon): New, wraps the conversion from string to symbol.
9554 (%union): Accept a possible union_name.
9555 (symbol): Now can be a char.
9556 * data/c.m4 (b4_union_name): Leave a default value.
9557 * data/glr.c, data/yacc.c: Use it.
9558
b931235e
JD
95592006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
9560
9561 For associating token numbers with token names for "yacc.c", don't use
9562 #define statements unless `--yacc' is specified; always use enum
9563 yytokentype. Most important discussions start at:
9564 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
9565 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
9566 and
9567 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
9568 * NEWS (2.3+): Mention.
9569 * data/c.m4 (b4_yacc_if): New.
9570 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
9571 token #define's.
9572 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
9573 on token name definitions.
9574 * src/getargs.c (usage): Capitalize `Yacc' in English.
9575 * src/output.c (prepare): Define b4_yacc_flag.
9576 * tests/regression.at (Early token definitions): Test that tokens names
9577 are defined before the pre-prologue not just before the post-prologue.
9578 Remove this test case and copy to...
9579 (Early token definitions with --yacc): ... this to test #define's.
9580 (Early token definitions without --yacc): ... and this to test enums.
9581
9e6e7ed2
PE
95822006-06-11 Paul Eggert <eggert@cs.ucla.edu>
9583
9584 * NEWS: Reword the post-2.3 change to not be so optimistic about
9585 removing the old "look-ahead" spelling.
9586 Update previous look-ahead/lookahead change reports.
9587 * REFERENCES: look-ahead -> lookahead (since that's
9588 what he actually wrote).
9589 * doc/refcard.tex: look ahead -> lookahead,
9590 look-ahead -> lookahead
9591
742e4900
JD
95922006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
9593
9594 For consistency, use `lookahead' instead of `look-ahead' or
9595 `look_ahead'. Discussed starting at
9596 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
9597 and then at
9598 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
9599 * NEWS: For the next release, note the change to `--report'.
9600 * TODO, doc/bison.1: Update English.
9601 * doc/bison.texinfo: Update English.
9602 (Understanding Your Parser, Bison Options): Document as
9603 `--report=lookahead' rather than `--report=look-ahead'.
9604 * src/conflicts.c: Update English in comments.
9605 (lookahead_set): Rename from look_ahead_set.
9606 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
9607 (resolve_sr_conflict): Rename local look_ahead_tokens to
9608 lookahead_tokens, and update other uses.
9609 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
9610 count_rr_conflicts, conflicts_free): Update uses.
9611 * src/getargs.c (report_args): Move "lookahead" before alternate
9612 spellings.
9613 (report_types): Update uses.
9614 (usage): For `--report' usage description, state `lookahead' spelling
9615 rather than `look-ahead'.
9616 * src/getargs.h (report.report_lookahead_tokens): Rename from
9617 report_look_ahead_tokens.
9618 * src/lalr.c: Update English in comments.
9619 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
9620 (state_lookahead_tokens_count): Rename from
9621 state_look_ahead_tokens_count.
9622 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9623 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
9624 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9625 Update other uses.
9626 Update English in output.
9627 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
9628 * src/print.c: Update English in comments.
9629 (lookahead_set): Rename from look_ahead_set.
9630 (print_reduction): Rename argument lookahead_token from
9631 look_ahead_token.
9632 (print_core, state_default_rule, print_reductions, print_results):
9633 Update uses.
9634 * src/print_graph.c: Update English in comments.
9635 (print_core): Update uses.
9636 * src/state.c: Update English in comments.
9637 (reductions_new): Update uses.
9638 (state_rule_lookahead_tokens_print): Rename from
9639 state_rule_look_ahead_tokens_print, and update other uses.
9640 * src/state.h: Update English in comments.
9641 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
9642 (state_rule_lookahead_tokens_print): Rename from
9643 state_rule_look_ahead_tokens_print.
9644 * src/tables.c: Update English in comments.
9645 (conflict_row, action_row): Update uses.
9646 * tests/glr-regression.at
9647 (Incorrect lookahead during deterministic GLR,
9648 Incorrect lookahead during nondeterministic GLR): Rename
9649 print_look_ahead to print_lookahead.
9650 * tests/torture.at: Update English in comments.
9651 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
9652 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
9653 (Many lookahead tokens): Update uses.
9654 * data/glr.c: Update English in comments.
9655 * lalr1.cc: Likewise.
9656 * yacc.c: Likewise.
9657 * src/conflicts.h: Likewise.
9658 * src/lalr.h: Likewise.
9659 * src/main.c: Likewise.
9660 * src/output.c: Likewise.
9661 * src/parse-gram.c: Likewise.
9662 * src/tables.h: Likewise.
9663 * tests/calc.at: Likewise.
9664
3c40d0b5
JD
96652006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
9666
9667 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
9668
5d278082
PE
96692006-06-07 Paul Eggert <eggert@cs.ucla.edu>
9670
9671 * TODO: Add request from Nelson H. F. Beebe to be able to install
9672 Bison without installing the yacc script.
9673
9e668899
JD
96742006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9675
9676 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
9677 and yytext if they're already #define'd.
9678 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
9679 * src/scan-code-c.c: ... here.
9680 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
9681 <config.h>.
9682
0c8e079f
JD
96832006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9684
9685 Get Bison to build again when configured with --enable-gcc-warnings.
9686 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
9687 missing #include's.
9688 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
9689 loc argument as it shadows a global.
9690 * src/scan-gram.l: Remove stray comma that prevents boundary_set
9691 invocation.
9692
9693 * src/.cvsignore: Add scan-code.c.
9694
2346344a
AD
96952006-06-07 Akim Demaille <akim@epita.fr>
9696
9697 * src/scan-gram.l: Move the "add a trailing ; to actions" code
9698 to...
9699 * src/scan-code.l: here.
9700 * tests/input.at (Torturing the Scanner): Fix another location
9701 error.
9702
4862bdfd
AD
97032006-06-07 Akim Demaille <akim@epita.fr>
9704
9705 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
9706
e9071366
AD
97072006-06-06 Akim Demaille <akim@epita.fr>
9708
9709 Extract the parsing of user actions from the grammar scanner.
9710 As a consequence, the relation between the grammar scanner and
9711 parser is much simpler. We can also split "composite tokens" back
9712 into simple tokens.
9713 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
9714 * src/scan-gram.l (add_column_width, adjust_location): Move to and
9715 rename as...
9716 * src/location.h, src/location.c (add_column_width)
9717 (location_compute): these.
9718 Fix the column count: the initial column is 0.
9719 (location_print): Be robust to ending column being 0.
9720 * src/location.h (boundary_set): New.
9721 * src/main.c: Adjust to scanner_free being renamed as
9722 gram_scanner_free.
9723 * src/output.c: Include scan-code.h.
9724 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
9725 Use boundary_set.
9726 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
9727 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
9728 which is now, again, a separate token.
9729 Adjust all dependencies.
9730 Whereever actions with $ and @ are used, use translate_code.
9731 (action): Remove this nonterminal which is now useless.
9732 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
9733 (grammar_current_rule_action_append): Use translate_code.
9734 (packgram): Bound check ruleno, itemno, and rule_length.
9735 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
9736 (last_string, last_braced_code_loc, max_left_semantic_context)
9737 (scanner_initialize, scanner_free, scanner_last_string_free)
9738 (gram_out, gram_lineno, YY_DECL_): Move to...
9739 * src/scan-gram.h: this new file.
9740 (YY_DECL): Rename as...
9741 (GRAM_DECL): this.
9742 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
9743 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9744 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9745 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9746 Move these declarations, and...
9747 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
9748 these to...
9749 * src/flex-scanner.h: this new file.
9750 * src/scan-gram.l (rule_length, rule_length_overflow)
9751 (increment_rule_length): Remove.
9752 (last_braced_code_loc): Rename as...
9753 (gram_last_braced_code_loc): this.
9754 Adjust to the changes of the parser.
9755 Move all the handling of $ and @ into...
9756 * src/scan-code.l: here.
9757 * src/scan-gram.l (handle_dollar, handle_at): Remove.
9758 (handle_action_dollar, handle_action_at): Move to...
9759 * src/scan-code.l: here.
9760 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
9761 scan-code.h, scan-code-c.c, scan-gram.h.
9762 (EXTRA_bison_SOURCES): Add scan-code.l.
9763 (BUILT_SOURCES): Add scan-code.c.
9764 (yacc): Be robust to white spaces.
9765
9766 * tests/conflicts.at, tests/input.at, tests/reduce.at,
9767 * tests/regression.at: Adjust the column numbers.
9768 * tests/regression.at: Adjust the error message.
7891a7c4 9769
184e42f0
JD
97702006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9771
9772 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9773 Use Akim's wording from
9774 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
9775
7891a7c4
JD
97762006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9777
9778 Between Bison releases, manually append `+' to the previous Bison
9779 release number, and use that as a signal to automatically print the
9780 ChangeLog's CVS Id keyword from --version. Discussed starting at
9781 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
9782 * ChangeLog: Add Id header.
9783 * configure.ac (AC_INIT): Append `+' to `2.3'.
9784 * src/.cvsignore: Add revision.c.
9785 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
9786 (BUILT_SOURCES): Add revision.c.
9787 (revision.c): New target rule. This file defines a new global variable
9788 named revision. It initializes it with either the Id from ChangeLog
9789 or, if VERSION doesn't contain `+', with the empty string.
9790 * src/getargs.c (version): Print the value of revision.
9791 * src/revision.h: Extern revision.
9792
4ad3ed84
PE
97932006-06-05 Paul Eggert <eggert@cs.ucla.edu>
9794
9795 * NEWS: Version 2.3.
9796 * configure.ac (AC_INIT): Likewise.
9797
02103984
PE
97982006-05-30 Paul Eggert <eggert@cs.ucla.edu>
9799
9800 * data/glr.c (YYRECOVERING): Define to be a function-like macro
9801 with no arguments, not as an object-like macro. This is for
9802 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
9803 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
9804 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
9805 Document this.
9806
2c08afa5
JD
98072006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
9808
9809 * src/getargs.c (usage): Back out yesterday's modification of the
9810 --help output so that we don't have to wait for translation before
9811 releasing 2.3.
9812
6077da58
PE
98132006-05-29 Paul Eggert <eggert@cs.ucla.edu>
9814
9815 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
9816 Problem reported by Akim Demaille.
9817
2a26b6c2
JD
98182006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
9819
9820 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9821
aefef0d6
PE
98222006-05-26 Paul Eggert <eggert@cs.ucla.edu>
9823
9824 * data/yacc.c (yy_reduce_print): Omit trailing white space in
9825 generated source code. Problem reported by Frans Englich in
9826 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
9827
fcd8e201
PE
98282006-05-22 Paul Eggert <eggert@cs.ucla.edu>
9829
9830 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
9831 shell, not within 'make', so that 'make' by an ordinary builder
9832 (using GNU make) does not worry about configuring gzip. This also
9833 works around a bug reported independently by Keith Thompson and by
9834 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
9835 stderr rather than stdout, messing up the build logs.
9836
7b5cdcbd
JD
98372006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9838
9839 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
9840 to make sure that YYID will never be unused. This fixes a 'make
9841 maintainer-check' failure caused by the recent changes to the 'Trivial
9842 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
9843 not used.
9844 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
9845
5ad0a449
JD
98462006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9847
9848 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
9849 state before an empty RHS is always resolved here. Only the location
9850 of that state is guaranteed to be resolved, and that's enough. This
9851 fixes the remaining bug reported by Derek M. Jones in
9852 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9853 * tests/glr-regression.at (Uninitialized location when reporting
9854 ambiguity): Test the above case.
9855 Also, the embedded comments in this test case claim it checks the case
9856 of an empty RHS that has inherited the initial location. However, the
9857 corresponding LHS was already resolved, so yyresolveLocations didn't
9858 actually have reason to modify it. Fix this by forcing
9859 nondeterministic operation at the beginning of the parse.
9860
50cce58e
PE
98612006-05-20 Paul Eggert <eggert@cs.ucla.edu>
9862
9863 * data/c.m4 (b4_yy_symbol_print_generate):
9864 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
9865 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
9866 of the bugs reported today by Derek M Jones in
9867 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9868 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
9869 defined to be a type name without parens or brackets.
9870 (Location Type): Similarly for YYLTYPE.
9871 * tests/regression.at (Trivial grammars): Put in a test for this
9872 bug that will be caught by 'make maintainer-check' (though not,
9873 alas, by 'make check' unless your compiler is picky).
9874
ab8d9dc5
PE
98752006-05-19 Paul Eggert <eggert@cs.ucla.edu>
9876
0d2c8934 9877 * NEWS: Version 2.2.
ab8d9dc5
PE
9878 * configure.ac (AC_INIT): Likewise.
9879
9138c575
JD
98802006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
9881
9882 * data/glr.c (yyreportTree): Make room in yystates for the state
9883 preceding the RHS. This fixes the segmentation fault reported by Derek
9884 M. Jones in
9885 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
9886 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
9887 to the user. Reported for yyreportTree by Derek M. Jones later in the
9888 same thread.
9889 * THANKS: Add Derek M. Jones.
9890 Update my email address.
9891 Fix typo in Steve Murphy's name.
9892
276f48df
PE
98932006-05-14 Paul Eggert <eggert@cs.ucla.edu>
9894
d6645148
PE
9895 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
9896 checking against YYLAST that caused the parser to miss a potential
9897 alternative in its diagnostic.
9898 Problem reported by Maria Jose Moron Fernandez in
9899 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
9900 * data/lalr1.cc (yysyntax_error_): Likewise.
9901 * data/yacc.c (yysyntax_error): Likewise.
9902 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
9903 tokens, in case we run into an older C compiler.
9904 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
9905 Use them to check for the off-by-one error fixed above.
9906
276f48df
PE
9907 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
9908 YYSIZE_T, not size_t.
9909 * tests/regression.at (Trivial grammars): New test, to catch
9910 the error fixed by the above patch.
9911
cd8b5791
AD
99122006-05-14 Akim Demaille <akim@lrde.epita.fr>
9913
9914 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
9915 scheme.
9916 Reported by Steve Murphy.
9917
34376418
AD
99182006-05-14 Akim Demaille <akim@lrde.epita.fr>
9919
9920 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
9921 * data/glr.cc: b4_location_flag is now b4_locations_flag.
9922
327afc7c
AD
99232006-05-14 Akim Demaille <akim@lrde.epita.fr>
9924
9925 Implement --trace=m4.
9926 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
9927 * src/output.c (output_skeleton): When set, pass -dV to m4.
9928
9929 Factor the handling of flags in m4.
9930 * src/output.c (prepare): Rename the muscle names debug, defines,
9931 error_verbose to debug_flag, defines_flag, error_verbose_flag.
9932 * data/c.m4: Adjust.
9933 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
9934 Use b4_define_flag_if to define other b4_FLAG_if macros.
9935 (b4_location_if): As a consequence, rename as...
9936 (b4_locations_if): this, for consistency.
9937 Adjust all the skeletons.
9938
ba9ecd19
AD
99392006-05-14 Akim Demaille <akim@lrde.epita.fr>
9940
9941 * etc/bench.pm: Shorten bench names.
9942
4e83ea15
AD
99432006-05-14 Akim Demaille <akim@lrde.epita.fr>
9944
9945 * src/output.h, src/output.c (error_verbose): Move to...
9946 * src/getargs.h, src/getargs.c: here.
9947 Sort the flags.
9948 Adjust dependencies.
9949
6e93d810
PE
99502006-05-13 Paul Eggert <eggert@cs.ucla.edu>
9951
9952 * data/c.m4 (b4_copyright): Put the special exception for Bison
9953 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
9954 uses changed. Suggested by Akim Demaille. Also, wrap the
9955 copyright notice, in case it is longer than 80 columns. Replace
9956 comma by newline after title.
6e93d810 9957
eaea13f5
PE
99582006-05-11 Paul Eggert <eggert@cs.ucla.edu>
9959
9960 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
9961 incompatibility, not a bug. Mention that it wasn't fixed as of
9962 flex 2.5.33.
9963
3cf084ec
AD
99642006-05-11 Akim Demaille <akim@lrde.epita.fr>
9965
9966 * examples/extexi: Enforce the precedence of concatenation over
9967 >>.
0a9f1c7d 9968 Reported by Tommy Nordgren.
3cf084ec 9969
32c96bd7
AD
99702006-05-11 Akim Demaille <akim@lrde.epita.fr>
9971
9972 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
9973 with the member "token".
f94705b2 9974 Reported by Martin Nylin.
32c96bd7 9975
eaea13f5
PE
99762006-05-08 Paul Eggert <eggert@cs.ucla.edu>
9977
9978 * data/glr.c: Switch to Bison 2.2 special-exception language in
9979 the copyright notice. Use more-regular format for titles and
9980 copyright notices.
9981 * data/glr.cc: Likewise.
9982 * data/location.cc: Likewise.
9983 * data/yacc.cc: Likewise.
9984 * doc/bison.texinfo (Conditions): Document this.
9985 * NEWS: likewise. Upgrade version to 2.2.
9986
6e2d1146
AD
99872006-04-27 Akim Demaille <akim@lrde.epita.fr>
9988
9989 * data/glr.cc: Remove dead code.
9990
47671055
PE
99912006-04-25 Paul Eggert <eggert@cs.ucla.edu>
9992
9993 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
9994 that variable and the line breaks the bootstrap. Problem reported
9995 by Juan M. Guerrero.
9996
ed2e6384
AD
99972006-04-24 Akim Demaille <akim@lrde.epita.fr>
9998
9999 * doc/bison.texinfo (Multiple start-symbols): New.
10000
3cedc2dc
AD
100012006-04-24 Akim Demaille <akim@lrde.epita.fr>
10002
10003 * etc/README, etc/bench.pl: New.
10004
b2ddc3f3
AD
100052006-04-03 Akim Demaille <akim@lrde.epita.fr>
10006
10007 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
10008 rule.
10009 Reported by Mickael Labau.
10010 * tests/input.at (Torturing the Scanner): Test it.
10011
91e3ac9a
PE
100122006-03-16 Paul Eggert <eggert@cs.ucla.edu>
10013
10014 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
10015 Problem reported by Bob Rossi.
10016
100172006-03-13 Paul Eggert <eggert@cs.ucla.edu>
10018
10019 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
10020 and didn't really work.
10021 For the index, use @ifnotinfo, not @iftex.
10022 Minor cleanups of spacing and terminology.
10023
5cf61e93
AD
100242006-03-12 Akim Demaille <akim@lrde.epita.fr>
10025
10026 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
10027 of AT_NAME_PREFIX when %name-prefix is not used.
10028
aa08666d
AD
100292006-03-12 Akim Demaille <akim@lrde.epita.fr>
10030
10031 Apply --prefix to C++ skeletons too: they change the namespace.
10032 The test suite already exercize these cases.
10033 * data/c++.m4 (b4_namespace): New.
10034 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
10035 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
10036 * data/yacc.c, data/glr.c: Remove a useless `[]'.
10037 * doc/bison.texinfo: Document it.
10038 (Option Cross Key): Use @multitable in all formats. It looks
10039 nicer, even in TeX outputs.
10040 (Rules): Use the same code whatever the output type is.
10041 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
10042 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
10043 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 10044
45567173
AD
100452006-03-10 Akim Demaille <akim@lrde.epita.fr>
10046
10047 * TODO: Remove dead items.
10048
e9d8f881 100492006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
10050
10051 * doc/FAQ: Remove, merged into...
10052 * doc/bison.texinfo (FAQ): this.
10053 * doc/Makefile.am (EXTRA_DIST): Adjust.
10054
c095d689
AD
100552006-03-10 Akim Demaille <akim@lrde.epita.fr>
10056
10057 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
10058 even if empty.
10059 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
10060 * doc/bison.texinfo (Calc++ Scanner): Use it.
10061
6e0f8287
PE
100622006-03-09 Paul Eggert <eggert@cs.ucla.edu>
10063
10064 Fix two nits reported by twlevo, plus one more that I discovered.
10065
10066 * src/assoc.h (assoc_to_string): Give a name to the arg, as
10067 this is the usual Bison style.
10068 * src/location.h (location_print): Likewise.
10069
10070 * src/reader.h (token_name): Likewise.
10071
d6b771c3
PE
100722006-03-08 Paul Eggert <eggert@cs.ucla.edu>
10073
10074 Fix some nits reported by twlevo.
10075 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
10076 and "POSIX". Use more-modern syntax for URLs. Mention C++
10077 and ask for Java. Don't hardwire OS version numbers. Add
10078 copyright notice.
10079 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
10080 * src/conflicts.c (solved_conflicts_obstack): Now static.
10081
1e137b71
JD
100822006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
10083
10084 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
10085 page. Say "you can use it" not "you may use it" as on the web page;
10086 we're describing capabilities not granting permission.
10087
73f2e47e
PE
100882006-03-06 Paul Eggert <eggert@cs.ucla.edu>
10089
6d05403d
PE
10090 * data/glr.c (yyresolveLocations): Rename local variables to avoid
10091 shadowing warnings. Use usual patter for iterating through RHS.
10092 * tests/glr-regression.at
10093 (Uninitialized location when reporting ambiguity):
10094 Modify yylex so that it uses its argument, rather than trying
10095 to rely on ARGSUSED (which doesn't work for gcc with warnings).
10096 const char -> char const.
10097
73f2e47e
PE
10098 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
10099 Don't use tabs inside commands; it messes up 'ps'.
10100 Problem reported by twlevo.
10101
8710fc41
JD
101022006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
10103
10104 * tests/glr-regression.at (Uninitialized location when reporting
10105 ambiguity): New test case.
10106 * data/glr.c (yyresolveLocations): New function, which uses
10107 YYLLOC_DEFAULT.
10108 (yyresolveValue): Invoke yyresolveLocations before reporting an
10109 ambiguity.
10110 * doc/bison.texinfo (Default Action for Locations): Note
10111 YYLLOC_DEFAULT's usage for ambiguity locations.
10112 (GLR Semantic Actions): Cross-reference those notes.
10113
ae952af2
JD
101142006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
10115
10116 * tests/glr-regression.at (Leaked semantic values when reporting
10117 ambiguity): Remove unnecessary union and type declarations.
10118 (Leaked lookahead after nondeterministic parse syntax error): New test
10119 case.
10120 * data/glr.c (yyparse): Check for zero stacks remaining before
10121 attempting to shift the lookahead so that you don't lose it.
10122
35ee866a
JD
101232006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
10124
10125 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
10126 * tests/glr-regression.at (Leaked semantic values when reporting
10127 ambiguity): New test case.
10128 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
10129 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
10130 now unnecessary yystackp parameter.
10131 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
10132 destructors can be called.
10133
10134 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
10135 in existing testcases.
10136
520181ab
JD
101372006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
10138
10139 Don't leak semantic values for parent RHS when a user action cuts the
10140 parser, and clean up related code a bit.
10141 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
10142 cuts parse): Rename to...
10143 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
10144 for leaked parent RHS values.
10145 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
10146 between an unresolved state (non-empty chain of semantic options) and
10147 an incomplete one (signaled by an empty chain).
ae952af2 10148 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
10149 successfully or unsuccessfully resolved yyGLRState to...
10150 (yyresolveValue): ... here so that yyresolveValue always leaves a
10151 yyGLRState with consistent data and thus is easier to understand.
10152 Remove the yyvalp and yylocp parameters since they are always just
10153 taken from the yys parameter. When reporting a discarded merged value
10154 in debugging output, note that it is incompletely merged. Document the
10155 interface.
10156 (yyresolveAction): If resolving any of the RHS states fails, destroy
10157 them all rather than leaking them. Thus, as long as user actions are
10158 written to clean up the RHS correctly, yyresolveAction always cleans up
10159 the RHS of a semantic option. Document the interface.
10160
18d9185c
PE
101612006-02-27 Paul Eggert <eggert@cs.ucla.edu>
10162
10163 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
10164 led to a segmentation fault in GNU Pascal. Problem reported
10165 by Waldek Hebisch.
10166
841a7737
JD
101672006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
10168
10169 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
10170 mid-rule action inside a nonterminal symbol in order to declare a
10171 destructor for its semantic value.
10172
fc3f467f
PE
101732006-02-16 Paul Eggert <eggert@cs.ucla.edu>
10174
10175 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
10176 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
10177 __cplusplus && ! defined _STDLIB_H && !
10178 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
10179 defined free))]: Include <stdlib.h> rather than rolling our own
10180 declarations of malloc and free, to avoid problems with
10181 incompatible declarations (using 'throw') C++'s stdlib.h. This
10182 should fix Debian bug 340012
10183 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
10184 reported by Guillaume Melquiond.
10185
a3af26dd
PE
101862006-02-13 Paul Eggert <eggert@cs.ucla.edu>
10187
4d7bc38c
PE
10188 * NEWS: Clarify symbols versus types in unused-value warnings.
10189
a3af26dd
PE
10190 * configure.ac (AC_INIT): Bump version number.
10191
4e26c69e
PE
101922006-02-13 Paul Eggert <eggert@cs.ucla.edu>
10193
10194 * NEWS: Version 2.1a.
10195 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
10196 since C99 requires this.
10197
498e897c
PE
101982006-02-11 Paul Eggert <eggert@cs.ucla.edu>
10199
10200 * m4/c-working.m4: New file.
10201 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
10202
57bb17ca
PE
102032006-02-10 Paul Eggert <eggert@cs.ucla.edu>
10204
10205 * Makefile.maint: Merge from coreutils.
10206
0be105dc
PE
102072006-02-09 Paul Eggert <eggert@cs.ucla.edu>
10208
10209 More portability fixes for problems summarized by Nelson H. F. Beebe.
10210
10211 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
10212 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
10213 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
10214 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
10215 messes up because C++ code is compiled in 32-bit mode but linked
10216 in 64-bit mode.
10217
6fc0c024
PE
102182006-02-08 Paul Eggert <eggert@cs.ucla.edu>
10219
10220 More portability fixes for problems summarized by Nelson H. F. Beebe.
10221
7870f699
PE
10222 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
10223 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
10224
6fc0c024
PE
10225 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
10226 nodist_PROGRAMS, since we don't need to actually compile the
10227 example if we're just doing a plain 'make'. This avoids bothering
10228 the installer unnecessarily about problems due to weird C++
10229 compilers.
10230
fe6c2fde
PE
102312006-02-06 Paul Eggert <eggert@cs.ucla.edu>
10232
10233 More portability fixes for problems summarized by Nelson H. F. Beebe.
10234
10235 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
10236 than #include "...", and compile with -I'.'. The old method was
10237 not portable, according to Posix and the C standard, and it does
10238 not work with Sun C 5.7, where previous #line directives affect
10239 the working directory used in later #include "..." directives.
10240
927b425b
JMG
102412006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10242
10243 Various DJGGP specific issues in /djgpp
10244
d9735e9e
PE
102452006-02-02 Paul Eggert <eggert@cs.ucla.edu>
10246
10247 More portability fixes for problems summarized by Nelson H. F. Beebe.
10248
10249 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
10250 '#include <map>' works and that you can apply ++ to iterators.
10251
5a6755af
PE
102522006-02-01 Paul Eggert <eggert@cs.ucla.edu>
10253
67a0dc4f
PE
10254 Work around portability problems summarized by Nelson H. F. Beebe in
10255 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
10256
8c86f0ef
PE
10257 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10258 that '#include <string>' works.
10259
de35dd59
PE
10260 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
10261 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
10262 "warning: sorry: semantics of inline function static data `const
10263 unsigned char translate_table[262]' are wrong (you'll wind up with
10264 multiple copies)".
10265
67a0dc4f
PE
10266 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
10267 or, xor to not_, and_, or_, and xor_, respectively. This works
10268 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
10269 random system header somewhere that includes the equivalent of
10270 <iso646.h>.
10271
5a6755af
PE
10272 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
10273 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 10274 Suite Version 2.0.
5a6755af 10275
3f001415
JD
102762006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
10277
10278 During deterministic GLR operation, user actions should be able to
10279 influence the parse by changing yychar. To make this easier to fix and
10280 to make glr.c easier to evolve in general, don't maintain yytoken in
10281 parallel with yychar; just compute yytoken when needed.
10282 * tests/glr-regression.at (Incorrect lookahead during deterministic
10283 GLR): Check that setting yychar in a user action has the intended
10284 effect.
10285 * data/glr.c (yyGLRStack): Remove yytokenp member.
10286 (yyclearin): Don't set *yytokenp.
10287 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
10288 yychar rather than *yytokenp to determine the current lookahead.
10289 Compute yytoken locally when needed.
10290 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
10291 point to.
10292
10293 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
10294 after `--report' documentation.
10295
e2a8c0f5
PE
102962006-01-30 Paul Eggert <eggert@cs.ucla.edu>
10297
10298 * src/parse-gram.y (grammar_declaration): Location of printer
10299 symbol is @1, not list->location. Bug reported by twlevo.
10300 * tests/input.at (Incompatible Aliases): Adjust to above change.
10301
6b702268
PE
103022006-01-29 Paul Eggert <eggert@cs.ucla.edu>
10303
27622431
PE
10304 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
10305 all the test at once. This makes the output easier to read in the
10306 normal case.
10307
6b702268
PE
10308 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
10309 got from <http://bro-ids.org/download.html>. The bug is that
10310 when two actions appeared in succession, the second one was
10311 scanned before the first one was added to the grammar rule
10312 as a midrule action. Bison then output the incorrect warning
10313 "parse.y:905.17-906.36: warning: unused value: $3".
10314 * src/parse-gram.y (BRACED_CODE, action): These are no longer
10315 associated with a value.
10316 (rhs): Don't invoke grammar_current_rule_action_append.
10317 (action): Invoke it here instead.
10318 * src/reader.c (grammar_midrule_action): Now extern.
10319 (grammar_current_rule_action_append): Don't invoke
10320 grammar_midrule_action; that is now the scanner's job.
10321 * src/reader.h (last_string, last_braced_code_loc):
10322 (grammar_midrule_action): New decls.
10323 * src/scan-gram.l (last_string): Now extern, sigh.
10324 (last_braced_code_loc): New extern variable.
10325 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
10326 rule already has an action.
10327 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
10328 * tests/input.at (AT_CHECK_UNUSED_VALUES):
10329 Add some tests to check that the above changes fixed the bug.
10330
d40ba6c2
PE
103312006-01-27 Paul Eggert <eggert@cs.ucla.edu>
10332
10333 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
10334 All used changed. Check whether the symbol has a destructor,
10335 not whether it is typed.
10336 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
10337 that the values are still reported as unused. All line numbers
10338 adjusted.
10339
401aace6
PE
103402006-01-23 Paul Eggert <eggert@cs.ucla.edu>
10341
10342 Work around a bug in bro 0.8, which underparenthesizes its
10343 definition of YYLLOC_DEFAULT.
10344 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
10345 their arguments.
10346 * data/lalr1.cc: Likewise.
10347 * data/yacc.cc: Likewise.
10348
06f01bc4
PE
103492006-01-22 Paul Eggert <eggert@cs.ucla.edu>
10350
401aace6
PE
10351 Work around a bug in Pike 7.0, and give the Pike folks a
10352 better way to override the usual int widths.
10353 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
10354 user can override the types.
10355 (short): #undef, to work around a bug in Pike 7.0.
10356 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
10357 (union yyalloc.yyss): Use yytype_int16 rather than short.
10358 All uses changed.
10359 (yysigned_char): Remove.
10360 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
10361 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
10362 * tests/regression.at (Web2c Actions): Adjust to above changes.
10363
10364 * src/reader.c (check_and_convert_grammar): New function.
10365 (reader): Close the input file even if something went wrong during
10366 parsing. Minor file descriptor leak reported by twlevo.
10367
06f01bc4
PE
10368 * src/assoc.c (assoc_to_string): Use a default: abort (); case
10369 to pacify gcc -Wswitch-default.
10370 * src/scan-gram.l (adjust_location): Use a default: break; case
10371 to pacify gcc -Wswitch-default.
10372 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
10373 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10374 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10375 Move these decls to scan-skel.l, since they don't need to be
10376 visible elsewhere.
10377 * src/scan-skel.l: Accept the above decls.
10378 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
10379 is used.
10380
02650b7f
PE
103812006-01-21 Paul Eggert <eggert@cs.ucla.edu>
10382
10383 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
10384 since we don't want to insist on a version number at the start
10385 of the changelog every time.
10386 * Makefile.maint: Sync from coreutils a bit better.
10387 (sc_trailing_blank): Renamed from sc_trailing_space.
10388 All uses changed.
10389 (sc_no_if_have_config_h, sc_require_config_h):
10390 (sc_prohibit_assert_without_use): New rules.
10391 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
10392 (sc_dd_max_sym_length): Fix leading spaces in rule.
10393 (sc_system_h_headers): Prefix with @.
10394 (sc_useless_cpp_parens, m4-check): Output line numbers.
10395 (changelog-check): Allow version only in head.
10396 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
10397 satisfy new Makefile.maint rule.
10398 * data/glr.c: Likewise.
10399 * data/glr.cc: Likewise.
10400 * data/lalr1.cc: Likewise.
10401 * data/yacc.c: Likewise.
10402 * lib/ebitsetv.c: Likewise.
10403 * lib/lbitset.c: Likewise.
10404 * lib/subpipe.c: Likewise.
10405 * lib/timevar.c: Likewise.
10406 * src/system.h: Likewise.
10407 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
10408 * djgpp/Makefile.maint: Add copyright notice.
10409 * djgpp/README.in: Likewise.
10410 * djgpp/config.bat: Likewise.
10411 * djgpp/config.site: Likewise.
10412 * djgpp/config_h.sed: Likewise.
10413 * djgpp/djunpack.bat: Likewise.
10414 * djgpp/config.sed: Fix copyright notice to match standard format.
10415 * djgpp/subpipe.h: Likewise.
10416 * lib/bitsetv-print.c: Likewise.
10417 * lib/bitsetv.c: Likewise.
10418 * lib/subpipe.h: Likewise.
10419 * lib/timevar.c: Likewise.
10420 * lib/timevar.h: Likewise.
10421 * djgpp/subpipe.c: Use standard recipe for config.h.
10422 * lib/abitset.c: Likewise.
10423 * lib/bitset.c: Likewise.
10424 * lib/bitset_stats.c: Likewise.
10425 * lib/bitsetv-print.c: Likewise.
10426 * lib/bitsetv.c: Likewise.
10427 * lib/ebitsetv.c: Likewise.
10428 * lib/get-errno.c: Likewise.
10429 * lib/lbitset.c: Likewise.
10430 * lib/subpipe.c: Likewise.
10431 * lib/timevar.c: Likewise.
10432 * lib/vbitset.c: Likewise.
10433 * tests/local.at: Likewise.
10434 * src/scan-gram.l: Don't include verify.h, since system.h does
10435 that for us.
10436 * .x-sc_require_config_h: New file.
10437 * .x-sc_unmarked_diagnostics: New file.
10438
287c78f6
PE
104392006-01-20 Paul Eggert <eggert@cs.ucla.edu>
10440
287c78f6
PE
10441 Be a bit more systematic about using 'abort'.
10442 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
10443 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
10444 Put 'default: abort ();' before some other case, to satisfy older
10445 pedantic compilers.
10446 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10447 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
10448 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
10449 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
10450 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
10451 (get_decision_str, get_orientation_str, get_node_alignment_str):
10452 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
10453 (get_linestyle_str, get_arrowstyle_str): Likewise.
10454 * src/conflicts.c (resolve_sr_conflict):
10455 Use a default case rather than one for the one remaining enum
10456 value, to catch invalid enum values as well.
10457 * src/lalr.c (set_goto_map, map_goto):
10458 Prefer "assert (FOO);" to "if (!FOO) abort ();".
10459 * src/nullable.c (nullable_compute, token_definitions_output):
10460 Likewise.
10461 * src/reader.c (packgram, reader): Likewise.
10462 * src/state.c (transitions_to, state_new, state_reduction_find):
10463 Likewise.
10464 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
10465 (symbol_pack): Likewise.
10466 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
10467 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
10468 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
10469 * src/system.h: Don't include <assert.h>.
10470 (assert): New macro.
10471
10472 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
10473 (Destructor Decl, Parser Function, Pure Calling):
10474 Describe rules for braces inside C code more carefully.
287c78f6 10475
c66dfadd
PE
104762006-01-19 Paul Eggert <eggert@cs.ucla.edu>
10477
c21493b8
PE
10478 Fix some porting glitches found by Nelson H. F. Beebe.
10479 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
10480 compilers that don't understand that abort () does not return.
10481 * src/state.c (transitions_to): Likewise.
10482 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10483 that '#include <cstdlib>' works.
10484 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
10485 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
10486 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
10487 for the benefit of some pre-C99 compilers.
10488
b6e3facf
PE
10489 * bootstrap: Undo changes to gnulib files that autoreconf made.
10490
c66dfadd
PE
10491 Minor fixups to get 'make maintainer-check' to work.
10492 * configure.ac: Don't use -Wnested-externs, as it's incompatible
10493 with the new verify.h implementation.
10494 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
10495 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
10496 * data/yacc.c (YYUSE): Likewise.
10497 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
10498 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
10499 * src/parse-gram.y (declaration): Don't pass a string constant
10500 to a function that expects char *, since GCC might complain
10501 about the constant value.
10502 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
10503 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
10504 before #defining them.
10505 * tests/glr-regression.at
10506 (Incorrectly initialized location for empty right-hand side in GLR):
10507 In yyerror, use the msg arg.
10508 (Corrupted semantic options if user action cuts parse):
10509 (Incorrect lookahead during deterministic GLR):
10510 (Incorrect lookahead during nondeterministic GLR):
10511 Don't name a local var 'index'; it shadows string.h's 'index'.
10512
ed94ef2a
AD
105132006-01-19 Akim Demaille <akim@epita.fr>
10514
10515 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
10516 location, not just parts of it.
10517
e9ad4aec
PE
105182006-01-18 Paul Eggert <eggert@cs.ucla.edu>
10519
d6ca7905
PE
10520 * NEWS: Document the fact that multiple %unions are now allowed.
10521 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
10522 * TODO: This feature is now implemented, so remove it from
10523 the wishlist.
d6ca7905 10524
ef1b70e0
PE
10525 * Makefile.maint: Merge with coreutils Makefile.maint.
10526 (CVS_LIST): Use build-aux version if available.
10527 (VERSION_REGEXP): New macro.
10528 (syntax-check-rules): Add sc_no_if_have_config_h,
10529 sc_prohibit_assert_without_use, sc_require_config_h,
10530 sc_useless_cpp_parens.
10531 (sc_obsolete_symbols): Check for O_NDELAY.
10532 (sc_dd_max_sym_length): Track coreutils.
10533 (sc_unmarked_diagnostics): Look in all files, not just *.c.
10534 (sc_useless_cpp_parens): New rule.
10535 (news-date-check): Look for version or today's date.
10536 (changelog-check): Don't require version number near head.
10537 (copyright-check): Use current year instead of hardwiring 2005.
10538 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
10539 (announcement): Add --gpg-key-ID.
10540
10541 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
10542 with "file system".
10543
2073ce56 10544 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
10545 array. Problem reported by twlevo.
10546 * src/reader.c (packgram): Prepend a new sentinel before ritem.
10547 * src/lalr.c (build_relations): Rely on new sentinel.
10548 * src/gram.c (gram_free): Adjust to new sentinel.
10549
b7691f15
JD
105502006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
10551
10552 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
10553 yylookaheadNeeds. All uses updated.
10554 (yysplitStack): Rename local yynewLookaheadStatuses to
10555 yynewLookaheadNeeds.
10556 * data/glr-regression.at (Incorrect lookahead during nondeterministic
10557 GLR): In comments, change `lookahead status' to `lookahead need'.
10558
ddee1b06
PH
105592006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10560
10561 * data/glr.c (yysplitStack): A little stylistic rewrite.
10562
12f4614d
PH
105632006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10564
10565 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
10566
32c29292
JD
105672006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
10568
10569 * doc/bison.texinfo: Fix some typos.
10570 (GLR Semantic Actions): New subsection discussing special
10571 considerations because GLR semantic actions might be deferred.
10572 (Actions): Mention look-ahead usage of yylval.
10573 (Actions and Locations): Mention look-ahead usage of yylloc.
10574 (Special Features for Use in Actions): Add YYEOF entry and mention it
10575 in the yychar entry.
10576 In the yychar entry, remove mention of the local yychar case (pure
10577 parser) since this is irrelevant information when writing semantic
148d66d8 10578 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
10579 yychar is otherwise described as an external variable.
10580 In the yychar entry, don't call it the `current' look-ahead since it
10581 isn't when semantic actions are deferred.
10582 In the yychar and yyclearin entries, add note about deferred semantic
10583 actions.
10584 Add yylloc and yylval entries discussing look-ahead usage.
10585 (Look-Ahead Tokens): When discussing yychar, don't call it the
10586 `current' look-ahead, and do mention yylval and yylloc.
10587 (Error Recovery): Cross-reference `Action Features' when mentioning
10588 yyclearin.
148d66d8 10589 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
10590 look-ahead.
10591 In the yylloc and yylval entries, mention look-ahead usage.
10592
de366a2f 105932006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
10594
10595 * tests/glr-regression.at: Update copyright year to 2006.
10596
bf70fa87
JD
105972006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10598
10599 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
10600 use during nondeterministic operation to track which stacks have
10601 actually needed the current lookahead.
10602 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
10603 Allocate, deallocate, resize, and otherwise shuffle space for
10604 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
10605 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
10606 appropriately during nondeterministic operation.
10607 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
10608 members to store the current lookahead to be used by the deferred
10609 user action.
10610 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
10611 from which the RHS is taken. Set the lookahead members of the new
10612 yySemanticOption according to the lookahead status for stack yyk.
10613 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
10614 yyaddDeferredAction.
10615 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
10616 members of yySemanticOption before invoking yyuserAction, and then set
10617 them back to their current values afterward.
10618 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
10619 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
10620 * tests/glr-regression.at: Remove `.' from the ends of recent test case
10621 titles for consistency.
10622 (Leaked merged semantic value if user action cuts parse): In order to
10623 suppress lint warnings, use arguments in merge function, and assign
10624 char value < 128 in main.
10625 (Incorrect lookahead during deterministic GLR): New test case.
10626 (Incorrect lookahead during nondeterministic GLR): New test case.
10627
05449a2c
JD
106282006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10629
de366a2f 10630 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
10631 !yyvaluep as signal that no semantic value is available to print.
10632 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
10633 to print a semantic value.
10634
4158e0a1 106352006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 10636
4158e0a1
JD
10637 * tests/glr-regression.at: For consistency with my newer test cases,
10638 don't thank myself.
10639
d659304d
JD
106402006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
10641
10642 * data/glr.c (yyresolveValue): When merging semantic options, if at
10643 least one user action succeeds but a later one cuts the parse, then
10644 destroy the semantic value before returning rather than leaking it.
10645 (yyresolveStates): If a user action cuts the parse and thus
10646 yyresolveValue fails, ignore the (unset) semantic value rather than
10647 corrupting the yyGLRState, and empty the semantic options list since
10648 the user actions should have called all necessary destructors.
10649 Simplify code with YYCHK.
10650 * tests/glr-regression.at (Corrupted semantic options if user action
10651 cuts parse): New test case.
10652 (Undesirable destructors if user action cuts parse): New test case.
10653 Before applying any of this patch, this test case never actually failed
10654 for me... but only because the corrupted semantic options usually
10655 masked this bug.
10656 (Leaked merged semantic value if user action cuts parse): New test
10657 case.
10658
6ec2c0f2
AD
106592006-01-05 Akim Demaille <akim@epita.fr>
10660
10661 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
10662
1b9c21fb
PE
106632006-01-04 Paul Eggert <eggert@cs.ucla.edu>
10664
10665 * data/c.m4 (b4_c_modern): New macro, with a new provision for
10666 _MSC_VER. Problem reported by Cenzato Marco.
10667 (b4_c_function_def): Use it.
10668 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
10669 b4_c_modern.
10670 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
10671 than rolling our own.
10672
84866159
AD
106732006-01-04 Akim Demaille <akim@epita.fr>
10674
10675 Also warn about non-used mid-rule values.
10676 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
10677 member.
10678 (symbol_list_new): Adjust.
10679 * src/reader.c (symbol_typed_p): New.
10680 (grammar_rule_check): Use it.
10681 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
10682 Check its rule.
10683 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
10684 Use it.
10685 * tests/actions.at (Exotic Dollars): Adjust.
10686
378f4bd8
AD
106872006-01-04 Akim Demaille <akim@epita.fr>
10688
10689 * src/reader.c (grammar_midrule_action): If $$ is set in a
10690 mid-rule, move the `used' bit to its lhs.
10691 * tests/input.at (Unused values): New.
10692 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
10693
e2a21b6f
PE
106942006-01-03 Paul Eggert <eggert@cs.ucla.edu>
10695
54662697
PE
10696 * doc/bison.texinfo (Bison Options): Say more accurately what
10697 --yacc does.
10698 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
10699 about declarations in the grammar when in Yacc mode, as POSIX does
10700 not require a diagnostic when the grammar uses extensions.
10701
10702 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
10703
073f9288
PE
10704 Warn about dubious constructions like "%token T T".
10705 Reported by twlevo.
10706 * src/symtab.h (struct symbol.declared): New member.
10707 * src/symtab.c (symbol_new): Initialize it to false.
10708 (symbol_class_set): New arg DECLARING, specifying whether
10709 this is a declaration that we want to warn about, if there
10710 is more than one of them. All uses changed.
10711
1221b78a
PE
10712 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
10713 Allow multiple %union directives, whose contents concatenate.
10714 * src/parse-gram.y (grammar_declaration): Likewise.
10715 Use muscle_code_grow, so that we don't need stype_line any more.
10716 All uses changed.
10717
10718 * src/muscle_tab.c (muscle_grow): Fix comment.
10719
e2a21b6f
PE
10720 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
10721 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
10722 Update copyright year to 2006.
10723
8f7e3cf9
AD
107242006-01-03 Akim Demaille <akim@epita.fr>
10725
10726 Have glr.cc pass (some of) the calc.at tests.
10727 * data/glr.cc (b4_parse_param_orig): New.
10728 (b4_parse_param): Improve its definition, and bound it more
10729 clearly in the skeleton.
10730 (b4_epilogue): Append, instead of prepending, in order to keep
10731 #line consistency.
10732 Simplify the generation of auxiliary functions: locations and
10733 purity are mandated.
10734 (b4_global_tokens_and_yystype): Honor it.
10735 * data/location.cc (c++.m4): Don't include it.
10736 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
10737 and AT_SKEL_CC_IF.
10738 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
10739 AT_LALR1_CC_IF.
10740 Be sure to initialize the first position's filename.
10741 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
10742 mandated anyway.
10743 (AT_CHECK_CALC_GLR_CC): New.
10744 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
10745
3953ed88
AD
107462006-01-02 Akim Demaille <akim@epita.fr>
10747
10748 * src/output.c (output_skeleton): Don't hard wire the inclusion of
10749 c.m4.
0a96ba81 10750 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
10751 * data/glr.cc: Do not include stack.hh.
10752
9ecafbbf
AD
107532006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
10754
10755 * data/glr.c: Reformat whitespace with tabs.
10756 (b4_lpure_formals): Remove this unused m4 macro.
10757 * tests/cxx-type.at: Reformat whitespace with tabs.
10758 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
10759 since it's a member. Rename type to isNterm for clarity.
10760
c4d497a0
AD
107612005-12-29 Akim <akim@sulaco.local>
10762
10763 Let glr.cc catch up with symbol_value_print.
10764 * data/glr.cc (b4_yysymprint_generate): Replace by...
10765 (b4_yy_symbol_print_generate): this.
10766 (yy_symbol_print, yy_symbol_value_print): Declare them.
10767
4517da37
PE
107682005-12-28 Paul Eggert <eggert@cs.ucla.edu>
10769
10770 * src/location.h (boundary): Note that a line or column equal
10771 to INT_MAX indicates an overflow.
10772 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
10773 (rule_length_overflow, increment_rule_length, add_column_width):
10774 New functions.
10775 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
10776 (<SC_BRACED_CODE>"}"):
10777 Use increment_rule_length rather than incrementing it by hand.
10778 (adjust_location, handle_syncline): Diagnose overflow.
10779 (handle_action_dollar, handle_action_at):
10780 Fix bug with monstrosities like $-2147483648.
10781 Remove now-unnecessary checks.
10782 (scan_integer): Verify assumptions and remove now-unnecessary checks.
10783 (convert_ucn_to_byte): Verify assumptions.
10784 (handle_syncline): New arg LOC. All callers changed.
10785 Don't store through a value derived from char const * pointer.
10786
10787 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
10788 GCC warnings.
10789
e3233bf6
PE
107902005-12-27 Paul Eggert <eggert@cs.ucla.edu>
10791
10792 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
10793 Remove unnecessary forward static decls.
10794
8f3596a6
AD
107952005-12-27 Akim Demaille <akim@epita.fr>
10796
10797 * src/reader.c (grammar_current_rule_check): Also check that $$
10798 is used.
10799 Take the rule to check as argument, hence rename as...
10800 (grammar_rule_check): this.
10801 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
10802 Rename as...
10803 (grammar_rule_begin, grammar_rule_end): these, for consistency.
10804 (grammar_midrule_action, grammar_symbol_append): Now static.
10805 * tests/torture.at (input): Don't rely on the default action
10806 being always performed.
10807 * tests/calc.at: "Set" $$ even when the action is "cut" with
10808 YYERROR or other.
10809 * tests/actions.at (Exotic Dollars): Instead of using unused
10810 values, check that the warning is issued.
10811
721be13c
PE
108122005-12-22 Paul Eggert <eggert@cs.ucla.edu>
10813
10814 * NEWS: Improve wording for unused-value warnings.
10815
a0af42fc
AD
108162005-12-22 Akim Demaille <akim@epita.fr>
10817
10818 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
10819 (b4_yysymprint_generate): Rename as...
10820 (b4_yy_symbol_print_generate): this.
10821 Generate yy_symbol_print instead of yysymprint.
10822 Generate also yy_symbol_value_print, and use it.
10823
affac613
AD
108242005-12-22 Akim Demaille <akim@epita.fr>
10825
721be13c 10826 * NEWS: Warn about unused values.
affac613
AD
10827 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
10828 a `used' member.
10829 (symbol_list_n_get, symbol_list_n_used_set): New.
10830 (symbol_list_n_type_name_get): Use symbol_list_n_get.
10831 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
10832 * src/reader.c (grammar_current_rule_check): Check that values are
10833 used.
10834 * src/symtab.c (symbol_print): Accept 0.
10835 * tests/existing.at: Remove the type information.
10836 Empty the actions.
10837 Remove useless actions (beware of mid-rule actions: perl -000
10838 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
10839 * tests/actions.at (Exotic Dollars): Use unused values.
10840 * tests/calc.at: Likewise.
10841 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10842 Likewise.
10843
10844 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
10845 rule_useful_p.
10846
9d9b8b70
PE
108472005-12-21 Paul Eggert <eggert@cs.ucla.edu>
10848
8bb4c753
PE
10849 Undo 2005-12-01 tentative license wording change. The wording is
10850 still being reviewed by the lawyers, and we don't want to wait for
10851 them before publishing a test release. For now, revert to the
10852 previous wording.
10853 * NEWS: Undo 2005-12-01 change.
10854 * data/glr.c: Revert to previous license wording.
10855 * data/glr.cc: Likewise.
10856 * data/lalr1.cc: Likewise.
10857 * data/location.cc: Likewise.
10858 * data/yacc.c: Likewise.
10859
9d9b8b70
PE
10860 * NEWS: Reword %destructor vs YYABORT etc.
10861 * data/glr.c: Use American spacing, for consistency.
10862 * data/glr.cc: Likewise.
10863 * data/lalr1.cc: Likewise.
10864 * data/yacc.c: Likewise.
10865 * data/yacc.c: Reformat comments slightly.
10866 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
10867 for consistency. Fix some spelling errors and reword recently-included
10868 text slightly.
10869 * tests/cxx-type.at: Cast results of malloc, for C++.
10870
2c3b392a
AD
108712005-12-21 Joel E. Denny <address@hidden>
10872
10873 * tests/cxx-type.at: Construct a tree, count the parents of shared
10874 nodes, and free each node once and only once. Previously, the memory
10875 for semantic values was leaked instead.
10876
d6cff4dc
AD
108772005-12-21 Joel E. Denny <address@hidden>
10878
10879 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
10880 (yylval, yylloc): If pure, #define to yystackp->yyval and
10881 yystackp->yyloc similar to yychar and yynerrs.
10882 (yyparse): If pure, remove local yylval and yylloc. Add local
10883 yystackp to accommodate pure definitions of yylval and yylloc.
10884 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
10885 yylvalp and yyllocp to &yylval and &yylloc.
10886 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
10887 namespace. Previously, nerrs and char were missing, but lval and lloc
10888 weren't necessary.
10889 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
10890 yylvalp and yyllocp parameters since, if pure, these are now always
10891 accessible through yystackp. If not pure, they are still accessible
10892 globally.
10893 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
10894 `if (YYID (N))' to pacify lint.
10895
a85284cf
AD
108962005-12-21 Akim Demaille <akim@epita.fr>
10897
10898 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
10899 destroy the RHS symbols of a rule.
10900 * data/yacc.c (yylen): Initialize to 0.
10901 Keep its value to the number of items to possibly shift.
10902 In particular, a regular successful parse that ends on YYFINAL by
10903 a (internal) YYACCEPT must not have yylen != 0.
10904 (yyerrorlab, yyreturn): Pop the RHS.
10905 Reorder a bit to emphasize the `shifting' bits of code.
10906 (YYPOPSTACK): Now accept a number of items to pop.
10907 * data/lalr1.cc: Likewise.
10908 * data/glr.c: Formatting changes.
10909 Use goto instead of fall through.
10910 * doc/bison.texinfo (Destructor Decl): Complete.
10911
d508c281
JMG
109122005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10913
10914 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10915 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
10916 * djgpp/config.bat: Replace every occurence of the file name
10917 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10918 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10919 * djgpp/config.sed: Replace every occurence of the file name
10920 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10921 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10922 * djgpp/djunpack.bat: DJGPP specific file.
10923 * djgpp/fnchange.lst: DJGPP specific file.
10924 * djgpp/README.in: Add new information about how to unpack the bison
10925 source on MSDOS and other systems which have 8.3 file name restrictions
10926 using djunpack.bat and fnchange.lst.
10927
3e7a2cd9
PE
109282005-12-12 Paul Eggert <eggert@cs.ucla.edu>
10929
10930 * bootstrap (build_cvs_prefix): Remove; unused.
10931 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
10932 when getting gnulib.
10933
109342005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
10935
10936 * data/glr.c: Reorder typedef declarations for structs to match order
10937 of struct declarations.
10938 Rename yystack everywhere to yystackp except in yyparse where it's not
10939 a pointer.
10940 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
10941 consistency.
10942 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
10943 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
10944 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
10945 lint.
10946
877519f8
PE
109472005-12-09 Paul Eggert <eggert@cs.ucla.edu>
10948
0eca5a39
PE
10949 * tests/sets.at (Accept): Fix typos in regular expression used to
10950 sed out the final state number.
10951
2cec9080
PE
10952 Work around portability problem on Solaris 10: flex-generated
10953 files include <stdio.h> before <config.h>, which messes up
10954 because the latter defines __EXTENSIONS__. Address the problem
10955 by creating two new little files that include <config.h> first,
10956 then include the flex-generated files. Rewrite everyone else
10957 to include <config.h> first, as well.
10958 * lib/timevar.c: Always include "config.h".
10959 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
10960 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
10961 (EXTRA_bison_SOURCES): New macro.
10962 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
10963 * src/system.h: Don't include config.h.
10964 * src/LR0.c: Include <config.h> first.
10965 * src/assoc.c: Likewise.
10966 * src/closure.c: Likewise.
10967 * src/complain.c: Likewise.
10968 * src/conflicts.c: Likewise.
10969 * src/derives.c: Likewise.
10970 * src/files.c: Likewise.
10971 * src/getargs.c: Likewise.
10972 * src/gram.c: Likewise.
10973 * src/lalr.c: Likewise.
10974 * src/location.c: Likewise.
10975 * src/main.c: Likewise.
10976 * src/muscle_tab.c: Likewise.
10977 * src/nullable.c: Likewise.
10978 * src/output.c: Likewise.
10979 * src/parse-gram.y: Likewise.
10980 * src/print.c: Likewise.
10981 * src/print_graph.c: Likewise.
10982 * src/reader.c: Likewise.
10983 * src/reduce.c: Likewise.
10984 * src/relation.c: Likewise.
10985 * src/state.c: Likewise.
10986 * src/symlist.c: Likewise.
10987 * src/symtab.c: Likewise.
10988 * src/tables.c: Likewise.
10989 * src/uniqstr.c: Likewise.
10990 * src/vcg.c: Likewise.
10991
877519f8
PE
10992 * src/parse-gram.y: Fix minor problems uncovered by lint.
10993 (current_lhs, current_lhs_location): Now static.
10994 (current_assoc): Remove unused variable.
10995
10996 Cleanups so that Bison-generated parsers have less lint.
10997 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
10998 Prepend /*ARGSUSED*/, for lint's sake.
10999 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
11000 definition if 'lint' is defined.
11001 (YYID): New macro (or function, if lint).
11002 All uses of /*CONSTCOND*/0 replaced by YYID(0).
11003 * data/yacc.c: Likewise.
11004 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
11005 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
11006 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
11007 is C++ only.
11008 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
11009 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
11010 Use YYID(0) rather than 0, for lint.
11011 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
11012 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
11013
f5228370
PE
110142005-12-07 Paul Eggert <eggert@cs.ucla.edu>
11015
11016 * tests/glr-regression.at
11017 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11018 Close memory leak reported by twlevo.
11019
69ce078b
PE
110202005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
11021
6ff99711
PE
11022 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
11023 all stacks.
11024 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
11025 * tests/glr-regression.at (No users destructors if stack 0 deleted):
11026 New test case.
11027 (Duplicated user destructor for lookahead): This test now is expected
11028 to succeed.
11029
af3412cd
PE
110302005-12-01 Paul Eggert <eggert@cs.ucla.edu>
11031
32b5b719 11032 * NEWS: Document the following change.
af3412cd
PE
11033 * data/yacc.c: Say "parser skeleton" rather than "file", since
11034 it's no longer just a file.
11035 * data/glr.c: Grant a special exception for C GLR parsers, that
11036 reads like the already-existing exception for C LALR(1) parsers.
11037 * data/glr.cc: Likewise.
11038 * data/lalr1.cc: Likewise.
11039 * data/location.cc: Likewise.
11040 * data/yacc.c: Reword the "written by" statement to clarify that
11041 it was the parser skeleton, not the entire output file.
11042 * data/glr.c: Written by Paul Hilfinger.
11043 * data/glr.cc: Written by Akim Demaille.
11044 * data/lalr1.cc: Likewise.
11045
035aa4a0
PE
110462005-11-18 Paul Eggert <eggert@cs.ucla.edu>
11047
d9963c85
PE
11048 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
11049 Fix typos in previous change that broke 'make check'.
11050 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
11051 supported in C.
11052 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
11053 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
11054 We can revert this once things settle down.
11055
035aa4a0
PE
11056 * src/conflicts.c (conflicts_print): Don't print file name twice
11057 when %expect fails because there were no conflicts.
11058 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
11059 change.
11060 * tests/conflicts.at (%expect not enough, %expect too much):
11061 (%expect with reduce conflicts): Adjust to new behavior.
11062
110632005-11-18 Akim Demaille <akim@epita.fr>
11064
11065 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
11066 errors.
11067 * NEWS: Document this.
11068 * doc/bison.texinfo (Expect Decl): Likewise.
11069
d1ff7a7c
AD
110702005-11-16 Akim Demaille <akim@epita.fr>
11071
11072 Generalize the display of semantic values and locations in traces.
11073 * data/glr.c (yy_reduce_print): Fix indices (again).
11074 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
11075 literal integers.
11076 * data/lalr1.cc (yyreduce_print): Rename as...
11077 (yy_reduce_print): this.
11078 Display values and locations.
11079 * data/yacc.c (yy_reduce_print): Likewise.
11080 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
11081 (yysymprint): Move higher to be visible from yy_reduce_print).
11082 (yyparse): Adjust.
11083 * tests/calc.at: Adjust the expected length of the traces.
11084
6de5398d
AD
110852005-11-14 Akim Demaille <akim@epita.fr>
11086
11087 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
11088 from 1 to N, while values and location start at 0.
11089 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
11090
a1373f55
AD
110912005-11-14 Akim Demaille <akim@epita.fr>
11092
11093 * data/glr.c (yy_reduce_print): Fix the $ number.
11094
613d8952
AD
110952005-11-14 Akim Demaille <akim@epita.fr>
11096
11097 "Use" parse parameters.
11098 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
11099 * data/glr.c, data/glr.cc: Use them.
11100 * data/glr.c (YYUSE): Have a C++ definition that supports
11101 non-pointer types.
11102
b2741627
AD
111032005-11-14 Akim Demaille <akim@epita.fr>
11104
11105 * data/glr.c (yyexpandGLRStack): Declare only if defined.
11106
5059b5c8
AD
111072005-11-14 Akim Demaille <akim@epita.fr>
11108
42249483
AD
11109 * data/glr.cc: New.
11110 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 11111
4626a15d
AD
111122005-11-12 Akim Demaille <akim@epita.fr>
11113
11114 Let position and location be PODs.
11115 * data/location.cc (position::initialize, location::initialize): New.
11116 (position::position, location::location): Define only if
11117 b4_location_constructors is defined.
11118 * data/lalr1.cc (b4_location_constructors): Define it for backward
11119 compatibility.
11120 * doc/bison.texinfo (Initial Action Decl): Use initialize.
11121
111222005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
11123
11124 * data/lalr1.cc: Move the body of the ctor and dtor into the
11125 parser file (instead of the header).
11126 Wrap the implementations in a "namespace yy".
11127
111282005-11-12 Akim Demaille <akim@epita.fr>
11129
11130 Have glr.c include its header file when created.
11131 * data/glr.c (b4_shared_declarations): New.
11132 Output them verbatim in the parser if !%defines, otherwise
11133 output then in the header file, and include it instead.
11134
1989d947
AD
111352005-11-11 Akim Demaille <akim@epita.fr>
11136
11137 * data/glr.c: Comment changes.
11138
111392005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
11140
11141 When yydebug, report semantic and location values for reductions.
11142 * data/glr.c (yy_reduce_print): Report the semantic values and the
11143 locations.
11144 (YY_REDUCE_PRINT): Adjust.
11145 (yyglrReduce): Use them.
11146 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
11147 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
11148 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
11149 traces.
11150
02998094
AD
111512005-11-10 Akim Demaille <akim@epita.fr>
11152
11153 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
11154 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
11155 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
11156
5210672f
PE
111572005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
11158
11159 * m4/cxx.m4, examples/Makefile.am: Don't build
11160 examples/calc++ if no C++ compiler is available. (trivial change)
11161
a8991a1d
AD
111622005-11-09 Akim Demaille <akim@epita.fr>
11163
11164 * src/scan-skel.l: Use a couple of asserts.
11165
36b5e963
AD
111662005-11-03 Akim Demaille <akim@epita.fr>
11167
11168 In some (weird) cases, the final state number is incorrect.
11169 Reported by Alexandre Duret-Lutz.
11170 * src/LR0.c (state_list_append): Remove the computation of
11171 final_state.
11172 (save_reductions): Do it here.
11173 (get_state): Alpha conversion.
11174 (generate_states): Use a for loop.
11175 * src/gram.h (item_number_is_rule_number)
11176 (item_number_is_symbol_number): New.
11177 * src/state.c: Use assert.
11178 * src/system.h: Include assert.h.
11179 * tests/sets.at (Accept): New.
11180
44e7ead1
PH
111812005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11182
11183 * data/glr.c (yyfill): Adjust comment.
36b5e963 11184 (yyresolveAction): Initialize default location properly
44e7ead1
PH
11185 for empty right-hand sides.
11186 (yydoAction): Ditto.
11187 Add comment explaining apparently dead code.
36b5e963
AD
11188 * tests/glr-regression.at
11189 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 11190 New test.
36b5e963 11191
e10a80ee
PE
111922005-10-30 Paul Eggert <eggert@cs.ucla.edu>
11193
11194 * bootstrap (cleanup_gnulib): New function. Use it to clean up
11195 gnulib when interrupted. This fixes some race conditions and
11196 works around some portability problems (one noted by Paul
11197 Hilfinger).
11198
067b32ee
AD
111992005-10-22 Akim <akim@epita.fr>
11200
11201 * Makefile.cfg: Adjust to config -> build-aux.
11202 Reported by twledo.
11203
4b367315
AD
112042005-10-21 Akim Demaille <akim@epita.fr>
11205
11206 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
11207 the %parse-params.
11208 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
11209 * data/yacc.c (b4_Pure_if): Rename as...
11210 (b4_yacc_pure_if): this.
11211 (YY_SYMBOL_PRINT, yyparse): Adjust.
11212 * doc/bison.texinfo: Formatting changes.
11213
24cc23d9
AD
112142005-10-21 Akim Demaille <akim@epita.fr>
11215
11216 Finish the transition config -> build-aux.
11217 * configure.ac, Makefile.am: Use build-aux.
11218 * config/prev-version, config/announce-gen, config/Makefile.am:
11219 Move to...
11220 * build-aux/prev-version, build-aux/announce-gen,
11221 * build-aux/Makefile.am: here.
11222
d4476375
AD
112232005-10-14 Akim Demaille <akim@epita.fr>
11224
11225 * examples/calc++/test: Use set -x only when VERBOSE.
11226
302c0aee
PE
112272005-10-13 Paul Eggert <eggert@cs.ucla.edu>
11228
11229 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
11230 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
11231
7625ec2c
AD
112322005-10-13 Akim Demaille <akim@epita.fr>
11233
11234 * src/scan-skel.l: Output the base name parts of the parser and
11235 header file names.
302c0aee 11236 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
11237 additional checks.
11238 Use this to exercise C++ outputs in subdirs.
11239 Reported by Oleg Smolsky.
11240
ba0fe3c7
PE
112412005-10-12 Paul Eggert <eggert@cs.ucla.edu>
11242
11243 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
11244 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
11245 Problem reported by John P. Hartmann.
11246 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
11247 already defined it.
11248
9b8a5ce0
AD
112492005-10-12 Akim Demaille <akim@epita.fr>
11250
11251 * src/parse-gram.y (version_check): Exit 63 to please missing
11252 (stands for "version mismatch).
11253 * tests/input.at, doc/bison.texinfo: Adjust.
11254
4f6e011e
PE
112552005-10-10 Paul Eggert <eggert@cs.ucla.edu>
11256
11257 Work around portability problems with Visual Age C compiler
11258 (xlc and xlC_r) reported by John P. Hartmann.
11259 * data/location.cc (initial_column, initial_line): Remove.
11260 All uses replaced by 0 and 1.
11261 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
11262 that xlc complains about.
11263 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 11264 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 11265 as __STDC__.
4d7aa45e
PE
11266 * data/yacc.c (YYMODERN_C): New macro, which also looks at
11267 __STDC_VERSION__. Use it everywhere instead of looking at
11268 __STDC__ and __cplusplus.
4f6e011e 11269
a1b3bf8c
AD
112702005-10-10 Akim Demaille <akim@epita.fr>
11271
11272 * examples/calc++/test: Be quiet unless VERBOSE.
11273
412e44aa
PE
112742005-10-05 Paul Eggert <eggert@cs.ucla.edu>
11275
2a4647a3
PE
11276 * data/c.m4 (yydestruct, yysymprint):
11277 Use YYUSE instead of casting to void.
11278 * data/glr.c (YYUSE): New macro.
11279 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11280 Use it instead of rolling our own.
11281 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11282 (YYCHK1):
11283 Use /*CONSTCOND*/ to suppress lint warnings.
11284 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11285 (YY_STACK_PRINT): Use 'false' not '0'.
11286 (YYUSE): New macro.
11287 (yysymprint_, yydestruct_): Use it instead of rolling our own.
11288 * data/yacc.c (YYUSE): New macro.
11289 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
11290 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
11291 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
11292
11293
412e44aa
PE
11294 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
11295 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
11296
88c6637f
PE
112972005-10-04 Paul Eggert <eggert@cs.ucla.edu>
11298
2f4f028d
PE
11299 Undo the parts of the unlocked-I/O change that substituted
11300 putc or puts for printf. This might hurt performance a bit,
11301 but some people prefer the printf style.
11302 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
11303 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
11304 All uses replaced by YYFPRINTF and YYDPRINTF.
11305 * data/yacc.c: Likewise.
11306 * lib/bitset.c (bitset_print): Likewise.
11307 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
11308 putc and puts.
11309 * lib/lbitset.c (debug_lbitset): Likewise.
11310 * src/closure.c (print_firsts, print_fderives): Likewise.
11311 * src/gram.c (grammar_dump): Likewise.
11312 * src/lalr.c (look_ahead_tokens_print): Likewise.
11313 * src/output.c (escaped_output): Likewise.
11314 (user_actions_output): Break apart two printfs.
11315 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
11316 * src/reduce.c (reduce_print): Likewise.
11317 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
11318 * src/system.h: Include unlocked-io.h rathe than stdio.h.
11319
88c6637f
PE
11320 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11321 Use assignments rather than casts-to-void to suppress
11322 unused-variable warnings. This pacifies 'lint'.
11323 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
11324 unused-variable warnings.
11325
fb32e373
JMG
113262005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11327
11328 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11329
edb8f44f
PE
113302005-10-02 Paul Eggert <eggert@cs.ucla.edu>
11331
fb9c0b33
PE
11332 Use unlocked I/O for a minor performance improvement on hosts like
11333 GNU/Linux and Solaris that support unlocked I/O. The basic idea
11334 is to use the gnlib unlocked-io module, and to prefer putc and
11335 puts to printf when either will work (since the latter doesn't
11336 come in an unlocked flavor).
11337 * bootstrap (gnulib_modules): Add unlocked-io.
11338 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
11339 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
11340 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
11341 and similarly for puts and putc and printf.
11342 * data/yacc.c: Likewise.
11343 * lib/bitset.c (bitset_print): Likewise.
11344 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
11345 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
11346 to printf.
11347 * lib/lbitset.c (debug_lbitset): Likewise.
11348 * src/closure.c (print_firsts, print_fderives): Likewise.
11349 * src/gram.c (grammar_dump): Likewise.
11350 * src/lalr.c (look_ahead_tokens_print): Likewise.
11351 * src/output.c (escaped_output): Likewise.
11352 (user_actions_output): Coalesce two printfs.
2f4f028d 11353 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
11354 * src/reduce.c (reduce_print): Likewise.
11355 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 11356 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 11357
edb8f44f
PE
11358 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
11359 this confuses xgettext.
11360
b50d2359
AD
113612005-10-02 Akim Demaille <akim@epita.fr>
11362
11363 * bootstrap (gnulib_modules): Add strverscmp.
11364 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
11365 * m4/.cvsignore: Add strverscmp.m4.
11366 * src/parse-gram.y (%require): New token, new rule.
11367 (version_check): New.
11368 * src/scan-gram.l (%require): Adjust.
11369 * tests/input.at (AT_REQUIRE): New.
11370 Use it.
11371 * doc/bison.texinfo (Require Decl): New.
11372 (Calc++ Parser): Use %require.
11373
21667f64
AD
113742005-10-02 Akim Demaille <akim@epita.fr>
11375
11376 * data/location.cc: New.
11377
2b81e969
AD
113782005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
11379 Akim Demaille <akim@epita.fr>
11380
11381 Make sure -odir/foo.cc creates dir/location.hh etc.
11382 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
11383 (spec_file_prefix, spec_verbose_file, spec_graph_file)
11384 (spec_defines_file): Now const.
11385 (dir_prefix): New.
11386 (short_base_name): Remove.
11387 * src/files.c: Adjust.
11388 (dirname.h): Include.
11389 (base_name): Don't prototype it.
11390 (finput): Remove, duplicates gram_in.
11391 (full_base_name, short_base_name): Replace by...
11392 (all_but_ext, all_but_tab_ext): these.
11393 (compute_base_names): Rename as...
11394 (compute_file_name_parts): this.
11395 Update to compute the new variables, including dir_prefix.
11396 Adjust dependencies.
11397 * src/output.c (prepare): Output them.
11398 * src/reader.c: Adjust to use gram_in, not finput.
11399 * src/scan-skel.l (@dir_prefix@): New.
11400
ad6a9b97
JMG
114012005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11402
11403 * lib/subpipe.c: New function end_of_output_subpipe() added
11404 to allow support for non-posix systems. This is a no-op function
11405 for posix systems.
11406
11407 * lib/subpipe.h: New function end_of_output_subpipe() added
11408 to allow support for non-posix systems. This is a no-op function
11409 for posix systems.
11410
11411 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
11412 handle the lack of pipe/fork functionality on non-posix systems.
11413
11414 * djgpp/Makefile.maint: DJGPP specific file.
11415
11416 * djgpp/README.in: DJGPP specific file.
11417
11418 * djgpp/config.bat: DJGPP specific configuration file.
11419
11420 * djgpp/config.sed: DJGPP specific configuration file.
11421
11422 * djgpp/config.site: DJGPP specific configuration file.
11423
11424 * djgpp/config_h.sed: DJGPP specific configuration file.
11425
11426 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
11427
11428 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
11429
fc695704
AD
114302005-10-02 Akim Demaille <akim@epita.fr>
11431
11432 * data/location.cc: New, extract from...
11433 * data/lalr1.cc: here.
11434 (location.hh): Include it after the user prologue, in case the
11435 filename type is defined by the user.
11436 Forward declation location and position before the pre-prologue.
11437 (yyresult_): Rename as...
11438 (yyresult): this, it's a local variable, not an attribute.
11439 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
11440
114412005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
11442
11443 * examples/extexi: Restore the #line generation.
11444
fb9712a9
AD
114452005-09-30 Akim Demaille <akim@epita.fr>,
11446 Alexandre Duret-Lutz <adl@gnu.org>
11447
11448 Move the token type and YYSTYPE in the parser class.
11449 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
11450 (parser::token): New, from the moved free definition of tokens.
11451 (parser::semantic_value): Now a full definition instead of an
11452 indirection to YYSTYPE.
11453 (b4_post_prologue): No longer included in the header file, but
11454 in the implementation file.
11455 * doc/bison.texi (C+ Language Interface): Update.
11456 * src/parse-gram.y: Support unary %define.
11457 * tests/actions.at: Define global_tokens_and_yystype for backward
11458 compatibility until we update the tests.
11459 * tests/calc.at: Idem.
11460 (first_line, first_column, last_line, last_column): Define for lalr1.cc
11461 to simplify the code.
11462
55f0c7b1
PE
114632005-09-29 Paul Eggert <eggert@cs.ucla.edu>
11464
11465 Port to SunOS 4.1.4, which lacks strtoul and strerror.
11466 Ah, the good old days! Problem reported by Peter Klein.
11467 * bootstrap (gnulib_modules): Add strerror, strtoul.
11468 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
11469 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
11470
fb9712a9 114712005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
11472
11473 * data/c.m4 (b4_error_verbose_if): New.
11474 * data/lalr1.cc: Use it.
11475 (YYERROR_VERBOSE_IF): Remove.
11476 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
11477 parser members, replaced by...
11478 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
11479 local variables.
11480 (yysyntax_error_): Takes the state number as argument.
11481 (yyreduce_print_): Use the argument yyrule, not the former
11482 attribute yyn_.
11483
8a6f72f3
PE
114842005-09-26 Paul Eggert <eggert@cs.ucla.edu>
11485
11486 * bootstrap (gnulib_modules): Add verify.
11487 * lib/.cvsignore: Add verify.h.
11488 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
11489 * src/system.h (verify): Remove.
11490 Include verify.h instead.
11491 * src/tables.c (tables_generate): Use new API for 'verify'.
11492
0d50976f
PE
114932005-09-21 Paul Eggert <eggert@cs.ucla.edu>
11494
ebc3737e
PE
11495 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
11496 local variables whose names begin with 'yy'.
11497 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11498 Trivial changes from Joel E. Denny.
11499
0d50976f
PE
11500 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
11501 it itself.
11502 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
11503 don't use alloca any more.
11504
11505 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
11506 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 11507 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
11508 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
11509 to match yacc.c, to test more hosts.
11510
a05b79df
PE
115112005-09-20 Paul Eggert <eggert@cs.ucla.edu>
11512
55289366
PE
11513 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
11514 doesn't affect behavior.
11515 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
11516 Solaris, AIX, MSC.
11517 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
11518 This works a bit better with glibc, if user code has already included
11519 stdlib.h.
11520 * doc/bison.texinfo (Bison Parser): Document that users can't
11521 arbitrarily use malloc and free for other purposes. Document
11522 that <alloca.h> and <malloc.h> might be included.
11523 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
11524 user must declare alloca.
11525
a05b79df
PE
11526 * HACKING (release): Forwarn the Translation Project about
11527 stable releses.
11528
3ab2ca22
AD
115292005-09-20 Akim Demaille <akim@epita.fr>
11530
11531 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
11532
a9739e7c
PE
115332005-09-19 Paul Eggert <eggert@cs.ucla.edu>
11534
a702593e
PE
11535 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
11536 (YYSTACK_ALLOC_MAXIMUM): Use it.
11537 (yysyntax_error): New function.
11538 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
11539 multiple syntax errors are reported, and alloca is being used.
11540 Instead, reallocate buffers twice as big each time, so that
11541 we waste at most half the allocated memory. Start with a small
11542 (128-byte) buffer that will suffice in most cases anyway.
11543 Use yysyntax_error to do most of the work.
11544
11545 * doc/bison.texinfo (Error Reporting, Table of Symbols):
11546 yynerrs is the number of errors reported, not the number of
11547 errors encountered.
11548
a9739e7c
PE
11549 * tests/glr-regression.at (Duplicated user destructor for lookahead):
11550 Mark it as expected to fail.
11551 Cast result of malloc; problem reported by twlevo@xs4all.nl.
11552 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
11553 Don't start user-code symbols with "yy", to avoid name space problems.
11554
f479c6c6
AD
115552005-09-19 Akim Demaille <akim@epita.fr>
11556
11557 Remove the traits, failed experiment.
11558 It never proved useful, and anyway because of the current
11559 definition, it was not possible to have several specialization of
11560 this traits, making it useless.
11561 * data/lalr1.cc (yy:traits): Remove.
11562 Inline its definitions in the parser class.
11563
e2586f82
AD
115642005-09-19 Akim Demaille <akim@epita.fr>
11565
11566 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
11567 least Mac OSX with a /usr/local install of gettext.
11568
2e8cf949
AD
115692005-09-19 Akim Demaille <akim@epita.fr>
11570
11571 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
11572 and yytoken for similarity with the other skeletons.
11573
c7fb0b90
AD
115742005-09-19 Akim Demaille <akim@epita.fr>
11575
4e26c69e 11576 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 11577
1bd0deda
PE
115782005-09-16 Paul Eggert <eggert@cs.ucla.edu>
11579
11580 * NEWS: Version 2.1.
11581
11582 * NEWS: Remove notice of yytname change, since it was never in an
11583 official release.
11584 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
11585 diagnostic.
11586 * src/output.c (prepare): Likewise.
11587 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
11588 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
11589 is not defined. This is an awful hack, but it's enough for now.
11590 All callers changed.
11591 * tests/glr-regression-at (make_value): Args are const pointers now,
11592 to avoid GCC warning.
11593 (Duplicated user destructor for lookahead): New test. Currently
11594 skipped. It fails on my host but I'm not sure it'll always fail.
11595
115962005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
11597
11598 * src/symtab.h (struct symbol): Declare the printer and destructor
11599 as const, to avoid accidental calls to free.
11600 (symbol_destructor_set, symbol_printer_set): Adjust.
11601 * src/symtab.c: Adjust.
11602
1bd0deda 116032005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
11604
11605 * data/c.m4 (b4_token_enums): New.
11606 (b4_token_defines): Rename as...
11607 (b4_token_enums_defines): this.
11608 (b4_token_defines): New, output only the #defines.
11609 * data/yacc.c, data/glr.c: Adjust.
11610 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
11611 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
11612 as default values.
11613
dbcdae2d
AD
116142005-09-16 Akim Demaille <akim@epita.fr>
11615
11616 * data/lalr1.cc (yylex_): Remove, inline its code.
11617 (yyreport_syntax_error_): Remove, replaced by...
11618 (yysyntax_error_): this which returns a string and leaves to the
11619 caller the call to the users' error function.
11620 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
11621 Move from members of the parser object...
11622 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
11623 to local variables of the parse function.
11624
70d8f291
AD
116252005-09-16 Akim Demaille <akim@epita.fr>
11626
11627 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
11628 since it's in Bison's name space.
11629
b47dbebe
PE
116302005-09-15 Paul Eggert <eggert@cs.ucla.edu>
11631
ae199bf1
PE
11632 * data/glr.c (yyresolveValue): Add default case to pacify
11633 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
11634
b47dbebe
PE
11635 * NEWS: Document when yyparse started to return 2.
11636 * doc/bison.texinfo (Parser Function): Document when yyparse
11637 returns 2.
11638
11639 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
11640 (b4_filename_type): Renamed back from b4_file_name_type. All uses
11641 changed.
11642 (class position): file_name -> filename (reverting). All uses changed.
11643
116442005-09-14 Paul Eggert <eggert@cs.ucla.edu>
11645
11646 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
11647 do anything if $@ exists. This reverts part of the 2005-07-07
11648 patch.
11649
00292f66
PE
116502005-09-11 Paul Eggert <eggert@cs.ucla.edu>
11651
11652 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
11653 contains obsolete information and isn't worth distributing as a
11654 separate file anyway.
11655 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
11656 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
11657 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
11658 (yyparse): Abort if user code uses longjmp to throw an unexpected
11659 value.
11660
a420f962
PE
116612005-09-09 Paul Eggert <eggert@cs.ucla.edu>
11662
00292f66
PE
11663 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
11664 Suggested by twlevo@xs4all.nl.
11665
127287e9
PE
11666 * data/glr.c (YYCHK1): Do not assume YYE is in range.
11667 This avoids a diagnostic from gcc -Wswitch-enum.
11668 Problem reported by twlevo@xs4all.nl.
11669
a420f962
PE
11670 * doc/bison.texinfo: Don't use "filename", as per GNU coding
11671 standards. Use "file name" or "file" or "name", depending on
11672 the context.
11673 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
11674 not to hack/foo.tab.c.
11675 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
11676 * data/glr.c: b4_filename -> b4_file_name.
11677 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
11678 All uses changed.
11679 (class position): filename -> file_name. All uses changed.
11680 * data/yacc.c: b4_filename -> b4_file_name.
11681 * lib/bitset.h: filename -> file_name in local vars.
11682 * lib/bitset_stats.c: Likewise.
11683 * src/files.c: Likewise.
11684 * src/scan-skel.l ("@output ".*\n): Likewise.
11685 * src/files.c (file_name_split): Renamed from filename_split.
11686 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
11687
116882005-09-08 Paul Eggert <eggert@cs.ucla.edu>
11689
11690 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
11691 to accommodate latest gnulib.
11692
11693 * tests/glr-regression.at (Duplicate representation of merged trees):
11694 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
11695
11696 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
11697 needed.
11698
42a6501d
PE
116992005-08-26 Paul Eggert <eggert@cs.ucla.edu>
11700
11701 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
11702 All uses changed. Invoke user destructor after an error during a
11703 split parse (trivial change from Joel E. Denny).
11704
11705 * tests/glr-regression.at
11706 (User destructor after an error during a split parse): New test case.
11707 Problem reported by Joel E. Denny in:
11708 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
11709
ef9a1faf
PE
117102005-08-25 Paul Eggert <eggert@cs.ucla.edu>
11711
5b4aaf78
PE
11712 * README-cvs: Give URLs for recommended tools.
11713 Mention Gzip version problem, and bootstrapping issues.
11714 Remove troubleshooting section, as it's somewhat obsolete.
11715
b5240ba5
PE
11716 * bootstrap (no_cache): New var, to accommodate different wget
11717 variants. Use it instead of '-C off'. Problem reported by
11718 twlevo@xs4all.nl.
11719
ef9a1faf
PE
11720 * data/glr.c (yydestroyStackItem): New function.
11721 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
11722 debugging information. Problem reported by Joel E. Denny.
11723
e6efa9da
AD
117242005-08-25 Akim Demaille <akim@epita.fr>
11725
11726 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
11727
adc90f13
PE
117282005-08-24 Paul Eggert <eggert@cs.ucla.edu>
11729
11730 * data/glr.c (yyrecoverSyntaxError, yyreturn):
11731 Don't invoke destructor on unresolved entries.
11732 * tests/glr-regression.at
11733 (User destructor for unresolved GLR semantic value): New test case.
11734 Problem reported by Joel E. Denny in:
11735 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
11736
f9315de5
PE
117372005-08-21 Paul Eggert <eggert@cs.ucla.edu>
11738
15d29c1f
PE
11739 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
11740 Add strnlen.c.
11741 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
11742 lib-prefix.m4, po.m4.
11743
dd5f2af2
PE
11744 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
11745 in yydestruct diagnostic, since it might not be an error.
11746 Problem reported by Joel Denny near end of
11747 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 11748 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
11749 * data/yacc.c (yyreturn): Likewise.
11750 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
11751
11752 * src/files.c: Remove obsolete FIXME comment.
11753
11754 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
11755 with the other templates, and to fix bogus run-on messages such
11756 as the one reported at the end of
11757 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11758 All callers changed to avoid the newline.
11759 (yyprocessOneStack): Output two lines rather than one, to accommodate
11760 the above change. This changes the debug output format slightly.
11761
f9315de5
PE
11762 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
11763 reported by Joel E. Denny in
11764 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
11765 (trivial change).
11766 * tests/glr-regression.at (Duplicate representation of merged trees):
11767 New test, from Joel E. Denny in:
11768 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
11769 * THANKS: Add Joel E. Denny.
11770
11771 * configure.ac (AC_INIT): Bump to 2.0c.
11772
04098407
PE
117732005-07-24 Paul Eggert <eggert@cs.ucla.edu>
11774
11775 * NEWS: Version 2.0b.
11776
ca5d2013
PE
11777 * Makefile.am (SUBDIRS): Put examples before tests, so that
11778 "make check" doesn't finish with "All 1 tests passed".
11779
3d54b576
PE
11780 * tests/regression.at (Token definitions): Don't rely on
11781 AT_PARSER_CHECK for data that contains backslashes. It currently
11782 uses 'echo', and 'echo' isn't portable if its argument contains
11783 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
11784 that the byte '\0xff' is not printable in the C locale; it is,
11785 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
11786 not printable, so use '\0x81' to test.
11787
d53ae497
PE
11788 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
11789 version of GCC, since the macro is used with non-GCC compilers.
11790
fc01665e
PE
11791 Fix core dump reported by Pablo De Napoli in
11792 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
11793 * tests/regression.at (Invalid inputs with {}): New test.
11794 * src/parse-gram.y (token_name): Translate type before using
11795 it as an index.
11796
04098407
PE
11797 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
11798 the user's name space. All uses changed to __attribute__
11799 ((__unused__)).
11800 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
11801 Add __attribute__ ((__noreturn__)).
11802
11803 * etc/clcommit: Remove. We weren't using it, and it failed
11804 "make maintainer-distcheck".
11805 * Makefile.maint: Merge from coreutils.
11806 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
11807 (syntax-check-rules): Change list of rules as described below.
11808 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
11809 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
11810 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
11811 (sc_trailing_space): New rules.
11812 (sc_xalloc_h_in_src): Remove.
11813 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
11814 (sc_space_tab, sc_error_exit_success, sc_changelog):
11815 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
11816 (makefile-check, po-check, author_mark_check):
11817 (makefile_path_separator_check, copyright-check):
11818 Use grep -n, to make it easier to find violations.
11819 Use CVS_LIST and CVS_LIST_EXCEPT.
11820 (header_regexp, h_re): Remove.
11821 (dd_c): New macro.
11822 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
11823 (my-distcheck): Use more-modern GCC flags.
11824 (signatures, %.asc): Remove.
11825 (rel-files, announcement): Remove signatures.
11826 Restore old updating code, even though we don't use it, so
11827 that we're the same as coreutils.
11828 (alpha, beta, major): Depend on news-date-check.
11829 Make the upload commands.
11830
11831 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
11832 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
11833 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
11834 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
11835 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
11836 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
11837 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
11838 * tests/sets.at: Likewise.
11839
11840 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
11841 we comment out the Autoconf version number.
11842 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
11843 it's error-prone and "make maintainer-distcheck" rejects it.
11844
11845 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
11846 Indent calls to "error" to pacify "make maintainer-distcheck",
11847 when the calls are not intended to be translated.
11848 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
11849
11850 * src/Makefile.am (DEFS): Use +=, to pacify
11851 "make maintainer-distcheck".
11852 (bison_SOURCES): Add scan-skel.h.
11853 (sc_tight_scope): New rule, from coreutils.
11854
11855 * src/files.c (src_extension, header_extension):
11856 Now static, not extern.
11857 * src/getargs.c (short_options): Likewise.
11858 * src/muscle_tab.c (muscle_table): Likewise.
11859 * src/parse-gram.y (current_class, current_type, current_prec):
11860 Likewise.
11861 * src/reader.c (grammar_end, previous_rule_end): Likewise.
11862 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
11863 * src/main.c (main): Cast bindtextdomain and textdomain calls to
11864 void, to avoid warning when NLS is disabled.
11865 * src/output.c: Include scan-skel.h.
11866 (scan_skel): Remove decl, since scan-skel.h does this.
11867 (output_skeleton):
11868 Indent calls to "error" to pacify "make maintainer-distcheck".
11869 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
11870 * src/reader.h (gram_end, gram_lineno): New decls to pacify
11871 "make maintainer-distcheck".
11872 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
11873 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
11874 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
11875 (skel_lex_destroy, scan_skel): Move these decls to...
11876 * src/scan-skel.h: New file.
11877 * src/uniqstr.c (uniqstr_assert):
11878 Indent calls to "error" to pacify "make maintainer-distcheck".
11879
11880 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
11881 not @VAR@.
11882
11883 * tests/torture.at: Revamp to avoid misuse of atoi that
11884 "make maintainer-distcheck" complained about.
11885
11886 * examples/extexi (message): Don't print a message more than once,
11887 and omit line-number decoration that makes Emacs compile think
11888 that informative messages are worth worrying about.
11889
118902005-07-22 Paul Eggert <eggert@cs.ucla.edu>
11891
11892 * configure.ac: Update version number.
11893
11894 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
11895 accidentally.
11896 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
11897 autogenerated by the maintainer.
11898 * examples/calc++/.cvsignore: Add *.yy.
11899
11900 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
11901 * lib/bitset_stats.c (bitset_stats_init): Likewise.
11902 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11903
11904 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
11905
11906 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
11907 from maintainer-distcheck about casting the argument of 'free'.
11908
11909 * NEWS: Mention recent yytname changes.
11910 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
11911
11912 * bootstrap: For translations that have not yet been upgraded to
11913 the new runtime-po domain, prime the pump by extracting the
11914 relevant strings from the obsolete translations. This code can be
11915 removed once the bison-runtime domain has been translated by each
11916 team.
11917
11918 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
11919 now that token names are already quoted.
11920
11921 Fix problem reported by Anthony Heading.
11922 * data/glr.c (YYTOKEN_TABLE): New macro.
11923 (yytname): Define if YYTOKEN_TABLE.
11924 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
11925 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
11926 (YYERROR_VERBOSE): Define the same way the other skeletons do.
11927 * src/output.c (prepare_symbols): Output token_table_flag.
11928
0ffda363
PE
119292005-07-21 Paul Eggert <eggert@cs.ucla.edu>
11930
11931 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
11932 again if the first call fails.
11933
11934 * data/glr.c (yytnamerr): New function.
11935 (yyreportSyntaxError): Use it to dequote most string literals.
11936 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
11937 with other skeletons. All uses changed.
11938 (yytnameerr_): New function.
11939 (yyreport_syntax_error): Use it to dequote most string literals.
11940 * data/yacc.c (yytnamerr): New function.
11941 (yyerrlab): Use it to decode most string literals.
11942 * doc/bison.texinfo (Decl Summary, Calling Convention):
11943 Clarify quoting convention of yytname.
11944 * src/output.c (prepare_symbols): Quote all names. This undoes
11945 the 2005-04-17 change, which is now accomplished (mostly) via
11946 changes in the parsers as described above.
11947 * tests/regression.at (Token definitions, Web2c Actions):
11948 Undo most 2005-04-17 change here, too.
11949
119502005-07-20 Paul Eggert <eggert@cs.ucla.edu>
11951
11952 Fix more problems reported by twlevo@xs4all.nl.
11953 * tests/cxx-type.at: Don't pipe output of ./types through sed to
11954 remove trailing spaces. This loses the exit status of ./types,
11955 and isn't needed since ./types shouldn't be emitting trailing
11956 spaces.
11957 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
11958 as the stack isn't valid in that case.
11959
11960 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
11961 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
11962 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
11963 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
11964 is used.
11965 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
11966 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
11967 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
11968 Likewise.
11969
11970 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
11971 overly-picky compilers that reject 'char *foo = "bar";'.
11972
11973 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
11974 to FILE * parameter, not to stderr. This fixes a typo introduced
11975 in the 2005-07-12 change.
11976
11977 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
11978 warnings from GCC 4.
11979
11980 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
11981 (yyglrShiftDefer, yysplitStack):
11982 Remove unused parameters b4_pure_formals. All uses changed.
11983 (yyglrShift): Remove unused parameters b4_user_formals.
11984 All uses changed.
11985 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
11986
6100a9aa
PE
119872005-07-18 Paul Eggert <eggert@cs.ucla.edu>
11988
258b75ca
PE
11989 Destructor cleanups and regularization among the three skeletons.
11990 * NEWS: Document the behavior changes.
11991 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
11992 stack before failing, as the cleanup code will do it for us now.
11993 * data/lalr1.cc (yyerrlab): Likewise.
11994 * data/glr.c (yyparse): Pop everything off the stack before
11995 freeing it, so that destructors get called properly.
11996 * data/lalr1.cc (yyreturn): Likewise.
11997 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
11998 This is more consistent.
11999 * doc/bison.texinfo (Destructor Decl): Mention more reasons
12000 why destructors might be called. 1.875 -> 2.1.
12001 (Destructor Decl, Decl Summary, Table of Symbols):
12002 Some English-language cleanups for %destructor.
12003 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12004 Add output line for destructor of start symbol.
12005 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
12006 because of that same extra output line.
12007
1a059451
PE
12008 * NEWS: Document minor wording changes in diagnostics of
12009 Bison-generated parsers.
12010 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
12011 Remove unused formals. All uses changed.
12012 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
12013 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
12014 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
12015 Rename yyoverflowab to yyexhaustedlab.
12016 When memory exhaustion occurs during syntax-error reporting,
12017 report it separately rather than in a single diagnostic; this
12018 eases translation.
12019 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
12020 (Memory Exhausted): Renamed from Parser Stack Overflow.
12021 Revamp wording slightly to prefer "memory exhaustion".
12022 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
12023
97460c78
PE
12024 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
12025
30757c8c
PE
12026 Add i18n support to the GLR skeleton. Partially fix the C++
12027 skeleton; a C++ expert needs to finish this. Remove debugging
12028 msgids; there's little point to having them translated, since they
12029 can be understood only by someone who can read the
12030 (English-language) source code.
12031
12032 Generate runtime-po/bison-runtime.pot automatically, so that we
12033 don't have to worry about garbage getting in that file. We'll
12034 make sure after the next official release that old msgids don't
12035 get lost. See
12036 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
12037
12038 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
12039 Now auto-generated.
12040 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
12041 Fix typos in explanations of the runtime file.
12042 * bootstrap: Change gettext keyword from YYI18N to YY_.
12043 Use standard Makefile.in.in in runtime-po, since we'll arrange
12044 for backward-compatible bison-runtime.po files in a different way.
12045 * data/glr.c (YY_): New macro, from yacc.c.
12046 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
12047 Translate messages intended for users.
12048 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
12049 the wording in the other skeletons. We don't know that the memory
12050 is virtual.
12051 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
12052 Use same method that yacc.c uses.
12053 Don't translate debugging messages.
12054 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
12055 it doesn't work (yet), and requires C++ expertise to fix.
12056 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
12057 Move defn to a more logical place, to be consistent with other
12058 skeletons.
12059 Don't translate debugging messages.
12060 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
12061 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
12062 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
12063 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
12064
ac8c5689
PE
12065 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
12066 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
12067 void, not int.
12068 * tests/glr-regression.at (Badly Collapsed GLR States):
12069 Likewise.
12070 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
12071 yylex should return 0 at EOF rather than aborting.
12072
6100a9aa
PE
12073 Improve tests for stack overflow in GLR parser.
12074 Problem reported by twlevo@xs4all.nl.
12075 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
12076 All uses removed.
12077 (yyStackOverflow): Just longjmp, but with value 2 so that caller
12078 can handle the problem.
12079 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
12080 (yyparse): New local variable yyresult to record the result.
12081 Use result of setjmp to set it, rather than storing itinto
12082 struct.
12083 (yyDone): Remove label.
12084 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
12085 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
12086 if YYABORT is used).
12087 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
12088 yyparse status; put status > 1 into diagnostic.
12089 Check that status==2 works.
12090 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
12091 Use exit status 3 for failure to open (which shouldn't happen).
12092
15f40952
PE
120932005-07-17 Paul Eggert <eggert@cs.ucla.edu>
12094
67fd79c4
PE
12095 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
12096 1 on syntax error; just let yyparse do its thing.
12097 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
12098 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
12099 (Exploding the Stack Size with Alloca):
12100 (Exploding the Stack Size with Malloc):
12101 Expect exit status 2, not 1, since the parser is supposed to blow
12102 its stack. Problem reported by twlevo@xs4all.nl.
12103
15f40952
PE
12104 * data/glr.c (yyparse): Don't assume that the initial calls
12105 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
12106 Print a stack-overflow message and fail instead.
12107 Initialize the line-number information before creating the stack,
12108 so that the stack-overflow message can report line zero safely.
12109
f32c66b5
PE
121102005-07-14 Paul Eggert <eggert@cs.ucla.edu>
12111
a22ff96f 12112 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
12113 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
12114 (yyuserMerge): Provide a default case if b4_mergers is empty.
12115 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
12116 * tests/glr-regression.at
12117 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 12118 Add casts to pacify C++ compilers.
1beb0b24
PE
12119 * tests/glr-regression.at (Improper merging of GLR delayed action
12120 sets): Declare yylex before using it.
f32c66b5 12121 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
12122 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
12123 test for valgrind; valgrind is independent of g++.
12124 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
12125 for compatibility with POSIX 1003.1-2001 (if running coreutils).
12126 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
12127 Use a destructor, so that we can expand the stack. Change
12128 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 12129
d741bd1b
PE
121302005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12131
12132 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
12133 a valgrind failure. Problem reported by twlevo@xs4all.nl.
12134
0410a6e0
PE
121352005-07-13 Paul Eggert <eggert@cs.ucla.edu>
12136
12137 * PACKAGING: New file, suggested by Bruno Haible and taken from
12138 similar wording in gettext's PACKAGING file.
12139 * NEWS: Mention PACKAGING.
12140 * Makefile.am (EXTRA_DIST): Add PACKAGING.
12141
f7ab6a50
PE
121422005-07-12 Paul Eggert <eggert@cs.ucla.edu>
12143
baf785db 12144 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
12145 * bootstrap: Get runtime translations into runtime-po.
12146 Create runtime-po files automatically, if possible.
12147 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
12148 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
12149 does not infringe on the user's name space.
12150 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
12151 * doc/bison.texinfo (Internationalization): Revamp the English
12152 and Texinfo syntax a bit, to try to make it clearer.
12153 (Bison Options, Option Cross Key): Mention --print-localedir.
12154 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
12155 YYENABLE_NLS. Quote a bit more.
12156 * runtime-po/.cvsignore: New file.
12157 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
12158 * runtime-po/Rules-quot: Remove; now created by bootstrap.
12159 * runtime-po/quot.sed: Likewise.
12160 * runtime-po/boldquot.sed: Likewise.
12161 * runtime-po/en@quot.header: Likewise.
12162 * runtime-po/en@boldquot.header: Likewise.
12163 * runtime-po/insert-header.sin: Likewise.
12164 * runtime-po/remove-potcdate.sin: Likewise.
12165 * runtime-po/Makevars: Likewise.
12166 * runtime-po/LINGUAS: Likewise.
12167 * runtime-po/de.po: Likewise; we will rely on the translation project
12168 to maintain this, so "bootstrap" should get it.
0410a6e0 12169 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
12170 its value.
12171 * src/main.c (main): Bind the bison-runtime domain, too.
12172
121732005-07-12 Bruno Haible <bruno@clisp.org>
12174
12175 * data/yacc.c: Include <libintl.h> when NLS is enabled.
12176 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
12177 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
12178 * runtime-po: New directory.
12179 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
12180 $(DOMAIN).pot-update rule, so that old messages are never dropped.
12181 * runtime-po/Rules-quot: New file, copied from po/.
12182 * runtime-po/quot.sed: Likewise.
12183 * runtime-po/boldquot.sed: Likewise.
12184 * runtime-po/en@quot.header: Likewise.
12185 * runtime-po/en@boldquot.header: Likewise.
12186 * runtime-po/insert-header.sin: Likewise.
12187 * runtime-po/remove-potcdate.sin: Likewise.
12188 * runtime-po/Makevars: New file.
12189 * runtime-po/POTFILES.in: New file.
12190 * runtime-po/LINGUAS: New file.
12191 * runtime-po/bison-runtime.pot: New file.
12192 * runtime-po/de.po: New file.
12193 * m4/bison.m4: New file.
12194 * Makefile.am (SUBDIRS): Add runtime-po.
12195 (aclocaldir, aclocal_DATA): New variables.
12196 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
12197 Define aclocaldir.
12198 * src/getargs.c (usage): Document --print-localedir option.
12199 (PRINT_LOCALEDIR_OPTION): New enum item.
12200 (long_options): Add --print-localedir option.
12201 (getargs): Handle --print-localedir option.
12202 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
12203 (Internationalization): New section.
12204
22dda0f0
AD
122052005-07-12 Akim Demaille <akim@epita.fr>
12206
12207 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
12208 for consistency with the rest of the code.
12209 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
12210 Add separators.
12211
82b248ad
AD
122122005-07-12 Akim Demaille <akim@epita.fr>
12213
12214 * src/parse-gram.y: Use %printer instead of YYPRINT.
12215
fa0e9314
AD
122162005-07-12 Akim Demaille <akim@epita.fr>
12217
867a3e00
AD
12218 * src/symtab.h, src/symtab.c (symbol_print): New.
12219 * src/symlist.h, src/symlist.c (symbol_list_print): New.
12220 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
12221
122222005-07-12 Akim Demaille <akim@epita.fr>
12223
12224 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
12225 b4_at_dollar and b4_dollar_dollar.
12226
e054b190
PE
122272005-07-11 Paul Eggert <eggert@cs.ucla.edu>
12228
12229 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
12230 and Pennello's paper.
12231
34160ec4
PE
122322005-07-09 Paul Eggert <eggert@cs.ucla.edu>
12233
407d4a75
PE
12234 * data/yacc.c (yyparse): Undo previous patch. Instead,
12235 set yylsp[0] and yyvsp[0] only if the initial action
12236 sets yylloc and yylval, respectively.
12237
34160ec4
PE
12238 * data/yacc.c (yyparse): In the initial action, set
12239 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
12240 This avoids the use of undefined variables if the initial
12241 action does not set yylloc and/or yylval.
12242
c3d5a4a7
PE
122432005-07-07 Paul Eggert <eggert@cs.ucla.edu>
12244
b34d96c1
PE
12245 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
12246 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
12247 Remove from CVS. These files are automatically generated.
12248 * examples/extexi: Clarify that this file is now part of Bison,
12249 not GNU M4, and that it works with any POSIX-compatible Awk.
12250 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
12251 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
12252 so that we also get calc++-parser.yy. Geneate it.
12253 Use $(AWK), not gawk, since any conforming Awk will do.
12254 Put comment before action, since older 'make' can't handle comment
12255 in action.
12256 $(BUILT_SOURCES): List all built sources, not just some of them.
12257 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
12258 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
12259 $($(calc_sources_generated)): Remove unnecessary test for existence
12260 of target. (This had a shell syntax error anyway; a stray "x".)
12261 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
12262 calc++-parser.yy.
12263 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
12264
c3d5a4a7
PE
12265 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
12266 implied by the other modules.
12267
828c373b
AD
122682005-07-06 Akim Demaille <akim@epita.fr>
12269
12270 Bind examples/calc++ to the package.
12271 * examples/calc++/Makefile: Remove, replaced by...
12272 * examples/calc++/Makefile.am: ... this new file.
12273 * examples/calc++/test: Remove input.
12274 * examples/calc++/compile: Remove.
12275 * examples/Makefile.am: New.
12276 * configure.ac, Makefile.am: Adjust.
12277 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
12278
63cb01d6
PE
122792005-07-05 Paul Eggert <eggert@cs.ucla.edu>
12280
fd2df2ed
PE
12281 * data/glr.c (yyFail): Drastically simplify; since the format argument
12282 never had any % directives, we can simply pass it to yyerror.
12283 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
12284 be modified later, as that is the usual style in glr.c.
12285 Problems reported by Paul Hilfinger.
12286
63cb01d6
PE
12287 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
12288 and size overflow errors.
12289 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
12290 in case the user prolog sets feature-test macros like _GNU_SOURCE.
12291 (YYSIZEMAX): New macro.
12292 (yystpcpy): New function, taken from yacc.c.
12293 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
12294 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
12295 so that we don't have to maintain their signatures.
12296 (yyFail): Check for buffer overflow, by using vsnprintf rather
12297 than vsprintf. Allocate a bigger buffer if possible.
12298 Report an error if buffer allocation fails.
12299 (yyStackOverflow): New function.
12300 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
12301 the initialization was successful. It might fail if storage was
12302 exhausted.
12303 (yyexpandGLRStack): Add more checks for storage allocation failure.
12304 Use yyStackOverflow to report failures.
12305 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
12306 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
12307 Don't assume stack number fits in int.
12308 (yysplitStack): Check for storage allocation failure.
12309 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
12310 can print diagnostics on storage allocation failure. All callers
12311 changed.
12312 (yyresolveValue): Use yybool for boolean.
12313 (yyreportSyntaxError): Check for size-calculation overflow.
12314 This code is taken from yacc.c.
12315 (yyparse): Check for storage allocation errors when allocating
12316 the initial stack.
12317
1c59e0a1
AD
123182005-07-05 Akim Demaille <akim@epita.fr>
12319
12320 Extract calc++ from the documentation.
12321 * doc/bison.texinfo (Calc++): Add the extraction marks.
12322 * examples/extexi: New, from the aborted GNU Programming 2E.
12323 Separate the different paragraph of a file with empty lines.
12324 * examples/Makefile: Use it to extract the whole calc++ example.
12325
8a0adb01
AD
123262005-06-24 Akim Demaille <akim@epita.fr>
12327
12328 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
12329 class typedefs.
12330
12545799
AD
123312005-06-22 Akim Demaille <akim@epita.fr>
12332
12333 * doc/bison.texinfo (C++ Language Interface): First stab.
12334 (C++ Parsers): Remove.
12335
99be0235
AD
123362005-06-22 Akim Demaille <akim@epita.fr>
12337
12338 * data/lalr1.cc (yylex_): Honor %lex-param.
12339
0ffd4fd1
AD
123402005-06-22 Akim Demaille <akim@epita.fr>
12341
12342 Start a set of simple examples.
12343 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
12344 * examples/calc++/calc++-driver.hh,
12345 * examples/calc++/calc++-parser.yy,
12346 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
12347 * examples/calc++/compile, examples/calc++/test: New.
12348
0925ebb4
PE
123492005-06-09 Paul Eggert <eggert@cs.ucla.edu>
12350
12351 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
12352 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
12353 which stems from the 2005-05-27 patch.
12354
43d3b664
PH
123552005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12356
12357 * data/glr.c: Modify treatment of unused parameters to permit use
12358 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
12359
3062864d
PE
123602005-05-30 Paul Eggert <eggert@cs.ucla.edu>
12361
12362 Fix infringement on user name space reported by Janos Zoltan Szabo.
12363 * data/yacc.c (yyparse): strlen -> yystrlen.
12364
989b5b8e
AD
123652005-05-30 Akim Demaille <akim@epita.fr>
12366
12367 * data/lalr1.cc (_): New.
12368 Translate the various messages.
12369
bedf57f5
PE
123702005-05-27 Paul Eggert <eggert@cs.ucla.edu>
12371
12372 Fix infringement on user name space reported by Bruno Haible.
12373 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
12374 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
12375 the user's name space.
12376 (alloca): Include <stdlib.h> to get it, if it's not built in.
12377 (YYMALLOC, YYFREE): Define only if needed.
12378 (malloc, free): Declare, but only if needed, as this infringes on
12379 the user name space.
12380
4d1801f1
PE
123812005-05-25 Paul Eggert <eggert@cs.ucla.edu>
12382
12383 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
12384 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
12385 with %d format.
12386 * lib/ebitset.c (min, max): Undef before defining.
12387 * lib/vbitset.c (min, max): Likewise.
12388 * lib/subpipe.c (create_subpipe): Save local variables in case
12389 vfork clobbers them.
12390
123912005-05-24 Bruno Haible <bruno@clisp.org>
12392
12393 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
12394 error message syntax used by gcc-4.0.
12395
b94a9e1e
PE
123962005-05-23 Paul Eggert <eggert@cs.ucla.edu>
12397
85ac3861
PE
12398 * README: Mention m4 1.4.3. Remove obsolete advice about
12399 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
12400
b94a9e1e
PE
12401 * bootstrap: Remove workaround for problem I encountered with
12402 gettext 0.14.1; it seems to be fixed now.
12403
51c30d21
PE
124042005-05-22 Paul Eggert <eggert@cs.ucla.edu>
12405
009ce67d
PE
12406 * NEWS: Version 2.0a.
12407
f2a97c62
PE
12408 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
12409 the previous change.
12410
c8775f93
PE
12411 Various maintainer cleanups.
12412 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
12413 conftest*, for benefit of CVS commands run at the same time as
12414 "configure". Add build-aux, since "bootstrap" now creates it and
12415 its subfiles.
12416 * Makefile.cfg (move_if_change): Remove.
12417 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
12418 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
12419 (po_repo, do-po-update, po-update, wget_files, get-targets):
12420 (config.guess-url_prefix, config.sub-url_prefix):
12421 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
12422 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
12423 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
12424 Remove.
12425 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
12426 this is now the recommended name.
12427 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
12428 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
12429 ylwrap. These files now go into build-aux.
12430 * config/move-if-change: Remove.
12431 * config/prev-version.txt: Bump from 1.75 to 2.0.
12432
3ea5f0ec
PE
12433 * bootstrap: Add stdio-safer, unistd-safer modules.
12434 Remove m4/glibc2.m4 (introduced by latest gnulib, but
12435 we don't need it).
12436 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
12437 fopen-safer.c, stdio-safer.h, unistd-safer.h.
12438 * lib/subpipe.c: Include "unistd-safer.h".
12439 (create_subpipe): Make sure all the newly-created
12440 file descriptors are > 2, so that diagnostics don't
12441 get sent down them (which might cause Bison to hang, in theory).
12442 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
12443 * src/files.c (xfopen): Use fopen_safer, not fopen.
12444
51c30d21
PE
12445 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
12446 yesterday's yacc.c fix.
12447
cea1469d
PE
124482005-05-21 Paul Eggert <eggert@cs.ucla.edu>
12449
3ea5f0ec
PE
12450 * data/glr.c, data/lalr1.cc: Update copyright date.
12451
cea1469d
PE
12452 Fix a destructor bug reported by Wolfgang Spraul in
12453 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
12454 * data/yacc.c (yyabortlab): Don't call destructor, and
12455 don't set yychar to EMPTY.
12456 (yyoverflowlab): Don't call destructor.
12457 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
12458 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
12459 since we no longer output the message "discarding lookahead token
12460 end of input ()".
12461
5e6f62f2
PH
124622005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12463
12464 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
12465 fix a small glitch in debugging output.
12466 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
12467 after YY_SYMBOL_PRINT where needed.
12468
12469 (struct yyGLRState): Add some comments.
12470 (struct yySemanticOption): Add some comments.
12471 (union yyGLRStackItem): Add comment.
12472
12473 (yymergeOptionSets): Correct this to properly perform the union,
12474 avoiding infinite reported by Michael Rosien.
12475 Update comment.
12476
12477 * tests/glr-regression.at: Add test for GLR merging error reported
12478 by M. Rosien.
cea1469d 12479
0fb669f9
PE
124802005-05-13 Paul Eggert <eggert@cs.ucla.edu>
12481
12482 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
12483 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
12484 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
12485 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
12486 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
12487 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
12488 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
12489 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
12490 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
12491 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
12492 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
12493 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
12494 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
12495 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
12496 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
12497 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
12498 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
12499 src/derives.h, src/files.c, src/files.h, src/getargs.c,
12500 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
12501 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
12502 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
12503 src/output.h, src/parse-gram.c, src/parse-gram.h,
12504 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
12505 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
12506 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
12507 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
12508 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
12509 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
12510 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
12511 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
12512 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
12513 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
12514 tests/reduce.at, tests/regression.at, tests/sets.at,
12515 tests/synclines.at, tests/testsuite.at, tests/torture.at:
12516 Update FSF postal mail address.
12517
51f4735e
PE
125182005-05-11 Paul Eggert <eggert@cs.ucla.edu>
12519
12520 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
12521 Problem reported by Ralf Menzel.
12522
80ce3401
PE
125232005-05-01 Paul Eggert <eggert@cs.ucla.edu>
12524
12525 * tests/actions.at: Test that stack overflow invokes destructors.
12526 From Marcus Holland-Moritz.
12527 * data/yacc.c (yyerrlab): Move the code that destroys the stack
12528 from here....
12529 (yyreturn): to here. That way, destructors are called properly
12530 even if the stack overflows, or the user calls YYACCEPT or
12531 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
12532 (yyoverflowlab): Destroy the lookahead.
12533
125342005-04-24 Paul Eggert <eggert@cs.ucla.edu>
12535
12536 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
12537
72f000b0
PE
125382005-04-17 Paul Eggert <eggert@cs.ucla.edu>
12539
12540 * NEWS: Bison-generated C parsers no longer quote literal strings
12541 associated with tokens.
12542 * src/output.c (prepare_symbols): Don't escape strings,
12543 since users don't want to see C escapes.
12544 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
12545 in diagnostics.
c19683bb 12546 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
12547 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
12548
1094323f
PE
125492005-04-16 Paul Eggert <eggert@cs.ucla.edu>
12550
12551 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
12552 the data size is known to be too small and we can't increase it.
12553 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
12554
ca407bdf
PE
125552005-04-15 Paul Eggert <eggert@cs.ucla.edu>
12556
12557 * src/parse-gram.y: Include quotearg.h.
12558 (string_as_id): Quote $1 before using it as a key, since the
12559 lexer no longer quotes it for us.
12560 (string_content): Don't strip quotes, since lexer no longer
12561 quotes it for us.
12562 * src/scan-gram.l: Include quotearg.h.
12563 ("\""): Omit quote.
12564 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
12565 a key, since the rest of the lexer doesn't quote it.
12566 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
12567 * tests/regression.at (Token definitions): Check for backslashes
12568 in token strings.
12569
12570 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
12571 (YYSIZE_T): Define to unsigned long int when using an older compiler.
12572 (yyparse): Revamp code to generate long syntax error message, to
12573 make it easier to translate, and to avoid problems with arithmetic
12574 overflow. Change "virtual memory" to "memory" in diagnostic, since
12575 we don't know whether the memory is virtual.
12576
1ce59070
PE
125772005-04-13 Paul Eggert <eggert@cs.ucla.edu>
12578
12579 * NEWS: Bison-generated C parsers now use the _ macro to
12580 translate strings.
12581 * data/yacc.c (_) [!defined _]: New macro.
12582 All English strings wrapped inside this macro.
12583 * doc/bison.texinfo (Bison Parser): Document _.
12584 * po/POTFILES.in: Include src/parse-gram.c, since it now
12585 includes translateable strings that parse-gram.y doesn't.
12586
a749a695
PE
125872005-04-12 Paul Eggert <eggert@cs.ucla.edu>
12588
12589 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
12590 reverting the 2004-10-11 change to this function.
12591 (symbol_check_alias_consistency): Don't call symbol_type_set
12592 if the type name is already correct.
12593 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
12594
8fb1053b
PE
125952005-03-25 Paul Eggert <eggert@cs.ucla.edu>
12596
12597 * tests/regression.at (Token definitions): Don't use a token named
12598 c, as that generates a "#define c ..." that runs afoul of buggy
12599 stdlib.h that uses the identifier c as a member of struct
12600 drand48_data. Problem reported by Horst Wente.
12601
ff498c4a
PE
126022005-03-21 Paul Eggert <eggert@cs.ucla.edu>
12603
12604 * bootstrap: Change translation URL from
12605 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
12606 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
12607 redirection glitches. Problem reported by twlevo@xs4all.nl.
12608
65211d70
PE
126092005-03-20 Paul Eggert <eggert@cs.ucla.edu>
12610
12611 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
12612 after operands; POSIX says this isn't portable for the c99 command.
12613
9577fb1f
PE
126142005-03-18 Paul Eggert <eggert@cs.ucla.edu>
12615
12616 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
12617 immediately if a data overrun has occurred; this may help us track
12618 down what may be a spurious failure on MacOS.
12619
78b178f7
PE
126202005-03-17 Paul Eggert <eggert@cs.ucla.edu>
12621
a2599d0f
PE
12622 Respond to problems reported by twlevo@xs4all.nl.
12623
12624 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
12625
78b178f7
PE
12626 * src/vcg.h: Comment fix.
12627 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
12628 (G_CMAX): Change to -1 instead of INT_MAX.
12629
12630 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 12631
7296e729
PE
126322005-03-15 Paul Eggert <eggert@cs.ucla.edu>
12633
12634 * src/tables.c (state_number_to_vector_number): Put it inside an
12635 "#if 0", since it's not currently used. Problem reported by
12636 Roland McGrath.
12637
05ac60f3
PE
126382005-03-06 Paul Eggert <eggert@cs.ucla.edu>
12639
12640 * src/output.c (escaped_output): Renamed from
12641 escaped_file_name_output, since we now use it for symbol tags as
12642 well. All uses changed.
12643 (symbol_destructors_output, symbol_printers_output):
12644 Escape symbol tags too.
12645 Problem reported by Matyas Forstner in
12646 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
12647
12648 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
12649 not needed.
12650 * src/output.c (user_actions_output, token_definitions_output,
12651 symbol_destructors_output, symbol_printers_output): Likewise.
12652 * src/reader.c (prologue_augment): Likewise.
12653 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
12654
12655 * src/vcg.c (output_edge): Don't quote linestyle arg.
12656 Problem reported by twlevo@xs4all.nl.
12657
7eb453ac
PE
126582005-02-28 Paul Eggert <eggert@cs.ucla.edu>
12659
12660 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
12661 example, reported by Derek M Jones. Also, make the example even
12662 more outrageous, to better illustrate how bad the problem is.
12663
4c04c52a
PE
126642005-02-24 Paul Eggert <eggert@cs.ucla.edu>
12665
12666 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
12667 putsym. Typo reported by Sebastian Piping.
12668
a61e1620
PE
126692005-02-23 Paul Eggert <eggert@cs.ucla.edu>
12670
12671 * doc/bison.texinfo (Language and Grammar): some -> same
12672 (Epilogue): int he -> in the
12673 Typos reported by Sebastian Piping via Justin Pence.
12674
9ec93868
PE
126752005-02-07 Paul Eggert <eggert@cs.ucla.edu>
12676
12677 * tests/glr-regression.at (Improper handling of embedded actions
12678 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
12679 embedded actions and $-N in GLR parsers", work around an Autoconf bug
12680 with dollar signs in test names.
12681 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
12682 for a similar reason.
12683
73ce7e7e
PE
126842005-01-28 Paul Eggert <eggert@cs.ucla.edu>
12685
12686 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
12687 wants to redefine G_VIEW.
12688
2e72b98e
PE
126892005-01-27 Paul Eggert <eggert@cs.ucla.edu>
12690
12691 * src/vcg.c (get_view_str): Remove case for normal_view.
12692 Problem reported by twlevo@xs4all.nl.
12693
e0d634e5
PE
126942005-01-24 Paul Eggert <eggert@cs.ucla.edu>
12695
ccf830a4
PE
12696 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
12697 Problem reported by twlevo@xs4all.nl.
12698
e0d634e5
PE
12699 * doc/bison.texinfo: Change @dircategory from "GNU programming
12700 tools" to "Software development". Requested by Richard Stallman
12701 via Karl Berry.
12702
7bbc8cb0
PE
127032005-01-23 Paul Eggert <eggert@cs.ucla.edu>
12704
12705 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
12706 Problem reported by twlevo@xs4all.nl.
12707
08b770bc
PE
127082005-01-21 Paul Eggert <eggert@cs.ucla.edu>
12709
12710 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
12711 keyword; it's not needed with modern compilers, and it doesn't
12712 affect correctness with older compilers. Suggested by
12713 twlevo@xs4all.nl.
12714
95f22ad2
PE
127152005-01-17 Paul Eggert <eggert@cs.ucla.edu>
12716
12717 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
12718 gcc -Wswitch-default.
12719 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12720 * data/yacc.c (yyparse): Likewise.
12721
d229d15c
PE
127222005-01-12 Paul Eggert <eggert@cs.ucla.edu>
12723
12724 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
12725 already. Let config.h define any nonstandard values.
12726
ecadd90f
PE
127272005-01-10 Paul Eggert <eggert@cs.ucla.edu>
12728
12729 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
12730 for the benefit of slower hosts. Problem reported by
12731 Nelson H. F. Beebe.
12732
213744b5
PE
127332005-01-07 Paul Eggert <eggert@cs.ucla.edu>
12734
12735 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
12736 being defined and not used.
12737 * data/lalr1.cc (yyparse): Likewise.
12738 Use "if (false)" rather than "if (0)".
12739
249d3236
PE
127402005-01-05 Paul Eggert <eggert@cs.ucla.edu>
12741
12742 * TODO: Mention that we should allow NUL bytes in tokens.
12743
987cc1fb
PE
127442005-01-02 Paul Eggert <eggert@cs.ucla.edu>
12745
12746 * src/scan-skel.l (<<EOF>>): Don't close standard output.
12747 Problem reported by Hans Aberg.
12748
08fe02d9
PE
127492005-01-01 Paul Eggert <eggert@cs.ucla.edu>
12750
12751 * src/getargs.c (version): Happy new year; update overall
12752 program copyright date from 2004 to 2005.
12753
12754 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
12755 Problem reported by Hans Aberg.
12756 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
12757 (Output file names.): Add a test for the case when standard output
12758 is closed.
12759
010c0266
PE
127602004-12-26 Paul Eggert <eggert@cs.ucla.edu>
12761
12762 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
12763 to fix an oversight in the Bison 2.0 manual.
12764
da12206a
PE
127652004-12-25 Paul Eggert <eggert@cs.ucla.edu>
12766
12767 * NEWS: Version 2.0. Reformat the existing news items since
12768 1.875, so that related items are grouped together.
3a4734aa 12769 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
12770 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
12771
c935d934
PE
12772 * tests/torture.at (Exploding the Stack Size with Alloca): Set
12773 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
12774 otherwise, we're not testing alloca. Unfortunately there's no
12775 simple way to consult HAVE_ALLOCA here.
12776
da12206a
PE
12777 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
12778 for yymsg, too.
12779
12780 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
12781 hand. This avoids a warning about comparing int to size_t when
12782 GCC warnings are enabled.
12783
0a2c5137
PE
127842004-12-22 Paul Eggert <eggert@cs.ucla.edu>
12785
d7e14fc0
PE
12786 * NEWS: Bison-generated parsers no longer default to using the
12787 alloca function (when available) to extend the parser stack, due
12788 to widespread problems in unchecked stack-overflow detection.
12789 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
12790 responsibility to set it to a positive value. This lets the user
12791 specify a value that is not a preprocessor constant.
12792 * data/yacc.c (YYMAXDEPTH): Likewise.
12793 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
12794 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
12795 to be a compile-time constant. However, explain the constraints on it.
12796 Also, explain the constraints on YYINITDEPTH.
12797 (Table of Symbols): Explain that alloca is no longer the default.
12798 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
12799 to 1.
12800
0a2c5137
PE
12801 * doc/bison.texinfo (Location Default Action): Mention that n must
12802 be zero when k is zero. Suggested by Frank Heckenbach.
12803
e019c247
AD
128042004-12-22 Akim Demaille <akim@epita.fr>
12805
12806 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
12807 (parser::state_type, parser::semantic_type, parser::location_type):
12808 Private, not public.
12809 (parser::parse): Return ints, not bool.
12810 Returning a bool introduces a problem: 0 corresponds to false, and
12811 it seems weird to return false on success. Returning true changes
12812 the conventions for yyparse.
12813 Alternatively we could return void and send an exception.
12814 There is no clear consensus (yet?).
12815 (state_stack, semantic_stack, location_stack): Rename as...
12816 (state_stack_type, semantic_stack_type, location_stack_type): these.
12817 Private, not public.
12818 * tests/c++.at: New.
12819 * tests/testsuite.at, tests/Makefile.am: Adjust.
12820
72731bb7
AD
128212004-12-21 Akim Demaille <akim@epita.fr>
12822
12823 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
12824
9a0d8bec
AD
128252004-12-21 Akim Demaille <akim@epita.fr>
12826
12827 Don't impose std::string for filenames.
12828
12829 * data/lalr1.cc (b4_filename_type): New.
12830 (position::filename): Use it.
12831 (parser.hh): Move the inclusion of stack.hh and location.hh below
12832 the user code, so that needed headers for the filename type can be
12833 included first.
72731bb7
AD
12834 Forward declare them before the user code.
12835 * tests/Makefile.am (check-local, installcheck-local): Pass
12836 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 12837
99880de5
AD
128382004-12-20 Akim Demaille <akim@epita.fr>
12839
12840 Use more STL like names: my_class instead of MyClass.
12841
12842 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
12843 (SemanticStack, SemanticType, StateStack, StateType)
12844 (TokenNumberType, Stack, Slice, Traits, Parser::location)
12845 (Parser::value): Rename as...
12846 (location_stack, location_type, rhs_number_type, semantic_stack)
12847 (semantic_type, state_stack, state_type, token_number_type, stack)
12848 (slice, traits, parser::yylloc, parser::yylval): these.
12849
12850 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
12851
9bec482e
PE
128522004-12-19 Paul Eggert <eggert@cs.ucla.edu>
12853
12854 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
12855 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12856
f6fbd3da
PE
128572004-12-17 Paul Eggert <eggert@cs.ucla.edu>
12858
12859 Remove uses of 'short int' and 'unsigned short int'. This raises
12860 some arbitrary limits. It uses more memory but nowadays that's
12861 not much of an issue.
12862
12863 This change does not affect the generated parsers; that's a different
12864 task, as some users will want to conserve memory there.
12865
12866 Ideally we should use size_t to represent all object counts, and
12867 something like ptrdiff_t to represent signed differences of object
12868 counts; but that will require more code-cleanup than I have the
12869 time to do right now.
12870
12871 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
12872 Use size_t, not int or short int, to count objects.
12873 * src/closure.c (nritemset, closure): Likewise.
12874 * src/closure.h (nritemset, closure): Likewise.
12875 * src/nullable.c (nullable_compute): Likewise.
12876 * src/print.c (print_core): Likewise.
12877 * src/print_graph.c (print_core): Likewise.
12878 * src/state.c (state_compare, state_hash): Likewise.
12879 * src/state.h (struct state): Likewise.
12880 * src/tables.c (default_goto, goto_actions): Likewise.
12881
12882 * src/gram.h (rule_number, rule): Use int, not short int.
12883 * src/output.c (prepare_rules): Likewise.
12884 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
12885 errs, reductions): Likewise.
12886 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
12887 Likewise.
12888 * src/tables.c (vector_number, tally, action_number,
12889 ACTION_NUMBER_MINIMUM): Likewise.
12890 * src/output.c (muscle_insert_short_int_table): Remove.
12891
efeed023
AD
128922004-12-17 Akim Demaille <akim@epita.fr>
12893
12894 * data/lalr1.cc: Extensive Doxygenation.
12895 (error_): Rename as...
12896 (error): this, since it is visible to the user.
12897 Adjust callers.
12898 (Parser::message): Now an automatic variable from...
12899 (Parser::yyreport_syntax_error_): here.
12900 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
12901 Parser::error.
12902 * tests/input.at: Escape $.
12903
bc82c5a5
PE
129042004-12-16 Paul Eggert <eggert@cs.ucla.edu>
12905
12906 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
12907 Parenthesize rhs to avoid obscure problems with mistakes like
12908 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
12909 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12910 b4_rhs_location): Likewise.
12911 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12912 b4_rhs_location): Likewise.
12913
fd19f271
AD
129142004-12-16 Akim Demaille <akim@epita.fr>
12915
12916 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
12917 yacc.c: be sure to stay within yycheck_.
12918 * tests/actions.at: Re-enable C++ tests.
12919
10454ea4
AD
129202004-12-16 Akim Demaille <akim@epita.fr>
12921
12922 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
12923 real.
12924
c5b95ccf
AD
129252004-12-16 Akim Demaille <akim@epita.fr>
12926
12927 Use #define to handle the %name-prefix.
12928
12929 * data/glr.c, data/yacc.c: Comment changes.
12930 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
12931 so that one can refer to yylex in the parser file, and have it
12932 renamed, as is the case with other skeletons.
12933
617a8f12
AD
129342004-12-16 Akim Demaille <akim@epita.fr>
12935
12936 Move lalr1.cc internals into yy*.
12937
12938 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
12939 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
12940 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
12941 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
12942 (empty_, final_, terror_, errcode_, ntokens_)
12943 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
12944 (looka_, ilooka_, error_range_, nerrs_):
12945 Rename as...
12946 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
12947 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
12948 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
12949 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
12950 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
12951 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
12952 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
12953 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
12954 these.
12955
1e547e6e
PE
129562004-12-15 Paul Eggert <eggert@cs.ucla.edu>
12957
12958 Fix some problems reported by twlevo at xs4all.
12959 * src/symtab.c (symbol_new): Report an error if the input grammar
12960 contains too many symbols. This is better than calling abort() later.
12961 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
12962 (struct node, struct graph):
12963 Rename member expand to stretch. All uses changed.
12964 (struct graph): Remove member layoutalgorithm. All uses removed.
12965 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
12966 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
12967 All uses changed.
12968 (N_STRETCH): Rename from N_EXPAND. All uses changed.
12969
735d6bd4
AD
129702004-12-15 Akim Demaille <akim@epita.fr>
12971
12972 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
12973 Add more Doxygen comments.
12974 (symprint_, stack_print_, reduce_print_, destruct_, pop)
12975 (report_syntax_error_, translate_): Rename as...
12976 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
12977 (yypop_, yyreport_syntax_error_, yytranslate_): this.
12978
2e1f5829
AD
129792004-12-15 Akim Demaille <akim@epita.fr>
12980
12981 * data/lalr1.cc (lex_): Rename as...
12982 (yylex_): this.
12983 Move the trace here.
12984 Take the %name-prefix into account.
12985 Reported by Alexandre Duret-Lutz.
12986
a3cb6248
AD
129872004-12-15 Akim Demaille <akim@epita.fr>
12988
12989 Simplify the C++ parser constructor.
12990
12991 * data/lalr1.cc (debug_): Rename as...
12992 (yydebug_): so that the parser's internals are always in the yy*
12993 pseudo namespace.
12994 Adjust uses.
12995 (b4_parse_param_decl): Remove the leading comma as it is now only
12996 called as unique argument list.
12997 (Parser::Parser): Remove the constructor accepting a location and
12998 an initial debugging level.
12999 Remove from the other ctor the argument for the debugging level.
13000 (debug_level_type, debug_level, set_debug_level): New.
13001
13002 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
13003 constructor calls.
13004
07fed891
AD
130052004-12-15 Akim Demaille <akim@epita.fr>
13006
13007 Remove b4_root related material: failure experiment
a3cb6248 13008 (which goal was to allow to derive from a class).
07fed891
AD
13009
13010 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
13011 definitions and uses.
13012
e603eaa5
PE
130132004-12-14 Paul Eggert <eggert@cs.ucla.edu>
13014
13015 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
13016 not 2, since it's not portable to subtract 1 from the start of an
13017 array. The new item 0 is never set or used. All uses changed.
13018
13019 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
13020 the default definition of YYLLOC_DEFAULT. Problem reported
13021 by Frank Heckenbach.
13022
fafb007d
PE
130232004-12-12 Paul Eggert <eggert@cs.ucla.edu>
13024
13025 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
13026 the normal case and one for the error case. Just use the
13027 first one uniformly. Problem reported by Frank Heckenbach.
13028 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
13029 use exactly the same macro in both places.
13030 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
13031 so that the normal-case YYRHSLOC works for the error case too.
13032 All uses changed.
13033 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
13034 (YYLLOC_DEFAULT): Use the same macro as glr.c.
13035 * doc/bison.texinfo (Location Default Action): Don't claim that
13036 we have an array of locations. Use the same macro for both glr
13037 and lalr parsers. Mention YYRHSLOC. Mention what happens when
13038 the index is 0.
13039
48814dcd
PE
130402004-12-10 Paul Eggert <eggert@cs.ucla.edu>
13041
a4e1a53b
PE
13042 * HACKING: Update email addresses to send announcements to.
13043
48814dcd
PE
13044 * configure.ac (AC_INIT): Bump version to 1.875f.
13045
337116ba
PE
130462004-12-10 Paul Eggert <eggert@cs.ucla.edu>
13047
13048 * NEWS: Version 1.875e.
13049 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
13050
13051 * src/scan-skel.l: Include "complain.h", for "fatal".
13052
13053 * src/relation.h (relation_print, relation_digraph):
13054 Relation sizes are of type relation_node, not size_t (this is
13055 merely a doc fix, since the two types are equivalent).
13056 (relation_transpose): Relation sizes are of type relation_node,
13057 not int.
13058 * src/relation.c: Likewise.
13059 (top, infinity): Now of type relation_node, not int.
13060 (traverse, relation_transpose): Use relation_node, not int.
13061
13062 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
13063 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
13064 (yyparse): Remove unused local introduced in 2004-10-25 patch.
13065
13066 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 13067 specifying whether the test should be skipped. Use it tp
337116ba 13068 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 13069 fail on some hosts, and should be skipped.
337116ba 13070
da2a7671
PE
130712004-12-08 Paul Eggert <eggert@cs.ucla.edu>
13072
13073 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
13074 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
13075 unless otherwise specified below.
13076
13077 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
13078 to allocate kernel_base, kernel_items, kernel_size, since
13079 they needn't be initialized to 0.
13080 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
13081 * src/closure.c (new_closure): Likewise, for itemset.
13082 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
13083 * src/lalr.c (set_goto_map): Likewise, for temp_map.
13084 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
13085 (build_relations): Likewise for edge, states1, includes.
13086 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
13087 * src/reader.c (packgram): Likewise, for ritem, rules.
13088 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
13089 * src/relation.c (relation_digraph): Likewise for VERTICES.
13090 (relation_transpose): Likewise for new_R, end_R.
13091 * src/symtab.c (symbols_token_translations_init): Likewise for
13092 token_translations.
13093 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
13094 (token_actions): Likewise for yydefact, actrow, conflrow,
13095 conflict_list.
13096 (save_column): Likewise for froms[symno], tos[symno].
13097 (goto_actions): Likewise for state_count.
13098 (pack_table): Likewise for base, pos, check.
13099 (tables_generate): Likewise for width.
13100
13101 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
13102 for initial core. Just have a separate core, so we needn't worry
13103 about whether kernel_size and kernel_base are initialized.
13104
13105 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
13106 kernel_size, kernel_items): Remove unnecessary initialization.
13107 * src/conflicts.c (conflicts): Likewise.
13108 * src/derives.c (derives): Likewise.
13109 * src/muscle_tablc (muscle_insert): Likewise.
13110 * src/relation.c (relation_digraph): Likewise.
13111 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
13112 conflrow, conflict_table, conflict_list, table, check):
13113 Likewise.
13114
13115 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
13116 This is because all callers pass unsigned int.
13117 * src/closure.h (new_closure): Likewise.
13118
13119 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
13120 (build_relations): Initialize includes[i] in all cases.
13121 * src/reader.c (packgram): Always initialize rules[ruleno].prec
13122 and rules[ruleno].precsym. Initialize members in order.
13123 * src/relation.c (relation_transpose): Always initialize new_R[i]
13124 and end_R[i].
13125 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
13126
13127 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
13128 conflict_list[0] was always 0, but now it isn't initialized.
13129
13130 * src/table.c (table_grow): When conflict_table grew, the grown
13131 area wasn't cleared. Fix this.
13132
13133 * lib/.cvsignore: Add strdup.c, strdup.h.
13134 * m4/.cvsignore: Add strdup.m4.
13135
00baeeac
PE
131362004-12-07 Paul Eggert <eggert@cs.ucla.edu>
13137
13138 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
13139 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
13140 GOTO_NUMBER_MAXIMUM, since we occasionally compute
13141 ngotos + 1 without checking for overflow.
13142 (build_relations): Use END_NODE, not -1, to denote end of edges.
13143 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
13144 build_relations): Use goto_number, not int, for goto numbers.
13145 * src/tables.c (save_column, default_goto): Likewise.
13146
be3d9d42
AD
131472004-11-23 Akim Demaille <akim@epita.fr>
13148
13149 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
13150 of #defining from yystype.
13151 Don't typedef yystype, C++ does not need it.
13152 This lets it possible to forward declare it as union.
13153
78e526d5
PE
131542004-11-23 Paul Eggert <eggert@cs.ucla.edu>
13155
13156 * bootstrap (gnulib_modules): Add extensions.
13157 Problem reported by Jim Meyering.
13158
afbb696d
PE
131592004-11-22 Paul Eggert <eggert@cs.ucla.edu>
13160
13161 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
13162 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
13163 src/system.h, src/tables.c: XFREE -> free, to accommodate
13164 recent change to gnulib xalloc.h.
78e526d5 13165 Problem reported by Jim Meyering.
afbb696d 13166
c1f8f16a
AD
131672004-11-17 Akim Demaille <akim@epita.fr>
13168
13169 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
13170
db7e5eb5 131712004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
13172 Alexandre Duret-Lutz <adl@gnu.org>
13173
13174 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
13175 changes.
13176 (YYCDEBUG): Adjust.
13177 Use it instead of cdebug_.
13178 (Parser::debug_stream, Parser::set_debug_stream): New.
13179 (Parser::symprint_): Define cdebug_ for temporary backward
13180 compatibility.
13181 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
13182 debug_stream ().
13183
68e11668
AD
131842004-11-17 Akim Demaille <akim@epita.fr>
13185
13186 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
13187 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
13188 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
13189 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13190
97cbc73e
PE
131912004-10-27 Paul Eggert <eggert@cs.ucla.edu>
13192
13193 * data/glr.c (yyloc_default): Remove; not used.
13194 Problem reported by Frank Heckenbach.
13195
e342c3be
AD
131962004-10-25 Akim Demaille <akim@epita.fr>
13197
13198 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
13199 Introduce another definition to address simple location arrays.
13200 (yyGLRStack): New member: yyerror_range.
13201 (yyrecoverSyntaxError, yyparse): Update it.
13202 (yyrecoverSyntaxError): Use it when shifting the error token to
13203 have an accurate range, equivalent to the one computed by both
13204 yacc.c and lalr1.cc.
13205 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
13206 that column numbers start at column 0, as per GNU Coding
13207 Standards, the others tests, and the doc.
13208 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
13209 Adjust to the above change (first column is 0).
13210 And adjust the location of the "<error>", now covering the whole
13211 line.
13212
93602feb 132132004-10-22 Akim Demaille <akim@epita.fr>
04098407 13214 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
13215
13216 Remove some arbitrary limits on goto numbers and relations.
13217 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
13218 initial values, since they're never used.
13219 (set_goto_map): ngotos is now unsigned, so test for overflow
13220 by seeing whether it wraps around to zero.
13221 * src/lalr.h (goto_number): Now size_t, not short int.
13222 (GOTO_NUMBER_MAXIMUM): Remove.
13223 * src/relation.c (relation_print, traverse, relation_transpose):
13224 Check for END_NODE rather than looking at sign.
13225 * src/relation.h (END_NODE): New macro.
13226 (relation_node): Now size_t, not short int.
13227
dba08b04
PE
132282004-10-22 Paul Eggert <eggert@cs.ucla.edu>
13229
13230 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
13231 keyword, not an identifier. Problem reported by Baron Schwartz in
13232 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
13233
df09ef2e
AD
132342004-10-11 Akim Demaille <akim@epita.fr>
13235
13236 * src/symtab.c (symbol_check_alias_consistency): Also check
13237 type names, destructors, and printers.
13238 Reported by Alexandre Duret-Lutz.
13239 Recode the handling of associativity and precedence in terms
13240 of symbol_precedence_set.
13241 Accept no redeclaration at all, not even equal to the previous
13242 value.
13243 (redeclaration): New.
13244 Use it to factor redeclaration complaints.
13245 (symbol_make_alias): Don't set the type of the alias, let
13246 symbol_check_alias_consistency do it as for other features.
13247 * src/symtab.h (symbol): Add new member prec_location, and
13248 type_location.
13249 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
13250 * tests/input.at (Incompatible Aliases): New.
13251
146bc99d
PE
132522004-10-09 Paul Eggert <eggert@cs.ucla.edu>
13253
13254 .cvsignore fixes to accommodate gnulib changes,
13255 and the practice of naming build directories "_build".
13256 * .cvsignore: Add "_*". Sort.
13257 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
13258 * m4/.cvsignore: Add "*_gl.m4".
13259
e503aa60
AD
132602004-10-06 Akim Demaille <akim@epita.fr>
13261
13262 * src/parse-gram.y (add_param): Fix the truncation of trailing
13263 spaces.
13264
b4a20338
AD
132652004-10-05 Akim Demaille <akim@epita.fr>
13266
13267 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
13268 whether the reducion was empty or not. This leaves room to
13269 improve the use of YYLLOC_DEFAULT in such a case.
13270 lalr1.cc is still experimental, so changing this is acceptable.
13271 And finally, there are probably not many users who changed the
13272 handling of locations in GLR, so changing is admissible too.
13273
13274 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
13275 empty reduction, set @$ to an empty location ending the previously
13276 stacked symbol.
13277 Adjust uses to make sure the code is triggered on empty
13278 reductions.
13279 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
13280 expected output: empty reductions have empty locations.
13281
f85a5e6f
AD
132822004-09-29 Akim Demaille <akim@epita.fr>
13283
13284 * data/lalr1.cc: Move towards a more standard C++ coding style
13285 for templates: Class < T > -> Class<T>.
13286
b203fc2c
AD
132872004-09-29 Akim Demaille <akim@epita.fr>
13288
13289 * data/lalr1.cc: Reinstall the former ctor, for sake of
13290 compatibility, but warn it will be removed.
13291 Move towards a more standard C++ coding style (i.e., type *var ->
13292 type* var).
13293
5b7e1e73
PE
132942004-09-27 Paul Eggert <eggert@cs.ucla.edu>
13295
3fee967f
PE
13296 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
13297 since it's less likely to work if NULs are involved in the future.
5b7e1e73 13298
0dcca5c2
AD
132992004-09-27 Akim Demaille <akim@epita.fr>
13300
13301 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
13302
6dde1c82
AD
133032004-09-27 Akim Demaille <akim@epita.fr>
13304
13305 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 13306 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
13307 and argument names.
13308 (b4_cc_constructor_call): Likewise.
13309
b233d555
AD
133102004-09-24 Akim Demaille <akim@epita.fr>
13311
13312 * src/parse-gram.y (add_param): Strip the leading and trailing
13313 blanks from a formal argument declaration.
13314 (YY_LOCATION_PRINT): New.
13315
619404e3
AD
133162004-09-24 Akim Demaille <akim@epita.fr>
13317
13318 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
13319 after the location.
13320
dd8d9022
AD
133212004-09-24 Akim Demaille <akim@epita.fr>
13322
13323 * doc/bison.texinfo (Table of Symbols): Sort.
13324
0092f063
AD
133252004-09-21 Akim Demaille <akim@epita.fr>
13326
13327 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
13328 the useless parentheses.
13329 Suggested by Paul Eggert.
13330
451364ed
AD
133312004-09-20 Akim Demaille <akim@epita.fr>
13332
13333 Let the initial-action act on the look-ahead, and use it for the
13334 "initial push" (corresponding to an hypothetical beginning-of-file).
13335 And let lalr1.cc honor %initial-action.
13336
13337 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
13338 example.
13339 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
13340 (Parser::Parser): Remove the ctor that used to initialize it.
13341 (Parser::parse): Like in the other skeletons, issue the "starting
13342 parse" message before any action.
13343 Honor %initial-action.
13344 Initialize the stacks with the lookahead.
13345 * data/yacc.c: Let $$ and @$ in %initial-action designate the
13346 look-ahead.
13347 Push them in the stacks.
13348 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
13349
18d192f0
AD
133502004-09-20 Akim Demaille <akim@epita.fr>
13351
13352 * doc/bison.texinfo (Initial Action Decl): New.
13353
b8458aa5
AD
133542004-09-20 Akim Demaille <akim@epita.fr>
13355
13356 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
13357 clearer criterion to define it.
13358 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
13359 When reducing on an empty RHS, use the latest stacked location as
13360 location.
13361 yylloc is not always available.
13362 * data/glr.c: Likewise.
13363 Also, honor initial-actions.
13364
3fc16193
AD
133652004-09-20 Akim Demaille <akim@epita.fr>
13366
13367 * data/yacc.c (YY_LOCATION_PRINT): New.
13368 Define when we know YYLTYPE's structure, i.e., when the default
13369 YYLLOC_DEFAULT is used.
13370 * data/c.m4 (b4_yysymprint_generate): Use it.
13371 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
13372 value of the result.
13373 (error_start_): Replace with...
13374 (error_range_): this location array.
13375 This allows to replace code relying on the implementation of
13376 locations by portable code.
13377 * data/yacc.c (yylerrsp): Replace with...
13378 (yyerror_range): this.
13379 Every time a token is popped, update yyerror_range[0], to have an
13380 accurate location for the error token.
13381 * data/glr.c (YY_LOCATION_PRINT): New.
13382 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
13383 deference a pointer.
13384 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
13385 report the location in %printers.
13386
13387 * src/scan-skel.l: Instead of abort, report error messages to ease
13388 understanding skeleton scanning failures.
13389
ecfe33e7
AD
133902004-09-16 Akim Demaille <akim@epita.fr>
13391
13392 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
13393 (iterator, const_iterator): these, to be more in the C++ spirit.
13394 Also, return reverse iterators so that when displaying the stack
13395 we display its bottom first.
13396 (Parser::stack_print_, Parser::reduce_print_): Match the messages
13397 from yacc.c.
13398 We should probably use vector here though.
13399
1576d44d
AD
134002004-09-16 Akim Demaille <akim@epita.fr>
13401
13402 Have more complete shift traces.
13403
13404 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
13405 to report Shifts instead of ad hoc YYDPRINTF invocations,
13406 including for the error token.
13407 * data/lalr1.cc (symprint_): Output the location.
13408 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
13409 output the location within the %printer.
13410 Activate GLR tests, at least to make sure they compile properly.
13411 They still don't pass though.
13412 * tests/calc.at: Adjust expect verbose output, since now "Entering
13413 state..." is on a different line than the "Shifting" message.
13414
9c66f418
AD
134152004-09-08 Akim Demaille <akim@epita.fr>
13416
13417 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
13418 Bison directive from the Bison file to the invocation of this
13419 macro, so that these directives are passed to
13420 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
13421 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
13422 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
13423 the extra Bison directives instead of the whole series.
13424 Change the grammar so that there are recoverable errors, and
13425 unrecoverable errors. Now we can have the parser give up before
13426 consuming the whole input. As a result we now can observe that
13427 the lookahead is freed when needed.
13428 Change the parser source to parse argv[1] instead of a hard coded
13429 string.
13430 Simplify yylex, and give a value and location to EOF.
13431 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
13432 passed directives already coded in the file.
13433 Add some tests to check the location of "error".
13434 For some tests, the C++ parser is correct, and not yacc.c.
13435 For other tests, they provide different, but unsatisfying, values,
13436 so keep the C++ value so that at least one parser is "correct"
13437 according to the test suite.
13438 (Actions after errors): Remove, this is subsumed by the
13439 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
13440
52d5733f
AD
134412004-09-06 Akim Demaille <akim@epita.fr>
13442
13443 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 13444 (Parser::pop): New.
52d5733f
AD
13445 Use it.
13446
a0e68930
AD
134472004-09-06 Akim Demaille <akim@epita.fr>
13448
13449 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
13450 argument, an informative message.
13451 Call YY_SYMBOL_PRINT.
13452 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
13453 * data/lalr1.cc (destruct_): Likewise.
13454 In addition, no longer depend on b4_yysymprint_generate and
13455 b4_yydestruct_generate to generate these functions, do it "by
13456 hand".
13457
e757bb10
AD
134582004-09-03 Akim Demaille <akim@epita.fr>
13459
13460 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
13461 invoked, yydestruct the lookahead.
13462 * tests/calc.at (Calculator $1): Update the expected lengths of
13463 traces: there is an added line for the discarded lookahead.
13464 * doc/bison.texinfo (Destructor Decl): Some rewording.
13465 Define "discarded" symbols.
13466
0fe1f06d
AD
134672004-09-02 Akim Demaille <akim@epita.fr>
13468
13469 * data/lalr1.cc (translate_, destruct_): No reason to be static.
13470
284acc8b
AD
134712004-09-02 Akim Demaille <akim@epita.fr>
13472
13473 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
13474 (YYDSYMPRINTF): Rename as...
13475 (YY_SYMBOL_PRINT): this.
13476 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
13477 two.
13478 Use it instead of direct symprint_ calls.
13479 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
13480 one.
13481
a5eb1ed2
AD
134822004-09-02 Akim Demaille <akim@epita.fr>
13483
b7c72fe1
AD
13484 * data/lalr1.cc (b4_yysymprint_generate): New.
13485 (symprint_): New member function, defined when YYDEBUG.
13486 Use it consistently instead of token/nterm debugging output by
13487 hand.
a5eb1ed2
AD
13488 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
13489 %printer calls to use cdebug_ when using lalr1.cc.
13490
417141dd
AD
134912004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
13492
13493 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
13494 with #ifdef YYDEBUG.
13495
2fa09258
AD
134962004-08-26 Akim Demaille <akim@epita.fr>
13497
13498 * doc/bison.texinfo (Implementing Loops): Rename as...
13499 (Implementing Gotos/Loops): this.
13500
9378b508
PE
135012004-08-13 Paul Eggert <eggert@cs.ucla.edu>
13502
13503 Adjust to latest gnulib.
13504 * bootstrap (gnulib_modules): Add xalloc-die.
13505 Set LC_ALL=C so that file names sort consistently.
13506 Prefer the gnulib copies of gettext.m4, glibc21.m4,
13507 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
13508 uintmax_t.m4, ulonglong.m4.
13509 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
13510 po.m4 since we are now using _gl.m4 instead.
13511
87a8ad5c
PE
135122004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
13513
13514 * src/scan-action.l: Remove. Scanning of semantic actions is
13515 handled in scan-gram.l.
13516
dca81a78
PE
135172004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
13518
13519 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
13520
13521 * src/location.h (struct): The file member is a uniqstr.
13522 (equal_boundaries): Use UNIQSTR_EQ for comparison.
13523
c9cbf7c5
PE
135242004-07-22 Paul Eggert <eggert@cs.ucla.edu>
13525
13526 Fix bug with non-%union parsers that have printers or destructors,
13527 which led to a Bison core dump. Reported by Peter Fales in
13528 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 13529
c9cbf7c5
PE
13530 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
13531 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
13532 not to our own type.
13533 * src/output.c (symbol_destructors_output, symbol_printers_output):
13534 Don't assume %union.
13535 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
13536 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
13537 UNION-FLAG. All callers changed.
13538 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
13539 Use type char, not unsigned int, when declaring an array of char;
13540 this lets us remove a cast.
13541 (Printers and Destructors): Add non-%union test cases.
13542
fa7e68c3
PE
135432004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13544
13545 * doc/bison.texinfo: Minor editorial changes, mostly to the new
13546 GLR writeups. E.g., avoid frenchspacing and the future tense,
13547 change "lookahead" to "look-ahead", and change "wrt" to "with
13548 respect to".
2fa09258 13549
fa7e68c3
PE
135502004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13551
13552 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
13553 New sections, split off from the GLR Parsers section. Put the new
13554 Simple GLR Parser near the start of the GLR section, for clarity.
13555 Rewrite connective text.
13556
99a9344e
PE
135572004-06-21 Frank Heckenbach <frank@g-n-u.de>
13558
13559 * doc/bison.texinfo (Simple GLR Parsers): New section.
13560
8dd162d3
PE
135612004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13562
13563 * NEWS, TODO, doc/bison.texinfo:
13564 Use "look-ahead" instead of "lookahead", to be consistent.
13565 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
13566 while we're fixing "look-ahead".
13567 * src/conflicts.c (shift_set): Renamed from shiftset.
13568 (look_ahead_set): Renamed from lookaheadset.
13569 * src/print.c: Likewise.
13570 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
13571 name for "lookahead".
13572 (report_types, usage): Likewise.
13573 * src/getargs.h (report_look_ahead_tokens): Renamed from
13574 report_lookaheads.
13575 * src/lalr.c (compute_look_ahead_tokens): Renamed from
13576 compute_lookaheads.
13577 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
13578 (look_ahead_tokens_print): Renamed from lookaheads_print.
13579 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
13580 state_rule_lookaheads_print.
13581 * src/state.h: Likewise.
13582 (reductions.look_ahead_tokens): Renamed from lookaheads.
13583 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
13584 AT_DATA_LOOKAHEADS_GRAMMAR.
13585
57a90331
PE
135862004-06-03 Paul Eggert <eggert@cs.ucla.edu>
13587
13588 * README: Update location of patched M4 distribution.
13589
8ed3234a
PE
135902004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
13591
13592 Don't assume the C++ compiler takes the same arguments as the C compiler
13593 (trivial change).
13594 * configure.ac (O0CXXFLAGS): New var.
13595 * tests/atlocal.in (CXXFLAGS): Use it.
13596
07971983
PE
135972004-05-29 Paul Eggert <eggert@cs.ucla.edu>
13598
13599 Fix some "make check" problems with C++ reported by
13600 Albert Chin-A-Young for Tru64 C++ in this thread:
13601 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
13602
13603 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
13604 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13605 Output to a .cc file for C++, not to a .c file.
13606 * tests/calc.at (AT_CHECK_CALC): Likewise.
13607 * tests/regression.at (AT_CHECK_DANCER): Likewise.
13608 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
13609
29058652
PE
136102004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
13611
13612 * tests/calc.at, tests/actions.at: Workaround for SGI
13613 C++ compiler. (trivial change)
13614
62cb8a99
PE
136152004-05-27 Paul Eggert <eggert@cs.ucla.edu>
13616
fd418816
PE
13617 Spent a few hours checking out which prerequisite versions the
13618 current sources actually require. I went all the way back to
13619 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
13620 a seemingly endless set of combinations of versions more recent
13621 than that. The bottom line is that the current sources require
13622 fairly recent versions of the build tools, and it'll be some work
13623 to change this.
13624 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
13625 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
13626 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
13627 Add comments explaining why those particular versions are
13628 currently needed.
2fa09258 13629
62cb8a99
PE
13630 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
13631 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 13632 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
13633
13634 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
13635 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
13636
caa52c10
PE
136372004-05-26 Paul Eggert <eggert@cs.ucla.edu>
13638
13639 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
13640 0.11.5. Suggested by Bruno Haible.
13641 * bootstrap: Remove gettext version checking.
13642
13643 * doc/bison.texinfo (Decl Summary): Also mention that %union
13644 can depend on prerequisite types. Problem reported by Tim
13645 Van Holder.
13646
4bfd5e4e
PE
136472004-05-25 Paul Eggert <eggert@cs.ucla.edu>
13648
2cef3017
PE
13649 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
13650 * README-alpha: Don't tell people not to package this.
13651
b9c85d5c
PE
13652 * bootstrap: Don't assume $(...) works; use `...` instead.
13653 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
13654 gettext better.
13655
4bfd5e4e
PE
13656 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
13657 put into the -d output file, and mention what to do if YYSTYPE is
13658 defined as a macro.
13659
6a36ff94
PE
136602004-05-24 Paul Eggert <eggert@cs.ucla.edu>
13661
6712933e
PE
13662 Undo change made earlier today: it caused autopoint to not bring
13663 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
13664 autopoint's.
13665
13666 * bootstrap: Check that gettext version matches what's in
13667 configure.ac. Warn users to ignore robots.txt ERROR 404.
13668 * bootstrap: Undo today's earlier change (logged below).
13669 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 13670
6a36ff94
PE
13671 The gettext version checking is causing more trouble than it's
13672 curing; remove it. Problem reported by Paul Hilfinger.
13673
13674 * bootstrap: Issue a warning that one can expect a message
13675 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
13676 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
13677
209ea708
PE
136782004-05-23 Paul Eggert <eggert@cs.ucla.edu>
13679
13680 Ensure that the C++ compiler used for testing actually works on a
13681 simple test program; if not, skip the C++-related tests. Problem
13682 reported by Vin Shelton in:
161a71f3 13683 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
13684
13685 * m4/cxx.m4: New file.
13686 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
13687 * tests/atlocal.in (BISON_CXX_WORKS): Add.
13688 * tests/local.at (AT_COMPILE_CXX): Use it.
13689
41ca2549
PE
136902004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13691
383e69dc
PE
13692 * data/glr.c (yylloc): Output this macro even if locations are not
13693 being generated, as the GLR parser needs it even in that case.
13694 Problem reported by Troy A. Johnson
13695 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
13696
41ca2549
PE
13697 * configure.ac (AC_INIT): Update to 1.875e.
13698
e476c87d
PE
136992004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13700
13701 * NEWS: Version 1.875d.
13702 * configure.ac (AC_INIT): Likewise.
13703 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
13704
13705 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
13706 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
13707 lalr1.cc runs afoul of the first, and the last two are no longer
13708 supported by GCC 3.4.0.
13709 * README: Mention GNU m4 1.4 or later; mention m4 patches.
13710 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
13711
233a88ad
PE
137122004-05-06 Paul Eggert <eggert@cs.ucla.edu>
13713
13714 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
13715 unsigned int, for compatibility with latest gnulib hash module.
13716 * src/state.c (state_hash, state_hasher): Likewise.
13717 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
13718 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 13719
12ffdd28
PE
137202004-05-03 Paul Eggert <eggert@cs.ucla.edu>
13721
13722 * NEWS: Unescaped newlines are no longer allowed in char & strings.
13723
13724 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
13725 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
13726 character and string literals.
13727 (unexpected_end): New function.
13728 (unexpected_eof): Use it.
13729 (unexpected_newline): New function.
13730 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
13731 actions.
e476c87d 13732
12ffdd28
PE
13733 * NEWS: Document %expect-rr.
13734
13735 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
13736 Fix typo by replacing $1 with $option.
13737 Remove more 'intl'-related files.
9668e2be 13738 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
13739
13740 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
13741 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
13742 strtoul.c.
13743 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
13744 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
13745 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
13746 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
13747 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
13748 * src/.cvsignore: Add *.output.
13749
13750 * src/parse-gram.y: Put copyright notice inside %{ %} so it
13751 gets copied to the output file.
e476c87d 13752
1f65350a
PE
137532004-04-28 Paul Eggert <eggert@twinsun.com>
13754
13755 Get files from the gnulib and po repositories, instead of relying
13756 on them being in our CVS. Upgrade to latest versions of gnulib
13757 and Automake.
13758
13759 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
13760 * bootstrap: Bootstrap from gnulib and po repositories.
13761 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
13762 * README-cvs: Document these changes. Remove version numbers from
13763 mentions of build tools, since they change so often. Mention Flex.
13764
13765 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
13766 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
13767 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
13768 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 13769 does this for us.
12ffdd28
PE
13770 (AC_ISC_POSIX): Remove; we no longer support this
13771 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
13772 (AC_HEADER_STDC): Remove: we now assume C89 or better.
13773 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
13774 Do not check for C89 headers, except for locale.h which is used
13775 by the Yacc library and must port to K&R hosts.
13776 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
13777 Do not check for C89 functions, except for setlocale which is
13778 used by the Yacc library.
13779 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
13780 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
13781 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
13782 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
13783 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
13784 AM_GNU_GETTEXT): Remove; now done by:
13785 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
13786 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
13787 for us.
13788
13789 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
13790 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
13791 Define to empty, as gnulib.mk will do the rest for us.
13792 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
13793 for us.
13794 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
13795 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
13796
13797 * src/files.c: Include gnulib's xstrndup.h.
13798
13799 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
13800 (REALLOC): Use xnrealloc, for likewise.
13801 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
13802 (strnlen, memrchr): Remove decls; functions no longer used.
13803 Include <stpcpy.h>.
13804
13805 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
13806 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13807 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
13808 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
13809 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
13810 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
13811 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
13812 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
13813 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
13814 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
13815 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
13816 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13817 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
13818 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
13819 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
13820 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
13821 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
13822 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
13823 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
13824 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
13825 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
13826 Remove, as these files are now generated automatically
13827 by bootstrap or automake.
13828
13829 * po/ChangeLog: Remove: all but one entry was a duplicate
13830 of this file, and I moved that 2000-11-02 entry here.
13831
13832 * config/.cvsignore: Add Makefile, depcomp, install-sh.
13833 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
13834 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
13835 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
13836 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
13837 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
13838 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
13839 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
13840 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
13841 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
13842 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
13843 xstrndup.h.
13844 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
13845 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
13846 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
13847 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
13848 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
13849 * src/.cvsignore: Remove *_.c.
13850
13851
13852 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
13853 support it. (The latest stable gzip doesn't.)
13854
138552004-04-27 Paul Eggert <eggert@twinsun.com>
13856
13857 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
13858 case, as stos_ is now used by destructors due to the 2004-02-09
13859 change.
13860
13861 Remove more K&R C support.
13862 * lib/libiberty.y (PARAMS): Remove. All uses removed.
13863 * lib/subpipe.c (errno): Remove decl.
13864 Include <stdlib.h> unconditionally.
13865 (EXIT_FAILURE): Remove macro.
13866 * src/complain.c (vfprintf, strerror): Remove.
13867 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
13868 unconditionally.
13869 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
13870 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
13871 (strchr, strspn, memchr): Remove decls.
13872 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
13873 unconditionally. Do not declare perror.
13874 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
13875 unconditionally.
13876
13877 * src/complain.c (_): Remove useless defn, as system.h defines this.
13878
13879 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
13880 with latest obstack.h.
13881 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
13882 to procedure types, as obstack.h now does that for us.
13883 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
13884
13885 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
13886 so that this include file can stand alone.
13887 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
13888 does this now. Include subpipe.h first after config.h, to
13889 test whether it can stand alone.
13890
13891 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
13892 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
13893 unused declaration.
13894
13895 * tests/synclines.at (%union synch line): Put a dummy member in
13896 the union, because empty unions aren't allowed in C. Caught
13897 by GCC 3.4.0.
13898
4f16766c
PE
138992004-04-13 Jim Meyering <jim@meyering.net>
13900
13901 * src/conflicts.c (conflicts_print): Correct format string typo:
13902 use `%%' to produce literal `%'. (trivial change)
13903
779e7ceb
PE
139042004-03-30 Paul Eggert <eggert@twinsun.com>
13905
13906 * src/getargs.c (version): Update copyright year to 2004.
13907
13908 * data/c.m4 (b4_int_type): Use 'short int' rather than
13909 'short', and similarly for 'long', 'unsigned', etc.
13910 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13911 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
13912 yy_yypstack, yydumpstack): Likewise.
13913 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
13914 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
13915 Likewise.
13916 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
13917 yy_stack_print, yyparse): Likewise.
13918 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
13919 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
13920 * lib/bitset.c (bitset_print): Likewise.
13921 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
13922 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13923 * lib/bitsetv.c (bitsetv_dump): Likewise.
13924 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
13925 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
13926 Likewise.
13927 * src/LR0.c (allocate_itemsets): Likewise.
13928 * src/gram.h (rule_number, rule): Likewise.
13929 * src/lalr.h (goto_number): Likewise.
13930 * src/nullable.c (nullable_compute): Likewise.
13931 * src/output.c (prepare_rules): Likewise.
13932 * src/relation.c (relation_print, relation_digraph): Likewise.
13933 * src/relation.h (relation_node): Likewise.
13934 * src/state.h (state_number, transitions, errs, reductions,
13935 struct state): Likewise.
13936 * src/symtab.h (symbol_number, struct symbol): Likewise.
13937 * src/tables.c (vector_number, tally, action_number,
13938 default_goto, goto_actions): Likewise.
13939 * tests/existing.at (GNU Cim Grammar): Likewise.
13940 * tests/regression.at (Web2c Actions): Likewise.
13941
13942 * src/output.c (muscle_insert_short_int_table): Renamed from
13943 muscle_insert_short_table. All uses changed.
13944
d6328241
PH
139452004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
13946
13947 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
13948 (declaration): Replace expected_conflicts with expected_sr_conflicts.
13949 Add %expect-rr rule.
4f16766c 13950
d6328241
PH
13951 * src/scan-gram.l: Recognize %expect-rr.
13952
4f16766c 13953 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 13954 expected_conflicts.
4f16766c 13955 (expected_rr_conflicts): Declare.
d6328241
PH
13956
13957 * src/conflicts.c (expected_sr_conflicts): Rename from
13958 expected_conflicts.
13959 (expected_rr_conflicts): Define.
13960 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
13961 for GLR parsers.
13962 Use expected_sr_conflicts in place of expected_conflicts.
13963 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 13964
d6328241 13965 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 13966
1452af69
PE
139672004-03-08 Paul Eggert <eggert@gnu.org>
13968
13969 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 13970 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
13971
13972 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
13973 in lalr1.cc.
13974 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
13975 * src/scan-gram.l (scan_integer): New function.
13976 ({int}): Use it.
13977 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
13978 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
13979 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
13980 Say "long int", not "long", for uniformity with GNU style.
13981
006d217d
PE
139822004-02-25 Paul Eggert <eggert@twinsun.com>
13983
13984 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
13985 compilers. This fixes a problem with Intel's C++ compiler being
13986 chatty, reported by Guido Trentalancia in
161a71f3 13987 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 13988
c2729758
ADL
139892004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
13990
13991 Support %destructor and merge error locations in lalr1.cc.
13992
13993 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
13994 (Parser::stos_): Define unconditionally.
13995 (Parser::destruct_): New method. Generate its body with
13996 b4_yydestruct_generate.
13997 (Parser::error_start_): New attribute.
13998 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
13999 token which are discarded.
14000 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
14001 error_start_ when erroneous token are discarded.
14002 (Parser::parse) <yyerrlab1>: Compute the location of the error
14003 token so that it covers all the discarded tokens.
14004 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
14005 it can be called with `%skeleton "lalr1.cc"', and do that.
14006
dd0e0635
PE
140072004-02-02 Paul Eggert <eggert@twinsun.com>
14008
14009 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
14010 $(top_srcdir)/lib and ../lib. This fixes a bug reported
14011 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
14012 There's no need to mention top_builddir since Automake does that
14013 for us.
14014 (INCLUDES): Remove, as Automake says it's obsolescent.
14015 Contents migrated into AM_CPPFLAGS as described above.
14016 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
14017
140182004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
14019
14020 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
14021 (yyreportSyntaxError): Handle case where lookahead token is
14022 YYEMPTY.
14023
be16239b
PH
140242004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14025
14026 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
14027 resulting parsers are compilable with C++.
14028
5fa90832
PE
140292003-12-23 Paul Eggert <eggert@twinsun.com>
14030
14031 * config/depcomp, config/install-sh: Sync with Automake 1.8.
14032 * src/output.c (output_skeleton): Rename local var.
14033 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
14034 Bison tokens, as this runs afoul of the 2003-10-07 change that
14035 disallowed NUL bytes in character constants or string literals.
14036
14037 * tests/local.at: Require Autoconf 2.59's Autotest.
14038 * tests/testsuite.at: Don't include local.at, since we now assume
14039 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
14040 including it.
14041 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
14042 multiple inclusion warnings.
dd0e0635 14043
b165c324
AD
140442003-12-02 Akim Demaille <akim@epita.fr>
14045
14046 * doc/bison.texinfo (How Can I Reset the Parser): More about start
14047 conditions.
14048 From Bruno Haible.
14049
26e06a21
ADL
140502003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
14051
14052 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
14053
92ac3705
PE
140542003-10-07 Paul Eggert <eggert@twinsun.com>
14055
6a5ecb38
PE
14056 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
14057 if testsuite doesn't exist.
14058
92ac3705
PE
14059 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
14060 literals, unfortunately.
14061 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
14062 Complain about NUL bytes in character constants or string literals.
14063
91d2c560
PE
140642003-10-05 Paul Eggert <eggert@twinsun.com>
14065
14066 * NEWS: Don't document %no-default-prec, as it's still
14067 too experimental.
14068 * doc/bison.texinfo: Document %no-default-prec only if
14069 the defaultprec flag is set. Normally it's not.
14070
0cc3da3a
PE
140712003-10-04 Paul Eggert <eggert@twinsun.com>
14072
14073 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
14074 non-modifiable lvalue, instead of a modifiable one.
14075 * doc/bison.texinfo (Actions): Document that $$ can
14076 be assigned to. Do not claim that $$ and $N are
14077 array element references: user code should not rely on this.
14078
22fccf95
PE
140792003-10-01 Paul Eggert <eggert@twinsun.com>
14080
14081 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
14082 (grammar_declaration): Use it.
14083 * src/scan-gram.l: New token %no-default-prec.
14084 * tests/conflicts.at: Revamp tests to use %no-default-prec.
14085 * NEWS, doc/bison.texinfo: Document the above.
14086
fc8f2965
AD
140872003-10-01 Akim Demaille <akim@epita.fr>
14088
14089 VCG no longer supports long_straight_phase.
14090
14091 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
14092 * src/print_graph.c (print_graph): Adjust.
14093
39a06c25
PE
140942003-09-30 Frank Heckenbach <frank@g-n-u.de>
14095 and Paul Eggert <eggert@twinsun.com>
14096
14097 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
14098 Table of Symbols): Document %default-prec.
14099 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
14100 (grammar_declaration): Set default_prec on %default-prec.
14101 * src/scan-gram.l (%default-prec): New token.
14102 * src/reader.h (default_prec): New flag.
14103 * src/reader.c: Likewise.
14104 (packgram): Handle it.
14105 * tests/conflicts.at (%default-prec without %prec,
14106 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 14107
39a06c25
PE
141082003-09-30 Paul Eggert <eggert@twinsun.com>
14109
14110 * tests/testsuite.at: Include local.at, not input.at, fixing
14111 a typo in the 2003-08-25 patch.
14112
62b6aef9
AD
141132003-08-27 Akim Demaille <akim@epita.fr>
14114
14115 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
14116 GCC warnings.
14117
89e1cc61
AD
141182003-08-26 Akim Demaille <akim@epita.fr>
14119
14120 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
14121 "<\#" to avoid magic from Gnus when posting parts of this script.
14122
a08460b0
AD
141232003-08-26 Akim Demaille <akim@epita.fr>
14124
14125 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
14126 (Parser::parse): here.
14127 Adjust: nerrs and errstatus is now replaced by...
14128 (Parser::nerrs_, Parser::errstatus_): New.
14129
603f1cfd
AD
141302003-08-25 Akim Demaille <akim@epita.fr>
14131
14132 * config/announce-gen, Makefile.cfg: New.
14133 * Makefile.am: Adjust.
14134 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
14135 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
14136
cd3684cf
AD
141372003-08-25 Akim Demaille <akim@epita.fr>
14138
14139 When reducing initial empty rules, Bison parser read an initial
14140 location that is not defined. This results in garbage, and that
14141 affects Bison's own parser. Therefore we need (i) to extend Bison
14142 to support a means to initialize this location, and (ii) to use
14143 this CVS Bison to fix CVS Bison's parser.
14144
14145 * src/reader.h, reader.c (epilogue_augment): Remove, replace
14146 with...
14147 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
14148 * src/parse-gram.y: Adjust.
14149 (%initial-action): New.
14150 (%error-verbose): Since we require CVS Bison, there is no reason
14151 not to use it.
14152 * src/scan-gram.l: Adjust.
14153 * src/Makefile.am (YACC): New, to make sure we use our own parser.
14154 * data/yacc.c (yyparse): Use b4_initial_action.
14155
4e03e201
AD
141562003-08-25 Akim Demaille <akim@epita.fr>
14157
14158 * doc/bison.texinfo: Don't promote stdout for error messages.
14159
8c182d05
AD
141602003-08-25 Akim Demaille <akim@epita.fr>
14161
14162 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
14163 From Alexandre Duret-Lutz.
14164
6a60c4cf
PE
141652003-08-25 Akim Demaille <akim@epita.fr>
14166
14167 Version 1.875c.
14168
25f66e1a
AD
141692003-08-25 Akim Demaille <akim@epita.fr>
14170
14171 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
14172 Use them.
14173
5348bfbe
AD
141742003-08-25 Akim Demaille <akim@epita.fr>
14175
14176 * data/lalr1.cc (Parser::reduce_print_): New.
14177 Use it.
14178
47301314
AD
141792003-08-25 Akim Demaille <akim@epita.fr>
14180
14181 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
14182 error recovery loops. This patch is based on
161a71f3 14183 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
14184 Also, augment the similarity between lalr1.cc and yacc.c.
14185 Note: the locations of error recovery rules are not correct yet.
14186
14187 * data/lalr1.cc: Comment changes to augment the similarity between
14188 lalr1.cc and yacc.c.
14189 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
14190 (yyerrlab1): Remove, but where it used to be (now the bottom part of
14191 yyerrlab), when hitting EOF, pop the whole stack here instead of
14192 merely falling thru the default error handling mechanism.
14193 (yyerrorlab): New label, with the old contents of YYERROR,
14194 plus the following change: pop the stack of rhs corresponding
14195 to the production that invoked YYERROR. That is how Yacc
14196 behaves (required by POSIX).
14197 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
14198 fail.
14199
1f7a61ff
AD
142002003-08-25 Akim Demaille <akim@epita.fr>
14201
14202 Tune local.at so that people can "autom4te -l autotest calc.at -o
14203 calc" for instance, to extract a sub test suite.
14204
14205 * tests/testsuite.at: Move the initialization, Autotest version
14206 requirement, and AT_TESTED invocation into...
14207 * tests/local.at: here.
14208 * tests/testsuite.at: Include it for compatibility with Autoconf
14209 2.57.
14210 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
14211 be ignore.
14212
327b5b56
PE
142132003-08-04 Paul Eggert <eggert@twinsun.com>
14214
14215 Rework code slightly to avoid gcc -Wtraditional warnings.
14216 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
14217 The returned value is now stored in *YY0. All callers changed.
14218 * src/output.c (merge_output): Adjust to the above change.
14219
0051e3ed
PE
142202003-07-26 Paul Eggert <eggert@twinsun.com>
14221
14222 * data/glr.c (YYASSERT): New macro.
14223 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
14224 yyresolveStates, yyprocessOneStack):
14225 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
14226 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 14227
137437c6
PE
142282003-07-25 Paul Eggert <eggert@twinsun.com>
14229
5b620e06
PE
14230 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
14231 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 14232 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
14233 by Frank Heckenbach, though I have omitted the structure-initialization
14234 part of his glr-knr.diff patch since I recall that the Portable
14235 C Compiler didn't require that change.
14236
137437c6
PE
14237 Let the user specify how to allocate and free memory.
14238 Derived from a suggestion by Frank Heckenbach in
161a71f3 14239 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
14240 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
14241 All uses of free, malloc, realloc changed to use these macros,
14242 and unnecessary casts removed.
14243 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
14244
ddb85ca5
PE
142452003-07-06 Matthias Mann <MatthiasMann@gmx.de>
14246
14247 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
14248 use s.empty() rather than s == "" to test for empty string; see
161a71f3 14249 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
14250 (trivial change)
14251
39910e09
AD
142522003-06-25 Akim Demaille <akim@epita.fr>
14253
14254 * config/depcomp, config/install-sh: Update from masters.
14255
0ae99356
PE
142562003-06-20 Paul Eggert <eggert@twinsun.com>
14257
14258 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
14259 and return properly parenthesized result.
14260 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
14261 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
14262 Remove unnecessary parentheses from uses.
14263 * doc/bison.texinfo (Location Default Action): Describe the
14264 conventions for parentheses.
14265
cd05d13c
PE
142662003-06-19 Paul Eggert <eggert@twinsun.com>
14267
81fd08ca
PE
14268 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
14269 yyreportTree): Do not assume that size_t is the same width as int,
14270 when printing sizes. Print sizes using an unsigned format.
14271 Problem reported by Frank Heckenbach in
161a71f3 14272 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 14273
cd05d13c
PE
14274 Port to Forte Developer 7 C compiler.
14275 * data/glr.c (struct YYLTYPE): If locations are not being used,
14276 declare a single dummy member, as empty structs do not conform
14277 to the C standard.
14278 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
14279 the Forte Developer 7 C compiler complains that end-of-loop
14280 code is not reached.
14281
4dcf140b
PE
142822003-06-17 Paul Eggert <eggert@twinsun.com>
14283
14284 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
14285 avoid warnings from picky compilers about redefinition of PARAMS.
14286
8dd76bee
PE
142872003-06-17 Paul Eggert <eggert@twinsun.com>
14288
14289 Version 1.875b.
14290
14291 * NEWS: Document 1.875b.
14292
14293 * lib/bbitset.h: Do not include config.h; that's the includer's job.
14294 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
14295 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
14296 Don't use 'index' in comments, as it's a builtin fn on some hosts.
14297 * lib/bitset_stats.c: Include gettext.h unconditionally, as
14298 per recent gettext manual's suggestion.
14299 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
14300 Use prototypes, not old-style definitions.
14301 * lib/lbitset.c (lbitset_unused_clear): Likewise.
14302 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
14303 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
14304 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
14305 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
14306 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
14307 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
14308 vbitset_or_and_cmp, vbitset_copy): Likewise.
14309
14310 * lib/libiberty.h: Do not include config.h; that's the includer's job.
14311 Do not include <stdlib.h>.
14312 (PARAMS): Define unconditionally for C89.
14313 (ATTRIBUTE_NORETURN): Remove.
14314 (ATTRIBUTE_UNUSED): Define unconditionally.
14315
14316 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 14317 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
14318 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
14319 * lib/vbitset.c, lib/vbitset.h: New files.
14320 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14321 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
14322 from libbitset.
14323
14324 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
14325 `How Can I Reset @code{yyparse}', since texinfo does not allow
14326 arbitrary @ in node names.
14327
14328 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
14329 shouldn't be needed according to the gettext 0.12.1 documentation
14330 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 14331 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 14332 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 14333 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 14334
8dd76bee
PE
14335 * lib/.cvsignore: Add stdbool.h.
14336 * m4/.cvsignore: Add nls.m4, po.m4.
14337
14338 Upgrade to CVS gnulib.
14339 * stdbool_.h: File renamed from stdbool.h.in.
14340 * configure.ac (AM_STDBOOL_H): Invoke this instead of
14341 AC_HEADER_STDBOOL.
14342 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
14343 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
14344 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
14345 (MOSTLYCLEANFILES): New var.
14346 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
14347 (stdbool.h): New rule.
14348 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
14349 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
14350 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
14351 m4/quote.m4: Upgrade to today's gnulib.
14352
14353 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
14354 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
14355 the tests right now.
14356 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
14357 yyerror are declared before use; C99 requires this.
14358
25005f6a
PH
143592003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14360
14361 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
14362 first.
14363 (yyrecoverSyntaxError): Correct the logic for setting and testing
14364 yyerrState.
14365 Correct comment on handling EOF.
14366 Allow states with only a default reduction, rather than failing
8dd76bee 14367 (I can't quite reconstruct why these were not allowed before).
25005f6a 14368
137437c6 14369 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 14370 buffer overruns, corrupting state.
8dd76bee
PE
14371
14372 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
14373 definition.
14374 * src/reader.h (max_left_semantic_context): New variable declaration.
14375 * src/scan-gram.l (max_left_semantic_context): Define.
14376 (handle_action_dollar): Update max_left_semantic_context.
14377 * data/glr.c (YYMAXLEFT): New definition.
14378 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
14379 (yyresolveAction): Ditto.
14380
14381 Fixes to problems with location handling in GLR parsers reported by
14382 Frank Heckenbach (2003/06/05).
14383
14384 * data/glr.c (YYLTYPE): Make trivial if locations not used.
14385 (YYRHSLOC): Add parentheses, and define only if locations used.
14386 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
14387 locations not used.
14388 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
14389 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 14390
25005f6a
PH
14391 * tests/cxx-type.at: Exercise location information; update tests
14392 to differentiate output with and without locations.
8dd76bee 14393 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
14394 because default YYLTYPE not yet defined.
14395 Change semantic actions to compute strings, rather than printing
14396 them directly (to test proper passing of semantics values). Change
14397 output to prefix notation and update test data and expected results.
14398 (yylex): Track locations.
14399 (stmtMerge): Return value rather than printing, and include arguments
14400 in value.
8dd76bee 14401
711f40b7
PE
144022003-06-03 Paul Eggert <eggert@twinsun.com>
14403
14404 Avoid warnings generated by GCC 2.95.4 when Bison is
14405 configured with --enable-gcc-warnings.
14406 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
14407 yy::]b4_parser_class_name[::translate_,
14408 yy::Stack::operator[] (unsigned),
14409 yy::Stack::operator[] (unsigned) const,
14410 yy::Slice::operator[] (unsigned),
14411 yy::Slice::operator[] (unsigned) const):
14412 Rename local vars to avoid warnings.
14413 * tests/glr-regression.at (Improper handling of embedded actions
14414 and $-N in GLR parsers): Remove unused local variable from yylex.
14415 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
14416 (void) as arg when not pure, since we now assume C89 when building
14417 Bison. Pacify GCC by using parameter.
14418
ac695f7d
PE
144192003-06-02 Paul Eggert <eggert@twinsun.com>
14420
14421 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
14422 yy::Location::lines, yy::Location::columns): Rename arguments
14423 to avoid shadowing; this removes a warning generated by GCC 3.3.
14424
26ec81e0
PE
144252003-06-01 Paul Eggert <eggert@twinsun.com>
14426
14427 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
14428 to g++, as GCC 3.3 complains if you do it.
14429 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
14430 everything that WARNING_CFLAGS has, except omit warnings
14431 not suitable for C++.
14432 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
14433 * tests/atlocal.in (CXXFLAGS): New var.
14434 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
14435
14436 Fix a GLR parser bug I reported in February; see
161a71f3 14437 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
14438 The problem was that GLR parsers did not conform to the C standard,
14439 because actions like { $1 = $2 + $3; } expanded to expressions
14440 that invoked YYFILL in separate subexpressions, and YYFILL assigned
14441 to a local variable. The C standard says that expressions
14442 like (var = f ()) + (var = f ()) have undefined behavior.
14443 Another problem was that GCC sometimes issues warnings that
14444 yyfill and its parameters are unused.
14445
14446 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
14447 as possibly unused.
14448 (yyfill): New function.
14449 (YYFILL): Use it.
14450 (yyuserAction): Change type of yynormal to bool, so that it matches
14451 the new yyfill signature. Mark it as possibly unused.
14452
14453
14454 Follow up on a bug I reported in February, where a Bison-generated
14455 parser can loop. Provide a test case and a fix for yacc.c. I
14456 don't have a fix for lalr1.cc or for glr.c, unfortunately.
14457 The original bug report is in:
161a71f3 14458 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
14459
14460 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
14461 macro's size was becoming unwieldy.
14462 (yyerrlab): Do not discard an empty lookahead symbol, as this
14463 might destroy garbage.
14464 (yyerrorlab): New label, with the old contents of YYERROR,
14465 plus the following change: pop the stack of rhs corresponding
14466 to the production that invoked YYERROR. That is how Yacc
14467 behaves, and POSIX requires this behavior.
14468 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
14469 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
14470 Define 'alarm' to do nothing if unistd.h is not available.
14471 Add a new rule "exp: '-' error;" to test the above change to
14472 data/yacc.c. Use 'alarm' to abort any test taking longer than
14473 10 seconds, as it's probably looping.
14474 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
14475 Also, the new yacc.c generates two fewer diagnostics for an
14476 existing test.
14477
d0829076
PE
144782003-05-24 Paul Eggert <eggert@twinsun.com>
14479
c6ae27df
PE
14480 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
14481 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
14482 This fixes a problem reported by John Bowman when the Compaq/HP
14483 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
14484 -ansi -Wall -gall).
14485 * data/yacc.c (union yyalloc): Likewise.
14486 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 14487
d0829076
PE
14488 Switch from 'int' to 'bool' where that makes sense.
14489
14490 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
14491 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
14492 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
14493 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
14494 Return or accept bool, not int. All callers changed.
14495 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
14496 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
14497 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
14498 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
14499 bitset_or_and_cmp_): Likewise.
14500 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
14501 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
14502 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
14503 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
14504 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
14505 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
14506 bitset_stats_or_and_cmp): Likewise.
14507 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
14508 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
14509 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
14510 ebitset_xor_cmp): Likewise.
14511 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
14512 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
14513 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
14514 lbitset_xor_cmp): Likewise.
14515 * lib/bbitset.h: Include <stdbool.h>.
14516 (struct bitset_vtable): The following members now return bool, not
14517 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
14518 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
14519 or_and_cmp).
14520 * src/conflicts.c (count_rr_conflicts): Likewise.
14521 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
14522 All uses changed.
14523 * lib/ebitset.c (ebitset_obstack_init): Likewise.
14524 * lib/lbitset.c (lbitset_obstack_init): Likewise.
14525 * src/getargs.c (debug_flag, defines_flag, locations_flag,
14526 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14527 graph_flag): Likewise.
14528 * src/getargs.h (debug_flag, defines_flag, locations_flag,
14529 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14530 graph_flag): Likewise.
14531 * src/output.c (error_verbose): Likewise.
14532 * src/output.h (error_verbose): Likewise.
14533 * src/reader.c (start_flag, typed): Likewise.
14534 * src/reader.h (typed): Likewise.
14535 * src/getargs.c (LOCATIONS_OPTION): New constant.
14536 (long_options, getargs): Use it.
14537 * src/lalr.c (build_relations): Use bool, not int.
14538 * src/nullable.c (nullable_compute): Likewise.
14539 * src/print.c (print_reductions): Likewise.
14540 * src/tables.c (action_row, pack_vector): Likewise.
14541 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
14542 * src/output.c (prepare): Use it.
14543 * src/output.c (token_definitions_output,
14544 symbol_destructors_output, symbol_destructors_output): Use string,
14545 not boolean integer, to keep track of whether to output separator.
14546 * src/print_graph.c (print_core): Likewise.
14547 * src/state.c (state_rule_lookaheads_print): Likewise.
14548
14549 * config/install-sh: Sync from automake 1.7.5.
14550
6b2584b7
PE
145512003-05-14 Paul Eggert <eggert@twinsun.com>
14552
14553 * src/parse-gram.y (rules_or_grammar_declaration): Require a
14554 semicolon after a grammar declaration, in the interest of possible
14555 future changes to the Bison input language.
14556 Do not allow a stray semicolon at the start of the grammar.
14557 (rhses.1): Allow one or more semicolons after any rule, including
14558 just before "|" as required by POSIX.
14559 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
14560 grammar.
14561
caf37a36
ADL
145622003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
14563
14564 %parse-param support for lalr1.cc.
14565
14566 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
14567 b4_cc_constructor_calls, b4_cc_constructor_call,
14568 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
14569 definitions.
14570 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
14571 parse-param arguments.
14572 (yy::b4_parser_class_name): Declare instance variables to
14573 hold parse-param arguments.
14574 * tests/calc.at: s/value/semantic_value/ because value clashes
14575 with a member of yy::b4_parser_class_name. Adjust C++ code
14576 to handle %parse-param. Enable %parse-param test in C++.
14577
3ab37077
PE
145782003-05-12 Paul Eggert <eggert@twinsun.com>
14579
14580 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
14581 English a bit. Fix fclose typo. Change "const char" to "char
14582 const", and use ANSI C rather than K&R for "main". Suggest
14583 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
14584 and suggest yy_switch_to_buffer.
14585
145862003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
14587
14588 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
14589 C89. This avoids a diagnostic on compilers that define __STDC__
14590 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 14591 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 14592
e743727f
PE
145932003-05-03 Paul Eggert <eggert@twinsun.com>
14594
14595 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
14596 Do not overrun array bounds.
14597 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 14598 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 14599
916708d5
AD
146002003-04-29 Akim Demaille <akim@epita.fr>
14601
14602 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
14603 * src/getargs.c, src/getargs.h: here, as bool, not int.
14604 (nondeterministic_parser): New.
14605 * src/parse-gram.y, src/scan-gram.l: Support
14606 %nondeterministic-parser.
14607 * src/output.c (prepare): Use nondeterministic_parser instead
14608 of glr_parser where appropriate.
14609 * src/tables.c (conflict_row, action_row, save_row)
14610 (token_actions, token_actions, pack_vector): Ditto.
14611
a06ea4aa
AD
146122003-04-29 Akim Demaille <akim@epita.fr>
14613
14614 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
14615
211074ca
AD
146162003-04-29 Akim Demaille <akim@epita.fr>
14617
14618 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
14619 with %pure-parser and %locations to exercise the patch from Yakov
14620 Markovitch below.
14621
6175ffe3
PE
146222003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
14623
14624 * data/yacc.c: (b4_lex_param): Corrected for the case where
14625 %lex-param is provided and %pure-parser isn't.
14626
b1e95857
PE
146272003-04-27 Paul Eggert <eggert@twinsun.com>
14628
14629 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 14630 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
14631 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
14632 if it is not defined.
14633 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
14634
acda9df6
PE
146352003-04-26 Paul Eggert <eggert@twinsun.com>
14636
3470c57b
PE
14637 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
14638 Declare to be of type suitable for the ninf value itself, not of
14639 type suitable for the corresponding table, since the latter might
14640 be unsigned but the ninf value might be negative. This fixes a
14641 bug reported by Alexandre Duret-Lutz in
161a71f3 14642 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 14643
acda9df6
PE
14644 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
14645 invokes it. We shouldn't invoke it twice because it will attempt
14646 to put error.o in the archive twice. This fixes a glitch reported
14647 by Martin Mokrejs in
161a71f3 14648 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 14649
b5250f26
PE
146502003-04-21 Paul Eggert <eggert@twinsun.com>
14651
14652 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
14653 to gnulib.
14654
089ac0f1
PE
146552003-04-21 Yakov Markovitch <Markovitch@iso.ru>
14656
14657 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
14658 Fix obvious typo that results in uncompilable GLR parsers
14659 when both %pure-parser and %locations are used. (trivial change)
14660
5ededac6
PE
146612003-04-17 Paul Eggert <eggert@twinsun.com>
14662
1b8f2fff
PE
14663 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
14664 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
14665 Do not insert the expected token via unput, as this runs afoul
14666 of a POSIX-compatibility bug in flex 2.5.31.
14667 All uses changed to BEGIN the parent state,
14668 since we no longer insert the expected token via unput.
14669 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
14670 that is no longer emitted after the above change.
14671
5ededac6
PE
14672 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
14673 the first one. This change is from Paul Hilfinger, and it fixes
14674 regression reported by Werner Lemberg in
161a71f3 14675 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
14676
14677 (resolve_sr_conflict): Don't invoke state_errs_set
14678 unless one or more tokens have been explicitly made errors.
14679 Otherwise, the above change causes Bison to abort.
14680
14681 * tests/existing.at (GNU pic Grammar): New test case, taken from
14682 Lemberg's email.
14683
b8be9132
AD
146842003-03-31 Akim Demaille <akim@epita.fr>
14685
14686 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
14687
d423d460
AD
146882003-03-31 Akim Demaille <akim@epita.fr>
14689
14690 * src/output.c (prepare_symbols): Avoid trailing spaces in the
14691 output.
14692
c7e441b4
AD
146932003-03-31 Akim Demaille <akim@epita.fr>
14694
14695 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
14696 From Paul Hilfinger.
14697
231897ad
AD
146982003-03-29 Akim Demaille <akim@epita.fr>
14699
14700 * m4/error.m4: Do not put under dynamic conditions some code which
14701 expansion is under static control.
14702
5b066063
AD
147032003-03-29 Akim Demaille <akim@epita.fr>
14704
14705 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
14706
22a74fec
AD
147072003-03-29 Akim Demaille <akim@epita.fr>
14708
14709 * doc/bison.texinfo (Strings are Destroyed): New.
14710
0eee27e7
PE
147112003-03-13 Paul Eggert <eggert@twinsun.com>
14712
14713 * .cvsignore: Add configure.lineno.
14714 * src/.cvsignore: Add yacc.
14715 * tests/.cvsignore: Add testsuite.log.
14716 * doc/fdl.texi: Sync with latest FSF version.
14717
f61aad93
PE
147182003-03-12 Paul Eggert <eggert@twinsun.com>
14719
537636c7
PE
14720 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
14721 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
14722 cursor, instead of leaving it undefined. This fixes a bug
14723 reported by Tim Van Holder in
161a71f3 14724 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
14725 * tests/input.at (Torturing the Scanner): Test the scanner on
14726 an empty input file, which was Tim Van Holder's test case.
14727
14728 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
14729 <sys/resource.h> can be included, include sys/time.h and
14730 sys/times.h first, if available. This works around the SunOS
14731 4.1.4 porting bug reported by Bruce Becker in
161a71f3 14732 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
14733
14734 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
14735 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
14736 AC_HEADER_SYS_WAIT.
14737
f61aad93
PE
14738 Merge changes from gnulib. This was prompted because the CVS
14739 snapshot didn't build on Solaris 7 due to strnlen problems.
14740
14741 These changes need to be merged back into gnulib:
14742 * lib/hash.c: Include <stdbool.h> unconditionally.
14743 * m4/onceonly.m4 (m4_quote): New macro.
14744 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
14745 Quote AC_FOREACH variable-expansions properly.
14746 The 2003-01-03 obstack.h change also needs merging.
14747 {end of changes requiring merging}
5b066063 14748
f61aad93
PE
14749 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14750 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
14751 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
14752 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
14753 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
14754 New files, imported from gnulib.
14755 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
14756 above.
14757
14758 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
14759 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
14760 gnulib sources.
14761
14762 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
14763 Add.
14764 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
14765 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
14766 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
14767 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
14768 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
14769 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
14770 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
14771 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
14772 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
14773 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
14774 (jm_PREREQ_ARGMATCH): Remove.
14775 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
14776 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
14777
14778 * src/system.h: Include <stdbool.h> unconditionally.
14779
14780 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
14781 assuming at least C89 in the bitset code for some time now.
14782
d2ffe116
AD
147832003-03-03 Akim Demaille <akim@epita.fr>
14784
14785 * ro.po: New.
14786
052826fd
AD
147872003-03-02 Akim Demaille <akim@epita.fr>
14788
14789 * doc/bison.texinfo (Table of Symbols): Reactivate the
14790 documentation for %lex-param, and %parse-param.
14791
c4749565
AD
147922003-03-02 Akim Demaille <akim@epita.fr>
14793
14794 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
14795 generate verbose error messages.
14796 Use the number of tokens as an upper bound in yytname, as it
14797 cannot be a non terminal.
14798
d5286af1
AD
147992003-03-02 Akim Demaille <akim@epita.fr>
14800
14801 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
14802 message.
14803
22e304a6
AD
148042003-03-02 Akim Demaille <akim@epita.fr>
14805
22e304a6
AD
14806 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
14807 Use them to exercise yycheck overrun.
14808 Based on Andrew Suffield's grammar.
14809
67a25fed
AD
148102003-03-02 Akim Demaille <akim@epita.fr>
14811
14812 Create tests/local.at for Bison generic testing macros.
14813
14814 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
14815 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
14816 This new file.
14817 * tests/calc.at (AT_CHECK_CALC): Adjust.
14818 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
14819 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
14820 * tests/local.at: here.
14821 (AT_COMPILE_CXX): Tags the tests using it as c++.
14822 Ignore the test if CXX is not functional.
14823
9c2b381f
PE
148242003-03-01 Paul Eggert <eggert@twinsun.com>
14825
14826 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
14827 not loc->end, since loc->end might contain garbage and this leads
14828 to undefined behavior on some platforms.
14829 (id_loc, token_start): Use (IF_LINTed) initial values that do not
14830 depend on *loc, so that the reader doesn't give the the false
14831 impression that *loc is initialized.
14832 (<INITIAL>"%%"): Do not bother setting code_start, since its value
14833 does not survive the return.
14834
0433ba88
AD
148352003-03-01 Akim Demaille <akim@epita.fr>
14836
14837 * src/scan-gram.l (code_start): Always initialize it when entering
14838 into yylex, as SC_EPILOGUE is activated *before* the corresponding
14839 yylex invocation. An alternative would be making it static, but
14840 then it starts with the second %%'s beginning, instead of its end.
14841
b305ea69
PE
148422003-02-28 Paul Eggert <eggert@twinsun.com>
14843
14844 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
14845 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 14846 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 14847
c3d25e01
PE
148482003-02-26 Paul Eggert <eggert@twinsun.com>
14849
14850 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
14851 Remove Sequent/Pyramid discussion (nobody uses them any more).
14852 Merge VMS and MS-DOS discussion; these ports may well be dead
14853 but let's keep mentioning them for now. Put <> around email
14854 addresses. Add copyright notice.
14855
c267ffbc
PE
148562003-02-24 Paul Eggert <eggert@twinsun.com>
14857
14858 * data/glr.c (yy_reduce_print): yylineno -> yylno,
14859 to avoid collision with flex use of yylineno.
14860 Problem reported by Bruce Lilly in
161a71f3 14861 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
14862 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
14863 * data/yacc.c (yy_reduce_print): Likewise.
14864
14865 * config/depcomp: Sync with Automake 1.7.3.
14866
f939fc12
AD
148672003-02-21 Akim Demaille <akim@epita.fr>
14868
14869 * data/lalr1.cc: Use temporary variables instead of casts to
14870 change integer types.
14871 Suggested by Paul Eggert.
14872
95923bd6
AD
148732003-02-21 Akim Demaille <akim@epita.fr>
14874
14875 * doc/bison.texinfo: Use "location" consistently to refer to @n,
14876 to avoid confusions with lalr1.cc's notion of Position.
14877 Suggested by Paul Eggert.
14878
2cdc240e
AD
148792003-02-20 Akim Demaille <akim@epita.fr>
14880
14881 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
14882 before initial_columns.
14883 (location.hh): Use consistent variable names when defining the
14884 operator<<.
14885 Use "last" so that we subtract from Positions, not from unsigned.
14886
5d003116
AD
148872003-02-20 Akim Demaille <akim@epita.fr>
14888
14889 * data/lalr1.cc (position.hh): New subfile, including the extended
14890 and Doxygen'ed documentation of class Position.
14891 (location.hh): Use it.
14892 Document a` la Doxygen.
ba1ecc07 14893 With the help of Benoit Perrot.
5d003116 14894
d02b25f9
AD
148952003-02-20 Akim Demaille <akim@epita.fr>
14896
14897 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
14898 AT_YACC_IF.
14899 Redefine AT_YYERROR_SEES_LOC_IF using it.
14900 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
14901 not defined.
14902 Don't use the location in yy::Parser::error_ and
14903 yy::Parser::print_ when not %locations.
14904 Activate more lalr1.cc tests.
14905
0d1c3a04
AD
149062003-02-19 Akim Demaille <akim@epita.fr>
14907
14908 * data/lalr1.cc: When displaying a line number, be sure to make it
14909 an int.
14910
60a777aa
AD
149112003-02-19 Akim Demaille <akim@epita.fr>
14912
14913 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
14914 Remove, useless.
14915 (YYABORT, YYACCEPT, YYERROR): New.
14916 * tests/calc.at: Renable the lalr1.cc test.
14917
0b86fc41
AD
149182003-02-19 Akim Demaille <akim@epita.fr>
14919
14920 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
14921 error recovery, mixing with/without pops and discarding of the
14922 lookahead.
14923 Exercise YYERROR.
14924 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
14925
da99a5dc
PE
149262003-02-17 Paul Eggert <eggert@twinsun.com>
14927
14928 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
14929 * tests/testsuite.at (AT_COMPILE): Use them.
14930 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 14931 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 14932
93b8c255
PE
149332003-02-12 Paul Eggert <eggert@twinsun.com>
14934
14935 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
14936 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 14937 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
14938 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
14939 Check for malloc failure, for consistency with yacc.c.
14940 (yytname_size): Remove, for consistency with yacc.c.
14941
14942 The bug still remains in data/lalr1.cc, as I didn't have time
14943 to fix it there.
14944
7548fed2
AD
149452003-02-06 Akim Demaille <akim@epita.fr>
14946
14947 * configure.ac (GXX): Rename as...
14948 (CXX): this, to keep the original Autoconf semantics.
14949 Require 2.57.
14950 * data/lalr1.cc: Fix b4_copyright invocations.
14951 If YYDEBUG is not defined, don't depend upon name_ being defined.
14952 (location.hh): Include string and iostream.
14953 (Position::filename): New member.
14954 (Position::Position ()): New.
14955 (operator<< (Position)): New.
14956 (operator- (Position, int)): New.
14957 (Location::first, Location::last): Rename as...
14958 (Location::begin, Location::end): these, to mock the conventional
14959 iterator names.
14960 (operator<< (Location)): New.
14961 * tests/atlocal.in (CXX): New.
14962 * tests/testsuite.at (AT_COMPILE_CXX): New.
14963 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
14964 locations in a more synthetic way.
14965 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
14966 lalr1.cc is used.
14967 Adjust the C locations to match those from Emacs: first column is
14968 column 0.
14969 Change all the expected results.
14970 Conform to the GCS: simplify the locations when applicable.
14971 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
14972 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
14973 these CPP macros with the m4 macros new defined by...
14974 (AT_CHECK_PUSHDEFS): this, i.e.:
14975 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 14976 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
14977 New macros.
14978 (AT_CHECK_POPDEFS): Undefine them.
14979 (AT_CHECK_CALC_LALR1_CC): New.
14980 Use it for the first lalr1.cc test.
14981
43a176ef
AD
149822003-02-04 Akim Demaille <akim@epita.fr>
14983
14984 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
14985 Location as is defined.
14986
fc049e9c
AD
149872003-02-04 Akim Demaille <akim@epita.fr>
14988
14989 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
14990 name_ being defined.
14991
a737b216
PE
149922003-02-03 Paul Eggert <eggert@twinsun.com>
14993
14994 * src/gram.h (start_symbol): Remove unused decl.
14995
14996 Use more-consistent naming conventions for local vars.
14997
14998 * src/derives.c (derives_compute): Change type of local var from
14999 int to rule_number.
15000 * src/gram.c (grammar_rules_partial_print): Likewise.
15001 * src/print.c (print_core): Likewise.
15002 * src/reduce.c (reduce_grammar_tables): Likewise.
15003
15004 * src/gram.c (grammar_dump): Change name of item_number *
15005 local var from r to rp.
15006 * src/nullable.c (nullable_compute): Likewise.
15007
15008 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
15009
15010 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
15011 for symbol or symbol_number var.
15012 * src/reader.c (grammar_start_symbol_set): Likewise.
15013 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
15014 Likewise.
15015 * src/state.c (transitions_to): Likewise.
15016 * src/state.h: Likewise.
15017 * src/tables.c (symbol_number_to_vector_number): Likewise.
15018
15019 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
15020 char * var.
15021
15022 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
15023 var.
15024
15025 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
15026 var.
15027
15028 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
15029 Use str, not s, for char * var. Use ch, not c, for character var.
15030 Use size for size var.
15031
15032 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
15033 char * var.
15034 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
15035 uniqstr var.
15036 * src/uniqstr.h: Likewise.
15037
15038 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15039 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15040 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
15041 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
15042 param to have same name as that of enum, so that we don't use
15043 "s" to stand for a non-state.
15044
68e93ad5
AD
150452003-02-02 Akim Demaille <akim@epita.fr>
15046
15047 * src/scan-skel.l: Scan more than one inert character per yylex
15048 invocation.
15049
92898986
PE
150502003-02-01 Paul Eggert <eggert@twinsun.com>
15051
15052 Version 1.875a.
15053
1d9d5d71
PE
15054 * po/LINGUAS: Add ms.
15055
0435d061
AD
150562003-01-30 Akim Demaille <akim@epita.fr>
15057
15058 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
15059
6029a57f
PH
150602003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15061
15062 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
15063 of $1.
0435d061
AD
15064
15065 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 15066 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 15067 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 15068
6029a57f
PH
15069 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
15070 (b4_rhs_location): Ditto.
0435d061 15071 (yyfill): New function to copy from stack tree into array
6029a57f 15072 incrementally.
0435d061
AD
15073 (yyuserAction): Modify to allow incremental move of semantic values
15074 to rhs array when in GLR mode.
15075 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
15076 as needed.
15077 Remove dummy use of yystack, as there is now a guaranteed use.
15078 (yydoAction): Modify to allow incremental move of semantic values
15079 to rhs array when in GLR mode.
15080 (yyresolveAction): Ditto.
15081 (yyglrShiftDefer): Update comment.
0435d061 15082 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
15083 (yyglrReduce): Ditto.
15084 (yydoAction): Ditto
0435d061 15085
6029a57f
PH
15086 * tests/glr-regr1.at: Rename to ...
15087 * tests/glr-regression.at: Add new regression test for the problems
15088 described above (adapted from S. Eken).
15089 Update copyright notice.
15090 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
15091 * tests/Makefile.am: Ditto.
15092
6cee6297
PE
150932003-01-28 Paul Eggert <eggert@twinsun.com>
15094
15095 * data/lalr1.cc: Do not use @output_header_name@ unless
15096 b4_defines_flag is set. This fixes two bugs reported by
15097 Tim Van Holder in
161a71f3
PE
15098 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
15099 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 15100
b2a836b5
PE
151012003-01-21 Paul Eggert <eggert@twinsun.com>
15102
15103 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
15104 we don't need to worry about yyerrlab1 being reported as an
15105 "unused label" by non-GCC C compilers. The downside is that if
15106 locations are used then a couple of statements are duplicated each
15107 time YYERROR is invoked, but the upside is that the warnings
15108 should vanish.
15109 (yyerrlab1): Move code to YERROR.
15110 (yyerrlab2): Remove. Change uses back to yyerrlab1.
15111 This reverts some of the 2002-12-27 change.
15112
4196b931
PE
151132003-01-17 Paul Eggert <eggert@twinsun.com>
15114
15115 * src/output.c (symbol_printers_output): Fix typo that led
15116 to core dump. Problem reported by Antonio Rus in
161a71f3 15117 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 15118
3ae831b4
AD
151192003-01-13 Akim Demaille <akim@epita.fr>,
15120 Quoc Peyrot <chojin@lrde.epita.fr>,
15121 Robert Anisko <anisko_r@lrde.epita.fr>
15122
15123 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
15124 when the stacks contain one element, as the loop would otherwise
15125 free the last state, and then use the top state (the one we just
15126 popped). This means that the initial elements will not be freed
15127 explicitly, as is the case in yacc.c; it is not a problem, as
15128 these elements have fake values.
15129
e3aa65c5
PE
151302003-01-11 Paul Eggert <eggert@twinsun.com>
15131
15132 * NEWS: %expect-violations are now just warnings, reverting
15133 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
15134 bootstrapping problem reported by Matthias Klose; see
161a71f3 15135 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
15136 * src/conflicts.c (conflicts_print): Likewise.
15137 * tests/conflicts.at (%expect not enough, %expect too much,
15138 %expect with reduce conflicts): Likewise.
15139 * doc/bison.texinfo (Expect Decl): Document this. Also mention
15140 that the warning is enabled if the number of conflicts changes
15141 (not necessarily increases).
15142
15143 * src/getargs.c (version): Update copyright year.
15144
f0057011
AD
151452003-01-09 Akim Demaille <akim@epita.fr>
15146
15147 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
15148
1ee6d2a0
PE
151492003-01-08 Paul Eggert <eggert@twinsun.com>
15150
15151 * Makefile.maint (WGETFLAGS):
15152 New macro, containing "-C off" to disable proxy caches.
15153 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
15154 (rel-check): Use $(WGET) instead of wget.
15155
d4fd77c4
PE
151562003-01-06 Paul Eggert <eggert@twinsun.com>
15157
15158 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
15159 the GLR paper of Scott, Johnstone and Hussain.
15160
464c6927
PE
151612003-01-04 Paul Eggert <eggert@twinsun.com>
15162
d600ee67
PE
15163 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
15164 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
15165 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
15166 (EXTRA_LIBRARIES): New var, for liby.a.
15167 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
15168 (EXTRA_SCRIPTS): New var, for yacc.
15169
464c6927
PE
15170 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
15171 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
15172 Problem reported by Nelson H. F. Beebe.
15173
151742003-01-03 Paul Eggert <eggert@twinsun.com>
15175
15176 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
15177 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
15178 when compiling Bison 1.875's `bitset bset = obstack_alloc
15179 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
15180
15181 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
15182 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
15183 grow to a huge size with typical invocation.
d600ee67 15184
464c6927
PE
15185 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
15186 Use the pattern recommended by Autoconf 2.57, except also protect
15187 against double-definition.
15188 * src/system.h: Likewise.
15189 Portability issues reported by Nelson H. F. Beebe.
d600ee67 15190
464c6927
PE
15191 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
15192 All uses changed. Provide a definition in both C and C++.
15193 (yytrue, yyfalse): Define even if defined (__cplusplus).
15194
15195 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
15196 Reported by Nelson H. F. Beebe.
d600ee67 15197
464c6927
PE
15198 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
15199
0f42c7d5
PE
152002003-01-02 Paul Eggert <eggert@twinsun.com>
15201
15202 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
15203 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
15204 Bug reported by Nelson H. F. Beebe.
15205
dc546b0f
PE
152062003-01-01 Paul Eggert <eggert@twinsun.com>
15207
15208 * Version 1.875.
15209
2c09b6a7
PE
152102002-12-30 Paul Eggert <eggert@twinsun.com>
15211
15212 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
15213 Moved here from...
15214 (<INITIAL>","): Here. This causes stray "," to be treated
15215 more uniformly.
15216
dc546b0f 15217 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
15218 last brace in braced code when not in Yacc mode, for compatibility
15219 with Bison 1.35. This resurrects the 2001-12-15 patch to
15220 src/reader.c.
15221
15222 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
15223 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
15224
535c0f63
PE
152252002-12-28 Paul Eggert <eggert@twinsun.com>
15226
15227 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
15228 that of SYM's type. This fixes Debian bug 168069, reported by
15229 Thomas Olsson.
d600ee67 15230
963fcc17
PE
152312002-12-28 Paul Eggert <eggert@twinsun.com>
15232
15233 Version 1.75f.
15234
15235 Switch back to the Yacc style of conflict reports, undoing some
15236 of the 2002-07-30 change.
15237 * doc/bison.texinfo (Understanding): Use Yacc style for
15238 conflict reports. Also, use new way of locating rules.
15239 * src/conflicts.c (conflict_report):
15240 Renamed from conflict_report_yacc, removing the old
15241 'conflict_report'. Translate the entire conflict report at once,
15242 so that we don't assume that "," has the same interpretation in
15243 all languages.
15244 (conflicts_output): Use Yacc-style conflict report for each state,
15245 instead of our more-complicated style.
15246 (conflicts_print): Use Yacc-style conflict report, except print
15247 the input file name when not emulating Yacc.
15248 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
15249 Conflicted Reduction, %expect not enough, %expect too much,
15250 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
15251 * tests/existing.at (GNU Cim Grammar): Likewise.
15252 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
15253
15254 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
15255 fatal): Don't invoke fflush; it's not needed and it might even be
15256 harmful for stdout, as stdout might not be open.
15257 * src/reduce.c (reduce_print): Likewise.
15258
b1efe548
PE
152592002-12-27 Paul Eggert <eggert@twinsun.com>
15260
15261 Fix a bug where error locations were not being recorded correctly.
15262 This problem was originally reported by Paul Hilfinger in
161a71f3 15263 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
15264
15265 * data/yacc.c (yyparse): New local var yylerrsp, to record the
15266 top of the location stack's error locations.
15267 (yyerrlab): Set it. When discarding a token, push its location
15268 onto yylerrsp so that we don't lose track of the error's end.
15269 (yyerrlab1): Now is only the target of YYERROR, so that we can
15270 properly record the location of the action that failed. For GCC
15271 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
15272 GCC warning about yyerrlab1 being unused if YYERROR is unused.
15273 (yyerrlab2): New label, which yyerrlab now falls through to.
15274 Compute the error's location by applying YYLLOC_DEFAULT to
15275 the locations of all the symbols that went into the error.
15276 * doc/bison.texinfo (Location Default Action): Mention that
15277 YYLLOC_DEFAULT is also invoked for syntax errors.
15278 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
15279 Error locations include the locations of all the tokens that were
15280 discarded, not just the last token.
d600ee67 15281
983c5c2c
PE
152822002-12-26 Paul Eggert <eggert@twinsun.com>
15283
b1efe548
PE
15284 * src/files.c: Include quote.h.
15285 (compute_output_file_names): Warn if we detect conflicting
15286 outputs to the same file. This should catch the misunderstanding
15287 exemplified by Debian Bug 165349, reported by Bruce Stephens..
15288
15289 * src/conflicts.c (conflicts_print): If the user specifies
15290 "%expect N", report an error if there are any reduce/reduce
15291 conflicts. This is what the manual says should happen.
15292 This fixes Debian bug 130890, reported by Anthony DeRobertis.
15293 * tests/conflicts.at (%expect with reduce conflicts): New test.
15294
983c5c2c
PE
15295 Don't use m4_include on relative file names, as it doesn't work as
15296 desired if there happens to be a file with that name under ".".
d600ee67 15297
983c5c2c
PE
15298 * m4sugar/version.m4: Remove; it was included but it wasn't used.
15299 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
15300 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
15301 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
15302 * src/output.c (output_skeleton): Use full path names when
15303 specifying a file to include; don't rely on include path, as
15304 it's unreliable when the working file contains a file with
15305 that name.
d600ee67 15306
983c5c2c
PE
153072002-12-25 Paul Eggert <eggert@twinsun.com>
15308
15309 Remove obsolete references to bison.simple and bison.hairy.
15310 Problem mentioned by Aubin Mahe in
161a71f3 15311 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
15312 * data/glr.c: Comment fix.
15313 * doc/bison.1: Remove references. Also, mention "yacc".
15314
15315 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
15316 with -g option.
15317
15318 * src/parse-gram.y (declaration): Use enum "report_states" rather
15319 than its numeric value 1.
15320
15321 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
15322 opening a new one. This fixes Debian bug 165349, reported by
15323 Bruce Stephens.
15324
23f2d9dc
PE
153252002-12-24 Paul Eggert <eggert@twinsun.com>
15326
15327 Version 1.75e.
15328
15329 * Makefile.maint (cvs-update): Don't assume that the shell
15330 supports $(...), as Solaris sh doesn't.
15331
15332 * src/parse-gram.y (lloc_default): Remove test for empty
15333 nonterminals at the end, since it didn't change the result.
15334
153352002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
15336
15337 If the user does not define YYSTYPE as a macro, Bison now declares it
15338 using typedef instead of defining it as a macro. POSIX requires this.
15339 For consistency, YYLTYPE is also declared instead of defined.
15340
15341 %union directives can now have a tag before the `{', e.g., the
15342 directive `%union foo {...}' now generates the C code
15343 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
15344 The default union tag is `YYSTYPE', for compatibility with Solaris 9
15345 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
15346 instead of `yyltype'.
15347
15348 `yystype' and `yyltype' are now obsolescent macros instead of being
15349 typedefs or tags; they are no longer documented and will be
15350 withdrawn in a future release.
15351
15352 * data/glr.c (b4_location_type): Remove.
15353 (YYSTYPE): Renamed from yystype.
15354 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
15355 (struct YYLTYPE): Renamed from struct yyltype.
15356 (YYLTYPE): Renamed from yyltype.
15357 (yyltype, yystype): New (and obsolescent) macros,
15358 for backward compatibility.
15359 * data/yacc.c: Likewise.
15360
15361 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
15362 does not specify a union tag. This is for compatibility with
15363 Solaris 9 yacc.
15364
15365 * src/parse-gram.y (add_param): 2nd arg is now char * not char
15366 const *, since it is now modified by stripping surrounding { }.
15367 (current_braced_code): Remove.
15368 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
15369 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
15370 trailing " {...}". Now of type <chars>.
15371 (grammar_declaration): Adjust to bundled tokens.
15372 (code_content): Remove; stripping is now done by add_param.
15373 (print_token_value): Print contents of bundled tokens.
15374 (token_name): New function.
15375
15376 * src/reader.h (braced_code, current_braced_code): Remove.
15377 (token_name): New decl.
15378
15379 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
15380 token_type, not braced_code code_kind. All uses changed.
15381 (SC_PRE_CODE): New state, for scanning after a keyword that
15382 has (or usually has) an immediately-following braced code.
15383 (token_type): New local var, to keep track of which token type
15384 to return when scanning braced code.
15385 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 15386 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
15387 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
15388 instead of returning a token type immediately.
15389 (<INITIAL>"{"): Set token type.
15390 (<SC_BRACED_CODE>"}"): Use it.
15391 (handle_action_dollar, handle_action_at): Now returns bool
15392 indicating success. Fail if ! current_rule; this prevents a core dump.
15393 (handle_symbol_code_dollar, handle_symbol_code_at):
15394 Remove; merge body into caller.
15395 (handle_dollar, handle_at): Complain in invalid contexts.
15396
15397 * NEWS, doc/bison.texinfo: Document the above.
15398 * NEWS: Fix years and program names in copyright notice.
15399
879ca4f8
PE
154002002-12-17 Paul Eggert <eggert@twinsun.com>
15401
15402 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
15403 Reporting, Table of Symbols): Omit mentions of %lex-param and
15404 %parse-param from the documentation for now.
15405
1c5fe69d
PE
154062002-12-15 Paul Eggert <eggert@twinsun.com>
15407
15408 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
15409 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
15410 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
15411 disagreed with the Bison documentation. Bug
15412 reported by Andrew Walrond.
d600ee67 15413
1c5fe69d
PE
15414 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
15415 as the caller now does that.
15416 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
15417 (YYEMPTY): Parenthesize right hand side, since others use it.
15418 (yyparse): Don't assume that our generated code is the only code
15419 that sets yychar.
15420
d1de5372
PE
154212002-12-13 Paul Eggert <eggert@twinsun.com>
15422
15423 Version 1.75d.
15424
15425 POSIX requires a "yacc" command.
15426 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
15427 (MOSTLYCLEANFILES): Add yacc.
15428 (yacc): New rule.
1c5fe69d 15429 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
15430 as an alias for bison y.
15431
15432 * po/LINGUAS: Add da.
d600ee67 15433
d1de5372
PE
15434 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
15435 problem with latest <getopt.h>.
15436 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
15437
15438 * doc/fdl.texi: Upgrade to 1.2.
15439 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
15440 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
15441 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
15442 gnulib.
15443 * config/install-sh: Sync with autotools.
15444
15445 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 15446 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
15447 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
15448 locations are requested.
15449 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
15450 locations are requested.
15451
d0f3fe23
PE
154522002-12-12 Paul Eggert <eggert@twinsun.com>
15453
15454 Remove unportable casts and storage allocation tricks.
15455 While we're at it, remove almost all casts, since they
15456 usually aren't needed and are a sign of trouble.
15457
15458 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
15459
15460 * src/derives.c (derives_compute): Do not subtract NTOKENS from
15461 the pointer DSET returned by malloc; this isn't portable.
15462 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
15463 Similarly for DERIVES.
15464 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
15465 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
15466 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
15467
15468 * src/derives.c (derives_compute): Do not bother invoking
15469 int_of_rule_number, since rule numbers are integers.
15470
15471 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
15472 rather than XMALLOC (char, N).
15473
15474 * src/files.c (filename_split): Rewrite to avoid cast.
15475
15476 * src/gram.h (symbol_number_as_item_number,
15477 item_number_as_symbol_number, rule_number_as_item_number,
15478 item_number_as_rule_number):
15479 Now inline functions rather than macros, to avoid casts.
15480 * src/state.h (state_number_as_int): Likewise.
15481 * src/tables.c (state_number_to_vector_number,
15482 symbol_number_to_vector_number): Likewise.
15483
15484 * src/gram.h (int_of_rule_number): Remove; no longer used.
15485
15486 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
15487 since the resulting storage is always stored into.
15488
15489 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
15490 where it's needed.
15491
15492 * src/muscle_tab.c (muscle_m4_output):
15493 Now inline. Return bool, not int.
15494 * src/state.c (state_compare): Likewise.
15495 * src/symtab.c (symbol_check_defined,
15496 symbol_check_alias_consistency, symbol_pack, symbol_translation,
15497 hash_compare_symbol, hash_symbol):
15498 Likewise.
15499 * src/uniqstr.c (uniqstr_print): Likewise.
15500 * src/muscle_tab.c (muscle_m4_output_processor):
15501 New function, to avoid casts.
15502 * src/state.c (state_comparator, stage_hasher): Likewise.
15503 * src/symtab.c (symbol_check_defined_processor,
15504 symbol_check_alias_consistency_processor, symbol_pack_processor,
15505 symbol_translation_processor, hash_symbol_comparator,
15506 hash_symbol_hasher): Likewise.
15507 * src/uniqstr.c (uniqstr_print_processor): Likewise.
15508 * src/muscle_tab.c (muscles_m4_output):
15509 Use new functions instead of casting old functions unportably.
15510 * src/state.c (state_hash_new): Likewise.
15511 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
15512 symbols_token_translations_init):
15513 Likewise.
15514 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
15515
15516 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
15517 var instead of casting to long, to avoid casts.
15518 (prepare_states): Use MALLOC rather than alloca, so that we don't
15519 have to worry about alloca.
15520 * src/state.c (state_hash_lookup): Likewise.
15521
15522 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
15523 local var instead of casting to unsigned char, to avoid casts.
15524
15525 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
15526 STATE_ALLOC): Remove.
15527 (transitions_new, errs_new, reductions_new, state_new): Use malloc
15528 rather than calloc, and use offsetof to avoid allocating slightly
15529 too much storage.
15530 (state_new): Initialize all members.
15531
15532 * src/state.c (state_hash): Use unsigned accumulator, not signed.
15533
15534 * src/symtab.c (symbol_free): Remove; unused.
15535 (symbol_get): Remove cast in lhs of assignment.
15536 (symbols_do): Now static. Accept generic arguments, not
15537 hashing-related ones.
15538
15539 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
15540 (symbol_processor): Remove.
15541 (symbols_do): Remove decl; now static.
15542
15543 * src/system.h (alloca): Remove; decl no longer needed.
15544 (<stddef.h>): Include, for offsetof.
15545 (<inttypes.>, <stdint.h>): Include if available.
15546 (uintptr_t): New type, if system lacks it.
15547 (CALLOC, MALLOC, REALLOC): New macros.
15548 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
15549 new macros.
15550
15551 * src/tables.c (table_size): Now int, to pacify GCC.
15552 (table_grow, table_ninf_remap): Use signed table size.
15553 (save_row): Don't bother initializing locals when not needed.
15554 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
15555 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
15556
15557 * src/vcg.h: Correct misspellings.
15558
15559 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
15560
15561
15562 * src/getargs.c (getargs): Don't assume EOF == -1.
15563
26b4a969
PE
155642002-12-09 Paul Eggert <eggert@twinsun.com>
15565
15566 Change identifier spellings to avoid collisions with names
15567 that are reserved by POSIX.
15568
15569 Don't use names ending in _t, since POSIX reserves them.
15570 For consistency, remove _e and _s endings -- they're weren't
15571 needed to remove ambiguity. All uses changed.
15572 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
15573 turn was just renamed from struniq_t.
15574 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
15575 which in turn was just renamed from struniq_processor_t.
15576 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
15577 in turn was renamed from hash_compare_struniq_t.
15578 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
15579 (state_list): Renamed from state_list_t.
15580 * src/assoc.h (assoc): Renamed from assoc_t.
15581 * src/conflicts.c (enum conflict_resolution): Renamed from
15582 enum conflict_resolution_e.
15583 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
15584 (rule_list): Renamed from rule_list_t.
15585 * src/getargs.h (enum trace): Renamed from enum trace_e.
15586 (enum report): Renamed from enum report_e.
15587 * src/gram.h (item_number): Renamed from item_number_t.
15588 (rule_number): Renamed from rule_number_t.
15589 (struct rule_s): Remove the "rule_s" part; not used.
15590 (rule): Renamed from rule_t.
15591 (rule_filter): Renamed from rule_filter_t.
15592 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
15593 (goto_list): Renamed from goto_list_t.
15594 * src/lalr.h (goto_number): Renamed from goto_number_t.
15595 * src/location.h (location): Renamed from location_t.
15596 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
15597 and moved here from:
15598 * src/muscle_tab.h (muscle_entry_t): here.
15599 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
15600 (rule_list): Renamed from rule_list_t.
15601 * src/print_graph.c (static_graph): Renamed from graph.
15602 * src/reader.h (braced_code): Renamed from braced_code_t.
15603 Remove brace_code_e tag.
15604 * src/relation.h (relation_node): Renamed from relation_node_t.
15605 (relation_nodes): Renamed from relation_nodes_t.
15606 (relation): Renamed from relation_t.
15607 * src/state.h (state_number): Renamed from state_number_t.
15608 (struct state): Renamed from struct state_s.
15609 (state): Renamed from state_t.
15610 (transitions): Renamed from transitions_t. Unused (and
15611 misspelled) transtion_s tag removed.
15612 (errs): Renamed from errs_t. Unused errs_s tag removed.
15613 (reductions): Renamed from reductions_t. Unused tag
15614 reductions_s removed.
15615 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
15616 (struct symbol_list): Renamed from struct symbol_list_s.
15617 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
15618 (struct symbol): Renamed from struct symbol_s.
15619 (symbol): Renamed from symbol_t.
15620 * src/tables.c (vector_number): Renamed from vector_number_t.
15621 (action_number): Renamed from action_t.
15622 * src/tables.h (base_number): Renamed from base_t.
15623 * src/vcg.h (enum color): Renamed from enum color_e.
15624 (enum textmode): Renamed from enum textmode_e.
15625 (enum shape): Renamed from enum shape_e.
15626 (struct colorentry): Renamed from struct colorentry_s.
15627 (struct classname): Renamed from struct classname_s.
15628 (struct infoname): Renamed from struct infoname_s.
15629 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
15630 (enum decision): Renamed from enum decision_e.
15631 (enum orientation): Renamed from enum orientation_e.
15632 (enum alignment): Renamed from enum alignment_e.
15633 (enum arrow_mode): Renamed from enum arrow_mode_e.
15634 (enum crossing_type): Renamed from enum crossing_type_e.
15635 (enum view): Renamed from enum view_e.
15636 (struct node): Renamed from struct node_s.
15637 (node): Renamed from node_t.
15638 (enum linestyle): Renamed from enum linestyle_e.
15639 (enum arrowstyle): Renamed from enum arrowstyle_e.
15640 (struct edge): Renamed from struct edge.
15641 (edge): Renamed from edge_t.
15642 (struct graph): Renamed from struct graph_s.
15643 (graph): Renamed from graph_t.
15644 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
15645 Rename value_t -> value.
15646 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
15647 value_t_as_yystype -> value_as_yystype.
15648
15649 Don't include <errno.h> in the mainstream code, since it
15650 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
15651 * lib/get-errno.c, lib/get-errno.h: New files.
15652 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
15653 get-errno.c.
15654 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
15655 * src/output.c (output_skeleton): Likewise.
15656 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
15657 instead of errno.
15658 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
15659 Likewise.
15660 (handle_action_dollar, handle_action_at): Likewise.
15661 * src/system.h: Do not include <errno.h>.
15662 (TAB_EXT): Renamed from EXT_TAB.
15663 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
15664
15665 Avoid str[a-z]*, since <string.h> reserves that name space.
15666 Change all instances of "struniq" in names to "uniqstr", and
15667 likewise for "STRUNIQ" and "UNIQSTR".
15668 * src/uniqstr.c: Renamed from src/struniq.c.
15669 * src/uniqstr.h: Renamed from src/struniq.h.
15670 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
15671 * src/files.c (strsuffix): Remove; unused.
15672 (concat2): Renamed from stringappend. Now static.
15673 * src/files.h (strsuffix, stringappend): Remove; unused.
15674 * src/parse-gram.y (<chars>): Renamed from <string>.
15675 (<uniqstr>): Renamed from <struniq>.
15676 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
15677 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
15678 (struct graph_s.expand): Renamed from struct graph_s.stretch.
15679 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
15680 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
15681 (N_EXPAND): Renamed from N_STRETCH.
15682
15683 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
15684 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
15685 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
15686 Remove; unused.
15687 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
15688 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
15689 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
15690 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
15691 (BASE_MAXIMUM): Renamed from BASE_MAX.
15692 (BASE_MINIMUM): Renamed from BASE_MIN.
15693 (ACTION_MAX): Remove; unused.
15694 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
15695 Unnecessary casts removed from above defines.
15696
15697
15698 Fix misspelling in names.
15699 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
15700 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
15701 G_NODE_ALIGNEMENT.
15702
15703
15704 * lib/timevar.c (timevar_report): Renamed from time_report,
15705 for consistency with other names.
15706 * lib/timevar.h (timevar_report): New decl.
15707 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
15708
15709
15710 Sort include-file uses.
15711
15712 Reorder all include files under src to be in the order "system.h".
15713 then the ../lib include files in angle brackets (alphabetized),
15714 then the . include files in double-quotes (alphabetized). Fix
15715 dependency breakages encountered in this process, as follows:
15716 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
15717 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
15718 * src/state.h: Include "symtab.h".
15719
996b1c7e
PE
157202002-12-08 Paul Eggert <eggert@twinsun.com>
15721
15722 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
15723 since this causes problems when __file__ contains character
15724 sequences like "@" that are treated specially by src/scan-skel.l.
15725 Instead, just use the file's basename. This fixes the bug
15726 reported by Martin Mokrejs in
161a71f3 15727 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 15728
e19c4e5d
PE
157292002-12-06 Paul Eggert <eggert@twinsun.com>
15730
15731 Add support for rules that do not have trailing semicolons, as
15732 POSIX requires. Improve the quality of locations in Bison
15733 diagnostics.
26b4a969 15734
e19c4e5d
PE
15735 * src/location.c: Include <quotearg.h>.
15736 (empty_location): Now const.
15737 (location_print): New function. Follow the recommendation of the
15738 GNU Coding Standards for locations that span file boundaries.
15739 * src/location.h: Do not include <quotearg.h>; no longer needed.
15740 (boundary): New type.
15741 (location_t): Use it. This allows locations to span file boundaries.
15742 All member uses changed: file -> start.file or end.file (as needed),
15743 first_line -> start.line, first_column -> start.column,
15744 last_line -> end.line, last_column -> end.column.
15745 (equal_boundaries): New function.
15746 (LOCATION_RESET, LOCATION_STEP): Remove.
15747 (LOCATION_PRINT): Remove. All callers changed to use location_print.
15748 (empty_location): Now const.
15749 (location_print): New decl.
15750 * src/parse-gram.y (lloc_default): New function, which handles
15751 empty locations more accurately.
15752 (YYLLOC_DEFAULT): Use it.
15753 (%token COLON): Remove.
15754 (%token ID_COLON): New token.
26b4a969 15755 (rules): Use it.
e19c4e5d
PE
15756 (declarations, rules): Remove trailing semicolon.
15757 (declaration, rules_or_grammar_declaration):
15758 Allow empty (";") declaration.
15759 (symbol_def): Remove empty actions; no longer needed.
15760 (rules_or_grammar_declaration): Remove trailing semicolon.
15761 (semi_colon.opt): Remove.
15762 * src/reader.h: Include location.h.
15763 (scanner_cursor): New decl.
15764 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
15765 rolling our own.
15766 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
15767 of *loc.
15768 (STEP): Remove. No longer needed, now that adjust_location does
15769 the work. All uses removed.
15770 (scanner_cursor): New var.
15771 (adjust_location): Renamed from extend_location. It now sets
15772 *loc and adjusts the scanner cursor. All uses changed.
15773 Don't bother testing for CR.
15774 (handle_syncline): Remove location arg; now updates scanner cursor.
15775 All callers changed.
15776 (unexpected_end_of_file): Now accepts start boundary of token or
15777 comment, not location. All callers changed. Update scanner cursor,
15778 not the location.
15779 (SC_AFTER_IDENTIFIER): New state.
15780 (context_state): Renamed from c_context. All uses changed.
15781 (id_loc, code_start, token_start): New local vars.
15782 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
15783 processing of Yacc white space and equivalents here.
15784 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
15785 instead of returning ID immediately, since we need to search for
15786 a subsequent colon.
15787 (<INITIAL>"'", "\""): Save token_start.
15788 (<INITIAL>"%{", "{", "%%"): Save code_start.
15789 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
15790 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
15791 BEGIN context_state at end, not INITIAL.
15792 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
15793 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
15794 Return correct token start.
15795 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
15796 the start of a character, string or multiline comment is found.
15797 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
15798 Reduction): Adjust reported locations to match the more-precise
15799 results now expected.
15800 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
15801 * tests/reduce.at (Useless Rules, Reduced Automaton,
15802 Underivable Rules): Likewise.
15803 * tests/regression.at (Invalid inputs): No longer `expecting ";"
15804 or "|"' now that so many other tokens are allowed by the new grammar.
15805
15806 * src/complain.h (current_file): Remove duplicate decl;
15807 current_file is now owned by files.h.
15808 * src/complain.c, src/scan-gram.l: Include files.h.
15809
158102002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 15811
e19c4e5d
PE
15812 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
15813 promotes to int; it might be unsigned int.
15814 * data/yacc.c (yy_reduce_print): Likewise.
15815
15816 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
15817 be #defined in the prologue, not in the Bison declarations.
15818 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 15819
b64755e3
PE
158202002-12-02 Paul Eggert <eggert@twinsun.com>
15821
15822 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
15823 * lib/strtoul.c: New file, from gnulib.
15824 This fixes a porting bug reported by Peter Klein in
161a71f3 15825 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 15826
6e746484
PE
158272002-11-30 Paul Eggert <eggert@twinsun.com>
15828
b64755e3
PE
15829 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
15830 and put only a forward declaration in the prologue. This is for
15831 consistency with the other scanner helper functions.
15832
6ba55592
PE
15833 Type clashes now generate warnings, not errors, since it
15834 appears that POSIX may allow some grammars with type clashes.
15835 * src/reader.c (grammar_current_rule_check): Warn about
15836 type clashes instead of complaining.
15837 * tests/input.at (Type Clashes): Expect warnings, not complaints.
15838
6e746484
PE
15839 Add Yacc library, since POSIX requires it.
15840 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
15841 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
15842 * lib/main.c, lib/yyerror.c: New files.
15843
15844 gram_error can be static; it need not be extern.
15845 * src/reader.h (gram_error): Remove decl.
15846 * src/parse-gram.y (gram_error): Now static. Add static decl.
15847 (print_token_value): Omit parameter names from forward decl,
15848 for consistency.
15849
88510f9c
PE
158502002-11-29 Paul Eggert <eggert@twinsun.com>
15851
6e746484
PE
15852 * doc/bison.texinfo: Emphasize that yylex and yyerror must
15853 be declared before being used. E.g., one should typically
15854 declare them in the prologue. Use GNU coding style in examples.
15855 Put "const" consistently after the type it modifies. Mention
15856 that C99 supports "inline". Mention that yyerror traditionally
15857 returns "int".
15858
88510f9c
PE
15859 %parse-param and %lex-param now take just one argument, the
15860 declaration; the argument name is deduced from the declaration.
15861
15862 * doc/bison.texinfo (Parser Function, Pure Calling, Error
15863 Reporting, Table of Symbols): Document this.
15864 * src/parse-gram.y (add_param): New function.
15865 (COMMA): Remove.
15866 (declaration): Implement new rule for %parse-param and %lex-param.
15867 * src/scan-gram.l: "," now elicits a warning, rather than being
15868 a token; this is more compatible with byacc.
15869 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
15870
bb92250c
PE
158712002-11-27 Paul Eggert <eggert@twinsun.com>
15872
15873 Rename identifiers to avoid real and potential collisions.
15874
15875 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
15876 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 15877 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
15878 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
15879 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
15880 * src/parse-gram.y (print_token_value): Renamed from yyprint.
15881 All uses changed.
15882 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
15883 The name "yycontrol" violates the name space rules, and this stuff
15884 wasn't being used anyway.
15885 (input): Remove action; this stuff wasn't being used.
15886 (gram_error): Rename local variable yylloc -> loc.
15887 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
15888 (YY_DECL): Don't use "yy" at start of local variables.
15889 All uses changed, e.g., yylloc -> loc.
15890 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
15891 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
15892 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
15893 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
15894
15895 * src/parse-gram.y (gram_error): loc is now const *.
15896 * src/reader.h (gram_error): Likewise.
15897
3af4feb2
PE
158982002-11-24 Paul Eggert <eggert@twinsun.com>
15899
15900 Version 1.75c.
15901
15902 * tests/actions.at (Actions after errors): Use an output format
15903 more similar to that of the Printers and Destructors test.
15904 Test the position of the ';' token too.
15905 (Printers and Destructors): Likewise.
15906 (Printers and Destructors: %glr-parser): Remove for now, to avoid
15907 unnecessarily alarming people when the test fails.
15908
15909 * data/yacc.c (yyerrlab1): Move this label down, so that the
15910 parser does not discard the lookahead token if the user code
15911 invokes YYERROR. This change is required for POSIX conformance.
15912
15913 * lib/error.c: Sync with gnulib.
15914
159152002-11-22 Paul Eggert <eggert@twinsun.com>
15916
15917 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
15918 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
15919 * lib/xmalloc.c: Likewise.
26b4a969 15920
58004308
PE
159212002-11-20 Paul Eggert <eggert@twinsun.com>
15922
15923 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
15924
159252002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 15926
58004308
PE
15927 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
15928 should use `if (! x) abort ();' rather than `assert (x);', and
15929 anyway it's one less thing to worry about configuring.
15930
15931 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
15932 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
15933 and replace all instances of assert with abort.
15934 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
15935 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
15936
15937 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
15938 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
15939 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
15940 hash_find_entry, hash_rehash, hash_insert): Likewise.
15941 * src/conflicts.c (resolve_sr_conflict): Likewise.
15942 * src/lalr.c (set_goto_map, map_goto): Likewise.
15943 * src/nullable.c (nullable_compute): Likewise.
15944 * src/output.c (prepare_rules, token_definitions_output): Likewise.
15945 * src/reader.c (packgram, reader): Likewise.
15946 * src/state.c (state_new, state_free, state_transitions_set,
15947 state_reduction_find): Likewise.
15948 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
15949 symbol_pack): Likewise.
15950 * src/tables.c (conflict_row, pack_vector): Likewise.
15951 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15952 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15953 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
15954 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
15955
15956 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
15957 (ARGMATCH_CONSTRAINT): New macro.
15958 (ARGMATCH_ASSERT): Use it.
15959
15960 * src/system.h (verify): New macro.
15961 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
15962 rather than assert.
15963 * src/tables.c (tables_generate): Likewise.
15964
15965 * src/struniq.c (struniq_assert): Now returns void, and aborts
15966 if the assertion is false.
15967 (struniq_assert_p): Remove.
15968 * src/struniq.h: Likewise.
15969
76ae8198
PE
159702002-11-18 Paul Eggert <eggert@twinsun.com>
15971
15972 * data/glr.c (yygetLRActions): Replace `yyindex' with
15973 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
15974 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 15975 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 15976
d3c4e709
AD
159772002-11-18 Akim Demaille <akim@epita.fr>
15978
15979 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
15980 space.
15981 From Tim Van Holder.
15982
8d8a7238
PE
159832002-11-17 Paul Eggert <eggert@twinsun.com>
15984
15985 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
15986 to "SyntaxError" for consistency with my 2002-11-15 change.
15987
15988 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
15989 not define to {}, since this breaks the common use of `YYDPRINTF
15990 ((...));' if a single statement is desired (e.g. before `else').
15991 Work around GCC warnings by surrounding corresponding calls with
15992 {} if needed.
15993 (yyhasResolvedValue): Remove unused function.
15994 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
15995 loop body.
15996 (yyreportSyntaxError): Renamed from yyreportParseError.
15997 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
15998 All uses changed.
15999 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
16000 extern when possible. Remove unused initializations.
16001
b0937b22
AD
160022002-11-16 Akim Demaille <akim@epita.fr>
16003
16004 Augment the similarity between GLR and LALR traces.
16005
16006 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
16007 (YY_REDUCE_PRINT): New.
16008 (yyparse): Use them.
16009 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
16010 YYDPRINT here.
16011 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
16012 state reached after the reduction/recovery, since...
16013 (yyparse, yyprocessOneStack): Report the state we are entering in.
16014
c5e3e510
AD
160152002-11-16 Akim Demaille <akim@epita.fr>
16016
16017 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
16018 Add support for --trace=skeleton.
16019 * src/scan-skel.l: %option debug.
16020 Scan strings of non-@ or \n instead of character by character.
16021 (scan_skel): Handle trace_skeleton.
16022 (QPUTS): New.
16023 (@output_parser_name@, @output_header_name@): ``Restore'' their
16024 support (used to be M4 macros).
16025 * data/yacc.c: Quote larger chunks, a la glr.c.
16026 * data/lalr1.cc: Likewise.
16027 The header guards are no longer available, so use some other
16028 string than `YYLSP_NEEDED'.
16029
4c6cc1db
AD
160302002-11-16 Akim Demaille <akim@epita.fr>
16031
16032 Make the ``Printers and Destructors'' test more verbose, taking
16033 `yacc.c''s behavior as (possibly wrong) reference.
16034
16035 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
16036 instead of fprint on stdout.
16037 Set and report the last_line of the symbols.
16038 Consistently display values and locations.
16039
6d9e8019
PE
160402002-11-16 Paul Eggert <eggert@twinsun.com>
16041
16042 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
16043
6e649e65
PE
160442002-11-15 Paul Eggert <eggert@twinsun.com>
16045
b25d88f6
PE
16046 * tests/actions.at (Actions after errors): New test case.
16047
6e649e65
PE
16048 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
16049 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
16050 tests/action.at, tests/calc.at, tests/conflicts.at,
16051 tests/cxx-type.at, tests/regression.at:
16052 "parse error" -> "syntax error" for POSIX compatibility.
16053 "parsing stack overflow..." -> "parser stack overflow" so
16054 that code matches Bison documentation.
16055
0f39aab9
AD
160562002-11-15 Akim Demaille <akim@epita.fr>
16057
16058 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
16059 take two BRACED_CODE, not two string_content.
16060 Free the scanner's obstack when we are done.
16061 (code_content): New.
16062 * tests/calc.at: Adjust.
16063 * doc/bison.texinfo: Adjust.
16064 Also, make sure to include the `,' for these declarations.
16065
761c1926
AD
160662002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
16067
16068 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
16069 definition; avoids potential autoreconf problems.
16070
b0f98b10
AD
160712002-11-15 Akim Demaille <akim@epita.fr>
16072
16073 Always check the value returned by yyparse.
16074
16075 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
16076 returned by yyparse.
16077 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
16078 Adjust calls.
16079 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
16080 returned by yyparse.
16081
970785f1
PH
160822002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16083
16084 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
16085 on input.at test.
16086
8fcc7db1
PE
160872002-11-14 Paul Eggert <eggert@twinsun.com>
16088
7ec1b48e
PE
16089 * src/output.c (output_skeleton): Call xfopen instead of
16090 duplicating xfopen's body.
16091
cfff7583 16092 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 16093 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 16094
8fcc7db1
PE
16095 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
16096 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
16097 Group compiler. Instead, use "$CC -E bar.c". Include the .h
16098 file twice in the grammar, as an extra check.
16099
16100 * tests/input.at (Torturing the Scanner): Surround the
16101 backslash-newline tests with "#if 0", to make it less likely that
16102 we'll run into compiler bugs. Bring back solitary \ inside
16103 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 16104 test backslash-newline in C character constant.
8fcc7db1 16105
4e8d992c
AD
161062002-11-14 Akim Demaille <akim@epita.fr>
16107
16108 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
16109 status of the compiler.
f32b346d 16110 Calling `exit 1' is no longer needed.
4e8d992c
AD
16111 Reported by Nelson H. F. Beebe.
16112
9501dc6e
AD
161132002-11-14 Akim Demaille <akim@epita.fr>
16114
16115 * tests/atlocal.in (CPPFLAGS): We have config.h.
16116 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
16117 New.
16118 * tests/actions.at, tests/calc.at, tests/conflicts.at,
16119 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
16120 * tests/regression.at, tests/torture.at: Use them for all the
16121 grammars that are to be compiled.
16122 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
16123 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
16124 * doc/bison.texinfo (GLR Parsers): Document `inline'.
16125
18b519c0
AD
161262002-11-14 Akim Demaille <akim@epita.fr>
16127
16128 * doc/bison.texinfo: Various formatting changes (alignments in
16129 samples, additional @group/@end group, GCS in samples.
16130 Use @deffn instead of simple @table to define the directives,
16131 macros, variables etc.
16132
9a86cdb9
PE
161332002-11-13 Paul Eggert <eggert@twinsun.com>
16134
daa33def 16135 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 16136 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 16137
daa33def 16138 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 16139 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
16140 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
16141 * tests/headers.at (export YYLTYPE): Likewise.
16142
16143 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 16144 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 16145
9a86cdb9
PE
16146 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
16147 comments, since they're not portable. Use GNU coding style.
16148
9c1e26bd
AD
161492002-11-13 Akim Demaille <akim@epita.fr>
16150
16151 * data/yacc.c: Leave bigger chunks of quoted text.
16152 (YYDSYMPRINTF): New.
16153 Use it to report symbol activities.
16154 * data/glr.c (YYDSYMPRINTF): New.
16155 Use it.
16156
87f721cc
PE
161572002-11-12 Paul Eggert <eggert@twinsun.com>
16158
16159 Version 1.75b.
16160
16161 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
16162 (yyglrReduce): Return yyok, not 0.
16163 This should avoid the enumerated-type warnings reported
464c6927 16164 by Nelson H. F. Beebe in
161a71f3 16165 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
16166
16167 * lib/bbitset.h (BITSET_INLINE): Remove.
16168 * lib/bitset.h [! BITSET_INLINE]: Remove.
16169 (bitset_set, bitset_reset, bitset_test): Rename local vars
16170 to avoid shadowing warnings by GCC.
16171
16172 * data/glr.c (inline): Remove #define. It's the user's
16173 responsibility to #define it away, just like 'const'.
464c6927 16174 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 16175 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 16176
87f721cc
PE
16177 * Makefile.maint (po-check): Scan .l and .y files instead of the
16178 .c and the .h files that they generate. This fixes the bug
16179 reported by Tim Van Holder in:
161a71f3 16180 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
16181 Look for N_ as well as for _. Try to avoid matching #define for
16182 N_ and _.
16183 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
16184 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
16185 * src/scan-gram.l: Revamp regular expressions so that " and '
16186 do not confuse xgettext.
16187
16188 * src/struniq.h (struniq_new): Do not declare the return type
16189 to be 'const'; this violates the C standard.
16190 * src/struniq.c (struniq_new): Likewise.
16191
be14ade5
AD
161922002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
16193
16194 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
16195 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
16196 linker.
16197
05291fbc
AD
161982002-11-12 Akim Demaille <akim@epita.fr>
16199
16200 * Makefile.maint: Sync with Autoconf:
16201 (local_updates): New.
16202
1f5fd52e
AD
162032002-11-12 Akim Demaille <akim@epita.fr>
16204
16205 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
16206
283f1e64
AD
162072002-11-12 Akim Demaille <akim@epita.fr>
16208
16209 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
16210 locations.
16211
886b69d1
AD
162122002-11-12 Akim Demaille <akim@epita.fr>
16213
16214 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
16215 not yyvalue.
16216
3df37415
AD
162172002-11-12 Akim Demaille <akim@epita.fr>
16218
16219 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
16220 Use it to test the GLR parser.
16221
7bd6c77e
AD
162222002-11-12 Akim Demaille <akim@epita.fr>
16223
16224 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
16225 defines it.
16226 * data/glr.c (yystos): New.
16227 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
16228 (YYDSYMPRINT): New.
16229 (yyval): Don't define it, it is handled via M4.
16230 (yyrecoverParseError): Free verbosely the discarded symbols.
16231 * data/yacc.c (yysymprint): Remove, rather...
16232 (b4_yysymprint_generate): invoke.
16233 * data/c.m4 (b4_yysymprint_generate): New.
16234 Accept pointers as arguments, as opposed to the version from
16235 yacc.c.
16236 (b4_yydestruct_generate): Likewise.
16237 * tests/cations.at (Printers and Destructors): Use Bison directives
16238 instead of CPP macros.
16239 Don't rely on internal details.
16240
b0400cc6
AD
162412002-11-12 Akim Demaille <akim@epita.fr>
16242
16243 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
16244 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
16245 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
16246 it against YYEMPTY and so forth), work on yytoken (i.e., set
16247 it to YYEMPTY etc.).
16248 (yydestruct): Replace with a b4_yydestruct_generate invocation.
16249 (b4_symbol_actions): Remove.
16250 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
16251 for 0, end-of-input.
16252
72f889cc
AD
162532002-11-12 Akim Demaille <akim@epita.fr>
16254
16255 * doc/bison.texinfo (Destructor Decl): New.
16256
b1ae9233
AD
162572002-11-12 Akim Demaille <akim@epita.fr>
16258
16259 * src/tables.c (tables_generate): Use free for pointers that
16260 cannot be NULL, not XFREE.
16261 (pack_vector): Use assert, not fatal, for bound violations.
16262 * src/state.c (state_new): Likewise.
16263 * src/reader.c (reader): Likewise.
16264 * src/lalr.c (set_goto_map): Likewise.
72f889cc 16265 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
16266 the file name.
16267
7ec2d4cd
AD
162682002-11-12 Akim Demaille <akim@epita.fr>
16269
16270 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
16271 Restore.
16272 * src/scan-gram.l (last_string): Is global to the file, not to
16273 yylex.
16274 * src/parse-gram.y (input): Don't append the epilogue here,
16275 (epilogue.opt): do it here, and free the scanner's obstack.
16276 * src/reader.c (epilogue_set): Rename as...
16277 (epilogue_augment): this.
16278 * data/c.m4 (b4_epilogue): Defaults to empty.
16279
573a6cd3
AD
162802002-11-12 Akim Demaille <akim@epita.fr>
16281
16282 * src/getargs.c (long_options): Remove duplicates.
16283 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
16284 Remove.
16285 * doc/bison.rnh: Remove.
16286 * doc/bison.texinfo (VMS Invocation): Remove.
16287
95612cfa
AD
162882002-11-12 Akim Demaille <akim@epita.fr>
16289
16290 * src/struniq.h, src/struniq.c (struniq_t): Is const.
16291 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
16292
16293 Use struniq for symbols.
16294
16295 * src/symtab.h (symbol_t): The tag member is a struniq.
16296 (symbol_type_set): Adjust.
16297 * src/symtab.c (symbol_new): Takes a struniq.
16298 (symbol_free): Don't free the tag member.
16299 (hash_compare_symbol_t, hash_symbol_t): Rename as...
16300 (hash_compare_symbol, hash_symbol): these.
16301 Use the fact that tags as struniqs.
16302 (symbol_get): Use struniq_new.
16303 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
16304 Returns a strniq.
16305 * src/reader.h (merger_list, grammar_currentmerge_set): The name
16306 and type members are struniqs.
16307 * src/reader.c (get_merge_function)
16308 (grammar_current_rule_merge_set): Adjust.
16309 (TYPE, current_type): Are struniq.
16310
16311 Use struniq for file names.
16312
16313 * src/files.h, src/files.c (infile): Split into...
16314 (grammar_file, current_file): these.
16315 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
16316 * src/reduce.c (reduce_print): Likewise.
16317 * src/getargs.c (getargs): Likewise.
16318 * src/complain.h, src/complain.c: Likewise.
16319 * src/main.c (main): Call struniqs_new early enough to use it for
16320 file names.
16321 Don't free the input file name.
16322
3e6656f9
AD
163232002-11-12 Akim Demaille <akim@epita.fr>
16324
16325 * src/symtab.c (symbol_free): Remove dead deactivated code:
16326 type_name are properly removed.
16327 Don't use XFREE to free items that cannot be NULL.
16328 * src/struniq.h, src/struniq.c: New.
16329 * src/main.c (main): Initialize/free struniqs.
16330 * src/parse-gram.y (%union): Add astruniq member.
16331 (yyprint): Adjust.
16332 * src/scan-gram.l (<{tag}>): Return a struniq.
16333 Free the obstack bit that used to store it.
16334 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
16335
7672019c
PE
163362002-11-11 Paul Eggert <eggert@twinsun.com>
16337
16338 Revamp to fix many (but not all) of the C- and M4-related quoting
16339 problems. Among other things, this fixes the Bison bug reported
16340 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 16341 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
16342
16343 Use new @ escapes consistently. Represent brackets with @{ and @}
16344 rather than @<:@ and @:>@, since this works a bit better with dumb
16345 editors like vi. Represent @ with @@, since @ is now consistently
16346 an escape. Use @oline@ and @ofile@ rather than __oline__ and
16347 __ofile__, to avoid unexpected expansions. Similarly, use @output
16348 rather than #output.
16349
16350 * data/c.m4 (b4_copyright): Omit file name from comment, since
16351 the file name could contain "*/".
16352 (b4_synclines_flag): Don't quote the 2nd argument; it should already
16353 be quoted. All uses changed.
16354
16355 * data/glr.c: Use new @ escapes consistently.
16356 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
16357 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
16358 Remove, since they couldn't handle arbitrary characters in file
16359 names.
16360 * data/lalr1.cc: Likewise.
16361 * data/yacc.c: Likewise.
16362
16363 * src/files.c (output_infix): Remove; all uses removed.
16364 * src/files.h: Likewise.
16365
16366 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
16367 mishandled funny characters in file names, and anyway it isn't
16368 needed any more.
16369 * data/yacc.c: Likewise.
16370 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
16371
16372 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
16373 * data/yacc.c: Likewise.
16374
16375 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
16376 strings now.
16377 (muscle_init): Quote filename as a C string.
16378 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
16379 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
16380 * src/output.c (escaped_file_name_output): New function.
16381 (prepare_symbols): Quote tokens for M4.
16382 (prepare): Don't insert output_infix, output_prefix,
16383 output_parser_name, output_header_name; this is now down by scan-skel.
16384 Insert skeleton as a C string.
16385
16386 * src/output.c (user_actions_output, symbol_destructors_output,
16387 symbol_printers_output): Quote filenames for C and M4.
16388 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16389
16390 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
16391 escapes other than \\ and \'; this simplifies the code.
16392 (<SC_STRING>): Likewise, for \\ and \".
16393 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
16394 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
16395 Use new escapes @{ and @} for [ and ].
16396
16397 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
16398 them with auto vars.
16399 Switch to new escape scheme, where @ is the escape character uniformly.
16400 Abort if a stray escape character is found. Avoid unbounded input
16401 buffer when parsing non-escaped text.
16402
16403 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
16404 __oline__, #output, $@, and @{ do not have unintended meanings.
16405
acea4f3b
PE
164062002-11-09 Paul Eggert <eggert@twinsun.com>
16407
16408 Fix the test failure due to GCC warnings described in
161a71f3 16409 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
16410 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
16411 evaluate to 0 if it's impossible for NINF to be in the respective
16412 table.
16413 (yygetLRActions, yyrecoverParseError): Use them.
16414
16415 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
16416 counted in the token inserted at end of file. Now takes
16417 location_t *, not location_t, so that the location can be
16418 adjusted. All uses changed.
16419
16420 * tests/regression.at (Invalid inputs): Adjust wording in
16421 diagnostic to match the new behavior.
16422
16423 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
16424 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
16425 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
16426 abort ();'. This reduces the runtime of the "Many lookaheads"
16427 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
16428 GCC 3.2.
16429
20ef1ad5
PE
164302002-11-07 Paul Eggert <eggert@twinsun.com>
16431
16432 * src/parse-gram.y (CHARACTER): Remove unused token.
16433 All uses removed.
16434
16435 * src/scan-gram.l: Remove stack option. We no longer use the
16436 stack, since the stack was never deeper than 1; instead, use the
16437 new auto var c_context to record the stacked value.
16438
16439 Remove nounput option. At an unexpected end of file, we now unput
16440 the minimal input necessary to end cleanly; this simplifies the
16441 code.
16442
16443 Avoid unbounded token sizes where this is easy.
16444
16445 (unexpected_end_of_file): New function.
16446 Use it to systematize the error message on unexpected EOF.
16447 (last-string): Now auto, not static.
16448 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
16449 (scanner_last_string_free): Remove; not used.
16450 (percent_percent_count): Move decl to just before use.
16451 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
16452 not the (never otherwised-used) CHARACTER.
16453
93724f13
AD
164542002-11-07 Akim Demaille <akim@epita.fr>
16455
16456 Let yyerror always receive the msg as last argument, so that
16457 yyerror can be variadic.
16458
16459 * data/yacc.c (b4_yyerror_args): New.
16460 Use it when calling yyerror.
16461 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
16462 Use it when calling yyerror.
16463 * doc/bison.texinfo (Error Reporting): Adjust.
16464 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
16465 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
16466
6e40b4eb
AD
164672002-11-06 Akim Demaille <akim@epita.fr>
16468
16469 #line should have quoted strings.
16470 Ideally, this should be done by m4_quotearg.
16471
16472 * src/scan-skel.l: Include quotearg.h.
16473 Quote __ofile__.
16474 * src/output.c (symbol_printers_output)
16475 (symbol_destructors_output): Quote the file name.
16476
2dfbfc12
AD
164772002-11-06 Akim Demaille <akim@epita.fr>
16478
16479 * tests/regression.at (Invalid inputs): Adjust to the recent
16480 messages.
16481
437c2d80
AD
164822002-11-06 Akim Demaille <akim@epita.fr>
16483
16484 Restore --no-lines.
16485 Reported by Jim Kent.
16486
16487 * data/c.m4 (b4_syncline): New.
16488 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
16489 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
16490 * src/output.c (user_actions_output): Likewise.
16491 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 16492 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 16493
900c5db5
AD
164942002-11-06 Akim Demaille <akim@epita.fr>
16495
16496 * src/main.c (main): Free `infile'.
16497 * src/scan-gram.l (handle_syncline): New.
16498 Recognize `#line'.
16499 * src/output.c (user_actions_output, symbol_destructors_output)
16500 (symbol_printers_output): Use the location's file name, not
16501 infile.
16502 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16503
e183b123 165042002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 16505
e183b123 16506 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 16507 either has GLR conflict entries.
e183b123 16508
193eb6b7
PE
165092002-11-05 Paul Eggert <eggert@twinsun.com>
16510
e183b123
PE
16511 * src/scan-gram.l: Use more accurate diagnostics, e.g.
16512 "integer out of range" rather than "invalid value".
16513 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
16514 accordingly.
16515
193eb6b7
PE
16516 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
16517 Also, remove one static variable in the scanner.
16518
16519 * src/scan-gram.l (braces_level): Now auto, not static.
16520 Initialize to zero if the compiler is being picky.
16521 (INITIAL): Clear braces_level instead of incrementing it.
16522 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
16523 as POSIX 1003.1-2001 requires.
16524 * src/system.h (IF_LINT): New macro, taken from coreutils.
16525 * configure.ac: Define "lint" if --enable-gcc-warnings.
16526
29c01725
AD
165272002-11-05 Akim Demaille <akim@epita.fr>
16528
16529 * src/scan-gram.l: When it starts with `%', complain about the
16530 whole directive, not just that `invalid character: %'.
16531
8aeac3ca
AD
165322002-11-04 Akim Demaille <akim@epita.fr>
16533
16534 * Makefile.maint: Update from Autoconf.
16535 (update, cvs-update, po-update, do-po-update): New.
16536
793a58bb
AD
165372002-11-04 Akim Demaille <akim@epita.fr>
16538
16539 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
16540 and yyerror.
16541 Have yyerror `use' its arguments.
16542 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
16543 returns true when location & yacc & pure & parse-param.
16544 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
16545
c4d720cd
AD
165462002-11-04 Akim Demaille <akim@epita.fr>
16547
16548 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
16549 clashes.
16550 * src/scan-gram.l: Use [\'] instead of ['] to pacify
16551 font-lock-mode.
16552 Use complain_at.
16553 Use quote, not quote_n since LOCATION_PRINT no longer uses the
16554 slot 0.
16555
613a0dc5
PE
165562002-11-03 Paul Eggert <eggert@twinsun.com>
16557
16558 * src/reader.c (get_merge_function, grammar_current_rule_check):
16559 Use consistent diagnostics for reporting type name clashes.
16560 Quote the types with <>, for consistency with Yacc.
16561 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
16562
2a8d363a
AD
165632002-11-03 Akim Demaille <akim@epita.fr>
16564
16565 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
16566 New.
16567 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
16568 (b4_parse_param): Remove.
16569 Use b4_identification.
16570 Propagate b4_pure_args where needed to pass them to yyerror.
16571 * data/glr.m4 (b4_parse_param): Remove.
16572 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
16573 (b4_lpure_formals): New.
16574 Use b4_identification.
16575 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
16576 b4_user_formals and b4_user_args.
16577 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
16578 (yyreportAmbiguity): When using a pure parser, also need
16579 the location, and the parse-params.
16580 Adjust callers.
16581 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
16582 When using a pure parser, also need the parse-params.
16583 Adjust callers.
16584 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
16585 (%pure-parser + %parse-param) LALR and GLR parsers.
16586 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
16587 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
16588 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
16589 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
16590 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
16591 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
16592 * doc/bison.texinfo: Untabify the whole file.
16593 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
16594 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
16595 (Error Reporting): Adjust to these new directives.
16596 Document %error-verbose, deprecate YYERROR_VERBOSE.
16597
9e32add8
AD
165982002-11-03 Akim Demaille <akim@epita.fr>
16599
16600 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
16601 AT_CHECK_CALC_GLR invocations to use % directives, instead of
16602 command line options.
16603 * tests/cxx-type.at: Formatting changes.
16604
b02d90a5
PE
166052002-11-03 Paul Eggert <eggert@twinsun.com>
16606
16607 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
16608 to count columns correctly, and to check for invalid inputs.
9e32add8 16609
b02d90a5
PE
16610 Use mbsnwidth to count columns correctly. Account for tabs, too.
16611 Include mbswidth.h.
16612 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
16613 (extend_location): New function.
16614 (YY_LINES): Remove.
16615
16616 Handle CRLF in C code rather than in Lex code.
16617 (YY_INPUT): New macro.
16618 (no_cr_read): New function.
16619
16620 Scan UCNs, even though we don't fully handle them yet.
16621 (convert_ucn_to_byte): New function.
16622
16623 Handle backslash-newline correctly in C code.
16624 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
16625 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
16626 all uses changed.
16627 (tag, splice): New EREs. Do not allow NUL or newline in tags.
16628 Use {splice} wherever C allows backslash-newline.
16629 YY_STEP after space, newline, vertical-tab.
16630 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 16631
b02d90a5
PE
16632 (letter, id): Don't assume ASCII; e.g., spell out a-z.
16633
16634 ({int}, handle_action_dollar, handle_action_at): Check for integer
16635 overflow.
9e32add8 16636
b02d90a5
PE
16637 (YY_STEP): Omit trailing semicolon, so that it's more like C.
16638
16639 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
16640 as well as \000. Check for UCHAR_MAX, not 255.
16641 Allow \x with an arbitrary positive number of digits, as in C.
16642 Check for overflow here.
16643 Allow \? and UCNs, for compatibility with C.
16644
16645 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
16646 with quote slot used by complain_at.
16647
16648 * tests/input.at: Add tests for backslash-newline, m4 quotes
16649 in symbols, long literals, and funny escapes in strings.
16650
16651 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
16652 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
16653 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
16654 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
16655 * m4/mbswidth.m4: New file, from GNU coreutils.
16656
16657 * doc/bison.texinfo (Grammar Outline): Document // comments.
16658 (Symbols): Document that trigraphs have no special meaning in Bison,
16659 nor is backslash-newline allowed.
16660 (Actions): Document that trigraphs have no special meaning.
16661
16662 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
16663 no longer used.
16664
166652002-11-02 Paul Eggert <eggert@twinsun.com>
16666
16667 * src/reader.c: Don't include quote.h; not needed.
16668 (get_merge_function): Reword warning to be consistent with
16669 type clash diagnostic in grammar_current_rule_check.
16670
16671 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
16672 bug in trigraph handling.
16673
16674 * src/output.c (prepare_symbols): When printing token names,
16675 escape "[" as "@<:@" and likewise for "]".
16676
16677 * src/system.h (errno): Remove declaration, as we are now
16678 assuming C89 or better, and C89 guarantees errno.
16679
762b212b
PE
166802002-10-30 Paul Eggert <eggert@twinsun.com>
16681
16682 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
16683 Check for close failures.
16684 * src/files.h (xfclose): Return void, not int, since it always
16685 returned zero.
16686 * src/files.c (xfclose): Likewise. Report I/O error if ferror
16687 indicates one.
16688 * src/output.c (output_skeleton): Use xfclose rather than fclose
16689 and ferror. xfclose now checks ferror.
16690
16691 * data/glr.c (YYLEFTMOST_STATE): Remove.
16692 (yyreportTree): Use a stack-based leftmost state. This avoids
16693 our continuing battles with bogus warnings about initializers.
16694
56100c60
AD
166952002-10-30 Akim Demaille <akim@epita.fr>
16696
16697 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
16698 #if.
16699
51b4a04c
PH
167002002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16701
16702 * tests/glr-regr1.at: New test for reported regressions.
16703 * tests/testsuite.at: Add glr-regr1.at test.
16704 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 16705
bf1ebda2
PE
167062002-10-24 Paul Eggert <eggert@twinsun.com>
16707
5c16c6b1
PE
16708 Version 1.75a.
16709
bf1ebda2
PE
16710 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
16711 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
16712 we use malloc. Don't assume 'A' through 'Z' are contiguous.
16713 Don't assume strdup exists; POSIX says its an XSI extension.
16714 Check for buffer overflow on input.
16715
b526ee61
AD
167162002-10-24 Akim Demaille <akim@epita.fr>
16717
16718 * src/output.c (output_skeleton): Don't disable M4sugar comments
16719 too soon: it results in comments being expanded.
16720 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
16721 first output.
16722
f1886bb2
AD
167232002-10-24 Akim Demaille <akim@epita.fr>
16724
16725 * data/yacc.c (m4_int_type): New.
16726 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
16727 char' as only yacc.c wants K&R portability.
16728 * data/glr.c (yysigned_char): Remove.
16729 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
16730 Reported by Quoc Peyrot.
16731
c5576256
PE
167322002-10-23 Paul Eggert <eggert@twinsun.com>
16733
16734 * src/main.c (main): With --trace=time, report times even if a
16735 non-fatal error occurs. Formerly, the times were reported in some
16736 such cases but not in others.
16737 * src/reader.c (reader): Just return if a complaint has been issued,
16738 instead of exiting, so that 'main' can report times.
16739
27b0ffea
AD
167402002-10-22 Akim Demaille <akim@epita.fr>
16741
16742 * src/system.h: Include sys/types.
16743 Reported by Bert Deknuydt.
16744
223a7883
PE
167452002-10-23 Paul Eggert <eggert@twinsun.com>
16746
16747 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
16748 Suggested by Art Haas.
16749
167502002-10-22 Paul Eggert <eggert@twinsun.com>
16751
16752 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
16753 decl; not needed any more.
16754 * src/main.c (main): Use return to exit, undoing yesterday's change.
16755 The last OS that we could find where this wouldn't work is
16756 SunOS 3.5, and that's too old to worry about now.
16757
16758 * data/glr.c (struct yyltype): Define members even when not
16759 doing locations. This is more consistent with yacc.c, and it
16760 works around the following bug reports:
161a71f3
PE
16761 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
16762 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 16763
223a7883
PE
16764 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
16765 @acronym consistently. Standardize on "Yacc" instead of "YACC",
16766 "Algol" instead of "ALGOL". Give a bit more history about BNF.
16767
8b76775a
AD
167682002-10-22 Akim Demaille <akim@epita.fr>
16769
16770 * data/README: New.
16771
6db10d14
PE
167722002-10-21 Paul Eggert <eggert@twinsun.com>
16773
16774 Be consistent about 'bool'; the old code used an enum in one
16775 module and an int in another, and this violates the C standard.
16776 * m4/stdbool.m4: New file, from coreutils 4.5.3.
16777 * configure.ac (AC_HEADER_STDBOOL): Add.
16778 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
16779 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
16780 * src/symtab.c (hash_compare_symbol_t): Likewise.
16781 * src/system.h (bool, false, true): Use a definition consistent
16782 with ../lib/hash.c. All uses changed.
16783
16784 * src/complain.c (warning_issued): Renamed from warn_message_count,
16785 so that we needn't worry about integer overflow (!).
16786 Now of type bool. All uses changed.
16787 (complaint_issued): Renamed from complain_message_count; likewise.
16788
16789 * src/main.c (main): Use exit to exit with failure.
27b0ffea 16790
6db10d14
PE
16791 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
16792 rather than 1 and 0.
16793 * src/main.c (main): Likewise.
16794 * src/getargs.c (getargs): Likewise.
16795 * src/reader.c (reader): Likewise.
16796
16797 * src/getarg.c (getargs): Remove duplicate code for
16798 "Try `bison --help'".
16799
16800 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
16801 What was that "2" for?
16802
16803 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
16804 * src/getargs.c (usage): Likewise.
16805
16806 * src/getargs.c (getargs): When there are too few operands, report
16807 the last one. When there are too many, report the first extra
16808 one. This is how diffutils does it.
16809
92a060fd
PE
168102002-10-20 Paul Eggert <eggert@twinsun.com>
16811
16812 Remove K&R vestiges.
16813 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
16814 * src/complain.c (VA_START): Remove. Assume prototypes.
16815 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
16816 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
16817 fatal): Assume prototypes.
16818 * src/complain.h: Assume prototypes.
16819 * src/system.h (PARAMS): Remove.
16820 Include <limits.h> unconditionally, since it's guaranteeed even
16821 for a freestanding C89 compiler.
16822 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
16823 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 16824
e7cb57c0
AD
168252002-10-20 Akim Demaille <akim@epita.fr>
16826
16827 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
16828 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
16829 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
16830 (yyresolveStates, yyresolveAction, yyresolveStack)
16831 (yyprocessOneStack): Use them.
16832 (yy_reduce_print): New.
16833 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
16834
0245f82d
AD
168352002-10-20 Akim Demaille <akim@epita.fr>
16836
16837 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
16838 arguments and output `void'.
16839 (b4_c_function): Rename as...
16840 (b4_c_function_def): this.
16841 (b4_c_function_decl, b4_c_ansi_function_def)
16842 (b4_c_ansi_function_decl): New.
16843 Change the interpretation of the arguments: before `int, foo', now
16844 `int foo, foo'.
16845 * data/yacc.c (yyparse): Prototype and define thanks to these.
16846 Adjust b4_c_function_def uses.
16847 * data/glr.c (yyparse): Likewise, but ANSI only.
16848
39912f52
AD
168492002-10-20 Akim Demaille <akim@epita.fr>
16850
16851 * src/output.c (prepare): Move the definition of `tokens_number',
16852 `nterms_number', `undef_token_number', `user_token_number_max'
16853 to...
16854 (prepare_tokens): Here.
16855 (prepare_tokens): Rename as...
16856 (prepare_symbols): this.
16857 (prepare): Move the definition of `rules_number' to...
16858 (prepare_rules): here.
16859 (prepare): Move the definition of `last', `final_state_number',
16860 `states_number' to...
16861 (prepare_states): here.
16862 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
16863
20c1e2ad
AD
168642002-10-20 Akim Demaille <akim@epita.fr>
16865
16866 * src/tables.h, src/tables.c, src/output.c: Comment changes.
16867
21964f43
AD
168682002-10-20 Akim Demaille <akim@epita.fr>
16869
16870 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
16871 * data/c.m4: here.
16872
66d30cd4
AD
168732002-10-20 Akim Demaille <akim@epita.fr>
16874
16875 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
16876 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
16877 `pair'.
16878 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
16879 `name' to...
16880 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
16881 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
16882 These.
16883
95f2c9fe
PE
168842002-10-19 Paul Eggert <eggert@twinsun.com>
16885
16886 Do not create a temporary file, as that involves security and
16887 cleanup headaches. Instead, use a pair of pipes.
16888 Derived from a suggestion by Florian Krohm.
16889 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
16890 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
16891 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
16892 (BISON_PREREQ_SUBPIPE): Add.
16893 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
16894 Add subpipe.h, subpipe.c.
16895 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
16896 * po/POTFILES.in: Add lib/subpipe.c.
16897 * src/output.c: Include "subpipe.h".
16898 (m4_invoke): Remove decl.
16899 (scan_skel): New decl.
16900 (output_skeleton): Use pipe rather than temporary file for m4 input.
16901 Check that m4sugar.m4 is readable, to avoid deadlock.
16902 Check for pipe I/O error.
16903 * src/scan-skel.l (readpipe): Remove decl.
16904 (scan_skel): New function, to be used in place of m4_invoke.
16905 Read from stream rather than file.
66d30cd4 16906
95f2c9fe
PE
16907 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
16908 float, as this generates a warning on Solaris 8 + GCC 3.2 with
16909 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
16910 this generates a more-accurate value anyway.
16911
16912 * lib/timevar.c (timervar_accumulate): Rename locals to
16913 avoid confusion with similarly-named more-global.
16914 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
16915
16916 * src/output.c (prepare): Use xstrdup to convert char const *
16917 to char *, to avoid GCC warning.
16918
c19988b7
AD
169192002-10-19 Akim Demaille <akim@epita.fr>
16920
16921 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
16922 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
16923 Use them to have `calc.y' ready for %pure-parser.
16924 * data/yacc.c (YYLEX): Pass a yylex return type to
16925 b4_c_function_call.
16926
ae7453f2
AD
169272002-10-19 Akim Demaille <akim@epita.fr>
16928
16929 Prototype support of %lex-param and %parse-param.
16930
16931 * src/parse-gram.y: Add the definition of the %lex-param and
16932 %parse-param tokens, plus their rules.
16933 Drop the `_' version of %glr-parser.
16934 Add the "," token.
16935 * src/scan-gram.l (INITIAL): Scan them.
16936 * src/muscle_tab.c: Comment changes.
16937 (muscle_insert, muscle_find): Rename `pair' as `probe'.
16938 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
16939 (muscle_entry_s): The `value' member is no longer const.
16940 Adjust all dependencies.
16941 * src/muscle_tab.c (muscle_init): Adjust: use
16942 MUSCLE_INSERT_STRING.
16943 Initialize the obstack earlier.
16944 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
16945 (muscle_pair_list_grow): New.
16946 * data/c.m4 (b4_c_function_call, b4_c_args): New.
16947 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
16948 * tests/calc.at: Use %locations, not --locations.
16949 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
16950
0e575721
AD
169512002-10-19 Akim Demaille <akim@epita.fr>
16952
16953 * src/getargs.c (usage): Take status as argument and exit
16954 accordingly.
16955 Report the traditional `Try ... --help' message when status != 0.
16956 (usage, version): Don't take a FILE * as arg, it is pointless.
16957 (getargs): When there is an incorrect number of arguments, make it
16958 an error, and report it GNUlically thanks to `usage ()'.
16959
724ce7f5
PE
169602002-10-18 Paul Eggert <eggert@twinsun.com>
16961
3a781eb2
PE
16962 * data/glr.c (yyreportParseError): Don't assume that sprintf
16963 yields the length of the printed string, as this is not true
16964 on SunOS 4.1.4. Reported by Peter Klein.
16965
724ce7f5
PE
16966 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
16967 * tests/conflicts.at (%nonassoc and eof): Likewise.
16968 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
16969
473d0a75
AD
169702002-10-17 Akim Demaille <akim@epita.fr>
16971
16972 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
16973 * src/getargs.c (trace_types, trace_args): Adjust.
16974 * src/reader.c (grammar_current_rule_prec_set)
16975 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
16976 Standardize error messages.
16977 And s/@prec/%prec/!
16978 (reader): Use trace_flag to enable scanner/parser debugging,
16979 instead of an adhoc scheme.
16980 * src/scan-gram.l: Remove trailing debugging code.
16981
e76d2469
PE
169822002-10-16 Paul Eggert <eggert@twinsun.com>
16983
93e2236a
PE
16984 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
16985 MUSCLE_TAB_H.
16986
e76d2469
PE
16987 * NEWS: Officially drop support for building Bison with K&R C,
16988 since it didn't work anyway and it's not worth worrying about.
16989 * Makefile.maint (wget_files): Remove ansi2knr.c.
16990 (ansi2knr.c-url_prefix): Remove.
16991 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
16992 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16993 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16994
5bd1c419
PE
169952002-10-15 Paul Eggert <eggert@twinsun.com>
16996
16997 Stop using the "enum_" trick for K&R-style function definitions;
16998 it confused me, and I was the author! Instead, assume that people
16999 who want to use K&R C compilers (when using these modules in GCC,
17000 perhaps?) will run ansi2knr.
17001
17002 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
17003 All uses of "enum_" changed to "enum ".
17004 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17005 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 17006
5bd1c419
PE
17007 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
17008 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
17009 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
17010 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
17011 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
17012 abitset_not, abitset_ones, abitset_or, abitset_or_and,
17013 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
17014 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
17015 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
17016 Use function prototypes; this removes the need for declaring
17017 static functions simply to provide their prototypes.
17018 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
17019 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
17020 bitset_count_, bitset_create, bitset_dump, bitset_first,
17021 bitset_free, bitset_init, bitset_last, bitset_next,
17022 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
17023 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
17024 bitset_print, bitset_release_memory, bitset_toggle_,
17025 bitset_type_choose, bitset_type_get, bitset_type_name_get,
17026 debug_bitset): Likewise.
17027 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
17028 * lib/bitset_stats.c (bitset_log_histogram_print,
17029 bitset_percent_histogram_print, bitset_stats_and,
17030 bitset_stats_and_cmp, bitset_stats_and_or,
17031 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
17032 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
17033 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
17034 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
17035 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
17036 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
17037 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
17038 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
17039 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
17040 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
17041 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
17042 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
17043 bitset_stats_zero): Likewise.
17044 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17045 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17046 bitsetv_dump, debug_bitsetv): Likewise.
17047 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
17048 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
17049 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
17050 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
17051 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
17052 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
17053 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
17054 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
17055 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
17056 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
17057 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
17058 Likewise.
17059 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
17060 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
17061 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
17062 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
17063 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
17064 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
17065 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
17066 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
17067 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
17068 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
17069 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 17070
ae26e1f0
AD
170712002-10-14 Akim Demaille <akim@epita.fr>
17072
17073 Version 1.75.
17074
d43baf71
AD
170752002-10-14 Akim Demaille <akim@epita.fr>
17076
17077 * tests/Makefile.am (maintainer-check-posix): New.
17078
7ebc83e3
AD
170792002-10-14 Akim Demaille <akim@epita.fr>
17080
17081 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
17082 member.
17083
05846dae
AD
170842002-10-14 Akim Demaille <akim@epita.fr>
17085
17086 * src/tables.c (table_ninf_remap): base -> tab.
17087 Reported by Matt Rosing.
17088
1318e37d
PE
170892002-10-14 Paul Eggert <eggert@twinsun.com>
17090
447fbb17
PE
17091 * tests/action.at, tests/calc.at, tests/conflicts.at,
17092 tests/cxx-type.at, tests/headers.at, tests/input.at,
17093 tests/regression.at, tests/synclines.at, tests/torture.at:
17094 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
17095 so that the tests still work even if POSIXLY_CORRECT is set.
17096 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 17097
1318e37d
PE
17098 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
17099 for portability to K&R hosts. Fix typo: signed char is guaranteed
17100 only to 127, not to 128.
17101 * data/glr.c (yysigned_char): New type.
17102 * data/yacc.c (yysigned_char): Likewise.
17103 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
17104
cc0f0794
PE
171052002-10-13 Paul Eggert <eggert@twinsun.com>
17106
5038f418
PE
17107 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
17108 true due to limited range of data type" warning from GCC.
17109
cc0f0794
PE
17110 * data/c.m4 (b4_token_defines): Protect against double-inclusion
17111 by wrapping enum yytokentype's definition inside #ifndef
17112 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
17113
6fed0802
AD
171142002-10-13 Akim Demaille <akim@epita.fr>
17115
17116 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
17117 Un yy- yyrhs to avoid the name clash with the global YYRHS.
17118
32f0598d
AD
171192002-10-13 Akim Demaille <akim@epita.fr>
17120
17121 * Makefile.maint: Update from Autoconf 2.54.
17122 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
17123
7ea9a33f
AD
171242002-10-13 Akim Demaille <akim@epita.fr>
17125
17126 * src/print.c (print_state): Separate the list of solved conflicts
17127 from the other items.
17128 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
17129
ea99527d
AD
171302002-10-13 Akim Demaille <akim@epita.fr>
17131
17132 Let nondeterministic skeletons be usable with deterministic
17133 tables.
17134
17135 With the patch, GAWK compiled by GCC without -O2 passes its test
17136 suite using a GLR parser driven by LALR tables. It fails with -O2
17137 because `struct stat' gives two different answers on my machine:
17138 88 (definition of an auto var) and later 96 (memset on this var).
17139 Hence the stack is badly corrumpted. The headers inclusion is to
17140 blame: if I move the awk.h inclusion before GLR's system header
17141 inclusion, the two struct stat have the same size.
17142
17143 * src/tables.c (pack_table): Always create conflict_table.
17144 (token_actions): Always create conflict_list.
17145 * data/glr.c (YYFLAG): Remove, unused.
17146
f377f69f
AD
171472002-10-13 Akim Demaille <akim@epita.fr>
17148
17149 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
17150 (O0FLAGS): New.
17151 (VALGRIND, GXX): New.
17152 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
17153 * tests/bison.in: Run $PREBISON a pre-command.
17154 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
17155 (maintainer-check-g++): New.
17156 * Makefile.am (maintainer-check): New.
17157
2a1fe6ed
AD
171582002-10-13 Akim Demaille <akim@epita.fr>
17159
17160 * data/glr.c: Formatting changes.
17161 Tweak some trace messages to match yacc.c's.
17162
f50adbbd
AD
171632002-10-13 Akim Demaille <akim@epita.fr>
17164
17165 GLR parsers sometimes raise parse errors instead of performing the
17166 default reduction.
17167 Reported by Charles-Henry de Boysson.
17168
17169 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 17170 check the length of the traces when %glr.
f50adbbd
AD
17171 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
17172 GLR's traces.
17173 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
17174 Test GLR parsers.
17175 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
17176 (yyltype): Remove the yy prefix from the member names.
17177 (yytable): Complete its comment.
17178 (yygetLRActions): Map error action number from YYTABLE from
17179 YYTABLE_NINF to 0.
17180 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
17181 (which was a bug: it should have been YYTABEL_NINF, and yet it was
17182 not satisfying as we could compare an YYACTION computed from
17183 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
17184 only value for error actions.
17185 (yyreportParseError): In verbose parse error messages, don't issue
17186 `error' in the list of expected tokens.
17187 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
17188 next action to perform to match glr.c's decoding.
17189 (yytable): Complete its comment.
17190
bcbad5b9
PE
171912002-10-13 Paul Eggert <eggert@twinsun.com>
17192
17193 Fix problem reported by Henrik Grubbstroem in
161a71f3 17194 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
17195 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
17196 because the Bison parser reads the second action before reducing
17197 the first one.
17198 * src/scan-gram.l (rule_length): New static var.
17199 Use it to keep track of the rule length in the scanner, since
17200 we can't expect the parser to be in lock-step sync with the scanner.
17201 (handle_action_dollar, handle_action_at): Use this var.
17202 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 17203
14904b89
PE
172042002-10-12 Paul Eggert <eggert@twinsun.com>
17205
1fe611e5
PE
17206 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
17207 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
17208 Include <sys/time.h> when checking for clock_t and struct tms.
17209 Use same include order as source.
17210 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 17211 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 17212
1fe611e5
PE
17213 * lib/timevar.c: Update copyright date and clarify comments.
17214 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 17215
1fe611e5
PE
17216 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
17217 GCC version as of today, then merge Bison's changes.
17218 Change "GCC" to "Bison" in copyright notice. timevar.def's
17219 author is Akim, so change that too.
17220
98194095
PE
17221 * src/reader.c (grammar_current_rule_check):
17222 Don't worry about the default action if $$ is untyped.
17223 Prevents bogus warnings reported by Jim Gifford in
161a71f3 17224 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 17225
14904b89
PE
17226 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
17227 * data/glr.c, data/lalr1.cc, data/yacc.c:
17228 Output token definitions before the first part of user declarations.
17229 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 17230 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 17231
ff6dca18
PE
172322002-10-11 Paul Eggert <eggert@twinsun.com>
17233
17234 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
17235 (yyparse): here. This undoes some of the 2002-07-25 change.
17236 Compatibility problem reported by Ralf S. Engelschall with
17237 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
17238
eb714592
AD
172392002-10-11 Akim Demaille <akim@epita.fr>
17240
17241 * tests/regression.at Characters Escapes): New.
17242 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
17243 characters.
17244 Reported by Jan Nieuwenhuizen.
17245
b7195100
AD
172462002-10-11 Akim Demaille <akim@epita.fr>
17247
17248 * po/id.po: New.
17249
f28a0f2d
PE
172502002-10-10 Paul Eggert <eggert@twinsun.com>
17251
17252 Portability fixes for bitsets; this also avoids several GCC
17253 warnings.
17254
17255 * lib/abitset.c: Include <stddef.h>, for offsetof.
17256 * lib/lbitset.c: Likewise.
17257
17258 * lib/abitset.c (abitset_bytes): Return a size that is aligned
17259 properly for vectors of objects. Do not assume that adding a
17260 header size to a multiple of a word size yields a value that is
17261 properly aligned for the whole union.
17262 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17263
17264 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
17265 unique names for structures.
17266 * lib/ebitset.c (ebitset_bytes): Likewise.
17267 * lib/lbitset.c (lbitset_bytes): Likewise.
17268
17269 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
17270 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
17271 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
17272 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
17273 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
17274 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
17275 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
17276 to improve the type-checking that GCC can do.
17277 * lib/bitset.c (bitset_op4_cmp): Likewise.
17278 * lib/bitset_stats.c (bitset_stats_count,
17279 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
17280 bitset_stats_copy, bitset_stats_disjoint_p,
17281 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
17282 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
17283 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
17284 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
17285 bitset_stats_and_or_cmp, bitset_stats_andn_or,
17286 bitset_stats_andn_or_cmp, bitset_stats_or_and,
17287 bitset_stats_or_and_cmp): Likewise.
17288 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
17289 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
17290 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
17291 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
17292
17293 * lib/abitset.h: Include bitset.h, not bbitset.h.
17294 * lib/ebitset.h: Likewise.
17295 * lib/lbitset.h: Likewise.
17296
17297 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
17298 All instances of parameters of type enum bitset_opts are now of
17299 type enum_bitset_opts, to conform to the C Standard, and similarly
17300 for enum_bitset_type.
17301 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17302 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
17303
17304 Do not use "struct bitset_struct" to mean different things in
17305 different modules. Not only is this confusing, it violates
17306 the C Standard, which requires that structure types in different
17307 modules must be compatible if one is to be passed to the other.
17308 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
17309 All instances of "struct bitset_struct *" replaced with "bitset".
17310 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
17311 (union bitset_union, struct abitset_struct, struct ebitset_struct,
17312 struct lbitset_struct, struct bitset_stats_struct): New types.
17313 All uses of struct bitset_struct changed to union bitset_union,
17314 etc.
ba0fe3c7 17315 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
17316 struct bitset_struct): Remove.
17317 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
17318 struct bitset_struct): Remove.
17319 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
17320 bitset_struct): Remove.
17321 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
17322 Likewise.
17323
17324 Do not call a function of type T using a call that assumes the
17325 function is of a different type U. Standard C requires that a
17326 function must be called with a type that is compatible with its
17327 definition.
17328 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17329 New decls.
17330 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17331 New functions.
17332 * lib/ebitset.c (PFV): Remove.
17333 * lib/lbitset.c (PFV): Likewise.
17334 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
17335 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
17336 decls.
17337 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
17338 (ebitset_vtable): Use them.
17339 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
17340 lbitset_xor): New functions.
17341 (lbitset_vtable): Use them.
17342
17343 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
17344 Declare.
17345
17346 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
17347 GCC warning.
17348 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
17349 Use offsetof, for simplicity.
17350
6fbe4984
PE
173512002-10-06 Paul Eggert <eggert@twinsun.com>
17352
17353 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
17354 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 17355 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
17356 which was inadvertently undone by the 2002-09-30 patch.
17357 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
17358 the same width as int.
17359
420f93c8
PE
173602002-10-04 Paul Eggert <eggert@twinsun.com>
17361
17362 Version 1.50.
17363
17364 * configure.ac (AC_INIT), NEWS: Increment version number.
17365
17366 * doc/bison.texinfo: Minor spelling, grammar, and white space
17367 fixes.
17368 (Symbols): Mention that any negative value returned from yylex
17369 signifies end-of-input. Warn about negative chars. Mention
17370 the portable Standard C character set.
17371
17372 The GNU coding standard says CFLAGS and YFLAGS are reserved
17373 for the installer to set.
17374 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
17375 * src/Makefile.am (AM_CFLAGS): Likewise.
17376 (AM_YFLAGS): Renamed from YFLAGS.
17377
17378 Fix some MAX and MIN problems.
17379 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
17380 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
17381 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
17382 * src/reader.c (reader): Use it.
17383
17384 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
17385 POSIX 1003.1-2001 has removed fgrep.
17386
173872002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
17388
17389 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
17390 interpreted as signed.
17391 * lib/ebitset.c (ebitset_list): Fix bug.
17392
ff68026d
PE
173932002-10-01 Paul Eggert <eggert@twinsun.com>
17394
17395 More fixes for 64-bit hosts and large bitsets.
17396
17397 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
17398 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
17399 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
17400 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
17401 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
17402 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
17403 bitset_count_): Likewise.
17404 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
17405 bitset_first, bitset_last): Likewise.
17406 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
17407 bitset_stats_list_reverse, bitset_stats_size,
17408 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
17409 Likewise.
17410 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17411 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17412 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17413 bitsetv_reflexive_transitive_closure): Likewise.
17414 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
17415 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
17416 Likewise.
17417 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
17418 Likewise.
420f93c8 17419
ff68026d
PE
17420 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
17421 Use size_t, not unsigned int, to count bytes.
17422 * lib/abitset.h (abitset_bytes): Likewise.
17423 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
17424 Likewise.
17425 * lib/bitset.h (bitset_bytes): Likewise.
17426 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
17427 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
17428 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17429 * lib/ebitset.c (ebitset_bytes): Likewise.
17430 * lib/ebitset.h (ebitset_bytes): Likewise.
17431 * lib/lbitset.c (lbitset_bytes): Likewise.
17432 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 17433
ff68026d
PE
17434 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
17435 abitset_subset_p, abitset_disjoint_p, abitset_and,
17436 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
17437 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
17438 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
17439 abitset_or_and, abitset_or_and_cmp):
17440 Use bitset_windex instead of unsigned int.
17441 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17442 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
17443 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
17444 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
17445 Likewise.
17446 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 17447
ff68026d
PE
17448 * lib/bitset.c (bitset_print):
17449 Use proper printf formats for widths of integer types.
17450 * lib/bitset_stats.c (bitset_percent_histogram_print,
17451 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
17452 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17453 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17454 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 17455
ff68026d
PE
17456 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
17457 BITSET_SIZE_MAX): New macros.
17458 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
17459 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
17460 to BITSET_WINDEX_MAX.
17461
17462 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
17463 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
17464 since we now return the bitset_bindex type (not int).
17465
17466 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
17467 when computing sizes.
17468 * lib/ebitset.c (ebitset_elts_grow): Likewise.
17469
17470 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
17471 and avoid cast to unsigned.
17472
6aa452a6
AD
174732002-09-30 Akim Demaille <akim@epita.fr>
17474
17475 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
17476 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
17477 Updates from Michael Hayes.
17478
927f7817
AD
174792002-09-30 Art Haas <ahaas@neosoft.com>
17480
17481 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
17482 invocations.
17483 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
17484 defined.
17485
9738f41e
AD
174862002-09-27 Akim Demaille <akim@epita.fr>
17487
17488 Version 1.49c.
17489
a5c75d7f
AD
174902002-09-27 Akim Demaille <akim@epita.fr>
17491
17492 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
17493 (Because of AC_LIBSOURCE).
17494
8280e179
AD
174952002-09-27 Akim Demaille <akim@epita.fr>
17496
17497 Playing with Autoscan.
17498
17499 * configure.ac: Remove the old LIBOBJ tweaks.
17500 (AC_REPLACE_FUNCS): Add strrchr and strtol.
17501 * lib/strrchr.c: New.
17502 * lib/strtol.c: New, from the Coreutils 4.5.1.
17503
ae64af35
AD
175042002-09-27 Akim Demaille <akim@epita.fr>
17505
17506 Playing with Autoscan.
17507
17508 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
17509 * lib/Makefile.am (libbison_a_SOURCES): No longer include
17510 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
17511 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
17512 Coreutils 4.5.1.
17513
d1a1114f
AD
175142002-09-24 Akim Demaille <akim@epita.fr>
17515
17516 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
17517 (Frequently Asked Questions, Parser Stack Overflow): New.
17518
b906441c
AD
175192002-09-13 Akim Demaille <akim@epita.fr>
17520
17521 Playing with autoscan.
17522
17523 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
17524 * src/files.c (skeleton_find): Remove, unused.
17525 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
17526 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
17527
bd701811
AD
175282002-09-13 Akim Demaille <akim@epita.fr>
17529
17530 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
17531 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
17532
e0a13e7b
AD
175332002-09-13 Akim Demaille <akim@epita.fr>
17534
17535 * configure.ac: Require 2.54.
17536 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
17537 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
17538 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
17539 Remove, provided by Autoconf macros.
17540
c97011bf
AD
175412002-09-12 Akim Demaille <akim@epita.fr>
17542
17543 * m4/prereq.m4: Update, from Coreutils 4.5.1.
17544
d862b1be
AD
175452002-09-12 Akim Demaille <akim@epita.fr>
17546
17547 * m4/prereq.m4: Update, from Fileutils 4.1.5.
17548 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
17549 Reported by Martin Mokrejs.
17550
3d38c03a
AD
175512002-09-10 Akim Demaille <akim@epita.fr>
17552
17553 * src/parse-gram.y: Associate a human readable string to each
17554 token type.
17555 * tests/regression.at (Invalid inputs): Adjust.
17556
b6347355
AD
175572002-09-10 Gary V. Vaughan <gary@gnu.org>
17558
17559 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
17560 with an Autoconf-2.5x style configure.ac.
17561
09ba4ab2
PE
175622002-09-06 Paul Eggert <eggert@twinsun.com>
17563
17564 * doc/bison.texinfo (Conditions): Make explicit that the GPL
17565 exception applies only to yacc.c. This is a modification of a
17566 patch originally suggested by Akim Demaille.
17567
21846f69
AD
175682002-09-06 Akim Demaille <akim@epita.fr>
17569
09ba4ab2
PE
17570 * data/c.m4 (b4_copyright): Move the GPL exception comment from
17571 here to...
17572 * data/yacc.c: here.
17573
21846f69
AD
17574 * data/lalr1.cc (struct yyltype): Don't define it, since we use
17575 LocationType.
17576 (b4_ltype): Default to yy::Location from location.hh.
17577
c0ad8bf3
AD
175782002-09-04 Jim Meyering <jim@meyering.net>
17579
17580 * data/yacc.c: Guard the declaration of yytoknum also with
17581 `#ifdef YYPRINT', so it is declared only when used.
17582
3a93251e
AD
175832002-09-04 Akim Demaille <akim@epita.fr>
17584
17585 * configure.in: Rename as...
17586 * configure.ac: this.
17587 Bump to 1.49c.
17588
427c0dda
AD
175892002-09-04 Akim Demaille <akim@epita.fr>
17590
17591 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
17592 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
17593 translate maintainer only messages.
17594
6a254321
PE
175952002-08-12 Paul Eggert <eggert@twinsun.com>
17596
645e30d1
PE
17597 Version 1.49b.
17598
6a254321
PE
17599 * Makefile.am (SUBDIRS): Remove intl.
17600 (DISTCLEANFILES): Remove.
17601 * NEWS: Mention that GNU M4 is now required. Clarify what is
17602 meant by "larger grammars". Mention the pt_BR translation.
17603 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
17604 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
17605 Bump version from 0.11.2 to 0.11.5.
17606 (BISON_PREREQ_STAGE): Remove.
17607 (AM_GNU_GETTEXT): Use external gettext.
17608 (AC_OUTPUT): Remove intl/Makefile.
17609
17610 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
17611
17612 * data/glr.c: Include string.h, for strlen.
17613 (yyreportParseError): Use size_t for yysize.
17614 (yy_yypstack): No longer nested inside yypstates, as nested
17615 functions are not portable. Do not assume size_t is the
17616 same width as int.
17617 (yypstates): Do not assume that ptrdiff_t is the same width
17618 as int, and similarly for yyposn and YYINDEX.
17619
17620 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
17621
17622 * lib/Makefile.am (INCLUDES): Do not include from the intl
17623 directory, which has been removed.
17624 * src/Makefile.am (INCLUDES): Likewise.
17625
17626 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
17627 (bitsets_sources, additional_bitsets_sources, timevars_sources):
17628 New vars.
17629
17630 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
17631 * tests/Makefile.am (EXTRA_DIST): Likewise.
17632
17633 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
17634 Do not assume that bitset_windex is the same width as unsigned.
17635
17636 * lib/abitset.c (abitset_unused_clear): Do not assume that
17637 bitset_word is the same width as int.
17638 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
17639 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
17640 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
17641 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
17642 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
17643
17644 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
17645 portability to one's complement hosts!).
17646 * lib/ebitset.c (ebitset_op1): Likewise.
17647 * lib/lbitset.c (lbitset_op1): Likewise.
17648
17649 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
17650 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
17651 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
17652 Sync with fileutils.
17653 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
17654 lib/gettext.h: Sync with diffutils.
17655
17656 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
17657 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
17658
17659 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
17660 PROTOTYPES to check for prototypes, and "defined __STDC__" to
17661 check for void *.
17662
17663 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
17664 size_t; the old version tried to do this but casted improperly.
17665 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
17666 (bitset_test): Now returns int, not unsigned long.
17667
17668 * lib/bitset_stats.c: Include "gettext.h".
17669 (_): New macro.
17670 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
17671 name locals "index", as it generates unnecessary warnings on some
17672 hosts that have an "index" function.
17673
17674 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
17675 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
17676 they need translation.
17677 * src/LR0.c (state_list_append, new_itemsets, get_state,
17678 append_states, generate_states): Likewise.
17679 * src/assoc.c (assoc_to_string): Likewise.
17680 * src/closure.c (print_closure, set_firsts, closure): Likewise.
17681 * src/gram.c (grammar_dump): Likewise.
17682 * src/injections.c (injections_compute): Likewise.
17683 * src/lalr.c (lookaheads_print): Likewise.
17684 * src/relation.c (relation_transpose): Likewise.
17685 * src/scan-gram.l: Likewise.
17686 * src/tables.c (table_grow, pack_vector): Likewise.
17687
17688 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
17689 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
17690 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
17691 * m4/mbstate_t.m4: Sync with fileutils.
17692 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
17693
17694 * po/LINGUAS: Add pt_BR.
17695 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
17696 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
17697 lib/timevar.c.
17698 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
17699 manual recommends.
17700 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
17701
17702 * src/complain.c (strerror_r): Remove decl; not needed.
17703 (strerror): Use same pattern as ../lib/error.c.
17704
17705 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
17706
17707 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
17708
17709 * src/main.c (main): Cast result of bindtextdomain and textdomain
17710 to void, to avoid a GCC warning when --disable-nls is in effect.
17711
17712 * src/scan-gram.l: Use strings rather than escapes when possible,
17713 to minimize the number of warnings from xgettext.
17714 (handle_action_dollar, handle_action_at): Don't use isdigit,
17715 as it mishandles negative chars and it may not work as expected
17716 outside the C locale.
17717
17718 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
17719 this is a GCC extension and is not portable to other compilers.
17720
17721 * src/system.h (alloca): Use same pattern as ../lib/error.c.
17722 Do not include <ctype.h>; no longer needed.
17723 Do not include <malloc.h>; no longer needed (and generates
17724 warnings on OpenBSD 3.0).
17725
17726 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
17727 it's not portable.
17728
17729 * tests/regression.at: Do not use 'cc -c input.c -o input';
17730 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
17731
17732 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
17733 exit status as failure, not just exit status 1. Sun C exits
17734 with status 2 sometimes.
17735
17736 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
17737 Use it for the two large tests.
17738
c8f002c7
AD
177392002-08-02 Akim Demaille <akim@epita.fr>
17740
17741 * src/conflicts.c (conflicts_output): Don't output rules never
17742 reduced here, since anyway that computation doesn't work.
17743 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
17744 (rule_useless_p, rule_never_reduced_p): New.
17745 (grammar_rules_partial_print): Use a filter instead of a range.
17746 Display the title only if needed.
17747 (grammar_rules_print): Adjust.
17748 (grammar_rules_never_reduced_report): New.
17749 * src/tables.c (action_row): Move the computation of rules never
17750 reduced to...
17751 (token_actions): here.
17752 * src/main.c (main): Make the parser before making the report, so
17753 that rules never reduced are computed.
17754 Call grammar_rules_never_reduced_report.
17755 * src/print.c (print_results): Report rules never reduced.
17756 * tests/conflicts.at, tests/reduce.at: Adjust.
17757
cd08e51e
AD
177582002-08-01 Akim Demaille <akim@epita.fr>
17759
17760 Instead of attaching lookaheads and duplicating the rules being
17761 reduced by a state, attach the lookaheads to the reductions.
17762
17763 * src/state.h (state_t): Remove the `lookaheads',
17764 `lookaheads_rule' member.
17765 (reductions_t): Add a `lookaheads' member.
17766 Use a regular array for the `rules'.
17767 * src/state.c (reductions_new): Initialize the lookaheads member
17768 to 0.
17769 (state_rule_lookaheads_print): Adjust.
17770 * src/state.h, src/state.c (state_reductions_find): New.
17771 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
17772 (count_rr_conflicts): Adjust.
17773 * src/lalr.c (LArule): Remove.
17774 (add_lookback_edge): Adjust.
17775 (state_lookaheads_count): New.
17776 (states_lookaheads_initialize): Merge into...
17777 (initialize_LA): this.
17778 (lalr_free): Adjust.
17779 * src/main.c (main): Don't free nullable and derives too early: it
17780 is used by --verbose.
17781 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
17782
bb0027a9
AD
177832002-08-01 Akim Demaille <akim@epita.fr>
17784
17785 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
17786 `rule_number_t**'.
17787 (set_derives, free_derives): Rename as...
17788 (derives_compute, derives_free): this.
17789 Adjust all dependencies.
17790 * src/nullable.c (set_nullable, free_nullable): Rename as...
17791 (nullable_compute, nullable_free): these.
17792 (rule_list_t): Store rule_t *, not rule_number_t.
17793 * src/state.c (state_rule_lookaheads_print): Directly compare rule
17794 pointers, instead of their numbers.
17795 * src/main.c (main): Call nullable_free, and derives_free earlier,
17796 as they were lo longer used.
17797
3325ddc4
AD
177982002-08-01 Akim Demaille <akim@epita.fr>
17799
17800 * lib/timevar.c (get_time): Include children time.
17801 * src/lalr.h (LA, LArule): Don't export them: used with the
17802 state_t.
17803 * src/lalr.c (LA, LArule): Static.
17804 * src/lalr.h, src/lalr.c (lalr_free): New.
17805 * src/main.c (main): Call it.
17806 * src/tables.c (pack_vector): Check whether loc is >= to the
17807 table_size, not >.
17808 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
17809 (tables_generate): do it, since that's also it which allocates
17810 them.
17811 Don't free LA and LArule, main does.
17812
c6f1a33c
AD
178132002-07-31 Akim Demaille <akim@epita.fr>
17814
17815 Separate parser tables computation and output.
17816
17817 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
17818 (conflict_list, conflict_list_cnt, table, check, table_ninf)
17819 (yydefgoto, yydefact, high): Move to...
17820 * src/tables.h, src/tables.c: here.
17821 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17822 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17823 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
17824 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
17825 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
17826 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
17827 (action_row, save_row, token_actions, save_column, default_goto)
17828 (goto_actions, sort_actions, matching_state, pack_vector)
17829 (table_ninf_remap, pack_table, prepare_actions): Move to...
17830 * src/tables.c: here.
17831 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
17832 * src/output.c (token_actions, output_base, output_conflicts)
17833 (output_check): Merge into...
17834 (prepare_actions): this.
17835 (actions_output): Rename as...
17836 (user_actions_output): this.
17837 * src/main.c (main): Call tables_generate and tables_free.
17838
1509d42f
AD
178392002-07-31 Akim Demaille <akim@epita.fr>
17840
17841 Steal GCC's --time-report support.
17842
17843 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
17844 stolen/adjusted from GCC.
17845 * m4/stage.m4: Remove time related checks.
17846 * m4/timevar.m4: New.
17847 * configure.in: Adjust.
17848 * src/system.h: Adjust to using timevar.h.
17849 * src/getargs.h, src/getargs.c: Support trace_time for
17850 --trace=time.
17851 * src/main.c (stage): Remove.
17852 (main): Replace `stage' invocations with timevar calls.
17853 * src/output.c: Insert pertinent timevar calls.
17854
273a74fa
AD
178552002-07-31 Akim Demaille <akim@epita.fr>
17856
17857 Let --trace have arguments.
17858
17859 * src/getargs.h (enum trace_e): New.
17860 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
17861 (long_options, short_options): --trace/-T takes an optional
17862 argument.
17863 Change all the uses of trace_flag to reflect the new flags.
17864 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
17865
17866 Strengthen `stage' portability.
17867
17868 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
17869 * configure.in: Use it.
17870 Don't check for malloc.h and sys/times.h.
17871 * src/system.h: Include them when appropriate.
17872 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
17873 times and struct tms are available.
17874
217598da
AD
178752002-07-30 Akim Demaille <akim@epita.fr>
17876
17877 In verbose parse error message, don't report `error' as an
17878 expected token.
17879 * tests/actions.at (Printers and Destructors): Adjust.
17880 * tests/calc.at (Calculator $1): Adjust.
17881 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
17882 error message, do not report the parser accepts the error token in
17883 that state.
17884
52489d44
AD
178852002-07-30 Akim Demaille <akim@epita.fr>
17886
17887 Normalize conflict related messages.
17888
17889 * src/complain.h, src/complain.c (warn, complain): New.
17890 * src/conflicts.c (conflicts_print): Use them.
17891 (conflict_report_yacc): New, extracted from...
17892 (conflicts_print): here.
17893 * tests/conflicts.at, tests/existing.at: Adjust.
17894
e8832397
AD
178952002-07-30 Akim Demaille <akim@epita.fr>
17896
17897 Report rules which are never reduced by the parser: those hidden
17898 by conflicts.
17899
17900 * src/LR0.c (save_reductions): Don't make the final state too
17901 different: save its reduction (accept) instead of having a state
17902 without any action (no shift or goto, no reduce).
17903 Note: the final state is now a ``regular'' state, i.e., the
17904 parsers now contain `reduce 0' as default reduction.
17905 Nevertheless, since they decide to `accept' when yystate =
17906 final_state, they still will not reduce rule 0.
17907 * src/print.c (print_actions, print_reduction): Adjust.
17908 * src/output.c (action_row): Track reduced rules.
17909 (token_actions): Report rules never reduced.
17910 * tests/conflicts.at, tests/regression.at: Adjust.
17911
caf23d24
AD
179122002-07-30 Akim Demaille <akim@epita.fr>
17913
17914 `stage' was accidently included in a previous patch.
17915 Initiate its autoconfiscation.
17916
17917 * configure.in: Look for malloc.h and sys/times.h.
17918 * src/main.c (stage): Adjust.
17919 Report only when trace_flag.
17920
640748ee
AD
179212002-07-29 Akim Demaille <akim@epita.fr>
17922
17923 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
17924 state_number_t.
17925 (errs_t): symbol_t*, not symbol_number_t.
17926 (reductions_t): rule_t*, not rule_number_t.
17927 (FOR_EACH_SHIFT): New.
17928 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
17929 * src/print.c, src/print_graph.c: Adjust.
17930
88bce5a2
AD
179312002-07-29 Akim Demaille <akim@epita.fr>
17932
17933 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
17934
17935 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
17936 (endtoken, accept): these.
17937 * src/reader.c (reader): Set endtoken's default tag to "$end".
17938 Set undeftoken's tag to "$undefined" instead of "$undefined.".
17939 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
17940 Adjust.
17941
1bfb97db
AD
179422002-07-29 Akim Demaille <akim@epita.fr>
17943
17944 * src/reduce.c (reduce_grammar): When the language is empty,
17945 complain about the start symbol, not the axiom.
17946 Use its location.
17947 * tests/reduce.at (Empty Language): New.
17948
fc5734fe
AD
179492002-07-26 Akim Demaille <akim@epita.fr>
17950
17951 * src/reader.h, src/reader.c (gram_error): ... can't get
17952 yycontrol without making too strong assumptions on the parser
17953 itself.
17954 * src/output.c (prepare_tokens): Use the real 0th value of
17955 token_translations instead of `0'.
17956 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
17957 visible here.
17958 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
17959 for the time being: %locations ought to provide it to yyerror.
17960
3650b4b8
AD
179612002-07-25 Akim Demaille <akim@epita.fr>
17962
17963 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
17964 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
17965 * tests/regression.at (Web2c Actions): Adjust.
17966
4b3d3a8e
AD
179672002-07-25 Akim Demaille <akim@epita.fr>
17968
17969 Stop storing rules from 1 to nrules + 1.
17970
17971 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
17972 * src/nullable.c, src/output.c, src/print.c, src/reader.c
17973 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
17974 Iterate from 0 to nrules.
17975 Use rule_number_as_item_number and item_number_as_rule_number.
17976 Adjust to `derive' now containing possibly 0.
17977 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
17978 Handle the `- 1' part in rule numbers from/to item numbers.
17979 * src/conflicts.c (log_resolution): Fix the message which reversed
17980 shift and reduce.
17981 * src/output.c (action_row): Initialize default_rule to -1.
17982 (token_actions): Adjust.
17983 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
17984 expected output.
17985 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
17986
4a2a22f4
AD
179872002-07-25 Akim Demaille <akim@epita.fr>
17988
17989 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
17990 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
17991 (b4_c_knr_arg_decl): New.
17992 * data/yacc.c: Use it to define yysymprint, yydestruct, and
17993 yyreport_parse_error.
17994
b8df3223
AD
179952002-07-25 Akim Demaille <akim@epita.fr>
17996
17997 * data/yacc.c (yyreport_parse_error): New, extracted from...
17998 (yyparse): here.
17999 (yydestruct, yysymprint): Move above yyparse.
18000 Be K&R compliant.
18001
a762e609
AD
180022002-07-25 Akim Demaille <akim@epita.fr>
18003
18004 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
18005 replace...
18006 (b4_sint_type, b4_uint_type): these.
18007 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
18008 * tests/regression.at (Web2c Actions): Adjust.
18009
12b0043a
AD
180102002-07-25 Akim Demaille <akim@epita.fr>
18011
18012 * src/gram.h (TIEM_NUMBER_MAX): New.
18013 (item_number_of_rule_number, rule_number_of_item_number): Rename
18014 as...
18015 (rule_number_as_item_number, item_number_as_rule_number): these.
18016 Adjust dependencies.
18017 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
18018 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
18019 (symbol_number_to_vector_number): New.
18020 (order): Of vector_number_t* type.
18021 (base_t, BASE_MAX, BASE_MIN): New.
18022 (froms, tos, width, pos, check): Of base_t type.
18023 (action_number_t, ACTION_MIN, ACTION_MAX): New.
18024 (actrow): Of action_number_t type.
18025 (conflrow): Of unsigned int type.
18026 (table_ninf, base_ninf): New.
18027 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
18028 (muscle_insert_int_table, muscle_insert_base_table)
18029 (muscle_insert_rule_number_table): New.
18030 (prepare_tokens): Output `toknum' as int_table.
18031 (action_row): Returns a rule_number_t.
18032 Use ACTION_MIN, not SHRT_MIN.
18033 (token_actions): yydefact is rule_number_t*.
18034 (table_ninf_remap): New.
18035 (pack_table): Use it for `base' and `table'.
18036 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
18037 replaced with...
18038 (YYPACT_NINF, YYTABLE_NINF): these.
18039 (yypact, yytable): Compute their types instead of hard-coded
18040 `short'.
18041 * tests/regression.at (Web2c Actions): Adjust.
18042
5dde258a
AD
180432002-07-19 Akim Demaille <akim@epita.fr>
18044
18045 * src/scan-gram.l (id): Can start with an underscore.
18046
a945ec39
AD
180472002-07-16 Akim Demaille <akim@epita.fr>
18048
18049 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
18050 Adjust all former `associativity' dependencies.
18051 * src/symtab.c (symbol_new): Default associativity is `undef', not
18052 `right'.
18053 (symbol_check_alias_consistence): Adjust.
18054
fae437e8
AD
180552002-07-09 Akim Demaille <akim@epita.fr>
18056
18057 * doc/bison.texinfo: Properly set the ``header'' part.
18058 Use @dircategory ``GNU programming tools'' as per Texinfo's
18059 documentation.
18060 Use @copying.
18061
1a715ef2
AD
180622002-07-09 Akim Demaille <akim@epita.fr>
18063
18064 * lib/quotearg.h: Protect against multiple inclusions.
18065 * src/location.h (location_t): Add a `file' member.
18066 (LOCATION_RESET, LOCATION_PRINT): Adjust.
18067 * src/complain.c (warn_at, complain_at, fatal_at): Drop
18068 `error_one_per_line' support.
18069
a5d50994
AD
180702002-07-09 Akim Demaille <akim@epita.fr>
18071
18072 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
18073 * src/reader.c (lineno): Remove.
18074 Adjust all dependencies.
18075 (get_merge_function): Take a location and use complain_at.
18076 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
18077 * tests/regression.at (Invalid inputs, Mixing %token styles):
18078 Adjust.
18079
b275314e
AD
180802002-07-09 Akim Demaille <akim@epita.fr>
18081
18082 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
18083 recovery rule, and forbid extensions when --yacc.
18084 (gram_error): Use complain_at.
18085 * src/reader.c (reader): Exit if there were parse errors.
18086
865b9df1
AD
180872002-07-09 Akim Demaille <akim@epita.fr>
18088
18089 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
18090 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
18091 Reported by R Blake <blakers@mac.com>.
18092
c76e14da
AD
180932002-07-09 Akim Demaille <akim@epita.fr>
18094
18095 * data/yacc.c: Output the copyright notive in the header.
18096
7db2ed2d
AD
180972002-07-03 Akim Demaille <akim@epita.fr>
18098
18099 * src/output.c (froms, tos): Are state_number_t.
18100 (save_column): sp, sp1, and sp2 are state_number_t.
18101 (prepare): Rename `final' as `final_state_number', `nnts' as
18102 `nterms_number', `nrules' as `rules_number', `nstates' as
18103 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
18104 unused.
18105 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
18106 * data/lalr1.cc (nsym_): Remove, unused.
18107
e68e0410
AD
181082002-07-03 Akim Demaille <akim@epita.fr>
18109
18110 * src/lalr.h, src/lalr.c (goto_number_t): New.
18111 * src/lalr.c (goto_list_t): New.
18112 Propagate them.
18113 * src/nullable.c (rule_list_t): New.
18114 Propagate.
18115 * src/types.h: Remove.
18116
e1a4f3a4
AD
181172002-07-03 Akim Demaille <akim@epita.fr>
18118
18119 * src/closure.c (print_fderives): Use rule_rhs_print.
18120 * src/derives.c (print_derives): Use rule_rhs_print.
18121 (rule_list_t): New, replaces `shorts'.
18122 (set_derives): Add comments.
18123 * tests/sets.at (Nullable, Firsts): Adjust.
18124
536545f3
AD
181252002-07-03 Akim Demaille <akim@epita.fr>
18126
18127 * src/output.c (prepare_actions): Free `tally' and `width'.
18128 (prepare_actions): Allocate and free `order'.
18129 * src/symtab.c (symbols_free): Free `symbols'.
18130 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
18131 * src/output.c (m4_invoke): Move to...
18132 * src/scan-skel.l: here.
18133 (<<EOF>>): Close yyout, and free its name.
18134
8b752b00
AD
181352002-07-03 Akim Demaille <akim@epita.fr>
18136
18137 Fix some memory leaks, and fix a bug: state 0 was examined twice.
18138
18139 * src/LR0.c (new_state): Merge into...
18140 (state_list_append): this.
18141 (new_states): Merge into...
18142 (generate_states): here.
18143 (set_states): Don't ensure a proper `errs' state member here, do it...
18144 * src/conflicts.c (conflicts_solve): here.
18145 * src/state.h, src/state.c: Comment changes.
18146 (state_t): Rename member `shifts' as `transitions'.
18147 Adjust all dependencies.
18148 (errs_new): For consistency, also take the values as argument.
18149 (errs_dup): Remove.
18150 (state_errs_set): New.
18151 (state_reductions_set, state_transitions_set): Assert that no
18152 previous value was assigned.
18153 (state_free): New.
18154 (states_free): Use it.
18155 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
18156 temporary storage: use `errs' and `nerrs' as elsewhere.
18157 (set_conflicts): Allocate and free this `errs'.
18158
613f5e1a
AD
181592002-07-02 Akim Demaille <akim@epita.fr>
18160
18161 * lib/libiberty.h: New.
18162 * lib: Update the bitset implementation from upstream.
18163 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
18164 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
18165 * src/main.c: Adjust bitset stats calls.
18166
26e0cadc
PE
181672002-07-01 Paul Eggert <eggert@twinsun.com>
18168
18169 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
18170 char, so that negative chars don't collide with $.
18171
1154cced
AD
181722002-06-30 Akim Demaille <akim@epita.fr>
18173
18174 Have the GLR tests be `warning' checked, and fix the warnings.
18175
18176 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
18177 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
18178 (yyremoveDeletes): `yyi' and `yyj' are size_t.
18179 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
18180 (yyaddDeferredAction): static.
18181 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
18182 (yyreportParseError): yyprefix is const.
18183 yytokenp is used only when verbose.
18184 (yy__GNUC__): Replace with __GNUC__.
18185 (yypdumpstack): yyi is size_t.
18186 (yypreference): Un-yy local variables and arguments, to avoid
18187 clashes with `yyr1'. Anyway, we are not in the user name space.
18188 (yytname_size): be an int, as is compared with ints.
18189 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
18190 Use them.
18191 * tests/cxx-gram.at: Use quotation to protect $1.
18192 Use AT_COMPILE to enable warnings hunts.
18193 Prototype yylex and yyerror.
18194 `Use' argc.
18195 Include `string.h', not `strings.h'.
18196 Produce and prototype stmtMerge only when used.
18197 yylex takes a location.
18198
97650f4e
AD
181992002-06-30 Akim Demaille <akim@epita.fr>
18200
18201 We spend a lot of time in quotearg, in particular when --verbose.
18202
18203 * src/symtab.c (symbol_get): Store a quoted version of the key.
18204 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
18205 Adjust all callers.
18206
d2576365
AD
182072002-06-30 Akim Demaille <akim@epita.fr>
18208
18209 * src/state.h (reductions_t): Rename member `nreds' as num.
18210 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
18211 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
18212
ccaf65bc
AD
182132002-06-30 Akim Demaille <akim@epita.fr>
18214
18215 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
18216 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
18217 (shifts_to): Rename as...
18218 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
18219 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
18220 (TRANSITION_IS_DISABLED, transitions_to): these.
18221
87675353
AD
182222002-06-30 Akim Demaille <akim@epita.fr>
18223
18224 * src/print.c (print_shifts, print_gotos): Merge into...
18225 (print_transitions): this.
18226 (print_transitions, print_errs, print_reductions): Align the
18227 lookaheads columns.
18228 (print_core, print_transitions, print_errs, print_state,
18229 print_grammar): Output empty lines separator before, not after.
18230 (state_default_rule_compute): Rename as...
18231 (state_default_rule): this.
18232 * tests/conflicts.at (Defaulted Conflicted Reduction),
18233 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
18234 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
18235
ce4ccb4b
AD
182362002-06-30 Akim Demaille <akim@epita.fr>
18237
18238 Display items as we display rules.
18239
18240 * src/gram.h, src/gram.c (rule_lhs_print): New.
18241 * src/gram.c (grammar_rules_partial_print): Use it.
18242 * src/print.c (print_core): Likewise.
18243 * tests/conflicts.at (Defaulted Conflicted Reduction),
18244 (Unresolved SR Conflicts): Adjust.
18245 (Unresolved SR Conflicts): Adjust and rename as...
18246 (Resolved SR Conflicts): this, as was meant.
18247 * tests/regression.at (Web2c Report): Adjust.
18248
bc933ef1
AD
182492002-06-30 Akim Demaille <akim@epita.fr>
18250
18251 * src/print.c (state_default_rule_compute): New, extracted from...
18252 (print_reductions): here.
18253 Pessimize, but clarify the code.
18254 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
18255
53d4308d
AD
182562002-06-30 Akim Demaille <akim@epita.fr>
18257
18258 * src/output.c (action_row): Let default_rule be always a rule
18259 number.
18260
574fb2d5
AD
182612002-06-30 Akim Demaille <akim@epita.fr>
18262
18263 * src/closure.c (print_firsts, print_fderives, closure):
18264 Use BITSET_EXECUTE.
18265 * src/lalr.c (lookaheads_print): Likewise.
18266 * src/state.c (state_rule_lookaheads_print): Likewise.
18267 * src/print_graph.c (print_core): Likewise.
18268 * src/print.c (print_reductions): Likewise.
18269 * src/output.c (action_row): Likewise.
18270 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
18271
05811fd7
AD
182722002-06-30 Akim Demaille <akim@epita.fr>
18273
18274 * src/print_graph.c: Use report_flag.
18275
0e4d5753
AD
182762002-06-30 Akim Demaille <akim@epita.fr>
18277
18278 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
18279 to...
18280 * src/relation.h, src/relation.c (traverse, relation_digraph)
18281 (relation_print, relation_transpose): New.
18282
24c7d800
AD
182832002-06-30 Akim Demaille <akim@epita.fr>
18284
18285 * src/state.h, src/state.c (shifts_to): New.
18286 * src/lalr.c (build_relations): Use it.
18287
9222837b
AD
182882002-06-30 Akim Demaille <akim@epita.fr>
18289
18290 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
18291 (item_number_of_rule_number, rule_number_of_item_number): New.
18292 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
18293 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18294 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
18295 Propagate their use.
18296 Much remains to be done, in particular wrt `shorts' from types.h.
18297
260008e5
AD
182982002-06-30 Akim Demaille <akim@epita.fr>
18299
18300 * src/symtab.c (symbol_new): Initialize the `printer' member.
18301
8a731ca8
AD
183022002-06-30 Akim Demaille <akim@epita.fr>
18303
18304 * src/LR0.c (save_reductions): Remove, replaced by...
18305 * src/state.h, src/state.c (state_reductions_set): New.
18306 (reductions, errs): Rename as...
18307 (reductions_t, errs_t): these.
18308 Adjust all dependencies.
18309
32e1e0a4
AD
183102002-06-30 Akim Demaille <akim@epita.fr>
18311
18312 * src/LR0.c (state_list_t, state_list_append): New.
18313 (first_state, last_state): Now symbol_list_t.
18314 (this_state): Remove.
18315 (new_itemsets, append_states, save_reductions): Take a state_t as
18316 argument.
18317 (set_states, generate_states): Adjust.
18318 (save_shifts): Remove, replaced by...
18319 * src/state.h, src/state.c (state_shifts_set): New.
18320 (shifts): Rename as...
18321 (shifts_t): this.
18322 Adjust all dependencies.
18323 * src/state.h (state_t): Remove the `next' member.
18324
e5fb6710
AD
183252002-06-30 Akim Demaille <akim@epita.fr>
18326
18327 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
18328 escaped in slot 0.
18329
c7ca99d4
AD
183302002-06-30 Akim Demaille <akim@epita.fr>
18331
18332 Use hash.h for the state hash table.
18333
18334 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
18335 (allocate_storage): Use state_hash_new.
18336 (free_storage): Use state_hash_free.
18337 (new_state, get_state): Adjust.
18338 * src/lalr.h, src/lalr.c (states): Move to...
18339 * src/states.h (state_t): Remove the `link' member, no longer
18340 used.
18341 * src/states.h, src/states.c: here.
18342 (state_hash_new, state_hash_free, state_hash_lookup)
18343 (state_hash_insert, states_free): New.
18344 * src/states.c (state_table, state_compare, state_hash): New.
18345 * src/output.c (output_actions): Do not free states now, since we
18346 still need to know the final_state number in `prepare', called
18347 afterwards. Do it...
18348 * src/main.c (main): here: call states_free after `output'.
18349
df0e7316
AD
183502002-06-30 Akim Demaille <akim@epita.fr>
18351
18352 * src/state.h, src/state.c (state_new): New, extracted from...
18353 * src/LR0.c (new_state): here.
18354 * src/state.h (STATE_ALLOC): Move to...
18355 * src/state.c: here.
18356 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
18357 * src/state.h, src/state.c: here.
18358
39f41916
AD
183592002-06-30 Akim Demaille <akim@epita.fr>
18360
18361 * src/reader.c (gensym): Rename as...
18362 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
18363 (getsym): Rename as...
18364 (symbol_get): this.
18365
d57650a5
AD
183662002-06-30 Akim Demaille <akim@epita.fr>
18367
18368 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
18369 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
18370 * src/output.c, src/print.c, src/print_graph.c: Propagate.
18371 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
18372
5a08f1ce
AD
183732002-06-30 Akim Demaille <akim@epita.fr>
18374
18375 Make the test suite pass with warnings checked.
18376
18377 * tests/actions.at (Printers and Destructors): Improve.
18378 Avoid unsigned vs. signed issues.
18379 * tests/calc.at: Don't exercise the scanner here, do it...
18380 * tests/input.at (Torturing the Scanner): here.
18381
720623af
PH
183822002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18383
88e7e941 18384 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
18385 reorganize first lines parallel to yacc.c.
18386
fb8135fa
AD
183872002-06-28 Akim Demaille <akim@epita.fr>
18388
18389 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
18390 (b4_token_enum, b4_token_defines): New, factored from...
18391 * data/lalr1.cc, data/yacc.c, glr.c: here.
18392
41442480
AD
183932002-06-28 Akim Demaille <akim@epita.fr>
18394
18395 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
18396 unused variables.
18397 * src/output.c (merger_output): static.
18398
e0e5bf84
AD
183992002-06-28 Akim Demaille <akim@epita.fr>
18400
ba0fe3c7 18401 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
18402 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
18403 pacify GCC.
18404 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 18405
676385e2
PH
184062002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18407
18408 Accumulated changelog for new GLR parsing features.
18409
6a254321 18410 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
18411 conflicts_total_count.
18412 * src/conflicts.h: Ditto.
18413 * src/output.c (token_actions): Use the new name.
18414 (output_conflicts): Change conflp => conflict_list_heads, and
18415 confl => conflict_list for better readability.
18416 * data/glr.c: Use the new names.
18417 * NEWS: Add self to GLR announcement.
e0e5bf84 18418
676385e2
PH
18419 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
18420
18421 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
18422 Akim Demaille.
18423
18424 * data/bison.glr: Change name to glr.c
18425 * data/glr.c: Renamed from bison.glr.
18426 * data/Makefile.am: Add glr.c
e0e5bf84
AD
18427
18428 * src/getargs.c:
18429
676385e2 18430 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 18431 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 18432
676385e2
PH
18433 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18434
18435 * data/bison.glr: Be sure to restore the
18436 current #line when returning to the skeleton contents after having
18437 exposed the input file's #line.
18438
18439 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18440
18441 * data/bison.glr: Bring up to date with changes to bison.simple.
18442
18443 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18444
18445 * data/bison.glr: Correct definitions that use b4_prefix.
18446 Various reformatting.
18447 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
18448 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
18449 yytokenp argument; now part of stack.
18450 (yychar): Define to behave as documented.
18451 (yyclearin): Ditto.
e0e5bf84 18452
676385e2
PH
18453 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18454
18455 * src/reader.h: Add declaration for free_merger_functions.
18456
18457 * src/reader.c (merge_functions): New variable.
18458 (get_merge_function): New function.
18459 (free_merger_functions): New function.
18460 (readgram): Check for %prec that is not followed by a symbol.
18461 Handle %dprec and %merge declarations.
18462 (packgram): Initialize dprec and merger fields in rules array.
18463
18464 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
18465 conflict_list_cnt, conflict_list_free): New variables.
18466 (table_grow): Also grow conflict_table.
e0e5bf84 18467 (prepare_rules): Output dprec and merger tables.
676385e2 18468 (conflict_row): New function.
e0e5bf84 18469 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
18470 default reduction in conflicted states for GLR parser so that there
18471 are spaces for the conflict lists.
18472 (save_row): Also save conflict information.
18473 (token_actions): Allocate conflict list.
18474 (merger_output): New function.
18475 (pack_vector): Pack conflict table, too.
18476 (output_conflicts): New function to output yyconflp and yyconfl.
18477 (output_check): Allocate conflict_tos.
18478 (output_actions): Output conflict tables, also.
18479 (output_skeleton): Output b4_mergers definition.
18480 (prepare): Output b4_max_rhs_length definition.
18481 Use 'bison.glr' as default skeleton for GLR parsers.
18482
18483 * src/gram.c (glr_parser): New flag.
18484 (grammar_free): Call free_merger_functions.
18485
18486 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
18487 all pairs of conflicting reductions, rather than just all tokens
18488 causing conflicts. Needed to size conflict tables.
e0e5bf84 18489 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
18490 interface.
18491 (conflicts_print): Ditto.
18492 (count_total_conflicts): New function.
18493
18494 * src/reader.h (merger_list): New type.
18495 (merge_functions): New variable.
18496
18497 * src/lex.h (tok_dprec, tok_merge): New token types.
18498
18499 * src/gram.h (rule_s): Add dprec and merger fields.
18500 (glr_parser): New flag.
18501
18502 * src/conflicts.h (count_total_conflicts): New function.
18503
18504 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
18505
18506 * doc/bison.texinfo (Generalized LR Parsing): New section.
18507 (GLR Parsers): New section.
18508 (Language and Grammar): Mention GLR parsing.
18509 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
18510 Correct typo ("tge" -> "the").
18511
18512 * data/bison.glr: New skeleton for GLR parsing.
18513
18514 * tests/cxx-gram.at: New tests for GLR parsing.
18515
18516 * tests/testsuite.at: Include cxx-gram.at.
18517
18518 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 18519
676385e2
PH
18520 * src/parse-gram.y:
18521
18522 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
18523
18524 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 18525
b5480d74 185262002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
18527
18528 * src/options.h, src/options.c: Remove.
18529 * src/getargs.c (short_options, long_options): New.
18530
60491a94
AD
185312002-06-27 Akim Demaille <akim@epita.fr>
18532
18533 * data/bison.simple, data/bison.c++: Rename as...
18534 * data/yacc.c, data/lalr1.cc: these.
18535 * doc/bison.texinfo (Environment Variables): Remove.
18536
9be0c25b
AD
185372002-06-25 Raja R Harinath <harinath@cs.umn.edu>
18538
18539 * src/getargs.c (report_argmatch): Initialize strtok().
18540
1ae72863
AD
185412002-06-20 Akim Demaille <akim@epita.fr>
18542
18543 * data/bison.simple (b4_symbol_actions): New, replaces...
18544 (b4_symbol_destructor, b4_symbol_printer): these.
18545 (yysymprint): Be sure to call YYPRINT only for tokens, and using
18546 user token numbers.
18547
87542d29
AD
185482002-06-20 Akim Demaille <akim@epita.fr>
18549
18550 * data/bison.simple (yydestructor): Rename as...
18551 (yydestruct): this.
18552
1a31ed21
AD
185532002-06-20 Akim Demaille <akim@epita.fr>
18554
18555 * src/symtab.h, src/symtab.c (symbol_type_set)
18556 (symbol_destructor_set, symbol_precedence_set): The location is
18557 the last argument.
18558 Adjust all callers.
18559
e776192e
AD
185602002-06-20 Akim Demaille <akim@epita.fr>
18561
18562 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
18563 internals.
18564 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
18565 Takes a location.
18566 * src/symtab.h, src/symtab.c (symbol_class_set)
18567 (symbol_user_token_number_set): Likewise.
18568 Adjust all callers.
18569 Promote complain_at.
18570 * tests/input.at (Type Clashes): Adjust.
18571
5c1180b3
AD
185722002-06-20 Akim Demaille <akim@epita.fr>
18573
18574 * data/bison.simple (YYLEX): Fix the declaration when
18575 %pure-parser.
18576
e3170060
AD
185772002-06-20 Akim Demaille <akim@epita.fr>
18578
18579 * data/bison.simple (yysymprint): Don't print the token number,
18580 just its name.
18581 * tests/actions.at (Destructors): Rename as...
18582 (Printers and Destructors): this.
18583 Also exercise %printer.
18584
253862fd
AD
185852002-06-20 Akim Demaille <akim@epita.fr>
18586
18587 * data/bison.simple (YYDSYMPRINT): New.
18588 Use it to remove many of the #if YYDEBUG/if (yydebug).
18589
366eea36
AD
185902002-06-20 Akim Demaille <akim@epita.fr>
18591
18592 * src/symtab.h, src/symtab.c (symbol_t): printer and
18593 printer_location are new members.
18594 (symbol_printer_set): New.
18595 * src/parse-gram.y (PERCENT_PRINTER): New token.
18596 Handle its associated rule.
18597 * src/scan-gram.l: Adjust.
18598 (handle_destructor_at, handle_destructor_dollar): Rename as...
18599 (handle_symbol_code_at, handle_symbol_code_dollar): these.
18600 * src/output.c (symbol_printers_output): New.
18601 (output_skeleton): Call it.
18602 * data/bison.simple (yysymprint): New. Cannot be named yyprint
18603 since there are already many grammar files with a user `yyprint'.
18604 Replace the calls to YYPRINT to calls to yysymprint.
18605 * tests/calc.at: Adjust.
18606 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
18607 taking advantage of parser very internal details (stack size!).
18608
4f25ebb0
AD
186092002-06-20 Akim Demaille <akim@epita.fr>
18610
18611 * src/scan-gram.l: Complete the scanner with the missing patterns
18612 to pacify Flex.
18613 Use `quote' and `symbol_tag_get' where appropriate.
18614
93b68a0e
AD
186152002-06-19 Akim Demaille <akim@epita.fr>
18616
18617 * tests/actions.at (Destructors): Augment to test locations.
18618 * data/bison.simple (yydestructor): Pass it the current location
18619 if locations are enabled.
18620 Prototype only when __STDC__ or C++.
18621 Change the argument names to move into the yy name space: there is
18622 user code here.
18623
58612f1d
AD
186242002-06-19 Akim Demaille <akim@epita.fr>
18625
74310291
AD
18626 * data/bison.simple (b4_pure_if): New.
18627 Use it instead of #ifdef YYPURE.
18628
186292002-06-19 Akim Demaille <akim@epita.fr>
18630
18631 * data/bison.simple (b4_location_if): New.
58612f1d
AD
18632 Use it instead of #ifdef YYLSP_NEEDED.
18633
f25bfb75
AD
186342002-06-19 Akim Demaille <akim@epita.fr>
18635
18636 Prepare @$ in %destructor, but currently don't bind it in the
18637 skeleton, as %location use is not cleaned up yet.
18638
18639 * src/scan-gram.l (handle_dollar, handle_destructor_at)
18640 (handle_action_at): New.
18641 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
18642 a braced_code_t and a location as additional arguments.
18643 (handle_destructor_dollar): Instead of requiring `b4_eval', just
18644 unquote one when outputting `b4_dollar_dollar'.
18645 Adjust callers.
18646 * data/bison.simple (b4_eval): Remove.
18647 (b4_symbol_destructor): Adjust.
18648 * tests/input.at (Invalid @n): Adjust.
18649
c732d2c6
AD
186502002-06-19 Zack Weinberg <zack@codesourcery.com>
18651
18652 * doc/bison.texinfo: Document ability to have multiple
18653 prologue sections.
18654
8c165d89
AD
186552002-06-18 Akim Demaille <akim@epita.fr>
18656
18657 * src/files.c (compute_base_names): When computing the output file
18658 names from the input file name, strip the directory part.
18659
ca98bf57
AD
186602002-06-18 Akim Demaille <akim@epita.fr>
18661
18662 * data/bison.simple.new: Comment changes.
18663 Reported by Andreas Schwab.
18664
0bfb02ff
AD
186652002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
18666
18667 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
18668 there are no `label `yyoverflowlab' defined but not used' warnings
18669 when yyoverflow is defined.
18670
24c0aad7
AD
186712002-06-18 Akim Demaille <akim@epita.fr>
18672
18673 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
18674 new member.
18675 (symbol_destructor_set): Adjust.
18676 * src/output.c (symbol_destructors_output): Output the destructor
18677 locations.
18678 Output the symbol name.
18679 * data/bison.simple (b4_symbol_destructor): Adjust.
18680
5719c109
AD
186812002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
18682 and Akim Demaille <akim@epita.fr>
18683
18684 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
18685 what's left on the stack when the error recovery hits EOF.
18686 * tests/actions.at (Destructors): Complete to exercise this case.
18687
9280d3ef
AD
186882002-06-17 Akim Demaille <akim@epita.fr>
18689
18690 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
18691 arguments is really empty, not only equal to `[]'.
18692 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
18693 member.
18694 (symbol_destructor_set): New.
18695 * src/output.c (symbol_destructors_output): New.
18696 * src/reader.h (brace_code_t, current_braced_code): New.
18697 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
18698 (handle_dollar): Rename as...
18699 (handle_action_dollar): this.
18700 (handle_destructor_dollar): New.
18701 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
18702 (grammar_declaration): Use it.
18703 * data/bison.simple (yystos): Is always defined.
18704 (yydestructor): New.
18705 * tests/actions.at (Destructors): New.
18706 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
18707
dafdc66f
AD
187082002-06-17 Akim Demaille <akim@epita.fr>
18709
18710 * src/symlist.h, src/symlist.c (symbol_list_length): New.
18711 * src/scan-gram.l (handle_dollar, handle_at): Compute the
18712 rule_length only when needed.
18713 * src/output.c (actions_output, token_definitions_output): Output
18714 the full M4 block.
18715 * src/symtab.c: Don't access directly to the symbol tag, use
18716 symbol_tag_get.
18717 * src/parse-gram.y: Use symbol_list_free.
18718
56c47203
AD
187192002-06-17 Akim Demaille <akim@epita.fr>
18720
18721 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
18722 (symbol_list_prepend, get_type_name): Move to...
18723 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
18724 (symbol_list_prepend, symbol_list_n_type_name_get): here.
18725 Adjust all callers.
18726 (symbol_list_free): New.
18727 * src/scan-gram.l (handle_dollar): Takes a location.
18728 * tests/input.at (Invalid $n): Adjust.
18729
1e0bab92
AD
187302002-06-17 Akim Demaille <akim@epita.fr>
18731
18732 * src/reader.h, src/reader.c (symbol_list_new): Export it.
18733 (symbol_list_prepend): New.
18734 * src/parse-gram.y (%union): `list' is a new member.
18735 (symbols.1): New, replaces...
18736 (terms_to_prec.1, nterms_to_type.1): these.
18737 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
18738 Take a location as additional argument.
18739 Adjust all callers.
18740
04e60654
AD
187412002-06-15 Akim Demaille <akim@epita.fr>
18742
18743 * src/parse-gram.y: Move %token in the declaration section so that
18744 we don't depend upon CVS Bison.
18745
10e5b8bd
AD
187462002-06-15 Akim Demaille <akim@epita.fr>
18747
18748 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
18749 * src/print.c (print_core): Use it.
18750
9801d40c
AD
187512002-06-15 Akim Demaille <akim@epita.fr>
18752
18753 * src/conflicts.c (log_resolution): Accept the rule involved in
18754 the sr conflicts instead of the lookahead number that points to
18755 that rule.
18756 (flush_reduce): Accept the current lookahead vector as argument,
18757 instead of the index in LA.
18758 (resolve_sr_conflict): Accept the current number of lookahead
18759 bitset to consider for the STATE, instead of the index in LA.
18760 (set_conflicts): Adjust.
18761 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
18762
c0263492
AD
187632002-06-15 Akim Demaille <akim@epita.fr>
18764
18765 * src/state.h (state_t): Replace the `lookaheadsp' member, a
18766 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
18767 Adjust all dependencies.
18768 * src/lalr.c (initialize_lookaheads): Split into...
18769 (states_lookaheads_count, states_lookaheads_initialize): these.
18770 (lalr): Adjust.
18771
9757c359
AD
187722002-06-15 Akim Demaille <akim@epita.fr>
18773
18774 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
18775 out of...
18776 (grammar_rules_print): here.
18777 * src/reduce.c (reduce_output): Use it.
18778 * tests/reduce.at (Useless Rules, Reduced Automaton)
18779 (Underivable Rules): Adjust.
18780
6b98e4b5
AD
187812002-06-15 Akim Demaille <akim@epita.fr>
18782
18783 Copy BYacc's nice way to report the grammar.
18784
18785 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
18786 New.
18787 Don't print the rules' location, it is confusing and useless.
18788 (rule_print): Use grammar_rhs_print.
18789 * src/print.c (print_grammar): Use grammar_rules_print.
18790
6b98e4b5
AD
187912002-06-15 Akim Demaille <akim@epita.fr>
18792
18793 Complete and rationalize `useless thing' warnings.
18794
18795 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
18796 (symbol_tag_print): New.
18797 Use them everywhere in place of accessing directly the tag member.
18798 * src/gram.h, src/gram.c (rule_print): New.
18799 Use it where a rule used to be printed `by hand'.
18800 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
18801 (reduce_grammar_tables): Report the useless rules.
18802 (reduce_print): Useless things are a warning, not an error.
18803 Report it as such.
18804 * tests/reduce.at (Useless Nonterminals, Useless Rules):
18805 (Reduced Automaton, Underivable Rules): Adjust.
18806 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
18807 * tests/conflicts.at (Unresolved SR Conflicts)
18808 (Solved SR Conflicts): Adjust.
18809
ee000ba4
AD
188102002-06-15 Akim Demaille <akim@epita.fr>
18811
18812 Let symbols have a location.
18813
18814 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
18815 (getsym): Adjust.
18816 Adjust all callers.
18817 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
18818 Use location_t, not int.
18819 * src/symtab.c (symbol_check_defined): Take advantage of the
18820 location.
18821 * tests/regression.at (Invalid inputs): Adjust.
18822
8efe435c
AD
188232002-06-15 Akim Demaille <akim@epita.fr>
18824
18825 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
18826 (input): Don't try to initialize yylloc here, do it in the
18827 scanner.
18828 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
18829 * src/gram.h (rule_t): Change line and action_line into location
18830 and action_location, of location_t type.
18831 Adjust all dependencies.
18832 * src/location.h, src/location.c (empty_location): New.
18833 * src/reader.h, src/reader.c (grammar_start_symbol_set)
18834 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
18835 (grammar_current_rule_symbol_append)
18836 (grammar_current_rule_action_append): Expect a location as argument.
18837 * src/reader.c (grammar_midrule_action): Adjust to attach an
18838 action's location as dummy symbol location.
18839 * src/symtab.h, src/symtab.c (startsymbol_location): New.
18840 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
18841 the line numbers.
18842
1921f1d7
AD
188432002-06-14 Akim Demaille <akim@epita.fr>
18844
18845 Grammar declarations may be found in the grammar section.
18846
18847 * src/parse-gram.y (rules_or_grammar_declaration): New.
18848 (declarations): Each declaration may end with a semicolon, not
18849 just...
18850 (grammar_declaration): `"%union"'.
18851 (grammar): Branch to rules_or_grammar_declaration.
18852
4515534c
AD
188532002-06-14 Akim Demaille <akim@epita.fr>
18854
18855 * src/main.c (main): Invoke scanner_free.
18856
f958596b
AD
188572002-06-14 Akim Demaille <akim@epita.fr>
18858
18859 * src/output.c (m4_invoke): Extracted from...
18860 (output_skeleton): here.
18861 Free tempfile.
18862
2c569025
AD
188632002-06-14 Akim Demaille <akim@epita.fr>
18864
18865 * src/parse-gram.y (directives, directive, gram)
18866 (grammar_directives, precedence_directives, precedence_directive):
18867 Rename as...
18868 (declarations, declaration, grammar, grammar_declaration)
18869 (precedence_declaration, precedence_declarator): these.
18870 (symbol_declaration): New.
18871
592e8d4d
AD
188722002-06-14 Akim Demaille <akim@epita.fr>
18873
18874 * src/files.c (action_obstack): Remove, unused.
18875 (output_obstack): Remove it, and all its dependencies, as it is no
18876 longer needed.
18877 * src/reader.c (epilogue_set): Build the epilogue in the
18878 muscle_obstack.
18879 * src/output.h, src/output.c (muscle_obstack): Move to...
18880 * src/muscle_tab.h, src/muscle_tab.h: here.
18881 (muscle_init): Initialize muscle_obstack.
18882 (muscle_free): New.
18883 * src/main.c (main): Call it.
18884
0c15323d
AD
188852002-06-14 Akim Demaille <akim@epita.fr>
18886
18887 * src/location.h: New, extracted from...
18888 * src/reader.h: here.
18889 * src/Makefile.am (noinst_HEADERS): Merge into
18890 (bison_SOURCES): this.
18891 Add location.h.
18892 * src/parse-gram.y: Use location_t instead of Bison's.
18893 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
18894 Use location_t instead of ints.
18895
e96c9728
AD
188962002-06-14 Akim Demaille <akim@epita.fr>
18897
18898 * data/bison.simple, data/bison.c++: Be sure to restore the
18899 current #line when returning to the skeleton contents after having
18900 exposed the input file's #line.
18901
75d1fe16
AD
189022002-06-12 Akim Demaille <akim@epita.fr>
18903
18904 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
18905 eager.
18906 * tests/actions.at (Exotic Dollars): New.
18907
6c35d22c
AD
189082002-06-12 Akim Demaille <akim@epita.fr>
18909
18910 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
18911 ['"/] too eagerly.
18912 * tests/input.at (Torturing the Scanner): New.
18913
1d6412ad
AD
189142002-06-11 Akim Demaille <akim@epita.fr>
18915
18916 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
18917 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
18918 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
18919 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
18920 * src/reader.c (reader): Use it.
18921
4cdb01db
AD
189222002-06-11 Akim Demaille <akim@epita.fr>
18923
18924 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
18925 Adjust all callers.
18926 (scanner_last_string_free): New.
18927
44995b2e
AD
189282002-06-11 Akim Demaille <akim@epita.fr>
18929
18930 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
18931 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
18932 (last_string, YY_OBS_FREE): New.
18933 Use them when returning an ID.
18934
e9955c83
AD
189352002-06-11 Akim Demaille <akim@epita.fr>
18936
18937 Have Bison grammars parsed by a Bison grammar.
18938
18939 * src/reader.c, src/reader.h (prologue_augment): New.
18940 * src/reader.c (copy_definition): Remove.
18941
18942 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
18943 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
18944 (grammar_current_rule_prec_set, grammar_current_rule_check)
18945 (grammar_current_rule_symbol_append)
18946 (grammar_current_rule_action_append): Export.
18947 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
18948 (symbol_list_action_append): Remove.
18949 Hook the routines from reader.
18950 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
18951 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18952
18953 * src/reader.c (read_declarations): Remove, unused.
18954
18955 * src/parse-gram.y: Handle the epilogue.
18956 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
18957 (grammar_start_symbol_set): this.
18958 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
18959 * src/reader.c (readgram): Remove, unused.
18960 (reader): Adjust to insert eoftoken and axiom where appropriate.
18961
18962 * src/reader.c (copy_dollar): Replace with...
18963 * src/scan-gram.h (handle_dollar): this.
18964 * src/parse-gram.y: Remove `%thong'.
18965
18966 * src/reader.c (copy_at): Replace with...
18967 * src/scan-gram.h (handle_at): this.
18968
18969 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
18970 New.
18971
18972 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
18973 time being.
18974
18975 * src/reader.h, src/reader.c (grammar_rule_end): New.
18976
18977 * src/parse.y (current_type, current_class): New.
18978 Implement `%nterm', `%token' support.
18979 Merge `%term' into `%token'.
18980 (string_as_id): New.
18981 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
18982 type name.
18983
18984 * src/parse-gram.y: Be sure to handle properly the beginning of
18985 rules.
18986
18987 * src/parse-gram.y: Handle %type.
18988 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
18989
18990 * src/parse-gram.y: More directives support.
18991 * src/options.c: No longer handle source directives.
18992
18993 * src/parse-gram.y: Fix %output.
18994
18995 * src/parse-gram.y: Handle %union.
18996 Use the prologue locations.
18997 * src/reader.c (parse_union_decl): Remove.
18998
18999 * src/reader.h, src/reader.c (epilogue_set): New.
19000 * src/parse-gram.y: Use it.
19001
19002 * data/bison.simple, data/bison.c++: b4_stype is now either not
19003 defined, then default to int, or to the contents of %union,
19004 without `union' itself.
19005 Adjust.
19006 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
19007
19008 * src/output.c (actions_output): Don't output braces, as they are
19009 already handled by the scanner.
19010
19011 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
19012 characters to themselves.
19013
19014 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
19015 that the epilogue has a proper #line.
19016
19017 * src/parse-gram.y: Handle precedence/associativity.
19018
19019 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
19020 a terminal.
19021 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
19022 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
19023 at all to define terminals that cannot be emitted.
19024
19025 * src/scan-gram.l: Escape M4 characters.
19026
19027 * src/scan-gram.l: Working properly with escapes in user
19028 strings/characters.
19029
19030 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
19031 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
19032 grammar.
19033 Use more modest sizes, as for the time being the parser does not
19034 release memory, and therefore the process swallows a huge amount
19035 of memory.
19036
19037 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
19038 stricter %token grammar.
19039
19040 * src/symtab.h (associativity): Add `undef_assoc'.
19041 (symbol_precedence_set): Do nothing when passed an undef_assoc.
19042 * src/symtab.c (symbol_check_alias_consistence): Adjust.
19043
19044 * tests/regression.at (Invalid %directive): Remove, as it is now
19045 meaningless.
19046 (Invalid inputs): Adjust to the new error messages.
19047 (Token definitions): The new grammar doesn't allow too many
19048 eccentricities.
19049
19050 * src/lex.h, src/lex.c: Remove.
19051 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
19052 (copy_character, copy_string2, copy_string, copy_identifier)
19053 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
19054 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
19055 (parse_action): Remove.
19056 * po/POTFILES.in: Adjust.
19057
2e047461
AD
190582002-06-11 Akim Demaille <akim@epita.fr>
19059
cd05d13c 19060 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
19061 rule's action member: return the action as a string.
19062 Don't require `rule_length' as an argument: compute it.
19063 (grammar_current_rule_symbol_append)
19064 (grammar_current_rule_action_append): New, eved out from
19065 (readgram): here.
19066 Remove `action_flag', `rulelength', unused now.
19067
9af3fbce
AD
190682002-06-11 Akim Demaille <akim@epita.fr>
19069
19070 * src/reader.c (grammar_current_rule_prec_set).
19071 (grammar_current_rule_check): New, eved out from...
19072 (readgram): here.
19073 Remove `xaction', `first_rhs': useless.
19074 * tests/input.at (Type clashes): New.
19075 * tests/existing.at (GNU Cim Grammar): Adjust.
19076
1485e106
AD
190772002-06-11 Akim Demaille <akim@epita.fr>
19078
19079 * src/reader.c (grammar_midrule_action): New, Eved out from
19080 (readgram): here.
19081
da4160c3
AD
190822002-06-11 Akim Demaille <akim@epita.fr>
19083
19084 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
19085 New.
19086 (readgram): Use them as replacement of inlined code, crule and
19087 crule1.
19088
f6d0f937
AD
190892002-06-11 Akim Demaille <akim@epita.fr>
19090
19091 * src/reader.c (grammar_end, grammar_symbol_append): New.
19092 (readgram): Use them.
19093 Make the use of `p' as local as possible.
19094
69078d4b
AD
190952002-06-10 Akim Demaille <akim@epita.fr>
19096
19097 GCJ's parser requires the tokens to be defined before the prologue.
19098
19099 * data/bison.simple: Output the token definition before the user's
19100 prologue.
19101 * tests/regression.at (Braces parsing, Duplicate string)
19102 (Mixing %token styles): Check the output from bison.
19103 (Early token definitions): New.
19104
5e424082
AD
191052002-06-10 Akim Demaille <akim@epita.fr>
19106
19107 * src/symtab.c (symbol_user_token_number_set): Don't complain when
19108 assigning twice the same user number to a token, so that we can
19109 use it in...
19110 * src/lex.c (lex): here.
19111 Also use `symbol_class_set' instead of hand written code.
19112 * src/reader.c (parse_assoc_decl): Likewise.
19113
44536b35
AD
191142002-06-10 Akim Demaille <akim@epita.fr>
19115
19116 * src/symtab.c, src/symtab.c (symbol_class_set)
19117 (symbol_user_token_number_set): New.
19118 * src/reader.c (parse_token_decl): Use them.
19119 Use a switch instead of ifs.
19120 Use a single argument.
19121
8b9f2372
AD
191222002-06-10 Akim Demaille <akim@epita.fr>
19123
19124 Remove `%thong' support as it is undocumented, unused, duplicates
19125 `%token's job, and creates useless e-mail traffic with people who
19126 want to know what it is, why it is undocumented, unused, and
19127 duplicates `%token's job.
19128
19129 * src/reader.c (parse_thong_decl): Remove.
19130 * src/options.c (option_table): Remove "thong".
19131 * src/lex.h (tok_thong): Remove.
19132
3ae2b51f
AD
191332002-06-10 Akim Demaille <akim@epita.fr>
19134
19135 * src/symtab.c, src/symtab.c (symbol_type_set)
19136 (symbol_precedence_set): New.
19137 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
19138 (value_components_used): Remove, unused.
19139
2f1afb73
AD
191402002-06-09 Akim Demaille <akim@epita.fr>
19141
19142 Move symbols handling code out of the reader.
19143
19144 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
19145 (axiom): Move to...
19146 * src/symtab.h, src/symtab.c: here.
19147
19148 * src/gram.c (start_symbol): Remove: use startsymbol->number.
19149 * src/reader.c (startval): Rename as...
19150 * src/symtab.h, src/symtab.c (startsymbol): this.
19151 * src/reader.c: Adjust.
19152
19153 * src/reader.c (symbol_check_defined, symbol_make_alias)
19154 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19155 (token_translations_init)
19156 Move to...
19157 * src/symtab.c: here.
19158 * src/reader.c (packsymbols): Move to...
19159 * src/symtab.h, src/symtab.c (symbols_pack): here.
19160 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
19161 argument.
19162
e9bca3ad
AD
191632002-06-03 Akim Demaille <akim@epita.fr>
19164
19165 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
19166 then statements.
19167
86eff183
AD
191682002-06-03 Akim Demaille <akim@epita.fr>
19169
19170 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
19171 structs with non literals.
19172 * src/scan-skel.l: never-interactive.
19173 * src/conflicts.c (enum conflict_resolution_e): No trailing
19174 comma.
19175 * src/getargs.c (usage): Split long literal strings.
19176 Reported by Hans Aberg.
19177
717be197
AD
191782002-05-28 Akim Demaille <akim@epita.fr>
19179
19180 * data/bison.c++: Use C++ ostreams.
19181 (cdebug_): New member.
19182
670ddffd
AD
191832002-05-28 Akim Demaille <akim@epita.fr>
19184
19185 * src/output.c (output_skeleton): Be sure to allocate enough room
19186 for `/' _and_ for `\0' in full_skeleton.
19187
769b430f
AD
191882002-05-28 Akim Demaille <akim@epita.fr>
19189
19190 * data/bison.c++: Catch up with bison.simple:
19191 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19192 and Paul Eggert <eggert@twinsun.com>: `error' handing.
19193 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
19194 and popping traces.
19195
7067cb36
PH
191962002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19197
19198 * src/output.c (output_skeleton): Put an explicit path in front of
19199 the skeleton file name, rather than relying on the -I directory,
19200 to partially alleviate effects of having a skeleton file lying around
19201 in the current directory.
769b430f 19202
4a713ec2
PH
192032002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19204
769b430f 19205 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
19206 obstack_printf should be obstack_fgrow1.
19207
b408954b
AD
192082002-05-26 Akim Demaille <akim@epita.fr>
19209
19210 * src/state.h (state_t): `solved_conflicts' is a new member.
19211 * src/LR0.c (new_state): Set it to 0.
19212 * src/conflicts.h, src/conflicts.c (print_conflicts)
19213 (free_conflicts, solve_conflicts): Rename as...
19214 (conflicts_print, conflicts_free, conflicts_solve): these.
19215 Adjust callers.
19216 * src/conflicts.c (enum conflict_resolution_e)
19217 (solved_conflicts_obstack): New, used by...
19218 (log_resolution): this.
19219 Adjust to attach the conflict resolution to each state.
19220 Complete the description with the precedence/associativity
19221 information.
19222 (resolve_sr_conflict): Adjust.
19223 * src/print.c (print_state): Output its solved_conflicts.
19224 * tests/conflicts.at (Unresolved SR Conflicts)
19225 (Solved SR Conflicts): Exercise --report=all.
19226
a49aecd5
AD
192272002-05-26 Akim Demaille <akim@epita.fr>
19228
19229 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19230 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19231 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
19232 (token_number_t, item_number_as_token_number)
19233 (token_number_as_item_number, muscle_insert_token_number_table):
19234 Rename as...
19235 (symbol_number_t, item_number_as_symbol_number)
19236 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
19237 these, since it is more appropriate.
19238
5504898e
AD
192392002-05-26 Akim Demaille <akim@epita.fr>
19240
19241 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
19242 `Error:' lines.
19243 * data/bison.simple (yystos) [YYDEBUG]: New.
19244 (yyparse) [YYDEBUG]: Display the symbols which are popped during
19245 error recovery.
19246 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
19247
ec3bc396
AD
192482002-05-25 Akim Demaille <akim@epita.fr>
19249
19250 * doc/bison.texinfo (Debugging): Split into...
19251 (Tracing): this new section, its former contents, and...
19252 (Understanding): this new section.
19253 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
19254 by...
19255 (report_flag): this.
19256 Adjust all dependencies.
19257 (report_args, report_types, report_argmatch): New.
19258 (usage, getargs): Report/support -r, --report.
19259 * src/options.h
19260 (struct option_table_struct): Rename as..,
19261 (struct option_table_s): this.
19262 Rename the `set_flag' member to `flag' to match with getopt_long's
19263 struct.
19264 * src/options.c (option_table): Split verbose into an entry for
19265 %verbose, and another for --verbose.
19266 Support --report/-r, so remove -r from the obsolete --raw.
19267 * src/print.c: Attach full item sets and lookaheads reports to
19268 report_flag instead of trace_flag.
19269 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
19270
78df8250
PE
192712002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19272 and Paul Eggert <eggert@twinsun.com>
769b430f 19273
78df8250
PE
19274 * data/bison.simple (yyparse): Correct error handling to conform to
19275 POSIX and yacc. Specifically, after syntax error is discovered,
19276 do not reduce further before shifting the error token.
19277 Clean up the code a bit by removing the labels yyerrdefault,
19278 yyerrhandle, yyerrpop.
19279 * NEWS: Document the above.
19280
c0c9ea05
PH
192812002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19282
19283 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
19284 type; it isn't always big enough, since it doesn't necessarily
19285 include non-terminals.
769b430f 19286 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
19287 the latter can be removed.
19288 (yy_token_number_type): Remove, only one use.
19289 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
19290 don't use TokenNumberType as element type.
769b430f 19291
c0c9ea05
PH
19292 * tests/regression.at: Modify expected output to agree with change
19293 to yyr1 and yytranslate.
769b430f 19294
6390a83f
FK
192952002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
19296
19297 * src/reader.c (parse_action): Use copy_character instead of
19298 obstack_1grow.
19299
db7c8e9a
AD
193002002-05-13 Akim Demaille <akim@epita.fr>
19301
19302 * tests/regression.at (Token definitions): Prototype yylex and
19303 yyerror.
19304
fcc61800
PH
193052002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19306
158c687b 19307 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
19308 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
19309 32-bit arithmetic.
19310 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
19311
5683e9b2
AD
193122002-05-07 Akim Demaille <akim@epita.fr>
19313
19314 * tests/synclines.at: Be sure to prototype yylex and yyerror to
19315 avoid GCC warnings.
19316
0c2d3f4c
AD
193172002-05-07 Akim Demaille <akim@epita.fr>
19318
19319 Kill GCC warnings.
19320
19321 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
19322 over the RHS of each rule.
19323 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
19324 * src/state.h (state_t): Member `nitems' is unsigned short.
19325 * src/LR0.c (get_state): Adjust.
19326 * src/reader.c (packgram): Likewise.
19327 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
19328 `Type'.
19329 (muscle_insert_int_table): Remove, unused.
19330 (prepare_rules): Remove `max'.
19331
1565b720
AD
193322002-05-06 Akim Demaille <akim@epita.fr>
19333
19334 * src/closure.c (print_firsts): Display of the symbol tags.
19335 (bitmatrix_print): Move to...
19336 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
19337 here.
19338 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
19339
cfaee611
AD
193402002-05-06 Akim Demaille <akim@epita.fr>
19341
19342 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
19343 hash_do_for_each.
19344
458be8e0
AD
193452002-05-06 Akim Demaille <akim@epita.fr>
19346
19347 * src/LR0.c (new_state, get_state): Instead of using the global
19348 `kernel_size' and `kernel_base', have two new arguments:
19349 `core_size' and `core'.
19350 Adjust callers.
19351
a900a624
AD
193522002-05-06 Akim Demaille <akim@epita.fr>
19353
19354 * src/reader.c (packgram): No longer end `ritem' with a 0
19355 sentinel: it is not used.
19356
d4e7d3a1
AD
193572002-05-05 Akim Demaille <akim@epita.fr>
19358
19359 New experimental feature: display the lookaheads in the report and
19360 graph.
19361
19362 * src/print (print_core): When --trace-flag, display the rules
19363 lookaheads.
19364 * src/print_graph.c (print_core): Likewise.
19365 Swap the arguments.
19366 Adjust caller.
19367
39ceb25b
AD
193682002-05-05 Akim Demaille <akim@epita.fr>
19369
19370 * tests/torture.at (Many lookaheads): New test.
19371
5372019f
AD
193722002-05-05 Akim Demaille <akim@epita.fr>
19373
19374 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
19375 (GENERATE_MUSCLE_INSERT_TABLE): this.
19376 (output_int_table, output_unsigned_int_table, output_short_table)
19377 (output_token_number_table, output_item_number_table): Replace with...
19378 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
19379 (muscle_insert_short_table, muscle_insert_token_number_table)
19380 (muscle_insert_item_number_table): these.
19381 Adjust all callers.
19382 (prepare_tokens): Don't free `translations', since...
19383 * src/reader.h, src/reader.c (grammar_free): do it.
19384 Move to...
19385 * src/gram.h, src/gram.c (grammar_free): here.
19386 * data/bison.simple, data/bison.c++: b4_token_number_max is now
19387 b4_translate_max.
19388
5df5f6d5
AD
193892002-05-05 Akim Demaille <akim@epita.fr>
19390
19391 * src/output.c (output_unsigned_int_table): New.
19392 (prepare_rules): `i' is unsigned.
19393 `prhs', `rline', `r2' are unsigned int.
19394 Rename muscle `rhs_number_max' as `rhs_max'.
19395 Output muscles `prhs_max', `rline_max', and `r2_max'.
19396 Free rline and r1.
19397 * data/bison.simple, data/bison.c++: Adjust to use these muscles
19398 to compute types instead of constant types.
19399 * tests/regression.at (Web2c Actions): Adjust.
19400
b87f8b21
AD
194012002-05-04 Akim Demaille <akim@epita.fr>
19402
19403 * src/symtab.h (SALIAS, SUNDEF): Rename as...
19404 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
19405 Adjust dependencies.
19406 * src/output.c (token_definitions_output): Be sure not to output a
19407 `#define 'a'' when fed with `%token 'a' "a"'.
19408 * tests/regression.at (Token definitions): New.
19409
8bb936e4
PE
194102002-05-03 Paul Eggert <eggert@twinsun.com>
19411
19412 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
19413 for K&R C.
19414
194152002-05-03 gettextize <bug-gnu-gettext@gnu.org>
19416
19417 * Makefile.am (SUBDIRS): Remove intl.
19418 (EXTRA_DIST): Add config/config.rpath.
19419
53c71a12
AD
194202002-05-03 Akim Demaille <akim@epita.fr>
19421
19422 * data/bison.simple (m4_if): Don't output empty enums.
19423 And actually, output valid enum definitions :(.
19424
289dd0cf
AD
194252002-05-03 Akim Demaille <akim@epita.fr>
19426
19427 * configure.bat: Remove, completely obsolete.
19428 * Makefile.am (EXTRA_DIST): Adjust.
19429 Don't distribute config.rpath...
19430 * config/Makefile.am (EXTRA_DIST): Do it.
19431
db85e524
AD
194322002-05-03 Akim Demaille <akim@epita.fr>
19433
19434 * configure.in (GETTEXT_VERSION): New.
19435 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
19436
83ccf991
AD
194372002-05-03 Akim Demaille <akim@epita.fr>
19438
19439 * data/bison.simple (b4_token_enum): New.
19440 (b4_token_defines): Use it to output tokens both as #define and
19441 enums.
19442 Suggested by Paul Eggert.
19443 * src/output.c (token_definitions_output): Don't output spurious
19444 white spaces.
19445
1f418995
AD
194462002-05-03 Akim Demaille <akim@epita.fr>
19447
19448 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19449
45119f04
RA
194502002-05-02 Robert Anisko <robert@lrde.epita.fr>
19451
19452 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
19453 Update the stack class, give a try to deque as the default container.
19454
b2d52318
AD
194552002-05-02 Akim Demaille <akim@epita.fr>
19456
19457 * data/bison.simple (yyparse): Do not implement @$ = @1.
19458 (YYLLOC_DEFAULT): Adjust to do it.
19459 * doc/bison.texinfo (Location Default Action): Fix.
19460
3a8b4109
AD
194612002-05-02 Akim Demaille <akim@epita.fr>
19462
19463 * src/reader.c (parse_braces): Merge into...
19464 (parse_action): this.
19465
84614e13
AD
194662002-05-02 Akim Demaille <akim@epita.fr>
19467
19468 * configure.in (ALL_LINGUAS): Remove.
19469 * po/LINGUAS, hr.po: New.
19470
fdbcd8e2
AD
194712002-05-02 Akim Demaille <akim@epita.fr>
19472
19473 Remove the so called hairy (semantic) parsers.
19474
19475 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
19476 * src/gram.h, src/gram.c (semantic_parser): Remove.
19477 (rule_t): Remove the guard and guard_line members.
19478 * src/lex.h (token_t): remove tok_guard.
19479 * src/options.c (option_table): Remove %guard and %semantic_parser
19480 support.
19481 * src/output.c, src/output.h (guards_output): Remove.
19482 (prepare): Adjust.
19483 (token_definitions_output): Don't output the `T'
19484 tokens (???).
19485 (output_skeleton): Don't output the guards.
19486 * src/files.c, src/files.c (attrsfile): Remove.
19487 * src/reader.c (symbol_list): Remove the guard and guard_line
19488 members.
19489 Adjust dependencies.
19490 (parse_guard): Remove.
19491 * data/bison.hairy: Remove.
19492 * doc/bison.texinfo (Environment Variables): Remove occurrences of
19493 BISON_HAIRY.
19494
82b6cb3f
AD
194952002-05-02 Akim Demaille <akim@epita.fr>
19496
19497 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
19498 (parse_guard): Rename the formal argument `stack_offset' as
19499 `rule_length', which is more readable.
19500 Adjust callers.
19501 (copy_at, copy_dollar): Instead of outputting the hard coded
19502 values of $$, $n and so forth, output invocation to b4_lhs_value,
19503 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
19504 Note: this patch partially drops `semantic-parser' support: it
19505 always does `rule_length - n', where semantic parsers ought to
19506 always use `-n'.
82b6cb3f
AD
19507 * data/bison.simple, data/bison.c++ (b4_lhs_value)
19508 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
19509
6cbfbcc5
AD
195102002-05-02 Akim Demaille <akim@epita.fr>
19511
19512 * configure.in (AC_INIT): Bump to 1.49b.
19513 (AM_INIT_AUTOMAKE): Short invocation.
19514
b8548114
AD
195152002-05-02 Akim Demaille <akim@epita.fr>
19516
19517 Version 1.49a.
19518
c20cd1fa
AD
195192002-05-01 Akim Demaille <akim@epita.fr>
19520
19521 * src/skeleton.h: Remove.
19522
8a9566d4
AD
195232002-05-01 Akim Demaille <akim@epita.fr>
19524
19525 * src/skeleton.h: Fix the #endif.
19526 Reported by Magnus Fromreide.
19527
8c6d399a
PE
195282002-04-26 Paul Eggert <eggert@twinsun.com>
19529
19530 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
19531 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 19532 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 19533
2b7ed18a
RA
195342002-04-25 Robert Anisko <robert@lrde.epita.fr>
19535
19536 * src/scan-skel.l: Postprocess quadrigraphs.
19537
19538 * src/reader.c (copy_character): New function, used to output
19539 single characters while replacing `[' and `]' with quadrigraphs, to
19540 avoid troubles with M4 quotes.
19541 (copy_comment): Output characters with copy_character.
19542 (read_additionnal_code): Likewise.
19543 (copy_string2): Likewise.
19544 (copy_definition): Likewise.
19545
19546 * tests/calc.at: Exercise M4 quoting.
19547
34a89c50
AD
195482002-04-25 Akim Demaille <akim@epita.fr>
19549
19550 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
19551 between `!' and the command.
19552 Reported by Paul Eggert.
19553
0dd1580a
RA
195542002-04-24 Robert Anisko <robert@lrde.epita.fr>
19555
19556 * tests/calc.at: Exercise prologue splitting.
19557
19558 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
19559 `b4_post_prologue' instead of `b4_prologue'.
19560
19561 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
19562 muscles.
19563 (output): Free pre_prologue_obstack and post_prologue_obstack.
19564 * src/files.h, src/files.c (attrs_obstack): Remove.
19565 (pre_prologue_obstack, post_prologue_obstack): New.
19566 * src/reader.c (copy_definition): Add a parameter to specify the
19567 obstack to fill, instead of using attrs_obstack unconditionally.
19568 (read_declarations): Pass pre_prologue_obstack to copy_definition if
19569 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
19570
83c1796f
PE
195712002-04-23 Paul Eggert <eggert@twinsun.com>
19572
19573 * data/bison.simple: Remove unnecessary commentary and white
19574 space differences from 1_29-branch.
19575 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
19576
19577 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
19578 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
19579 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
19580 constructors or destructors.
19581
19582 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
19583
1207eeac
AD
195842002-04-23 Akim Demaille <akim@epita.fr>
19585
19586 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
19587 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
19588 location with columns.
19589 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
19590 All reported by Paul Eggert.
19591
78ab8f67
AD
195922002-04-22 Akim Demaille <akim@epita.fr>
19593
19594 * src/reduce.c (dump_grammar): Move to...
19595 * src/gram.h, src/gram.c (grammar_dump): here.
19596 Be sure to separate long item numbers.
19597 Don't read the members of a rule's prec if its nil.
19598
133c20e2
AD
195992002-04-22 Akim Demaille <akim@epita.fr>
19600
19601 * src/output.c (table_size, table_grow): New.
19602 (MAXTABLE): Remove, replace uses with table_size.
19603 (pack_vector): Instead of dying when the table is too big, grow it.
19604
9515e8a7
AD
196052002-04-22 Akim Demaille <akim@epita.fr>
19606
19607 * data/bison.simple (yyr1): Its type is that of a token number.
19608 * data/bison.c++ (r1_): Likewise.
19609 * tests/regression.at (Web2c Actions): Adjust.
19610
23c5a174
AD
196112002-04-22 Akim Demaille <akim@epita.fr>
19612
19613 * src/reader.c (token_translations_init): 256 is now the default
19614 value for the error token, i.e., it will be assigned another
19615 number if the user assigned 256 to one of her tokens.
19616 (reader): Don't force 256 to error.
19617 * doc/bison.texinfo (Symbols): Adjust.
19618 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
19619 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
19620 etc. instead of 10, 20, 30 (which was used to `jump' over error
19621 (256) and undefined (2)).
19622
5fbb0954
AD
196232002-04-22 Akim Demaille <akim@epita.fr>
19624
19625 Propagate more token_number_t.
19626
19627 * src/gram.h (token_number_as_item_number)
19628 (item_number_as_token_number): New.
19629 * src/output.c (GENERATE_OUTPUT_TABLE): New.
19630 Use it to create output_item_number_table and
19631 output_token_number_table.
19632 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19633 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
19634 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
19635 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
19636
4f940944
AD
196372002-04-22 Akim Demaille <akim@epita.fr>
19638
19639 * src/output.h, src/output.c (get_lines_number): Remove.
19640
3ded9a63
AD
196412002-04-19 Akim Demaille <akim@epita.fr>
19642
19643 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
19644 as Lex/Flex'.
19645 (Debugging): More details about enabling the debugging features.
19646 (Table of Symbols): Describe $$, $n, @$, and @n.
19647 Suggested by Tim Josling.
19648
e0c471a9
AD
196492002-04-19 Akim Demaille <akim@epita.fr>
19650
19651 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
19652
fecc10cd
AD
196532002-04-10 Akim Demaille <akim@epita.fr>
19654
19655 * src/system.h: Rely on HAVE_LIMITS_H.
19656 Suggested by Paul Eggert.
19657
51dec47b
AD
196582002-04-09 Akim Demaille <akim@epita.fr>
19659
19660 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
19661 full stderr, and strip it according to the bison options, instead
19662 of composing the error message from different bits.
19663 This makes it easier to check for several error messages.
19664 Adjust all the invocations.
19665 Add an invocation exercising the error token.
19666 Add an invocation demonstrating a stupid error message.
19667 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
19668 Adjust the tests.
19669 Error message are for stderr, not stdout.
19670
007a50a4
AD
196712002-04-09 Akim Demaille <akim@epita.fr>
19672
19673 * src/gram.h, src/gram.c (error_token_number): Remove, use
19674 errtoken->number.
19675 * src/reader.c (reader): Don't specify the user token number (2)
19676 for $undefined, as it uselessly prevents using it.
19677 * src/gram.h (token_number_t): Move to...
19678 * src/symtab.h: here.
19679 (state_t.number): Is a token_number_t.
19680 * src/print.c, src/reader.c: Use undeftoken->number instead of
19681 hard coded 2.
19682 (Even though this 2 is not the same as above: the number of the
19683 undeftoken remains being 2, it is its user token number which
19684 might not be 2).
19685 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
19686 `user_token_number_max'.
19687 Output `undef_token_number'.
19688 * data/bison.simple, data/bison.c++: Use them.
19689 Be sure to map invalid yylex return values to
19690 `undef_token_number'. This saves us from gratuitous SEGV.
19691
19692 * tests/conflicts.at (Solved SR Conflicts)
19693 (Unresolved SR Conflicts): Adjust.
19694 * tests/regression.at (Web2c Actions): Adjust.
19695
06446ccf
AD
196962002-04-08 Akim Demaille <akim@epita.fr>
19697
19698 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
19699 Adding #line.
19700 Remove the duplicate `typedefs'.
19701 (RhsNumberType): Fix the declaration and various other typos.
19702 Use __ofile__.
19703 * data/bison.simple: Use __ofile__.
19704 * src/scan-skel.l: Handle __ofile__.
19705
62a3e4f0
AD
197062002-04-08 Akim Demaille <akim@epita.fr>
19707
19708 * src/gram.h (item_number_t): New, the type of item numbers in
19709 RITEM. Note that it must be able to code symbol numbers as
19710 positive number, and the negation of rule numbers as negative
19711 numbers.
19712 Adjust all dependencies (pretty many).
19713 * src/reduce.c (rule): Remove this `short *' pointer: use
19714 item_number_t.
19715 * src/system.h (MINSHORT, MAXSHORT): Remove.
19716 Include `limits.h'.
19717 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
19718 (shortcpy): Remove.
19719 (MAXTABLE): Move to...
19720 * src/output.c (MAXTABLE): here.
19721 (prepare_rules): Use output_int_table to output rhs.
19722 * data/bison.simple, data/bison.c++: Adjust.
19723 * tests/torture.at (Big triangle): Move the limit from 254 to
19724 500.
19725 * tests/regression.at (Web2c Actions): Ajust.
19726
19727 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
19728 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
19729 passes, but produces negative #line number, once fixed, GCC is
19730 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
19731 C), it passes.
19732 * src/state.h (state_h): Code input lines on ints, not shorts.
19733
bb88b0fc
AD
197342002-04-08 Akim Demaille <akim@epita.fr>
19735
19736 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
19737 and then the grammar.
19738
9a636f47
AD
197392002-04-08 Akim Demaille <akim@epita.fr>
19740
19741 * src/system.h: No longer using strndup.
19742
680e8701
AD
197432002-04-07 Akim Demaille <akim@epita.fr>
19744
19745 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
19746 * src/output.c (output_table_data): Return the longest number.
19747 (prepare_tokens): Output `token_number_max').
19748 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
19749 New.
19750 Use them to define yy_token_number_type/TokenNumberType.
19751 Use this type for yytranslate.
19752 * tests/torture.at (Big triangle): Push the limit from 124 to
19753 253.
19754 * tests/regression.at (Web2c Actions): Adjust.
19755
817e9f41
AD
197562002-04-07 Akim Demaille <akim@epita.fr>
19757
19758 * tests/torture.at (Big triangle): New.
19759 (GNU AWK Grammar, GNU Cim Grammar): Move to...
19760 * tests/existing.at: here.
19761
5123689b
AD
197622002-04-07 Akim Demaille <akim@epita.fr>
19763
19764 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
19765 nritems.
19766 Adjust dependencies.
19767
f3849179
AD
197682002-04-07 Akim Demaille <akim@epita.fr>
19769
19770 * src/reader.c: Normalize increments to prefix form.
19771
bd02036a
AD
197722002-04-07 Akim Demaille <akim@epita.fr>
19773
19774 * src/reader.c, symtab.c: Remove debugging code.
19775
db8837cb
AD
197762002-04-07 Akim Demaille <akim@epita.fr>
19777
19778 Rename all the `bucket's as `symbol_t'.
19779
19780 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
19781 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
19782 * src/symtab.c, src/symtab.h (bucket): Rename as...
19783 (symbol_t): this.
19784 (symbol_list_new, bucket_check_defined, bucket_make_alias)
19785 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
19786 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19787 (buckets_new, buckets_free, buckets_do): Rename as...
19788 (symbol_list_new, symbol_check_defined, symbol_make_alias)
19789 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19790 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
19791 (symbols_new, symbols_free, symbols_do): these.
19792
72a23c97
AD
197932002-04-07 Akim Demaille <akim@epita.fr>
19794
19795 Use lib/hash for the symbol table.
19796
19797 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
19798 EOF.
19799 * src/lex.c (lex): Set the `number' member of new terminals.
19800 * src/reader.c (bucket_check_defined, bucket_make_alias)
19801 (bucket_check_alias_consistence, bucket_translation): New.
19802 (reader, grammar_free, readgram, token_translations_init)
19803 (packsymbols): Adjust.
19804 (reader): Number the predefined tokens.
19805 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
19806 for predefined tokens.
19807 * src/symtab.h (bucket): Remove all the hash table related
19808 members.
19809 * src/symtab.c (symtab): Replace by...
19810 (bucket_table): this.
19811 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19812 (buckets_new, buckets_do): New.
19813
280a38c3
AD
198142002-04-07 Akim Demaille <akim@epita.fr>
19815
19816 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
19817 (start_symbol, max_user_token_number, semantic_parser)
19818 (error_token_number): Initialize.
19819 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
19820 Initialize.
19821 (reader): Don't.
19822 (errtoken, eoftoken, undeftoken, axiom): Extern.
19823
03b31c0c
AD
198242002-04-07 Akim Demaille <akim@epita.fr>
19825
19826 * src/gram.h (rule_s): prec and precsym are now pointers
19827 to the bucket giving the priority/associativity.
19828 Member `associativity' removed: useless.
19829 * src/reduce.c, src/conflicts.c: Adjust.
19830
8b3df748
AD
198312002-04-07 Akim Demaille <akim@epita.fr>
19832
19833 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
19834 Properly escape the symbols' TAG when outputting them.
19835
e601aa1d
AD
198362002-04-07 Akim Demaille <akim@epita.fr>
19837
19838 * src/lalr.h (LA): Is a bitsetv, not bitset*.
19839
b0299a2e
AD
198402002-04-07 Akim Demaille <akim@epita.fr>
19841
19842 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
19843 (LArule): this, which is an array to rule_t*.
19844 * src/print.c, src/conflicts.c: Adjust.
19845
d7e1f00c
AD
198462002-04-07 Akim Demaille <akim@epita.fr>
19847
19848 * src/gram.h (rule_t): Rename `number' as `user_number'.
19849 `number' is a new member.
19850 Adjust dependencies.
19851 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
19852
cc9305dd
AD
198532002-04-07 Akim Demaille <akim@epita.fr>
19854
19855 As a result of the previous patch, it is no longer needed
19856 to reorder ritem itself.
19857
19858 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
19859
b0940840
AD
198602002-04-07 Akim Demaille <akim@epita.fr>
19861
19862 Be sure never to walk through RITEMS, but use only data related to
19863 the rules themselves. RITEMS should be banished.
19864
19865 * src/output.c (output_token_translations): Rename as...
19866 (prepare_tokens): this.
19867 In addition to `translate', prepare the muscles `tname' and
19868 `toknum', which were handled by...
19869 (output_rule_data): this.
19870 Remove, and move the remainder of its outputs into...
19871 (prepare_rules): this new routines, which also merges content from
19872 (output_gram): this.
19873 (prepare_rules): Be sure never to walk through RITEMS.
19874 (output_stos): Rename as...
19875 (prepare_stos): this.
19876 (output): Always invoke prepare_states, after all, just don't use it
19877 in the output if you don't need it.
19878
643a5994
AD
198792002-04-07 Akim Demaille <akim@epita.fr>
19880
19881 * src/LR0.c (new_state): Display `nstates' as the name of the
19882 newly created state.
19883 Adjust to initialize first_state and last_state if needed.
19884 Be sure to distinguish the initial from the final state.
19885 (new_states): Create the itemset of the initial state, and use
19886 new_state.
19887 * src/closure.c (closure): Now that the initial state has its
19888 items properly set, there is no need for a special case when
19889 creating `ruleset'.
19890
19891 As a result, now the rule 0, reducing to $axiom, is visible in the
19892 outputs. Adjust the test suite.
19893
19894 * tests/conflicts.at (Solved SR Conflicts)
19895 (Unresolved SR Conflicts): Adjust.
19896 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
19897 * tests/conflicts.at (S/R in initial): New.
19898
b4c4ccc2
AD
198992002-04-07 Akim Demaille <akim@epita.fr>
19900
19901 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
19902 the RHS of the rules.
19903 * src/output.c (output_gram): Likewise.
19904
bba97eb2
AD
199052002-04-07 Akim Demaille <akim@epita.fr>
19906
19907 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
19908 bucket.
19909 Adjust all dependencies.
19910 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
19911 `number' of the buckets too.
19912 * src/gram.h: Include `symtab.h'.
19913 (associativity): Move to...
19914 * src/symtab.h: here.
19915 No longer include `gram.h'.
19916
c3b407f4
AD
199172002-04-07 Akim Demaille <akim@epita.fr>
19918
19919 * src/gram.h, src/gram.c (rules_rhs_length): New.
19920 (ritem_longest_rhs): Use it.
19921 * src/gram.h (rule_t): `number' is a new member.
19922 * src/reader.c (packgram): Set it.
19923 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
19924 the end of `rules', and count them out of `nrules'.
19925 (reduce_output, dump_grammar): Adjust.
19926 * src/print.c (print_grammar): It is no longer needed to check for
19927 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
19928 * tests/reduce.at (Reduced Automaton): New test.
19929
11652ab3
AD
199302002-04-07 Akim Demaille <akim@epita.fr>
19931
19932 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
19933 lacking `+ 1' to nrules, Bison reported as useless a token if it
19934 was used solely to set the precedence of the last rule...
19935
26b23c1a
AD
199362002-04-07 Akim Demaille <akim@epita.fr>
19937
19938 * data/bison.c++, data/bison.simple: Don't output the current file
19939 name in #line, to avoid useless diffs between two identical
19940 outputs under different names.
19941
18bcecb0
AD
199422002-04-07 Akim Demaille <akim@epita.fr>
19943
19944 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
19945 Normalize loops to using `< nrules + 1', not `<= nrules'.
19946
fa770c86
AD
199472002-04-07 Akim Demaille <akim@epita.fr>
19948
19949 * TODO: Update.
19950
d9b739c3
AD
199512002-04-07 Akim Demaille <akim@epita.fr>
19952
19953 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
19954 bucket.value as bucket.number.
19955
99013900
AD
199562002-04-07 Akim Demaille <akim@epita.fr>
19957
19958 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
19959 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19960 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
19961 RHS, instead of being an index in RITEMS.
19962
e966383b
PE
199632002-04-04 Paul Eggert <eggert@twinsun.com>
19964
19965 * doc/bison.texinfo: Update copyright date.
19966 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
19967 (Symbols): Warn about running Bison in one character set,
19968 but compiling and/or running in an incompatible one.
19969 Warn about character code 256, too.
19970
199712002-04-03 Paul Eggert <eggert@twinsun.com>
19972
19973 * src/bison.data (YYSTACK_ALLOC): Depend on whether
19974 YYERROR_VERBOSE is nonzero, not whether it is defined.
19975
19976 Merge changes from bison-1_29-branch.
c307773e 19977
8d6c48b9
PE
199782002-03-20 Paul Eggert <eggert@twinsun.com>
19979
19980 Merge fixes from Debian bison_1.34-1.diff.
19981
19982 * configure.in (AC_PREREQ): 2.53.
19983
e53c6322
AD
199842002-03-20 Akim Demaille <akim@epita.fr>
19985
19986 * src/conflicts.c (log_resolution): Argument `resolution' is const.
19987
9ffbeca7
PE
199882002-03-19 Paul Eggert <eggert@twinsun.com>
19989
21db0b2a
PE
19990 * src/bison.simple (YYCOPY): New macro.
19991 (YYSTACK_RELOCATE): Use it.
19992 Remove Type arg; no longer needed. All callers changed.
19993 (yymemcpy): Remove; no longer needed.
19994
9ffbeca7
PE
19995 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
19996 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
19997
642cb8f8
AD
199982002-03-19 Akim Demaille <akim@epita.fr>
19999
20000 Test and fix the #line outputs.
20001
20002 * tests/atlocal.at (GCC): New.
20003 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 20004 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
20005 (Action synch line, Epilogue synch line): New tests.
20006 * src/reader.c (parse_union_decl): Define the muscle stype_line.
20007 * data/bison.simple, data/bison.c++: Use it.
20008
3c31a486
AD
200092002-03-19 Akim Demaille <akim@epita.fr>
20010
20011 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
20012 (Solved SR Conflicts, %expect not enough, %expect right)
20013 (%expect too much): Move to...
20014 * tests/conflicts.at: this new file.
20015
0d8bed56
AD
200162002-03-19 Akim Demaille <akim@epita.fr>
20017
20018 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
20019 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
20020 that we can move to enums for instance.
20021 * src/output.c (token_definitions_output): Output a list of
20022 `token-name, token-number' instead of the #define.
20023 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
20024
9208d17f
AD
200252002-03-14 Akim Demaille <akim@epita.fr>
20026
20027 Use Gettext 0.11.1.
20028
af27eacb
RA
200292002-03-09 Robert Anisko <robert@lrde.epita.fr>
20030
20031 * data/bison.c++: Make the user able to add members to the generated
20032 parser by subclassing.
20033
9101a310
RA
200342002-03-05 Robert Anisko <robert@lrde.epita.fr>
20035
20036 * src/reader.c (read_additionnal_code): `c' should be an integer, not
20037 a character.
20038 Reported by Nicolas Tisserand and Nicolas Burrus.
20039
fff9bf0b
RA
200402002-03-04 Robert Anisko <robert@lrde.epita.fr>
20041
20042 * src/reader.c: Warn about lacking semi-colons, do not complain.
20043
64dba31e
RA
200442002-03-04 Robert Anisko <robert@lrde.epita.fr>
20045
20046 * data/bison.c++: Remove a debug line.
20047
374f5a14
RA
200482002-03-04 Robert Anisko <robert@lrde.epita.fr>
20049
20050 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
20051 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
20052 provide a default implementation.
20053
bfcf1f3a
AD
200542002-03-04 Akim Demaille <akim@epita.fr>
20055
20056 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
20057 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
20058 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
20059 * tests/semantic.at (Parsing Guards): Similarly.
20060 * src/reader.at (readgram): Complain if the last rule is not ended
20061 with a semi-colon.
20062
65ccf9fc
AD
200632002-03-04 Akim Demaille <akim@epita.fr>
20064
20065 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
20066 * src/closure.c: here.
20067 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
20068 RTC.
20069 * src/warshall.h, src/warshall.c: Remove.
20070 * tests/sets.at (Broken Closure): Adjust.
20071
d0039cbc
AD
200722002-03-04 Akim Demaille <akim@epita.fr>
20073
20074 * src/output.c (output_skeleton): tempdir is const.
20075 bytes_read is unused.
20076
345cea78
AD
200772002-03-04 Akim Demaille <akim@epita.fr>
20078
20079 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
20080 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
20081 Update.
20082 From Michael Hayes.
20083
564801f7
AD
200842002-03-04 Akim Demaille <akim@epita.fr>
20085
20086 * src/closure.c (closure): `r' is unused.
20087
e5352bc7
AD
200882002-03-04 Akim Demaille <akim@epita.fr>
20089
20090 * tests/sets.at (Broken Closure): Add the ending `;'.
20091 * src/reader.at (readgram): Complain if a rule is not ended with a
20092 semi-colon.
20093
914feea9
AD
200942002-03-04 Akim Demaille <akim@epita.fr>
20095
20096 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
20097 (count_sr_conflicts): Use bitset_count.
20098 * src/reduce.c (inaccessable_symbols): Ditto.
20099 (bits_size): Remove.
20100 * src/warshall.h, src/warshall.c: Convert to bitsetv.
20101
f0250de6
AD
201022002-03-04 Akim Demaille <akim@epita.fr>
20103
20104 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
20105 * src/reduce.c: Remove the `bitset_zero's following the
20106 `bitset_create's, as now it is performed by the latter.
20107
ef017502
AD
201082002-03-04 Akim Demaille <akim@epita.fr>
20109
20110 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
20111 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
20112 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
20113 latest sources from Michael.
20114
76514394
AD
201152002-03-04 Akim Demaille <akim@epita.fr>
20116
20117 * src/output.c (output): Don't free the grammar.
20118 * src/reader.c (grammar_free): New.
20119 * src/main.c (main): Call it and don't free symtab here.
20120
55024580
AD
201212002-03-04 Akim Demaille <akim@epita.fr>
20122
20123 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
20124 before returning.
20125 Reported by Benoit Perrot.
20126
f9abaa2c
AD
201272002-03-04 Akim Demaille <akim@epita.fr>
20128
20129 Use bitset operations when possible, not loops over bits.
20130
20131 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
20132 bitset_or.
20133 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
20134 * src/reduce.c (useless_nonterminals): Formatting changes.
20135 * src/warshall.c (TC): Use bitset_or.
20136
0e721e75
AD
201372002-03-04 Akim Demaille <akim@epita.fr>
20138
20139 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
20140 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
20141 Ditto.
20142
0fb1ffb1
AD
201432002-03-04 Akim Demaille <akim@epita.fr>
20144
20145 * src/lalr.c (F): Now a bitset*.
20146 Adjust all dependencies.
20147
b86796bf
AD
201482002-03-04 Akim Demaille <akim@epita.fr>
20149
20150 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
20151 Adjust all dependencies.
20152
602bbf31
AD
201532002-03-04 Akim Demaille <akim@epita.fr>
20154
20155 * src/L0.c, src/LR0.h (nstates): Be size_t.
20156 Adjust comparisons (signed vs unsigned).
20157 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
20158 bitset*.
20159 Adjust all dependencies.
20160
d8a0245c
AD
201612002-03-04 Akim Demaille <akim@epita.fr>
20162
20163 * src/closure.c (firsts): Now, also a bitset.
20164 Adjust all dependencies.
20165 (varsetsize): Remove, now unused.
20166 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
20167
34ba9743
AD
201682002-03-04 Akim Demaille <akim@epita.fr>
20169
20170 * src/print.c: Convert to use bitset.h, not hand coded iterations
20171 over ints.
20172
ed86e78c
AD
201732002-03-04 Akim Demaille <akim@epita.fr>
20174
20175 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
20176
dfdb1797
AD
201772002-03-04 Akim Demaille <akim@epita.fr>
20178
20179 * src/closure.c (ruleset): Be a bitset.
20180 (rulesetsize): Remove.
20181
7086e707
AD
201822002-03-04 Akim Demaille <akim@epita.fr>
20183
20184 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
20185 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
20186 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
20187 * src/closure.c (fderives): Be an array of bitsets.
20188
98254360
RA
201892002-02-28 Robert Anisko <robert@lrde.epita.fr>
20190
20191 * data/bison.c++: Merge the two generated headers. Insert a copyright
20192 notice in each output file.
20193
a75c057f
AD
201942002-02-28 Akim Demaille <akim@epita.fr>
20195
20196 * data/bison.c++: Copy the prologue of bison.simple to fetch
20197 useful M4 definitions, such as b4_header_guard.
20198
06b00abc
AD
201992002-02-25 Akim Demaille <akim@epita.fr>
20200
20201 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
20202 translator friendly scheme for the bgr
20203 copyright notice.
06b00abc 20204
70e7d534
AD
202052002-02-25 Akim Demaille <akim@epita.fr>
20206
20207 * src/output.c (header_output): Remove, now handled completely via
20208 M4.
20209
abe017f6
AD
202102002-02-25 Akim Demaille <akim@epita.fr>
20211
20212 * m4/m4.m4: New, from CVS Autoconf.
20213 * configure.in: Invoke it.
20214 * src/output.c (output_skeleton): Use its result instead of the
20215 hard coded name.
20216
381fb12e
AD
202172002-02-25 Akim Demaille <akim@epita.fr>
20218
20219 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
20220 Fileutils 4.1.5.
20221 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
20222 * src/output.c (output_skeleton): Use mkstemp to create a real
20223 temporary file.
20224 Move the filling of `skeleton' and its muscle to...
20225 (prepare): here.
20226 (output): Move the definition of the prologue muscle to...
20227 (prepare): here.
20228 * src/system.h (DEFAULT_TMPDIR): New.
20229
6f38107f
PE
202302002-02-14 Paul Eggert <eggert@twinsun.com>
20231
20232 Remove the support for C++ namespace cleanliness; it was
20233 causing more problems than it was curing, since it didn't work
20234 properly on some nonstandard C++ compilers. This can wait
20235 for a proper C++ parser.
20236
20237 * NEWS: Document this.
20238 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
20239 of C++, as it's treated like C now.
20240 * src/bison.simple (YYSTD): Remove.
20241 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
20242 Treat C++ just like Standard C instead of trying to support
20243 namespace cleanliness.
20244
80cce3da
AD
202452002-02-14 Akim Demaille <akim@epita.fr>
20246
20247 * tests/regression.at (else): Adjust to Andreas' change.
20248
842e8679
AD
202492002-02-14 Akim Demaille <akim@epita.fr>
20250
20251 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
20252
4bda3f10
AD
202532002-02-13 Andreas Schwab <schwab@suse.de>
20254
20255 * src/output.c (output_rule_data): Don't output NULL, it might
20256 not be defined yet.
20257
4162fa07 202582002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 20259
4162fa07
RA
20260 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
20261 (Copyright notice): Update.
b418ecd8 20262
bd16a5dc
AD
202632002-02-11 Akim Demaille <akim@epita.fr>
20264
20265 * tests/regression.at (%nonassoc and eof): Don't include
20266 nonportable headers.
20267
8d69a1a3
RA
202682002-02-08 Robert Anisko <robert@lrde.epita.fr>
20269
20270 * data/bison.c++: Correct error recovery. Make the user able to
20271 initialize the starting location.
20272
9b2d0677
AD
202732002-02-07 Akim Demaille <akim@epita.fr>
20274
20275 * tests/input.at: New.
20276
69e2658b
RA
202772002-02-07 Robert Anisko <robert@lrde.epita.fr>
20278
20279 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 20280 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
20281 directives around tables only needed for debugging.
20282
4aacc3a7
RA
202832002-02-07 Robert Anisko <robert@lrde.epita.fr>
20284
20285 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
20286 C++ parsers.
20287 (yy::b4_name::parse): Use print_.
20288
762a801e
RA
202892002-02-07 Robert Anisko <robert@lrde.epita.fr>
20290
20291 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
20292
4bb2bc3f
RA
202932002-02-07 Robert Anisko <robert@lrde.epita.fr>
20294
20295 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
20296 C++ parsers.
20297 (yy::b4_name::parse): Build verbose error messages, and use error_.
20298
6b45a3ca
RA
202992002-02-06 Robert Anisko <robert@lrde.epita.fr>
20300
20301 * data/bison.c++: Fix m4 quoting in comments.
20302
50997c6e
RA
203032002-02-06 Robert Anisko <robert@lrde.epita.fr>
20304
20305 * data/bison.c++: Adjust the parser code. Fix some muscles that were
20306 not expanded by m4.
20307
3f3eed27
AD
203082002-02-05 Akim Demaille <akim@epita.fr>
20309
20310 * data/bison.c++: Adjust to the M4 back end.
20311 More is certainly needed.
20312
be2a1a68
AD
203132002-02-05 Akim Demaille <akim@epita.fr>
20314
20315 Give a try to M4 as a back end.
20316
20317 * lib/readpipe.c: New, from wdiff.
20318 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
20319 BISON_HAIRY.
20320 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
20321 specific values. Now it is m4 that performs the lookup.
20322 * src/parse-skel.y: Remove.
20323 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
20324 * src/output.c (actions_output, guards_output)
20325 (token_definitions_output): No longer keeps track of the output
20326 line number, hence remove the second argument.
20327 (guards_output): Check against the guard member of a rule, not the
20328 action member.
20329 Adjust callers.
20330 (output_skeleton): Don't look for the skeleton location, let m4 do
20331 that.
20332 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
20333 file will be used.
20334 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
20335 (prepare): Given that for the time being changesyntax is not
20336 usable in M4, rename the muscles using `-' to `_'.
20337 Define `defines_flag', `output_parser_name' and `output_header_name'.
20338 * src/output.h (actions_output, guards_output)
20339 (token_definitions_output): Adjust prototypes.
20340 * src/scan-skel.l: Instead of scanning the skeletons, it now
20341 processes the output of m4: `__oline__' and `#output'.
20342 * data/bison.simple: Adjust to be used by M4(sugar).
20343 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
20344 to date.
20345 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
20346 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
20347 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
20348 shamelessly stolen from CVS Autoconf.
20349
beda758b
AD
203502002-02-05 Akim Demaille <akim@epita.fr>
20351
20352 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
20353 * configure.in: Check for the declarations of free and malloc.
20354 * src/muscle_tab.c: Adjust.
20355
5ece6d43
AD
203562002-02-05 Akim Demaille <akim@epita.fr>
20357
20358 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
20359 which have no values.
20360
5bb18f9a
AD
203612002-02-05 Akim Demaille <akim@epita.fr>
20362
20363 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
20364 * data/: here.
20365
894dd62e
PE
203662002-01-29 Paul Eggert <eggert@twinsun.com>
20367
20368 * src/bison.simple (YYSIZE_T): Do not define merely because
20369 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
20370 On some platforms, <alloca.h> does not declare YYSTD (size_t).
20371
82841af7
AD
203722002-01-27 Akim Demaille <akim@epita.fr>
20373
20374 Fix `%nonassoc and eof'.
20375
20376 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
20377 which were not properly copied! Replace
20378 memcpy (res->errs, src->errs, src->nerrs);
20379 with
20380 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
20381 !!!
20382 * tests/regression.at (%nonassoc and eof): Adjust to newest
20383 Autotest: `.' is not in the PATH.
20384
318b76e9
AD
203852002-01-27 Akim Demaille <akim@epita.fr>
20386
20387 * tests/sets.at (AT_EXTRACT_SETS): New.
20388 (Nullable): Use it.
20389 (Firsts): New.
20390
30d2f3d5
AD
203912002-01-26 Akim Demaille <akim@epita.fr>
20392
20393 * tests/actions.at, tests/calc.at, tests/headers.at,
20394 * tests/torture.at: Adjust to the newest Autotest which no longer
20395 forces `.' in the PATH.
20396
30f8c395
AD
203972002-01-25 Akim Demaille <akim@epita.fr>
20398
20399 * tests/regression.at (%nonassoc and eof): New.
20400 Suggested by Robert Anisko.
20401
29ae55f1
AD
204022002-01-24 Akim Demaille <akim@epita.fr>
20403
20404 Bison dumps core when trying to complain about broken input files.
20405 Reported by Cris van Pelt.
20406
20407 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
20408 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
20409 into...
20410 (Invalid inputs): Strengthen: exercise parse_percent_token.
20411
2b548aa6
RA
204122002-01-24 Robert Anisko <robert.anisko@epita.fr>
20413
20414 * src/Makefile.am: Add bison.c++.
20415 * src/bison.c++: New skeleton.
20416
bb0146c2
AD
204172002-01-21 Paolo Bonzini <bonzini@gnu.org>
20418
20419 * po/it.po: New.
20420
bec30531
AD
204212002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
20422
20423 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
20424
fc6edc45
MA
204252002-01-20 Marc Autret <marc@gnu.org>
20426
20427 * src/files.c (compute_output_file_names): Fix
20428
5e5d5415
MA
204292002-01-20 Marc Autret <marc@gnu.org>
20430
20431 * tests/output.at: New test.
20432 * src/files.c (compute_base_names): Don't map extensions when
20433 the YACC flag is set, use defaults.
20434 Reported by Evgeny Stambulchik.
20435
44ea3fbd
MA
204362002-01-20 Marc Autret <marc@gnu.org>
20437
ba0fe3c7
PE
20438 * src/system.h: Need to define __attribute__ away for non-GCC
20439 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
20440 Suggested by Albert Chin-A-Young.
20441
338963d1
TVH
204422002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
20443
20444 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
20445 canonical definition.
20446 * src/system.h: Use the canonical definition for PARAMS (avoids
20447 a conflict with the macro from lib/hash.h).
20448
c57b2479
AD
204492002-01-11 Akim Demaille <akim@epita.fr>
20450
20451 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 20452 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 20453
b85810ae
AD
204542002-01-09 Akim Demaille <akim@epita.fr>
20455
20456 * src/files.c, src/files.h (output_infix): New.
20457 (tab_extension): Remove.
20458 (compute_base_names): Compute the former, drop the latter.
20459 * src/output.c (prepare): Insert the muscles `output-infix', and
20460 `output-suffix'.
20461 * src/parse-skel.y (string, string.1): New.
20462 (section.header): Use it.
20463 (section.yacc): Remove.
20464 (prefix): Remove too.
20465 * src/scan-skel.l: Adjust.
20466 * src/bison.simple, src/bison.hairy: Adjust.
20467
cae60122
AD
204682002-01-09 Akim Demaille <akim@epita.fr>
20469
20470 * configure.in (WERROR_CFLAGS): Compute it.
20471 * src/Makefile.am (CFLAGS): Pass it.
20472 * tests/atlocal.in (CFLAGS): Idem.
20473 * src/files.c: Fix a few warnings.
20474 (get_extension_index): Remove, unused.
20475
ae404801
AD
204762002-01-08 Akim Demaille <akim@epita.fr>
20477
20478 * src/getargs.c (AS_FILE_NAME): New.
20479 (getargs): Use it to convert DOSish file names.
20480 * src/files.c (base_name): Rename as full_base_name to avoid
20481 clashes with `base_name ()'.
20482 (filename_split): New.
20483 (compute_base_names): N-th rewrite, using filename_split.
20484
22312b71
AD
204852002-01-08 Akim Demaille <akim@epita.fr>
20486
20487 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
20488 New, stolen from the Fileutils 4.1.
20489 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20490 * configure.in: Check for the presence of memrchr, and of its
20491 prototype.
20492
a67cef01
TVH
204932002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
20494
20495 * lib/hash.h (__P): Added definition for this macro.
20496 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
20497 BUILT_SOURCES, to ensure they are generated first.
20498 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
20499 %error-verbose to allow bootstrapping with bison 1.30x.
20500
2b25d624
AD
205012002-01-06 Akim Demaille <akim@epita.fr>
20502
20503 * src/reader.c (parse_braces): Don't fetch the next char, the
20504 convention is to fetch on entry.
20505 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
20506 'switch' without a following semicolon.
20507 * tests/regression.at (braces parsing): New.
20508
3460813b
AD
205092002-01-06 Akim Demaille <akim@epita.fr>
20510
20511 Bison is dead wrong in its RR conflict reports.
20512
20513 * tests/torture.at (GNU Cim Grammar): New.
20514 * src/conflicts.c (count_rr_conflicts): Fix.
20515
73784c64
AD
205162002-01-06 Akim Demaille <akim@epita.fr>
20517
20518 Creating package.m4 from configure.ac causes too many problems.
20519
20520 * tests/Makefile.am (package.m4): Create it by hand,
20521 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
20522
25d81090
AD
205232002-01-06 Akim Demaille <akim@epita.fr>
20524
20525 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
20526 skeleton.h.
20527
a9b8959e
PE
205282002-01-04 Paul Eggert <eggert@twinsun.com>
20529
20530 * doc/bison.texinfo (Debugging):
20531 Remove YYSTDERR; it's no longer defined or used.
20532 Also, s/cstdio.h/cstdio/.
20533
25d81090
AD
205342002-01-03 Akim Demaille <akim@epita.fr>
20535
20536 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
20537
1109455c
AD
205382002-01-03 Akim Demaille <akim@epita.fr>
20539
20540 * src/parse-skel.y (process_skeleton): Don't bind the parser's
20541 tracing code to --trace, wait for a better --trace option, with
20542 args.
20543
7ea5e977
AD
205442002-01-03 Akim Demaille <akim@epita.fr>
20545
20546 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
20547 The ISO C++ standard is extremely clear about it: stderr is
20548 considered a macro, not a regular symbol (see table 94 `Header
20549 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
20550 Therefore std:: does not apply to it. It still does with fprintf.
20551 Also, s/cstdio.h/cstdio/.
20552
fab5b110
AD
205532002-01-03 Akim Demaille <akim@epita.fr>
20554
20555 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
20556 for non system headers.
20557
aed7fd9b
AD
205582002-01-02 Akim Demaille <akim@epita.fr>
20559
20560 Equip the skeleton chain with location tracking, runtime trace,
20561 pure parser and scanner.
20562
20563 * src/parse-skel.y: Request a pure parser, locations, and prefix
20564 renaming.
20565 (%union): Having several members with the same type does not help
20566 type mismatches, simplify.
20567 (YYPRINT, yyprint): New.
20568 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
20569 (skel_error): this.
20570 Handle locations.
20571 * src/scan-skel.l: Adjust to these changes.
20572 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
20573 (LOCATION_PRINT, skel_control_t): New.
20574
24fad99e
AD
205752001-12-30 Akim Demaille <akim@epita.fr>
20576
20577 * src/parse-skel.y: Get rid of the shift/reduce conflict:
20578 replace `gb' with BLANKS.
20579 * src/scan-skel.l: Adjust.
20580
a4b36db4
AD
205812001-12-30 Akim Demaille <akim@epita.fr>
20582
20583 * src/system.h: We don't need nor want bcopy.
20584 Throw away MS-DOS crap: we don't need getpid.
20585 * configure.in: We don't need strndup. It was even causing
20586 problems: because Flex includes the headers *before* us,
20587 _GNU_SOURCE is not defined by config.h, and therefore strndup was
20588 not visible.
20589 * lib/xstrndup.c: New.
20590 * src/scan-skel.l: Use it.
20591 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
20592 * src/parse-skel.y: Use %directives instead of #defines.
20593
1239777d
AD
205942001-12-30 Akim Demaille <akim@epita.fr>
20595
20596 * src/skeleton.h: New.
20597 * src/output.c (output_parser, output_master_parser): Remove, dead
20598 code.
20599 * src/output.h (get_lines_number, actions_output, guards_output)
20600 (token_definitions_output): Prototype them.
20601 * src/parse-skel.y: Add the license notice.
20602 Include output.h and skeleton.h.
20603 (process_skeleton): Returns void, and takes a single parameter.
20604 * src/scan-skel.l: Add the license notice.
20605 Include skeleton.h.
20606 Don't use %option yylineno: it seems that then Flex imagines
20607 REJECT has been used, and therefore it won't reallocate its
20608 buffers (which makes no other sense to me than a bug). It results
20609 in warnings for `unused: yy_flex_realloc'.
20610
9b3add5b
RA
206112001-12-30 Robert Anisko <robert.anisko@epita.fr>
20612
20613 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20614 (MUSCLE_INSERT_PREFIX): ...to there.
20615 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20616 (MUSCLE_INSERT_PREFIX): Move from here...
20617
20618 * src/bison.hairy: Add a section directive. Put braces around muscle
20619 names. This parser skeleton is still broken, but Bison should not
20620 choke on a bad muscle 'syntax'.
20621 * src/bison.simple: Add a section directive. Put braces around muscle
20622 names.
20623
20624 * src/files.h (strsuffix, stringappend): Add declarations.
20625 (tab_extension): Add declaration.
20626 (short_base_name): Add declaration.
20627
20628 * src/files.c (strsuffix, stringappend): No longer static. These
20629 functions are used in the skeleton parser.
20630 (tab_extension): New.
20631 (compute_base_names): Use the computations done in this function
fab5b110 20632 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
20633 names.
20634 (short_base_name): No longer static.
20635
20636 * src/output.c (output_skeleton): New.
20637 (output): Disable call to output_master_parser, and give a try to
20638 a new skeleton handling system.
20639 (guards_output, actions_output): No longer static.
20640 (token_definitions_output, get_lines_number): No longer static.
20641
20642 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
20643
fab5b110 20644 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
20645 parse-skel.y.
20646
20647 * src/parse-skel.y: New file.
20648 * src/scan-skel.l: New file.
20649
b5b61c61
AD
206502001-12-29 Akim Demaille <akim@epita.fr>
20651
20652 %name-prefix is broken.
20653
20654 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
20655 Adjust all dependencies.
20656 * tests/headers.at (export YYLTYPE): Strengthen this test: use
20657 %name-prefix.
20658
20659 Renaming yylval but not yylloc is not consistent. Now we do.
20660
20661 * src/bison.simple: Prefix yylloc if used.
20662 * doc/bison.texinfo (Decl Summary): Document that.
20663
8c9a50be
AD
206642001-12-29 Akim Demaille <akim@epita.fr>
20665
20666 * doc/bison.texinfo: Promote `%long-directive' over
20667 `%long_directive'.
20668 Remove all references to fixed-output-files, yacc is enough.
20669
d99361e6
AD
206702001-12-29 Akim Demaille <akim@epita.fr>
20671
20672 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
20673 user prologue. These are defaults.
20674 * tests/actions.at (Mid-rule actions): Make sure the user can
20675 define YYDEBUG and YYERROR_VERBOSE.
20676
b9cecb91
AD
206772001-12-29 Akim Demaille <akim@epita.fr>
20678
20679 * src/output.c (header_output): Don't forget to export YYLTYPE and
20680 yylloc.
20681 * tests/headers.at (export YYLTYPE): New, make sure it does.
20682 * tests/regression.at (%union and --defines, Invalid CPP headers):
20683 Move to...
20684 * tests/headers.at: here.
20685
aea13e97
AD
206862001-12-29 Akim Demaille <akim@epita.fr>
20687
20688 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
20689
931394cb
AD
206902001-12-29 Akim Demaille <akim@epita.fr>
20691
20692 * tests/actions.at (Mid-rule actions): Output on a single line
20693 instead of several.
20694
704a47c4
AD
206952001-12-29 Akim Demaille <akim@epita.fr>
20696
20697 * doc/bison.texinfo: Formatting changes.
20698
091e20bb
AD
206992001-12-29 Akim Demaille <akim@epita.fr>
20700
20701 Don't store the token defs in a muscle, just be ready to output it
20702 on command. Now possible via `symbols'. Fixes a memory leak.
20703
20704 * src/output.c (token_definitions_output): New.
20705 (output_parser, header_output): Use it.
20706 * src/reader.c (symbols_save): Remove.
20707
cce71710
AD
207082001-12-29 Akim Demaille <akim@epita.fr>
20709
20710 * src/bison.simple: Do not provide a default for YYSTYPE and
20711 YYLTYPE before the user's prologue. Otherwise it's hardly... a
20712 default.
20713
82c035a8
AD
207142001-12-29 Akim Demaille <akim@epita.fr>
20715
20716 Mid-rule actions are simply... ignored!
20717
20718 * src/reader.c (readgram): Be sure to attach mid-rule actions to
20719 the empty-rule associated to the dummy symbol, not to the host
20720 rule.
20721 * tests/actions.at (Mid-rule actions): New.
20722
8419d367
AD
207232001-12-29 Akim Demaille <akim@epita.fr>
20724
20725 Memory leak.
20726
20727 * src/reader.c (reader): Free grammar.
20728
375d5806
AD
207292001-12-29 Akim Demaille <akim@epita.fr>
20730
20731 Memory leak.
20732
20733 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
20734 since it allocates it for each state, although only one is needed.
20735 (allocate_storage): Do it here.
20736
f51cb8ff
AD
207372001-12-29 Akim Demaille <akim@epita.fr>
20738
20739 * src/options.h, src/options.c (create_long_option_table): Rename
20740 as...
20741 (long_option_table_new): this, with a clearer prototype.
20742 (percent_table): Remove, unused,
20743 * src/getargs.c (getargs): Adjust.
20744
29e88316
AD
207452001-12-29 Akim Demaille <akim@epita.fr>
20746
20747 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
20748 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
20749 as states.
20750
b9f71f19
AD
207512001-12-29 Akim Demaille <akim@epita.fr>
20752
20753 * src/lalr.c (build_relations): Rename `states' as `states1'.
20754 Sorry, I don't understand exactly what it is, no better name...
20755
1a2b5d37
AD
207562001-12-29 Akim Demaille <akim@epita.fr>
20757
20758 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
20759 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
20760 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
20761 as rules.
20762
1cca533e
AD
207632001-12-29 Akim Demaille <akim@epita.fr>
20764
20765 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
20766 ago.
20767
c03ae966
AD
207682001-12-29 Akim Demaille <akim@epita.fr>
20769
20770 * src/reader.c, src/reader.h (user_toknums): Remove.
20771 Adjust all users to use symbols[i]->user_token_number.
20772
5a670b1e
AD
207732001-12-29 Akim Demaille <akim@epita.fr>
20774
20775 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
20776 Adjust all users to use symbols[i]->prec or ->assoc.
20777
ad949da9
AD
207782001-12-29 Akim Demaille <akim@epita.fr>
20779
20780 * src/reader.c, src/reader.h (tags): Remove.
20781 Adjust all users to use symbols[i]->tag.
20782
0e78e603
AD
207832001-12-29 Akim Demaille <akim@epita.fr>
20784
20785 * src/gram.h, src/gram.c (symbols): New, similar to state_table
20786 and rule_table.
20787 * src/reader.c (packsymbols): Fill this table.
20788 Drop sprec.
20789 * src/conflicts.c (resolve_sr_conflict): Adjust.
20790 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
20791 single table.
20792 Use symbols[i]->tag instead of tags[i].
20793
213e640e
AD
207942001-12-29 Akim Demaille <akim@epita.fr>
20795
20796 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
20797 In addition, put a comment in there, to replace...
20798 * tests/regression.at (%union and C comments): Remove.
20799
e7b8bef1
AD
208002001-12-29 Akim Demaille <akim@epita.fr>
20801
20802 * tests/regression.at (Web2c Actions): Blindly move the actual
20803 output as expected output. The contents *seem* right to me, but I
20804 can't pretend reading perfectly parser tables... Nonetheless, all
20805 the other tests pass correctly, the table look OK, even though the
20806 presence of `$axiom' is to be noted: AFAICS it is useless (but
20807 harmless).
20808
b68e7744
AD
208092001-12-29 Akim Demaille <akim@epita.fr>
20810
20811 * src/reader.c (readgram): Don't add the rule 0 if there were no
20812 rules read. In other words, add it _after_ having performed
20813 grammar sanity checks.
20814 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
20815
78d5bae9
AD
208162001-12-29 Akim Demaille <akim@epita.fr>
20817
20818 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
20819 visible, and some states have now a different number.
20820
ff442794
AD
208212001-12-29 Akim Demaille <akim@epita.fr>
20822
20823 * src/reader.c (readgram): Bind the initial rule's lineno to that
20824 of the first rule.
20825 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20826 (Solved SR Conflicts): Adjust rule 0's line number.
20827
610ab194
AD
208282001-12-29 Akim Demaille <akim@epita.fr>
20829
20830 Fix the `GAWK Grammar' failure.
20831
20832 * src/LR0.c (final_state): Initialize to -1 so that we do compute
20833 the reductions of the first state which was mistakenly confused
20834 with the final state because precisely final_state was initialized
20835 to 0.
20836 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
20837 now noticed by Bison.
20838 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
20839 have a reduction on $default.
20840
29d29c8f
AD
208412001-12-29 Akim Demaille <akim@epita.fr>
20842
20843 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
20844 rule line numbers.
20845 * src/closure.c (print_closure): Likewise.
20846 * src/derives.c (print_derives): Likewise.
20847 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
20848 now.
20849
7c6b64d0
AD
208502001-12-29 Akim Demaille <akim@epita.fr>
20851
20852 * src/lalr.c (lookaheads_print): New.
20853 (lalr): Call it when --trace-flag.
20854 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
20855 are dumped.
20856
3d4daee3
AD
208572001-12-29 Akim Demaille <akim@epita.fr>
20858
20859 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
20860 when walking through ritem, even via rule->rhs.
20861 * src/reduce.c (dump_grammar, useful_production, reduce_output)
20862 (useful_production, useless_nonterminals): Likewise.
20863 (reduce_grammar_tables): Likewise, plus update nritems.
20864 * src/nullable.c (set_nullable): Likewise.
20865 * src/lalr.c (build_relations): Likewise.
20866 * tests/sets.at (Nullable): Adjust.
20867 Fortunately, now, the $axiom is no longer nullable.
20868
9e7f6bbd
AD
208692001-12-29 Akim Demaille <akim@epita.fr>
20870
20871 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
20872 the 0-sentinel.
20873 * src/gram.c (ritem_longest_rhs): Likewise.
20874 * src/reduce.c (nonterminals_reduce): Likewise.
20875 * src/print_graph.c (print_graph): Likewise.
20876 * src/output.c (output_rule_data): Likewise.
20877 * src/nullable.c (set_nullable): Likewise.
20878
255ef638
AD
208792001-12-29 Akim Demaille <akim@epita.fr>
20880
20881 * src/output.c: Comment changes.
20882
0d8a7363
AD
208832001-12-27 Paul Eggert <eggert@twinsun.com>
20884
20885 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
20886 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
20887 Sparc, as they were causing more porting problems than the
20888 (minor) performance improvement was worth.
20889
20890 Also, catch up with 1.31's YYSTD.
20891
3db472b9
AD
208922001-12-27 Akim Demaille <akim@epita.fr>
20893
20894 * src/output.c (output_gram): Rely on nritems, not the
20895 0-sentinel. See below.
20896 Use -1 as separator, not 0.
20897 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
20898 Rely on -1 as separator in yyrhs, instead of 0.
20899 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
20900 twice `Now at end of input', therefore there are two lines less to
20901 expect.
20902
b365aa05
AD
209032001-12-27 Akim Demaille <akim@epita.fr>
20904
20905 * tests/regression.at (Unresolved SR Conflicts):
20906 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
20907 below.
20908
30171f79
AD
209092001-12-27 Akim Demaille <akim@epita.fr>
20910
20911 * src/LR0.c (new_state): Recognize the final state by the fact it
20912 is reached by eoftoken.
20913 (insert_start_shifting_state, insert_eof_shifting_state)
20914 (insert_accepting_state, augment_automaton): Remove, since now
20915 these states are automatically computed from the initial state.
20916 (generate_states): Adjust.
20917 * src/print.c: When reporting a rule number to the user, substract
20918 1, so that the axiom rule is rule 0, and the first user rule is 1.
20919 * src/reduce.c: Likewise.
20920 * src/print_graph.c (print_core): For the time being, just as for
20921 the report, depend upon --trace-flags to dump the full set of
20922 items.
20923 * src/reader.c (readgram): Once the grammar read, insert the rule
20924 0: `$axiom: START-SYMBOL $'.
20925 * tests/set.at: Adjust: rule 0 is now displayed, and since the
20926 number of the states has changed (the final state is no longer
20927 necessarily the last), catch up.
20928
75142d45
AD
209292001-12-27 Akim Demaille <akim@epita.fr>
20930
20931 Try to make the use of the eoftoken valid. Given that its value
20932 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
20933 is used instead of > 0 where appropriate, (ii), depend upon nritems
20934 instead of the 0-sentinel.
20935
20936 * src/gram.h, src/gram.c (nritems): New.
20937 Expected to be duplication of nitems, but for the time being...
20938 * src/reader.c (packgram): Assert nritems and nitems are equal.
20939 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
20940 * src/closure.c (print_closure, print_fderives): Likewise.
20941 * src/gram.c (ritem_print): Likewise.
20942 * src/print.c (print_core, print_grammar): Likewise.
20943 * src/print_graph.c: Likewise.
20944
b7c49edf
AD
209452001-12-27 Akim Demaille <akim@epita.fr>
20946
20947 * src/main.c (main): If there are complains after grammar
20948 reductions, then output the report anyway if requested, then die.
20949 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
20950 * src/reader.c (eoftoken): New.
20951 (parse_token_decl): If the token being defined has value `0', it
20952 is the eoftoken.
20953 (packsymbols): No longer hack `tags' to insert `$' by hand.
20954 Be sure to preserve the value of the eoftoken.
20955 (reader): Make sure eoftoken is defined.
20956 Initialize nsyms to 0: now eoftoken is created just like the others.
20957 * src/print.c (print_grammar): Don't special case the eof token.
20958 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
20959 lie anyway, albeit pleasant.
20960 * tests/calc.at: Exercise error messages with eoftoken.
20961 Change the grammar so that empty input is invalid.
20962 Adjust expectations.
20963 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
20964
ec2da99f
AD
209652001-12-27 Akim Demaille <akim@epita.fr>
20966
20967 * configure.in: Check the protos of strchr ans strspn.
20968 Replace strchr if needed.
20969 * src/system.h: Provide the protos of strchr, strspn and memchr if
20970 missing.
20971 * lib/strchr.c: New.
20972 * src/reader.c (symbols_save): Use strchr.
20973
8adfa272
AD
209742001-12-27 Akim Demaille <akim@epita.fr>
20975
20976 * src/print.c, src/print_graph.c (escape): New.
20977 Use it to quote the TAGS outputs.
20978 * src/print_graph.c (print_state): Now errors are in red, and
20979 reductions in green.
20980 Prefer high to wide: output the state number on a line of its own.
20981
80dac38c
AD
209822001-12-27 Akim Demaille <akim@epita.fr>
20983
20984 * src/state.h, src/state.c (reductions_new): New.
20985 * src/LR0.c (set_state_table): Let all the states have a
20986 `reductions', even if reduced to 0.
20987 (save_reductions): Adjust.
20988 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
20989 * src/print.c (print_reductions, print_actions): Adjust.
20990 * src/output.c (action_row): Adjust.
20991
2cec70b9
AD
209922001-12-27 Akim Demaille <akim@epita.fr>
20993
20994 * src/state.h, src/state.c (errs_new, errs_dup): New.
20995 * src/LR0.c (set_state_table): Let all the states have an errs,
20996 even if reduced to 0.
20997 * src/print.c (print_errs, print_reductions): Adjust.
20998 * src/output.c (output_actions, action_row): Adjust.
20999 * src/conflicts.c (resolve_sr_conflict): Adjust.
21000
13ca549a
AD
210012001-12-27 Akim Demaille <akim@epita.fr>
21002
21003 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
21004
5092aba5
AD
210052001-12-27 Akim Demaille <akim@epita.fr>
21006
21007 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
21008 * src/print.c: here.
21009 (lookaheadset, shiftset): New, used as additional storage by
21010 print_reductions.
21011 (print_results): Adjust.
21012 (print_shifts, print_gotos, print_errs): New, extracted from...
21013 (print_actions): here.
21014 * src/print_graph.c (print_actions): Remove dead code.
21015
11e2beca
AD
210162001-12-27 Akim Demaille <akim@epita.fr>
21017
21018 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
21019 `$n' and `@n'.
21020
dac3c910
AD
210212001-12-27 Akim Demaille <akim@epita.fr>
21022
21023 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
21024 (build_relations): Adjust.
21025
d0b0fefa
AD
210262001-12-27 Akim Demaille <akim@epita.fr>
21027
21028 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
21029 duplication.
21030
adc8c848
AD
210312001-12-27 Akim Demaille <akim@epita.fr>
21032
21033 * src/reader.c (packgram): Catch nitems overflows.
21034
14d293ac
AD
210352001-12-27 Akim Demaille <akim@epita.fr>
21036
21037 * src/files.c, src/files.h (guard_obstack): Remove.
21038 * src/output.c (output): Adjust.
21039 * src/reader.c (parse_braces): New, factoring...
21040 (copy_action, copy_guard): these two which are renamed as...
21041 (parse_action, parse_guard): these.
21042 As a voluntary consequence, using braces around guards is now
21043 mandatory.
21044
f499b062
AD
210452001-12-27 Akim Demaille <akim@epita.fr>
21046
21047 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
21048 * src/reader.c (symbol_list): `guard' and `guard_line' are new
21049 members.
21050 (symbol_list_new): Adjust.
21051 (copy_action): action_line is the first line, not the last.
21052 (copy_guard): Just as for actions, store the `action' only, not
21053 the switch/case/break flesh.
21054 Don't parse the user action that might follow the guard, let...
21055 (readgram): do it, i.e., now, there can be an action after a
21056 guard.
21057 In other words the guard is just explicitly optional.
21058 (packgram): Adjust.
21059 * src/output.c (guards_output): New.
21060 (output_parser): Call it when needed.
21061 (output): Also free the guard and attrs obstacks.
21062 * src/files.c, src/files.h (obstack_save): Remove.
21063 (output_files): Remove.
21064 As a result, if one needs the former `.act' file, using an
21065 appropriate skeleton which requires actions and guards is now
21066 required.
21067 * src/main.c (main): Adjust.
21068 * tests/semantic.at: New.
21069 * tests/regression.at: Use `input.y' as input file name.
21070 Avoid 8+3 problems by requiring input.c when the test needs the
21071 parser.
21072
d945f5cd
AD
210732001-12-27 Akim Demaille <akim@epita.fr>
21074
21075 * src/reader.c (symbol_list_new): Be sure to initialize all the
21076 fields.
21077
d200e455
AD
210782001-12-27 Akim Demaille <akim@epita.fr>
21079
21080 All the hacks using a final pseudo state are now useless.
21081
21082 * src/LR0.c (set_state_table): state_table holds exactly nstates.
21083 * src/lalr.c (nLA): New.
21084 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
21085 instead of lookaheadsp from the pseudo state (nstate + 1).
21086
f9507c28
AD
210872001-12-27 Akim Demaille <akim@epita.fr>
21088
21089 * src/output.c (action_row, token_actions): Use a state_t instead
21090 of a integer, and nlookaheads instead of the following state's
21091 lookaheadsp.
21092
065fbd27
AD
210932001-12-27 Akim Demaille <akim@epita.fr>
21094
21095 * src/conflicts.c (log_resolution, flush_shift)
21096 (resolve_sr_conflict, set_conflicts, solve_conflicts)
21097 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
21098 (conflicts_print, print_reductions): Use a state_t instead of an
21099 integer when referring to a state.
21100 As much as possible, depend upon nlookaheads, instead of the
21101 `lookaheadsp' member of the following state (since lookaheads of
21102 successive states are successive, the difference between state n + 1
21103 and n served as the number of lookaheads for state n).
21104 * src/lalr.c (add_lookback_edge): Likewise.
21105 * src/print.c (print_core, print_actions, print_state)
21106 (print_results): Likewise.
21107 * src/print_graph.c (print_core, print_actions, print_state)
21108 (print_graph): Likewise.
21109 * src/conflicts.h: Adjust.
21110
1b177bd7
AD
211112001-12-27 Akim Demaille <akim@epita.fr>
21112
21113 * src/bison.hairy: Formatting/comment changes.
21114 ANSIfy.
21115 Remove `register' indications.
21116 Add plenty of `static'.
21117
7742ddeb
AD
211182001-12-27 Akim Demaille <akim@epita.fr>
21119
21120 * src/output.c (prepare): Drop the muscle `ntbase' which
21121 duplicates ntokens.
21122 * src/bison.simple: Formatting/comment changes.
21123 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
21124 is an undocumented synonym.
21125
1fa14068
AD
211262001-12-22 Akim Demaille <akim@epita.fr>
21127
21128 * src/output.c (output_table_data): Change the prototype to use
21129 `int' for array ranges: some invocations do pass an int, not a
21130 short.
21131 Reported by Wayne Green.
21132
b9752825
AD
211332001-12-22 Akim Demaille <akim@epita.fr>
21134
21135 Some actions of web2c.y are improperly triggered.
21136 Reported by Mike Castle.
21137
21138 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
21139 * tests/regression.at (Web2c): Rename as...
21140 (Web2c Report): this.
21141 (Web2c Actions): New.
21142
776209d6
AD
211432001-12-22 Akim Demaille <akim@epita.fr>
21144
21145 Reductions in web2c.y are improperly reported.
21146 Reported by Mike Castle.
21147
21148 * src/conflicts.c (print_reductions): Fix.
21149 * tests/regression.at (Web2c): New.
21150
275fc3ad
AD
211512001-12-18 Akim Demaille <akim@epita.fr>
21152
21153 Some host fail on `assert (!"foo")', which expands to
21154 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
21155 Reported by Nelson Beebee.
21156
21157 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
21158 `#define it_succeeded 0' and `assert (it_succeeded)'.
21159
897668ee
MA
211602001-12-17 Marc Autret <autret_m@epita.fr>
21161
21162 * src/bison.simple: Don't hard code the skeleton line and filename.
21163 * src/output.c (output_parser): Rename 'line' as 'output_line'.
21164 New line counter 'skeleton_line' (skeleton-line muscle).
21165
ab3399e0
PE
211662001-12-17 Paul Eggert <eggert@twinsun.com>
21167
21168 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
21169 YYDEBUG must be defined to a nonzero value.
21170
21171 * src/bison.simple (yytname): Do not assume that the user defines
21172 YYDEBUG to a properly parenthesized expression.
21173
3877f72b
AD
211742001-12-17 Akim Demaille <akim@epita.fr>
21175
21176 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
21177 nlookaheads is a new member.
21178 Adjust all users.
21179 * src/lalr.h (nlookaheads): Remove this orphan declaration.
21180 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
21181 state.
776209d6 21182
331dbc1b
AD
211832001-12-17 Akim Demaille <akim@epita.fr>
21184
21185 * src/files.h, src/files.c (open_files, close_files): Remove.
21186 * src/main.c (main): Don't open/close files, nor invoke lex_free,
21187 let...
21188 * src/reader.c (reader): Do it.
776209d6 21189
be750e4c
AD
211902001-12-17 Akim Demaille <akim@epita.fr>
21191
21192 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 21193
709ae8c6
AD
211942001-12-17 Akim Demaille <akim@epita.fr>
21195
21196 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
21197 (flush_reduce): New.
21198 (resolve_sr_conflict): Adjust.
776209d6 21199
f87685c3
AD
212002001-12-17 Akim Demaille <akim@epita.fr>
21201
21202 * src/output.c (output_obstack): Be static and rename as...
21203 (format_obstack): this, to avoid any confusion with files.c's
21204 output_obstack.
21205 * src/reader.h (muscle_obstack): Move to...
21206 * src/output.h: here, since it's defined in output.c.
21207
837491d8
AD
212082001-12-17 Akim Demaille <akim@epita.fr>
21209
21210 * src/output.c (action_row, save_column, default_goto)
21211 (sort_actions, matching_state, pack_vector): Better variable
21212 locality.
21213
796d61fb
AD
212142001-12-17 Akim Demaille <akim@epita.fr>
21215
21216 * src/output.c: Various formatting changes.
776209d6 21217
64d15509
AD
212182001-12-17 Akim Demaille <akim@epita.fr>
21219
21220 * src/files.c (output_files): Free the output_obstack.
21221 * src/main.c (main): Call print and print_graph conditionally.
21222 * src/print.c (print): Work unconditionally.
21223 * src/print_graph.c (print_graph): Work unconditionally.
21224 * src/conflicts.c (log_resolution): Output only if verbose_flag.
21225
fbc8ecb7
MA
212262001-12-16 Marc Autret <autret_m@epita.fr>
21227
21228 * src/output.c (actions_output): Fix. When we use %no-lines,
21229 there is one less line per action.
21230
f0440388
MA
212312001-12-16 Marc Autret <autret_m@epita.fr>
21232
21233 * src/bison.simple: Remove a useless #line directive.
21234 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
21235 * src/output.c (get_lines_number): New.
776209d6 21236 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
21237 output muscles.
21238 Fix line numbering.
21239 (actions_output): Computes the number of lines taken by actions.
21240 (output_master_parser): Insert new skeleton which is the name of
21241 the output parser file name.
21242
a79986b8
MA
212432001-12-15 Marc Autret <autret_m@epita.fr>
21244
21245 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
21246
4ec8e00f
MA
212472001-12-15 Marc Autret <autret_m@epita.fr>
21248
21249 * src/output.c (output_gram): Keep track of the hairy one.
21250
1a4648ff
AD
212512001-12-15 Akim Demaille <akim@epita.fr>
21252
21253 Make `make distcheck' work.
21254
21255 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
21256 system.h which uses libgettext.h.
21257
9c2c67e6
AD
212582001-12-15 Akim Demaille <akim@epita.fr>
21259
21260 * src/nullable.c (set_nullable): Useless rules must be skipped,
21261 otherwise, since we range over their symbols, we might look at a
21262 nonterminal which no longer ``exists'', i.e., it is not counted in
21263 `nvars', hence we overflow our arrays.
21264
93ede233
AD
212652001-12-15 Akim Demaille <akim@epita.fr>
21266
21267 The header can also be produced directly, without any obstack!
21268 Yahoo!
21269
21270 * src/files.c, src/files.h (defines_obstack): Remove.
21271 (compute_header_macro): Global.
21272 (defines_obstack_save): Remove.
21273 * src/reader.c (parse_union_decl): No longer output to
21274 defines_obstack: its content can be found in the `stype' muscle
21275 anyway.
21276 (output_token_translations): Merge into...
21277 (symbols_output): this.
21278 Rename as...
21279 (symbols_save): this.
21280 (reader): Adjust.
21281 * src/output.c (header_output): New.
21282 (output): Call it.
21283
2666f928
AD
212842001-12-15 Akim Demaille <akim@epita.fr>
21285
21286 * src/reader.c (parse_union_decl): Instead of handling two obstack
21287 simultaneously, use one to define the `stype' muscle, and use the
21288 value of the latter to fill defines_obstack.
21289 (copy_comment): Remove.
21290 (copy_comment2): Work for a single obstack.
21291 Rename as...
21292 (copy_comment): this.
21293
428046f8
AD
212942001-12-15 Akim Demaille <akim@epita.fr>
21295
21296 * src/lex.c, src/lex.h (xgetc): No longer static.
21297 * src/reader.c (parse_union_decl): Revamp.
21298
ea52d706
AD
212992001-12-15 Akim Demaille <akim@epita.fr>
21300
21301 Still making progress in separating Bison into (i) input, (ii)
21302 process, (iii) output: now we can directly output the parser file
21303 without using table_obstack at all.
21304
21305 * src/files.c, src/files.h (table_obstack): Bye bye.
21306 (parser_file_name): New.
21307 * src/files.c (compute_output_file_names): Compute it.
21308 * src/output.c (actions_output, output_parser)
21309 (output_master_parser): To a file instead of an obstack.
21310
3f96f4dc
AD
213112001-12-15 Akim Demaille <akim@epita.fr>
21312
21313 Attach actions to rules, instead of pre-outputting them to
21314 actions_obstack.
21315
21316 * src/gram.h (rule_t): action and action_line are new members.
21317 * src/reader.c (symbol_list): Likewise.
21318 (copy_action): Save the actions within the rule.
21319 (packgram): Save them in rule_table.
21320 * src/output.c (actions_output): New.
21321 (output_parser): Use it on `%%actions'.
21322 (output_rule_data): Don't free rule_table.
21323 (output): Do it.
21324 (prepare): Don't save the `action' muscle.
21325 * src/bison.simple: s/%%action/%%actions/.
21326
51576fb3
AD
213272001-12-15 Akim Demaille <akim@epita.fr>
21328
21329 * src/reader.c (copy_action): When --yacc, don't append a `;'
21330 to the user action: let it fail if lacking.
dee049eb 21331 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 21332
2648a72d
AD
213332001-12-14 Akim Demaille <akim@epita.fr>
21334
21335 * src/lex.c (literalchar): Simply return the char you decoded, non
21336 longer mess around with obstacks and int pointers.
21337 Adjust all callers.
21338
92790e5b
AD
213392001-12-14 Akim Demaille <akim@epita.fr>
21340
21341 * src/lex.c (literalchar): Don't escape the special characters,
21342 just decode them, and keep them as char (before, eol was output as
21343 the 2 char string `\n' etc.).
21344 * src/output.c (output_rule_data): Use quotearg to output the
21345 token strings.
21346
927c1557
PE
213472001-12-13 Paul Eggert <eggert@twinsun.com>
21348
21349 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
21350 Do not infringe on the global user namespace when using C++.
21351 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
21352 All uses of `fprintf' and `stderr' changed.
21353
21354 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
21355
ed8e1f68
AD
213562001-12-13 Akim Demaille <akim@epita.fr>
21357
21358 The computation of nullable is broken: it doesn't handle empty
21359 RHS's properly.
21360
21361 * tests/torture.at (GNU AWK Grammar): New.
21362 * tests/sets.at (Nullable): New.
21363 * src/nullable.c (set_nullable): Instead of blindly looping over
21364 `ritems', loop over the rules, and then over their rhs's.
21365
21366 Work around Autotest bugs.
21367
21368 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
21369 frame, because Autotest understand lines starting with a `+' as
21370 traces from the shell. Then, they are not processed properly.
21371 Admittedly an Autotest bug, but we don't have time to wait for
21372 Autotest to catch up.
21373 * tests/regression.at (Broken Closure): Adjust to the new table
21374 frames.
21375 Move to...
21376 * tests/sets.at: here.
21377
cb581495
AD
213782001-12-13 Akim Demaille <akim@epita.fr>
21379
21380 * src/closure.c (closure): Use nrules instead of playing tricks
21381 with BITS_PER_WORD.
21382
2e729273
AD
213832001-12-13 Akim Demaille <akim@epita.fr>
21384
21385 * src/print.c (print_actions): Output the handling of `$' as the
21386 traces do: shifting the token EOF. Before EOF was treated as a
21387 nonterminal.
21388 * tests/regression.at: Adjust some tests.
21389 * src/print_graph.c (print_core): Complete the set of items via
21390 closure. The next-to-final and final states are still unsatisfying,
21391 but that's to be addressed elsewhere.
21392 No longer output the rule numbers, but do output the state number.
21393 A single loop for the shifts + gotos is enough, but picked a
21394 distinct color for each.
21395 (print_graph): Initialize and finalize closure.
21396
107f7dfb
AD
213972001-12-13 Akim Demaille <akim@epita.fr>
21398
21399 * src/reader.c (readgram): Remove dead code, an strip useless
21400 braces.
21401 (get_type): Remove, unused.
21402
9b53a24f
AD
214032001-12-12 Akim Demaille <akim@epita.fr>
21404
21405 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
21406 on that of lib/error.c.
21407
dbfb6dcd
AD
214082001-12-12 Akim Demaille <akim@epita.fr>
21409
21410 Some hosts don't like `/' in includes.
21411
21412 * src/system.h: Include libgettext.h without qualifying the path.
21413 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
21414 $(top_srcdir).
21415
c25fb648
MA
214162001-12-11 Marc Autret <autret_m@epita.fr>
21417
21418 * src/output.c (output_parser): Remove useless muscle.
21419
710ddc4f
MA
214202001-12-11 Marc Autret <autret_m@epita.fr>
21421
21422 * src/bison.simple: Remove #line just before %%epilogue. It
21423 is now handled in ...
21424 * src/reader.c (read_additionnal_code): Add the output of a
21425 #line for the epilogue.
21426
e83d80b8
MA
214272001-12-10 Marc Autret <autret_m@epita.fr>
21428
927c1557 21429 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
21430 replace precedent remove.
21431 * src/bison.simple: Remove #line before %%prologue because
21432 %%input-line is wrong at this time.
21433
971d5158
MA
214342001-12-10 Marc Autret <autret_m@epita.fr>
21435
21436 * src/reader.c (symbols_output): Clean up.
927c1557 21437 * src/output.c (output_gram, output): Clean up.
971d5158 21438
5edafffd
AD
214392001-12-10 Akim Demaille <akim@epita.fr>
21440
21441 * src/lalr.c (initialize_lookaheads): New. Extracted from...
21442 * src/LR0.c (set_state_table): here.
21443 * src/lalr.c (lalr): Call it.
21444
0279f8e9
AD
214452001-12-10 Akim Demaille <akim@epita.fr>
21446
21447 * src/state.h (shifts): Remove the `number' member: shifts are
21448 attached to state, hence no longer need to be labelled with a
21449 state number.
21450
190c4f5f
AD
214512001-12-10 Akim Demaille <akim@epita.fr>
21452
21453 Now that states have a complete set of members, the linked list of
21454 shifts is useless: just fill directly the state's shifts member.
21455
21456 * src/state.h (shifts): Remove the `next' member.
21457 * src/LR0.c (first_state, last_state): Remove.
21458 Adjust the callers.
21459 (augment_automaton): Don't look for the shifts that must be added
21460 a shift on EOF: it is those of the state we looked for! But now,
21461 since shifts are attached, it is no longer needed to looking
21462 merely by its id: its number.
21463
2a73b93d
AD
214642001-12-10 Akim Demaille <akim@epita.fr>
21465
21466 * src/LR0.c (augment_automaton): Better variable locality.
21467 Remove an impossible branch: if there is a state corresponding to
21468 the start symbol being shifted, then there is shift for the start
21469 symbol from the initial state.
21470
74392f6a
AD
214712001-12-10 Akim Demaille <akim@epita.fr>
21472
21473 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
21474 only when appropriate: when insert_start_shifting_state' is not
21475 invoked.
21476 * tests/regression.at (Rule Line Numbers): Adjust.
21477
37c82725
AD
214782001-12-10 Akim Demaille <akim@epita.fr>
21479
21480 * src/LR0.c (augment_automaton): Now that all states have shifts,
21481 merge the two cases addition shifts to the initial state.
21482
6a164e0c
AD
214832001-12-10 Akim Demaille <akim@epita.fr>
21484
21485 * src/lalr.c (set_state_table): Move to...
21486 * src/LR0.c: here.
21487 * src/lalr.c (lalr): Don't call it...
21488 * src/LR0.c (generate_states): do it.
21489 * src/LR0.h (first_state): Remove, only the table is used.
21490
7215de24
AD
214912001-12-10 Akim Demaille <akim@epita.fr>
21492
21493 * src/LR0.h (first_shift, first_reduction): Remove.
21494 * src/lalr.c: Don't use first_shift: find shifts through the
21495 states.
21496
80e25d4d
AD
214972001-12-10 Akim Demaille <akim@epita.fr>
21498
21499 * src/LR0.c: Attach shifts to states as soon as they are
21500 computed.
21501 * src/lalr.c (set_state_table): Instead of assigning shifts to
21502 state, just assert that the mapping was properly done.
21503
0ab3728b
AD
215042001-12-10 Akim Demaille <akim@epita.fr>
21505
21506 * src/LR0.c (insert_start_shift): Rename as...
21507 (insert_start_shifting_state): this.
21508 (insert_eof_shifting_state, insert_accepting_state): New.
21509 (augment_automaton): Adjust.
21510 Better locality of the variables.
21511 When looking if the start_symbol is shifted from the initial
21512 state, using `while (... symbol != start_symbol ...)' sounds
21513 better than `while (... symbol < start_symbol ...)': If fail
21514 to see how the order between symbols could be relevant!
21515
78af9bbc
AD
215162001-12-10 Akim Demaille <akim@epita.fr>
21517
21518 * src/getargs.h: Don't declare `spec_name_prefix' and
21519 `spec_file_prefix', declared by src/files.h.
21520 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
21521 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
21522 * src/output.c (prepare): Adjust.
21523 * src/reader.c (symbols_output): Likewise.
21524 * src/vmsgetargs.c: Vaguely adjust, but who cares?
21525
bdef2a41
AD
215262001-12-10 Akim Demaille <akim@epita.fr>
21527
21528 * src/muscle_tab.c (muscle_init): NULL is a better default than
21529 `"0"'.
21530
3735969c
AD
215312001-12-10 Akim Demaille <akim@epita.fr>
21532
21533 * src/reader.c (reader): Calling symbols_output once is enough.
21534
49701457
AD
215352001-12-10 Akim Demaille <akim@epita.fr>
21536
21537 Now that states have a complete set of members, the linked list of
21538 reductions is useless: just fill directly the state's reductions
21539 member.
21540
21541 * src/state.h (struct reductions): Remove member `number' and
21542 `next'.
21543 * src/LR0.c (first_reduction, last_reduction): Remove.
21544 (save_reductions): Don't link the new reductions, store them in
21545 this_state.
21546 * src/lalr.c (set_state_table): No need to attach reductions to
21547 states, it's already done.
21548 * src/output.c (output_actions): No longer free the shifts, then
21549 the reductions, then the states: free all the states and their
21550 members.
21551
0edad749
AD
215522001-12-10 Akim Demaille <akim@epita.fr>
21553
21554 * src/options.c (OPTN, DRTV, BOTH): New.
21555 (option_table): Use them.
21556
0edad749
AD
21557 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
21558 the job of system.h.
21559 * src/options.c: Don't include stdio.h and xalloc.h for the same
21560 reasons.
21561
5449dd0f
AD
215622001-12-10 Akim Demaille <akim@epita.fr>
21563
21564 * src/output.c (output, prepare): Make sure the values of the
21565 muscles `action' and `prologue' are 0-terminated.
21566
a870c567
AD
215672001-12-10 Akim Demaille <akim@epita.fr>
21568
21569 Clean up GCC warnings.
21570
21571 * src/reader.c (copy_action): `buf' is not used.
21572 (parse_skel_decl): Be static.
21573 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
21574 * src/options.h (create_long_option_table): Have a real prototype.
21575 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
21576 (hash_delete_at): Return const void *.
21577 Adjust casts to preserve the const.
21578
80df8768
AD
215792001-12-10 Akim Demaille <akim@epita.fr>
21580
21581 * configure.in: Require 2.52g.
21582 M4 is not needed, but AUTOM4TE is.
21583 * m4/m4.m4: Remove.
21584 * tests/Makefile.am: Adjust.
21585
f693ad14
AD
215862001-12-10 Akim Demaille <akim@epita.fr>
21587
21588 One structure for states is enough, even though theoretically
21589 there are LR(0) states and LALR(1) states.
21590
21591 * src/lalr.h (state_t): Remove.
21592 (state_table): Be state_t **, not state_t *.
21593 * src/state.h (core, CORE_ALLOC): Rename as...
21594 (state_t, STATE_ALLOC): this.
21595 Add the LALR(1) members: shifts, reductions, errs.
21596 * src/LR0.c (state_table): Rename as...
21597 (state_hash): this, to avoid name clashes with the global
21598 `state_table'.
21599 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
21600 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
21601
74ffbcb6
AD
216022001-12-10 Akim Demaille <akim@epita.fr>
21603
21604 Bison dumps core on bash.y.
21605 Reported by Pascal Bart.
21606
21607 * src/warshall.c (bitmatrix_print): New.
21608 (TC): Use it.
ba0fe3c7 21609 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
21610 j must be the outer loop.
21611 * tests/regression.at (Broken Closure): New.
21612
07708e19
AD
216132001-12-05 Akim Demaille <akim@epita.fr>
21614
21615 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
21616 its argument.
ba1ecc07 21617 Reported by Peter Hamorsky.
07708e19 21618
92b16366
AD
216192001-12-05 Akim Demaille <akim@epita.fr>
21620
21621 * src/conflicts.c (err_table): Remove.
21622 (resolve_sr_conflict): Adjust.
21623 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
21624 Rename as...
21625 (state_t.reductions, state_t.shifts): this.
21626
076ab033
AD
216272001-12-05 Akim Demaille <akim@epita.fr>
21628
21629 * src/reduce.c (reduce_grammar_tables): No longer disable the
21630 removal of useless rules via CPP but via `if (0)', so that the
21631 compiler still check the code is valid.
21632 For instance, it should have noticed `rline' no longer exists: use
21633 the `line' member of rule_t.
21634 * src/gram.c (dummy, rline): Remove, unused.
21635
3843c413
AD
216362001-12-05 Akim Demaille <akim@epita.fr>
21637
21638 * src/output.c (pack_vector): Use assert, not berror.
21639 * src/main.c (berror): Remove, unused.
21640
43168960
AD
216412001-12-05 Akim Demaille <akim@epita.fr>
21642
21643 New experimental feature: if --verbose --trace output all the
21644 items of a state, not only its kernel.
21645
21646 * src/print.c (print_core): If `trace_flag', then invoke closure
21647 before outputting the items of the state (print_core is no longer
21648 a correct name them).
21649 (print_results): Invoke new_closure/free_closure if needed.
21650
b2872512
AD
216512001-12-05 Akim Demaille <akim@epita.fr>
21652
21653 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
21654 * src/closure.c, src/closure.h (itemsetsize): Rename as...
21655 (nitemset): for consistency with the rest of the project.
21656
23cbcc6c
AD
216572001-12-05 Akim Demaille <akim@epita.fr>
21658
21659 * src/closure.c (print_closure): Improve.
21660 (closure): Use it for printing input and output.
21661
03ec521c
AD
216622001-12-05 Akim Demaille <akim@epita.fr>
21663
21664 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
21665 indexed by nonterminals.
21666
3a7456dd
AD
216672001-12-05 Akim Demaille <akim@epita.fr>
21668
21669 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
21670 what it was!).
21671 * src/warshall.h: Remove accidental duplication of the content.
21672
1cbcf2e7
AD
216732001-12-05 Akim Demaille <akim@epita.fr>
21674
21675 * src/closure.c (set_fderives): De-obfuscate.
21676
84182270
AD
216772001-12-05 Akim Demaille <akim@epita.fr>
21678
21679 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
21680
3f6f053c
AD
216812001-12-05 Akim Demaille <akim@epita.fr>
21682
21683 * src/closure.c (set_firsts): De-obfuscate.
21684
7a5350ba
AD
216852001-12-05 Akim Demaille <akim@epita.fr>
21686
21687 * src/output.c (action_row): De-obfuscate
21688 using the good o' techniques: arrays not pointers, variable
21689 locality, BITISSET, RESETBIT etc.
21690
d954473d
AD
216912001-12-05 Akim Demaille <akim@epita.fr>
21692
21693 Pessimize the code to simplify it: from now on, all the states
21694 have a valid SHIFTS, which NSHIFTS is possibly 0.
21695
21696 * src/LR0.c (shifts_new): Be global and move to..
21697 * src/state.c, src/state.h: here.
21698 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
21699 * src/print_graph: Adjust.
21700
9839bbe5
AD
217012001-12-05 Akim Demaille <akim@epita.fr>
21702
21703 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
21704 * src/conflicts.c: Use it.
21705 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
21706 incorrectly ``simplified''.
21707
9f136c07
AD
217082001-12-05 Akim Demaille <akim@epita.fr>
21709
21710 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
21711 using the good o' techniques: arrays not pointers, variable
21712 locality, BITISSET, RESETBIT etc.
21713
b608206e
AD
217142001-12-05 Akim Demaille <akim@epita.fr>
21715
21716 * src/state.h (SHIFT_SYMBOL): New.
21717 * src/conflicts.c: Use it to deobfuscate.
21718
52afa962
AD
217192001-12-05 Akim Demaille <akim@epita.fr>
21720
21721 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
21722 (print_reductions): De-obfuscate using the good o' techniques:
21723 arrays not pointers, variable locality, BITISSET.
21724
e74dc321
AD
217252001-12-05 Akim Demaille <akim@epita.fr>
21726
21727 * src/conflicts.c (print_reductions): Arrays, not pointers.
21728 Use BITISSET.
21729
768fca83
AD
217302001-12-05 Akim Demaille <akim@epita.fr>
21731
21732 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21733
a17e599f
AD
217342001-12-05 Akim Demaille <akim@epita.fr>
21735
21736 * src/conflicts.c (print_reductions): Improve variable locality.
21737
a04bc341
AD
217382001-12-05 Akim Demaille <akim@epita.fr>
21739
21740 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21741
c8ea038e
AD
217422001-12-05 Akim Demaille <akim@epita.fr>
21743
21744 * src/conflicts.c (print_reductions): Improve variable locality.
21745
aa2aab3c
AD
217462001-12-05 Akim Demaille <akim@epita.fr>
21747
21748 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
21749 * src/lalr.c: Use them.
21750
b178c8cc
AD
217512001-12-05 Akim Demaille <akim@epita.fr>
21752
21753 * src/LR0.c (augment_automaton): Formatting changes.
21754 Better variable locality.
21755
f67d13aa
AD
217562001-12-05 Akim Demaille <akim@epita.fr>
21757
21758 * src/lalr.c (matrix_print): New.
21759 (transpose): Use it.
21760 Use arrays instead of pointers.
21761
c2713865
AD
217622001-12-05 Akim Demaille <akim@epita.fr>
21763
21764 * src/lalr.c (maxrhs): Move to...
21765 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
21766 * src/lalr.c (build_relations): Adjust.
21767
9887c18a
AD
217682001-12-05 Akim Demaille <akim@epita.fr>
21769
21770 * src/lalr.c (transpose): Free the memory allocated to the
21771 argument, as it is replaced by the results by the unique caller.
21772 (build_relations): Merely invoke transpose: it handles the memory
21773 deallocation.
21774 Improve variable locality.
21775 Avoid variables used as mere abbreviations.
21776 (compute_lookaheads): Use arrays instead of pointers.
21777
4d4f699c
AD
217782001-12-05 Akim Demaille <akim@epita.fr>
21779
21780 * src/lalr.c (initialize_F): Improve variable locality.
21781 Avoid variables used as mere abbreviations.
21782
80a69750
AD
217832001-12-05 Akim Demaille <akim@epita.fr>
21784
21785 * src/derives.c (print_derives): Display the ruleno.
21786 * src/lalr.c (initialize_F, transpose): Better variable locality
21787 to improve readability.
21788 Avoid variables used as mere abbreviations.
21789
fe961097
AD
217902001-12-05 Akim Demaille <akim@epita.fr>
21791
21792 * src/lalr.c (traverse): Use arrays instead of pointers.
21793
e3e4e814
AD
217942001-12-05 Akim Demaille <akim@epita.fr>
21795
21796 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
21797 the handling of squeue.
21798 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21799
630e182b
AD
218002001-12-05 Akim Demaille <akim@epita.fr>
21801
21802 Because useless nonterminals are now kept alive (instead of being
21803 `destroyed'), we now sometimes examine them, and store information
21804 related to them. Hence we need to know their number, and adjust
21805 memory allocations.
21806
21807 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
21808 static.
21809 * src/LR0.c (allocate_itemsets): The memory allocated to
21810 `symbol_count' was used for two different purpose: once to count
21811 the number of occurrences of each symbol, and later reassigned to
21812 `shift_symbol', containing the symbol that can be shifted from a
21813 given state.
21814 Deobfuscate, i.e., allocate, use and free `symbol_count' here
21815 only, and...
21816 (new_itemsets): Allocate `shift_symbol' here.
21817 (allocate_itemsets): symbol_count includes useless nonterminals.
21818 Make room for them.
21819 (free_storage): Use `free', not `XFREE', for pointers that cannot
21820 be null.
21821
81b51460
AD
218222001-12-05 Akim Demaille <akim@epita.fr>
21823
21824 * src/nullable.c (set_nullable): Deobfuscate the handling of
21825 ritem.
21826 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21827
3067fbef
AD
218282001-12-05 Akim Demaille <akim@epita.fr>
21829
21830 * src/gram.c, src/gram.h (ritem_print): New.
21831 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
21832 (This useless function was defined only to work around VMS linkers
21833 that can't handle compilation units with variables only).
21834 * src/reduce.c (dump_grammar): Use it to trace the construction of
21835 ritem.
21836
c2bea5f9
PE
218372001-12-04 Paul Eggert <eggert@twinsun.com>
21838
7d27c823
PE
21839 * src/bison.simple (union yyalloc): Change member names
21840 to be the same as the stack names.
21841 (yyparse): yyptr is now union yyalloc *, not char *.
21842 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
21843 and may generate better code on some machines.
c2bea5f9
PE
21844 (yystpcpy): Use prototype if __STDC__ is defined, not just
21845 if __cplusplus is defined.
35687a9d 21846
2c8a9dfa
AD
218472001-11-30 Akim Demaille <akim@epita.fr>
21848
21849 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
21850 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
21851 Gettext doesn't compile cleanly, and dies with -Werror.
21852 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
21853 Include WARNING_CFLAGS here.
21854 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
21855 before being defined.
21856
f4e421e6
AD
218572001-11-27 Paul Eggert <eggert@twinsun.com>
21858
21859 * lib/quotearg.h (quotearg_n, quotearg_n_style):
21860 First arg is int, not unsigned.
21861 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
21862 (SIZE_MAX, UINT_MAX): New macros.
21863 (quotearg_n_options): Abort if N is negative.
21864 Avoid overflow check on hosts where size_t is 64 bits and int
21865 is 32 bits, as overflow is impossible there.
21866 Fix off-by-one typo that caused unnecessary reallocation.
21867
7093d0f5
AD
218682001-11-29 Paul Eggert <eggert@twinsun.com>
21869
21870 Name space cleanup in generated parser.
21871
21872 * doc/bison.texinfo (Bison Parser): Discuss system headers
21873 and their effect on the user name space.
21874
21875 * src/bison.simple:
21876 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
21877 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
21878 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
21879
21880 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
21881 on user names when possible.
21882
21883 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
21884 Simplify test for whather <alloca.h> exists.
21885
21886 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
21887
21888 (<stdio.h>): Include if YYDEBUG.
21889
21890 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
21891 ! defined (yyoverflow) && ! defined (yymemcpy).
21892
21893 (yymemcpy, yyparse): Rename local variables as needed so that
21894 they all begin with 'yy'.
21895
21896 (yystrlen, yystpcpy): New functions.
21897
21898 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
21899 All uses changed.
21900
21901 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
21902 instead of relying on string.h functions. Use YYSTACK_ALLOC
21903 and YYSTACK_FREE instead of malloc and free.
21904
fd51e5ff
AD
219052001-11-30 Akim Demaille <akim@epita.fr>
21906
21907 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
21908 before their first uses.
21909 (YYBISON, YYPURE): Move to the top of the output.
21910
7d13ff5f
AD
219112001-11-30 Akim Demaille <akim@epita.fr>
21912
21913 * tests/reduce.at (Useless Nonterminals): Fix.
21914
892a3995
AD
219152001-11-30 Akim Demaille <akim@epita.fr>
21916
21917 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
21918 if body instead of `;' to pacify GCC's warnings.
21919
68f1e3ed
AD
219202001-11-30 Akim Demaille <akim@epita.fr>
21921
21922 Instead of mapping the LHS of unused rules to -1, keep the LHS
21923 valid, but flag the rules as invalid.
21924
21925 * src/gram.h (rule_t): `useful' is a new member.
21926 * src/print.c (print_grammar): Adjust.
21927 * src/derives.c (set_derives): Likewise.
21928 * src/reader.c (packgram, reduce_output): Likewise.
21929 * src/reduce.c (reduce_grammar_tables): Likewise.
21930 * tests/reduce.at (Underivable Rules, Useless Rules): New.
21931
d2d1b42b
AD
219322001-11-30 Akim Demaille <akim@epita.fr>
21933
21934 * src/reduce.c (reduce_output): Formatting changes.
21935 * src/print.c (print_results, print_grammar): Likewise.
21936 * tests/regression.at (Rule Line Numbers)
21937 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
21938
760b53a8
AD
219392001-11-30 Akim Demaille <akim@epita.fr>
21940
21941 * src/reduce.c (nonterminals_reduce): Instead of throwing away
21942 useless nonterminals, move them at the end of the symbol arrays.
21943 (reduce_output): Adjust.
21944 * tests/reduce.at (Useless Nonterminals): Adjust.
21945
00238958
AD
219462001-11-30 Akim Demaille <akim@epita.fr>
21947
21948 * src/reduce.c: Various comment/formatting changes.
21949 (nonterminals_reduce): New, extracted from...
21950 (reduce_grammar_tables): here.
21951 (reduce_grammar): Call nonterminals_reduce.
21952
396452de
PE
219532001-11-29 Paul Eggert <eggert@twinsun.com>
21954
21955 * src/bison.simple (YYSTACK_REALLOC): Remove.
21956 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
21957 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
21958 New macros.
21959 (union yyalloc): New type.
21960 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
21961 an arbitrary restriction on hosts where size_t is wider than int.
21962
21963 (yyparse): Don't dump core if alloca or malloc fails; instead, report
21964 a parser stack overflow. Allocate just one block of memory for all
21965 three stacks, instead of allocating three blocks; this typically is
21966 faster and reduces fragmentation.
21967
21968 Do not limit the number of items in the stack to a value that fits
21969 in 'int', as this is an arbitrary limit on hosts with 64-bit
21970 size_t and 32-bit int.
21971
147e184c
MA
219722001-11-29 Marc Autret <autret_m@epita.fr>
21973
21974 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
21975 of defining YYERROR_VERBOSE.
21976 [AT_DATA]: $4 is now out of C declarations in the prologue.
21977
426cf563
MA
219782001-11-28 Marc Autret <autret_m@epita.fr>
21979
21980 * src/reader.c (parse_dquoted_param): New.
21981 (parse_skel_decl): Use it.
21982 * src/lex.h: Add its prototype.
21983 * src/lex.c (literalchar): Become not static.
21984
c7925b99
MA
219852001-11-28 Marc Autret <autret_m@epita.fr>
21986
21987 * src/output.h: And put its extern declaration here.
21988 * src/output.c (error_verbose): Define here.
21989 (prepare): Echo name modification.
21990 * src/getargs.h: Clean its extern declaration.
21991 * src/getargs.c (error_verbose_flag): Remove.
21992 (getargs): Remove case 'e'.
21993 * src/options.c (option_table): 'error-verbose' is now seen as simple
21994 percent option.
21995 Include output.h.
21996
21997 * src/reader.c (read_declarations): Remove case tok_include.
21998 (parse_include_decl): Remove.
21999 * src/lex.h (token_t): Remove tok_include.
22000 * src/options.c (option_table): 'include' is now a simple command line
22001 option.
22002
5b5d1929
MA
220032001-11-28 Marc Autret <autret_m@epita.fr>
22004
22005 * src/bison.simple: Adjust muscle names.
22006 * src/muscle_tab.c (muscle_init): Also rename the muscles.
22007 * src/output.c (prepare): s/_/-/ for the muscles names.
22008 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
22009
8850be4b
MA
220102001-11-28 Marc Autret <autret_m@epita.fr>
22011
22012 * src/bison.simple: Fix debug.
22013 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
22014
4a38e613
AD
220152001-11-28 Akim Demaille <akim@epita.fr>
22016
22017 * src/LR0.c (shifts_new): New.
22018 (save_shifts, insert_start_shift, augment_automaton): Use it.
22019
4b35e1c1
AD
220202001-11-28 Akim Demaille <akim@epita.fr>
22021
22022 * src/closure.c (closure): `b' and `ruleno' denote the same value:
22023 keep ruleno only.
22024
d2b04478
AD
220252001-11-28 Akim Demaille <akim@epita.fr>
22026
22027 * src/closure.c (closure): Instead of looping over word in array
22028 then bits in words, loop over bits in array.
22029
2c4c30aa
AD
220302001-11-28 Akim Demaille <akim@epita.fr>
22031
22032 * src/closure.c (closure): No longer optimize the special case
22033 where all the bits of `ruleset[r]' are set to 0, to make the code
22034 clearer.
22035
576890b7
AD
220362001-11-28 Akim Demaille <akim@epita.fr>
22037
22038 * src/closure.c (closure): `r' and `c' are new variables, used to
22039 de-obfuscate accesses to RULESET and CORE.
22040
cb487d7d
AD
220412001-11-28 Akim Demaille <akim@epita.fr>
22042
22043 * src/reduce.c (reduce_print): Use ngettext.
22044 (dump_grammar): Improve the trace accuracy.
22045
6013d43f
AD
220462001-11-28 Akim Demaille <akim@epita.fr>
22047
22048 * src/reduce.c (dump_grammar): Don't translate trace messages.
22049
cb4956ee
AD
220502001-11-28 Akim Demaille <akim@epita.fr>
22051
22052 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
22053 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
22054 as all tags are free'ed afterwards.
22055 From Enrico Scholz.
22056
648185ab
PE
220572001-11-27 Paul Eggert <eggert@twinsun.com>
22058
22059 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
22060 use alloca when we didn't want to, and vice versa.
22061
68254a03
MA
220622001-11-27 Marc Autret <autret_m@epita.fr>
22063
9113b58f
AD
22064 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
22065 initialization.
68254a03
MA
22066 * src/output.c (prepare): Remove its update.
22067
04d843a2
MA
220682001-11-27 Marc Autret <autret_m@epita.fr>
22069
22070 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
22071 Use %error-verbose.
22072
d2079671 220732001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
22074
22075 * src/bison.simple: Remove YYERROR_VERBOSE using.
22076 Use %%error_verbose.
22077 (yyparse): Likewise.
22078 * src/output.c (prepare): Give its final value.
22079 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
22080 * src/getargs.h: Add its extern declaration.
22081 * src/getargs.c (error_verbose_flag): New int.
22082 (getargs): Update to catch new case.
22083 * src/options.c (option_table): 'error-verbose' is a new option.
22084 (shortopts): Update.
22085
e0327bc8
AD
220862001-11-27 Akim Demaille <akim@epita.fr>
22087
22088 * src/system.h: Use intl/libgettext.h.
22089 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
22090
000f1a3c
AD
220912001-11-27 Akim Demaille <akim@epita.fr>
22092
22093 * tests/torture.at (Exploding the Stack Size with Malloc):
22094 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
22095
26cfe0be
AD
220962001-11-27 Akim Demaille <akim@epita.fr>
22097
22098 * src/files.c: Include error.h.
22099 Reported by Hans Aberg.
22100
f6bd5427
MA
221012001-11-26 Marc Autret <autret_m@epita.fr>
22102
d2079671 22103 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
22104 (read_declarations): Add case tok_include.
22105 * src/getargs.h (include): Add its extern definition.
22106 * src/getargs.c (include): New const char *.
22107 (getargs): Add case '-I'.
22108 * src/options.c (option_table): Add include as command line and
22109 percent option.
22110 * src/lex.h (token_t): Add tok_include.
22111
2ca209c1
AD
221122001-11-26 Akim Demaille <akim@epita.fr>
22113
22114 * src/reader.c (readgram): Make sure rules for mid-rule actions
22115 have a lineno equal to that of their host rule.
22116 Reported by Hans Aberg.
22117 * tests/regression.at (Rule Line Numbers): New.
22118
0e41b407
AD
221192001-11-26 Akim Demaille <akim@epita.fr>
22120
22121 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
22122 size_ts.
22123
221242001-11-26 Akim Demaille <akim@epita.fr>
22125
22126 * src/complain.c, src/complain.h (error): Remove, provided by
22127 lib/error.[ch].
22128
e0c40012
AD
221292001-11-26 Akim Demaille <akim@epita.fr>
22130
22131 * src/reader.c (read_declarations): Don't abort on tok_illegal,
22132 issue an error message.
22133 * tests/regression.at (Invalid %directive): New.
22134 Reported by Hans Aberg.
22135
5e147124
AD
221362001-11-26 Akim Demaille <akim@epita.fr>
22137
22138 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
22139 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
22140
a034c8b8
AD
221412001-11-26 Akim Demaille <akim@epita.fr>
22142
22143 * src/conflicts.c (conflicts_print): Don't complain at all when
22144 there are no reduce/reduce conflicts, and as many shift/reduce
22145 conflicts as expected.
22146 * tests/regression.at (%expect right): Adjust.
22147
c64a20f3
AD
221482001-11-23 Akim Demaille <akim@epita.fr>
22149
22150 * lib/alloca.c: Update, from fileutils.
22151
5b0d29bb
AD
221522001-11-23 Akim Demaille <akim@epita.fr>
22153
22154 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
22155
722c4bfe
AD
221562001-11-23 Akim Demaille <akim@epita.fr>
22157
22158 * src/system.h: Include alloca.h.
22159 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
22160
6255b435
AD
221612001-11-23 Akim Demaille <akim@epita.fr>
22162
22163 * src/print_graph.c (print_actions): Remove `rule', unused.
22164 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
22165 pacify GCC's signed < unsigned warnings.
22166 * src/closure.c (itemsetsize): Likewise.
22167 * src/reader.c (symbol_list_new): Static.
22168
b29b2ed5
AD
221692001-11-23 Akim Demaille <akim@epita.fr>
22170
22171 Attaching lineno to buckets is stupid, since only one copy of each
22172 symbol is kept, only the line of the first occurrence is kept too.
22173
22174 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
22175 * src/reader.c (rline_allocated): Remove, unused.
22176 (symbol_list): Have a `line' member.
22177 (symbol_list_new): New.
22178 (readgram): Use it.
22179 * src/print.c (print_grammar): Output the rule line numbers.
22180 * tests/regression.at (Solved SR Conflicts)
22181 (Unresolved SR Conflicts): Adjust.
22182 Reported by Hans Aberg.
22183
a81b1d4a
MA
221842001-11-22 Marc Autret <autret_m@epita.fr>
22185
22186 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
22187
c1ecb3c1
MA
221882001-11-22 Marc Autret <autret_m@epita.fr>
22189
22190 * src/muscle_tab.c (muscle_init): Remove initialization of
22191 skeleton muscle.
22192 * src/output.c (output_master_parser): Do it here.
22193
fbe01355
AD
221942001-11-20 Akim Demaille <akim@epita.fr>
22195
22196 * po/sv.po: New.
22197 * configure.in (ALL_LINGUAS): Adjust.
22198 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
22199 longer contains strings to translate.
22200
81e895c0
AD
222012001-11-19 Akim Demaille <akim@epita.fr>
22202
22203 * src/conflicts.c (conflicts_print): Add a missing \n.
22204
6bb1878b
AD
222052001-11-19 Akim Demaille <akim@epita.fr>
22206
22207 * src/nullable.c (nullable_print): New.
22208 (set_nullable): Call it when tracing.
22209 Better locality of variables.
22210
d9ec2d07
AD
222112001-11-19 Akim Demaille <akim@epita.fr>
22212
22213 * src/print.c (print_actions): Better locality of variables.
22214
720e5c1b
AD
222152001-11-19 Akim Demaille <akim@epita.fr>
22216
22217 * src/derives.c (print_derives): Fix and enrich.
22218 * src/closure.c (print_fderives): Likewise.
22219
fb908786
AD
222202001-11-19 Akim Demaille <akim@epita.fr>
22221
22222 * src/closure.c (itemsetend): Remove, replaced with...
22223 (itemsetsize): new.
22224
125ecb56
AD
222252001-11-19 Akim Demaille <akim@epita.fr>
22226
22227 * src/LR0.c (kernel_end): Remove, replaced with...
22228 (kernel_size): new.
22229
d8cf039f
AD
222302001-11-19 Akim Demaille <akim@epita.fr>
22231
22232 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
22233 to clarify.
22234
7bec0760
AD
222352001-11-19 Akim Demaille <akim@epita.fr>
22236
22237 * src/closure.c (closure): Use arrays instead of pointers to clarify.
22238
c87d4863
AD
222392001-11-19 Akim Demaille <akim@epita.fr>
22240
22241 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
22242 trace messages.
22243 * src/LR0.c: Likewise.
22244 (allocate_itemsets): Use arrays instead of pointers to clarify.
22245
9bfe901c
AD
222462001-11-19 Akim Demaille <akim@epita.fr>
22247
22248 * src/getargs.c (statistics_flag): Replace with...
22249 (trace_flag): New.
22250 (longopts): Accept --trace instead of --statistics.
22251 * src/getargs.h, src/options.c: Adjust.
22252 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
22253 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
22254
97db7bd4
AD
222552001-11-19 Akim Demaille <akim@epita.fr>
22256
cc72668c 22257 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
22258 pointers to clarify the code.
22259 (save_reductions, save_shifts): Factor common parts of alternatives.
22260
2c5f66ed
AD
222612001-11-19 Akim Demaille <akim@epita.fr>
22262
22263 * src/LR0.c (new_state, get_state): Complete TRACE code.
22264 * src/closure.c: Include `reader.h' to get `tags', needed by the
22265 trace code.
22266 Rename the conditional DEBUG as TRACE.
22267 Output consistently TRACEs to stderr, not stdout.
22268 * src/derives.c: Likewise.
22269 * src/reduce.c: (inaccessable_symbols): Using if is better style
22270 than goto.
22271 Use `#if TRACE' instead of `#if 0' for tracing code.
22272
300f275f
AD
222732001-11-19 Akim Demaille <akim@epita.fr>
22274
22275 * src/system.h (LIST_FREE, shortcpy): New.
22276 * src/LR0.c: Use them.
22277 * src/output.c (free_itemsets, free_reductions, free_shifts):
22278 Remove, replaced by LIST_FREE.
22279
f59c437a
AD
222802001-11-19 Akim Demaille <akim@epita.fr>
22281
22282 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
22283 (REDUCTIONS_ALLOC): New.
22284 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
22285 allocation.
22286
6986fd9e
AD
222872001-11-19 Akim Demaille <akim@epita.fr>
22288
22289 * src/LR0.c (new_state): Complete trace code.
22290 * src/nullable.c (set_nullable): Don't translate traces.
22291
4bc30f78
AD
222922001-11-19 Akim Demaille <akim@epita.fr>
22293
22294 * src/print_graph.c (print_core): Better locality of variables.
22295 * src/print.c (print_core): Likewise.
22296
08a946e0
AD
222972001-11-19 Akim Demaille <akim@epita.fr>
22298
22299 * src/vcg.c: You do the output, so you are responsible of the
22300 handling of VCG syntax, in particular: use quotearg.
22301 * src/print_graph.c: Don't.
22302 (print_actions): Don't output the actions as part of the nodes,
22303 since that's the job of the edges.
22304 (print_state): Don't output by hand: fill the node description,
9bfe901c 22305 and ask for its output.
08a946e0 22306
f0473484
AD
223072001-11-19 Akim Demaille <akim@epita.fr>
22308
cc72668c
AD
22309 * src/bison.simple (yyparse): When verbosely reporting an error,
22310 no longer put additional quotes around token names.
f0473484
AD
22311 * tests/calc.at: Adjust.
22312
e41dc700
AD
223132001-11-19 Akim Demaille <akim@epita.fr>
22314
22315 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
22316 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
22317 * src/output.c: Adjust.
22318
652a871c
AD
223192001-11-19 Akim Demaille <akim@epita.fr>
22320
22321 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
22322 (rule_t): this.
22323 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
22324
b2ed6e58
AD
223252001-11-19 Akim Demaille <akim@epita.fr>
22326
22327 * src/gram.h (rule_t): New.
22328 (rule_table): New.
22329 (rrhs, rlhs): Remove, part of state_t.
22330 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
22331 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
22332 * src/reader.c, src/reduce.c: Adjust.
22333
edad7067
AD
223342001-11-19 Akim Demaille <akim@epita.fr>
22335
22336 * src/reader.c (symbols_output): New, extracted from...
22337 (packsymbols): Here.
22338 (reader): Call it.
22339
3feec034
AD
223402001-11-19 Akim Demaille <akim@epita.fr>
22341
22342 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
22343 (maxrhs): this new function.
22344
ddcd5fdf
AD
223452001-11-19 Akim Demaille <akim@epita.fr>
22346
cc72668c 22347 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
22348 Adjust.
22349
bb527fc2
AD
223502001-11-19 Akim Demaille <akim@epita.fr>
22351
cc72668c 22352 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
22353 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22354 * src/lalr.c: Adjust.
22355
a845a697
AD
223562001-11-19 Akim Demaille <akim@epita.fr>
22357
22358 * src/lalr.c (initialize_LA): Only initialize LA. Let...
22359 (set_state_table): handle the `lookaheads' members.
22360
f004bf6a
AD
223612001-11-19 Akim Demaille <akim@epita.fr>
22362
cc72668c
AD
22363 * src/lalr.h (lookaheads): Removed array, whose contents is now
22364 a member of...
f004bf6a
AD
22365 (state_t): this structure.
22366 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22367 Adjust.
22368
de326cc0
AD
223692001-11-19 Akim Demaille <akim@epita.fr>
22370
cc72668c
AD
22371 * src/lalr.h (consistent): Removed array, whose contents is now
22372 a member of...
de326cc0
AD
22373 (state_t): this structure.
22374 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22375 Adjust.
22376
90b4416b
AD
223772001-11-19 Akim Demaille <akim@epita.fr>
22378
cc72668c
AD
22379 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
22380 contents are now members of...
90b4416b
AD
22381 (state_t): this structure.
22382 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22383 Adjust.
22384
9703cc49
AD
223852001-11-19 Akim Demaille <akim@epita.fr>
22386
22387 * src/lalr.h (state_t): New.
22388 (state_table): Be a state_t * instead of a core **.
22389 (accessing_symbol): Remove, part of state_t.
22390 * src/lalr.c: Adjust.
22391 (set_accessing_symbol): Merge into...
22392 (set_state_table): this.
22393 * src/print_graph.c, src/conflicts.c: Adjust.
22394
d803322e
AD
223952001-11-14 Akim Demaille <akim@epita.fr>
22396
22397 * tests/calc.at, tests/output.at, tests/regression.at,
22398 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
22399 now the tests are run in private dirs, therefore AC_CLEANUP and
22400 family can be simplified to 0-ary.
22401 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
22402 use abs. path to find config.h.
22403 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
22404 stderr, there can be way too much random noise.
22405 Instead pass -Werror to GCC and rely on the exit status.
22406 Reported by Wolfram Wagner.
22407
3d76b07d
AD
224082001-11-14 Akim Demaille <akim@epita.fr>
22409
22410 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
22411 defined only if yyoverflow is defined, to avoid `warning: unused
22412 variable `yyvs1''.
22413 Reported by The Test Suite.
22414
09b503c8
AD
224152001-11-14 Akim Demaille <akim@epita.fr>
22416
22417 * src/print.c: Include reduce.h.
22418 Reported by Hans Aberg.
22419
224202001-11-14 Akim Demaille <akim@epita.fr>
22421
22422 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
22423 Revert a previous patch: these are really const.
22424 * src/conflicts.c (conflict_report): Additional useless pair of
22425 braces to pacify GCC's warnings for `if () if () {} else {}'.
22426 * src/lex.c (parse_percent_token): Replace equal_offset with
22427 arg_offset.
22428 arg is const.
22429 Be sure to strdup `arg' when used, since there is no reason for
22430 token_buffer not to change.
22431
0f37a994
AD
224322001-11-14 Akim Demaille <akim@epita.fr>
22433
22434 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
22435 definition.
22436 * src/main.c (main): Use them.
22437 Suggested by Hans Aberg.
22438
d39d93b8
AD
224392001-11-12 Akim Demaille <akim@epita.fr>
22440
22441 * src/system.h (ngettext): Now that we use ngettext, be sure to
22442 provide a default definition when NLS are not used.
22443
9edcd895
AD
224442001-11-12 Akim Demaille <akim@epita.fr>
22445
22446 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
22447 Use @kbd to denote user input.
22448 (Language and Grammar): ANSIfy the example.
22449 Adjust its layout for info/notinfo.
22450 (Location Tracking Calc): Output error messages to stderr.
22451 Output locations in a more GNUtically correct way.
22452 Fix a couple of Englishos.
22453 Adjust @group/@end group pairs.
22454
7da99ede
AD
224552001-11-12 Akim Demaille <akim@epita.fr>
22456
e3aa65c5 22457 %expect was not functioning at all.
7da99ede
AD
22458
22459 * src/conflicts.c (expected_conflicts): Set to -1.
22460 (conflict_report): Use ngettext.
22461 (conflicts_print): Check %expect and make its violation an error.
22462 * doc/bison.texinfo (Expect Decl): Adjust.
22463 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
22464 * tests/regression.at (%expect not enough, %expect right)
22465 (%expect too much): New.
22466
ba9dda1a
AD
224672001-11-12 Akim Demaille <akim@epita.fr>
22468
22469 * tests/regression.at (Conflicts): Rename as...
22470 (Unresolved SR Conflicts): this.
22471 (Solved SR Conflicts): New.
22472
337c5bd1
AD
224732001-11-12 Akim Demaille <akim@epita.fr>
22474
22475 * src/reduce.c (print_results): Rename as...
22476 (reduce_output): This.
22477 Output to OUT, passed as argument, instead of output_obstack.
22478 (dump_grammar): Likewise.
22479 (reduce_free): New.
22480 Also free V1.
22481 (reduce_grammar): No longer call reduce_output, since...
22482 * src/print.c (print_results): do it.
22483 * src/main.c (main): Call reduce_free;
22484
c73a41af
AD
224852001-11-12 Akim Demaille <akim@epita.fr>
22486
22487 * src/conflicts.c (print_reductions): Accept OUT as argument.
22488 Output to it, not to output_obstack.
22489 * src/print.c (print_actions): Adjust.
22490
0df87bb6
AD
224912001-11-12 Akim Demaille <akim@epita.fr>
22492
22493 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
22494 the result instead of using...
22495 (src_total, rrc_total, src_count, rrc_count): Remove.
22496 (any_conflicts): Remove.
22497 (print_conflicts): Split into...
22498 (conflicts_print, conflicts_output): New.
22499 * src/conflicts.h: Adjust.
22500 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 22501 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
22502 * tests/regression.at (Conflicts): New.
22503 Reported by Tom Lane.
22504
e4d3d4de
AD
225052001-11-12 Akim Demaille <akim@epita.fr>
22506
22507 * tests/regression.at (Invalid input): Remove, duplicate with
22508 ``Invalid input: 1''.
22509
6d7d248e
AD
225102001-11-12 Akim Demaille <akim@epita.fr>
22511
22512 * tests/torture.at (AT_DATA_STACK_TORTURE)
22513 (Exploding the Stack Size with Alloca)
22514 (Exploding the Stack Size with Malloc): New.
22515
e9e4c321
AD
225162001-11-12 Akim Demaille <akim@epita.fr>
22517
22518 * src/bison.simple (YYSTACK_REALLOC): New.
22519 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 22520 Reported by Per Allansson.
e9e4c321 22521
5f7e0832
AD
225222001-11-12 Pascal Bart <pascal.bart@epita.fr>
22523
22524 * src/bison.simple: Define type yystype instead of YYSTYPE, and
22525 define CPP macro, which substitute YYSTYPE by yystype.
22526 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
22527 with yyltype/YYLTYPE. This allows inclusion of the generated
22528 header within the parser if the compiler, such as GGC, accepts
22529 multiple equivalent #defines.
22530 From Akim.
22531
e3f1699f
AD
225322001-11-05 Akim Demaille <akim@epita.fr>
22533
22534 * src/reader.c (symbols_output): New, extracted from...
22535 (packsymbols): here.
22536 (reader): Adjust.
22537
65be0866
AD
225382001-11-05 Akim Demaille <akim@epita.fr>
22539
22540 * src/lex.c (parse_percent_token): s/quotearg/quote/.
22541
e4d910bf
AD
225422001-11-05 Akim Demaille <akim@epita.fr>
22543
22544 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
22545 pattern.
22546
951366c1
AD
225472001-11-05 Akim Demaille <akim@epita.fr>
22548
22549 * src/options.h (struct option_table_struct): set_flags is void*.
22550 * src/options.c (longopts): Support `--output' and `%output'.
22551 (usage): Adjust.
22552 * src/lex.h (tok_setopt): Remove, replaced with...
22553 (tok_intopt, tok_stropt): these new guys.
22554 * src/lex.c (getopt.h): Not needed.
22555 (token_buffer, unlexed_token_buffer): Not const.
22556 (percent_table): Promote `-' over `_' in directive names.
22557 Active `%name-prefix', `file-prefix', and `output'.
22558 (parse_percent_token): Accept possible arguments to directives.
22559 Promote `-' over `_' in directive names.
22560
d8988b2f
AD
225612001-11-04 Akim Demaille <akim@epita.fr>
22562
22563 * doc/bison.texinfo (Decl Summary): Split the list into
22564 `directives for grammars' and `directives for bison'.
22565 Sort'em.
22566 Add description of `%name-prefix', `file-prefix', and `output'.
22567 Promote `-' over `_' in directive names.
22568 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
22569 Simplify the description of `--name-prefix'.
22570 Promote `-' over `_' in directive names.
22571 Promote `--output' over `--output-file'.
22572 Fix the description of `--defines'.
22573 * tests/output.at: Exercise %file-prefix and %output.
22574
6468d18e
AD
225752001-11-02 Akim Demaille <akim@epita.fr>
22576
22577 * doc/refcard.tex: Update.
22578
6b7e85b9
AD
225792001-11-02 Akim Demaille <akim@epita.fr>
22580
22581 * src/symtab.h (SUNDEF): New.
22582 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
22583 stand for `uninitialized', instead of 0.
22584 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
22585 * src/lex.c (lex): Adjust.
22586
22587 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
22588 Number it 0.
22589 Let yylex return it instead of a plain 0.
22590 Reported by Dick Streefland.
22591
cd5aafcf
AD
225922001-11-02 Akim Demaille <akim@epita.fr>
22593
22594 * tests/regression.at (Mixing %token styles): New test.
22595
037ca2f1
AD
225962001-11-02 Akim Demaille <akim@epita.fr>
22597
22598 * src/reader.c (parse_thong_decl): Formatting changes.
22599 (token_translations_init): New, extracted from...
22600 (packsymbols): Here.
22601 Adjust.
22602
270a173c
AD
226032001-11-01 Akim Demaille <akim@epita.fr>
22604
22605 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
22606 Check that `9foo.y' produces correct cpp guards.
22607 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
22608 guards.
22609 Reported by Wwp.
22610
561f9a30
AD
226112001-11-01 Akim Demaille <akim@epita.fr>
22612
22613 * tests/regression.at (Invalid input: 2): New.
22614 * src/lex.c (unlexed_token_buffer): New.
22615 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
22616 too.
22617 Reported by Wwp.
22618
f987e9d2
AD
226192001-11-01 Akim Demaille <akim@epita.fr>
22620
22621 * tests/calc.at: Catch up with 1.30.
22622 * configure.in: Bump to 1.49a.
22623 Adjust to newer Autotest.
22624
0846f581
PB
226252001-10-19 Pascal Bart <pascal.bart@epita.fr>
22626
22627 * src/conflicts.c: Move global variables rrc_total and src_total ...
22628 (print_conflicts): here.
22629 * src/output.c (output): Free global variable user_toknums.
22630 * src/lex.c (token_obstack): Become static.
22631
3c1a79b3
AD
226322001-10-18 Akim Demaille <akim@epita.fr>
22633
22634 * tests/atlocal.in (GCC): Add.
22635 * tests/calc.at: s/m4_match/m4_bmatch/.
22636 s/m4_patsubst/m4_bpatsubst/.
22637 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
22638 * configure.in: AC_SUBST(GCC).
22639
5d52e7d0
MA
226402001-10-14 Marc Autret <autret_m@epita.fr>
22641
22642 * src/options.c (create_long_option_table): Fix.
22643
631aa1d3
AD
226442001-10-10 Akim Demaille <akim@epita.fr>
22645
22646 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
22647
f6ec6d13
AD
226482001-10-04 Akim Demaille <akim@epita.fr>
22649
22650 * src/reader.c (parse_union_decl): Push the caracters in
22651 union_obstack, not attrs_obstack.
22652
342b8b6e
AD
226532001-10-04 Akim Demaille <akim@epita.fr>
22654
22655 Merge in the branch 1.29.
22656
22657 * src/reader.c (packsymbols): Use a temporary obstack for
22658 `%%tokendef', since output_stack is already used elsewhere.
22659
22660 2001-10-02 Akim Demaille <akim@epita.fr>
22661
22662 Bump 1.29d.
22663
22664 2001-10-02 Akim Demaille <akim@epita.fr>
22665
22666 Version 1.29c.
22667
22668 2001-10-02 Akim Demaille <akim@epita.fr>
22669
22670 * tests/regression.at (Invalid CPP headers): New.
22671 From Alexander Belopolsky.
22672 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
22673
22674 2001-10-02 Akim Demaille <akim@epita.fr>
22675
22676 * tests/regression.at (Invalid input): New.
22677 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
22678 Reported by Shura.
22679
22680 2001-10-02 Akim Demaille <akim@epita.fr>
22681
22682 * tests/calc.at: Now that --debug works, the tests must be adjusted.
22683
22684 2001-10-02 Akim Demaille <akim@epita.fr>
22685
22686 * src/output.c (output_parser): Assert `skeleton'.
22687 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
22688 systems.
22689 From Shura.
22690
22691 2001-10-01 Marc Autret <autret_m@epita.fr>
22692
22693 * src/lex.h: Echo modifications.
22694 * src/lex.c (unlex): Parameter is now token_t.
22695 From Hans Aberg.
22696
22697 2001-10-01 Marc Autret <autret_m@epita.fr>
22698
22699 * src/main.c: Include lex.h.
22700 From Hans Aberg.
22701
22702 2001-09-29 Akim Demaille <akim@epita.fr>
22703
22704 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
22705
22706 2001-09-28 Akim Demaille <akim@epita.fr>
22707
22708 * tests/testsuite.at: Update to newer Autotest.
22709 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
22710
22711 2001-09-27 Akim Demaille <akim@epita.fr>
22712
22713 Position independent wrapper.
22714
22715 * tests/bison: Remove.
22716 * tests/bison.in: New.
22717 * configure.in: Adjust.
22718
22719 2001-09-27 Paul Eggert <eggert@twinsun.com>
22720
22721 Port quotearg fixes from tar 1.13.24.
22722
22723 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
22724 tm to be declared.
22725 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
22726 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
22727
22728 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
22729 * m4/mbrtowc.m4: New file.
22730 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
22731 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
22732
22733 2001-09-27 Akim Demaille <akim@epita.fr>
22734
22735 Bump to 1.29c.
22736
22737 2001-09-27 Akim Demaille <akim@epita.fr>
22738
22739 Version 1.29b.
22740
22741 2001-09-25 Akim Demaille <akim@epita.fr>
22742
22743 * src/system.h: Include `xalloc.h'.
22744 Remove it from the C files.
22745 * src/files.c (output_files): Free the obstacks.
22746 * src/lex.c (init_lex): Rename as...
22747 (lex_init): this.
22748 (lex_free): New.
22749 * src/main.c (main): Use it.
22750
22751 2001-09-24 Marc Autret <autret_m@epita.fr>
22752
22753 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
22754 to output informations in fout (FILE*).
22755 (open_graph, close_graph): Likewise.
22756 (output_graph, output_edge, output_node): Likewise.
22757 * src/vcg.h: Update function prototypes.
22758 * src/print_graph.c (print_graph): Open output graph file.
22759 (print_actions): Adjust.
22760 * src/files.h: Remove extern declaration.
22761 * src/files.c: Remove graph_obstack declaration.
22762 (open_files): Remove graph_obstack initialization.
22763 (output_files): Remove graph_obstack saving.
22764
22765 2001-09-24 Marc Autret <autret_m@epita.fr>
22766
22767 * src/files.c (compute_output_file_names): Fix.
22768
22769 2001-09-24 Marc Autret <autret_m@epita.fr>,
22770 Akim Demaille <akim@epita.fr>
22771
22772 * src/reader.c (reader): Remove call to free_symtab ().
22773 * src/main.c (main): Call it here.
22774 Include symtab.h.
22775 * src/conflicts.c (initialize_conflicts): Rename as...
22776 (solve_conflicts): this.
22777 * src/print.c (print_core, print_actions, print_state)
22778 (print_grammar): Dump to a file instead a `output_obstack'.
22779 (print_results): Dump `output_obstack', and then proceed with the
22780 FILE *.
22781 * src/files.c (compute_output_file_names, close_files): New.
22782 (output_files): Adjust.
22783 * src/main.c (main): Adjust.
22784
22785 2001-09-23 Marc Autret <autret_m@epita.fr>
22786
22787 * src/files.c (compute_header_macro): Computes header macro name
22788 from spec_defines_file when given.
22789
22790 2001-09-23 Marc Autret <autret_m@epita.fr>
22791
22792 * src/files.c (output_files): Add default extensions.
22793
22794 2001-09-22 Akim Demaille <akim@epita.fr>
22795
22796 * src/conflicts.c (finalize_conflicts): Rename as...
22797 (free_conflicts): this.
22798
22799 2001-09-22 Akim Demaille <akim@epita.fr>
22800
22801 * src/gram.c (gram_free): Rename back as...
22802 (dummy): this.
22803 (output_token_translations): Free `token_translations'.
22804 * src/symtab.c (free_symtab): Free the tag field.
22805
22806 2001-09-22 Akim Demaille <akim@epita.fr>
22807
22808 Remove `translations' as it is always set to true.
22809
22810 * src/gram.h: Adjust.
22811 * src/reader.c (packsymbols, parse_token_decl): Adjust
22812 * src/print.c (print_grammar): Adjust.
22813 * src/output.c (output_token_translations): Adjust.
22814 * src/lex.c (lex): Adjust.
22815 * src/gram.c: Be sure the set pointers to NULL.
22816 (dummy): Rename as...
22817 (gram_free): this.
22818
22819 2001-09-22 Akim Demaille <akim@epita.fr>
22820
22821 * configure.in: Invoke AM_LIB_DMALLOC.
22822 * src/system.h: Use dmalloc.
22823 * src/LR0.c: Be sure to have pointers initialized to NULL.
22824 (allocate_itemsets): Allocate kernel_items only if needed.
22825
22826 2001-09-22 Akim Demaille <akim@epita.fr>
22827
22828 * configure.in: Bump to 1.29b.
22829 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
22830 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
22831 need xmalloc.c in calc.y.
22832 From Pascal Bart.
22833
22834 2001-09-21 Akim Demaille <akim@epita.fr>
22835
22836 Version 1.29a.
22837 * Makefile.maint, config/config.guess, config/config.sub,
22838 * config/missing: Update from masters.
22839 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
22840 upon package.m4.
22841 * configure.in (ALL_LINGUAS): Add `tr'.
22842
22843 2001-09-21 Akim Demaille <akim@epita.fr>
22844
22845 * tests/Makefile.am (package.m4): Move to...
22846 ($(srcdir)/$(TESTSUITE)): here.
22847
22848 2001-09-20 Akim Demaille <akim@epita.fr>
22849
22850 * src/complain.c: No longer try to be standalone: use system.h.
22851 Don't assume __STDC__ is defined to 1. Just test if it is defined.
22852 * src/complain.h: Likewise.
22853 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
22854 Remove the unused variable `n'.
22855 From Albert Chin-A-Young.
22856
22857 2001-09-18 Marc Autret <autret_m@epita.fr>
22858
22859 * doc/bison.1: Update.
22860 * doc/bison.texinfo (Bison Options): Update --defines and --graph
22861 descriptions.
22862 (Option Cross Key): Update.
22863 Add --graph.
22864
22865 2001-09-18 Marc Autret <autret_m@epita.fr>
22866
22867 * tests/regression.at: New test (comment in %union).
22868
22869 2001-09-18 Marc Autret <autret_m@epita.fr>
22870
22871 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
22872 do that.
22873 Reported by Keith Browne.
22874
22875 2001-09-18 Marc Autret <autret_m@epita.fr>
22876
22877 * tests/output.at: Add tests for --defines and --graph.
22878
22879 2001-09-18 Marc Autret <autret_m@epita.fr>
22880
22881 * tests/output.at: Removes tests of %{header,src}_extension features.
22882
22883 2001-09-18 Akim Demaille <akim@epita.fr>
22884
22885 * tests/Makefile.am (package.m4): New.
22886 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
22887 (_AT_CHECK_CALC_ERROR): Likewise.
22888 Factor the `, ' part of verbose error messages.
22889
22890 2001-09-18 Marc Autret <autret_m@epita.fr>
22891
22892 * src/getargs.c (longopts): Declare --defines and --graph as options
22893 with optional arguments.
22894 * src/files.h: Add extern declarations.
22895 * src/files.c (spec_graph_file, spec_defines_file): New.
22896 (output_files): Update.
22897 Remove CPP-outed code.
22898
22899 2001-09-18 Marc Autret <autret_m@epita.fr>
22900
22901 Turn off %{source,header}_extension feature.
22902
22903 * src/files.c (compute_exts_from_gf): Update.
22904 (compute_exts_from_src): Update.
22905 (output_files): CPP-out useless code.
22906 * src/files.h: Remove {header,source}_extension extern declarations.
22907 * src/reader.c (parse_dquoted_param): CPP-out.
22908 (parse_header_extension_decl): Remove.
22909 (parse_source_extension_decl): Remove.
22910 (read_declarations): Remove cases tok_{hdrext,srcext}.
22911 * src/lex.c (percent_table): Remove {header,source}_extension entries.
22912 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
22913
22914 2001-09-10 Akim Demaille <akim@epita.fr>
22915
22916 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
22917 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
22918 (AT_CHECK_OUTPUT): this.
22919 Merely check ls' exit status, its output is useless.
22920
22921 2001-09-10 Akim Demaille <akim@epita.fr>
22922
22923 * tests/calc.at: Use m4_match.
22924 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
22925
22926 2001-09-10 Marc Autret <autret_m@epita.fr>,
22927 Akim Demaille <akim@epita.fr>
22928
22929 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
22930 enum color_e.
22931 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
22932 to `normal'.
22933 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
22934 * src/lex.h: Adjust prototype.
22935 (token_t): Add `tok_undef'.
22936 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
22937 (parse_percent_token): Now returns token_t.
22938 Add default statement in switch.
22939 (lex): Separate `c' as an input variable, from the token_t result
22940 part.
22941 (unlexed): Is a token_t.
22942
22943 2001-09-10 Akim Demaille <akim@epita.fr>
22944
22945 * configure.in: Bump to 1.29a.
22946
22947 2001-09-07 Akim Demaille <akim@epita.fr>
22948
22949 Version 1.29.
22950
22951 2001-08-30 Akim Demaille <akim@epita.fr>
22952
22953 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
22954 * m4/atconfig.m4: Remove.
22955 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
22956 * tests/bison: New.
22957 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
22958 m4_if, m4_patsubst, and m4_regexp.
22959 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
22960 `input' file instead of echo.
22961
22962 2001-08-29 Akim Demaille <akim@epita.fr>
22963
22964 Bump to 1.28e.
22965
22966 2001-08-29 Akim Demaille <akim@epita.fr>
22967
22968 Version 1.28d.
22969
22970 2001-08-29 Paul Eggert <eggert@twinsun.com>
22971
22972 * src/bison.simple (yyparse): Don't take the address of an
22973 item before the start of an array, as that doesn't conform to
22974 the C Standard.
22975
22976 2001-08-29 Robert Anisko <anisko_r@epita.fr>
22977
22978 * doc/bison.texinfo (Location Tracking Calc): New node.
22979
22980 2001-08-29 Paul Eggert <eggert@twinsun.com>
22981
22982 * src/output.c (output): Do not define const, as this now
22983 causes more problems than it cures.
22984
22985 2001-08-29 Akim Demaille <akim@epita.fr>
22986
22987 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
22988 the nodes.
22989 Be sure to tag the `detailmenu'.
22990
22991 2001-08-29 Akim Demaille <akim@epita.fr>
22992
22993 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
22994 download in a tmp dir.
22995
22996 2001-08-28 Marc Autret <autret_m@epita.fr>
22997
22998 * config/depcomp: New file.
22999
23000 2001-08-28 Marc Autret <autret_m@epita.fr>
23001
23002 * doc/bison.1 (mandoc): Adjust.
23003 From Juan Manuel Guerrero.
23004
23005 2001-08-28 Marc Autret <autret_m@epita.fr>
23006
23007 * src/print_graph.c (print_state): Fix.
23008
23009 2001-08-27 Marc Autret <autret_m@epita.fr>
23010
23011 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
23012 char * members.
23013 Echo modifications to the functions prototypes.
23014 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
23015
23016 2001-08-27 Marc Autret <autret_m@epita.fr>
23017
23018 * src/vcg.c: Include `xalloc.h'.
23019 (add_colorentry): New.
23020 (add_classname): New.
23021 (add_infoname): New.
23022 * src/vcg.h: Add new prototypes.
23023
23024 2001-08-27 Akim Demaille <akim@epita.fr>
23025
23026 * Makefile.maint: Sync. again with CVS Autoconf.
23027
23028 2001-08-27 Akim Demaille <akim@epita.fr>
23029
23030 * Makefile.maint: Formatting changes.
23031 (po-update, cvs-update, update): New targets.
23032 (AMTAR): Remove.
23033
23034 2001-08-27 Akim Demaille <akim@epita.fr>
23035
23036 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23037 * Makefile.maint: Sync. with CVS Autoconf.
23038
23039 2001-08-27 Marc Autret <autret_m@epita.fr>
23040
23041 * src/vcg.h (struct infoname_s): New.
23042 (struct colorentry_s): New.
23043 (graph_s): New fields {vertical,horizontal}_order in structure.
23044 Add `infoname' field.
23045 Add `colorentry' field;
23046 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
23047 (G_HORIZONTAL_ORDER): New.
23048 (G_INFONAME): New.
23049 (G_COLORENTRY): New.
23050 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
23051 Add output of `infoname'.
23052 Add output of `colorentry'.
23053
23054 2001-08-27 Marc Autret <autret_m@epita.fr>
23055
23056 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
23057 This one shadowed a global parameter.
23058
23059 2001-08-24 Marc Autret <autret_m@epita.fr>
23060
23061 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
23062 instead of `unsigned'.
23063 (print_state): Do not call obstack_object_size () in obstack_grow ()
23064 to avoid macro variables shadowing.
23065
23066 2001-08-23 Marc Autret <autret_m@epita.fr>
23067
23068 * src/lex.c (percent_table): Typo: s/naem/name/.
23069 Add graph option.
23070 Normalize new options declarations.
23071
23072 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
23073
23074 * tests/suite.at: Exercise %header_extension and %source_extension.
23075
23076 2001-08-16 Marc Autret <autret_m@epita.fr>
23077
23078 * src/reader.c (parse_dquoted_param): New.
23079 (parse_header_extension_decl): Use it.
23080 (parse_source_extension_decl): Likewise.
23081
23082 2001-08-16 Marc Autret <autret_m@epita.fr>
23083
23084 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
23085 (get_xxxx_str): Use assert () instead of complain ().
23086 Remove return invokations in default cases.
23087 (get_decision_str): Modify default behaviour. Remove second argument.
23088 Echo modifications on calls.
23089 (output_graph): Fix.
23090
23091 2001-08-16 Marc Autret <autret_m@epita.fr>
23092
23093 * src/getargs.c (usage): Update with ``-g, --graph''.
23094
23095 2001-08-16 Marc Autret <autret_m@epita.fr>
23096
23097 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
23098 (Option Cross Key): Likewise.
23099 * doc/bison.1: Update.
23100
1c8c2190
PB
231012001-09-25 Pascal Bart <pascal.bart@epita.fr>
23102
23103 * src/output.c (output_master_parser): Don't finish action_obstack.
23104 (output_parser): Don't care about the muscle action, here.
23105 (prepare): Copy the action_obstack in the action muscle.
23106 (output): Free action_obstack.
23107
180d45ba
PB
231082001-09-23 Pascal Bart <pascal.bart@epita.fr>
23109
23110 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
23111 will contain `%union' declaration.
23112 (parse_union_decl): Delete #line directive output.
23113 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
23114 informations about %union.
23115 (parse_union_decl): Copy the union_obstack in the muscle stype.
23116 * src/bison.simple: Add new #line directive.
23117 Add typdef %%stype YYSTYPE.
23118
c51d1a19
PB
231192001-09-23 Pascal Bart <pascal.bart@epita.fr>
23120
23121 * src/bison.simple: Add new `#line' directive.
23122
6f9344da
PB
231232001-09-22 Pascal Bart <pascal.bart@epita.fr>
23124
23125 * src/bison.simple: New `#line' directive.
23126 * src/output.c (output_parser): Support new dynamic muscle input_line.
23127
652def80
MA
231282001-09-22 Marc Autret <autret_m@epita.fr>
23129
23130 * src/output.c (output_master_parser): New.
23131 (output_parser): Be more re-entrant.
23132
25b222fa
MA
231332001-09-21 Marc Autret <autret_m@epita.fr>
23134
23135 * src/reader.c (copy_definition, parse_union_decl): Update and use
23136 `linef' muscle.
23137 (copy_action): Likewise.
23138 Use obstack_1grow ().
23139 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
23140
6bc35ae5
MA
231412001-09-21 Marc Autret <autret_m@epita.fr>
23142
23143 * src/options.c (option_table): Adjust.
23144 * src/lex.c (parse_percent_token): Fix.
23145
c0629aa1
PB
231462001-09-20 Pascal Bart <pascal.bart@epita.fr>
23147
23148 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 23149
82b6d266
PB
231502001-09-20 Pascal Bart <pascal.bart@epita.fr>
23151
23152 * src/lex.c (parse_percent_token): Change type of variable `tx', which
23153 is now an option_table_struct*.
23154 (option_strcmp): New function option_strcmp.
23155 (parse_percent_token): Call option_strcmp.
23156 * src/getargs.c (xalloc.h, options.h): Include it.
23157 (getargs): Call create_long_option_table.
23158 (getargs): Free longopts at the end of the function.
23159 (shortopts): Move in options.c.
23160 * src/options.c (create_long_option_table): New function. Convert
23161 information from option_table to option structure.
23162 * src/reader.c (options.h): Include it.
23163
23164 * src/Makefile.am: Adjust.
23165 * src/options.c (option_table): Create from longopts and percent_table.
23166 * src/getargs.c (longopts): Delete.
23167 * src/lex.c (struct percent_table_struct): Delete.
23168 (percent_table): Delete.
23169 (options.h): Include it.
23170 * src/options.c: Create.
23171 * src/options.h: Create.
23172 Declare enum opt_access_e.
23173 Define struct option_table_struct.
23174
75f5aaea
MA
231752001-09-20 Marc Autret <autret_m@epita.fr>
23176
23177 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
23178 sections of Bison.
23179
f508cb0a
PB
231802001-09-19 Pascal Bart <pascal.bart@epita.fr>
23181
23182 * src/bison.simple: s/%%filename/%%skeleton.
23183 * src/muscle_tab.c (getargs.h): Include it.
23184 (muscle_init): Insert new muscle skeleton.
23185
13105fc1
PB
231862001-09-18 Pascal Bart <pascal.bart@epita.fr>
23187
23188 * src/output.c (output_parser): Delete unused variable actions_dumped.
23189
b0c4483e
PB
231902001-09-07 Pascal Bart <pascal.bart@epita.fr>
23191
23192 * src/output.c (output): Delete call to reader_output_yylsp.
23193 * src/reader.c (reader): Likewise.
ba0fe3c7 23194 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 23195
11d82f03
MA
231962001-09-02 Marc Autret <autret_m@epita.fr>
23197
23198 * src/reader.c: Include muscle_tab.h.
23199 (parse_union_decl): Update.
23200 (parse_macro_decl): Rename parse_muscle_decl.
23201 Update to use renamed functions and variable.
23202 (read_declarations, copy_action, read_additionnal_code, : Updated
23203 with correct variables and functions names.
23204 (packsymbols, reader): Likewise.
342b8b6e 23205
11d82f03 23206 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 23207
11d82f03
MA
23208 * src/output.c: Include muscle_tab.h
23209 In all functions using macro_insert, change by using muscle_insert ().
23210 (macro_obstack): Rename muscle_obstack.
23211 Echo modifications in the whole file.
23212 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
23213 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
23214 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
23215
23216 * src/muscle_tab.h: Update double inclusion macros.
23217 (macro_entry_s): Rename muscle_entry_s.
23218 Update prototypes.
342b8b6e 23219
11d82f03
MA
23220 * src/muscle_tab.c: Include muscle_tab.h.
23221 Rename macro_tabble to muscle_table.
23222 (mhash1, mhash2, mcmp): Use muscle_entry.
23223 (macro_init): Rename muscle_init. Update.
23224 (macro_insert): Rename muscle_insert. Update.
23225 (macro_find): Rename muscle_find. Update.
23226
23227 * src/main.c: Include muscle_tab.h.
23228 (main): Call muscle_init ().
23229 * src/Makefile.am (bison_SOURCES): Echo modifications.
23230
93a37297
MA
232312001-09-02 Marc Autret <autret_m@epita.fr>
23232
f753cd62 23233 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 23234
f753cd62
MA
23235 * src/muscle_tab.c, src/muscle_tab.h: Add files.
23236
232372001-09-02 Marc Autret <autret_m@epita.fr>
23238
23239 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 23240
682d48cd
PB
232412001-09-01 Pascal Bart <pascal.bart@epita.fr>
23242
342b8b6e 23243 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
23244 filename.
23245
087c8fda
MA
232462001-09-01 Marc Autret <autret_m@epita.fr>
23247
23248 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
23249 to an explicit value to activate the feature. We do it here.
23250
dda680cb
PB
232512001-08-31 Pascal Bart <pascal.bart@epita.fr>
23252
23253 * src/output.c (prepare): Delete the `filename' muscule insertion.
23254 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
23255 (parse_union_decl): Likewise.
23256 * src/macrotab.c (macro_init): Initialize filename by infile.
23257
9e644e64
MA
232582001-08-31 Marc Autret <autret_m@epita.fr>
23259
23260 * src/bison.simple (YYLSP_NEEDED): New definition.
23261 * src/output.c (prepare): Add macro insertion of `locations_flag'
23262
17da6427
PB
232632001-08-31 Pascal Bart <pascal.bart@epita.fr>
23264
23265 * src/output.c (prepare): Delete insertion of previous muscles,
23266 and insert the `prefix' muscles.
23267 * src/macrotab.c (macro_init): Likewise.
23268 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 23269 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
23270 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
23271 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 23272 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
23273 name_prefix.
23274
e8cb70b9
PB
232752001-08-31 Pascal Bart <pascal.bart@epita.fr>
23276
23277 * src/main.c (main): Standardize.
23278 * src/output.c (output_table_data, output_parser): Likewise.
23279 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
23280
63c2d5de
MA
232812001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
23282
342b8b6e 23283 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
23284 %%epilogue.
23285 * src/output.c (output): Rename %%declarations to %%prologue.
23286 * src/bison.simple: Echo modifications.
342b8b6e 23287
d8cb5183
MA
232882001-08-31 Marc Autret <autret_m@epita.fr>
23289
23290 * src/reader.c (readgram): CleanUp.
23291 (output_token_defines): Likewise.
23292 (packsymbols): Likewise.
23293 (reader): Likewise.
23294 * src/output.c (output): CPP-out useless code.
23295
6c686258
PB
232962001-08-31 Pascal Bart <pascal.bart@epita.fr>
23297
342b8b6e 23298 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
23299 output_trailers and output_headers.
23300 * src/output.h: Remove obsolete functions prototypes of output_headers
23301 and output_trailers.
23302
8f451ef7
PB
233032001-08-30 Pascal Bart <pascal.bart@epita.fr>
23304
23305 * src/main.c: Include macrotab.h.
342b8b6e 23306 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
23307 Adjust functions prototypes.
23308 * src/macrotab.c (macro_insert): Constify key and value.
23309 (macro_find): Constify key.
23310 (macro_insert): Include 'xalloc.h'
23311 (macro_insert): Use XMALLOC.
23312 (macro_find): Constify return value.
23313 * src/output.c (output_table_data): Rename table to table_data.
23314 (output_parser): Constify macro_key, macro_value.
23315
997b6fd0 233162001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
23317
23318 * src/reader.c (parse_skel_decl): New.
342b8b6e 23319 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
23320 * src/lex.h (token_t): New token `tok_skel'.
23321 * src/lex.c (percent_table): Add skeleton option entry.
23322 Standardize.
23323
ff48177d
MA
233242001-08-29 Marc Autret <autret_m@epita.fr>
23325
23326 * src/bison.simple: Add %%user_code directive at the end.
23327 * src/reader.c (read_additionnal_code): New.
23328 (reader): Use it.
23329 * src/output.c (output_program): Remove.
23330 (output): Update.
23331
b33160bf
MA
233322001-08-28 Marc Autret <autret_m@epita.fr>
23333
23334 * src/output.c (output_actions): Clean up.
4e5caae2 23335 (output_gram): CPP-out useless code.
b33160bf
MA
23336 * src/reader.c (reader): Clean up, CPP-out useless code.
23337
d1a2daf7
PB
233382001-08-28 Pascal Bart <pascal.bart@epita.fr>
23339
342b8b6e 23340 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 23341 directive.
d1a2daf7
PB
23342 * src/bison.simple: Add `%%definitions'.
23343
2b763dfe
MA
233442001-08-28 Marc Autret <autret_m@epita.fr>
23345
23346 * config/depcomp: New file.
23347
f1a87ef6
PE
233482001-08-27 Paul Eggert <eggert@twinsun.com>
23349
23350 * src/bison.simple (yyparse): Don't take the address of an
23351 item before the start of an array, as that doesn't conform to
23352 the C Standard.
23353
82e236e2
RA
233542001-08-27 Robert Anisko <robert.anisko@epita.fr>
23355
f1a87ef6 23356 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
23357 obstack. It was done too late here.
23358
23359 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
23360 completely wrong.
23361 (reader): Initialize the macro obstack here, since we need it to grow
23362 '%define' directives.
23363
23364 * src/reader.h: Declare the macro obstack as extern.
23365
b0cfa28a
RA
233662001-08-27 Robert Anisko <robert.anisko@epita.fr>
23367
23368 * src/output.c (output_parser): Fix. Store single '%' characters in
23369 the output obstack instead of throwing them away.
23370
6fc74234
AD
233712001-08-27 Akim Demaille <akim@epita.fr>
23372
23373 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23374
9c76d118
RA
233752001-08-25 Robert Anisko <robert.anisko@epita.fr>
23376
23377 * lib/Makefile.am: Adjust.
23378
a8289c62
RA
233792001-08-25 Robert Anisko <robert.anisko@epita.fr>
23380
23381 * src/bison.simple: Update and add '%%' directives.
23382
b6610515
RA
233832001-08-25 Robert Anisko <robert.anisko@epita.fr>
23384
23385 * src/reader.c (reader): Remove calls to 'output_headers' and
23386 'output_trailers'. Remove some C output.
23387 (readgram): Disable a piece of code that was writing a default
23388 definition for 'YYSTYPE'.
23389 (reader_output_yylsp): Remove.
23390 (packsymbols): Output token defintions to a macro.
23391 (copy_definition): Disable C output.
6fc74234 23392
b6610515
RA
23393 * src/reader.c (parse_macro_decl): New function used to parse macro
23394 declarations.
23395 (copy_string2): Put the body of copy_string into this new function.
23396 Add a parameter to let the caller choose whether he wants to copy the
23397 string delimiters or not.
23398 (copy_string): Be a simple call to copy_string2 with the last argument
23399 bound to true.
23400 (read_declarations): Add case for macro definition.
23401 (copy_identifier): New.
6fc74234 23402 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
23403 rather than lex.
23404
26f609ff
RA
234052001-08-25 Robert Anisko <robert.anisko@epita.fr>
23406
23407 * src/output.c (prepare): Add prefixed names.
23408 (output_parser): Output semantic actions.
23409 (output_parser): Fix bug on '%%line' directives.
6fc74234 23410
26f609ff
RA
23411 * src/output.c (output_headers): Remove. The C code printed by this
23412 function should now be in the skeletons.
23413 (output_trailers): Remove.
23414 (output): Disable call to 'reader_output_yylsp'.
23415 (output_rule_data): Do not output tables to the table obstack.
23416
23417 * src/output.c: Remove some C dedicated output.
23418 Improve the use of macro and output obstacks.
23419 (output_defines): Remove.
6fc74234 23420
26f609ff
RA
23421 * src/output.c (output_token_translations): Associate 'translate'
23422 table with a macro. No output to the table obstack.
23423 (output_gram): Same for 'rhs' and 'prhs'.
23424 (output_stos): Same for 'stos'.
23425 (output_rule_data): Same for 'r1' and 'r2'.
23426 (token_actions): Same for 'defact'.
23427 (goto_actions): Same for 'defgoto'.
23428 (output_base): Same for 'pact' and 'pgoto'.
23429 (output_table): Same for 'table'.
23430 (output_check): Same for 'check'.
6fc74234 23431
26f609ff
RA
23432 * src/output.c (output_table_data): New function.
23433 (output_short_table): Remove.
23434 (output_short_or_char_table): Remove.
6fc74234 23435
26f609ff
RA
23436 * src/output.c (output_parser): Replace most of the skeleton copy code
23437 with something new. Skeletons are now processed character by character
23438 rather than line by line, and Bison looks for '%%' macros. This is the
23439 first step in making Bison's output process (a lot) more flexible.
23440 (output_parser): Use the macro table.
23441
6f43b113
RA
234422001-08-25 Robert Anisko <robert.anisko@epita.fr>
23443
23444 * src/main.c (main): Initialize the macro table.
23445
dd3127cf
RA
234462001-08-25 Robert Anisko <robert.anisko@epita.fr>
23447
23448 * src/lex.c (percent_table): Add tok_define.
23449 * src/lex.h: Add tok_define.
23450
aa321494
RA
234512001-08-25 Robert Anisko <robert.anisko@epita.fr>
23452
23453 * src/macrotab.c: New file.
23454 * src/macrotab.h: New file.
23455 * src/Makefile.am: Update.
23456
68bd3b6b
RA
234572001-08-25 Robert Anisko <robert.anisko@epita.fr>
23458
23459 * lib/hash.c: New file.
23460 * lib/hash.h: New file.
23461 * lib/Makefile.am: Update.
23462
45f8dd1e
AD
234632001-08-15 Akim Demaille <akim@epita.fr>
23464
23465 Version 1.28c.
23466
40a64a7a 234672001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
23468
23469 * src/reader.c (readgram): Indent output macro YYSTYPE.
23470 (packsymbols): Likewise.
23471 (output_token_defines): Likewise.
23472 * src/files.c: Standardize.
23473 (compute_header_macro): New.
23474 (defines_obstack_save): New. Use compute_header_macro.
23475 (output_files): Update. Use defines_obstack_save.
23476
f9a8293a
AD
234772001-08-15 Akim Demaille <akim@epita.fr>
23478
23479 * doc/bison.texinfo (Table of Symbols): Document
23480 YYSTACK_USE_ALLOCA.
23481
150ca7a7
AD
234822001-08-15 Akim Demaille <akim@epita.fr>
23483
23484 * missing: Update from CVS Automake.
23485 * config/config.guess, config/config.sub, config/texinfo.tex:
23486 Update from gnu.org.
23487
69b5cec4
AD
234882001-08-15 Akim Demaille <akim@epita.fr>
23489
23490 * Makefile.maint: Sync with CVS Autoconf.
23491
f2b5126e
PB
234922001-08-14 Pascal Bart <pascal.bart@epita.fr>
23493
69b5cec4 23494 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
23495 `fdl.texi'.
23496 * doc/fdl.texi: Add to package.
23497
4ecbf796
MA
234982001-08-14 Marc Autret <autret_m@epita.fr>
23499
23500 Turn on %{source,header}_extension features.
23501
69b5cec4 23502 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
23503 source_extension.
23504 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 23505 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
23506 between options.
23507
95fb5662
MA
235082001-08-14 Marc Autret <autret_m@epita.fr>
23509
23510 * src/files.c (compute_base_names): Add extensions computing when
23511 `--file-prefix' used.
23512 Standardize function calls.
23513
78d09da9
MA
235142001-08-13 Marc Autret <autret_m@epita.fr>
23515
69b5cec4 23516 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
23517 defining it (defined but null disables alloca).
23518
5a009f2c
MA
235192001-08-13 Marc Autret <autret_m@epita.fr>
23520
23521 * src/bison.simple (_yy_memcpy): CPP reformat.
23522
1e41465a
PB
235232001-08-13 Pascal Bart <pascal.bart@epita.fr>
23524
23525 * tests/atconfig.in (CPPFLAGS): Fix.
23526
c67a198d
PB
235272001-08-10 Pascal Bart <pascal.bart@epita.fr>
23528
79282c6c 23529 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
23530 `gpl.texi'.
23531 * doc/gpl.texi: Add to package.
23532
09a6de7e
MA
235332001-08-10 Marc Autret <autret_m@epita.fr>
23534
23535 * src/print_graph.h: Fix.
23536 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
23537
b77b9ee0
AD
235382001-08-10 Akim Demaille <akim@epita.fr>
23539
23540 * src/system.h: Provide default declarations for stpcpy, strndup,
23541 and strnlen.
23542
3e259915
MA
235432001-08-10 Robert Anisko <anisko_r@epita.fr>
23544
23545 * doc/bison.texinfo (Locations): Update @$ stuff.
23546
ca96bc2d
MA
235472001-08-09 Robert Anisko <anisko_r@epita.fr>
23548
23549 * src/bison.simple (YYLLOC_DEFAULT): Update.
23550 (yyparse): Adjust.
23551
fdc6758b
MA
235522001-08-08 Marc Autret <autret_m@epita.fr>
23553
b77b9ee0 23554 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
23555 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
23556 Reported by Fabrice Bauzac.
957d4dbf 23557
600cad3b
MA
235582001-08-08 Marc Autret <autret_m@epita.fr>
23559
23560 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
23561 * src/vcg.c (output_node): Fix.
23562 * src/vcg.h: Cleanup.
23563 * src/print_graph.c: Add comments.
b77b9ee0 23564 (node_output_size): New global variable. Simplify the formatting of
600cad3b 23565 the VCG graph output.
b77b9ee0 23566 (print_actions): Unused code is now used. It notifies the final state
600cad3b 23567 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 23568 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
23569 blue.
23570 Get the current node name and node_obstack by argument.
23571 (node_obstack): New variable.
23572 (print_state): Manage node_obstack.
23573 (print_core): Use node_obstack given by argument.
23574 A node is not only computed here but in print_actions also.
23575 (print_graph): CPP out useless code instead of commenting it.
23576
976e528f
AD
235772001-08-07 Pascal Bart <pascal.bart@epita.fr>
23578
23579 * tests/atconfig.in (CPPFLAGS): Fix.
23580
20e8e5ca
AD
235812001-08-07 Akim Demaille <akim@epita.fr>
23582
23583 * src/print_graph.c (quote): New.
23584 (print_core): Use it.
23585
957d4dbf 235862001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 23587
3e3da797
AD
23588 * src/vcg.c (complain.h): Include it.
23589 Unepitaize `return' invocations.
c4b66126 23590 [NDEBUG] (main): Remove.
79282c6c 23591 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
23592 * src/files.c (open_files): Initialize graph_obstack.
23593 * src/print_graph.c (print_actions): CPP out useless code.
23594 (print_core): Don't output the last `\n' in labels.
23595 Use `quote'.
23596 * src/files.c (output_files): Output the VCG file.
23597 * src/main.c (main): Invoke print_graph ();
3e3da797 23598
957d4dbf 235992001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
23600
23601 Automaton VCG graph output.
23602 Using option ``-g'' or long option ``--graph'', you can generate
23603 a gram_filename.vcg file containing a VCG description of the LALR (1)
23604 automaton of your grammar.
23605
23606 * src/main.c: Call to print_graph() function.
23607 * src/getargs.h: Update.
23608 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
23609 (graph_flag): New flag.
23610 (longopts): Update.
23611 (getargs): Add case `g'.
23612 * src/files.c (graph_obstack): New obstack struct.
23613 (open_files): Initialize new obstack.
23614 (output_files): Saves graph_obstack if required.
23615 * src/files.h (graph_obstack): New extern declaration.
23616 * src/Makefile.am: Add new source files.
23617
927c1557 236182001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
23619
23620 * src/print_graph.c, src/print_graph.h (graph): New.
23621 * src/vcg.h: New file.
23622 * src/vcg.c: New file, VCG graph handling.
23623
7333d403
AD
236242001-08-06 Marc Autret <autret_m@epita.fr>
23625
23626 Add of %source_extension and %header_extension which specify
23627 the source or/and the header output file extension.
23628
23629 * src/files.c (compute_base_names): Remove initialisation of
23630 src_extension and header_extension.
23631 (compute_exts_from_gf): Update.
23632 (compute_exts_from_src): Update.
23633 (output_files): Update.
23634 * src/reader.c (parse_header_extension_decl): New.
23635 (parse_source_extension_decl): New.
23636 (read_declarations): New case statements for the new tokens.
23637 * src/lex.c (percent_table): Add entries for %source_extension
23638 and %header_extension.
23639 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
23640
84163231
AD
236412001-08-06 Marc Autret <autret_m@epita.fr>
23642
23643 * configure.in: Bump to 1.28c.
23644 * doc/bison.texinfo: Texinfo thingies.
23645
8303fc42
AD
236462001-08-04 Pascal Bart <pascal.bart@epita.fr>
23647
23648 * tests/atconfig.in (CPPFLAGS): Add.
23649 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
23650
70a84437
AD
236512001-08-03 Akim Demaille <akim@epita.fr>
23652
23653 Version 1.28b.
23654
2ce10144
AD
236552001-08-03 Akim Demaille <akim@epita.fr>
23656
23657 * tests/Makefile.am (check-local): Ship testsuite.
23658 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
23659 Include `string.h'.
23660
1e3e4bc1
AD
236612001-08-03 Akim Demaille <akim@epita.fr>
23662
23663 * configure.in: Try using -Wformat when compiling.
23664
42b45b7f
AD
236652001-08-03 Akim Demaille <akim@epita.fr>
23666
23667 * configure.in: Bump to 1.28b.
23668
8f13fe33
AD
236692001-08-03 Akim Demaille <akim@epita.fr>
23670
23671 * src/complain.c: Adjust strerror_r portability issues.
23672
b37ba92c
AD
236732001-08-03 Akim Demaille <akim@epita.fr>
23674
23675 Version 1.28a.
23676
b0ce6046
AD
236772001-08-03 Akim Demaille <akim@epita.fr>
23678
23679 * src/getargs.c, src/getarg.h (skeleton)): Constify.
23680 * src/lex.c (literalchar): Avoid name clashes on `buf'.
23681 * src/getargs.c: Include complain.h.
23682 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
23683 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
23684
d01c415b
AD
236852001-08-03 Akim Demaille <akim@epita.fr>
23686
23687 * src/reader.c (readgram): Display hidden chars in error messages.
23688
459dd1a6
AD
236892001-08-03 Akim Demaille <akim@epita.fr>
23690
23691 Update to gettext 0.10.39.
23692
53b74c0c
AD
236932001-08-03 Akim Demaille <akim@epita.fr>
23694
23695 * lib/strspn.c: New.
23696
234a3be3
AD
236972001-08-01 Marc Autret <autret_m@epita.fr>
23698
23699 * doc/bison.texinfo: Update.
23700 * doc/bison.1 (mandoc): Update.
23701 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
23702 * src/files.c: Support output files extensions computing.
23703 (src_extension): New static variable.
23704 (header_extension): New static variable.
23705 (tr): New function.
23706 (get_extension_index): New function, gets the index of an extension
23707 filename in a string.
23708 (compute_exts_from_gf): New function, computes extensions from the
23709 grammar file extension.
23710 (compute_exts_from_src): New functions, computes extensions from the
23711 C source file extension, file given by ``-o'' option.
23712 (compute_base_names): Update.
23713 (output_files): Update.
23714
847bf1f5
AD
237152001-08-01 Robert Anisko <anisko_r@epita.fr>
23716
d995fee7 23717 * doc/bison.texi: Document @$.
847bf1f5
AD
23718 (Locations): New section.
23719
d074a105
AD
237202001-07-18 Akim Demaille <akim@epita.fr>
23721
23722 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
23723 * config/prev-version.txt, config/move-if-change: New.
23724 * Makefile.am: Adjust.
23725
3419715d
AD
237262001-07-08 Pascal Bart <pascal.bart@epita.fr>
23727
23728 * src/bison.simple (yyparse): Suppress warning `comparaison
23729 between signed and unsigned'.
23730
62ab6972
AD
237312001-07-05 Pascal Bart <pascal.bart@epita.fr>
23732
23733 * src/getargs.h (raw_flag): Remove.
23734 * src/getargs.c: Die on `-r'/`--raw'.
23735 * src/lex.c (parse_percent_token): Die on `%raw'.
23736 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
23737 * tests/calc.at: Suppress test with option `--raw'.
23738
1e24cc5b
AD
237392001-07-14 Akim Demaille <akim@epita.fr>
23740
23741 * config/: New.
23742 * configure.in: Require Autoconf 2.50.
23743 Update to gettext 0.10.38.
23744
32dfccf8
AD
237452001-03-16 Akim Demaille <akim@epita.fr>
23746
23747 * doc/bison.texinfo: ANSIfy the examples.
23748
cd5bd6ac
AD
237492001-03-16 Akim Demaille <akim@epita.fr>
23750
23751 * getargs.c (skeleton): New variable.
23752 (longopts): --skeleton is a new option.
23753 (shortopts, getargs): -S is a new option.
23754 * getargs.h: Declare skeleton.
23755 * output.c (output_parser): Use it.
23756
5141b016
AD
237572001-03-16 Akim Demaille <akim@epita.fr>
23758
23759 * m4/strerror_r.m4: New.
23760 * m4/error.m4: Run AC_FUNC_STRERROR_R.
23761 * lib/error.h, lib/error.c: Update.
23762
447992b9
AD
237632001-03-16 Akim Demaille <akim@epita.fr>
23764
23765 * src/getargs.c (longopts): Clean up.
23766
274d42ce
AD
237672001-02-21 Akim Demaille <akim@epita.fr>
23768
23769 * src/reader.c (gensym): `gensym_count' is your own.
23770 Use a static buf to create the symbol name, as token_buffer is no
23771 longer a buffer.
23772
22c821f3
AD
237732001-02-08 Akim Demaille <akim@epita.fr>
23774
23775 * src/conflicts.c (conflict_report): Be sure not to append to res
23776 between two calls, which could happen if both first sprintf were
23777 skipped, but not the first cp += strlen.
23778
18569462
AD
237792001-02-08 Akim Demaille <akim@epita.fr>
23780
23781 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
23782 New, from fileutils 4.0.37.
23783 * configure.in: Require Autoconf 2.49c. I took some time before
23784 making this decision. This is the only way out for portability
23785 issues in Bison, it would mean way too much duplicate effort to
23786 import in Bison features implemented in 2.49c since 2.13.
23787 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
23788
0d8f3c8a
AD
237892001-02-02 Akim Demaille <akim@epita.fr>
23790
23791 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 23792 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 23793
f17bcd1f
AD
237942001-01-19 Akim Demaille <akim@epita.fr>
23795
23796 Get rid of the ad hoc handling of token_buffer in the scanner: use
23797 the obstacks.
23798
23799 * src/lex.c (token_obstack): New.
23800 (init_lex): Initialize it. No longer call...
23801 (grow_token_buffer): this. Remove it.
23802 Adjust all the places which used it to use the obstack.
23803
511e79b3
AD
238042001-01-19 Akim Demaille <akim@epita.fr>
23805
23806 * src/lex.h: Rename all the tokens:
23807 s/\bENDFILE\b/tok_eof/g;
23808 s/\bIDENTIFIER\b/tok_identifier/g;
23809 etc.
23810 Let them be enums, not #define, to ease debugging.
23811 Adjust all the code.
23812
0d6508ef
AD
238132001-01-18 Akim Demaille <akim@epita.fr>
23814
23815 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
23816 * src/lex.c (maxtoken, grow_token_buffer): Static.
23817
6deb4447
AD
238182001-01-18 Akim Demaille <akim@epita.fr>
23819
23820 Since we now use obstacks, more % directives can be enabled.
23821
23822 * src/lex.c (percent_table): Also accept `%yacc',
23823 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
23824 `%debug'.
23825 Handle the actions for `%semantic_parser' and `%pure_parser' here,
23826 instead of returning a token.
23827 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
23828 * src/reader.c (read_declarations): Adjust.
23829 * src/files.c (open_files): Don't call `compute_base_names', don't
23830 compute `attrsfile' since they depend upon data which might be
23831 *in* the input file now.
23832 (output_files): Do it here.
23833 * src/output.c (output_headers): Document the fact that this patch
23834 introduces a guaranteed SEGV for semantic parsers.
23835 * doc/bison.texinfo: Document them.
23836 * tests/suite.at: Exercise these %options.
23837
ff4423cc
AD
238382000-12-20 Akim Demaille <akim@epita.fr>
23839
23840 Also handle the output file (--verbose) with obstacks.
23841
23842 * files.c (foutput): Remove.
23843 (output_obstack): New.
23844 Adjust all dependencies.
23845 * src/conflicts.c: Return a string.
23846 * src/system.h (obstack_grow_string): Rename as...
23847 (obstack_sgrow): this. Be ready to work with non literals.
23848 (obstack_fgrow4): New.
23849
956dba3a
AD
238502000-12-20 Akim Demaille <akim@epita.fr>
23851
23852 * src/files.c (open_files): Fix the computation of short_base_name
23853 in the case of `-o foo.tab.c'.
23854
337bab46
AD
238552000-12-20 Akim Demaille <akim@epita.fr>
23856
23857 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
23858 (copy_dollar): Now that everything uses obstacks, get rid of the
23859 FILE * parameters.
23860
5d3214b8
AD
238612000-12-20 Akim Demaille <akim@epita.fr>
23862
23863 * src/files.c (open_files): Actually the `.output' file is based
23864 on the short_base_name, not base_name.
23865 * tests/suite.at (Checking output file names): Adjust.
23866
29092a57
AD
238672000-12-20 Akim Demaille <akim@epita.fr>
23868
23869 * src/bison.s1: Remove, we now use directly...
23870 * src/bison.simple: this.
23871 * src/Makefile.am: Use pkgdata instead of data.
23872
ea5607fd
AD
238732000-12-20 Akim Demaille <akim@epita.fr>
23874
23875 * src/files.c (guard_obstack): New.
23876 (open_files): Initialize it.
23877 (output_files): Dump it...
23878 * src/files.h: Export it.
23879 * src/reader.c (copy_guard): Use it.
23880
27110317
AD
238812000-12-19 Akim Demaille <akim@epita.fr>
23882
23883 * src/files.c (outfile, defsfile, actfile): Removed as global
23884 vars.
23885 (open_files): Don't compute them.
23886 (output_files): Adjust.
23887 (base_name, short_base_name): Be global.
23888 Adjust dependencies.
23889
19c50364
AD
238902000-12-19 Akim Demaille <akim@epita.fr>
23891
23892 * src/files.c (strsuffix): New.
23893 (stringappend): Be just like strcat but allocate.
23894 (base_names): Eve out from open_files.
23895 Try to simplify the rather hairy computation of base_name and
23896 short_base_name.
23897 (open_files): Use it.
23898 * tests/suite.at (Checking output file names): New test.
23899
573c1d9f
AD
239002000-12-19 Akim Demaille <akim@epita.fr>
23901
23902 * src/system.h (obstack_grow_literal_string): Rename as...
23903 (obstack_grow_string): this.
23904 * src/output.c (output_parser): Recognize `%% actions' instead of
23905 `$'.
23906 * src/bison.s1: s/$/%% actions/.
23907 * src/bison.hairy: Likewise.
23908
ef7ddedd
AD
239092000-12-19 Akim Demaille <akim@epita.fr>
23910
23911 * src/output.c (output_parser): Compute the `#line' lines when
23912 there are.
23913 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
23914 Suggested by Hans Aberg.
23915
ff61dabd
AD
239162000-12-19 Akim Demaille <akim@epita.fr>
23917
23918 Let the handling of the skeleton files be local to the procedures
23919 that use it.
23920
23921 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
23922 longer static.
23923 (fparser, open_extra_files): Remove.
23924 (open_files, output_files): Don't take care of fparser.
23925 * src/files.h: Adjust.
23926 * src/output.c (output_parser): Open and close the file to the
23927 skeleton.
23928 * src/reader.c (read_declarations): When %semantic_parser, open
23929 fguard.
23930
55b96341
AD
239312000-12-19 Akim Demaille <akim@epita.fr>
23932
23933 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
23934 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
23935
358c15b7
AD
239362000-12-19 Akim Demaille <akim@epita.fr>
23937
23938 * src/files.c (open_files): Yipee! We no longer need all the code
23939 looking for `/tmp' since we have no tmp file.
23940
7de3329e
AD
239412000-12-19 Akim Demaille <akim@epita.fr>
23942
23943 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
23944 New macros.
23945 * src/files.c (open_files): Less dependency on MSDOS etc.
23946
3abcd459
AD
239472000-12-14 Akim Demaille <akim@epita.fr>
23948
23949 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
23950 Provide a default definition.
23951 Use it when executing the default @ action.
23952 * src/reader.c (reader_output_yylsp): No longer include
23953 `timestamp' and `text' in the default YYLTYPE.
23954
2a91a95e
AD
239552000-12-12 Akim Demaille <akim@epita.fr>
23956
23957 * src/reader.c (copy_definition, parse_union_decl, copy_action)
23958 (copy_guard): Quote the file names.
23959 Reported by Laurent Mascherpa.
23960
14d3eb9b
AD
239612000-12-12 Akim Demaille <akim@epita.fr>
23962
23963 * src/output.c (output_headers, output_program, output): Be sure
23964 to escape special characters when outputting filenames.
23965 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
23966 (output_headers): Don't depend on them, Use ACTSTR.
23967
d7045ec6
AD
239682000-11-17 Akim Demaille <akim@epita.fr>
23969
23970 * lib/obstack.h: Formatting changes.
23971 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
23972 prevents type checking.
23973 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
23974 cast the value to (void *): assigning a `foo *' to a `void *'
23975 variable is valid.
23976 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
23977 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
23978 append characters.
23979
6fd54b73
AD
239802000-11-17 Akim Demaille <akim@epita.fr>
23981
23982 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
23983 as...
23984 (suite.m4, regression.m4, calc.m4): these.
23985 * tests/atgeneral.m4: Update from CVS Autoconf.
23986
4c50eae6
AD
239872000-11-17 Akim Demaille <akim@epita.fr>
23988
23989 * tests/regression.m4 (%union and --defines): New test,
23990 demonstrating a current bug in the obstack implementation.
23991
a35f64ea
AD
239922000-11-17 Akim Demaille <akim@epita.fr>
23993
23994 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
23995 macros.
23996 Use them to declare the variables which are global or local to
23997 `yyparse'.
23998
7de23534
AD
239992000-11-17 Akim Demaille <akim@epita.fr>
24000
24001 * acconfig.h: Remove, no longer used.
24002
aa7815f5
AD
240032000-11-07 Akim Demaille <akim@epita.fr>
24004
24005 * src: s/Copyright (C)/Copyright/g.
24006
5af1f549
AD
240072000-11-07 Akim Demaille <akim@epita.fr>
24008
24009 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
24010 defining.
24011 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
24012
553e2b22
AD
240132000-11-07 Akim Demaille <akim@epita.fr>
24014
24015 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
24016 Merge in a single CPP if/else.
24017
8a4f41d6
AD
240182000-11-07 Akim Demaille <akim@epita.fr>
24019
24020 * src/output.c (output): Remove useless variables.
24021 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
24022 argument `data' for consistency with the prototypes.
24023 Qualify it `const'.
24024 (obstack_copy, obstack_copy0): Rename the second argument as
24025 `address' for consistency. Qualify it `const'.
24026 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
24027 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
24028 `const' their input argument (`data' or `address').
24029 Adjust the corresponding macros to include `const' in casts.
24030
095a3fb5
AD
240312000-11-03 Akim Demaille <akim@epita.fr>
24032
24033 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
24034 s/PFILE1/BISON_HAIRY/.
24035 Adjust dependencies.
24036
d1cdce7c
AD
240372000-11-03 Akim Demaille <akim@epita.fr>
24038
090c5ebf 24039 For some reason, this was not applied.
d1cdce7c
AD
24040
24041 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
24042 `unlink': it's no longer used.
24043
9311529b
AD
240442000-11-03 Akim Demaille <akim@epita.fr>
24045
24046 * src/files.c (skeleton_find): New function, eved out of...
24047 (open_files, open_extra_files): here.
24048
d8880f69
AD
240492000-11-03 Akim Demaille <akim@epita.fr>
24050
24051 Don't use `atexit'.
24052
24053 * src/files.c (obstack_save): New function.
24054 (done): Rename as...
24055 (output_files): this.
24056 Use `obstack_save'.
24057 * src/main.c (main): Don't use `atexit' to register `done', since
24058 it no longer has to remove tmp files, just call `output_files'
24059 when there are no errors.
24060
0dbb648e
AD
240612000-11-02 Akim Demaille <akim@epita.fr>
24062
24063 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
24064 `unlink': it's no longer used.
24065 * src/files.h: Formatting changes.
24066
896fe5c1
AD
240672000-11-02 Akim Demaille <akim@epita.fr>
24068
24069 Remove the last uses of mktemp and unlink/delete.
24070
24071 * src/files.c (fdefines, ftable): Removed.
24072 (defines_ostack, table_obstack): New.
24073 Adjust dependencies of the former into uses of the latter.
24074 * src/output.c (output_short_or_char_table, output_short_table):
24075 Convert to using obstacks.
24076 * src/reader.c (copy_comment2): Accept one FILE * and two
24077 obstacks.
24078 (output_token_defines, reader_output_yylsp): Use obstacks.
24079 * src/system.h (obstack_fgrow3): New.
1f65350a 24080 * po/POTFILES.in: Adjust.
896fe5c1 24081
dd60faec
AD
240822000-11-01 Akim Demaille <akim@epita.fr>
24083
24084 Change each use of `fattrs' into a use of `attrs_obstack'.
24085
24086 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
24087 * src/files.c (fattrs): Remove.
24088 (attrs_obstack): New.
24089 Adjust all dependencies.
24090 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
24091
8c7ebe49
AD
240922000-11-01 Akim Demaille <akim@epita.fr>
24093
24094 Introduce obstacks.
24095 Change each use of `faction' into a use of `action_obstack'.
24096
24097 * lib/obstack.h, lib/obstack.c: New files.
24098 * src/files.c (faction): Remove.
24099 (action_obstack): New.
24100 Adjust all dependencies.
24101
77aee789
AD
241022000-10-20 Akim Demaille <akim@epita.fr>
24103
24104 * lib/quote.h (PARAMS): New macro. Use it.
24105
43591cec
AD
241062000-10-16 Akim Demaille <akim@epita.fr>
24107
24108 * src/output.c (output_short_or_char_table): New function.
24109 (output_short_table, output_token_translations): Use it.
24110 (goto_actions): Use output_short_table.
24111
1e9798d5
AD
241122000-10-16 Akim Demaille <akim@epita.fr>
24113
24114 * src/symtab.c (bucket_new): New function.
24115 (getsym): Use it.
24116
24117 * src/output.c (output_short_table): New argument to display the
24118 comment associated with the table.
24119 Adjust dependencies.
24120 (output_gram): Use it.
24121 (output_rule_data): Nicer output layout for YYTNAME.
24122
f282676b
AD
241232000-10-16 Akim Demaille <akim@epita.fr>
24124
24125 * src/lex.c (read_typename): New function.
24126 (lex): Use it.
24127 * src/reader.c (copy_dollar): Likewise.
24128
550a72a3
AD
241292000-10-16 Akim Demaille <akim@epita.fr>
24130
24131 * src/reader.c (copy_comment2): Expect the input stream to be on
24132 the `/' which is suspected to open a comment, instead of being
24133 called after `//' or `/*' was read.
24134 (copy_comment, copy_definition, parse_union_decl, copy_action)
24135 (copy_guard): Adjust.
24136
131e2fef
AD
241372000-10-16 Akim Demaille <akim@epita.fr>
24138
24139 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
24140 `read_signed_integer'.
24141
79282c5a
AD
241422000-10-16 Akim Demaille <akim@epita.fr>
24143
24144 * src/reader.c (copy_dollar): New function.
24145 (copy_guard, copy_action): Use it.
24146
ff4a34be
AD
241472000-10-16 Akim Demaille <akim@epita.fr>
24148
24149 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
24150 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
24151 New files, from Fileutils 4.0.27.
24152 * src/main.c (printable_version): Remove.
24153 * src/lex.c, src/reader.c: Use `quote'.
24154
241552000-10-04 Akim Demaille <akim@epita.fr>
24156
24157 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
24158
14ded682
AD
241592000-10-04 Akim Demaille <akim@epita.fr>
24160
24161 * doc/bison.texinfo: Various typos spotted by Neil Booth.
24162
8e03724b
AD
241632000-10-04 Akim Demaille <akim@epita.fr>
24164
24165 When a literal string is used to define two different tokens,
24166 `bison -v' segfaults.
24167 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
24168
24169 * tests/regression.m4: New file.
24170 Include the core of the sample provided by Piotr Gackiewicz.
24171 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
24172 properly.
24173
a9e64249
AD
241742000-10-04 Akim Demaille <akim@epita.fr>
24175
24176 * src/reader.c (parse_expect_decl): Keep `count' within the size
24177 of `buffer'.
24178 From Neil Booth.
24179
da9abf43
AD
241802000-10-02 Paul Eggert <eggert@twinsun.com>
24181
24182 * bison.s1 (yyparse): Assign the default value
24183 unconditionally, to avoid a GCC warning and make the parser a
24184 tad smaller.
24185
c33638bb
AD
241862000-10-02 Akim Demaille <akim@epita.fr>
24187
24188 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
24189 options.
24190
444c570a
AD
241912000-10-02 Akim Demaille <akim@epita.fr>
24192
24193 * src/derives.c, src/print.c, src/reduce.c: To ease the
24194 translation, move some `\n' out of the translated strings.
24195
89cab50d
AD
241962000-10-02 Akim Demaille <akim@epita.fr>
24197
24198 The location tracking mechanism is precious for parse error
24199 messages. Nevertheless, it is enabled only when `@n' is used in
24200 the grammar, which is a different issue (you can use it in error
24201 message, but not in the grammar per se). Therefore, there should
24202 be another means to enable it.
24203
24204 * src/getargs.c (getargs): Support `--locations'.
24205 (usage): Report it.
24206 * src/getargs.h (locationsflag): Export it.
24207 * src/lex.c (percent_table): Support `%locations'.
24208 * src/reader.c (yylsp_needed): Remove this variable, now replaced
24209 with `locationsflag'.
24210 * doc/bison.texinfo: Document `--locations' and `%locations'.
24211 Sort the options.
24212 * tests/calc.m4: Test it.
24213
24214 For regularity of the names, replace each
24215 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
24216 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
24217 In addition replace each `flag' with `_flag'.
24218
d6c2cba0
AD
242192000-10-02 Akim Demaille <akim@epita.fr>
24220
24221 Also test parse error messages, including with YYERROR_VERBOSE.
24222
24223 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
24224 associative).
24225 Use it to check the computations.
24226 Use it to check `nonassoc' is honored.
24227 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
24228 `--yyerror-verbose'.
24229 (_AT_CHECK_CALC): Adjust to this option.
24230 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
24231
5a35a6cb
AD
242322000-10-02 Akim Demaille <akim@epita.fr>
24233
24234 Test also `--verbose', `--defines' and `--name-prefix'. Testing
24235 the latter demonstrates a flaw in the handling of non debugging
24236 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
24237 was used in order to simplify:
24238
24239 #if YYDEBUG
24240 if (yydebug)
24241 {
24242 ...
24243 }
24244 #endif
24245
24246 into
24247
24248 if (yydebug)
24249 {
24250 ...
24251 }
24252
24253 unfortunately this leads to a CPP conflict when
24254 `--name-prefix=foo' is used since it produces `#define yydebug
24255 foodebug'.
24256
24257 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
24258 (YYDPRINTF): New macro.
24259 Spread its use.
24260 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
24261 the bison options.
24262 Also test `--verbose', `--defines' and `--name-prefix'.
24263
71da9eea
AD
242642000-10-02 Akim Demaille <akim@epita.fr>
24265
24266 Improve the readability of the produced parsers.
24267
24268 * src/bison.s1: Formatting changes.
24269 Improve the comment related to the `$' mark.
24270 (yydefault): Don't fall through to `yyresume': `goto' there.
24271 * src/output.c (output_parser): When the `$' is met, skip the end
24272 of its line.
24273 New variable, `number_of_dollar_signs', to check there's exactly
24274 one `$' in the parser skeleton.
24275
95e36146
AD
242762000-10-02 Akim Demaille <akim@epita.fr>
24277
24278 * lib/xstrdup.c: New file, from the fileutils.
24279 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
24280 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
24281 instead of strlen + xmalloc + strcpy.
24282 * src/symtab.c (copys): Remove, use xstrdup instead.
24283
d7020c20
AD
242842000-10-02 Akim Demaille <akim@epita.fr>
24285
24286 * src/gram.h (associativity): New enum type which replaces the
24287 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
24288 `right_assoc', `left_assoc' and `non_assoc'.
24289 Adjust all dependencies.
24290 * src/reader.c: Formatting changes.
24291 (LTYPESTR): Don't define it, use it as a literal in
24292 `reader_output_yylsp'.
24293 * src/symtab.h (symbol_class): New enum type which replaces the
24294 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
24295 `sunknown', `stoken and `snterm'.
24296
1916f98e
AD
242972000-10-02 Akim Demaille <akim@epita.fr>
24298
24299 * src/getargs.c (fixed_outfiles): Rename as...
24300 (yaccflag): for consistency and accuracy.
24301 Adjust dependencies.
24302
d7913476
AD
243032000-10-02 Akim Demaille <akim@epita.fr>
24304
24305 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
24306 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
24307 difficult and introduced a lot of core dump. It turns out that
24308 Bison used an implementation of `xmalloc' based on `calloc', and
24309 at various places it does depend upon the initialization to 0. I
24310 have not tried to isolate the pertinent places, and all the former
24311 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
24312 someone should address this issue.
24313
24314 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
24315 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
24316 files.
24317 Adjust dependencies.
24318 * src/warshall.h: New file.
24319 Propagate.
24320
340ef489
AD
243212000-10-02 Akim Demaille <akim@epita.fr>
24322
24323 Various anti-`extern in *.c' changes.
24324
24325 * src/system.h: Include `assert.h'.
24326
b2ca4022
AD
243272000-10-02 Akim Demaille <akim@epita.fr>
24328
24329 * src/state.h (nstates, final_state, first_state, first_shift)
24330 (first_reduction): Move their exportation from here...
24331 * src/LR0.h: to here.
24332 Adjust dependencies.
24333 * src/getargs.c (statisticsflag): New variable.
24334 Add support for `--statistics'.
24335 Adjust dependencies.
24336
24337 Remove a lot of now useless `extern' statements in most files.
24338
403b315b
AD
243392000-10-02 Akim Demaille <akim@epita.fr>
24340
24341 * src/LR0.h: New file.
24342 Propagate its use.
24343
07a58c13
AD
243442000-10-02 Akim Demaille <akim@epita.fr>
24345
24346 * src/print.h: New file.
24347 Propagate its use.
24348 * src/print.c: Formatting and ordering changes.
24349 (verbose, terse): Replace with...
24350 (print_results): this new function.
24351 Adjust dependencies.
24352
0619caf0
AD
243532000-10-02 Akim Demaille <akim@epita.fr>
24354
24355 * src/conflicts.c (conflict_report): New function.
24356 (conflict_log, verbose_conflict_log): Replace with...
24357 (print_conflicts): this function.
24358 Adjust dependencies.
24359 * src/conflicts.h: New file.
24360 Propagate its inclusion.
24361
3519ec76
AD
243622000-10-02 Akim Demaille <akim@epita.fr>
24363
24364 * src/nullable.h: New file.
24365 Propagate its inclusion.
24366 * src/nullable.c: Formatting changes.
24367
015acc48
AD
243682000-10-02 Akim Demaille <akim@epita.fr>
24369
24370 * src/reduce.h: New file.
24371 Propagate its inclusion.
24372 * src/reduce.c: Topological sort and other formatting changes.
24373 (bool, TRUE, FALSE): Move their definition to...
24374 * src/system.h: here.
24375
8963a27b
AD
243762000-10-02 Akim Demaille <akim@epita.fr>
24377
24378 * src/files.c: Formatting changes.
24379 (tryopen, tryclose, openfiles): Rename as...
24380 (xfopen, xfclose, open_files): this.
24381 (stringappend): static.
24382 * src/files.h: Complete the list of exported symbols.
24383 Propagate its use.
24384
a70083a3
AD
243852000-10-02 Akim Demaille <akim@epita.fr>
24386
24387 * src/reader.h: New file.
24388 Propagate its use instead of tedious list of `extern' and
24389 prototypes.
24390 * src/reader.c: Formatting changes, topological sort,
24391 s/register//.
24392
abadc117
AD
243932000-10-02 Akim Demaille <akim@epita.fr>
24394
24395 * src/lex.h: Prototype `lex.c' exported functions.
24396 * src/reader.c: Adjust.
24397 * src/lex.c: Formatting changes.
24398 (safegetc): Rename as...
24399 (xgetc): this.
24400
720d742f
AD
244012000-10-02 Akim Demaille <akim@epita.fr>
24402
24403 * src/lalr.h: New file.
24404 Propagate its inclusion instead of prototypes and `extern'.
24405 * src/lalr.c: Formatting changes, topological sorting etc.
24406
f2acea59
AD
244072000-10-02 Akim Demaille <akim@epita.fr>
24408
24409 * src/output.c (token_actions): Introduce a temporary array,
24410 YYDEFACT, that makes it possible for this function to use
24411 output_short_table.
24412
d019d655
AD
244132000-10-02 Akim Demaille <akim@epita.fr>
24414
24415 `user_toknums' is output as a `short[]' in `output.c', while it is
24416 defined as a `int[]' in `reader.c'. For consistency with the
24417 other output tables, `user_toknums' is now defined as a table of
24418 shorts.
24419
24420 * src/reader.c (user_toknums): Be a short table instead of an int
24421 table.
24422 Adjust dependencies.
24423
24424 Factor the short table outputs.
24425
24426 * src/output.c (output_short_table): New function.
24427 * src/output.c (output_gram, output_stos, output_rule_data)
24428 (output_base, output_table, output_check): Use it.
24429
6c89f1c1
AD
244302000-10-02 Akim Demaille <akim@epita.fr>
24431
24432 * src/output.c (output): Topological sort of the functions, in
24433 order to get rid of the `static' prototypes.
24434 No longer use `register'.
24435 * src/output.h: New file.
24436 Propagate its inclusion in files explicitly prototyping functions
24437 from output.c.
24438
d9efd181
AD
244392000-09-21 Akim Demaille <akim@epita.fr>
24440
24441 * src/atgeneral.m4: Update from Autoconf.
24442
c29240e7 244432000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
24444
24445 * src/closure.h: New file.
24446 * src/closure.c: Formatting changes, topological sort over the
24447 functions, use of closure.h.
24448 (initialize_closure, finalize_closure): Rename as...
24449 (new_closure, free_closure): these. Adjust dependencies.
24450 * src/LR0.c: Formatting changes, topological sort, use of
24451 cloture.h.
24452 (initialize_states): Rename as...
24453 (new_states): this.
24454 * src/Makefile.am (noinst_HEADERS): Adjust.
24455
499daa50
AD
244562000-09-20 Akim Demaille <akim@epita.fr>
24457
24458 * src/acconfig.h: Don't protect config.h against multiple
24459 inclusion.
24460 Don't define PARAMS.
24461 * src/system.h: Define PARAMS.
24462 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
24463 purpose of config.h. system.h must not try to fix wrong
24464 definitions in config.h.
24465
cc84fd5d
AD
244662000-09-20 Akim Demaille <akim@epita.fr>
24467
24468 * src/derives.h: New file.
24469 * src/main.c, src/derives.h: Use it.
24470 Formatting changes.
24471 * src/Makefile.am (noinst_HEADERS): Adjust.
24472
db5b3a89
AD
244732000-09-20 Akim Demaille <akim@epita.fr>
24474
24475 * tests/atgeneral.m4: Update from Autoconf.
24476 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
24477 (AT_CHECK_CALC): New macros.
24478 Use these macros to test bison with options `', `--raw',
24479 `--debug', `--yacc', `--yacc --debug'.
24480
ceed8467
AD
244812000-09-19 Akim Demaille <akim@epita.fr>
24482
24483 * src/output.c: Formatting changes.
24484 * src/machine.h: Remove, leaving its contents in...
24485 * src/system.h: here.
24486 Include stdio.h.
24487 Adjust all dependencies on stdio.h and machine.h.
24488 * src/getargs.h: New file.
24489 Let all `extern' declarations about getargs.c be replaced with
24490 inclusion of `getargs.h'.
24491 * src/Makefile.am (noinst_HEADERS): Adjust.
24492
24493 * tests/calc.m4 (yyin): Be initialized in main, not on the global
24494 scope.
24495 (yyerror): Returns void, not int.
24496 * doc/bison.texinfo: Formatting changes.
24497
05a1d24b
AD
244982000-09-19 Akim Demaille <akim@epita.fr>
24499
24500 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
24501 portable.
24502
cbd25751
AD
245032000-09-18 Akim Demaille <akim@epita.fr>
24504
24505 * configure.in: Append WARNING_CFLAGS to CFLAGS.
24506 * src/Makefile.am (INCLUDES): Don't.
24507 Be ready to fetch headers in lib/.
24508
13863333
AD
245092000-09-18 Akim Demaille <akim@epita.fr>
24510
24511 * doc/bison.texinfo: Update the copyright.
24512 ANSIfy and GNUify the examples.
24513 Remove the old menu.
24514
0d533154
AD
245152000-09-18 Akim Demaille <akim@epita.fr>
24516
24517 First set of tests: use the `calc' example from the documentation.
24518
24519 * src/bison.s1 (yyparse): Condition the code using `yytname' which
24520 is defined only when YYDEBUG is.
24521 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
24522 * src/files.c (tryopen, tryclose): Formatting changes.
24523 Move to the top and be static.
24524 * src/reader.c (read_signed_integer): Likewise.
24525 * tests/calc.m4: New file.
24526 * Makefile.am, suite.m4: Adjust.
24527 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
24528
e79137ac
AD
245292000-09-18 Akim Demaille <akim@epita.fr>
24530
24531 Add support for an Autotest test suite for Bison.
24532
24533 * m4/m4.m4, m4/atconfig.m4: New files.
24534 * m4/Makefile.am (EXTRA_DIST): Adjust.
24535 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
24536 files.
24537 * src/getargs.c: Display a more standard --version message.
24538 * src/reader.c (reader): Formatting changes.
24539 No longer depend upon VERSION_STRING.
24540 * configure.in: No longer use `dnl'.
24541 Set up the test suite and the new directory `tests/.
24542 (VERSION_STRING): Remove.
24543
27821bff
AD
245442000-04-14 Akim Demaille <akim@epita.fr>
24545
24546 * src/reader.c (copy_comment2): New function, same as former
24547 `copy_comment', but outputs into two FILE *.
24548 (copy_comment): Use it.
24549 (parse_union_decl): Use it.
24550 (get_type, parse_start_decl): Use the same `invalid' message.
24551 (parse_start_decl, parse_union_decl): Use the same `multiple'
24552 message.
24553 (parse_union_decl, copy_guard, copy_action): Use the same
24554 `unmatched' message.
24555 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
24556
cfe5fbc0
AD
245572000-03-31 Akim Demaille <akim@epita.fr>
24558
24559 * src/files.c (tryopen, tryclose): Move to the top.
24560 Be static.
24561
cb7db13e
AD
245622000-03-31 Akim Demaille <akim@epita.fr>
24563
24564 * src/main.c (main): Don't call `done', exit does it.
24565
a0f6b076
AD
245662000-03-31 Akim Demaille <akim@epita.fr>
24567
36281465
AD
24568 * allocate.c: s/return (foo)/return foo/.
24569 * lalr.c: Likewise.
24570 * LR0.c: Likewise.
24571 * output.c: Likewise.
24572 * reader.c: Likewise.
24573 * symtab.c: Likewise.
24574 * vmsgetargs.c: Likewise.
24575
245762000-03-31 Akim Demaille <akim@epita.fr>
24577
24578 Clean up the error reporting functions.
a0f6b076
AD
24579
24580 * src/report.c: New file.
24581 * src/report.h: Likewise.
24582 * src/Makefile.am: Adjust.
24583 * m4/error.m4: New file.
24584 * m4/Makefile.am: Adjust.
24585 * configure.in (jm_PREREQ_ERROR): Call it.
24586 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
24587 Remove.
24588 (fatal, fatals): Remove. All callers use complain.c::fatal.
24589 (warn, warni, warns, warnss, warnss): Remove. All callers use
24590 complain.c::complain.
24591 (toomany): Remove, use fatal instead.
24592 * src/files.c (done): No argument, use complain_message_count.
24593 * src/main.c (main): Register `done' to `atexit'.
24594
24595 * src/getargs.c (usage): More `fputs', less `fprintf'.
24596
18539825
AD
245972000-03-28 Akim Demaille <akim@epita.fr>
24598
24599 * lib/: New directory.
24600 * Makefile.am (SUBDIRS): Adjust.
24601 * configure.in: Adjust.
24602 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
24603 useless.
24604 * src/alloca.c: Moved to lib/.
24605 * src/getopt.c: Likewise.
24606 * src/getopt1.c: Likewise.
24607 * src/getopt.h: Likewise.
24608 * src/ansi2knr.c: Likewise.
24609 * src/ansi2knr.1: Likewise.
24610 * src/Makefile.am: Adjust.
24611 * lib/Makefile.am: New file.
24612
9f306f2a
AD
246132000-03-28 Akim Demaille <akim@epita.fr>
24614
24615 * src/getargs.c (usage): Refresh the help message.
24616
0ba347b6
AD
246172000-03-17 Akim Demaille <akim@epita.fr>
24618
24619 * src/getopt1.c: Updated from textutils 2.0e
24620 * src/getopt.c: Likewise.
24621 * src/getopt.h: Likewise.
24622
dbe7f271
AD
246232000-03-17 Akim Demaille <akim@epita.fr>
24624
24625 * src/Makefile.am (bison.simple): Fix the awk program: quote only
24626 the file name, not the whole `#line LINE FILE'.
24627
75bbe78d
AD
246282000-03-17 Akim Demaille <akim@epita.fr>
24629
24630 On syntax errors, report the token on which we choked.
24631
aa5fd0ee
AD
24632 * src/bison.s1 (yyparse): In the label yyerrlab, when
24633 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 24634
7b306f52
AD
246352000-03-17 Akim Demaille <akim@epita.fr>
24636
aa5fd0ee 24637 * src/reader.c (copy_at): New function.
7b306f52
AD
24638 (copy_guard): Use it.
24639 (copy_action): Use it.
24640
e87b5700
AD
246412000-03-17 Akim Demaille <akim@epita.fr>
24642
24643 Be kind to translators, save some useless translations.
24644
aa5fd0ee 24645 * src/main.c (banner): New function.
e87b5700
AD
24646 (fatal_banner): Use it.
24647 (warn_banner): Use it.
24648
ae3c3164
AD
246492000-03-17 Akim Demaille <akim@epita.fr>
24650
aa5fd0ee
AD
24651 * src/reader.c (copy_definition): Use copy_string and
24652 copy_comment. Removed now unused `match', `ended',
24653 `cplus_comment'.
ae3c3164
AD
24654 (copy_comment, copy_string): Moved, to be visible from
24655 copy_definition.
24656
4dc58e7c
AD
246572000-03-17 Akim Demaille <akim@epita.fr>
24658
aa5fd0ee
AD
24659 * src/reader.c (copy_string): Declare `static inline'. No
24660 problems with inline, since it is checked by configure.
4dc58e7c
AD
24661 (copy_comment): Likewise.
24662
0a6384c4
AD
246632000-03-17 Akim Demaille <akim@epita.fr>
24664
aa5fd0ee 24665 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 24666
3cef001a
AD
246672000-03-17 Akim Demaille <akim@epita.fr>
24668
aa5fd0ee 24669 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
24670 (copy_action): Use it. Removed now unused `match', `ended',
24671 `cplus_comment'.
24672 (copy_guard): Likewise.
24673
ca36d2ef
AD
246742000-03-17 Akim Demaille <akim@epita.fr>
24675
aa5fd0ee 24676 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
24677 (copy_action): Use it.
24678 (copy_guard): Likewise.
24679
6666f98f
AD
246802000-03-17 Akim Demaille <akim@epita.fr>
24681
24682 Change the handling of @s so that they behave exactly like $s.
24683 There is now a pseudo variable @$ (readble and writable), location
24684 of the lhs of the rule (by default ranging from the location of
24685 the first symbol of the rhs, to the location of the last symbol,
24686 or, if the rhs is empty, YYLLOC).
24687
24688 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
24689 yyval.
24690 (yyparse): When providing a default semantic action, provide a
24691 default location action.
24692 (after the $): No longer change `*YYLSP', just stack YYLOC the
24693 same way you stack YYVAL.
24694 * src/reader.c (read_declarations): Use warns.
24695 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
24696 (copy_action, case '@'): Likewise.
24697 Use a standard error message, to save useless work from
24698 translators.
24699
41aca2e0
AD
247002000-03-17 Akim Demaille <akim@epita.fr>
24701
aa5fd0ee
AD
24702 * src/bison.s1: Formatting and cosmetics changes.
24703 * src/reader.c: Likewise.
41aca2e0
AD
24704 Update the Copyright notice.
24705
dc08c1d5
AD
247062000-03-17 Akim Demaille <akim@epita.fr>
24707
aa5fd0ee
AD
24708 * src/bison.s1 (#line): All set to `#line' only, since the
24709 Makefile now handles them.
dc08c1d5 24710
9ee3c97b
AD
247112000-03-16 Akim Demaille <akim@epita.fr>
24712
24713 * src/output.c (output_rule_data): Output the documentation of
24714 some of the tables.
24715 (Copyright notice): Update.
24716 Formatting changes.
24717
0de741ca
AD
247182000-03-16 Akim Demaille <akim@epita.fr>
24719
24720 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
24721 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
24722 One `#if YYDEBUG' remains, since it uses variables which are
24723 defined only if `YYDEBUG != 0'.
24724
bb10be54
AD
247252000-03-16 Akim Demaille <akim@epita.fr>
24726
24727 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
24728 and related variables so that the similarities are highlighted.
24729
b07b484a
AD
247302000-03-16 Akim Demaille <akim@epita.fr>
24731
24732 * src/bison.s1: Properly indent CPP directives.
24733
361f60b3
AD
247342000-03-16 Akim Demaille <akim@epita.fr>
24735
24736 * src/bison.s1: Properly indent the `alloca' CPP section.
24737
8c44d3ec
AD
247382000-03-16 Akim Demaille <akim@epita.fr>
24739
24740 Do not hard code values of directories in `configure.in'.
24741 Update the `configure' tool chain.
24742
24743 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
24744 src/makefile.am.
24745 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
24746 (AC_OUTPUT): Add m4/Makefile.
24747 Bump to bison 1.28a, 1.29 has never been released.
24748 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
24749 handled via src/Makefile.am.
24750 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
24751 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
24752 autoheader.
24753 * Makefile.am (SUBDIRS): Add m4.
24754 (ACLOCAL_AM_FLAGS): New variable.
24755 (AUTOMAKE_OPTIONS): Add check-news.
24756 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
24757 the proper line number and file name.
24758 (DEFS): Propagate the location of bison library files and of the
24759 locale files.
24760 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
24761 builddir.
24762 * acinclude.m4: Remove, replaced by the directory m4.
24763 * m4/Makefile.am (EXTRA_DIST): New variable.
24764 * m4/gettext.m4: New file, from the fileutils.
24765 * m4/lcmessage.m4: Likewise
24766 * m4/progtest.m4: Likewise.
24767 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
24768
f95997e7
AD
247692000-03-10 Akim Demaille <akim@epita.fr>
24770
24771 * src/closure.c:
24772 Formatting changes of various comments.
24773 Respect the GNU coding standards at various places.
24774 Don't use `_()' when no translation is needed.
24775
247761999-12-13 Jesse Thilo <jthilo@gnu.org>
24777
24778 * src/files.c:
24779 OS/2 honors TMPDIR environment variable.
24780
247811999-12-13 Jesse Thilo <jthilo@gnu.org>
24782
24783 * doc/bison.texinfo: Tweaked spelling and grammar.
24784 Updated ISBN.
24785 Removed reference to price of printed copy.
24786 Mention BISON_SIMPLE and BISON_HAIRY.
24787
247881999-12-13 Jesse Thilo <jthilo@gnu.org>
24789
24790 * configure.in, NEWS:
24791 Bison 1.29 released.
24792
247931999-10-27 Jesse Thilo <jthilo@gnu.org>
24794
24795 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
24796 Added reference card.
24797
247981999-07-26 Jesse Thilo <jthilo@gnu.org>
24799
24800 * po/ru.po: Added Russian translation.
24801
248021999-07-26 Jesse Thilo <jthilo@gnu.org>
24803
24804 * configure.in: Added Russian translation.
24805
248061999-07-06 Jesse Thilo <jthilo@gnu.org>
24807
24808 * configure.in, NEWS, README:
24809 Released version 1.28.
24810
248111999-06-14 Jesse Thilo <jthilo@gnu.org>
24812
24813 * src/system.h:
24814 Squashed redefinition warning on some systems.
24815
24816 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
24817 Have configure build version string instead of relying on ANSI string
24818 concatentation.
24819
248201999-06-14 Jesse Thilo <jthilo@gnu.org>
24821
24822 * po/POTFILES.in: Got rid of version.c.
24823
248241999-06-14 Jesse Thilo <jthilo@gnu.org>
24825
24826 * acconfig.h, configure.in:
24827 Have configure build version string instead of relying on ANSI string
24828 concatentation.
24829
248301999-06-08 Jesse Thilo <jthilo@gnu.org>
24831
24832 * doc/bison.1:
24833 Dropped mention of `+' for long-named options.
24834
248351999-05-30 Jesse Thilo <jthilo@gnu.org>
24836
24837 * src/files.c: Added <unistd.h> for unlink().
24838
24839 * src/Makefile.am, src/system.h:
24840 I18n fixes.
24841
248421999-05-30 Jesse Thilo <jthilo@gnu.org>
24843
24844 * README: Added a FAQ list.
24845
24846 * configure.in, acconfig.h:
24847 I18n fixes.
24848
248491999-05-30 Jesse Thilo <jthilo@gnu.org>
24850
24851 * doc/FAQ, doc/Makefile.am:
24852 Added a FAQ list.
24853
248541999-05-19 Jesse Thilo <jthilo@gnu.org>
24855
24856 * src/alloc.h, src/symtab.h, src/version.c:
24857 Protected inclusion of "config.h" with HAVE_CONFIG_H.
24858
248591999-04-18 Jesse Thilo <jthilo@gnu.org>
24860
24861 * src/.cvsignore, src/Makefile.am:
24862 Reorganized: sources in `src', documentation in `doc'.
24863
24864 * src/lex.c (literalchar):
24865 fixed the code for escaping double quotes (thanks
24866 Jonathan Czisny.)
24867
248681999-04-18 Jesse Thilo <jthilo@gnu.org>
24869
24870 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
24871 Adjusted paths to reflect directory reorganization.
24872
248731999-04-18 Jesse Thilo <jthilo@gnu.org>
24874
24875 * doc/.cvsignore, doc/Makefile.am:
24876 Reorganized: sources in `src', documentation in `doc'.
24877
248781999-04-18 Jesse Thilo <jthilo@gnu.org>
24879
24880 * configure.in:
24881 Updated AC_INIT file to reflect directory reorganization.
24882
24883 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
24884 Reorganized: sources in `src', documentation in `doc'.
24885
248861999-04-13 Jesse Thilo <jthilo@gnu.org>
24887
24888 * src/allocate.c:
24889 Don't declare calloc() and realloc() if not necessary.
24890
248911999-04-13 Jesse Thilo <jthilo@gnu.org>
24892
24893 * configure.in, acconfig.h, acinclude.m4:
24894 Don't declare calloc() and realloc() if not necessary.
24895
248961999-03-23 Jesse Thilo <jthilo@gnu.org>
24897
24898 * po/.cvsignore: Added i18n support.
24899
249001999-03-23 Jesse Thilo <jthilo@gnu.org>
24901
24902 * acconfig.h, configure.in, Makefile.am:
24903 Added i18n support.
24904
249051999-03-22 Jesse Thilo <jthilo@gnu.org>
24906
24907 * src/bison.s1: Fixed #line numbers.
24908
249091999-03-15 Jesse Thilo <jthilo@gnu.org>
24910
24911 * po/es.po, po/fr.po, po/nl.po, po/de.po:
24912 Added PO files from Translation Project.
24913
249141999-03-03 Jesse Thilo <jthilo@gnu.org>
24915
24916 * Makefile.am:
24917 Added support for non-ANSI compilers (ansi2knr).
24918
249191999-02-16 Jesse Thilo <jthilo@gnu.org>
24920
24921 * configure.in: Bumped version number to 1.27.
24922
24923 * Makefile.am:
24924 Added `bison.simple' to list of files removed by `make distclean'.
24925
249261999-02-12 Jesse Thilo <jthilo@gnu.org>
24927
24928 * src/files.c, src/files.h:
24929 Defined locations of parser files in config.h instead of Makefile.
24930
249311999-02-12 Jesse Thilo <jthilo@gnu.org>
24932
24933 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
24934 Defined locations of parser files in config.h instead of Makefile.
24935
249361999-02-09 Jesse Thilo <jthilo@gnu.org>
24937
24938 * Makefile.am:
24939 Removed inappropriate use of $< macro.
24940
249411999-02-05 Jesse Thilo <jthilo@gnu.org>
24942
24943 * po/Makefile.in.in, po/POTFILES.in:
24944 Add `po' directory skeleton.
24945
249461999-01-27 Jesse Thilo <jthilo@gnu.org>
24947
24948 * README: Document help-bison list.
24949
24950 * configure.in: Add check for mkstemp().
24951
249521999-01-20 Jesse Thilo <jthilo@gnu.org>
24953
24954 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
24955 Hush a few compiler warnings.
24956
24957 * src/files.c:
24958 Add tryclose(), which verifies that fclose was successful.
24959 Hush a couple of compiler warnings.
24960
249611999-01-20 Jesse Thilo <jthilo@gnu.org>
24962
24963 * Makefile.am, OChangeLog:
24964 ChangeLog is now automatically generated. Include the old version as
24965 OChangeLog.
24966
249671999-01-14 Jesse Thilo <jthilo@gnu.org>
24968
24969 * 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:
24970 Update FSF address.
24971
249721999-01-14 Jesse Thilo <jthilo@gnu.org>
24973
24974 * doc/bison.texinfo: Fix formatting glitch.
24975
24976 * doc/bison.texinfo: Update FSF address.
24977
249781999-01-14 Jesse Thilo <jthilo@gnu.org>
24979
24980 * acconfig.h: Update FSF address.
24981
249821999-01-08 Jesse Thilo <jthilo@gnu.org>
24983
24984 * src/system.h:
24985 Don't define PACKAGE here, since config.h defines it.
24986
249871998-12-30 Jesse Thilo <jthilo@gnu.org>
24988
24989 * src/reader.c: Update copyright date.
24990
24991 * src/main.c:
24992 Ditch sprintf to statically-sized buffers in fatal/warn functions in
24993 favor of output directly to stderr (avoids buffer overruns).
24994
24995 * src/reader.c: Some checks for premature EOF.
24996
24997 * 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:
24998 Use prototypes if the compiler understands them.
24999
25000 * src/files.c: Honor TMPDIR on Unix hosts.
25001 Use prototypes if the compiler understands them.
25002
25003 * src/reader.c:
25004 Fix a couple of buffer overrun bugs.
25005 Use prototypes if the compiler understands them.
25006
25007 * src/system.h: Include unistd.h and ctype.h.
25008 Use #ifdef instead of #if for NLS symbols.
25009
250101998-12-30 Jesse Thilo <jthilo@gnu.org>
25011
25012 * doc/bison.texinfo:
25013 Delete comment "consider using @set for edition number, etc..." since
25014 we now are doing so.
25015
250161998-12-30 Jesse Thilo <jthilo@gnu.org>
25017
25018 * configure.in:
25019 Use prototypes if the compiler understands them.
25020
25021 * NEWS: Document 1.26 highlights.
25022
25023 * Makefile.am: Require Automake 1.3 or later.
25024
25025 * acconfig.h:
25026 Use prototypes if the compiler understands them.
25027
250281998-12-29 Jesse Thilo <jthilo@gnu.org>
25029
25030 * src/version.c:
25031 Use VERSION symbol from automake for version number.
25032
250331998-12-29 Jesse Thilo <jthilo@gnu.org>
25034
25035 * acconfig.h, configure.in, version.cin:
25036 Use VERSION symbol from automake for version number.
25037
250381998-11-28 Jesse Thilo <jthilo@gnu.org>
25039
25040 * Makefile.am:
25041 Distribute original version of simple parser (bison.s1), not built
25042 version (bison.simple).
25043
250441998-11-28 Jesse Thilo <jthilo@gnu.org>
25045
25046 * doc/bison.texinfo: Add info dir entry.
25047
25048 * doc/bison.texinfo:
25049 Let automake put version number into documentation.
25050
250511998-11-26 Jesse Thilo <jthilo@gnu.org>
25052
25053 * src/bison.cld, src/build.com, src/vmshlp.mar:
25054 Add non-RCS files from /gd/gnu/bison.
25055
250561998-11-26 Jesse Thilo <jthilo@gnu.org>
25057
25058 * doc/bison.1:
25059 Document the BISON_HAIRY and BISON_SIMPLE variables.
25060
250611998-11-25 Jesse Thilo <jthilo@gnu.org>
25062
25063 * src/version.c: Build version.c automatically.
25064
25065 * src/reader.c:
25066 Fix token numbering (used to start at 258, not 257).
25067
25068 * src/system.h: Include config.h.
25069
25070 * src/getargs.c: Update bug report address.
25071
25072 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
25073 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
25074
250751998-11-25 Jesse Thilo <jthilo@gnu.org>
25076
25077 * Makefile.am:
25078 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
25079
25080 * configure.in, version.cin:
25081 Build version.c automatically.
25082
25083 * AUTHORS: Add AUTHORS file.
25084
25085 * README: Update bug report address.
25086
25087 * bison.simple:
25088 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
25089
25090 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
25091 Add automake stuff.
25092
250931998-11-25 Jesse Thilo <jthilo@gnu.org>
25094
25095 * doc/bison.texinfo: Clean up some formatting.
25096
250971998-05-05 Richard Stallman <rms@gnu.org>
25098
25099 * doc/bison.texinfo:
25100 Explain better why to make a pure parser.
25101
251021998-01-05 Richard Stallman <rms@gnu.org>
25103
25104 * src/files.c (openfiles):
25105 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
25106 find a temporary directory, if possible. Do not unlink files while
25107 they are open.
25108
251091997-08-25 Richard Stallman <rms@gnu.org>
25110
25111 * src/reader.c (stack_offset;):
25112 Change some warni to warns.
25113
25114 * src/lex.c (literalchar): Use warns, not warni.
25115
251161997-06-28 Richard Stallman <rms@gnu.org>
25117
25118 * src/bison.s1: Add a Bison version comment.
25119
25120 * src/main.c (fatal, warn, berror):
25121 Use program_name.
25122
251231997-06-28 Richard Stallman <rms@gnu.org>
25124
25125 * Makefile.in (bison_version): New variable.
25126 (dist): Use that variable.
25127 (bison.s1): Substitute the Bison version into bison.simple.
25128
25129 * bison.simple: Add a Bison version comment.
25130
251311997-06-18 Richard Stallman <rms@gnu.org>
25132
25133 * src/main.c (fatal, warn, berror):
25134 Make error messages standard.
25135 (toomany): Improve error message text.
25136
25137 * 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:
25138 new.h renamed to alloc.h.
25139
251401997-06-18 Richard Stallman <rms@gnu.org>
25141
25142 * Makefile.in: new.h renamed to alloc.h.
25143
251441997-05-24 Richard Stallman <rms@gnu.org>
25145
25146 * src/lex.c (literalchar):
25147 Fix the code for escaping \, " and '.
25148
25149 (lex): Avoid trouble when there are many chars
25150 to discard in a char literal with just several chars in it.
25151
251521997-05-17 Richard Stallman <rms@gnu.org>
25153
25154 * src/bison.s1:
25155 Use malloc, if using alloca is troublesome.
25156 (YYSTACK_USE_ALLOCA): New flag macro.
25157 Define it for some systems and compilers.
25158 (YYSTACK_ALLOC): New macro.
25159 (yyparse): Use YYSTACK_ALLOC to allocate stack.
25160 If it was malloc'd, free it.
25161
251621997-05-17 Richard Stallman <rms@gnu.org>
25163
25164 * bison.simple:
25165 Use malloc, if using alloca is troublesome.
25166 (YYSTACK_USE_ALLOCA): New flag macro.
25167 Define it for some systems and compilers.
25168 (YYSTACK_ALLOC): New macro.
25169 (yyparse): Use YYSTACK_ALLOC to allocate stack.
25170 If it was malloc'd, free it.
25171
251721997-04-23 Richard Stallman <rms@gnu.org>
25173
25174 * src/bison.s1:
25175 (alloca) [__hpux]: Always define as __builtin_alloca.
25176
251771997-04-23 Richard Stallman <rms@gnu.org>
25178
25179 * bison.simple:
25180 (alloca) [__hpux]: Always define as __builtin_alloca.
25181
251821997-04-22 Richard Stallman <rms@gnu.org>
25183
25184 * src/bison.s1:
25185 [__hpux]: Include alloca.h (right for HPUX 10)
25186 instead of declaring alloca (right for HPUX 9).
25187
25188 * src/bison.s1 (__yy_memcpy):
25189 Declare arg `count' as unsigned int.
25190 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
25191
251921997-04-22 Richard Stallman <rms@gnu.org>
25193
25194 * bison.simple:
25195 [__hpux]: Include alloca.h (right for HPUX 10)
25196 instead of declaring alloca (right for HPUX 9).
25197
25198 * bison.simple (__yy_memcpy):
25199 Declare arg `count' as unsigned int.
25200 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
25201
252021997-01-03 Richard Stallman <rms@gnu.org>
25203
25204 * src/allocate.c: [__STDC__ or _MSC_VER]:
25205 Declare calloc and realloc to return void *.
25206
252071997-01-02 Richard Stallman <rms@gnu.org>
25208
25209 * src/system.h:
25210 [_MSC_VER]: Include stdlib.h and process.h.
25211 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
25212
25213 * src/main.c (main): Return FAILURE as a value.
25214 (printable_version): Declare arg as int, not char.
25215
252161997-01-02 Richard Stallman <rms@gnu.org>
25217
25218 * Makefile.in (dist):
25219 Explicitly check for symlinks, and copy them.
25220
252211996-12-19 Richard Stallman <rms@gnu.org>
25222
25223 * src/files.c:
25224 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
25225
252261996-12-18 Paul Eggert <eggert@gnu.org>
25227
25228 * src/bison.s1 (yyparse):
25229 If __GNUC__ and YYPARSE_PARAM are both defined,
25230 declare yyparse to have a void * argument.
25231
252321996-12-18 Paul Eggert <eggert@gnu.org>
25233
25234 * bison.simple (yyparse):
25235 If __GNUC__ and YYPARSE_PARAM are both defined,
25236 declare yyparse to have a void * argument.
25237
252381996-12-17 Richard Stallman <rms@gnu.org>
25239
25240 * src/reduce.c (nbits): Add some casts.
25241
252421996-08-12 Richard Stallman <rms@gnu.org>
25243
25244 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
25245
252461996-08-12 Richard Stallman <rms@gnu.org>
25247
25248 * bison.simple: Test _MSDOS as well as _MSDOS_.
25249
252501996-07-31 Richard Stallman <rms@gnu.org>
25251
25252 * src/bison.s1:
25253 [__sun && __i386]: Include alloca.h.
25254
252551996-07-31 Richard Stallman <rms@gnu.org>
25256
25257 * bison.simple:
25258 [__sun && __i386]: Include alloca.h.
25259
252601996-07-30 Richard Stallman <rms@gnu.org>
25261
25262 * src/bison.s1: Comment change.
25263
25264 * src/bison.s1: Test _MSDOS_, not MSDOS.
25265
252661996-07-30 Richard Stallman <rms@gnu.org>
25267
25268 * bison.simple: Comment change.
25269
25270 * bison.simple: Test _MSDOS_, not MSDOS.
25271
252721996-06-01 Richard Stallman <rms@gnu.org>
25273
25274 * 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:
25275 Insert `_' macro around many string constants.
25276
25277 * src/main.c:
25278 Insert `_' macro around many string constants.
25279
25280 (main): Call setlocale, bindtextdomain and textdomain.
25281
25282 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
25283 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
25284 [ENABLE_NLS]: Include libintl.h.
25285 [ENABLE_NLS] (gettext): Define.
25286 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
25287 (N_, PACKAGE, LOCALEDIR): New macros.
25288
252891996-06-01 Richard Stallman <rms@gnu.org>
25290
25291 * POTFILES.in: New file.
25292
25293 * Makefile.in (allocate.o):
25294 Define target explicitly.
25295
25296 * Makefile.in (CFLAGS): Set to @CFLAGS@.
25297 (LDFLAGS): Set to @LDFLAGS@.
25298 (configure): Run autoconf only if preceding `cd' succeeds.
25299 (bison.s1): Redirect output to temporary file then move the
25300 temporary to the target, rather than redirecting directly to bison.s1.
25301 (clean): Remove config.status and config.log.
25302 (distclean): Don't remove config.status here.
25303
253041996-05-12 Richard Stallman <rms@gnu.org>
25305
25306 * src/bison.s1:
25307 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25308
253091996-05-12 Richard Stallman <rms@gnu.org>
25310
25311 * bison.simple:
25312 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25313
253141996-05-11 Richard Stallman <rms@gnu.org>
25315
25316 * src/bison.s1 (__yy_memcpy):
25317 Really reorder the args, as was supposedly done on Feb 14 1995.
25318 (yyparse): Calls changed accordingly.
25319
253201996-05-11 Richard Stallman <rms@gnu.org>
25321
25322 * Makefile.in (dist): Don't use $(srcdir).
25323
25324 * bison.simple (__yy_memcpy):
25325 Really reorder the args, as was supposedly done on Feb 14 1995.
25326 (yyparse): Calls changed accordingly.
25327
253281996-01-27 Richard Stallman <rms@gnu.org>
25329
25330 * src/output.c (output_rule_data):
25331 Test YYERROR_VERBOSE in the conditional
25332 around the definition of ttyname.
25333
253341995-12-29 Richard Stallman <rms@gnu.org>
25335
25336 * src/bison.s1:
25337 Fix line numbers in #line commands.
25338
253391995-12-29 Richard Stallman <rms@gnu.org>
25340
25341 * bison.simple:
25342 Fix line numbers in #line commands.
25343
253441995-12-27 Richard Stallman <rms@gnu.org>
25345
25346 * src/bison.s1 (YYPARSE_PARAM_DECL):
25347 In C++, make it always null.
25348 (YYPARSE_PARAM_ARG): New macro.
25349 (yyparse): Use YYPARSE_PARAM_ARG.
25350
253511995-12-27 Richard Stallman <rms@gnu.org>
25352
25353 * bison.simple (YYPARSE_PARAM_DECL):
25354 In C++, make it always null.
25355 (YYPARSE_PARAM_ARG): New macro.
25356 (yyparse): Use YYPARSE_PARAM_ARG.
25357
253581995-11-29 Richard Stallman <rms@gnu.org>
25359
25360 * doc/bison.texinfo:
25361 Describe literal string tokens, %raw, %no_lines, %token_table.
25362
253631995-11-29 Daniel Hagerty <hag@gnu.org>
25364
25365 * doc/bison.texinfo: Fixed update date
25366
253671995-10-16 Richard Stallman <rms@gnu.org>
25368
25369 * src/version.c: Version 1.25.
25370
253711995-10-16 Richard Stallman <rms@gnu.org>
25372
25373 * NEWS: *** empty log message ***
25374
253751995-10-16 Richard Stallman <rms@gnu.org>
25376
25377 * doc/bison.1, doc/bison.rnh:
25378 Add new options.
25379
253801995-10-15 Richard Stallman <rms@gnu.org>
25381
25382 * src/vmsgetargs.c, src/getargs.c:
25383 Added -n, -k, and -raw switches.
25384 (noparserflag, toknumflag, rawtoknumflag): New variables.
25385
25386 * src/symtab.h (SALIAS):
25387 New #define for adding aliases to %token.
25388 (struct bucket): Added `alias' field.
25389
25390 * src/reduce.c (reduce_grammar):
25391 Revise error message.
25392 (print_notices): Remove final `.' from error message.
25393
25394 * src/reader.c (reader_output_yylsp):
25395 New function.
25396 (readgram): Use `#if 0' around code that accepted %command
25397 inside grammar rules: The documentation doesn't allow it,
25398 and it will fail since the %command processors scan for the next %.
25399 (parse_token_decl): Extended the %token
25400 declaration to allow a multi-character symbol as an alias.
25401 (parse_thong_decl): New function.
25402 (read_declarations): Added %thong declarations.
25403 (read_declarations): Handle NOOP to deal with allowing
25404 % declarations as another means to specify the flags.
25405 (readgram): Allow %prec prior to semantics embedded in a rule.
25406 (skip_to_char, read_declarations, copy_definition)
25407 (parse_token_decl, parse_start_decl, parse_type_decl)
25408 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
25409 (get_type_name, copy_guard, copy_action, readgram)
25410 (get_type, packsymbols): Revised most error messages.
25411 Changed `fatal' to `warnxxx' to avoid aborting for error.
25412 Revised and use multiple warnxxx functions to avoid using VARARGS1.
25413 (read_declarations): Improve the error message for
25414 an invalid character. Do not abort.
25415 (read_declarations, copy_guard, copy_action): Use
25416 printable_version to avoid unprintable characters in printed output.
25417 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
25418 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
25419 Allow the type of a non-terminal can be given
25420 more than once, as long as all specifications give the same type.
25421
25422 * src/output.c:
25423 (output_headers, output_trailers, output, output_gram)
25424 (output_rule_data): Implement noparserflag variable.
25425 Implement toknumflag variable.
25426 (output): Call reader_output_yylsp to output LTYPESTR.
25427
25428 * src/main.c (main):
25429 If reader sees an error, don't process the grammar.
25430 (fatals): Updated to not use VARARGS1.
25431 (printable_version, int_to_string, warn, warni, warns, warnss)
25432 (warnsss): New error reporting functions. Avoid abort for error.
25433
25434 * src/lex.h:
25435 Added THONG and NOOP for alias processing.
25436 Added SETOPT for the new code that allows setting options with %flags.
25437
25438 * src/lex.c:
25439 Include getopt.h. Add some extern decls.
25440 (safegetc): New function to deal with EOF gracefully.
25441 (literalchar); new function to deal with reading \ escapes.
25442 (lex): Use literalchar.
25443 (lex): Implemented "..." tokens.
25444 (literalchar, lex, parse_percent_token): Made tokenbuffer
25445 always contain the token. This includes growing the token
25446 buffer while reading an integer.
25447 (parse_percent_token): Replaced if-else statement with percent_table.
25448 (parse_percent_token): Added % declarations as another
25449 way to specify the flags -n, -l, and -r. Also added hooks for
25450 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
25451 major changes to files.c.
25452 (lex) Retain in the incoming stream a character following
25453 an incorrect '/'.
25454 (skip_white_space, lex): Revised most error messages
25455 and changed fatal to warn to avoid aborting.
25456 (percent_table): Added %thong declarations.
25457
25458 * src/gram.h: Comment changes.
25459
25460 * src/files.c (openfiles, open_extra_files, done):
25461 Add faction flag
25462 and actfile file. Handle noparserflag. Both for -n switch.
25463
25464 * src/conflicts.c (resolve_sr_conflict):
25465 Remove use of alloca.
25466
254671995-06-01 Jim Meyering <meyering@gnu.org>
25468
25469 * doc/bison.texinfo: *** empty log message ***
25470
254711995-05-06 Richard Stallman <rms@gnu.org>
25472
25473 * src/bison.s1: Comment change.
25474
254751995-05-06 Richard Stallman <rms@gnu.org>
25476
25477 * bison.simple: Comment change.
25478
254791995-05-03 Richard Stallman <rms@gnu.org>
25480
25481 * src/version.c: Version now 1.24.
25482
25483 * src/bison.s1: Change distribution terms.
25484
25485 * src/version.c: Version now 1.23.
25486
254871995-05-03 Richard Stallman <rms@gnu.org>
25488
25489 * doc/bison.texinfo:
25490 Rewrite "Conditions for Using Bison".
25491 Update version to 1.24.
25492
254931995-05-03 Richard Stallman <rms@gnu.org>
25494
25495 * bison.simple: Change distribution terms.
25496
254971995-02-23 Richard Stallman <rms@gnu.org>
25498
25499 * src/files.c: Test __VMS_POSIX as well as VMS.
25500
255011995-02-14 Jim Meyering <meyering@gnu.org>
25502
25503 * src/bison.s1 (__yy_memcpy):
25504 Renamed from __yy_bcopy to avoid
25505 confusion. Reverse FROM and TO arguments to be consistent with
25506 those of memcpy.
25507
255081995-02-14 Jim Meyering <meyering@gnu.org>
25509
25510 * bison.simple (__yy_memcpy):
25511 Renamed from __yy_bcopy to avoid
25512 confusion. Reverse FROM and TO arguments to be consistent with
25513 those of memcpy.
25514
255151994-11-10 David J. MacKenzie <djm@gnu.org>
25516
25517 * NEWS: reformat
25518
25519 * NEWS: New file.
25520
25521 * Makefile.in (DISTFILES): Include NEWS.
25522
25523 * Makefile.in (DISTFILES):
25524 Include install-sh, not install.sh.
25525
25526 * configure.in: Update to Autoconf v2 macro names.
25527
255281994-10-05 David J. MacKenzie <djm@gnu.org>
25529
25530 * Makefile.in: fix typo
25531
25532 * Makefile.in (prefix, exec_prefix):
25533 Let configure set them.
25534
255351994-09-28 David J. MacKenzie <djm@gnu.org>
25536
25537 * Makefile.in: Set datadir to $(prefix)/share.
25538
255391994-09-15 Richard Stallman <rms@gnu.org>
25540
25541 * src/bison.s1:
25542 Update copyright notice and GPL version.
25543
255441994-09-15 Richard Stallman <rms@gnu.org>
25545
25546 * bison.simple:
25547 Update copyright notice and GPL version.
25548
255491994-07-12 Richard Stallman <rms@gnu.org>
25550
25551 * src/reduce.c, src/reader.c:
25552 entered into RCS
25553
255541994-05-05 David J. MacKenzie <djm@gnu.org>
25555
25556 * Makefile.in: entered into RCS
25557
255581994-03-26 Richard Stallman <rms@gnu.org>
25559
25560 * src/bison.s1: entered into RCS
25561
255621994-03-26 Richard Stallman <rms@gnu.org>
25563
25564 * bison.simple: entered into RCS
25565
255661994-03-25 Richard Stallman <rms@gnu.org>
25567
25568 * src/main.c: entered into RCS
25569
255701994-03-24 Richard Stallman <rms@gnu.org>
25571
25572 * src/conflicts.c: entered into RCS
25573
255741994-01-02 Richard Stallman <rms@gnu.org>
25575
25576 * Makefile.in: *** empty log message ***
25577
255781993-11-21 Richard Stallman <rms@gnu.org>
25579
25580 * src/bison.s1: *** empty log message ***
25581
255821993-11-21 Richard Stallman <rms@gnu.org>
25583
25584 * doc/bison.texinfo: entered into RCS
25585
25586 * doc/bison.texinfo: *** empty log message ***
25587
255881993-11-21 Richard Stallman <rms@gnu.org>
25589
25590 * bison.simple: *** empty log message ***
25591
255921993-10-25 David J. MacKenzie <djm@gnu.org>
25593
25594 * doc/bison.texinfo: *** empty log message ***
25595
255961993-10-19 Richard Stallman <rms@gnu.org>
25597
25598 * src/bison.s1: *** empty log message ***
25599
256001993-10-19 Richard Stallman <rms@gnu.org>
25601
25602 * bison.simple: *** empty log message ***
25603
256041993-10-14 Richard Stallman <rms@gnu.org>
25605
25606 * src/bison.s1: *** empty log message ***
25607
256081993-10-14 Richard Stallman <rms@gnu.org>
25609
25610 * bison.simple: *** empty log message ***
25611
256121993-09-14 David J. MacKenzie <djm@gnu.org>
25613
25614 * doc/bison.texinfo: *** empty log message ***
25615
256161993-09-13 Noah Friedman <friedman@gnu.org>
25617
25618 * Makefile.in: *** empty log message ***
25619
256201993-09-10 Richard Stallman <rms@gnu.org>
25621
25622 * src/conflicts.c: *** empty log message ***
25623
25624 * src/system.h: entered into RCS
25625
256261993-09-10 Richard Stallman <rms@gnu.org>
25627
25628 * doc/bison.1: entered into RCS
25629
256301993-09-06 Noah Friedman <friedman@gnu.org>
25631
25632 * src/version.c: entered into RCS
25633
256341993-09-06 Noah Friedman <friedman@gnu.org>
25635
25636 * Makefile.in: *** empty log message ***
25637
256381993-07-30 David J. MacKenzie <djm@gnu.org>
25639
25640 * Makefile.in: *** empty log message ***
25641
256421993-07-24 Richard Stallman <rms@gnu.org>
25643
25644 * src/bison.s1: *** empty log message ***
25645
256461993-07-24 Richard Stallman <rms@gnu.org>
25647
25648 * bison.simple: *** empty log message ***
25649
256501993-07-08 David J. MacKenzie <djm@gnu.org>
25651
25652 * Makefile.in: *** empty log message ***
25653
256541993-07-04 Richard Stallman <rms@gnu.org>
25655
25656 * src/bison.s1: *** empty log message ***
25657
256581993-07-04 Richard Stallman <rms@gnu.org>
25659
25660 * bison.simple: *** empty log message ***
25661
256621993-06-26 David J. MacKenzie <djm@gnu.org>
25663
25664 * src/getargs.c: entered into RCS
25665
256661993-06-26 David J. MacKenzie <djm@gnu.org>
25667
25668 * doc/bison.texinfo: *** empty log message ***
25669
25670 * doc/bison.1: New file.
25671
256721993-06-25 Richard Stallman <rms@gnu.org>
25673
25674 * src/getargs.c: New file.
25675
256761993-06-16 Richard Stallman <rms@gnu.org>
25677
25678 * src/bison.s1: *** empty log message ***
25679
256801993-06-16 Richard Stallman <rms@gnu.org>
25681
25682 * bison.simple: *** empty log message ***
25683
256841993-06-03 Richard Stallman <rms@gnu.org>
25685
25686 * src/bison.s1: New file.
25687
256881993-06-03 Richard Stallman <rms@gnu.org>
25689
25690 * doc/bison.texinfo: *** empty log message ***
25691
256921993-06-03 Richard Stallman <rms@gnu.org>
25693
25694 * bison.simple: New file.
25695
256961993-05-19 Richard Stallman <rms@gnu.org>
25697
25698 * doc/bison.texinfo: New file.
25699
257001993-05-07 Noah Friedman <friedman@gnu.org>
25701
25702 * Makefile.in: *** empty log message ***
25703
257041993-04-28 Noah Friedman <friedman@gnu.org>
25705
25706 * src/reader.c: *** empty log message ***
25707
257081993-04-23 Noah Friedman <friedman@gnu.org>
25709
25710 * src/alloc.h: entered into RCS
25711
257121993-04-20 David J. MacKenzie <djm@gnu.org>
25713
25714 * src/version.c: *** empty log message ***
25715
25716 * src/files.c, src/allocate.c:
25717 entered into RCS
25718
25719 * src/reader.c: *** empty log message ***
25720
25721 * src/lex.c: entered into RCS
25722
25723 * src/conflicts.c: New file.
25724
25725 * src/symtab.c: entered into RCS
25726
25727 * src/alloc.h: New file.
25728
25729 * src/LR0.c: entered into RCS
25730
257311993-04-18 Noah Friedman <friedman@gnu.org>
25732
25733 * src/reader.c: New file.
25734
25735 * src/version.c: *** empty log message ***
25736
257371993-04-18 Noah Friedman <friedman@gnu.org>
25738
25739 * Makefile.in: *** empty log message ***
25740
257411993-04-17 Noah Friedman <friedman@gnu.org>
25742
25743 * Makefile.in: *** empty log message ***
25744
257451993-04-15 Richard Stallman <rms@gnu.org>
25746
25747 * src/main.c, src/files.c:
25748 New file.
25749
257501993-04-15 Noah Friedman <friedman@gnu.org>
25751
25752 * configure.in: entered into RCS
25753
25754 * configure.in: *** empty log message ***
25755
25756 * configure.in: New file.
25757
257581993-04-14 Richard Stallman <rms@gnu.org>
25759
25760 * Makefile.in: New file.
25761
257621993-04-13 Richard Stallman <rms@gnu.org>
25763
25764 * src/version.c: New file.
25765
257661993-03-25 Richard Stallman <rms@gnu.org>
25767
25768 * src/output.c: entered into RCS
25769
257701992-09-25 Richard Stallman <rms@gnu.org>
25771
25772 * configure.bat: entered into RCS
25773
257741992-06-22 Richard Stallman <rms@gnu.org>
25775
25776 * src/vmsgetargs.c: entered into RCS
25777
257781992-06-22 Richard Stallman <rms@gnu.org>
25779
25780 * doc/bison.rnh: entered into RCS
25781
257821992-04-20 David J. MacKenzie <djm@gnu.org>
25783
25784 * README: entered into RCS
25785
257861992-01-22 Richard Stallman <rms@gnu.org>
25787
25788 * src/machine.h: entered into RCS
25789
257901991-12-21 Richard Stallman <rms@gnu.org>
25791
25792 * src/lalr.c, src/closure.c:
25793 entered into RCS
25794
257951991-12-20 Richard Stallman <rms@gnu.org>
25796
25797 * src/state.h: entered into RCS
25798
257991991-12-18 Richard Stallman <rms@gnu.org>
25800
25801 * src/print.c, src/nullable.c, src/derives.c:
25802 entered into RCS
25803
258041991-11-03 David J. MacKenzie <djm@gnu.org>
25805
25806 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
25807 entered into RCS
25808
258091988-09-09 Richard Stallman <rms@gnu.org>
25810
25811 * src/bison.hairy: entered into RCS
25812
258131987-12-16 Richard Stallman <rms@gnu.org>
25814
25815 * REFERENCES: entered into RCS
dc546b0f 25816
f294a2c2 25817
04098407 25818 -----
f294a2c2 25819
7d424de1
PE
25820 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
25821 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
25822 2008, 2009, 2010 Free Software Foundation, Inc.
f294a2c2 25823
04098407
PE
25824 Copying and distribution of this file, with or without
25825 modification, are permitted provided the copyright notice and this
25826 notice are preserved.